Resolve gravity coords in menuframe so it can use the widths
[mikachu/openbox.git] / openbox / menu.h
index c0cc199..08ca00e 100644 (file)
@@ -59,6 +59,7 @@ struct _ObMenu
     gchar *name;
     /* Displayed title */
     gchar *title;
+    gchar *collate_key;
     /*! The shortcut key that would be used to activate this menu if it was
       displayed as a submenu */
     gunichar shortcut;
@@ -103,7 +104,12 @@ typedef enum
 } ObMenuEntryType;
 
 struct _ObNormalMenuEntry {
+    /* Icon stuff.  If you set this, make sure you RrImageRef() it too. */
+    RrImage *icon;
+    gint     icon_alpha;
+
     gchar *label;
+    gchar *collate_key;
     /*! The shortcut key that would be used to activate this menu entry */
     gunichar shortcut;
     /*! The shortcut's position in the string */
@@ -117,10 +123,6 @@ struct _ObNormalMenuEntry {
     /* List of ObActions */
     GSList *actions;
 
-    /* Icon stuff.  If you set this, make sure you RrImageRef() it too. */
-    RrImage *icon;
-    gint     icon_alpha;
-
     /* Mask icon */
     RrPixmapMask *mask;
     RrColor *mask_normal_color;
@@ -132,8 +134,13 @@ struct _ObNormalMenuEntry {
 };
 
 struct _ObSubmenuMenuEntry {
+    /* Icon stuff.  If you set this, make sure you RrImageRef() it too. */
+    RrImage *icon;
+    gint     icon_alpha;
+
     gchar *name;
     ObMenu *submenu;
+    
     guint show_from;
 };
 
@@ -174,8 +181,8 @@ void menu_clear_pipe_caches(void);
 
 void menu_show_all_shortcuts(ObMenu *self, gboolean show);
 
-void menu_show(gchar *name, gint x, gint y, gboolean mouse,
-               struct _ObClient *client);
+void menu_show(gchar *name, GravityPoint pos, gint monitor,
+               gboolean mouse, struct _ObClient *client);
 gboolean menu_hide_delay_reached(void);
 
 /*! The show function is called right after a menu is shown */
@@ -206,7 +213,10 @@ ObMenuEntry* menu_add_normal(ObMenu *menu, gint id, const gchar *label,
 ObMenuEntry* menu_add_submenu(ObMenu *menu, gint id, const gchar *submenu);
 ObMenuEntry* menu_add_separator(ObMenu *menu, gint id, const gchar *label);
 
-void menu_clear_entries(ObMenu *menu);
+/*! This sorts groups of menu entries between consecutive separators */
+void menu_sort_entries(ObMenu *self);
+
+void menu_clear_entries(ObMenu *self);
 void menu_entry_remove(ObMenuEntry *self);
 
 void menu_entry_set_label(ObMenuEntry *self, const gchar *label,