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 GList
*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
;
101 typedef struct PluginMenuCreateData
{
105 } PluginMenuCreateData
;
109 void menu_shutdown();
111 #define menu_new(l, n, p) \
112 menu_new_full(l, n, p, NULL, NULL)
114 ObMenu
*menu_new_full(char *label
, char *name
, ObMenu
*parent
,
115 menu_controller_show show
, menu_controller_update update
);
116 void menu_free(char *name
);
118 void menu_show(char *name
, int x
, int y
, struct _ObClient
*client
);
119 void menu_show_full(ObMenu
*menu
, int x
, int y
, struct _ObClient
*client
);
121 void menu_hide(ObMenu
*self
);
123 void menu_clear(ObMenu
*self
);
125 ObMenuEntry
*menu_entry_new_full(char *label
, Action
*action
,
126 ObMenuEntryRenderType render_type
,
129 #define menu_entry_new(label, action) \
130 menu_entry_new_full(label, action, OB_MENU_ENTRY_RENDER_TYPE_NONE, NULL)
132 #define menu_entry_new_separator(label) \
133 menu_entry_new_full(label, NULL, OB_MENU_ENTRY_RENDER_TYPE_SEPARATOR, NULL)
135 #define menu_entry_new_submenu(label, submenu) \
136 menu_entry_new_full(label, NULL, OB_MENU_ENTRY_RENDER_TYPE_SUBMENU, submenu)
138 #define menu_entry_new_boolean(label, action) \
139 menu_entry_new_full(label, action, OB_MENU_ENTRY_RENDER_TYPE_BOOLEAN, NULL)
141 void menu_entry_free(ObMenuEntry
*entry
);
143 void menu_entry_set_submenu(ObMenuEntry
*entry
, ObMenu
*submenu
);
145 void menu_add_entry(ObMenu
*menu
, ObMenuEntry
*entry
);
147 ObMenuEntry
*menu_find_entry(ObMenu
*menu
, Window win
);
148 ObMenuEntry
*menu_find_entry_by_submenu(ObMenu
*menu
, ObMenu
*submenu
);
149 ObMenuEntry
*menu_find_entry_by_pos(ObMenu
*menu
, int x
, int y
);
151 void menu_entry_render(ObMenuEntry
*self
);
153 void menu_entry_fire(ObMenuEntry
*self
);
155 void menu_render(ObMenu
*self
);
156 void menu_render_full(ObMenu
*self
);
158 /*so plugins can call it? */
159 void parse_menu_full(xmlDocPtr doc
, xmlNodePtr node
, void *data
, gboolean
new);
160 void menu_control_mouseover(ObMenuEntry
*entry
, gboolean enter
);
161 ObMenuEntry
*menu_control_keyboard_nav(ObMenuEntry
*over
, ObKey key
);