5 #include "render/render.h"
9 extern GHashTable *menu_map;
13 typedef void(*menu_controller_show)(struct Menu *self, int x, int y, Client *);
14 typedef void(*menu_controller_update)(struct Menu *self);
27 /* place a menu on screen */
28 menu_controller_show show;
29 void (*hide)( /* some bummu */);
32 menu_controller_update update;
33 void (*mouseover)( /* some bummu */);
34 void (*selected)( /* some bummu */);
42 int title_min_w, title_h;
50 typedef enum MenuEntryRenderType {
51 MenuEntryRenderType_None = 0,
52 MenuEntryRenderType_Submenu = 1 << 0,
53 MenuEntryRenderType_Boolean = 1 << 1,
54 MenuEntryRenderType_Separator = 1 << 2,
56 MenuEntryRenderType_Other = 1 << 7
57 } MenuEntryRenderType;
65 MenuEntryRenderType render_type;
68 gboolean boolean_value;
75 Appearance *a_disabled;
84 #define menu_new(l, n, p) \
85 menu_new_full(l, n, p, NULL, NULL)
87 Menu *menu_new_full(char *label, char *name, Menu *parent,
88 menu_controller_show show, menu_controller_update update);
89 void menu_free(char *name);
91 void menu_show(char *name, int x, int y, Client *client);
92 void menu_hide(Menu *self);
94 MenuEntry *menu_entry_new_full(char *label, Action *action,
95 MenuEntryRenderType render_type,
98 #define menu_entry_new(label, action) \
99 menu_entry_new_full(label, action, MenuEntryRenderType_None, NULL)
101 void menu_entry_free(MenuEntry *entry);
103 void menu_entry_set_submenu(MenuEntry *entry, Menu *submenu);
105 void menu_add_entry(Menu *menu, MenuEntry *entry);
107 MenuEntry *menu_find_entry(Menu *menu, Window win);
109 void menu_entry_render(MenuEntry *self);
111 void menu_entry_fire(MenuEntry *self);
113 void menu_render(Menu *self);