diff finch/libgnt/gntmenuitem.h @ 21212:b65f1bff6412

Allow binding key-shortcuts to menuitems. For example, to bind ctrl+m to the 'Options -> Send IM...' menu, you would add: [buddylist::menu] c-m = send-im in ~/.gntrc
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 03 Oct 2007 06:51:26 +0000
parents 44b4e8bd759b
children d275275a011c
line wrap: on
line diff
--- a/finch/libgnt/gntmenuitem.h	Wed Oct 03 05:42:31 2007 +0000
+++ b/finch/libgnt/gntmenuitem.h	Wed Oct 03 06:51:26 2007 +0000
@@ -53,6 +53,7 @@
 	int x;
 	int y;
 	char trigger;
+	char *id;
 };
 
 typedef void (*GntMenuItemCallback)(GntMenuItem *item, gpointer data);
@@ -86,36 +87,46 @@
 G_BEGIN_DECLS
 
 /**
- * 
- *
- * @return
+ * @return GType for GntMenuItem.
  */
 GType gnt_menuitem_get_gtype(void);
 
 /**
- * 
- * @param text
+ * Create a new menuitem.
  *
- * @return
+ * @param text   Label for the menuitem.
+ *
+ * @return  The newly created menuitem.
  */
 GntMenuItem * gnt_menuitem_new(const char *text);
 
 /**
- * 
- * @param item
- * @param callback
- * @param data
+ * Set a callback function for a menuitem.
+ *
+ * @param item       The menuitem.
+ * @param callback   The callback function.
+ * @param data       Data to send to the callback function.
  */
 void gnt_menuitem_set_callback(GntMenuItem *item, GntMenuItemCallback callback, gpointer data);
 
 /**
- * 
- * @param item
- * @param menu
+ * Set a submenu for a menuitem. A menuitem with a submenu cannot have a callback.
+ *
+ * @param item  The menuitem.
+ * @param menu  The submenu.
  */
 void gnt_menuitem_set_submenu(GntMenuItem *item, GntMenu *menu);
 
 /**
+ * Get the submenu for a menuitem.
+ *
+ * @param item   The menuitem.
+ *
+ * @return  The submenu, or @c NULL.
+ */
+GntMenu *gnt_menuitem_get_submenu(GntMenuItem *item);
+
+/**
  * Set a trigger key for the item.
  *
  * @param item     The menuitem
@@ -134,6 +145,23 @@
  */
 char gnt_menuitem_get_trigger(GntMenuItem *item);
 
+/**
+ * Set an ID for the menuitem.
+ *
+ * @param item   The menuitem.
+ * @param id     The ID for the menuitem.
+ */
+void gnt_menuitem_set_id(GntMenuItem *item, const char *id);
+
+/**
+ * Get the ID of the menuitem.
+ *
+ * @param item   The menuitem.
+ *
+ * @return  The ID for the menuitem.
+ */
+const char * gnt_menuitem_get_id(GntMenuItem *item);
+
 G_END_DECLS
 
 #endif /* GNT_MENUITEM_H */