5 #include "render/render.h"
13 typedef void(*menu_controller_show
)(struct Menu
*self
, int x
, int y
, Client
*);
14 typedef void(*menu_controller_update
)(struct Menu
*self
);
15 typedef void(*menu_controller_mouseover
)(struct MenuEntry
*self
,
31 struct Menu
*open_submenu
;
33 /* place a menu on screen */
34 menu_controller_show show
;
35 void (*hide
)( /* some bummu */);
38 menu_controller_update update
;
39 menu_controller_mouseover mouseover
;
40 void (*selected
)( /* some bummu */);
48 int title_min_w
, title_h
;
61 typedef enum MenuEntryRenderType
{
62 MenuEntryRenderType_None
= 0,
63 MenuEntryRenderType_Submenu
= 1 << 0,
64 MenuEntryRenderType_Boolean
= 1 << 1,
65 MenuEntryRenderType_Separator
= 1 << 2,
67 MenuEntryRenderType_Other
= 1 << 7
68 } MenuEntryRenderType
;
76 MenuEntryRenderType render_type
;
79 gboolean boolean_value
;
86 Appearance
*a_disabled
;
95 #define menu_new(l, n, p) \
96 menu_new_full(l, n, p, NULL, NULL)
98 Menu
*menu_new_full(char *label
, char *name
, Menu
*parent
,
99 menu_controller_show show
, menu_controller_update update
);
100 void menu_free(char *name
);
102 void menu_show(char *name
, int x
, int y
, Client
*client
);
103 void menu_show_full(Menu
*menu
, int x
, int y
, Client
*client
);
105 void menu_hide(Menu
*self
);
107 void menu_clear(Menu
*self
);
109 MenuEntry
*menu_entry_new_full(char *label
, Action
*action
,
110 MenuEntryRenderType render_type
,
113 #define menu_entry_new(label, action) \
114 menu_entry_new_full(label, action, MenuEntryRenderType_None, NULL)
116 #define menu_entry_new_separator(label) \
117 menu_entry_new_full(label, NULL, MenuEntryRenderType_Separator, NULL)
119 #define menu_entry_new_submenu(label, submenu) \
120 menu_entry_new_full(label, NULL, MenuEntryRenderType_Submenu, submenu)
122 #define menu_entry_new_boolean(label, action) \
123 menu_entry_new_full(label, action, MenuEntryRenderType_Boolean, NULL)
125 void menu_entry_free(MenuEntry
*entry
);
127 void menu_entry_set_submenu(MenuEntry
*entry
, Menu
*submenu
);
129 void menu_add_entry(Menu
*menu
, MenuEntry
*entry
);
131 MenuEntry
*menu_find_entry(Menu
*menu
, Window win
);
133 void menu_entry_render(MenuEntry
*self
);
135 void menu_entry_fire(MenuEntry
*self
);
137 void menu_render(Menu
*self
);
139 void menu_control_mouseover(MenuEntry
*entry
, gboolean enter
);