comparison src/blist.h @ 12919:248b8b39c671

[gaim-migrate @ 15272] Replace GaimBlistNodeAction with the more generic GaimMenuAction, this is in preparation for letting the chat room user list have extensible menus like the blist entries do. (I know it's not exactly the prettiest, and the callback isn't exactly type-safe, when we eventually gobjectify everything we can get some safety back by using (GObject, gpointer) but that's for later.) I'm planning to look into merging GaimPluginActions into GaimMenuActions as well. committer: Tailor Script <tailor@pidgin.im>
author Etan Reisner <pidgin@unreliablesource.net>
date Tue, 17 Jan 2006 23:22:19 +0000
parents e63a80be5227
children 51c6405049a3
comparison
equal deleted inserted replaced
12918:a05fbd9dcc31 12919:248b8b39c671
30 #include <glib.h> 30 #include <glib.h>
31 31
32 typedef struct _GaimBuddyList GaimBuddyList; 32 typedef struct _GaimBuddyList GaimBuddyList;
33 typedef struct _GaimBlistUiOps GaimBlistUiOps; 33 typedef struct _GaimBlistUiOps GaimBlistUiOps;
34 typedef struct _GaimBlistNode GaimBlistNode; 34 typedef struct _GaimBlistNode GaimBlistNode;
35
36 typedef struct _GaimBlistNodeAction GaimBlistNodeAction;
37 35
38 typedef struct _GaimChat GaimChat; 36 typedef struct _GaimChat GaimChat;
39 typedef struct _GaimGroup GaimGroup; 37 typedef struct _GaimGroup GaimGroup;
40 typedef struct _GaimContact GaimContact; 38 typedef struct _GaimContact GaimContact;
41 typedef struct _GaimBuddy GaimBuddy; 39 typedef struct _GaimBuddy GaimBuddy;
182 void (*request_add_chat)(GaimAccount *account, GaimGroup *group, 180 void (*request_add_chat)(GaimAccount *account, GaimGroup *group,
183 const char *alias, const char *name); 181 const char *alias, const char *name);
184 void (*request_add_group)(void); 182 void (*request_add_group)(void);
185 }; 183 };
186 184
187
188 struct _GaimBlistNodeAction {
189 char *label;
190 void (*callback)(GaimBlistNode *, gpointer);
191 gpointer data;
192 GList *children;
193 };
194
195
196 #ifdef __cplusplus 185 #ifdef __cplusplus
197 extern "C" { 186 extern "C" {
198 #endif 187 #endif
199 188
200 /**************************************************************************/ 189 /**************************************************************************/
846 */ 835 */
847 GaimBlistNodeFlags gaim_blist_node_get_flags(GaimBlistNode *node); 836 GaimBlistNodeFlags gaim_blist_node_get_flags(GaimBlistNode *node);
848 837
849 /*@}*/ 838 /*@}*/
850 839
851
852 /** 840 /**
853 * Retrieves the extended menu items for a buddy list node. 841 * Retrieves the extended menu items for a buddy list node.
854 * @param n The blist node for which to obtain the extended menu items. 842 * @param n The blist node for which to obtain the extended menu items.
855 * @return A list of GaimBlistNodeAction items, as harvested by the 843 * @return A list of GaimMenuAction items, as harvested by the
856 * blist-node-extended-menu signal. 844 * blist-node-extended-menu signal.
857 */ 845 */
858 GList *gaim_blist_node_get_extended_menu(GaimBlistNode *n); 846 GList *gaim_blist_node_get_extended_menu(GaimBlistNode *n);
859
860
861 /**
862 * Creates a new GaimBlistNodeAction.
863 * @param label The text label to display for this action.
864 * @param callback The function to be called when the action is used on
865 * a selected GaimBlistNode.
866 * @param data Additional data, to be passed to the callback
867 * @param children A GList of GaimBlistNodeActions to be added as a
868 * submenu of the action.
869 * @return The GaimBlistNodeAction.
870 */
871 GaimBlistNodeAction *gaim_blist_node_action_new(char *label,
872 void (*callback)(GaimBlistNode *, gpointer), gpointer data,
873 GList *children);
874
875 847
876 /**************************************************************************/ 848 /**************************************************************************/
877 /** @name UI Registration Functions */ 849 /** @name UI Registration Functions */
878 /**************************************************************************/ 850 /**************************************************************************/
879 /*@{*/ 851 /*@{*/