diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-02-18 12:22:13 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-02-18 12:22:13 +0000 |
commit | ff9603d3be5513bc75de073b2dc99c3ca7997d37 (patch) | |
tree | 61af3a881a285eac3117f191ec134288ccbf03ea /telepathy-glib/dbus-properties-mixin.h | |
parent | f71e86378b2d6c4e896bf1a3b72d6b2f5c65712b (diff) | |
download | telepathy-glib-ff9603d3be5513bc75de073b2dc99c3ca7997d37.tar.gz |
Make registering DBus.Properties for the mixin more declarative.
The interfaces now just have a gchar * for the name (this avoids having to
fill in computed values, the quark and GType, in class_init - everything
can be static initialization data) and the mixin walks the interface list
at runtime to tag the interface implementation with its corresponding
interface info.
Also, use different user_data for the getter and setter functions, so those
two functions don't have to be tightly coupled.
20080218122213-53eee-c73c34ee631e11c208e6b3020649001a1ba56c7f.gz
Diffstat (limited to 'telepathy-glib/dbus-properties-mixin.h')
-rw-r--r-- | telepathy-glib/dbus-properties-mixin.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/telepathy-glib/dbus-properties-mixin.h b/telepathy-glib/dbus-properties-mixin.h index d51f9503c..16f3d1759 100644 --- a/telepathy-glib/dbus-properties-mixin.h +++ b/telepathy-glib/dbus-properties-mixin.h @@ -54,28 +54,32 @@ void tp_svc_interface_set_dbus_properties_info (GType g_interface, /* ---- Concrete implementation (in GObject subclasses) ------------- */ typedef void (*TpDBusPropertiesMixinGetter) (GObject *object, - GQuark interface, GQuark name, GValue *value, gpointer user_data); + GQuark interface, GQuark name, GValue *value, gpointer getter_data); typedef gboolean (*TpDBusPropertiesMixinSetter) (GObject *object, - GQuark interface, GQuark name, const GValue *value, gpointer user_data, + GQuark interface, GQuark name, const GValue *value, gpointer setter_data, GError **error); typedef struct { const gchar *name; - gpointer data; - gpointer _1; + gpointer getter_data; + gpointer setter_data; + /*<private>*/ + GCallback _1; + GCallback _2; gpointer mixin_priv; } TpDBusPropertiesMixinPropImpl; typedef struct { - GQuark dbus_interface; - GType svc_interface; + const gchar *name; TpDBusPropertiesMixinGetter getter; TpDBusPropertiesMixinSetter setter; TpDBusPropertiesMixinPropImpl *props; - gpointer _1; - gpointer _2; - gpointer _3; + /*<private>*/ + GCallback _1; + GCallback _2; + GCallback _3; + gpointer mixin_priv; } TpDBusPropertiesMixinIfaceImpl; struct _TpDBusPropertiesMixinClass { |