3 * proper icon bar mangement (multiple icons, etc.)
5 * © 1992-1998 Straylight
8 /*----- Licensing note ----------------------------------------------------*
10 * This file is part of Straylight's Steel library.
12 * Steel is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2, or (at your option)
17 * Steel is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with Steel. If not, write to the Free Software Foundation,
24 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
46 /*-----------------------------------------------------
52 + only use the functions provided for manipulating your icons
56 + try and use event_attachmenu() or win_register_event_handler()
57 like you do for baricon.
58 + delete icons without these functions
60 baricon will be retained for compatibility, but it will use these
61 routines rather than going it alone.
63 -----------------------------------------------------*/
65 typedef struct ibicon__ibiconstr *ibicon;
69 ibicon_NOTHING, /* Nothing interesting. This is for use by */
70 /* ibicon, and will NOT be passed to handlers */
71 ibicon_LEFTCLICK, /* Click with left button */
72 ibicon_RIGHTCLICK, /* Click with right button */
73 ibicon_LOAD, /* Attempt to load file from disk */
74 ibicon_SAVE, /* Attempt to import file */
75 ibicon_HELP /* Request for help about the icon */
79 typedef void (*ibicon_handler)(ibicon i,ibicon_eventType e,void *handle);
80 typedef BOOL (*ibicon_rawHandler)(ibicon i,wimp_eventstr *e,void *handle);
82 /* These are places you can put your icon */
84 #define ibicon_LEFT -2 /* Show icon on left side (device) */
85 #define ibicon_RIGHT -1 /* Show icon on right side (application) */
86 #define ibicon_LEFTSEARCHLEFT -5
87 #define ibicon_LEFTSEARCHRIGHT -6
88 #define ibicon_RIGHTSEARCHLEFT -7
89 #define ibicon_RIGHTSEARCHRIGHT -8
91 /* A couple of ways of specifying odd sprite areas */
93 #define ibicon_WIMPAREA ((sprite_area *)1)
94 #define ibicon_SYSTEMAREA ((sprite_area *)0)
97 * ibicon ibicon_find(wimp_i icon)
100 * Return the ibicon handle of an icon.
103 * wimp_i icon == the icon to find
106 ibicon ibicon_find(wimp_i icon);
110 * wimp_i ibicon_syshandle(ibicon i)
113 * Returns the low-level WIMP handle for the icon concerned.
116 * ibicon i == the icon whose handle is desired
119 * The WIMP icon handle for the icon
122 wimp_i ibicon_syshandle(ibicon i);
125 * void ibicon_setPriority(int priority)
128 * Sets the priority with which to create icons under RISC OS 3.
131 * int priority == the new setting
134 void ibicon_setPriority(int priority);
137 * ibicon ibicon_create
141 * sprite_area *sprarea,
147 * Creates an icon in the icon bar. Where is up to you. Specify a
148 * sprite-only icon by passing 0 for text. Use the macros to define where
149 * and what area you want the sprite from.
152 * int where == what part of the icon bar you want to put the icon in.
153 * Macros are defined for the RISC OS 2 possibilities. Wait for the
154 * RISC OS 3 macros, or just pass a window handle.
155 * char *spritename == the name of the sprite to display
156 * sprite_area *sprarea == the area from which the sprite area comes. Use
157 * the macros provided for odd things like the WIMP area. If you have
158 * text as well, then this will be ignored anyway.
159 * char *text == the text for the icon. May be a NULL pointer, for no
161 * int maxtext == the max length the text entry can be. If 0 then the
162 * length of the text given will be used.
165 * A handle to the icon if successful, or 0 if not.
172 sprite_area *sprarea,
178 * void ibicon_changeSprite(ibicon i,char *newsprite)
181 * Chnage the sprite displayed in an icon
184 * ibicon i == the icon to change
185 * char *newsprite == the new name
188 void ibicon_changeSprite(ibicon i,char *newsprite);
191 * void ibicon_changeText(ibicon i,char *newtext)
194 * Change the text of an icon.
197 * ibicon i == the icon to change
198 * char *text == the new text to display
201 void ibicon_changeText(ibicon i,char *newtext);
204 * void ibicon_attachMenu
208 * menu_selectProc sel,
209 * menu_helpProc help,
214 * Attaches a menu to an icon in the icon bar
217 * ibicon i == the icon to attach to
218 * menu m == the menu to attach
219 * menu_selectProc sel == a handler function for the menu
220 * menu_helpProc help == a help processor for the menu
221 * void *handle == a handle passed to the handler
224 void ibicon_attachMenu
235 * void ibicon_attachMenuMaker
238 * event_menu_maker m,
239 * menu_selectProc sel,
240 * menu_helpProc help,
245 * Attaches a menu maker to an icon in the icon bar
248 * ibicon i == the icon to attach to
249 * event_menu_maker m == the menu maker to attach
250 * menu_selectProc sel == a handler function for the menu
251 * menu_helpProc help == a help processor for the menu
252 * void *handle == a handle passed to the handler
255 void ibicon_attachMenuMaker
265 * void ibicon_removeIcon(ibicon i)
268 * Removes an icon totally from the icon bar.
271 * ibicon i == the icon to vape
274 void ibicon_removeIcon(ibicon i);
277 * void ibicon_eventHandler(ibicon i,ibicon_handler p,void *handle)
280 * Attaches the handler to an icon.
283 * ibicon i == the icon to attach
284 * ibicon_handler p == the handler
285 * void *handle == a pointer to pass to the handler
288 void ibicon_eventHandler(ibicon i,ibicon_handler p,void *handle);
291 * void ibicon_rawEventHandler(ibicon i,ibicon_rawHandler p,void *handle)
294 * Attaches a raw event handler. This can 'vet' events before ibicon gets
295 * it mucky mits on them.
298 * ibicon i == the icon to attach
299 * ibicon_rawHandler p == the handler
300 * void *handle == a pointer to pass to the handler
303 void ibicon_rawEventHandler(ibicon i,ibicon_rawHandler p,void *handle);