summaryrefslogtreecommitdiff
path: root/openbox/menu.h
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-08-28 05:44:13 +0000
committerDana Jansens <danakj@orodu.net>2003-08-28 05:44:13 +0000
commit615cbd96075905d75533f9b615c4ee6a75f4f9a4 (patch)
treed57954f576d41f36ff30df6df1dad2264c13dcbd /openbox/menu.h
parent9290376bbbb8b29411f59a35e5477f25304fe205 (diff)
change the menu plugin interface, no need for the create/destroy functions any more.
redo the client-menu plugin to work with the new menu api
Diffstat (limited to 'openbox/menu.h')
-rw-r--r--openbox/menu.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/openbox/menu.h b/openbox/menu.h
index cfbb52de..66390e75 100644
--- a/openbox/menu.h
+++ b/openbox/menu.h
@@ -17,9 +17,9 @@ typedef struct _ObNormalMenuEntry ObNormalMenuEntry;
typedef struct _ObSubmenuMenuEntry ObSubmenuMenuEntry;
typedef struct _ObSeparatorMenuEntry ObSeparatorMenuEntry;
-extern GList *menu_visible;
-
+typedef void (*ObMenuUpdateFunc)(struct _ObMenuFrame *frame, gpointer data);
+extern GList *menu_visible;
struct _ObMenu
{
@@ -33,6 +33,8 @@ struct _ObMenu
/* plugin data */
gpointer data;
+
+ ObMenuUpdateFunc update_func;
};
typedef enum
@@ -62,6 +64,8 @@ struct _ObMenuEntry
ObMenuEntryType type;
ObMenu *menu;
+ gint id;
+
/* state */
gboolean enabled;
@@ -78,13 +82,18 @@ void menu_shutdown();
void menu_parse();
gboolean menu_new(gchar *name, gchar *title, gpointer data);
+void menu_free(gchar *name);
+
+void menu_set_update_func(gchar *name, ObMenuUpdateFunc func);
void menu_show(gchar *name, gint x, gint y, struct _ObClient *client);
/* functions for building menus */
void menu_clear_entries(gchar *name);
-void menu_add_normal(gchar *name, gchar *label, GSList *actions);
-void menu_add_submenu(gchar *name, gchar *submenu);
-void menu_add_separator(gchar *name);
+void menu_add_normal(gchar *name, gint id, gchar *label, GSList *actions);
+void menu_add_submenu(gchar *name, gint id, gchar *submenu);
+void menu_add_separator(gchar *name, gint id);
+
+ObMenuEntry* menu_find_entry_id(ObMenu *self, gint id);
#endif