[Pkg-telepathy-commits] [telepathy-glib-1] 186/212: Move TpDBusPropertiesMixin to the -dbus library
Simon McVittie
smcv at debian.org
Wed May 14 12:09:13 UTC 2014
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian
in repository telepathy-glib-1.
commit 29ebd0ca4e9120e62a2667733807848bd1ee315f
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date: Wed Apr 16 16:49:43 2014 +0100
Move TpDBusPropertiesMixin to the -dbus library
It already has private GVariant-based APIs, so we might as well make
them public while we're changing them anyway.
This removes TP_TYPE_DBUS_PROPERTIES_MIXIN_FLAGS (because we don't
run glib-mkenums on the -dbus library) but I doubt anyone actually
used it.
Reviewed-by: Xavier Claessens <xavier.claessens at collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
---
.../telepathy-glib/telepathy-glib-sections.txt | 4 +-
examples/cm/contactlist/conn.h | 1 +
telepathy-glib/Makefile.am | 6 +-
telepathy-glib/base-call-channel.c | 1 +
telepathy-glib/base-call-content.h | 1 -
telepathy-glib/base-call-stream.c | 1 +
telepathy-glib/base-call-stream.h | 1 -
telepathy-glib/base-channel.c | 1 +
telepathy-glib/base-channel.h | 1 -
telepathy-glib/base-client.h | 1 -
telepathy-glib/base-connection-manager.c | 1 +
telepathy-glib/base-media-call-content.c | 1 +
telepathy-glib/base-media-call-stream.c | 1 +
telepathy-glib/base-password-channel.c | 1 +
telepathy-glib/base-password-channel.h | 1 -
telepathy-glib/base-protocol.h | 1 -
telepathy-glib/call-content-media-description.c | 1 +
telepathy-glib/call-content-media-description.h | 1 -
telepathy-glib/call-stream-endpoint.h | 1 -
.../core-dbus-properties-mixin-internal.h | 67 -------------
telepathy-glib/core-dbus-properties-mixin.c | 95 ------------------
telepathy-glib/dbus-properties-mixin.c | 108 ++++++++++++---------
telepathy-glib/dbus-properties-mixin.h | 24 ++++-
telepathy-glib/debug-sender.c | 1 +
telepathy-glib/debug-sender.h | 1 -
telepathy-glib/group-mixin.c | 1 +
telepathy-glib/group-mixin.h | 1 -
telepathy-glib/svc-interface-skeleton.c | 7 +-
telepathy-glib/svc-interface.h | 2 +
telepathy-glib/telepathy-glib-dbus.h | 1 +
telepathy-glib/telepathy-glib.h | 1 -
telepathy-glib/versions/dbus-1.0.abi | 11 +++
telepathy-glib/versions/main-1.0.abi | 12 ---
tests/lib/contacts-conn.h | 1 +
tests/lib/dbus-tube-chan.h | 1 +
tests/lib/echo-chan.h | 1 +
tests/lib/file-transfer-chan.h | 1 +
tests/lib/room-list-chan.h | 1 +
tests/lib/simple-account-manager.h | 2 +-
tests/lib/simple-account.h | 1 +
tests/lib/simple-channel-dispatch-operation.h | 1 +
tests/lib/simple-channel-dispatcher.h | 2 +-
tests/lib/simple-channel-request.h | 1 +
tests/lib/stream-tube-chan.h | 1 +
tests/lib/textchan-group.h | 1 +
tests/lib/tls-certificate.h | 1 +
46 files changed, 127 insertions(+), 247 deletions(-)
diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
index 03e4559..b6f9790 100644
--- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
@@ -1892,7 +1892,6 @@ tp_dbus_name_type_get_type
<FILE>dbus-properties-mixin</FILE>
<TITLE>dbus-properties-mixin</TITLE>
TpDBusPropertiesMixinFlags
-TP_TYPE_DBUS_PROPERTIES_MIXIN_FLAGS
TpDBusPropertiesMixinIfaceInfo
TpDBusPropertiesMixinPropInfo
tp_svc_interface_set_dbus_properties_info
@@ -1907,8 +1906,11 @@ TpDBusPropertiesMixinSetter
tp_dbus_properties_mixin_setter_gobject_properties
tp_dbus_properties_mixin_class_init
tp_dbus_properties_mixin_implement_interface
+tp_dbus_properties_mixin_dup_variant
tp_dbus_properties_mixin_get
+tp_dbus_properties_mixin_dup_all_vardict
tp_dbus_properties_mixin_dup_all
+tp_dbus_properties_mixin_set_variant
tp_dbus_properties_mixin_set
tp_dbus_properties_mixin_fill_properties_hash
tp_dbus_properties_mixin_make_properties_hash
diff --git a/examples/cm/contactlist/conn.h b/examples/cm/contactlist/conn.h
index 6bfa53a..69c2bba 100644
--- a/examples/cm/contactlist/conn.h
+++ b/examples/cm/contactlist/conn.h
@@ -14,6 +14,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
diff --git a/telepathy-glib/Makefile.am b/telepathy-glib/Makefile.am
index d9d80e2..84ab59e 100644
--- a/telepathy-glib/Makefile.am
+++ b/telepathy-glib/Makefile.am
@@ -83,7 +83,6 @@ tpginclude_HEADERS = \
contact-operations.h \
base-contact-list.h \
dbus.h \
- dbus-properties-mixin.h \
dbus-tube-channel.h \
defs.h \
debug.h \
@@ -136,6 +135,7 @@ tpgdbusinclude_HEADERS = \
cli-connection.h \
cli-misc.h \
cli-proxy.h \
+ dbus-properties-mixin.h \
gnio-util.h \
gtypes.h \
interfaces.h \
@@ -190,9 +190,8 @@ libtelepathy_glib_dbus_internal_la_SOURCES = \
cli-channel.c \
cli-connection.c \
cli-misc.c \
- core-dbus-properties-mixin-internal.h \
- core-dbus-properties-mixin.c \
core-proxy.c \
+ dbus-properties-mixin.c \
gnio-util.c \
gtypes.c \
interfaces.c \
@@ -280,7 +279,6 @@ libtelepathy_glib_main_internal_handwritten_source = \
cm-message-internal.h \
dbus.c \
dbus-internal.h \
- dbus-properties-mixin.c \
dbus-tube-channel.c \
debug.c \
debug-client.c \
diff --git a/telepathy-glib/base-call-channel.c b/telepathy-glib/base-call-channel.c
index 20ea4cc..a13a900 100644
--- a/telepathy-glib/base-call-channel.c
+++ b/telepathy-glib/base-call-channel.c
@@ -109,6 +109,7 @@
#include "telepathy-glib/base-call-internal.h"
#include "telepathy-glib/base-media-call-stream.h"
#include "telepathy-glib/base-connection.h"
+#include <telepathy-glib/dbus-properties-mixin.h>
#include "telepathy-glib/debug-internal.h"
#include "telepathy-glib/dbus.h"
#include "telepathy-glib/enums.h"
diff --git a/telepathy-glib/base-call-content.h b/telepathy-glib/base-call-content.h
index f2e3813..6a7a955 100644
--- a/telepathy-glib/base-call-content.h
+++ b/telepathy-glib/base-call-content.h
@@ -31,7 +31,6 @@
#include <telepathy-glib/base-call-stream.h>
#include <telepathy-glib/base-connection.h>
-#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/defs.h>
G_BEGIN_DECLS
diff --git a/telepathy-glib/base-call-stream.c b/telepathy-glib/base-call-stream.c
index c66602a..159f7d6 100644
--- a/telepathy-glib/base-call-stream.c
+++ b/telepathy-glib/base-call-stream.c
@@ -103,6 +103,7 @@
#include "telepathy-glib/base-call-channel.h"
#include "telepathy-glib/base-call-internal.h"
+#include <telepathy-glib/dbus-properties-mixin.h>
#include "telepathy-glib/debug-internal.h"
#include "telepathy-glib/dbus.h"
#include "telepathy-glib/gtypes.h"
diff --git a/telepathy-glib/base-call-stream.h b/telepathy-glib/base-call-stream.h
index 6bcd054..1d76cf5 100644
--- a/telepathy-glib/base-call-stream.h
+++ b/telepathy-glib/base-call-stream.h
@@ -30,7 +30,6 @@
#include <glib-object.h>
#include <telepathy-glib/base-connection.h>
-#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/defs.h>
G_BEGIN_DECLS
diff --git a/telepathy-glib/base-channel.c b/telepathy-glib/base-channel.c
index bd7960a..c55f718 100644
--- a/telepathy-glib/base-channel.c
+++ b/telepathy-glib/base-channel.c
@@ -315,6 +315,7 @@
#include <telepathy-glib/asv.h>
#include <telepathy-glib/base-connection.h>
#include <telepathy-glib/dbus.h>
+#include <telepathy-glib/dbus-properties-mixin.h>
#include "telepathy-glib/group-mixin.h"
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/svc-channel.h>
diff --git a/telepathy-glib/base-channel.h b/telepathy-glib/base-channel.h
index 86d04f4..e70333b 100644
--- a/telepathy-glib/base-channel.h
+++ b/telepathy-glib/base-channel.h
@@ -28,7 +28,6 @@
#include <glib-object.h>
-#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/defs.h>
#include "connection.h"
diff --git a/telepathy-glib/base-client.h b/telepathy-glib/base-client.h
index 752bd10..0aabedd 100644
--- a/telepathy-glib/base-client.h
+++ b/telepathy-glib/base-client.h
@@ -36,7 +36,6 @@
#include <telepathy-glib/connection.h>
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/defs.h>
-#include <telepathy-glib/dbus-properties-mixin.h>
G_BEGIN_DECLS
diff --git a/telepathy-glib/base-connection-manager.c b/telepathy-glib/base-connection-manager.c
index c310dc5..8e79481 100644
--- a/telepathy-glib/base-connection-manager.c
+++ b/telepathy-glib/base-connection-manager.c
@@ -39,6 +39,7 @@
#include <dbus/dbus-protocol.h>
+#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/svc-connection-manager.h>
diff --git a/telepathy-glib/base-media-call-content.c b/telepathy-glib/base-media-call-content.c
index fd871c1..098269c 100644
--- a/telepathy-glib/base-media-call-content.c
+++ b/telepathy-glib/base-media-call-content.c
@@ -65,6 +65,7 @@
#include "telepathy-glib/base-connection.h"
#include "telepathy-glib/base-media-call-stream.h"
#include "telepathy-glib/dbus.h"
+#include <telepathy-glib/dbus-properties-mixin.h>
#include "telepathy-glib/debug-internal.h"
#include "telepathy-glib/dtmf.h"
#include "telepathy-glib/gtypes.h"
diff --git a/telepathy-glib/base-media-call-stream.c b/telepathy-glib/base-media-call-stream.c
index d6aa3db..3ecc2dd 100644
--- a/telepathy-glib/base-media-call-stream.c
+++ b/telepathy-glib/base-media-call-stream.c
@@ -156,6 +156,7 @@
#include "telepathy-glib/base-media-call-channel.h"
#include "telepathy-glib/call-stream-endpoint.h"
#include "telepathy-glib/dbus.h"
+#include <telepathy-glib/dbus-properties-mixin.h>
#include "telepathy-glib/debug-internal.h"
#include "telepathy-glib/enums.h"
#include "telepathy-glib/gtypes.h"
diff --git a/telepathy-glib/base-password-channel.c b/telepathy-glib/base-password-channel.c
index d2739f3..4422d3e 100644
--- a/telepathy-glib/base-password-channel.c
+++ b/telepathy-glib/base-password-channel.c
@@ -58,6 +58,7 @@
#include <telepathy-glib/asv.h>
#include <telepathy-glib/dbus.h>
+#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/util.h>
diff --git a/telepathy-glib/base-password-channel.h b/telepathy-glib/base-password-channel.h
index 2aa7439..51c5087 100644
--- a/telepathy-glib/base-password-channel.h
+++ b/telepathy-glib/base-password-channel.h
@@ -27,7 +27,6 @@
#include <glib-object.h>
#include <telepathy-glib/base-channel.h>
-#include <telepathy-glib/dbus-properties-mixin.h>
G_BEGIN_DECLS
diff --git a/telepathy-glib/base-protocol.h b/telepathy-glib/base-protocol.h
index 193d797..e77ea08 100644
--- a/telepathy-glib/base-protocol.h
+++ b/telepathy-glib/base-protocol.h
@@ -28,7 +28,6 @@
#include <glib-object.h>
#include <telepathy-glib/base-connection.h>
-#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/defs.h>
#include <telepathy-glib/presence-mixin.h>
diff --git a/telepathy-glib/call-content-media-description.c b/telepathy-glib/call-content-media-description.c
index 4c3c4d1..e3462f6 100644
--- a/telepathy-glib/call-content-media-description.c
+++ b/telepathy-glib/call-content-media-description.c
@@ -57,6 +57,7 @@
#include "telepathy-glib/base-call-internal.h"
#include "telepathy-glib/debug-internal.h"
#include "telepathy-glib/dbus.h"
+#include <telepathy-glib/dbus-properties-mixin.h>
#include "telepathy-glib/gtypes.h"
#include "telepathy-glib/handle.h"
#include "telepathy-glib/interfaces.h"
diff --git a/telepathy-glib/call-content-media-description.h b/telepathy-glib/call-content-media-description.h
index 85e673e..bdcd004 100644
--- a/telepathy-glib/call-content-media-description.h
+++ b/telepathy-glib/call-content-media-description.h
@@ -31,7 +31,6 @@
#include <gio/gio.h>
#include <telepathy-glib/dbus.h>
-#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/defs.h>
#include <telepathy-glib/handle.h>
diff --git a/telepathy-glib/call-stream-endpoint.h b/telepathy-glib/call-stream-endpoint.h
index 556b51e..259c8b3 100644
--- a/telepathy-glib/call-stream-endpoint.h
+++ b/telepathy-glib/call-stream-endpoint.h
@@ -28,7 +28,6 @@
#include <glib-object.h>
#include <telepathy-glib/dbus.h>
-#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/defs.h>
#include <telepathy-glib/enums.h>
diff --git a/telepathy-glib/core-dbus-properties-mixin-internal.h b/telepathy-glib/core-dbus-properties-mixin-internal.h
deleted file mode 100644
index 359fe24..0000000
--- a/telepathy-glib/core-dbus-properties-mixin-internal.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*<private_header>*/
-/*
- * Copyright © 2014 Collabora Ltd.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef __TP_CORE_DBUS_PROPERTIES_MIXIN_H__
-#define __TP_CORE_DBUS_PROPERTIES_MIXIN_H__
-
-#include <glib.h>
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-typedef struct {
- const gchar *version;
-
- GVariant *(*dup_variant) (GObject *object,
- const gchar *interface_name,
- const gchar *property_name,
- GError **error);
-
- gboolean (*set_variant) (GObject *object,
- const gchar *interface_name,
- const gchar *property_name,
- GVariant *value,
- GError **error);
-
- GVariant *(*dup_all_vardict) (GObject *object,
- const gchar *interface_name);
-
- gsize size;
-} TpDBusPropertiesMixinImpl;
-
-GVariant *_tp_dbus_properties_mixin_dup_in_dbus_lib (GObject *object,
- const gchar *interface_name,
- const gchar *property_name,
- GError **error);
-
-gboolean _tp_dbus_properties_mixin_set_in_dbus_lib (GObject *object,
- const gchar *interface_name,
- const gchar *property_name,
- GVariant *value,
- GError **error);
-
-GVariant *_tp_dbus_properties_mixin_dup_all_in_dbus_lib (GObject *object,
- const gchar *interface_name);
-
-void tp_private_dbus_properties_mixin_set_implementation (
- const TpDBusPropertiesMixinImpl *real_impl);
-
-G_END_DECLS
-
-#endif
diff --git a/telepathy-glib/core-dbus-properties-mixin.c b/telepathy-glib/core-dbus-properties-mixin.c
deleted file mode 100644
index 5aba77c..0000000
--- a/telepathy-glib/core-dbus-properties-mixin.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright © 2014 Collabora Ltd.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#include <telepathy-glib/core-dbus-properties-mixin-internal.h>
-
-#include <gio/gio.h>
-
-#include <telepathy-glib/errors.h>
-
-static TpDBusPropertiesMixinImpl impl = { NULL };
-
-GVariant *
-_tp_dbus_properties_mixin_dup_in_dbus_lib (GObject *object,
- const gchar *interface_name,
- const gchar *property_name,
- GError **error)
-{
- if (impl.version == NULL)
- {
- /* deliberately not using TP_ERROR to avoid a cross-library reference
- * in the wrong direction */
- g_dbus_error_set_dbus_error (error, TP_ERROR_STR_NOT_IMPLEMENTED,
- "No properties registered with TpDBusPropertiesMixin", NULL);
- return NULL;
- }
- else
- {
- return impl.dup_variant (object, interface_name, property_name, error);
- }
-}
-
-gboolean
-_tp_dbus_properties_mixin_set_in_dbus_lib (GObject *object,
- const gchar *interface_name,
- const gchar *property_name,
- GVariant *value,
- GError **error)
-{
- if (impl.version == NULL)
- {
- g_dbus_error_set_dbus_error (error, TP_ERROR_STR_NOT_IMPLEMENTED,
- "No properties registered with TpDBusPropertiesMixin", NULL);
- return FALSE;
- }
- else
- {
- return impl.set_variant (object, interface_name, property_name,
- value, error);
- }
-}
-
-GVariant *
-_tp_dbus_properties_mixin_dup_all_in_dbus_lib (GObject *object,
- const gchar *interface_name)
-{
- if (impl.version == NULL)
- {
- /* GetAll() always succeeds */
- return g_variant_new ("a{sv}", NULL);
- }
- else
- {
- return impl.dup_all_vardict (object, interface_name);
- }
-}
-
-void
-tp_private_dbus_properties_mixin_set_implementation (
- const TpDBusPropertiesMixinImpl *real_impl)
-{
- g_assert (g_str_equal (real_impl->version, VERSION));
- g_assert (real_impl->size == sizeof (impl));
- g_assert (real_impl->dup_variant != NULL);
- g_assert (real_impl->set_variant != NULL);
- g_assert (real_impl->dup_all_vardict != NULL);
-
- impl = *real_impl;
-}
diff --git a/telepathy-glib/dbus-properties-mixin.c b/telepathy-glib/dbus-properties-mixin.c
index 24ee6ae..213b904 100644
--- a/telepathy-glib/dbus-properties-mixin.c
+++ b/telepathy-glib/dbus-properties-mixin.c
@@ -29,12 +29,20 @@
#include <telepathy-glib/svc-interface.h>
#include <telepathy-glib/util.h>
-#define DEBUG_FLAG TP_DEBUG_PROPERTIES
-#include <telepathy-glib/core-dbus-properties-mixin-internal.h>
#include "telepathy-glib/dbus-internal.h"
-#include "telepathy-glib/debug-internal.h"
#include <telepathy-glib/object-registration-internal.h>
+/* no debug infrastructure here, this is the -dbus library */
+#define DEBUG(format, ...) \
+ g_log (G_LOG_DOMAIN "/properties", G_LOG_LEVEL_DEBUG, "%s: " format, \
+ G_STRFUNC, ##__VA_ARGS__)
+#define CRITICAL(format, ...) \
+ g_log (G_LOG_DOMAIN "/properties", G_LOG_LEVEL_CRITICAL, "%s: " format, \
+ G_STRFUNC, ##__VA_ARGS__)
+#define WARNING(format, ...) \
+ g_log (G_LOG_DOMAIN "/properties", G_LOG_LEVEL_WARNING, "%s: " format, \
+ G_STRFUNC, ##__VA_ARGS__)
+
/**
* SECTION:dbus-properties-mixin
* @title: TpDBusPropertiesMixin
@@ -80,21 +88,10 @@
* %TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_INVALIDATED may be specified for a
* property.
*
- * Since 0.11.5, there is a corresponding #GFlagsClass type,
- * %TP_TYPE_DBUS_PROPERTIES_MIXIN_FLAGS.
- *
* Since: 0.7.3
*/
/**
- * TP_TYPE_DBUS_PROPERTIES_MIXIN_FLAGS:
- *
- * The #GFlagsClass type of #TpDBusPropertiesMixinFlags.
- *
- * Since: 0.11.5
- */
-
-/**
* TpDBusPropertiesMixinPropInfo:
* @name: Quark representing the property's name
* @flags: Flags representing read/write access to the property
@@ -265,8 +262,6 @@ tp_dbus_properties_mixin_setter_gobject_properties (GObject *object,
* Since: 0.7.3
*/
-static void tp_dbus_properties_mixin_hook_to_dbus_library (void);
-
static GQuark
_prop_mixin_offset_quark (void)
{
@@ -418,8 +413,6 @@ tp_dbus_properties_mixin_implement_interface (GObjectClass *cls,
g_return_if_fail (G_IS_OBJECT_CLASS (cls));
- tp_dbus_properties_mixin_hook_to_dbus_library ();
-
/* never freed - intentional per-class leak */
iface_impl = g_new0 (TpDBusPropertiesMixinIfaceImpl, 1);
iface_impl->name = g_quark_to_string (iface);
@@ -538,8 +531,6 @@ tp_dbus_properties_mixin_class_init (GObjectClass *cls,
g_return_if_fail (g_type_get_qdata (type, q) == NULL);
g_type_set_qdata (type, q, GSIZE_TO_POINTER (offset));
- tp_dbus_properties_mixin_hook_to_dbus_library ();
-
if (offset == 0)
return;
@@ -1214,8 +1205,23 @@ out:
return ret;
}
-static GVariant *
-_tp_dbus_properties_mixin_dup_variant (GObject *object,
+/**
+ * tp_dbus_properties_mixin_dup_variant:
+ * @object: an object with this mixin
+ * @interface_name: a D-Bus interface name
+ * @property_name: a D-Bus property name
+ * @error: used to return an error on failure
+ *
+ * Get the value of the property @property_name on @interface_name, as if
+ * by calling the D-Bus method org.freedesktop.DBus.Properties.Get.
+ *
+ * If Get would return a D-Bus error, %NULL is returned and @error
+ * is filled in instead.
+ *
+ * Returns: (transfer full) (allow-none): a reference to a #GVariant, or %NULL
+ */
+GVariant *
+tp_dbus_properties_mixin_dup_variant (GObject *object,
const gchar *interface_name,
const gchar *property_name,
GError **error)
@@ -1233,8 +1239,24 @@ _tp_dbus_properties_mixin_dup_variant (GObject *object,
return ret;
}
-static gboolean
-_tp_dbus_properties_mixin_set_variant (GObject *object,
+/**
+ * tp_dbus_properties_mixin_set_variant:
+ * @object: an object with this mixin
+ * @interface_name: a D-Bus interface name
+ * @property_name: a D-Bus property name
+ * @value: a #GVariant containing the new value for this property;
+ * if it is floating, ownership will be taken
+ * @error: used to return an error on failure
+ *
+ * Sets a property to the value specified by @value, as if by
+ * calling the D-Bus method org.freedesktop.DBus.Properties.Set.
+ *
+ * If Set would return a D-Bus error, sets @error and returns %FALSE
+ *
+ * Returns: %TRUE on success; %FALSE (setting @error) on failure
+ */
+gboolean
+tp_dbus_properties_mixin_set_variant (GObject *object,
const gchar *interface_name,
const gchar *property_name,
GVariant *value,
@@ -1254,8 +1276,21 @@ _tp_dbus_properties_mixin_set_variant (GObject *object,
return ret;
}
-static GVariant *
-_tp_dbus_properties_mixin_dup_all_vardict (GObject *object,
+/**
+ * tp_dbus_properties_mixin_dup_all_vardict:
+ * @object: an object with this mixin
+ * @interface_name: a D-Bus interface name
+ *
+ * Get all the properties of a particular interface, as if by
+ * calling the D-Bus method org.freedesktop.DBus.Properties.GetAll.
+ * This implementation
+ * never returns an error: it will return an empty map if the interface
+ * is unknown.
+ *
+ * Returns: (transfer full): a variant of type %G_VARIANT_TYPE_VARDICT
+ */
+GVariant *
+tp_dbus_properties_mixin_dup_all_vardict (GObject *object,
const gchar *interface_name)
{
GVariant *ret;
@@ -1266,24 +1301,3 @@ _tp_dbus_properties_mixin_dup_all_vardict (GObject *object,
g_hash_table_unref (asv);
return ret;
}
-
-static TpDBusPropertiesMixinImpl impl = { NULL };
-
-static void
-tp_dbus_properties_mixin_hook_to_dbus_library (void)
-{
- static gsize done = 0;
-
- if (g_once_init_enter (&done))
- {
- impl.dup_variant = _tp_dbus_properties_mixin_dup_variant;
- impl.set_variant = _tp_dbus_properties_mixin_set_variant;
- impl.dup_all_vardict = _tp_dbus_properties_mixin_dup_all_vardict;
- impl.version = VERSION;
- impl.size = sizeof (impl);
-
- tp_private_dbus_properties_mixin_set_implementation (&impl);
-
- g_once_init_leave (&done, 1);
- }
-}
diff --git a/telepathy-glib/dbus-properties-mixin.h b/telepathy-glib/dbus-properties-mixin.h
index 5811008..6121b69 100644
--- a/telepathy-glib/dbus-properties-mixin.h
+++ b/telepathy-glib/dbus-properties-mixin.h
@@ -18,8 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#if !defined (_TP_GLIB_H_INSIDE) && !defined (_TP_COMPILATION)
-#error "Only <telepathy-glib/telepathy-glib.h> can be included directly."
+#if !defined (_TP_GLIB_DBUS_H_INSIDE) && !defined (_TP_COMPILATION)
+#error "Only <telepathy-glib/telepathy-glib-dbus.h> can be included directly."
#endif
#ifndef __TP_DBUS_PROPERTIES_MIXIN_H__
@@ -27,8 +27,7 @@
#include <glib-object.h>
-#include <telepathy-glib/defs.h>
-#include <telepathy-glib/_gen/genums.h>
+#include <telepathy-glib/telepathy-glib.h>
G_BEGIN_DECLS
@@ -121,6 +120,13 @@ void tp_dbus_properties_mixin_implement_interface (GObjectClass *cls,
gboolean tp_dbus_properties_mixin_get (GObject *self,
const gchar *interface_name, const gchar *property_name,
GValue *value, GError **error);
+
+GVariant *tp_dbus_properties_mixin_dup_variant (GObject *object,
+ const gchar *interface_name,
+ const gchar *property_name,
+ GError **error)
+ G_GNUC_WARN_UNUSED_RESULT;
+
_TP_AVAILABLE_IN_0_16
gboolean tp_dbus_properties_mixin_set (
GObject *self,
@@ -129,10 +135,20 @@ gboolean tp_dbus_properties_mixin_set (
const GValue *value,
GError **error);
+gboolean tp_dbus_properties_mixin_set_variant (GObject *object,
+ const gchar *interface_name,
+ const gchar *property_name,
+ GVariant *value,
+ GError **error);
+
_TP_AVAILABLE_IN_0_22
GHashTable *tp_dbus_properties_mixin_dup_all (GObject *self,
const gchar *interface_name);
+GVariant *tp_dbus_properties_mixin_dup_all_vardict (GObject *object,
+ const gchar *interface_name)
+ G_GNUC_WARN_UNUSED_RESULT;
+
GHashTable *tp_dbus_properties_mixin_make_properties_hash (
GObject *object, const gchar *first_interface,
const gchar *first_property, ...)
diff --git a/telepathy-glib/debug-sender.c b/telepathy-glib/debug-sender.c
index 14dc2c7..833bc5f 100644
--- a/telepathy-glib/debug-sender.c
+++ b/telepathy-glib/debug-sender.c
@@ -22,6 +22,7 @@
#include "debug-sender.h"
#include <telepathy-glib/dbus.h>
+#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/defs.h>
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/interfaces.h>
diff --git a/telepathy-glib/debug-sender.h b/telepathy-glib/debug-sender.h
index c6f0cbc..31562ee 100644
--- a/telepathy-glib/debug-sender.h
+++ b/telepathy-glib/debug-sender.h
@@ -26,7 +26,6 @@
#include <glib-object.h>
-#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/defs.h>
#include <telepathy-glib/enums.h>
diff --git a/telepathy-glib/group-mixin.c b/telepathy-glib/group-mixin.c
index ffaa35c..a0f514f 100644
--- a/telepathy-glib/group-mixin.c
+++ b/telepathy-glib/group-mixin.c
@@ -67,6 +67,7 @@
#include <telepathy-glib/asv.h>
#include <telepathy-glib/base-channel.h>
#include <telepathy-glib/dbus.h>
+#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/errors.h>
#include <telepathy-glib/gtypes.h>
#include <telepathy-glib/interfaces.h>
diff --git a/telepathy-glib/group-mixin.h b/telepathy-glib/group-mixin.h
index 318c817..a899b50 100644
--- a/telepathy-glib/group-mixin.h
+++ b/telepathy-glib/group-mixin.h
@@ -27,7 +27,6 @@
#ifndef __TP_GROUP_MIXIN_H__
#define __TP_GROUP_MIXIN_H__
-#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/handle-repo.h>
#include <telepathy-glib/util.h>
diff --git a/telepathy-glib/svc-interface-skeleton.c b/telepathy-glib/svc-interface-skeleton.c
index 9a2a920..3bcc377 100644
--- a/telepathy-glib/svc-interface-skeleton.c
+++ b/telepathy-glib/svc-interface-skeleton.c
@@ -22,7 +22,6 @@
#include <dbus/dbus-glib.h>
#include <telepathy-glib/asv.h>
-#include <telepathy-glib/core-dbus-properties-mixin-internal.h>
#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/variant-util.h>
@@ -111,7 +110,7 @@ tp_svc_interface_skeleton_get_property (GDBusConnection *connection,
object = g_weak_ref_get (&self->priv->object);
g_return_val_if_fail (object != NULL, NULL);
- ret = _tp_dbus_properties_mixin_dup_in_dbus_lib (object, interface_name,
+ ret = tp_dbus_properties_mixin_dup_variant (object, interface_name,
property_name, error);
g_object_unref (object);
@@ -139,7 +138,7 @@ tp_svc_interface_skeleton_set_property (GDBusConnection *connection,
object = g_weak_ref_get (&self->priv->object);
g_return_val_if_fail (object != NULL, FALSE);
- ret = _tp_dbus_properties_mixin_set_in_dbus_lib (object, interface_name,
+ ret = tp_dbus_properties_mixin_set_variant (object, interface_name,
property_name, variant, error);
g_object_unref (object);
@@ -173,7 +172,7 @@ tp_svc_interface_skeleton_get_properties (GDBusInterfaceSkeleton *skel)
/* For now assume we have the TpDBusPropertiesMixin if we have
* any properties at all. This never returns NULL. */
- ret = _tp_dbus_properties_mixin_dup_all_in_dbus_lib (object, iface_name);
+ ret = tp_dbus_properties_mixin_dup_all_vardict (object, iface_name);
g_object_unref (object);
return ret;
}
diff --git a/telepathy-glib/svc-interface.h b/telepathy-glib/svc-interface.h
index 863f700..ff28189 100644
--- a/telepathy-glib/svc-interface.h
+++ b/telepathy-glib/svc-interface.h
@@ -27,6 +27,8 @@
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/dbus-properties-mixin.h>
+
G_BEGIN_DECLS
typedef struct _TpSvcInterfaceInfo TpSvcInterfaceInfo;
diff --git a/telepathy-glib/telepathy-glib-dbus.h b/telepathy-glib/telepathy-glib-dbus.h
index b32f58b..3185579 100644
--- a/telepathy-glib/telepathy-glib-dbus.h
+++ b/telepathy-glib/telepathy-glib-dbus.h
@@ -56,6 +56,7 @@
#include <telepathy-glib/_gen/tp-cli-logger.h>
/* service-side */
+#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/svc-account.h>
#include <telepathy-glib/svc-account-manager.h>
#include <telepathy-glib/svc-call.h>
diff --git a/telepathy-glib/telepathy-glib.h b/telepathy-glib/telepathy-glib.h
index 6e8303c..78dd96f 100644
--- a/telepathy-glib/telepathy-glib.h
+++ b/telepathy-glib/telepathy-glib.h
@@ -74,7 +74,6 @@
#include <telepathy-glib/contact-search.h>
#include <telepathy-glib/contact.h>
#include <telepathy-glib/dbus.h>
-#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/dbus-tube-channel.h>
#include <telepathy-glib/debug-client.h>
#include <telepathy-glib/debug-message.h>
diff --git a/telepathy-glib/versions/dbus-1.0.abi b/telepathy-glib/versions/dbus-1.0.abi
index 3d05957..051e02d 100644
--- a/telepathy-glib/versions/dbus-1.0.abi
+++ b/telepathy-glib/versions/dbus-1.0.abi
@@ -295,6 +295,17 @@ tp_cli_protocol_call_normalize_contact
tp_cli_protocol_interface_addressing1_call_normalize_contact_uri
tp_cli_protocol_interface_addressing1_call_normalize_vcard_address
tp_dbus_g_method_return_not_implemented
+tp_dbus_properties_mixin_class_init
+tp_dbus_properties_mixin_dup_all
+tp_dbus_properties_mixin_emit_properties_changed
+tp_dbus_properties_mixin_emit_properties_changed_varargs
+tp_dbus_properties_mixin_fill_properties_hash
+tp_dbus_properties_mixin_get
+tp_dbus_properties_mixin_getter_gobject_properties
+tp_dbus_properties_mixin_implement_interface
+tp_dbus_properties_mixin_make_properties_hash
+tp_dbus_properties_mixin_set
+tp_dbus_properties_mixin_setter_gobject_properties
tp_dbus_specialized_value_slice_new
tp_g_socket_address_from_g_variant
tp_g_socket_address_from_variant
diff --git a/telepathy-glib/versions/main-1.0.abi b/telepathy-glib/versions/main-1.0.abi
index 896f53d..6298933 100644
--- a/telepathy-glib/versions/main-1.0.abi
+++ b/telepathy-glib/versions/main-1.0.abi
@@ -759,18 +759,6 @@ tp_dbus_connection_unregister_object
tp_dbus_error_get_type
tp_dbus_errors_quark
tp_dbus_name_type_get_type
-tp_dbus_properties_mixin_class_init
-tp_dbus_properties_mixin_dup_all
-tp_dbus_properties_mixin_emit_properties_changed
-tp_dbus_properties_mixin_emit_properties_changed_varargs
-tp_dbus_properties_mixin_fill_properties_hash
-tp_dbus_properties_mixin_flags_get_type
-tp_dbus_properties_mixin_get
-tp_dbus_properties_mixin_getter_gobject_properties
-tp_dbus_properties_mixin_implement_interface
-tp_dbus_properties_mixin_make_properties_hash
-tp_dbus_properties_mixin_set
-tp_dbus_properties_mixin_setter_gobject_properties
tp_dbus_tube_channel_accept_async
tp_dbus_tube_channel_accept_finish
tp_dbus_tube_channel_dup_parameters
diff --git a/tests/lib/contacts-conn.h b/tests/lib/contacts-conn.h
index 2d77c4e..2814055 100644
--- a/tests/lib/contacts-conn.h
+++ b/tests/lib/contacts-conn.h
@@ -14,6 +14,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
#include "simple-conn.h"
#include "contact-list-manager.h"
diff --git a/tests/lib/dbus-tube-chan.h b/tests/lib/dbus-tube-chan.h
index 7180097..03a1af6 100644
--- a/tests/lib/dbus-tube-chan.h
+++ b/tests/lib/dbus-tube-chan.h
@@ -13,6 +13,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
diff --git a/tests/lib/echo-chan.h b/tests/lib/echo-chan.h
index 5fbe6ee..9272985 100644
--- a/tests/lib/echo-chan.h
+++ b/tests/lib/echo-chan.h
@@ -14,6 +14,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
diff --git a/tests/lib/file-transfer-chan.h b/tests/lib/file-transfer-chan.h
index 19d6c98..add6297 100644
--- a/tests/lib/file-transfer-chan.h
+++ b/tests/lib/file-transfer-chan.h
@@ -14,6 +14,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
diff --git a/tests/lib/room-list-chan.h b/tests/lib/room-list-chan.h
index 52dbd2e..a05921a 100644
--- a/tests/lib/room-list-chan.h
+++ b/tests/lib/room-list-chan.h
@@ -4,6 +4,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
diff --git a/tests/lib/simple-account-manager.h b/tests/lib/simple-account-manager.h
index cc65f09..0ed114d 100644
--- a/tests/lib/simple-account-manager.h
+++ b/tests/lib/simple-account-manager.h
@@ -14,7 +14,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
-
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
diff --git a/tests/lib/simple-account.h b/tests/lib/simple-account.h
index b5da2af..a7fdcf2 100644
--- a/tests/lib/simple-account.h
+++ b/tests/lib/simple-account.h
@@ -14,6 +14,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
diff --git a/tests/lib/simple-channel-dispatch-operation.h b/tests/lib/simple-channel-dispatch-operation.h
index 6c6165c..c5ef51a 100644
--- a/tests/lib/simple-channel-dispatch-operation.h
+++ b/tests/lib/simple-channel-dispatch-operation.h
@@ -15,6 +15,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
diff --git a/tests/lib/simple-channel-dispatcher.h b/tests/lib/simple-channel-dispatcher.h
index da21406..ac23f10 100644
--- a/tests/lib/simple-channel-dispatcher.h
+++ b/tests/lib/simple-channel-dispatcher.h
@@ -13,7 +13,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
-
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
diff --git a/tests/lib/simple-channel-request.h b/tests/lib/simple-channel-request.h
index 60ea3be..6c53bdc 100644
--- a/tests/lib/simple-channel-request.h
+++ b/tests/lib/simple-channel-request.h
@@ -14,6 +14,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
#include "simple-conn.h"
diff --git a/tests/lib/stream-tube-chan.h b/tests/lib/stream-tube-chan.h
index 2672912..45bccc9 100644
--- a/tests/lib/stream-tube-chan.h
+++ b/tests/lib/stream-tube-chan.h
@@ -13,6 +13,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
diff --git a/tests/lib/textchan-group.h b/tests/lib/textchan-group.h
index 810e004..90695bd 100644
--- a/tests/lib/textchan-group.h
+++ b/tests/lib/textchan-group.h
@@ -14,6 +14,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
diff --git a/tests/lib/tls-certificate.h b/tests/lib/tls-certificate.h
index 1de3192..8549ca5 100644
--- a/tests/lib/tls-certificate.h
+++ b/tests/lib/tls-certificate.h
@@ -24,6 +24,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-glib-1.git
More information about the Pkg-telepathy-commits
mailing list