notification system (from user input to application basically)
This commit is contained in:
@@ -143,6 +143,24 @@ struct repack_event {
|
||||
int id;
|
||||
};
|
||||
|
||||
/*************************************************************************/
|
||||
/* notifications */
|
||||
/*************************************************************************/
|
||||
|
||||
/* same type as in gui.h */
|
||||
typedef void (*notifier)(void *private, gui *g,
|
||||
char *notification, widget *w, void *notification_data);
|
||||
|
||||
struct notifier {
|
||||
notifier handler;
|
||||
unsigned long id;
|
||||
char *notification;
|
||||
widget *w;
|
||||
void *private;
|
||||
/* done is used bu gui_notify */
|
||||
int done;
|
||||
};
|
||||
|
||||
/*************************************************************************/
|
||||
/* main structure */
|
||||
/*************************************************************************/
|
||||
@@ -161,6 +179,9 @@ struct gui {
|
||||
void *xwin; /* set by a toplevel_window when
|
||||
* it paints itself, to be used
|
||||
* by its children */
|
||||
struct notifier *notifiers;
|
||||
int notifiers_count;
|
||||
unsigned long next_notifier_id;
|
||||
};
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -178,4 +199,7 @@ void gui_events(gui *gui);
|
||||
|
||||
struct widget *find_widget(struct gui *g, int id);
|
||||
|
||||
void gui_notify(struct gui *g, char *notification, widget *w,
|
||||
void *notification_data);
|
||||
|
||||
#endif /* _GUI_DEFS_H_ */
|
||||
|
||||
Reference in New Issue
Block a user