]> Dogcows Code - chaz/openbox/blobdiff - openbox/menu.h
change the menu plugin interface, no need for the create/destroy functions any more.
[chaz/openbox] / openbox / menu.h
index cfbb52dee84dd4249c7307856d1bd10bac395492..66390e7565847db9000a455f2a11928603709f87 100644 (file)
@@ -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
This page took 0.021361 seconds and 4 git commands to generate.