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
{
/* plugin data */
gpointer data;
+
+ ObMenuUpdateFunc update_func;
};
typedef enum
ObMenuEntryType type;
ObMenu *menu;
+ gint id;
+
/* state */
gboolean enabled;
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