summaryrefslogtreecommitdiff
path: root/tests/dbus/connection_client.c-expected
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2021-08-07 16:43:00 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2021-10-31 16:19:59 +0000
commitc710c5ea6e83e26e7c6305e151c3e31255690257 (patch)
treed459cc7dd7fe178d4f6b5f26965d77045aea2e4f /tests/dbus/connection_client.c-expected
parentc5729675c36d34e89ea056da9875263476992253 (diff)
downloadvala-c710c5ea6e83e26e7c6305e151c3e31255690257.tar.gz
Update expected C sourcestintou/gdbus-properties
Diffstat (limited to 'tests/dbus/connection_client.c-expected')
-rw-r--r--tests/dbus/connection_client.c-expected85
1 files changed, 84 insertions, 1 deletions
diff --git a/tests/dbus/connection_client.c-expected b/tests/dbus/connection_client.c-expected
index d25dbb971..6a8981ae6 100644
--- a/tests/dbus/connection_client.c-expected
+++ b/tests/dbus/connection_client.c-expected
@@ -27,6 +27,11 @@ typedef struct _TestIface TestIface;
#define TYPE_TEST_PROXY (test_proxy_get_type ())
typedef GDBusProxy TestProxy;
typedef GDBusProxyClass TestProxyClass;
+enum {
+ TEST_PROXY_0_PROPERTY,
+ TEST_PROXY_NUM_PROPERTIES
+};
+static GParamSpec* test_proxy_properties[TEST_PROXY_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
@@ -47,10 +52,22 @@ VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gint test_get_test (Test* self,
GError** error);
static GType test_get_type_once (void);
+static GParamSpec * _vala_test_find_property_from_dbus_name (const gchar * dbus_property_name);
+static void test_proxy_get_property (GObject* object,
+ guint property_id,
+ GValue* value,
+ GParamSpec* pspec);
+static void test_proxy_set_property (GObject* object,
+ guint property_id,
+ const GValue* value,
+ GParamSpec* pspec);
static void test_proxy_g_signal (GDBusProxy* proxy,
const gchar* sender_name,
const gchar* signal_name,
GVariant* parameters);
+static void test_proxy_g_properties_changed (GDBusProxy* proxy,
+ GVariant* changed_properties,
+ const gchar* const* invalidated_properties);
static gint test_proxy_get_test (Test* self,
GError** error);
static void test_proxy_test_interface_init (TestIface* iface);
@@ -142,7 +159,48 @@ G_DEFINE_TYPE_EXTENDED (TestProxy, test_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT
static void
test_proxy_class_init (TestProxyClass* klass)
{
- G_DBUS_PROXY_CLASS (klass)->g_signal = test_proxy_g_signal;
+ GDBusProxyClass * proxy_class = G_DBUS_PROXY_CLASS (klass);
+ GObjectClass * object_class = G_OBJECT_CLASS (klass);
+ proxy_class->g_signal = test_proxy_g_signal;
+ proxy_class->g_properties_changed = test_proxy_g_properties_changed;
+ object_class->get_property = test_proxy_get_property;
+ object_class->set_property = test_proxy_set_property;
+}
+
+static GParamSpec *
+_vala_test_find_property_from_dbus_name (const gchar * dbus_property_name)
+{
+ return NULL;
+}
+
+static void
+test_proxy_get_property (GObject* object,
+ guint property_id,
+ GValue* value,
+ GParamSpec* pspec)
+{
+ Test * self;
+ GVariant * variant;
+ const gchar * dbus_property_name = NULL;
+ self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_TEST, Test);
+ switch (property_id) {
+ default:
+ return;
+ }
+}
+
+static void
+test_proxy_set_property (GObject* object,
+ guint property_id,
+ const GValue* value,
+ GParamSpec* pspec)
+{
+ Test * self;
+ self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_TEST, Test);
+ switch (property_id) {
+ default:
+ return;
+ }
}
static void
@@ -154,6 +212,31 @@ test_proxy_g_signal (GDBusProxy* proxy,
}
static void
+test_proxy_g_properties_changed (GDBusProxy* proxy,
+ GVariant* changed_properties,
+ const gchar* const* invalidated_properties)
+{
+ GVariantIter * iter;
+ const gchar * key;
+ GParamSpec * pspec;
+ guint n;
+ g_variant_get (changed_properties, "a{sv}", &iter);
+ while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) {
+ pspec = _vala_test_find_property_from_dbus_name (key);
+ if (pspec != NULL) {
+ g_object_notify_by_pspec ((GObject *) proxy, pspec);
+ }
+ }
+ g_variant_iter_free (iter);
+ for (n = 0; invalidated_properties[n] != NULL; n++) {
+ pspec = _vala_test_find_property_from_dbus_name (invalidated_properties[n]);
+ if (pspec != NULL) {
+ g_object_notify_by_pspec ((GObject *) proxy, pspec);
+ }
+ }
+}
+
+static void
test_proxy_init (TestProxy* self)
{
g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_test_dbus_interface_info));