From a300f6cd4ed76fbc68c379bcc6729aa71cfc1759 Mon Sep 17 00:00:00 2001 From: Eitan Isaacson Date: Wed, 8 Apr 2009 16:47:46 +0300 Subject: GBoxed IndicateListenerServer --- libindicate/listener.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'libindicate/listener.c') 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); +} -- cgit v1.2.3