summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-16 16:49:43 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-17 14:22:30 +0100
commit767fc14eb59e0374e2c0a483f1fe421f810d0c23 (patch)
treea973ce0022f02891df914ee1f2ff84af364b0ddd
parent2d8622ea9cc7a45aefb47b147f8366e51b0a4f3e (diff)
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.
-rw-r--r--docs/reference/telepathy-glib/telepathy-glib-sections.txt4
-rw-r--r--examples/cm/contactlist/conn.h1
-rw-r--r--telepathy-glib/Makefile.am6
-rw-r--r--telepathy-glib/base-call-channel.c1
-rw-r--r--telepathy-glib/base-call-content.h1
-rw-r--r--telepathy-glib/base-call-stream.c1
-rw-r--r--telepathy-glib/base-call-stream.h1
-rw-r--r--telepathy-glib/base-channel.c1
-rw-r--r--telepathy-glib/base-channel.h1
-rw-r--r--telepathy-glib/base-client.h1
-rw-r--r--telepathy-glib/base-connection-manager.c1
-rw-r--r--telepathy-glib/base-media-call-content.c1
-rw-r--r--telepathy-glib/base-media-call-stream.c1
-rw-r--r--telepathy-glib/base-password-channel.c1
-rw-r--r--telepathy-glib/base-password-channel.h1
-rw-r--r--telepathy-glib/base-protocol.h1
-rw-r--r--telepathy-glib/call-content-media-description.c1
-rw-r--r--telepathy-glib/call-content-media-description.h1
-rw-r--r--telepathy-glib/call-stream-endpoint.h1
-rw-r--r--telepathy-glib/core-dbus-properties-mixin-internal.h67
-rw-r--r--telepathy-glib/core-dbus-properties-mixin.c95
-rw-r--r--telepathy-glib/dbus-properties-mixin.c108
-rw-r--r--telepathy-glib/dbus-properties-mixin.h24
-rw-r--r--telepathy-glib/debug-sender.c1
-rw-r--r--telepathy-glib/debug-sender.h1
-rw-r--r--telepathy-glib/group-mixin.c1
-rw-r--r--telepathy-glib/group-mixin.h1
-rw-r--r--telepathy-glib/svc-interface-skeleton.c7
-rw-r--r--telepathy-glib/svc-interface.h2
-rw-r--r--telepathy-glib/telepathy-glib-dbus.h1
-rw-r--r--telepathy-glib/telepathy-glib.h1
-rw-r--r--telepathy-glib/versions/dbus-1.0.abi11
-rw-r--r--telepathy-glib/versions/main-1.0.abi12
-rw-r--r--tests/lib/contacts-conn.h1
-rw-r--r--tests/lib/dbus-tube-chan.h1
-rw-r--r--tests/lib/echo-chan.h1
-rw-r--r--tests/lib/file-transfer-chan.h1
-rw-r--r--tests/lib/room-list-chan.h1
-rw-r--r--tests/lib/simple-account-manager.h2
-rw-r--r--tests/lib/simple-account.h1
-rw-r--r--tests/lib/simple-channel-dispatch-operation.h1
-rw-r--r--tests/lib/simple-channel-dispatcher.h2
-rw-r--r--tests/lib/simple-channel-request.h1
-rw-r--r--tests/lib/stream-tube-chan.h1
-rw-r--r--tests/lib/textchan-group.h1
-rw-r--r--tests/lib/tls-certificate.h1
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 03e4559bf..b6f97903c 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 6bfa53a20..69c2bba6c 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 d9d80e2cd..84ab59e8d 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 20ea4cc17..a13a90003 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 f2e381393..6a7a955da 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 c66602a31..159f7d680 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 6bcd0546b..1d76cf581 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 bd7960a2f..c55f7188b 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 86d04f4a3..e70333bfb 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 752bd1066..0aabeddec 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 c310dc5f5..8e7948115 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 fd871c14a..098269c94 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 d6aa3dbc8..3ecc2dde5 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 d2739f3a4..4422d3e1a 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 2aa743955..51c50871d 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 193d79702..e77ea0809 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 4c3c4d1c0..e3462f641 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 85e673e74..bdcd00496 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 556b51e0c..259c8b3f2 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 359fe2462..000000000
--- 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 5aba77cb3..000000000
--- 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 24ee6ae72..213b904e8 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 5811008a5..6121b69d1 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 14dc2c758..833bc5f2c 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 c6f0cbcf6..31562ee31 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 ffaa35c26..a0f514fc9 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 318c81767..a899b504d 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 9a2a92074..3bcc377b6 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 863f70086..ff281896b 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 b32f58b70..31855798c 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 6e8303c11..78dd96f7b 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 3d05957b7..051e02dc8 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 896f53d87..629893388 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 2d77c4eed..28140550d 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 71800970d..03a1af685 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 5fbe6ee52..927298565 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 19d6c98af..add629740 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 52dbd2e8e..a05921acb 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 cc65f092d..0ed114d41 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 b5da2af5b..a7fdcf233 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 6c6165c11..c5ef51ac1 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 da2140617..ac23f1006 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 60ea3be64..6c53bdc7f 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 26729127a..45bccc938 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 810e00488..90695bd85 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 1de31927a..8549ca59a 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