diff options
author | Eitan Isaacson <eitan@ascender.com> | 2009-04-08 16:47:46 +0300 |
---|---|---|
committer | Eitan Isaacson <eitan@ascender.com> | 2009-04-08 16:47:46 +0300 |
commit | a300f6cd4ed76fbc68c379bcc6729aa71cfc1759 (patch) | |
tree | 4e1d7e550e43b896377956c35eb1d324abd2bd81 /libindicate | |
parent | 03077752f8a7b86e1008ca85d726690b0c8fac2f (diff) | |
download | libayatana-indicator-a300f6cd4ed76fbc68c379bcc6729aa71cfc1759.tar.gz libayatana-indicator-a300f6cd4ed76fbc68c379bcc6729aa71cfc1759.tar.bz2 libayatana-indicator-a300f6cd4ed76fbc68c379bcc6729aa71cfc1759.zip |
GBoxed IndicateListenerServer
Diffstat (limited to 'libindicate')
-rw-r--r-- | libindicate/listener.c | 37 | ||||
-rw-r--r-- | libindicate/listener.h | 5 |
2 files changed, 42 insertions, 0 deletions
diff --git a/libindicate/listener.c b/libindicate/listener.c index 381a5f9..aa36d18 100644 --- a/libindicate/listener.c +++ b/libindicate/listener.c @@ -1024,3 +1024,40 @@ indicate_listener_server_check_interest (IndicateListener * listener, IndicateLi return server->interests[interest]; } +GType +indicate_listener_server_get_gtype (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("IndicateListenerServer", + (GBoxedCopyFunc) indicate_listener_server_copy, + (GBoxedFreeFunc) indicate_listener_server_free); + + return our_type; +} + +IndicateListenerServer * +indicate_listener_server_copy (const IndicateListenerServer *listener_server) +{ + IndicateListenerServer *retval; + retval = (IndicateListenerServer *)g_memdup ( + listener_server, + sizeof (IndicateListenerServer)); + + g_object_ref (retval->proxy); + dbus_g_connection_ref (retval->connection); + g_stpcpy (retval->name, listener_server->name); + + return retval; +} + +void +indicate_listener_server_free (IndicateListenerServer *listener_server) +{ + g_free (listener_server->name); + g_object_unref (listener_server->proxy); + dbus_g_connection_unref (listener_server->connection); + + g_free (listener_server); +} diff --git a/libindicate/listener.h b/libindicate/listener.h index 0fdaa9b..5a1e991 100644 --- a/libindicate/listener.h +++ b/libindicate/listener.h @@ -59,6 +59,11 @@ G_BEGIN_DECLS #define INDICATE_LISTENER_INDICATOR_ID(indicator) (indicate_listener_indicator_get_id(indicator)) typedef struct _IndicateListenerServer IndicateListenerServer; +#define INDICATE_TYPE_LISTENER_SERVER (indicate_listener_server_get_gtype ()) +GType indicate_listener_server_get_gtype (void) G_GNUC_CONST; +IndicateListenerServer *indicate_listener_server_copy (const IndicateListenerServer *listener_server); +void indicate_listener_server_free (IndicateListenerServer *listener_server); + typedef struct _IndicateListenerIndicator IndicateListenerIndicator; typedef struct _IndicateListener IndicateListener; |