[Telepathy-commits] [telepathy-salut/master] SalutImChannel: export D-Bus properties for spec 0.17.7
Simon McVittie
simon.mcvittie at collabora.co.uk
Wed Aug 13 11:09:24 PDT 2008
20080609092439-53eee-e58947b32a94778178fc2b6c30289727701fc9e3.gz
Signed-off-by: Sjoerd Simons <sjoerd.simons at collabora.co.uk>
---
src/salut-im-channel.c | 22 ++++++++++++++++++++++
src/salut-im-channel.h | 2 ++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/src/salut-im-channel.c b/src/salut-im-channel.c
index 3eb0c29..265ab23 100644
--- a/src/salut-im-channel.c
+++ b/src/salut-im-channel.c
@@ -46,6 +46,7 @@
#include <telepathy-glib/channel-iface.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/dbus.h>
+#include <telepathy-glib/svc-generic.h>
static void channel_iface_init (gpointer g_iface, gpointer iface_data);
static void text_iface_init (gpointer g_iface, gpointer iface_data);
@@ -57,6 +58,8 @@ static void xmpp_connection_manager_new_connection_cb (
static void _setup_connection (SalutImChannel *self);
G_DEFINE_TYPE_WITH_CODE (SalutImChannel, salut_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_CHANNEL_IFACE, NULL);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TEXT, text_iface_init);
@@ -336,6 +339,21 @@ salut_im_channel_class_init (SalutImChannelClass *salut_im_channel_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (salut_im_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_im_channel_class,
sizeof (SalutImChannelPrivate));
@@ -401,6 +419,10 @@ salut_im_channel_class_init (SalutImChannelClass *salut_im_channel_class)
tp_text_mixin_class_init (object_class,
G_STRUCT_OFFSET (SalutImChannelClass, text_class));
+
+ salut_im_channel_class->dbus_props_class.interfaces = prop_interfaces;
+ tp_dbus_properties_mixin_class_init (object_class,
+ G_STRUCT_OFFSET (SalutImChannelClass, dbus_props_class));
}
void
diff --git a/src/salut-im-channel.h b/src/salut-im-channel.h
index d9def50..425bb6b 100644
--- a/src/salut-im-channel.h
+++ b/src/salut-im-channel.h
@@ -33,7 +33,9 @@ typedef struct _SalutImChannelClass SalutImChannelClass;
struct _SalutImChannelClass {
GObjectClass parent_class;
+
TpTextMixinClass text_class;
+ TpDBusPropertiesMixinClass dbus_props_class;
};
struct _SalutImChannel {
--
1.5.6.3
More information about the Telepathy-commits
mailing list