[Telepathy-commits] [telepathy-salut/master] SalutRoomlistChannel: implement channel DBus properties

Sjoerd Simons sjoerd at luon.net
Mon Aug 11 05:04:10 PDT 2008


---
 src/salut-roomlist-channel.c |   23 +++++++++++++++++++++++
 src/salut-roomlist-channel.h |    1 +
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/salut-roomlist-channel.c b/src/salut-roomlist-channel.c
index 58e0503..1a33f9c 100644
--- a/src/salut-roomlist-channel.c
+++ b/src/salut-roomlist-channel.c
@@ -30,6 +30,7 @@
 #include <telepathy-glib/interfaces.h>
 #include <telepathy-glib/channel-iface.h>
 #include <telepathy-glib/svc-channel.h>
+#include <telepathy-glib/svc-generic.h>
 
 #define DEBUG_FLAG DEBUG_ROOMLIST
 #include "debug.h"
@@ -45,6 +46,8 @@ static void roomlist_iface_init (gpointer, gpointer);
 
 G_DEFINE_TYPE_WITH_CODE (SalutRoomlistChannel, salut_roomlist_channel,
     G_TYPE_OBJECT,
+    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES,
+      tp_dbus_properties_mixin_iface_init);
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init);
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_ROOM_LIST,
       roomlist_iface_init);
@@ -199,6 +202,21 @@ salut_roomlist_channel_class_init (
 {
   GObjectClass *object_class = G_OBJECT_CLASS (salut_roomlist_channel_class);
   GParamSpec *param_spec;
+  static TpDBusPropertiesMixinPropImpl channel_props[] = {
+      { "TargetHandleType", "handle-type", NULL },
+      { "TargetHandle", "handle", NULL },
+      { "ChannelType", "channel-type", NULL },
+      { "Interfaces", "interfaces", NULL },
+      { NULL }
+  };
+  static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
+      { TP_IFACE_CHANNEL,
+        tp_dbus_properties_mixin_getter_gobject_properties,
+        NULL,
+        channel_props,
+      },
+      { NULL }
+  };
 
   g_type_class_add_private (salut_roomlist_channel_class,
       sizeof (SalutRoomlistChannelPrivate));
@@ -229,6 +247,11 @@ salut_roomlist_channel_class_init (
                                     G_PARAM_STATIC_NICK |
                                     G_PARAM_STATIC_BLURB);
   g_object_class_install_property (object_class, PROP_CONNECTION, param_spec);
+
+  salut_roomlist_channel_class->dbus_props_class.interfaces = prop_interfaces;
+  tp_dbus_properties_mixin_class_init (object_class,
+      G_STRUCT_OFFSET (SalutRoomlistChannelClass, dbus_props_class));
+
 }
 
 static void
diff --git a/src/salut-roomlist-channel.h b/src/salut-roomlist-channel.h
index 99f9be9..ae91614 100644
--- a/src/salut-roomlist-channel.h
+++ b/src/salut-roomlist-channel.h
@@ -31,6 +31,7 @@ typedef struct _SalutRoomlistChannelClass SalutRoomlistChannelClass;
 
 struct _SalutRoomlistChannelClass {
     GObjectClass parent_class;
+    TpDBusPropertiesMixinClass dbus_props_class;
 };
 
 struct _SalutRoomlistChannel {
-- 
1.5.6.3




More information about the Telepathy-commits mailing list