#include <glib.h>
struct _ObClient;
+struct _ObParseInst;
typedef struct _ObMenu ObMenu;
typedef struct _ObMenuEntry ObMenuEntry;
+typedef void(*menu_controller_destroy)(ObMenu *self);
typedef void(*menu_controller_show)(ObMenu *self, int x, int y,
struct _ObClient *);
typedef void(*menu_controller_update)(ObMenu *self);
ObMenu *open_submenu;
GList *over;
+ /* destructor */
+ menu_controller_destroy destroy;
+
/* behaviour callbacks
TODO: Document and split code that HAS to be in the overridden callback */
/* place a menu on screen */
char *label;
ObMenu *parent;
- Action *action;
+ ObAction *action;
ObMenuEntryRenderType render_type;
gboolean hilite;
/* render stuff */
Window item;
+ Window submenu_pic;
+
RrAppearance *a_item;
RrAppearance *a_disabled;
RrAppearance *a_hilite;
+ RrAppearance *a_submenu;
gint y;
gint min_w;
} MenuEntry;
typedef struct PluginMenuCreateData{
+ struct _ObParseInst *parse_inst;
xmlDocPtr doc;
xmlNodePtr node;
ObMenu *parent;
void menu_startup();
void menu_shutdown();
+void menu_parse();
+
void menu_noop();
#define menu_new(l, n, p) \
menu_new_full(l, n, p, menu_show_full, menu_render, menu_entry_fire, \
- menu_hide, menu_control_mouseover)
+ menu_hide, menu_control_mouseover, NULL)
ObMenu *menu_new_full(char *label, char *name, ObMenu *parent,
- menu_controller_show show, menu_controller_update update,
+ menu_controller_show show,
+ menu_controller_update update,
menu_controller_selected selected,
menu_controller_hide hide,
- menu_controller_mouseover mouseover);
+ menu_controller_mouseover mouseover,
+ menu_controller_destroy destroy);
void menu_free(char *name);
void menu_clear(ObMenu *self);
-ObMenuEntry *menu_entry_new_full(char *label, Action *action,
+ObMenuEntry *menu_entry_new_full(char *label, ObAction *action,
ObMenuEntryRenderType render_type,
gpointer submenu);
void menu_render_full(ObMenu *self);
/*so plugins can call it? */
-void parse_menu_full(xmlDocPtr doc, xmlNodePtr node, void *data, gboolean new);
+void parse_menu_full(struct _ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
+ void *data, gboolean new);
void menu_control_mouseover(ObMenuEntry *entry, gboolean enter);
void menu_control_keyboard_nav(unsigned int key);
#endif