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