[Telepathy-commits] [telepathy-gabble/master] GabbleTubesChannel: implement spec 0.17.6 and 0.17.7 Group and Channel properties

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Aug 19 10:53:10 PDT 2008


20080606130020-53eee-d345304b31ccee221f3239a77a4818785cf5a917.gz
---
 src/tubes-channel.c |   24 ++++++++++++++++++++++++
 src/tubes-channel.h |    2 ++
 2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/tubes-channel.c b/src/tubes-channel.c
index 71cdd97..fd84ff9 100644
--- a/src/tubes-channel.c
+++ b/src/tubes-channel.c
@@ -38,6 +38,7 @@
 #include <telepathy-glib/group-mixin.h>
 #include <telepathy-glib/interfaces.h>
 #include <telepathy-glib/svc-channel.h>
+#include <telepathy-glib/svc-generic.h>
 
 #define DEBUG_FLAG GABBLE_DEBUG_TUBES
 
@@ -74,6 +75,8 @@ static void tubes_iface_init (gpointer, gpointer);
 
 G_DEFINE_TYPE_WITH_CODE (GabbleTubesChannel, gabble_tubes_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_TUBES, tubes_iface_init);
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP,
@@ -2394,6 +2397,21 @@ static void
 gabble_tubes_channel_class_init (
     GabbleTubesChannelClass *gabble_tubes_channel_class)
 {
+  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 }
+  };
   GObjectClass *object_class = G_OBJECT_CLASS (gabble_tubes_channel_class);
   GParamSpec *param_spec;
 
@@ -2447,6 +2465,12 @@ gabble_tubes_channel_class_init (
       G_PARAM_STATIC_NICK |
       G_PARAM_STATIC_BLURB);
   g_object_class_install_property (object_class, PROP_MUC, param_spec);
+
+  gabble_tubes_channel_class->dbus_props_class.interfaces = prop_interfaces;
+  tp_dbus_properties_mixin_class_init (object_class,
+      G_STRUCT_OFFSET (GabbleTubesChannelClass, dbus_props_class));
+
+  tp_external_group_mixin_init_dbus_properties (object_class);
 }
 
 void
diff --git a/src/tubes-channel.h b/src/tubes-channel.h
index 5e91c14..35c865c 100644
--- a/src/tubes-channel.h
+++ b/src/tubes-channel.h
@@ -35,6 +35,8 @@ typedef struct _GabbleTubesChannelClass GabbleTubesChannelClass;
 
 struct _GabbleTubesChannelClass {
     GObjectClass parent_class;
+
+    TpDBusPropertiesMixinClass dbus_props_class;
 };
 
 struct _GabbleTubesChannel {
-- 
1.5.6.3




More information about the Telepathy-commits mailing list