notification system (from user input to application basically)

This commit is contained in:
Cedric Roux
2016-04-29 15:51:44 +02:00
parent e742718c2d
commit f2195ba4e3
4 changed files with 160 additions and 1 deletions
+24
View File
@@ -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_ */