7 #include "render/render.h"
8 #include "parser/parse.h"
14 struct _ObMenuEntryFrame;
16 typedef struct _ObMenu ObMenu;
17 typedef struct _ObMenuEntry ObMenuEntry;
18 typedef struct _ObNormalMenuEntry ObNormalMenuEntry;
19 typedef struct _ObSubmenuMenuEntry ObSubmenuMenuEntry;
20 typedef struct _ObSeparatorMenuEntry ObSeparatorMenuEntry;
22 typedef void (*ObMenuUpdateFunc)(struct _ObMenuFrame *frame, gpointer data);
23 typedef void (*ObMenuExecuteFunc)(struct _ObMenuEntry *entry, gpointer data);
24 typedef void (*ObMenuDestroyFunc)(struct _ObMenu *menu, gpointer data);
26 extern ObParseInst *menu_parse_inst;
30 /* Name of the menu. Used in the showmenu action. */
35 /* ObMenuEntry list */
41 ObMenuUpdateFunc update_func;
42 ObMenuExecuteFunc execute_func;
43 ObMenuDestroyFunc destroy_func;
48 OB_MENU_ENTRY_TYPE_NORMAL,
49 OB_MENU_ENTRY_TYPE_SUBMENU,
50 OB_MENU_ENTRY_TYPE_SEPARATOR
53 struct _ObNormalMenuEntry {
59 /* List of ObActions */
68 struct _ObSubmenuMenuEntry {
73 struct _ObSeparatorMenuEntry {
74 gchar foo; /* placeholder */
85 ObNormalMenuEntry normal;
86 ObSubmenuMenuEntry submenu;
87 ObSeparatorMenuEntry separator;
96 ObMenu* menu_new(gchar *name, gchar *title, gpointer data);
97 void menu_free(gchar *name);
99 gboolean menu_open_plugin(ObParseInst *i, gchar *name, gchar *plugin);
101 void menu_set_update_func(gchar *name, ObMenuUpdateFunc func);
102 void menu_set_execute_func(gchar *name, ObMenuExecuteFunc func);
103 void menu_set_destroy_func(gchar *name, ObMenuDestroyFunc func);
105 void menu_show(gchar *name, gint x, gint y, struct _ObClient *client);
107 /* functions for building menus */
108 void menu_clear_entries(gchar *name);
109 ObMenuEntry* menu_add_normal(gchar *name, gint id, gchar *label,
111 ObMenuEntry* menu_add_submenu(gchar *name, gint id, gchar *submenu);
112 ObMenuEntry* menu_add_separator(gchar *name, gint id);
114 ObMenuEntry* menu_find_entry_id(ObMenu *self, gint id);
116 void menu_find_submenus(ObMenu *self);