6 #include "render/render.h"
14 typedef struct _ObMenu ObMenu;
15 typedef struct _ObMenuEntry ObMenuEntry;
16 typedef struct _ObNormalMenuEntry ObNormalMenuEntry;
17 typedef struct _ObSubmenuMenuEntry ObSubmenuMenuEntry;
18 typedef struct _ObSeparatorMenuEntry ObSeparatorMenuEntry;
20 typedef void (*ObMenuUpdateFunc)(struct _ObMenuFrame *frame, gpointer data);
22 extern GList *menu_visible;
26 /* Name of the menu. Used in the showmenu action. */
31 /* ObMenuEntry list */
37 ObMenuUpdateFunc update_func;
42 OB_MENU_ENTRY_TYPE_NORMAL,
43 OB_MENU_ENTRY_TYPE_SUBMENU,
44 OB_MENU_ENTRY_TYPE_SEPARATOR
47 struct _ObNormalMenuEntry {
50 /* List of ObActions */
54 struct _ObSubmenuMenuEntry {
58 struct _ObSeparatorMenuEntry {
59 gchar foo; /* placeholder */
73 ObNormalMenuEntry normal;
74 ObSubmenuMenuEntry submenu;
75 ObSeparatorMenuEntry separator;
84 gboolean menu_new(gchar *name, gchar *title, gpointer data);
85 void menu_free(gchar *name);
87 void menu_set_update_func(gchar *name, ObMenuUpdateFunc func);
89 void menu_show(gchar *name, gint x, gint y, struct _ObClient *client);
91 /* functions for building menus */
92 void menu_clear_entries(gchar *name);
93 void menu_add_normal(gchar *name, gint id, gchar *label, GSList *actions);
94 void menu_add_submenu(gchar *name, gint id, gchar *submenu);
95 void menu_add_separator(gchar *name, gint id);
97 ObMenuEntry* menu_find_entry_id(ObMenu *self, gint id);