4 * Handling and dispatching events
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 /*----- Required headers --------------------------------------------------*/
38 typedef struct menu__menustr *menu;
39 typedef menu (*event_menu_maker)(void *handle);
40 typedef void (*event_menu_proc)(void *handle,char* hit);
44 /*----- Type definitions --------------------------------------------------*/
55 typedef void (*event_midbhandler)(wimp_w w,
61 /*----- Exported functions ------------------------------------------------*/
63 void event__process(void);
64 void event_process(void);
65 #define event_process(x) dbox__eventProcess()
67 event_menuPurpose event_whyMenuEvent(void);
68 void event_returnMenuHelp(BOOL doit);
71 * BOOL event_attachMidbHandler(wimp_w w,
72 * event_midbhandler proc,
79 * Registers a function to be called by event when a menu button event is
80 * received by a particular window. Typically, this handler will display a
81 * menu at the mouse coordinates, although you can do anything you want.
83 * You shouldn't need to call this function very much. It's really for
84 * allowing other systems to supply menu attachment functions like event_-
88 * wimp_w == the window to which to attach the function
89 * event_midbhandler proc == the function to call when a menu button event
90 * is received for the window
91 * others == arguments to be passed (unprocessed) to proc when it's called.
94 * TRUE if the attachment succeeded.
97 BOOL event_attachMidbHandler(wimp_w w,
98 event_midbhandler proc,
104 void event_attachedMenu(wimp_w w,
106 event_menu_maker *mk,
107 event_menu_proc *proc,
111 * void event_openMenu(menu it,event_menu_proc proc,void *handle)
112 * void event_makeMenu(event_menu_maker it,event_menu_proc proc,void *handle)
113 * void event_openIconbarMenu(...)
114 * void event_makeIconbarMenu(...)
117 * Opens a menu onto the screen and tells your routine when it's finished.
120 * menu it == the menu or menu maker procedure
121 * event_menu_proc proc == the menu handler function
122 * void *handle == it's jolly old handle
125 void event_openMenu(menu it,event_menu_proc proc,void *handle);
126 void event_makeMenu(event_menu_maker maker,
127 event_menu_proc proc,
129 void event_openIconbarMenu(menu it,event_menu_proc proc,void *handle);
130 void event_makeIconbarMenu(event_menu_maker maker,
131 event_menu_proc proc,
135 * void event_attachmenu(wimp_w w,menu m,event_menu_proc p,void *handle)
138 * Attaches a menu to a window so that it opens when you click menu on it.
141 * wimp_w w == the window to attach to
142 * menu m == the menu to attach to it
143 * event_menu_proc p == what to do when a menu item is chosen
144 * void *handle == something else to send to p
147 BOOL event_attachmenu(wimp_w w,menu m,event_menu_proc p,void *handle);
150 * void event_attachmenumaker(wimp_w w,
151 * event_menu_maker m,
156 * Attaches a menu to a window so that it opens when you click menu on it.
159 * wimp_w w == the window to attach to
160 * event_menu_maker m == how to create the menu
161 * event_menu_proc p == what to do when a menu item is chosen
162 * void *handle == something else to send to p
165 BOOL event_attachmenumaker(wimp_w w,
170 BOOL event_anywindows(void);
172 BOOL event_is_menu_being_recreated(void);
174 void event_clear_current_menu(void);
176 void event_setmask (wimp_emask mask);
178 wimp_emask event_getmask (void);