diff src/blist.h @ 9030:7ab20f829190

[gaim-migrate @ 9806] Siege updated the code for creating right-click menu's for buddies, chats, groups, etc. It uses more stuff from the blist API and less stuff from multi.h. It also combines the code for right-click menus for chats, buddies, etc. (all types of blist nodes). So PRPLs and plugins can easily add right-click menu options to anything in the buddy list in a clean way. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 23 May 2004 17:27:45 +0000
parents d494fd1bd90b
children 7a8aa87164ae
line wrap: on
line diff
--- a/src/blist.h	Sun May 23 08:06:38 2004 +0000
+++ b/src/blist.h	Sun May 23 17:27:45 2004 +0000
@@ -34,6 +34,8 @@
 typedef struct _GaimBlistUiOps GaimBlistUiOps;
 typedef struct _GaimBlistNode GaimBlistNode;
 
+typedef struct _GaimBlistNodeAction GaimBlistNodeAction;
+
 typedef struct _GaimChat GaimChat;
 typedef struct _GaimGroup GaimGroup;
 typedef struct _GaimContact GaimContact;
@@ -183,6 +185,14 @@
 	void (*request_add_group)(void);
 };
 
+
+struct _GaimBlistNodeAction {
+	char *label;
+	void (*callback)(GaimBlistNode *, gpointer);
+	gpointer data;
+};
+
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -857,22 +867,23 @@
 
 
 /**
- * Retrieves the extended menu items for a buddy.
- * @param b      The buddy to obtain the extended menu items for
-*/
-GList *gaim_buddy_get_extended_menu(GaimBuddy *b);
+ * Retrieves the extended menu items for a buddy list node.
+ * @param n	The blist node for which to obtain the extended menu items.
+ * @return	list of GaimBlistNodeAction items, as harvested by the
+ *		blist-node-extended-menu signal.
+ */
+GList *gaim_blist_node_get_extended_menu(GaimBlistNode *n);
+
 
 /**
- * Retrieves the extended menu items for a chat.
- * @param c      The chat to obtain the extended menu items for
-*/
-GList *gaim_chat_get_extended_menu(GaimChat *c);
-
-/**
- * Retrieves the extended menu items for a group.
- * @param g      The group to obtain the extended menu items for
-*/
-GList *gaim_group_get_extended_menu(GaimGroup *g);
+ * Creates a new GaimBlistNodeAction.
+ * @param label		The text label to display for this action.
+ * @param callback	The function to be called when the action is used on
+ *			a selected GaimBlistNode.
+ * @param data		Additional data, to be passed to the callback
+ */
+GaimBlistNodeAction  *gaim_blist_node_action_new(char *label,
+		void (*callback)(GaimBlistNode *, gpointer), gpointer data);
 
 
 /**************************************************************************/