Mercurial > pidgin
diff src/util.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 | 4f2b96f23700 |
children | 69b3d5cbd2b1 |
line wrap: on
line diff
--- a/src/util.h Tue Jan 17 19:28:45 2006 +0000 +++ b/src/util.h Tue Jan 17 23:22:19 2006 +0000 @@ -37,6 +37,13 @@ extern "C" { #endif +typedef struct _GaimMenuAction +{ + char *label; + GaimCallback callback; + gpointer data; + GList *children; +} GaimMenuAction; /** * A key-value pair. @@ -51,7 +58,18 @@ } GaimKeyValuePair; - +/** + * Creates a new GaimMenuAction. + * @param label The text label to display for this action. + * @param callback The function to be called when the action is used on + * the selected item. + * @param data Additional data to be passed to the callback. + * @param children A GList of GaimMenuActions to be added as a submenu + * of the action. + * @return The GaimMenuAction. + */ +GaimMenuAction *gaim_menu_action_new(char *label, GaimCallback callback, + gpointer data, GList *children); /**************************************************************************/ /** @name Base16 Functions */ @@ -90,7 +108,6 @@ /*@}*/ - /**************************************************************************/ /** @name Base64 Functions */ /**************************************************************************/