6 #include "render/render.h"
13 typedef struct _ObMenu ObMenu;
14 typedef struct _ObMenuEntry ObMenuEntry;
16 typedef void(*menu_controller_show)(ObMenu *self, int x, int y,
18 typedef void(*menu_controller_update)(ObMenu *self);
19 typedef void(*menu_controller_mouseover)(ObMenuEntry *self, gboolean enter);
21 extern GHashTable *menu_hash;
22 extern GSList *menu_visible;
40 /* place a menu on screen */
41 menu_controller_show show;
42 void (*hide)( /* some bummu */);
45 menu_controller_update update;
46 menu_controller_mouseover mouseover;
47 void (*selected)( /* some bummu */);
51 struct _ObClient *client;
54 RrAppearance *a_title;
55 gint title_min_w, title_h;
57 RrAppearance *a_items;
62 guint xin_area; /* index of the xinerama head/area */
71 OB_MENU_ENTRY_RENDER_TYPE_NONE,
72 OB_MENU_ENTRY_RENDER_TYPE_SUBMENU,
73 OB_MENU_ENTRY_RENDER_TYPE_BOOLEAN,
74 OB_MENU_ENTRY_RENDER_TYPE_SEPARATOR,
75 OB_MENU_ENTRY_RENDER_TYPE_OTHER /* XXX what is this? */
76 } ObMenuEntryRenderType;
85 ObMenuEntryRenderType render_type;
88 gboolean boolean_value;
95 RrAppearance *a_disabled;
96 RrAppearance *a_hilite;
102 void menu_shutdown();
104 #define menu_new(l, n, p) \
105 menu_new_full(l, n, p, NULL, NULL)
107 ObMenu *menu_new_full(char *label, char *name, ObMenu *parent,
108 menu_controller_show show, menu_controller_update update);
109 void menu_free(char *name);
111 void menu_show(char *name, int x, int y, struct _ObClient *client);
112 void menu_show_full(ObMenu *menu, int x, int y, struct _ObClient *client);
114 void menu_hide(ObMenu *self);
116 void menu_clear(ObMenu *self);
118 ObMenuEntry *menu_entry_new_full(char *label, Action *action,
119 ObMenuEntryRenderType render_type,
122 #define menu_entry_new(label, action) \
123 menu_entry_new_full(label, action, OB_MENU_ENTRY_RENDER_TYPE_NONE, NULL)
125 #define menu_entry_new_separator(label) \
126 menu_entry_new_full(label, NULL, OB_MENU_ENTRY_RENDER_TYPE_SEPARATOR, NULL)
128 #define menu_entry_new_submenu(label, submenu) \
129 menu_entry_new_full(label, NULL, OB_MENU_ENTRY_RENDER_TYPE_SUBMENU, submenu)
131 #define menu_entry_new_boolean(label, action) \
132 menu_entry_new_full(label, action, OB_MENU_ENTRY_RENDER_TYPE_BOOLEAN, NULL)
134 void menu_entry_free(ObMenuEntry *entry);
136 void menu_entry_set_submenu(ObMenuEntry *entry, ObMenu *submenu);
138 void menu_add_entry(ObMenu *menu, ObMenuEntry *entry);
140 ObMenuEntry *menu_find_entry(ObMenu *menu, Window win);
141 ObMenuEntry *menu_find_entry_by_pos(ObMenu *menu, int x, int y);
143 void menu_entry_render(ObMenuEntry *self);
145 void menu_entry_fire(ObMenuEntry *self);
147 void menu_render(ObMenu *self);
148 void menu_render_full(ObMenu *self);
150 void menu_control_mouseover(ObMenuEntry *entry, gboolean enter);