[Telepathy-commits] [telepathy-gabble/master] GabbleIMChannel: implement spec 0.17.7 properties

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


20080606125945-53eee-6152c604702c615ec52d40169919240661796bc5.gz
---
 src/gabble-im-channel.c |   22 ++++++++++++++++++++++
 src/gabble-im-channel.h |    1 +
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/src/gabble-im-channel.c b/src/gabble-im-channel.c
index 64c23fa..40ffa5d 100644
--- a/src/gabble-im-channel.c
+++ b/src/gabble-im-channel.c
@@ -40,12 +40,15 @@
 #include <telepathy-glib/interfaces.h>
 #include <telepathy-glib/channel-iface.h>
 #include <telepathy-glib/svc-channel.h>
+#include <telepathy-glib/svc-generic.h>
 
 static void channel_iface_init (gpointer, gpointer);
 static void text_iface_init (gpointer, gpointer);
 static void chat_state_iface_init (gpointer, gpointer);
 
 G_DEFINE_TYPE_WITH_CODE (GabbleIMChannel, gabble_im_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_TEXT, text_iface_init);
     G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL);
@@ -215,6 +218,21 @@ static void gabble_im_channel_finalize (GObject *object);
 static void
 gabble_im_channel_class_init (GabbleIMChannelClass *gabble_im_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_im_channel_class);
   GParamSpec *param_spec;
 
@@ -252,6 +270,10 @@ gabble_im_channel_class_init (GabbleIMChannelClass *gabble_im_channel_class)
   g_object_class_install_property (object_class, PROP_INTERFACES, param_spec);
 
   tp_text_mixin_class_init (object_class, G_STRUCT_OFFSET (GabbleIMChannelClass, text_class));
+
+  gabble_im_channel_class->dbus_props_class.interfaces = prop_interfaces;
+  tp_dbus_properties_mixin_class_init (object_class,
+      G_STRUCT_OFFSET (GabbleIMChannelClass, dbus_props_class));
 }
 
 static void
diff --git a/src/gabble-im-channel.h b/src/gabble-im-channel.h
index 7c5e224..6ec96bd 100644
--- a/src/gabble-im-channel.h
+++ b/src/gabble-im-channel.h
@@ -36,6 +36,7 @@ struct _GabbleIMChannelClass {
     GObjectClass parent_class;
 
     GabbleTextMixinClass text_class;
+    TpDBusPropertiesMixinClass dbus_props_class;
 };
 
 struct _GabbleIMChannel {
-- 
1.5.6.3




More information about the Telepathy-commits mailing list