+struct _ObClient;
+struct _ObMenuFrame;
+struct _ObMenuEntryFrame;
+
+typedef struct _ObMenu ObMenu;
+typedef struct _ObMenuEntry ObMenuEntry;
+typedef struct _ObNormalMenuEntry ObNormalMenuEntry;
+typedef struct _ObSubmenuMenuEntry ObSubmenuMenuEntry;
+typedef struct _ObSeparatorMenuEntry ObSeparatorMenuEntry;
+
+typedef void (*ObMenuShowFunc)(struct _ObMenuFrame *frame, gpointer data);
+typedef void (*ObMenuHideFunc)(struct _ObMenuFrame *frame, gpointer data);
+typedef gboolean (*ObMenuUpdateFunc)(struct _ObMenuFrame *frame,
+ gpointer data);
+typedef void (*ObMenuExecuteFunc)(struct _ObMenuEntry *entry,
+ struct _ObMenuFrame *frame,
+ struct _ObClient *client,
+ guint state, gpointer data);
+typedef void (*ObMenuDestroyFunc)(struct _ObMenu *menu, gpointer data);
+/*! @param x is the mouse x coordinate. on return it should be the x coordinate
+ for the menu
+ @param y is the mouse y coordinate. on return it should be the y coordinate
+ for the menu
+*/
+typedef void (*ObMenuPlaceFunc)(struct _ObMenuFrame *frame, gint *x, gint *y,
+ gboolean mouse, gpointer data);
+
+struct _ObMenu
+{
+ /* Name of the menu. Used in the showmenu action. */
+ gchar *name;
+ /* Displayed title */
+ gchar *title;
+ /*! The shortcut key that would be used to activate this menu if it was
+ displayed as a submenu */
+ gunichar shortcut;
+ /*! The shortcut's position in the string */
+ guint shortcut_position;
+ /*! If the shortcut was specified by & and should always be drawn */
+ gboolean shortcut_always_show;
+
+ /*! If the shortcut key should be shown in menu entries even when it
+ is the first character in the string */
+ gboolean show_all_shortcuts;
+
+ /* Command to execute to rebuild the menu */
+ gchar *execute;
+
+ /* ObMenuEntry list */
+ GList *entries;
+
+ /* plugin data */
+ gpointer data;
+
+ ObMenuShowFunc show_func;
+ ObMenuHideFunc hide_func;
+ ObMenuUpdateFunc update_func;
+ ObMenuExecuteFunc execute_func;
+ ObMenuDestroyFunc destroy_func;
+ ObMenuPlaceFunc place_func;
+
+ /* Pipe-menu parent, we get destroyed when it is destroyed */
+ ObMenu *pipe_creator;
+
+ /* The menu used as the destination for the "More..." entry for this menu*/
+ ObMenu *more_menu;
+};
+
+typedef enum
+{
+ OB_MENU_ENTRY_TYPE_NORMAL,
+ OB_MENU_ENTRY_TYPE_SUBMENU,
+ OB_MENU_ENTRY_TYPE_SEPARATOR
+} ObMenuEntryType;
+
+struct _ObNormalMenuEntry {
+ gchar *label;
+ /*! The shortcut key that would be used to activate this menu entry */
+ gunichar shortcut;
+ /*! The shortcut's position in the string */
+ guint shortcut_position;
+ /*! If the shortcut was specified by & and should always be drawn */
+ gboolean shortcut_always_show;
+
+ /* state */
+ gboolean enabled;