]> Dogcows Code - chaz/openbox/blob - openbox/menu.h
Added some menu structure.
[chaz/openbox] / openbox / menu.h
1 #ifndef __menu_h
2 #define __menu_h
3
4 #include <glib.h>
5
6 typedef struct {
7 char *label;
8
9 GList *entries;
10 /* GList *tail; */
11
12 /* ? */
13 gboolean shown;
14 gboolean invalid;
15
16 Menu *parent;
17
18 /* waste o' pointers */
19 void (*show)( /* some bummu */);
20 void (*hide)( /* some bummu */);
21 void (*update)( /* some bummu */);
22 void (*mouseover)( /* some bummu */);
23 void (*selected)( /* some bummu */);
24 } Menu;
25
26 typedef enum MenuEntryRenderType {
27 MenuEntryRenderType_None = 0,
28 MenuEntryRenderType_Submenu 1 << 0,
29 MenuEntryRenderType_Boolean 1 << 1,
30 MenuEntryRenderType_Separator 1 << 2,
31
32 MenuEntryRenderType_Other 1 << 7
33 } MenuEntryType;
34
35
36 typedef struct {
37 char *label;
38 Menu *parent;
39
40 Action action;
41
42 MenuEntryRenderType render_type;
43 gboolean enabled;
44 gboolean boolean_value;
45 gpointer render_data;
46
47 Menu *submenu;
48 } MenuEntry;
49
50 Menu *menu_new(char *label, Menu *parent);
51 MenuEntry *menu_entry_new_full(char *label, Action *action,
52 MenuEntryRenderType render_type,
53 gpointer render_data, gpointer submenu);
54
55 #define menu_entry_new(label, action) \
56 menu_entry_new(label, action, MenuEntryRenderType_None, NULL, NULL)
57
58 void menu_entry_set_submenu(MenuEntry *entry, Menu *submenu);
59
60 void menu_add_entry(Menu *menu, MenuEntry *entry);
61 #endif
This page took 0.040703 seconds and 5 git commands to generate.