summaryrefslogtreecommitdiff
path: root/openbox/menu.h
diff options
context:
space:
mode:
authorScott Moynes <smoynes@nexus.carleton.ca>2003-03-24 21:54:47 +0000
committerScott Moynes <smoynes@nexus.carleton.ca>2003-03-24 21:54:47 +0000
commit3443454f33f88e10f187b78594ecfb5c09e1448d (patch)
tree6eca175cd4844b677ab7eba73aa9854f0e25c5a2 /openbox/menu.h
parent3bbe809596b0c1ee9acb7695c4c80bfb4fc593df (diff)
Added some menu structure.
Diffstat (limited to 'openbox/menu.h')
-rw-r--r--openbox/menu.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/openbox/menu.h b/openbox/menu.h
new file mode 100644
index 00000000..d7d27c2c
--- /dev/null
+++ b/openbox/menu.h
@@ -0,0 +1,61 @@
+#ifndef __menu_h
+#define __menu_h
+
+#include <glib.h>
+
+typedef struct {
+ char *label;
+
+ GList *entries;
+ /* GList *tail; */
+
+ /* ? */
+ gboolean shown;
+ gboolean invalid;
+
+ Menu *parent;
+
+ /* waste o' pointers */
+ void (*show)( /* some bummu */);
+ void (*hide)( /* some bummu */);
+ void (*update)( /* some bummu */);
+ void (*mouseover)( /* some bummu */);
+ void (*selected)( /* some bummu */);
+} Menu;
+
+typedef enum MenuEntryRenderType {
+ MenuEntryRenderType_None = 0,
+ MenuEntryRenderType_Submenu 1 << 0,
+ MenuEntryRenderType_Boolean 1 << 1,
+ MenuEntryRenderType_Separator 1 << 2,
+
+ MenuEntryRenderType_Other 1 << 7
+} MenuEntryType;
+
+
+typedef struct {
+ char *label;
+ Menu *parent;
+
+ Action action;
+
+ MenuEntryRenderType render_type;
+ gboolean enabled;
+ gboolean boolean_value;
+ gpointer render_data;
+
+ Menu *submenu;
+} MenuEntry;
+
+Menu *menu_new(char *label, Menu *parent);
+MenuEntry *menu_entry_new_full(char *label, Action *action,
+ MenuEntryRenderType render_type,
+ gpointer render_data, gpointer submenu);
+
+#define menu_entry_new(label, action) \
+ menu_entry_new(label, action, MenuEntryRenderType_None, NULL, NULL)
+
+void menu_entry_set_submenu(MenuEntry *entry, Menu *submenu);
+
+void menu_add_entry(Menu *menu, MenuEntry *entry);
+#endif