4 * Interface to WIMP SWIs
6 * © 1994-1998 Straylight
9 /*----- Licensing note ----------------------------------------------------*
11 * This file is part of Straylight's Steel library.
13 * Steel is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
18 * Steel is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with Steel. If not, write to the Free Software Foundation,
25 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #ifndef __wimpstruct_h
32 #include "wimpstruct.h"
35 /*----- Notes -------------------------------------------------------------*
37 * This file defines functions callable from C programs to allow access to
38 * the WIMP at the SWI level.
40 * Each function maps directly to a single WIMP SWI, and performs little
41 * or no additional processing. For full information about each one,
42 * you should consult the RISC OS 3 Programmer's Reference Manual.
43 * Little or no documentation is provided for each function.
45 * Two SWIs are not supported currently:
47 * Wimp_ClaimFreeMemory -- since the memory is only usable in SVC mode,
48 * it doesn't seem to be very useful to be able to claim it from C.
50 * Wimp_SetColourMapping -- this call is only useful for specialised
51 * applications, and a veneer defined here isn't really appropriate.
54 /*----- Polling the WIMP --------------------------------------------------*
56 * The two functions wimp_poll and wimp_pollidle map to SWIs Wimp_Poll and
57 * Wimp_PollIdle respectively. The other two functions control the saving
58 * or not of the floating point status -- the default is to save this
59 * status (although this is not performed if the FPEmulator is not present).
61 * Correct handling of the DLL Application Handle is also performed.
64 os_error *wimp_poll(wimp_emask mask,wimp_eventstr *e);
65 os_error *wimp_pollidle(wimp_emask mask,wimp_eventstr *e,int time);
67 void wimp_corrupt_fp_state_on_poll(void);
68 void wimp_save_fp_state_on_poll(void);
70 /*----- Initialising the WIMP ---------------------------------------------*
72 * wimp_initialise should only be used if you don't want a multitasking
73 * application -- not very useful, really. wimp_taskinit will perform all
74 * the initialisation a full multitasking application requires. If you
75 * initialise with a version number of 300 or higher, the optional messages
76 * argument should be filled in with a pointer to an array of message
80 os_error *wimp_initialise(int *version);
81 os_error *wimp_taskinit(char *name,
83 wimp_t *taskhandle,...
86 /*----- Closing down the WIMP ---------------------------------------------*/
88 os_error *wimp_closedown(void);
89 os_error *wimp_taskclose(wimp_t taskhandle);
91 /*----- Creating and deleting windows and icons ---------------------------*/
93 os_error *wimp_create_wind(wimp_wind *w,wimp_w *handle);
94 os_error *wimp_delete_wind(wimp_w w);
95 os_error *wimp_create_icon(wimp_icreate *i,wimp_i *handle);
96 os_error *wimp_delete_icon(wimp_w w,wimp_i i);
98 /*----- Getting and changing window and icon states -----------------------*/
100 os_error *wimp_open_wind(wimp_openstr *o);
101 os_error *wimp_close_wind(wimp_w w);
102 os_error *wimp_set_extent(wimp_redrawstr *r);
103 os_error *wimp_get_wind_state(wimp_w w,wimp_wstate *s);
104 os_error *wimp_get_wind_info(wimp_winfo *w);
105 os_error *wimp_get_icon_info(wimp_w w,wimp_i i,wimp_icon *icn);
106 os_error *wimp_set_icon_state(wimp_w w,wimp_i i,int eorMask,int bicMask);
107 os_error *wimp_which_icon(wimp_which_block *w,wimp_i *icons);
108 os_error *wimp_getwindowoutline(wimp_redrawstr *r);
110 /*----- Redrawing windows -------------------------------------------------*/
112 os_error *wimp_redraw_wind(wimp_redrawstr *r,BOOL *more);
113 os_error *wimp_update_wind(wimp_redrawstr *r,BOOL *more);
114 os_error *wimp_get_rectangle(wimp_redrawstr *r,BOOL *more);
115 os_error *wimp_force_redraw(wimp_redrawstr *r);
116 os_error *wimp_ploticon(wimp_icon *i);
117 os_error *wimp_blockcopy(wimp_w w,wimp_box *box,int x,int y);
119 /*----- Menu handling -----------------------------------------------------*/
121 os_error *wimp_create_menu(wimp_menustr *m,int x,int y);
122 os_error *wimp_create_submenu(wimp_menustr *m,int x,int y);
123 os_error *wimp_decode_menu(wimp_menustr *m,void *hits,void *stringbuffer);
124 os_error *wimp_getmenustate(int action,
129 /*----- Colour handling ---------------------------------------------------*/
131 os_error *wimp_setcolour(int colour);
132 os_error *wimp_textcolour(int colour);
133 os_error *wimp_setfontcolours(int background,int foreground);
134 os_error *wimp_setpalette(wimp_palettestr *pal);
135 os_error *wimp_readpalette(wimp_palettestr *pal);
137 /*----- Sprite handling ---------------------------------------------------*/
139 os_error *wimp_spriteop(int action,char *sprite);
140 os_error *wimp_spriteop_full(os_regset r);
141 void *wimp_baseofsprites(void);
142 os_error *wimp_readpixtrans(sprite_area *sa,
144 sprite_factors *zoomage,
145 sprite_pixtrans *pixtrans);
147 /*----- Message handling --------------------------------------------------*/
149 os_error *wimp_sendmessage(wimp_etype event,wimp_msgstr *m,wimp_t dest);
150 os_error *wimp_sendwmessage(wimp_etype event,
154 os_error *wimp_addmessages(wimp_msgaction *messages);
155 os_error *wimp_removemessages(wimp_msgaction *messages);
157 /*----- Pointer handling --------------------------------------------------*/
159 os_error *wimp_get_point_info(wimp_mousestr *m);
160 os_error *wimp_set_point_shape(wimp_pshapestr *shapeinfo);
162 /*----- Caret and key handling --------------------------------------------*
164 * Warning: Don't pass STEEL extended keyset keys on with wimp_processkey!
165 * Only use standard WIMP key mapping codes.
168 os_error *wimp_set_caret_pos(wimp_caretstr *c);
169 os_error *wimp_get_caret_pos(wimp_caretstr *c);
170 os_error *wimp_processkey(int key);
172 /*----- Handing template files --------------------------------------------*/
174 os_error *wimp_open_template(char *filename);
175 os_error *wimp_close_template(void);
176 os_error *wimp_load_template(wimp_template *loadinfo);
178 /*----- Miscellaneous calls -----------------------------------------------*
180 * Warning: Use _dll_starttask instead of wimp_starttask if you are using
181 * a dynamically linked STEEL.
184 os_error *wimp_drag_box(wimp_dragstr *d);
185 os_error *wimp_starttask(char *command);
186 os_error *wimp_reporterror(os_error *error,wimp_errflags how,char *appname);
187 os_error *wimp_setmode(int newmode);
188 os_error *wimp_slotsize(int *current,int *next,int *free);
189 os_error *wimp_commandwindow(wimp_commandwind *dowhat);
190 os_error *wimp_transferblock(wimp_t sourceTask,
192 wimp_t destinationTask,
193 char *destinationBuffer,
195 os_error *wimp_readsysinfo(wimp_sysinfo info,
199 /*----- The end -----------------------------------------------------------*/