diff options
author | Ted Gould <ted@gould.cx> | 2011-03-02 10:04:25 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-03-02 10:04:25 -0600 |
commit | ecd64358f931dc26bd806f72f774cac54e3bfad7 (patch) | |
tree | 58d798562a1662b9a6402254503cf169fe84a9e2 | |
parent | 05298620b764d60b942567d09b970342924099f9 (diff) | |
download | libdbusmenu-ecd64358f931dc26bd806f72f774cac54e3bfad7.tar.gz libdbusmenu-ecd64358f931dc26bd806f72f774cac54e3bfad7.tar.bz2 libdbusmenu-ecd64358f931dc26bd806f72f774cac54e3bfad7.zip |
Changing the destroy notification function to be a GDestroyNotify for GIR purposes
-rw-r--r-- | libdbusmenu-glib/client.c | 10 | ||||
-rw-r--r-- | libdbusmenu-glib/client.h | 14 |
2 files changed, 6 insertions, 18 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 83ca056..8415b95 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -129,7 +129,7 @@ typedef struct _type_handler_t type_handler_t; struct _type_handler_t { DbusmenuClient * client; DbusmenuClientTypeHandler cb; - DbusmenuClientTypeDestroyHandler destroy_cb; + GDestroyNotify destroy_cb; gpointer user_data; gchar * type; }; @@ -1881,7 +1881,7 @@ type_handler_destroy (gpointer user_data) { type_handler_t * th = (type_handler_t *)user_data; if (th->destroy_cb != NULL) { - th->destroy_cb(th->client, th->type, th->user_data); + th->destroy_cb(th->user_data); } g_free(th->type); g_free(th); @@ -1893,7 +1893,7 @@ type_handler_destroy (gpointer user_data) * @client: Client where we're getting types coming in * @type: A text string that will be matched with the 'type' * property on incoming menu items - * @newfunc: The function that will be executed with those new + * @newfunc: (scope notified): The function that will be executed with those new * items when they come in. * * This function connects into the type handling of the #DbusmenuClient. @@ -1920,7 +1920,7 @@ dbusmenu_client_add_type_handler (DbusmenuClient * client, const gchar * type, D * @client: Client where we're getting types coming in * @type: A text string that will be matched with the 'type' * property on incoming menu items - * @newfunc: The function that will be executed with those new + * @newfunc: (scope notified): The function that will be executed with those new * items when they come in. * @user_data: Data passed to @newfunc when it is called * @destroy_func: A function that is called when the type handler is @@ -1941,7 +1941,7 @@ dbusmenu_client_add_type_handler (DbusmenuClient * client, const gchar * type, D * Return value: If registering the new type was successful. */ gboolean -dbusmenu_client_add_type_handler_full (DbusmenuClient * client, const gchar * type, DbusmenuClientTypeHandler newfunc, gpointer user_data, DbusmenuClientTypeDestroyHandler destroy_func) +dbusmenu_client_add_type_handler_full (DbusmenuClient * client, const gchar * type, DbusmenuClientTypeHandler newfunc, gpointer user_data, GDestroyNotify destroy_func) { g_return_val_if_fail(DBUSMENU_IS_CLIENT(client), FALSE); g_return_val_if_fail(type != NULL, FALSE); diff --git a/libdbusmenu-glib/client.h b/libdbusmenu-glib/client.h index 28d4dd3..1deed56 100644 --- a/libdbusmenu-glib/client.h +++ b/libdbusmenu-glib/client.h @@ -198,18 +198,6 @@ struct _DbusmenuClient { */ typedef gboolean (*DbusmenuClientTypeHandler) (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client, gpointer user_data); -/** - DbusmenuClientTypeDestroyHandler: - @client: A pointer to the #DbusmenuClient - @type: The type that this handler was registered with - @user_data: The data you gave us - - This handler is called when the type becomes unregistered by the - client. This is usally caused by the #DbusmenuClient being destroyed - and should free memory or unref objects in @user_data. -*/ -typedef void (*DbusmenuClientTypeDestroyHandler) (DbusmenuClient * client, const gchar * type, gpointer user_data); - GType dbusmenu_client_get_type (void); DbusmenuClient * dbusmenu_client_new (const gchar * name, const gchar * object); @@ -221,7 +209,7 @@ gboolean dbusmenu_client_add_type_handler_full (DbusmenuClient * cli const gchar * type, DbusmenuClientTypeHandler newfunc, gpointer user_data, - DbusmenuClientTypeDestroyHandler destroy_func); + GDestroyNotify destroy_func); DbusmenuTextDirection dbusmenu_client_get_text_direction (DbusmenuClient * client); DbusmenuStatus dbusmenu_client_get_status (DbusmenuClient * client); |