diff options
| author | Scott Moynes <smoynes@nexus.carleton.ca> | 2003-04-22 03:48:34 +0000 |
|---|---|---|
| committer | Scott Moynes <smoynes@nexus.carleton.ca> | 2003-04-22 03:48:34 +0000 |
| commit | 574dd66b326bb3c5893b6bf6bfe7307229def653 (patch) | |
| tree | 73633a0950c3f5cb3aa1f2c0490d5518584fd511 /openbox/menu.h | |
| parent | 6a237b91bcbc2c25f2bf8d368535430ba6a1bf26 (diff) | |
More menu changes to facilitate plugins.
Diffstat (limited to 'openbox/menu.h')
| -rw-r--r-- | openbox/menu.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/openbox/menu.h b/openbox/menu.h index 1c1b31d9..1a3f002a 100644 --- a/openbox/menu.h +++ b/openbox/menu.h @@ -8,23 +8,28 @@ extern GHashTable *menu_map; +struct Menu; + +typedef void(*menu_controller_show)(struct Menu *self, int x, int y, Client *); +typedef void(*menu_controller_update)(struct Menu *self); + typedef struct Menu { char *label; char *name; GList *entries; - /* GList *tail; */ - /* ? */ gboolean shown; gboolean invalid; struct Menu *parent; - /* waste o' pointers */ - void (*show)( /* some bummu */); + /* place a menu on screen */ + menu_controller_show show; void (*hide)( /* some bummu */); - void (*update)( /* some bummu */); + + /* render a menu */ + menu_controller_update update; void (*mouseover)( /* some bummu */); void (*selected)( /* some bummu */); @@ -76,7 +81,11 @@ typedef struct { void menu_startup(); void menu_shutdown(); -Menu *menu_new(char *label, char *name, Menu *parent); +#define menu_new(l, n, p) \ + menu_new_full(l, n, p, NULL, NULL) + +Menu *menu_new_full(char *label, char *name, Menu *parent, + menu_controller_show show, menu_controller_update update); void menu_free(char *name); void menu_show(char *name, int x, int y, Client *client); |
