aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libindicate/listener.c37
-rw-r--r--libindicate/listener.h5
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;