Wed, 19 Feb 2014 16:59:51 +0530
Box FinchBlistManager
| finch/gntblist.c | file | annotate | diff | comparison | revisions | |
| finch/gntblist.h | file | annotate | diff | comparison | revisions |
--- a/finch/gntblist.c Tue Feb 18 13:01:35 2014 +0530 +++ b/finch/gntblist.c Wed Feb 19 16:59:51 2014 +0530 @@ -3201,3 +3201,40 @@ return ggblist ? GNT_TREE(ggblist->tree) : NULL; } +/************************************************************************** + * GBoxed code + **************************************************************************/ +static FinchBlistManager * +finch_blist_manager_copy(FinchBlistManager *manager) +{ + FinchBlistManager *manager_new; + + g_return_val_if_fail(manager != NULL, NULL); + + manager_new = g_new(FinchBlistManager, 1); + *manager_new = *manager; + + return manager_new; +} + +static void +finch_blist_manager_free(FinchBlistManager *manager) +{ + g_return_if_fail(manager != NULL); + + g_free(manager); +} + +GType +finch_blist_manager_get_type(void) +{ + static GType type = 0; + + if (type == 0) { + type = g_boxed_type_register_static("FinchBlistManager", + (GBoxedCopyFunc)finch_blist_manager_copy, + (GBoxedFreeFunc)finch_blist_manager_free); + } + + return type; +}
--- a/finch/gntblist.h Tue Feb 18 13:01:35 2014 +0530 +++ b/finch/gntblist.h Wed Feb 19 16:59:51 2014 +0530 @@ -31,6 +31,8 @@ #include "buddylist.h" #include "gnttree.h" +#define FINCH_TYPE_BLIST_MANAGER (finch_blist_manager_get_type()) + /********************************************************************** * GNT BuddyList API **********************************************************************/ @@ -65,6 +67,13 @@ }; /** + * finch_blist_manager_get_type: + * + * Returns: The #GType for the #FinchBlistManager boxed structure. + */ +GType finch_blist_manager_get_type(void); + +/** * finch_blist_get_ui_ops: * * Get the ui-functions. @@ -177,7 +186,8 @@ * * Find a buddy list manager. * - * Returns: The manager with the requested identifier, if available. %NULL otherwise. + * Returns: The manager with the requested identifier, if available. %NULL + * otherwise. */ FinchBlistManager * finch_blist_manager_find(const char *id);