/* * Generated by gdbus-codegen 2.50.3. DO NOT EDIT. * * The license of this code is the same as for the source it was derived from. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "../src/common/mock-dbus-tests.h" #include #ifdef G_OS_UNIX # include #endif typedef struct { GDBusArgInfo parent_struct; gboolean use_gvariant; } _ExtendedGDBusArgInfo; typedef struct { GDBusMethodInfo parent_struct; const gchar *signal_name; gboolean pass_fdlist; } _ExtendedGDBusMethodInfo; typedef struct { GDBusSignalInfo parent_struct; const gchar *signal_name; } _ExtendedGDBusSignalInfo; typedef struct { GDBusPropertyInfo parent_struct; const gchar *hyphen_name; gboolean use_gvariant; } _ExtendedGDBusPropertyInfo; typedef struct { GDBusInterfaceInfo parent_struct; const gchar *hyphen_name; } _ExtendedGDBusInterfaceInfo; typedef struct { const _ExtendedGDBusPropertyInfo *info; guint prop_id; GValue orig_value; /* the value before the change */ } ChangedProperty; static void _changed_property_free (ChangedProperty *data) { g_value_unset (&data->orig_value); g_free (data); } static gboolean _g_strv_equal0 (gchar **a, gchar **b) { gboolean ret = FALSE; guint n; if (a == NULL && b == NULL) { ret = TRUE; goto out; } if (a == NULL || b == NULL) goto out; if (g_strv_length (a) != g_strv_length (b)) goto out; for (n = 0; a[n] != NULL; n++) if (g_strcmp0 (a[n], b[n]) != 0) goto out; ret = TRUE; out: return ret; } static gboolean _g_variant_equal0 (GVariant *a, GVariant *b) { gboolean ret = FALSE; if (a == NULL && b == NULL) { ret = TRUE; goto out; } if (a == NULL || b == NULL) goto out; ret = g_variant_equal (a, b); out: return ret; } G_GNUC_UNUSED static gboolean _g_value_equal (const GValue *a, const GValue *b) { gboolean ret = FALSE; g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); switch (G_VALUE_TYPE (a)) { case G_TYPE_BOOLEAN: ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); break; case G_TYPE_UCHAR: ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); break; case G_TYPE_INT: ret = (g_value_get_int (a) == g_value_get_int (b)); break; case G_TYPE_UINT: ret = (g_value_get_uint (a) == g_value_get_uint (b)); break; case G_TYPE_INT64: ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); break; case G_TYPE_UINT64: ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); break; case G_TYPE_DOUBLE: { /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ gdouble da = g_value_get_double (a); gdouble db = g_value_get_double (b); ret = memcmp (&da, &db, sizeof (gdouble)) == 0; } break; case G_TYPE_STRING: ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); break; case G_TYPE_VARIANT: ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); break; default: if (G_VALUE_TYPE (a) == G_TYPE_STRV) ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); else g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); break; } return ret; } /* ------------------------------------------------------------------------ * Code for interface com.redhat.Cockpit.DBusTests.Alpha * ------------------------------------------------------------------------ */ /** * SECTION:TestAlpha * @title: TestAlpha * @short_description: Generated C code for the com.redhat.Cockpit.DBusTests.Alpha D-Bus interface * * This section contains code for working with the com.redhat.Cockpit.DBusTests.Alpha D-Bus interface in C. */ /* ---- Introspection data for com.redhat.Cockpit.DBusTests.Alpha ---- */ static const _ExtendedGDBusInterfaceInfo _test_alpha_interface_info = { { -1, (gchar *) "com.redhat.Cockpit.DBusTests.Alpha", NULL, NULL, NULL, NULL }, "alpha", }; /** * test_alpha_interface_info: * * Gets a machine-readable description of the com.redhat.Cockpit.DBusTests.Alpha D-Bus interface. * * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. */ GDBusInterfaceInfo * test_alpha_interface_info (void) { return (GDBusInterfaceInfo *) &_test_alpha_interface_info.parent_struct; } /** * test_alpha_override_properties: * @klass: The class structure for a #GObject-derived class. * @property_id_begin: The property id to assign to the first overridden property. * * Overrides all #GObject properties in the #TestAlpha interface for a concrete class. * The properties are overridden in the order they are defined. * * Returns: The last property id. */ guint test_alpha_override_properties (GObjectClass *klass, guint property_id_begin) { return property_id_begin - 1; } /** * TestAlpha: * * Abstract interface type for the D-Bus interface com.redhat.Cockpit.DBusTests.Alpha. */ /** * TestAlphaIface: * @parent_iface: The parent interface. * * Virtual table for the D-Bus interface com.redhat.Cockpit.DBusTests.Alpha. */ typedef TestAlphaIface TestAlphaInterface; G_DEFINE_INTERFACE (TestAlpha, test_alpha, G_TYPE_OBJECT); static void test_alpha_default_init (TestAlphaIface *iface) { } /* ------------------------------------------------------------------------ */ /** * TestAlphaProxy: * * The #TestAlphaProxy structure contains only private data and should only be accessed using the provided API. */ /** * TestAlphaProxyClass: * @parent_class: The parent class. * * Class structure for #TestAlphaProxy. */ struct _TestAlphaProxyPrivate { GData *qdata; }; static void test_alpha_proxy_iface_init (TestAlphaIface *iface); #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (TestAlphaProxy, test_alpha_proxy, G_TYPE_DBUS_PROXY, G_ADD_PRIVATE (TestAlphaProxy) G_IMPLEMENT_INTERFACE (TEST_TYPE_ALPHA, test_alpha_proxy_iface_init)); #else G_DEFINE_TYPE_WITH_CODE (TestAlphaProxy, test_alpha_proxy, G_TYPE_DBUS_PROXY, G_IMPLEMENT_INTERFACE (TEST_TYPE_ALPHA, test_alpha_proxy_iface_init)); #endif static void test_alpha_proxy_finalize (GObject *object) { TestAlphaProxy *proxy = TEST_ALPHA_PROXY (object); g_datalist_clear (&proxy->priv->qdata); G_OBJECT_CLASS (test_alpha_proxy_parent_class)->finalize (object); } static void test_alpha_proxy_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec G_GNUC_UNUSED) { } static void test_alpha_proxy_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec G_GNUC_UNUSED) { } static void test_alpha_proxy_g_signal (GDBusProxy *proxy, const gchar *sender_name G_GNUC_UNUSED, const gchar *signal_name, GVariant *parameters) { _ExtendedGDBusSignalInfo *info; GVariantIter iter; GVariant *child; GValue *paramv; guint num_params; guint n; guint signal_id; info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_test_alpha_interface_info.parent_struct, signal_name); if (info == NULL) return; num_params = g_variant_n_children (parameters); paramv = g_new0 (GValue, num_params + 1); g_value_init (¶mv[0], TEST_TYPE_ALPHA); g_value_set_object (¶mv[0], proxy); g_variant_iter_init (&iter, parameters); n = 1; while ((child = g_variant_iter_next_value (&iter)) != NULL) { _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; if (arg_info->use_gvariant) { g_value_init (¶mv[n], G_TYPE_VARIANT); g_value_set_variant (¶mv[n], child); n++; } else g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); g_variant_unref (child); } signal_id = g_signal_lookup (info->signal_name, TEST_TYPE_ALPHA); g_signal_emitv (paramv, signal_id, 0, NULL); for (n = 0; n < num_params + 1; n++) g_value_unset (¶mv[n]); g_free (paramv); } static void test_alpha_proxy_g_properties_changed (GDBusProxy *_proxy, GVariant *changed_properties, const gchar *const *invalidated_properties) { TestAlphaProxy *proxy = TEST_ALPHA_PROXY (_proxy); guint n; const gchar *key; GVariantIter *iter; _ExtendedGDBusPropertyInfo *info; g_variant_get (changed_properties, "a{sv}", &iter); while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) { info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_alpha_interface_info.parent_struct, key); g_datalist_remove_data (&proxy->priv->qdata, key); if (info != NULL) g_object_notify (G_OBJECT (proxy), info->hyphen_name); } g_variant_iter_free (iter); for (n = 0; invalidated_properties[n] != NULL; n++) { info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_alpha_interface_info.parent_struct, invalidated_properties[n]); g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); if (info != NULL) g_object_notify (G_OBJECT (proxy), info->hyphen_name); } } static void test_alpha_proxy_init (TestAlphaProxy *proxy) { #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 proxy->priv = test_alpha_proxy_get_instance_private (proxy); #else proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TEST_TYPE_ALPHA_PROXY, TestAlphaProxyPrivate); #endif g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), test_alpha_interface_info ()); } static void test_alpha_proxy_class_init (TestAlphaProxyClass *klass) { GObjectClass *gobject_class; GDBusProxyClass *proxy_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = test_alpha_proxy_finalize; gobject_class->get_property = test_alpha_proxy_get_property; gobject_class->set_property = test_alpha_proxy_set_property; proxy_class = G_DBUS_PROXY_CLASS (klass); proxy_class->g_signal = test_alpha_proxy_g_signal; proxy_class->g_properties_changed = test_alpha_proxy_g_properties_changed; #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 g_type_class_add_private (klass, sizeof (TestAlphaProxyPrivate)); #endif } static void test_alpha_proxy_iface_init (TestAlphaIface *iface) { } /** * test_alpha_proxy_new: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * * Asynchronously creates a proxy for the D-Bus interface com.redhat.Cockpit.DBusTests.Alpha. See g_dbus_proxy_new() for more details. * * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_alpha_proxy_new_finish() to get the result of the operation. * * See test_alpha_proxy_new_sync() for the synchronous, blocking version of this constructor. */ void test_alpha_proxy_new ( GDBusConnection *connection, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_async_initable_new_async (TEST_TYPE_ALPHA_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Alpha", NULL); } /** * test_alpha_proxy_new_finish: * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_alpha_proxy_new(). * @error: Return location for error or %NULL * * Finishes an operation started with test_alpha_proxy_new(). * * Returns: (transfer full) (type TestAlphaProxy): The constructed proxy object or %NULL if @error is set. */ TestAlpha * test_alpha_proxy_new_finish ( GAsyncResult *res, GError **error) { GObject *ret; GObject *source_object; source_object = g_async_result_get_source_object (res); ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); g_object_unref (source_object); if (ret != NULL) return TEST_ALPHA (ret); else return NULL; } /** * test_alpha_proxy_new_sync: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Synchronously creates a proxy for the D-Bus interface com.redhat.Cockpit.DBusTests.Alpha. See g_dbus_proxy_new_sync() for more details. * * The calling thread is blocked until a reply is received. * * See test_alpha_proxy_new() for the asynchronous version of this constructor. * * Returns: (transfer full) (type TestAlphaProxy): The constructed proxy object or %NULL if @error is set. */ TestAlpha * test_alpha_proxy_new_sync ( GDBusConnection *connection, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GError **error) { GInitable *ret; ret = g_initable_new (TEST_TYPE_ALPHA_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Alpha", NULL); if (ret != NULL) return TEST_ALPHA (ret); else return NULL; } /** * test_alpha_proxy_new_for_bus: * @bus_type: A #GBusType. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * * Like test_alpha_proxy_new() but takes a #GBusType instead of a #GDBusConnection. * * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_alpha_proxy_new_for_bus_finish() to get the result of the operation. * * See test_alpha_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. */ void test_alpha_proxy_new_for_bus ( GBusType bus_type, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_async_initable_new_async (TEST_TYPE_ALPHA_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Alpha", NULL); } /** * test_alpha_proxy_new_for_bus_finish: * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_alpha_proxy_new_for_bus(). * @error: Return location for error or %NULL * * Finishes an operation started with test_alpha_proxy_new_for_bus(). * * Returns: (transfer full) (type TestAlphaProxy): The constructed proxy object or %NULL if @error is set. */ TestAlpha * test_alpha_proxy_new_for_bus_finish ( GAsyncResult *res, GError **error) { GObject *ret; GObject *source_object; source_object = g_async_result_get_source_object (res); ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); g_object_unref (source_object); if (ret != NULL) return TEST_ALPHA (ret); else return NULL; } /** * test_alpha_proxy_new_for_bus_sync: * @bus_type: A #GBusType. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Like test_alpha_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. * * The calling thread is blocked until a reply is received. * * See test_alpha_proxy_new_for_bus() for the asynchronous version of this constructor. * * Returns: (transfer full) (type TestAlphaProxy): The constructed proxy object or %NULL if @error is set. */ TestAlpha * test_alpha_proxy_new_for_bus_sync ( GBusType bus_type, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GError **error) { GInitable *ret; ret = g_initable_new (TEST_TYPE_ALPHA_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Alpha", NULL); if (ret != NULL) return TEST_ALPHA (ret); else return NULL; } /* ------------------------------------------------------------------------ */ /** * TestAlphaSkeleton: * * The #TestAlphaSkeleton structure contains only private data and should only be accessed using the provided API. */ /** * TestAlphaSkeletonClass: * @parent_class: The parent class. * * Class structure for #TestAlphaSkeleton. */ struct _TestAlphaSkeletonPrivate { GValue *properties; GList *changed_properties; GSource *changed_properties_idle_source; GMainContext *context; GMutex lock; }; static void _test_alpha_skeleton_handle_method_call ( GDBusConnection *connection G_GNUC_UNUSED, const gchar *sender G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, const gchar *method_name, GVariant *parameters, GDBusMethodInvocation *invocation, gpointer user_data) { TestAlphaSkeleton *skeleton = TEST_ALPHA_SKELETON (user_data); _ExtendedGDBusMethodInfo *info; GVariantIter iter; GVariant *child; GValue *paramv; guint num_params; guint num_extra; guint n; guint signal_id; GValue return_value = G_VALUE_INIT; info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); g_assert (info != NULL); num_params = g_variant_n_children (parameters); num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); n = 0; g_value_init (¶mv[n], TEST_TYPE_ALPHA); g_value_set_object (¶mv[n++], skeleton); g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); g_value_set_object (¶mv[n++], invocation); if (info->pass_fdlist) { #ifdef G_OS_UNIX g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); #else g_assert_not_reached (); #endif } g_variant_iter_init (&iter, parameters); while ((child = g_variant_iter_next_value (&iter)) != NULL) { _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; if (arg_info->use_gvariant) { g_value_init (¶mv[n], G_TYPE_VARIANT); g_value_set_variant (¶mv[n], child); n++; } else g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); g_variant_unref (child); } signal_id = g_signal_lookup (info->signal_name, TEST_TYPE_ALPHA); g_value_init (&return_value, G_TYPE_BOOLEAN); g_signal_emitv (paramv, signal_id, 0, &return_value); if (!g_value_get_boolean (&return_value)) g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); g_value_unset (&return_value); for (n = 0; n < num_params + num_extra; n++) g_value_unset (¶mv[n]); g_free (paramv); } static GVariant * _test_alpha_skeleton_handle_get_property ( GDBusConnection *connection G_GNUC_UNUSED, const gchar *sender G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name G_GNUC_UNUSED, const gchar *property_name, GError **error, gpointer user_data) { TestAlphaSkeleton *skeleton = TEST_ALPHA_SKELETON (user_data); GValue value = G_VALUE_INIT; GParamSpec *pspec; _ExtendedGDBusPropertyInfo *info; GVariant *ret; ret = NULL; info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_alpha_interface_info.parent_struct, property_name); g_assert (info != NULL); pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); if (pspec == NULL) { g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); } else { g_value_init (&value, pspec->value_type); g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); g_value_unset (&value); } return ret; } static gboolean _test_alpha_skeleton_handle_set_property ( GDBusConnection *connection G_GNUC_UNUSED, const gchar *sender G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name G_GNUC_UNUSED, const gchar *property_name, GVariant *variant, GError **error, gpointer user_data) { TestAlphaSkeleton *skeleton = TEST_ALPHA_SKELETON (user_data); GValue value = G_VALUE_INIT; GParamSpec *pspec; _ExtendedGDBusPropertyInfo *info; gboolean ret; ret = FALSE; info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_alpha_interface_info.parent_struct, property_name); g_assert (info != NULL); pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); if (pspec == NULL) { g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); } else { if (info->use_gvariant) g_value_set_variant (&value, variant); else g_dbus_gvariant_to_gvalue (variant, &value); g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); g_value_unset (&value); ret = TRUE; } return ret; } static const GDBusInterfaceVTable _test_alpha_skeleton_vtable = { _test_alpha_skeleton_handle_method_call, _test_alpha_skeleton_handle_get_property, _test_alpha_skeleton_handle_set_property, {NULL} }; static GDBusInterfaceInfo * test_alpha_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) { return test_alpha_interface_info (); } static GDBusInterfaceVTable * test_alpha_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) { return (GDBusInterfaceVTable *) &_test_alpha_skeleton_vtable; } static GVariant * test_alpha_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) { TestAlphaSkeleton *skeleton = TEST_ALPHA_SKELETON (_skeleton); GVariantBuilder builder; guint n; g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); if (_test_alpha_interface_info.parent_struct.properties == NULL) goto out; for (n = 0; _test_alpha_interface_info.parent_struct.properties[n] != NULL; n++) { GDBusPropertyInfo *info = _test_alpha_interface_info.parent_struct.properties[n]; if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) { GVariant *value; value = _test_alpha_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.redhat.Cockpit.DBusTests.Alpha", info->name, NULL, skeleton); if (value != NULL) { g_variant_take_ref (value); g_variant_builder_add (&builder, "{sv}", info->name, value); g_variant_unref (value); } } } out: return g_variant_builder_end (&builder); } static void test_alpha_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) { } static void test_alpha_skeleton_iface_init (TestAlphaIface *iface); #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (TestAlphaSkeleton, test_alpha_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, G_ADD_PRIVATE (TestAlphaSkeleton) G_IMPLEMENT_INTERFACE (TEST_TYPE_ALPHA, test_alpha_skeleton_iface_init)); #else G_DEFINE_TYPE_WITH_CODE (TestAlphaSkeleton, test_alpha_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, G_IMPLEMENT_INTERFACE (TEST_TYPE_ALPHA, test_alpha_skeleton_iface_init)); #endif static void test_alpha_skeleton_finalize (GObject *object) { TestAlphaSkeleton *skeleton = TEST_ALPHA_SKELETON (object); g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); if (skeleton->priv->changed_properties_idle_source != NULL) g_source_destroy (skeleton->priv->changed_properties_idle_source); g_main_context_unref (skeleton->priv->context); g_mutex_clear (&skeleton->priv->lock); G_OBJECT_CLASS (test_alpha_skeleton_parent_class)->finalize (object); } static void test_alpha_skeleton_init (TestAlphaSkeleton *skeleton) { #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 skeleton->priv = test_alpha_skeleton_get_instance_private (skeleton); #else skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TEST_TYPE_ALPHA_SKELETON, TestAlphaSkeletonPrivate); #endif g_mutex_init (&skeleton->priv->lock); skeleton->priv->context = g_main_context_ref_thread_default (); } static void test_alpha_skeleton_class_init (TestAlphaSkeletonClass *klass) { GObjectClass *gobject_class; GDBusInterfaceSkeletonClass *skeleton_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = test_alpha_skeleton_finalize; skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); skeleton_class->get_info = test_alpha_skeleton_dbus_interface_get_info; skeleton_class->get_properties = test_alpha_skeleton_dbus_interface_get_properties; skeleton_class->flush = test_alpha_skeleton_dbus_interface_flush; skeleton_class->get_vtable = test_alpha_skeleton_dbus_interface_get_vtable; #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 g_type_class_add_private (klass, sizeof (TestAlphaSkeletonPrivate)); #endif } static void test_alpha_skeleton_iface_init (TestAlphaIface *iface) { } /** * test_alpha_skeleton_new: * * Creates a skeleton object for the D-Bus interface com.redhat.Cockpit.DBusTests.Alpha. * * Returns: (transfer full) (type TestAlphaSkeleton): The skeleton object. */ TestAlpha * test_alpha_skeleton_new (void) { return TEST_ALPHA (g_object_new (TEST_TYPE_ALPHA_SKELETON, NULL)); } /* ------------------------------------------------------------------------ * Code for interface com.redhat.Cockpit.DBusTests.Frobber * ------------------------------------------------------------------------ */ /** * SECTION:TestFrobber * @title: TestFrobber * @short_description: Generated C code for the com.redhat.Cockpit.DBusTests.Frobber D-Bus interface * * This section contains code for working with the com.redhat.Cockpit.DBusTests.Frobber D-Bus interface in C. */ /* ---- Introspection data for com.redhat.Cockpit.DBusTests.Frobber ---- */ static const _ExtendedGDBusArgInfo _test_frobber_method_info_hello_world_IN_ARG_greeting = { { -1, (gchar *) "greeting", (gchar *) "s", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_hello_world_IN_ARG_pointers[] = { &_test_frobber_method_info_hello_world_IN_ARG_greeting, NULL }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_hello_world_OUT_ARG_response = { { -1, (gchar *) "response", (gchar *) "s", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_hello_world_OUT_ARG_pointers[] = { &_test_frobber_method_info_hello_world_OUT_ARG_response, NULL }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_hello_world = { { -1, (gchar *) "HelloWorld", (GDBusArgInfo **) &_test_frobber_method_info_hello_world_IN_ARG_pointers, (GDBusArgInfo **) &_test_frobber_method_info_hello_world_OUT_ARG_pointers, NULL }, "handle-hello-world", FALSE }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_never_return = { { -1, (gchar *) "NeverReturn", NULL, NULL, NULL }, "handle-never-return", FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_IN_ARG_val_byte = { { -1, (gchar *) "val_byte", (gchar *) "y", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_IN_ARG_val_boolean = { { -1, (gchar *) "val_boolean", (gchar *) "b", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_IN_ARG_val_int16 = { { -1, (gchar *) "val_int16", (gchar *) "n", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_IN_ARG_val_uint16 = { { -1, (gchar *) "val_uint16", (gchar *) "q", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_IN_ARG_val_int32 = { { -1, (gchar *) "val_int32", (gchar *) "i", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_IN_ARG_val_uint32 = { { -1, (gchar *) "val_uint32", (gchar *) "u", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_IN_ARG_val_int64 = { { -1, (gchar *) "val_int64", (gchar *) "x", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_IN_ARG_val_uint64 = { { -1, (gchar *) "val_uint64", (gchar *) "t", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_IN_ARG_val_double = { { -1, (gchar *) "val_double", (gchar *) "d", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_IN_ARG_val_string = { { -1, (gchar *) "val_string", (gchar *) "s", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_IN_ARG_val_objpath = { { -1, (gchar *) "val_objpath", (gchar *) "o", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_IN_ARG_val_signature = { { -1, (gchar *) "val_signature", (gchar *) "g", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_IN_ARG_val_bytestring = { { -1, (gchar *) "val_bytestring", (gchar *) "ay", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_test_primitive_types_IN_ARG_pointers[] = { &_test_frobber_method_info_test_primitive_types_IN_ARG_val_byte, &_test_frobber_method_info_test_primitive_types_IN_ARG_val_boolean, &_test_frobber_method_info_test_primitive_types_IN_ARG_val_int16, &_test_frobber_method_info_test_primitive_types_IN_ARG_val_uint16, &_test_frobber_method_info_test_primitive_types_IN_ARG_val_int32, &_test_frobber_method_info_test_primitive_types_IN_ARG_val_uint32, &_test_frobber_method_info_test_primitive_types_IN_ARG_val_int64, &_test_frobber_method_info_test_primitive_types_IN_ARG_val_uint64, &_test_frobber_method_info_test_primitive_types_IN_ARG_val_double, &_test_frobber_method_info_test_primitive_types_IN_ARG_val_string, &_test_frobber_method_info_test_primitive_types_IN_ARG_val_objpath, &_test_frobber_method_info_test_primitive_types_IN_ARG_val_signature, &_test_frobber_method_info_test_primitive_types_IN_ARG_val_bytestring, NULL }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_OUT_ARG_ret_byte = { { -1, (gchar *) "ret_byte", (gchar *) "y", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_OUT_ARG_ret_boolean = { { -1, (gchar *) "ret_boolean", (gchar *) "b", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_OUT_ARG_ret_int16 = { { -1, (gchar *) "ret_int16", (gchar *) "n", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_OUT_ARG_ret_uint16 = { { -1, (gchar *) "ret_uint16", (gchar *) "q", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_OUT_ARG_ret_int32 = { { -1, (gchar *) "ret_int32", (gchar *) "i", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_OUT_ARG_ret_uint32 = { { -1, (gchar *) "ret_uint32", (gchar *) "u", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_OUT_ARG_ret_int64 = { { -1, (gchar *) "ret_int64", (gchar *) "x", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_OUT_ARG_ret_uint64 = { { -1, (gchar *) "ret_uint64", (gchar *) "t", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_OUT_ARG_ret_double = { { -1, (gchar *) "ret_double", (gchar *) "d", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_OUT_ARG_ret_string = { { -1, (gchar *) "ret_string", (gchar *) "s", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_OUT_ARG_ret_objpath = { { -1, (gchar *) "ret_objpath", (gchar *) "o", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_OUT_ARG_ret_signature = { { -1, (gchar *) "ret_signature", (gchar *) "g", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_primitive_types_OUT_ARG_ret_bytestring = { { -1, (gchar *) "ret_bytestring", (gchar *) "ay", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_test_primitive_types_OUT_ARG_pointers[] = { &_test_frobber_method_info_test_primitive_types_OUT_ARG_ret_byte, &_test_frobber_method_info_test_primitive_types_OUT_ARG_ret_boolean, &_test_frobber_method_info_test_primitive_types_OUT_ARG_ret_int16, &_test_frobber_method_info_test_primitive_types_OUT_ARG_ret_uint16, &_test_frobber_method_info_test_primitive_types_OUT_ARG_ret_int32, &_test_frobber_method_info_test_primitive_types_OUT_ARG_ret_uint32, &_test_frobber_method_info_test_primitive_types_OUT_ARG_ret_int64, &_test_frobber_method_info_test_primitive_types_OUT_ARG_ret_uint64, &_test_frobber_method_info_test_primitive_types_OUT_ARG_ret_double, &_test_frobber_method_info_test_primitive_types_OUT_ARG_ret_string, &_test_frobber_method_info_test_primitive_types_OUT_ARG_ret_objpath, &_test_frobber_method_info_test_primitive_types_OUT_ARG_ret_signature, &_test_frobber_method_info_test_primitive_types_OUT_ARG_ret_bytestring, NULL }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_test_primitive_types = { { -1, (gchar *) "TestPrimitiveTypes", (GDBusArgInfo **) &_test_frobber_method_info_test_primitive_types_IN_ARG_pointers, (GDBusArgInfo **) &_test_frobber_method_info_test_primitive_types_OUT_ARG_pointers, NULL }, "handle-test-primitive-types", FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_non_primitive_types_IN_ARG_dict_s_to_s = { { -1, (gchar *) "dict_s_to_s", (gchar *) "a{ss}", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_non_primitive_types_IN_ARG_dict_s_to_pairs = { { -1, (gchar *) "dict_s_to_pairs", (gchar *) "a{s(ii)}", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_non_primitive_types_IN_ARG_a_struct = { { -1, (gchar *) "a_struct", (gchar *) "(iss)", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_non_primitive_types_IN_ARG_array_of_strings = { { -1, (gchar *) "array_of_strings", (gchar *) "as", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_non_primitive_types_IN_ARG_array_of_objpaths = { { -1, (gchar *) "array_of_objpaths", (gchar *) "ao", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_non_primitive_types_IN_ARG_array_of_signatures = { { -1, (gchar *) "array_of_signatures", (gchar *) "ag", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_non_primitive_types_IN_ARG_array_of_bytestrings = { { -1, (gchar *) "array_of_bytestrings", (gchar *) "aay", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_test_non_primitive_types_IN_ARG_pointers[] = { &_test_frobber_method_info_test_non_primitive_types_IN_ARG_dict_s_to_s, &_test_frobber_method_info_test_non_primitive_types_IN_ARG_dict_s_to_pairs, &_test_frobber_method_info_test_non_primitive_types_IN_ARG_a_struct, &_test_frobber_method_info_test_non_primitive_types_IN_ARG_array_of_strings, &_test_frobber_method_info_test_non_primitive_types_IN_ARG_array_of_objpaths, &_test_frobber_method_info_test_non_primitive_types_IN_ARG_array_of_signatures, &_test_frobber_method_info_test_non_primitive_types_IN_ARG_array_of_bytestrings, NULL }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_non_primitive_types_OUT_ARG_result = { { -1, (gchar *) "result", (gchar *) "s", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_test_non_primitive_types_OUT_ARG_pointers[] = { &_test_frobber_method_info_test_non_primitive_types_OUT_ARG_result, NULL }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_test_non_primitive_types = { { -1, (gchar *) "TestNonPrimitiveTypes", (GDBusArgInfo **) &_test_frobber_method_info_test_non_primitive_types_IN_ARG_pointers, (GDBusArgInfo **) &_test_frobber_method_info_test_non_primitive_types_OUT_ARG_pointers, NULL }, "handle-test-non-primitive-types", FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_asv_IN_ARG_asv = { { -1, (gchar *) "asv", (gchar *) "a{sv}", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_test_asv_IN_ARG_pointers[] = { &_test_frobber_method_info_test_asv_IN_ARG_asv, NULL }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_asv_OUT_ARG_result = { { -1, (gchar *) "result", (gchar *) "s", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_test_asv_OUT_ARG_pointers[] = { &_test_frobber_method_info_test_asv_OUT_ARG_result, NULL }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_test_asv = { { -1, (gchar *) "TestAsv", (GDBusArgInfo **) &_test_frobber_method_info_test_asv_IN_ARG_pointers, (GDBusArgInfo **) &_test_frobber_method_info_test_asv_OUT_ARG_pointers, NULL }, "handle-test-asv", FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_test_variant_IN_ARG_v = { { -1, (gchar *) "v", (gchar *) "v", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_test_variant_IN_ARG_pointers[] = { &_test_frobber_method_info_test_variant_IN_ARG_v, NULL }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_test_variant = { { -1, (gchar *) "TestVariant", (GDBusArgInfo **) &_test_frobber_method_info_test_variant_IN_ARG_pointers, NULL, NULL }, "handle-test-variant", FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_request_signal_emission_IN_ARG_which_one = { { -1, (gchar *) "which_one", (gchar *) "i", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_request_signal_emission_IN_ARG_pointers[] = { &_test_frobber_method_info_request_signal_emission_IN_ARG_which_one, NULL }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_request_signal_emission = { { -1, (gchar *) "RequestSignalEmission", (GDBusArgInfo **) &_test_frobber_method_info_request_signal_emission_IN_ARG_pointers, NULL, NULL }, "handle-request-signal-emission", FALSE }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_request_property_mods = { { -1, (gchar *) "RequestPropertyMods", NULL, NULL, NULL }, "handle-request-property-mods", FALSE }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_request_multi_property_mods = { { -1, (gchar *) "RequestMultiPropertyMods", NULL, NULL, NULL }, "handle-request-multi-property-mods", FALSE }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_unimplemented_method = { { -1, (gchar *) "UnimplementedMethod", NULL, NULL, NULL }, "handle-unimplemented-method", FALSE }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_property_cancellation = { { -1, (gchar *) "PropertyCancellation", NULL, NULL, NULL }, "handle-property-cancellation", FALSE }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_delete_all_objects = { { -1, (gchar *) "DeleteAllObjects", NULL, NULL, NULL }, "handle-delete-all-objects", FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_create_object_IN_ARG_at_path = { { -1, (gchar *) "at_path", (gchar *) "o", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_create_object_IN_ARG_pointers[] = { &_test_frobber_method_info_create_object_IN_ARG_at_path, NULL }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_create_object = { { -1, (gchar *) "CreateObject", (GDBusArgInfo **) &_test_frobber_method_info_create_object_IN_ARG_pointers, NULL, NULL }, "handle-create-object", FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_delete_object_IN_ARG_path = { { -1, (gchar *) "path", (gchar *) "o", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_delete_object_IN_ARG_pointers[] = { &_test_frobber_method_info_delete_object_IN_ARG_path, NULL }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_delete_object = { { -1, (gchar *) "DeleteObject", (GDBusArgInfo **) &_test_frobber_method_info_delete_object_IN_ARG_pointers, NULL, NULL }, "handle-delete-object", FALSE }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_add_alpha = { { -1, (gchar *) "AddAlpha", NULL, NULL, NULL }, "handle-add-alpha", FALSE }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_remove_alpha = { { -1, (gchar *) "RemoveAlpha", NULL, NULL, NULL }, "handle-remove-alpha", FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_create_clique_IN_ARG_name = { { -1, (gchar *) "name", (gchar *) "s", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_create_clique_IN_ARG_pointers[] = { &_test_frobber_method_info_create_clique_IN_ARG_name, NULL }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_create_clique_OUT_ARG_member = { { -1, (gchar *) "member", (gchar *) "o", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_create_clique_OUT_ARG_pointers[] = { &_test_frobber_method_info_create_clique_OUT_ARG_member, NULL }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_create_clique = { { -1, (gchar *) "CreateClique", (GDBusArgInfo **) &_test_frobber_method_info_create_clique_IN_ARG_pointers, (GDBusArgInfo **) &_test_frobber_method_info_create_clique_OUT_ARG_pointers, NULL }, "handle-create-clique", FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_emit_hidden_IN_ARG_name = { { -1, (gchar *) "name", (gchar *) "s", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_emit_hidden_IN_ARG_pointers[] = { &_test_frobber_method_info_emit_hidden_IN_ARG_name, NULL }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_emit_hidden = { { -1, (gchar *) "EmitHidden", (GDBusArgInfo **) &_test_frobber_method_info_emit_hidden_IN_ARG_pointers, NULL, NULL }, "handle-emit-hidden", FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_claim_other_name_IN_ARG_name = { { -1, (gchar *) "name", (gchar *) "s", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_claim_other_name_IN_ARG_pointers[] = { &_test_frobber_method_info_claim_other_name_IN_ARG_name, NULL }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_claim_other_name = { { -1, (gchar *) "ClaimOtherName", (GDBusArgInfo **) &_test_frobber_method_info_claim_other_name_IN_ARG_pointers, NULL, NULL }, "handle-claim-other-name", FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_release_other_name_IN_ARG_name = { { -1, (gchar *) "name", (gchar *) "s", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_release_other_name_IN_ARG_pointers[] = { &_test_frobber_method_info_release_other_name_IN_ARG_name, NULL }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_release_other_name = { { -1, (gchar *) "ReleaseOtherName", (GDBusArgInfo **) &_test_frobber_method_info_release_other_name_IN_ARG_pointers, NULL, NULL }, "handle-release-other-name", FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_tell_me_your_name_OUT_ARG_name = { { -1, (gchar *) "name", (gchar *) "s", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_tell_me_your_name_OUT_ARG_pointers[] = { &_test_frobber_method_info_tell_me_your_name_OUT_ARG_name, NULL }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_tell_me_your_name = { { -1, (gchar *) "TellMeYourName", NULL, (GDBusArgInfo **) &_test_frobber_method_info_tell_me_your_name_OUT_ARG_pointers, NULL }, "handle-tell-me-your-name", FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_make_test_fd_IN_ARG_type = { { -1, (gchar *) "type", (gchar *) "s", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_make_test_fd_IN_ARG_pointers[] = { &_test_frobber_method_info_make_test_fd_IN_ARG_type, NULL }; static const _ExtendedGDBusArgInfo _test_frobber_method_info_make_test_fd_OUT_ARG_fd = { { -1, (gchar *) "fd", (gchar *) "h", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_method_info_make_test_fd_OUT_ARG_pointers[] = { &_test_frobber_method_info_make_test_fd_OUT_ARG_fd, NULL }; static const _ExtendedGDBusMethodInfo _test_frobber_method_info_make_test_fd = { { -1, (gchar *) "MakeTestFd", (GDBusArgInfo **) &_test_frobber_method_info_make_test_fd_IN_ARG_pointers, (GDBusArgInfo **) &_test_frobber_method_info_make_test_fd_OUT_ARG_pointers, NULL }, "handle-make-test-fd", FALSE }; static const _ExtendedGDBusMethodInfo * const _test_frobber_method_info_pointers[] = { &_test_frobber_method_info_hello_world, &_test_frobber_method_info_never_return, &_test_frobber_method_info_test_primitive_types, &_test_frobber_method_info_test_non_primitive_types, &_test_frobber_method_info_test_asv, &_test_frobber_method_info_test_variant, &_test_frobber_method_info_request_signal_emission, &_test_frobber_method_info_request_property_mods, &_test_frobber_method_info_request_multi_property_mods, &_test_frobber_method_info_unimplemented_method, &_test_frobber_method_info_property_cancellation, &_test_frobber_method_info_delete_all_objects, &_test_frobber_method_info_create_object, &_test_frobber_method_info_delete_object, &_test_frobber_method_info_add_alpha, &_test_frobber_method_info_remove_alpha, &_test_frobber_method_info_create_clique, &_test_frobber_method_info_emit_hidden, &_test_frobber_method_info_claim_other_name, &_test_frobber_method_info_release_other_name, &_test_frobber_method_info_tell_me_your_name, &_test_frobber_method_info_make_test_fd, NULL }; static const _ExtendedGDBusArgInfo _test_frobber_signal_info_test_signal_ARG_val_int32 = { { -1, (gchar *) "val_int32", (gchar *) "i", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_signal_info_test_signal_ARG_array_of_strings = { { -1, (gchar *) "array_of_strings", (gchar *) "as", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_signal_info_test_signal_ARG_array_of_objpaths = { { -1, (gchar *) "array_of_objpaths", (gchar *) "ao", NULL }, FALSE }; static const _ExtendedGDBusArgInfo _test_frobber_signal_info_test_signal_ARG_dict_s_to_pairs = { { -1, (gchar *) "dict_s_to_pairs", (gchar *) "a{s(ii)}", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_signal_info_test_signal_ARG_pointers[] = { &_test_frobber_signal_info_test_signal_ARG_val_int32, &_test_frobber_signal_info_test_signal_ARG_array_of_strings, &_test_frobber_signal_info_test_signal_ARG_array_of_objpaths, &_test_frobber_signal_info_test_signal_ARG_dict_s_to_pairs, NULL }; static const _ExtendedGDBusSignalInfo _test_frobber_signal_info_test_signal = { { -1, (gchar *) "TestSignal", (GDBusArgInfo **) &_test_frobber_signal_info_test_signal_ARG_pointers, NULL }, "test-signal" }; static const _ExtendedGDBusArgInfo _test_frobber_signal_info_another_signal_ARG_word = { { -1, (gchar *) "word", (gchar *) "s", NULL }, FALSE }; static const _ExtendedGDBusArgInfo * const _test_frobber_signal_info_another_signal_ARG_pointers[] = { &_test_frobber_signal_info_another_signal_ARG_word, NULL }; static const _ExtendedGDBusSignalInfo _test_frobber_signal_info_another_signal = { { -1, (gchar *) "AnotherSignal", (GDBusArgInfo **) &_test_frobber_signal_info_another_signal_ARG_pointers, NULL }, "another-signal" }; static const _ExtendedGDBusSignalInfo * const _test_frobber_signal_info_pointers[] = { &_test_frobber_signal_info_test_signal, &_test_frobber_signal_info_another_signal, NULL }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_y = { { -1, (gchar *) "y", (gchar *) "y", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "y", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_b = { { -1, (gchar *) "b", (gchar *) "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "b", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_n = { { -1, (gchar *) "n", (gchar *) "n", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "n", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_q = { { -1, (gchar *) "q", (gchar *) "q", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "q", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_i = { { -1, (gchar *) "i", (gchar *) "i", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "i", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_u = { { -1, (gchar *) "u", (gchar *) "u", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "u", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_x = { { -1, (gchar *) "x", (gchar *) "x", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "x", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_t = { { -1, (gchar *) "t", (gchar *) "t", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "t", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_d = { { -1, (gchar *) "d", (gchar *) "d", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "d", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_s = { { -1, (gchar *) "s", (gchar *) "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "s", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_o = { { -1, (gchar *) "o", (gchar *) "o", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "o", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_g = { { -1, (gchar *) "g", (gchar *) "g", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "g", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_ay = { { -1, (gchar *) "ay", (gchar *) "ay", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "ay", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_as = { { -1, (gchar *) "as", (gchar *) "as", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "as", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_aay = { { -1, (gchar *) "aay", (gchar *) "aay", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "aay", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_ao = { { -1, (gchar *) "ao", (gchar *) "ao", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "ao", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_ag = { { -1, (gchar *) "ag", (gchar *) "ag", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "ag", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_finally_normal_name = { { -1, (gchar *) "FinallyNormalName", (gchar *) "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "finally-normal-name", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_readonly_property = { { -1, (gchar *) "ReadonlyProperty", (gchar *) "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL }, "readonly-property", FALSE }; static const _ExtendedGDBusPropertyInfo _test_frobber_property_info_writeonly_property = { { -1, (gchar *) "WriteonlyProperty", (gchar *) "s", G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL }, "writeonly-property", FALSE }; static const _ExtendedGDBusPropertyInfo * const _test_frobber_property_info_pointers[] = { &_test_frobber_property_info_y, &_test_frobber_property_info_b, &_test_frobber_property_info_n, &_test_frobber_property_info_q, &_test_frobber_property_info_i, &_test_frobber_property_info_u, &_test_frobber_property_info_x, &_test_frobber_property_info_t, &_test_frobber_property_info_d, &_test_frobber_property_info_s, &_test_frobber_property_info_o, &_test_frobber_property_info_g, &_test_frobber_property_info_ay, &_test_frobber_property_info_as, &_test_frobber_property_info_aay, &_test_frobber_property_info_ao, &_test_frobber_property_info_ag, &_test_frobber_property_info_finally_normal_name, &_test_frobber_property_info_readonly_property, &_test_frobber_property_info_writeonly_property, NULL }; static const _ExtendedGDBusInterfaceInfo _test_frobber_interface_info = { { -1, (gchar *) "com.redhat.Cockpit.DBusTests.Frobber", (GDBusMethodInfo **) &_test_frobber_method_info_pointers, (GDBusSignalInfo **) &_test_frobber_signal_info_pointers, (GDBusPropertyInfo **) &_test_frobber_property_info_pointers, NULL }, "frobber", }; /** * test_frobber_interface_info: * * Gets a machine-readable description of the com.redhat.Cockpit.DBusTests.Frobber D-Bus interface. * * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. */ GDBusInterfaceInfo * test_frobber_interface_info (void) { return (GDBusInterfaceInfo *) &_test_frobber_interface_info.parent_struct; } /** * test_frobber_override_properties: * @klass: The class structure for a #GObject-derived class. * @property_id_begin: The property id to assign to the first overridden property. * * Overrides all #GObject properties in the #TestFrobber interface for a concrete class. * The properties are overridden in the order they are defined. * * Returns: The last property id. */ guint test_frobber_override_properties (GObjectClass *klass, guint property_id_begin) { g_object_class_override_property (klass, property_id_begin++, "y"); g_object_class_override_property (klass, property_id_begin++, "b"); g_object_class_override_property (klass, property_id_begin++, "n"); g_object_class_override_property (klass, property_id_begin++, "q"); g_object_class_override_property (klass, property_id_begin++, "i"); g_object_class_override_property (klass, property_id_begin++, "u"); g_object_class_override_property (klass, property_id_begin++, "x"); g_object_class_override_property (klass, property_id_begin++, "t"); g_object_class_override_property (klass, property_id_begin++, "d"); g_object_class_override_property (klass, property_id_begin++, "s"); g_object_class_override_property (klass, property_id_begin++, "o"); g_object_class_override_property (klass, property_id_begin++, "g"); g_object_class_override_property (klass, property_id_begin++, "ay"); g_object_class_override_property (klass, property_id_begin++, "as"); g_object_class_override_property (klass, property_id_begin++, "aay"); g_object_class_override_property (klass, property_id_begin++, "ao"); g_object_class_override_property (klass, property_id_begin++, "ag"); g_object_class_override_property (klass, property_id_begin++, "finally-normal-name"); g_object_class_override_property (klass, property_id_begin++, "readonly-property"); g_object_class_override_property (klass, property_id_begin++, "writeonly-property"); return property_id_begin - 1; } /** * TestFrobber: * * Abstract interface type for the D-Bus interface com.redhat.Cockpit.DBusTests.Frobber. */ /** * TestFrobberIface: * @parent_iface: The parent interface. * @handle_add_alpha: Handler for the #TestFrobber::handle-add-alpha signal. * @handle_claim_other_name: Handler for the #TestFrobber::handle-claim-other-name signal. * @handle_create_clique: Handler for the #TestFrobber::handle-create-clique signal. * @handle_create_object: Handler for the #TestFrobber::handle-create-object signal. * @handle_delete_all_objects: Handler for the #TestFrobber::handle-delete-all-objects signal. * @handle_delete_object: Handler for the #TestFrobber::handle-delete-object signal. * @handle_emit_hidden: Handler for the #TestFrobber::handle-emit-hidden signal. * @handle_hello_world: Handler for the #TestFrobber::handle-hello-world signal. * @handle_make_test_fd: Handler for the #TestFrobber::handle-make-test-fd signal. * @handle_never_return: Handler for the #TestFrobber::handle-never-return signal. * @handle_property_cancellation: Handler for the #TestFrobber::handle-property-cancellation signal. * @handle_release_other_name: Handler for the #TestFrobber::handle-release-other-name signal. * @handle_remove_alpha: Handler for the #TestFrobber::handle-remove-alpha signal. * @handle_request_multi_property_mods: Handler for the #TestFrobber::handle-request-multi-property-mods signal. * @handle_request_property_mods: Handler for the #TestFrobber::handle-request-property-mods signal. * @handle_request_signal_emission: Handler for the #TestFrobber::handle-request-signal-emission signal. * @handle_tell_me_your_name: Handler for the #TestFrobber::handle-tell-me-your-name signal. * @handle_test_asv: Handler for the #TestFrobber::handle-test-asv signal. * @handle_test_non_primitive_types: Handler for the #TestFrobber::handle-test-non-primitive-types signal. * @handle_test_primitive_types: Handler for the #TestFrobber::handle-test-primitive-types signal. * @handle_test_variant: Handler for the #TestFrobber::handle-test-variant signal. * @handle_unimplemented_method: Handler for the #TestFrobber::handle-unimplemented-method signal. * @get_aay: Getter for the #TestFrobber:aay property. * @get_ag: Getter for the #TestFrobber:ag property. * @get_ao: Getter for the #TestFrobber:ao property. * @get_as: Getter for the #TestFrobber:as property. * @get_ay: Getter for the #TestFrobber:ay property. * @get_b: Getter for the #TestFrobber:b property. * @get_d: Getter for the #TestFrobber:d property. * @get_finally_normal_name: Getter for the #TestFrobber:finally-normal-name property. * @get_g: Getter for the #TestFrobber:g property. * @get_i: Getter for the #TestFrobber:i property. * @get_n: Getter for the #TestFrobber:n property. * @get_o: Getter for the #TestFrobber:o property. * @get_q: Getter for the #TestFrobber:q property. * @get_readonly_property: Getter for the #TestFrobber:readonly-property property. * @get_s: Getter for the #TestFrobber:s property. * @get_t: Getter for the #TestFrobber:t property. * @get_u: Getter for the #TestFrobber:u property. * @get_writeonly_property: Getter for the #TestFrobber:writeonly-property property. * @get_x: Getter for the #TestFrobber:x property. * @get_y: Getter for the #TestFrobber:y property. * @another_signal: Handler for the #TestFrobber::another-signal signal. * @test_signal: Handler for the #TestFrobber::test-signal signal. * * Virtual table for the D-Bus interface com.redhat.Cockpit.DBusTests.Frobber. */ typedef TestFrobberIface TestFrobberInterface; G_DEFINE_INTERFACE (TestFrobber, test_frobber, G_TYPE_OBJECT); static void test_frobber_default_init (TestFrobberIface *iface) { /* GObject signals for incoming D-Bus method calls: */ /** * TestFrobber::handle-hello-world: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * @arg_greeting: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the HelloWorld() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_hello_world() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-hello-world", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_hello_world), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 2, G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); /** * TestFrobber::handle-never-return: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * * Signal emitted when a remote caller is invoking the NeverReturn() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_never_return() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-never-return", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_never_return), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 1, G_TYPE_DBUS_METHOD_INVOCATION); /** * TestFrobber::handle-test-primitive-types: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * @arg_val_byte: Argument passed by remote caller. * @arg_val_boolean: Argument passed by remote caller. * @arg_val_int16: Argument passed by remote caller. * @arg_val_uint16: Argument passed by remote caller. * @arg_val_int32: Argument passed by remote caller. * @arg_val_uint32: Argument passed by remote caller. * @arg_val_int64: Argument passed by remote caller. * @arg_val_uint64: Argument passed by remote caller. * @arg_val_double: Argument passed by remote caller. * @arg_val_string: Argument passed by remote caller. * @arg_val_objpath: Argument passed by remote caller. * @arg_val_signature: Argument passed by remote caller. * @arg_val_bytestring: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the TestPrimitiveTypes() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_test_primitive_types() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-test-primitive-types", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_test_primitive_types), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 14, G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UCHAR, G_TYPE_BOOLEAN, G_TYPE_INT, G_TYPE_UINT, G_TYPE_INT, G_TYPE_UINT, G_TYPE_INT64, G_TYPE_UINT64, G_TYPE_DOUBLE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); /** * TestFrobber::handle-test-non-primitive-types: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * @arg_dict_s_to_s: Argument passed by remote caller. * @arg_dict_s_to_pairs: Argument passed by remote caller. * @arg_a_struct: Argument passed by remote caller. * @arg_array_of_strings: Argument passed by remote caller. * @arg_array_of_objpaths: Argument passed by remote caller. * @arg_array_of_signatures: Argument passed by remote caller. * @arg_array_of_bytestrings: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the TestNonPrimitiveTypes() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_test_non_primitive_types() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-test-non-primitive-types", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_test_non_primitive_types), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 8, G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT, G_TYPE_VARIANT, G_TYPE_STRV, G_TYPE_STRV, G_TYPE_VARIANT, G_TYPE_STRV); /** * TestFrobber::handle-test-asv: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * @arg_asv: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the TestAsv() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_test_asv() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-test-asv", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_test_asv), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 2, G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); /** * TestFrobber::handle-test-variant: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * @arg_v: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the TestVariant() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_test_variant() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-test-variant", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_test_variant), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 2, G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); /** * TestFrobber::handle-request-signal-emission: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * @arg_which_one: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the RequestSignalEmission() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_request_signal_emission() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-request-signal-emission", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_request_signal_emission), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 2, G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_INT); /** * TestFrobber::handle-request-property-mods: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * * Signal emitted when a remote caller is invoking the RequestPropertyMods() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_request_property_mods() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-request-property-mods", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_request_property_mods), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 1, G_TYPE_DBUS_METHOD_INVOCATION); /** * TestFrobber::handle-request-multi-property-mods: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * * Signal emitted when a remote caller is invoking the RequestMultiPropertyMods() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_request_multi_property_mods() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-request-multi-property-mods", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_request_multi_property_mods), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 1, G_TYPE_DBUS_METHOD_INVOCATION); /** * TestFrobber::handle-unimplemented-method: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * * Signal emitted when a remote caller is invoking the UnimplementedMethod() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_unimplemented_method() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-unimplemented-method", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_unimplemented_method), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 1, G_TYPE_DBUS_METHOD_INVOCATION); /** * TestFrobber::handle-property-cancellation: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * * Signal emitted when a remote caller is invoking the PropertyCancellation() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_property_cancellation() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-property-cancellation", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_property_cancellation), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 1, G_TYPE_DBUS_METHOD_INVOCATION); /** * TestFrobber::handle-delete-all-objects: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * * Signal emitted when a remote caller is invoking the DeleteAllObjects() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_delete_all_objects() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-delete-all-objects", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_delete_all_objects), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 1, G_TYPE_DBUS_METHOD_INVOCATION); /** * TestFrobber::handle-create-object: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * @arg_at_path: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the CreateObject() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_create_object() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-create-object", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_create_object), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 2, G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); /** * TestFrobber::handle-delete-object: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * @arg_path: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the DeleteObject() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_delete_object() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-delete-object", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_delete_object), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 2, G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); /** * TestFrobber::handle-add-alpha: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * * Signal emitted when a remote caller is invoking the AddAlpha() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_add_alpha() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-add-alpha", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_add_alpha), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 1, G_TYPE_DBUS_METHOD_INVOCATION); /** * TestFrobber::handle-remove-alpha: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * * Signal emitted when a remote caller is invoking the RemoveAlpha() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_remove_alpha() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-remove-alpha", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_remove_alpha), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 1, G_TYPE_DBUS_METHOD_INVOCATION); /** * TestFrobber::handle-create-clique: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * @arg_name: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the CreateClique() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_create_clique() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-create-clique", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_create_clique), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 2, G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); /** * TestFrobber::handle-emit-hidden: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * @arg_name: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the EmitHidden() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_emit_hidden() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-emit-hidden", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_emit_hidden), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 2, G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); /** * TestFrobber::handle-claim-other-name: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * @arg_name: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the ClaimOtherName() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_claim_other_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-claim-other-name", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_claim_other_name), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 2, G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); /** * TestFrobber::handle-release-other-name: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * @arg_name: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the ReleaseOtherName() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_release_other_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-release-other-name", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_release_other_name), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 2, G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); /** * TestFrobber::handle-tell-me-your-name: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * * Signal emitted when a remote caller is invoking the TellMeYourName() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_tell_me_your_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-tell-me-your-name", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_tell_me_your_name), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 1, G_TYPE_DBUS_METHOD_INVOCATION); /** * TestFrobber::handle-make-test-fd: * @object: A #TestFrobber. * @invocation: A #GDBusMethodInvocation. * @arg_type: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the MakeTestFd() D-Bus method. * * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call test_frobber_complete_make_test_fd() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. * * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. */ g_signal_new ("handle-make-test-fd", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, handle_make_test_fd), g_signal_accumulator_true_handled, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 2, G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); /* GObject signals for received D-Bus signals: */ /** * TestFrobber::test-signal: * @object: A #TestFrobber. * @arg_val_int32: Argument. * @arg_array_of_strings: Argument. * @arg_array_of_objpaths: Argument. * @arg_dict_s_to_pairs: Argument. * * On the client-side, this signal is emitted whenever the D-Bus signal "TestSignal" is received. * * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. */ g_signal_new ("test-signal", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, test_signal), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 4, G_TYPE_INT, G_TYPE_STRV, G_TYPE_STRV, G_TYPE_VARIANT); /** * TestFrobber::another-signal: * @object: A #TestFrobber. * @arg_word: Argument. * * On the client-side, this signal is emitted whenever the D-Bus signal "AnotherSignal" is received. * * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. */ g_signal_new ("another-signal", G_TYPE_FROM_INTERFACE (iface), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestFrobberIface, another_signal), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_STRING); /* GObject properties for D-Bus properties: */ /** * TestFrobber:y: * * Represents the D-Bus property "y". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_uchar ("y", "y", "y", 0, 255, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:b: * * Represents the D-Bus property "b". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_boolean ("b", "b", "b", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:n: * * Represents the D-Bus property "n". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_int ("n", "n", "n", G_MININT16, G_MAXINT16, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:q: * * Represents the D-Bus property "q". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_uint ("q", "q", "q", 0, G_MAXUINT16, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:i: * * Represents the D-Bus property "i". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_int ("i", "i", "i", G_MININT32, G_MAXINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:u: * * Represents the D-Bus property "u". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_uint ("u", "u", "u", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:x: * * Represents the D-Bus property "x". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_int64 ("x", "x", "x", G_MININT64, G_MAXINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:t: * * Represents the D-Bus property "t". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_uint64 ("t", "t", "t", 0, G_MAXUINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:d: * * Represents the D-Bus property "d". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_double ("d", "d", "d", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:s: * * Represents the D-Bus property "s". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_string ("s", "s", "s", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:o: * * Represents the D-Bus property "o". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_string ("o", "o", "o", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:g: * * Represents the D-Bus property "g". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_string ("g", "g", "g", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:ay: * * Represents the D-Bus property "ay". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_string ("ay", "ay", "ay", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:as: * * Represents the D-Bus property "as". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_boxed ("as", "as", "as", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:aay: * * Represents the D-Bus property "aay". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_boxed ("aay", "aay", "aay", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:ao: * * Represents the D-Bus property "ao". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_boxed ("ao", "ao", "ao", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:ag: * * Represents the D-Bus property "ag". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_variant ("ag", "ag", "ag", G_VARIANT_TYPE ("ag"), NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:finally-normal-name: * * Represents the D-Bus property "FinallyNormalName". * * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side. */ g_object_interface_install_property (iface, g_param_spec_string ("finally-normal-name", "FinallyNormalName", "FinallyNormalName", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:readonly-property: * * Represents the D-Bus property "ReadonlyProperty". * * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. */ g_object_interface_install_property (iface, g_param_spec_string ("readonly-property", "ReadonlyProperty", "ReadonlyProperty", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TestFrobber:writeonly-property: * * Represents the D-Bus property "WriteonlyProperty". * * Since the D-Bus property for this #GObject property is writable but not readable, it is meaningful to write to it on both the client- and service-side. It is only meaningful, however, to read from it on the service-side. */ g_object_interface_install_property (iface, g_param_spec_string ("writeonly-property", "WriteonlyProperty", "WriteonlyProperty", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } /** * test_frobber_get_y: (skip) * @object: A #TestFrobber. * * Gets the value of the "y" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: The property value. */ guchar test_frobber_get_y (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_y (object); } /** * test_frobber_set_y: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "y" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_y (TestFrobber *object, guchar value) { g_object_set (G_OBJECT (object), "y", value, NULL); } /** * test_frobber_get_b: (skip) * @object: A #TestFrobber. * * Gets the value of the "b" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: The property value. */ gboolean test_frobber_get_b (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_b (object); } /** * test_frobber_set_b: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "b" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_b (TestFrobber *object, gboolean value) { g_object_set (G_OBJECT (object), "b", value, NULL); } /** * test_frobber_get_n: (skip) * @object: A #TestFrobber. * * Gets the value of the "n" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: The property value. */ gint16 test_frobber_get_n (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_n (object); } /** * test_frobber_set_n: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "n" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_n (TestFrobber *object, gint16 value) { g_object_set (G_OBJECT (object), "n", value, NULL); } /** * test_frobber_get_q: (skip) * @object: A #TestFrobber. * * Gets the value of the "q" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: The property value. */ guint16 test_frobber_get_q (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_q (object); } /** * test_frobber_set_q: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "q" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_q (TestFrobber *object, guint16 value) { g_object_set (G_OBJECT (object), "q", value, NULL); } /** * test_frobber_get_i: (skip) * @object: A #TestFrobber. * * Gets the value of the "i" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: The property value. */ gint test_frobber_get_i (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_i (object); } /** * test_frobber_set_i: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "i" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_i (TestFrobber *object, gint value) { g_object_set (G_OBJECT (object), "i", value, NULL); } /** * test_frobber_get_u: (skip) * @object: A #TestFrobber. * * Gets the value of the "u" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: The property value. */ guint test_frobber_get_u (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_u (object); } /** * test_frobber_set_u: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "u" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_u (TestFrobber *object, guint value) { g_object_set (G_OBJECT (object), "u", value, NULL); } /** * test_frobber_get_x: (skip) * @object: A #TestFrobber. * * Gets the value of the "x" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: The property value. */ gint64 test_frobber_get_x (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_x (object); } /** * test_frobber_set_x: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "x" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_x (TestFrobber *object, gint64 value) { g_object_set (G_OBJECT (object), "x", value, NULL); } /** * test_frobber_get_t: (skip) * @object: A #TestFrobber. * * Gets the value of the "t" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: The property value. */ guint64 test_frobber_get_t (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_t (object); } /** * test_frobber_set_t: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "t" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_t (TestFrobber *object, guint64 value) { g_object_set (G_OBJECT (object), "t", value, NULL); } /** * test_frobber_get_d: (skip) * @object: A #TestFrobber. * * Gets the value of the "d" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: The property value. */ gdouble test_frobber_get_d (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_d (object); } /** * test_frobber_set_d: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "d" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_d (TestFrobber *object, gdouble value) { g_object_set (G_OBJECT (object), "d", value, NULL); } /** * test_frobber_get_s: (skip) * @object: A #TestFrobber. * * Gets the value of the "s" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use test_frobber_dup_s() if on another thread. * * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. */ const gchar * test_frobber_get_s (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_s (object); } /** * test_frobber_dup_s: (skip) * @object: A #TestFrobber. * * Gets a copy of the "s" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). */ gchar * test_frobber_dup_s (TestFrobber *object) { gchar *value; g_object_get (G_OBJECT (object), "s", &value, NULL); return value; } /** * test_frobber_set_s: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "s" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_s (TestFrobber *object, const gchar *value) { g_object_set (G_OBJECT (object), "s", value, NULL); } /** * test_frobber_get_o: (skip) * @object: A #TestFrobber. * * Gets the value of the "o" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use test_frobber_dup_o() if on another thread. * * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. */ const gchar * test_frobber_get_o (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_o (object); } /** * test_frobber_dup_o: (skip) * @object: A #TestFrobber. * * Gets a copy of the "o" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). */ gchar * test_frobber_dup_o (TestFrobber *object) { gchar *value; g_object_get (G_OBJECT (object), "o", &value, NULL); return value; } /** * test_frobber_set_o: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "o" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_o (TestFrobber *object, const gchar *value) { g_object_set (G_OBJECT (object), "o", value, NULL); } /** * test_frobber_get_g: (skip) * @object: A #TestFrobber. * * Gets the value of the "g" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use test_frobber_dup_g() if on another thread. * * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. */ const gchar * test_frobber_get_g (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_g (object); } /** * test_frobber_dup_g: (skip) * @object: A #TestFrobber. * * Gets a copy of the "g" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). */ gchar * test_frobber_dup_g (TestFrobber *object) { gchar *value; g_object_get (G_OBJECT (object), "g", &value, NULL); return value; } /** * test_frobber_set_g: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "g" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_g (TestFrobber *object, const gchar *value) { g_object_set (G_OBJECT (object), "g", value, NULL); } /** * test_frobber_get_ay: (skip) * @object: A #TestFrobber. * * Gets the value of the "ay" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use test_frobber_dup_ay() if on another thread. * * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. */ const gchar * test_frobber_get_ay (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_ay (object); } /** * test_frobber_dup_ay: (skip) * @object: A #TestFrobber. * * Gets a copy of the "ay" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). */ gchar * test_frobber_dup_ay (TestFrobber *object) { gchar *value; g_object_get (G_OBJECT (object), "ay", &value, NULL); return value; } /** * test_frobber_set_ay: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "ay" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_ay (TestFrobber *object, const gchar *value) { g_object_set (G_OBJECT (object), "ay", value, NULL); } /** * test_frobber_get_as: (skip) * @object: A #TestFrobber. * * Gets the value of the "as" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use test_frobber_dup_as() if on another thread. * * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. */ const gchar *const * test_frobber_get_as (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_as (object); } /** * test_frobber_dup_as: (skip) * @object: A #TestFrobber. * * Gets a copy of the "as" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev(). */ gchar ** test_frobber_dup_as (TestFrobber *object) { gchar **value; g_object_get (G_OBJECT (object), "as", &value, NULL); return value; } /** * test_frobber_set_as: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "as" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_as (TestFrobber *object, const gchar *const *value) { g_object_set (G_OBJECT (object), "as", value, NULL); } /** * test_frobber_get_aay: (skip) * @object: A #TestFrobber. * * Gets the value of the "aay" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use test_frobber_dup_aay() if on another thread. * * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. */ const gchar *const * test_frobber_get_aay (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_aay (object); } /** * test_frobber_dup_aay: (skip) * @object: A #TestFrobber. * * Gets a copy of the "aay" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev(). */ gchar ** test_frobber_dup_aay (TestFrobber *object) { gchar **value; g_object_get (G_OBJECT (object), "aay", &value, NULL); return value; } /** * test_frobber_set_aay: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "aay" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_aay (TestFrobber *object, const gchar *const *value) { g_object_set (G_OBJECT (object), "aay", value, NULL); } /** * test_frobber_get_ao: (skip) * @object: A #TestFrobber. * * Gets the value of the "ao" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use test_frobber_dup_ao() if on another thread. * * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. */ const gchar *const * test_frobber_get_ao (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_ao (object); } /** * test_frobber_dup_ao: (skip) * @object: A #TestFrobber. * * Gets a copy of the "ao" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev(). */ gchar ** test_frobber_dup_ao (TestFrobber *object) { gchar **value; g_object_get (G_OBJECT (object), "ao", &value, NULL); return value; } /** * test_frobber_set_ao: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "ao" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_ao (TestFrobber *object, const gchar *const *value) { g_object_set (G_OBJECT (object), "ao", value, NULL); } /** * test_frobber_get_ag: (skip) * @object: A #TestFrobber. * * Gets the value of the "ag" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use test_frobber_dup_ag() if on another thread. * * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. */ GVariant * test_frobber_get_ag (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_ag (object); } /** * test_frobber_dup_ag: (skip) * @object: A #TestFrobber. * * Gets a copy of the "ag" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref(). */ GVariant * test_frobber_dup_ag (TestFrobber *object) { GVariant *value; g_object_get (G_OBJECT (object), "ag", &value, NULL); return value; } /** * test_frobber_set_ag: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "ag" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_ag (TestFrobber *object, GVariant *value) { g_object_set (G_OBJECT (object), "ag", value, NULL); } /** * test_frobber_get_finally_normal_name: (skip) * @object: A #TestFrobber. * * Gets the value of the "FinallyNormalName" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use test_frobber_dup_finally_normal_name() if on another thread. * * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. */ const gchar * test_frobber_get_finally_normal_name (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_finally_normal_name (object); } /** * test_frobber_dup_finally_normal_name: (skip) * @object: A #TestFrobber. * * Gets a copy of the "FinallyNormalName" D-Bus property. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. * * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). */ gchar * test_frobber_dup_finally_normal_name (TestFrobber *object) { gchar *value; g_object_get (G_OBJECT (object), "finally-normal-name", &value, NULL); return value; } /** * test_frobber_set_finally_normal_name: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "FinallyNormalName" D-Bus property to @value. * * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_finally_normal_name (TestFrobber *object, const gchar *value) { g_object_set (G_OBJECT (object), "finally-normal-name", value, NULL); } /** * test_frobber_get_readonly_property: (skip) * @object: A #TestFrobber. * * Gets the value of the "ReadonlyProperty" D-Bus property. * * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. * * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use test_frobber_dup_readonly_property() if on another thread. * * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. */ const gchar * test_frobber_get_readonly_property (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_readonly_property (object); } /** * test_frobber_dup_readonly_property: (skip) * @object: A #TestFrobber. * * Gets a copy of the "ReadonlyProperty" D-Bus property. * * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. * * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). */ gchar * test_frobber_dup_readonly_property (TestFrobber *object) { gchar *value; g_object_get (G_OBJECT (object), "readonly-property", &value, NULL); return value; } /** * test_frobber_set_readonly_property: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "ReadonlyProperty" D-Bus property to @value. * * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. */ void test_frobber_set_readonly_property (TestFrobber *object, const gchar *value) { g_object_set (G_OBJECT (object), "readonly-property", value, NULL); } /** * test_frobber_get_writeonly_property: (skip) * @object: A #TestFrobber. * * Gets the value of the "WriteonlyProperty" D-Bus property. * * Since this D-Bus property is not readable, it is only meaningful to use this function on the service-side. * * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use test_frobber_dup_writeonly_property() if on another thread. * * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. */ const gchar * test_frobber_get_writeonly_property (TestFrobber *object) { return TEST_FROBBER_GET_IFACE (object)->get_writeonly_property (object); } /** * test_frobber_dup_writeonly_property: (skip) * @object: A #TestFrobber. * * Gets a copy of the "WriteonlyProperty" D-Bus property. * * Since this D-Bus property is not readable, it is only meaningful to use this function on the service-side. * * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). */ gchar * test_frobber_dup_writeonly_property (TestFrobber *object) { gchar *value; g_object_get (G_OBJECT (object), "writeonly-property", &value, NULL); return value; } /** * test_frobber_set_writeonly_property: (skip) * @object: A #TestFrobber. * @value: The value to set. * * Sets the "WriteonlyProperty" D-Bus property to @value. * * Since this D-Bus property is writable, it is meaningful to use this function on both the client- and service-side. */ void test_frobber_set_writeonly_property (TestFrobber *object, const gchar *value) { g_object_set (G_OBJECT (object), "writeonly-property", value, NULL); } /** * test_frobber_emit_test_signal: * @object: A #TestFrobber. * @arg_val_int32: Argument to pass with the signal. * @arg_array_of_strings: Argument to pass with the signal. * @arg_array_of_objpaths: Argument to pass with the signal. * @arg_dict_s_to_pairs: Argument to pass with the signal. * * Emits the "TestSignal" D-Bus signal. */ void test_frobber_emit_test_signal ( TestFrobber *object, gint arg_val_int32, const gchar *const *arg_array_of_strings, const gchar *const *arg_array_of_objpaths, GVariant *arg_dict_s_to_pairs) { g_signal_emit_by_name (object, "test-signal", arg_val_int32, arg_array_of_strings, arg_array_of_objpaths, arg_dict_s_to_pairs); } /** * test_frobber_emit_another_signal: * @object: A #TestFrobber. * @arg_word: Argument to pass with the signal. * * Emits the "AnotherSignal" D-Bus signal. */ void test_frobber_emit_another_signal ( TestFrobber *object, const gchar *arg_word) { g_signal_emit_by_name (object, "another-signal", arg_word); } /** * test_frobber_call_hello_world: * @proxy: A #TestFrobberProxy. * @arg_greeting: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the HelloWorld() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_hello_world_finish() to get the result of the operation. * * See test_frobber_call_hello_world_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_hello_world ( TestFrobber *proxy, const gchar *arg_greeting, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "HelloWorld", g_variant_new ("(s)", arg_greeting), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_hello_world_finish: * @proxy: A #TestFrobberProxy. * @out_response: (out): Return location for return parameter or %NULL to ignore. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_hello_world(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_hello_world(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_hello_world_finish ( TestFrobber *proxy, gchar **out_response, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "(s)", out_response); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_hello_world_sync: * @proxy: A #TestFrobberProxy. * @arg_greeting: Argument to pass with the method invocation. * @out_response: (out): Return location for return parameter or %NULL to ignore. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the HelloWorld() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_hello_world() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_hello_world_sync ( TestFrobber *proxy, const gchar *arg_greeting, gchar **out_response, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "HelloWorld", g_variant_new ("(s)", arg_greeting), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "(s)", out_response); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_never_return: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the NeverReturn() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_never_return_finish() to get the result of the operation. * * See test_frobber_call_never_return_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_never_return ( TestFrobber *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "NeverReturn", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_never_return_finish: * @proxy: A #TestFrobberProxy. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_never_return(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_never_return(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_never_return_finish ( TestFrobber *proxy, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_never_return_sync: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the NeverReturn() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_never_return() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_never_return_sync ( TestFrobber *proxy, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "NeverReturn", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_test_primitive_types: * @proxy: A #TestFrobberProxy. * @arg_val_byte: Argument to pass with the method invocation. * @arg_val_boolean: Argument to pass with the method invocation. * @arg_val_int16: Argument to pass with the method invocation. * @arg_val_uint16: Argument to pass with the method invocation. * @arg_val_int32: Argument to pass with the method invocation. * @arg_val_uint32: Argument to pass with the method invocation. * @arg_val_int64: Argument to pass with the method invocation. * @arg_val_uint64: Argument to pass with the method invocation. * @arg_val_double: Argument to pass with the method invocation. * @arg_val_string: Argument to pass with the method invocation. * @arg_val_objpath: Argument to pass with the method invocation. * @arg_val_signature: Argument to pass with the method invocation. * @arg_val_bytestring: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the TestPrimitiveTypes() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_test_primitive_types_finish() to get the result of the operation. * * See test_frobber_call_test_primitive_types_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_test_primitive_types ( TestFrobber *proxy, guchar arg_val_byte, gboolean arg_val_boolean, gint16 arg_val_int16, guint16 arg_val_uint16, gint arg_val_int32, guint arg_val_uint32, gint64 arg_val_int64, guint64 arg_val_uint64, gdouble arg_val_double, const gchar *arg_val_string, const gchar *arg_val_objpath, const gchar *arg_val_signature, const gchar *arg_val_bytestring, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "TestPrimitiveTypes", g_variant_new ("(ybnqiuxtdsog^ay)", arg_val_byte, arg_val_boolean, arg_val_int16, arg_val_uint16, arg_val_int32, arg_val_uint32, arg_val_int64, arg_val_uint64, arg_val_double, arg_val_string, arg_val_objpath, arg_val_signature, arg_val_bytestring), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_test_primitive_types_finish: * @proxy: A #TestFrobberProxy. * @out_ret_byte: (out): Return location for return parameter or %NULL to ignore. * @out_ret_boolean: (out): Return location for return parameter or %NULL to ignore. * @out_ret_int16: (out): Return location for return parameter or %NULL to ignore. * @out_ret_uint16: (out): Return location for return parameter or %NULL to ignore. * @out_ret_int32: (out): Return location for return parameter or %NULL to ignore. * @out_ret_uint32: (out): Return location for return parameter or %NULL to ignore. * @out_ret_int64: (out): Return location for return parameter or %NULL to ignore. * @out_ret_uint64: (out): Return location for return parameter or %NULL to ignore. * @out_ret_double: (out): Return location for return parameter or %NULL to ignore. * @out_ret_string: (out): Return location for return parameter or %NULL to ignore. * @out_ret_objpath: (out): Return location for return parameter or %NULL to ignore. * @out_ret_signature: (out): Return location for return parameter or %NULL to ignore. * @out_ret_bytestring: (out): Return location for return parameter or %NULL to ignore. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_test_primitive_types(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_test_primitive_types(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_test_primitive_types_finish ( TestFrobber *proxy, guchar *out_ret_byte, gboolean *out_ret_boolean, gint16 *out_ret_int16, guint16 *out_ret_uint16, gint *out_ret_int32, guint *out_ret_uint32, gint64 *out_ret_int64, guint64 *out_ret_uint64, gdouble *out_ret_double, gchar **out_ret_string, gchar **out_ret_objpath, gchar **out_ret_signature, gchar **out_ret_bytestring, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "(ybnqiuxtdsog^ay)", out_ret_byte, out_ret_boolean, out_ret_int16, out_ret_uint16, out_ret_int32, out_ret_uint32, out_ret_int64, out_ret_uint64, out_ret_double, out_ret_string, out_ret_objpath, out_ret_signature, out_ret_bytestring); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_test_primitive_types_sync: * @proxy: A #TestFrobberProxy. * @arg_val_byte: Argument to pass with the method invocation. * @arg_val_boolean: Argument to pass with the method invocation. * @arg_val_int16: Argument to pass with the method invocation. * @arg_val_uint16: Argument to pass with the method invocation. * @arg_val_int32: Argument to pass with the method invocation. * @arg_val_uint32: Argument to pass with the method invocation. * @arg_val_int64: Argument to pass with the method invocation. * @arg_val_uint64: Argument to pass with the method invocation. * @arg_val_double: Argument to pass with the method invocation. * @arg_val_string: Argument to pass with the method invocation. * @arg_val_objpath: Argument to pass with the method invocation. * @arg_val_signature: Argument to pass with the method invocation. * @arg_val_bytestring: Argument to pass with the method invocation. * @out_ret_byte: (out): Return location for return parameter or %NULL to ignore. * @out_ret_boolean: (out): Return location for return parameter or %NULL to ignore. * @out_ret_int16: (out): Return location for return parameter or %NULL to ignore. * @out_ret_uint16: (out): Return location for return parameter or %NULL to ignore. * @out_ret_int32: (out): Return location for return parameter or %NULL to ignore. * @out_ret_uint32: (out): Return location for return parameter or %NULL to ignore. * @out_ret_int64: (out): Return location for return parameter or %NULL to ignore. * @out_ret_uint64: (out): Return location for return parameter or %NULL to ignore. * @out_ret_double: (out): Return location for return parameter or %NULL to ignore. * @out_ret_string: (out): Return location for return parameter or %NULL to ignore. * @out_ret_objpath: (out): Return location for return parameter or %NULL to ignore. * @out_ret_signature: (out): Return location for return parameter or %NULL to ignore. * @out_ret_bytestring: (out): Return location for return parameter or %NULL to ignore. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the TestPrimitiveTypes() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_test_primitive_types() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_test_primitive_types_sync ( TestFrobber *proxy, guchar arg_val_byte, gboolean arg_val_boolean, gint16 arg_val_int16, guint16 arg_val_uint16, gint arg_val_int32, guint arg_val_uint32, gint64 arg_val_int64, guint64 arg_val_uint64, gdouble arg_val_double, const gchar *arg_val_string, const gchar *arg_val_objpath, const gchar *arg_val_signature, const gchar *arg_val_bytestring, guchar *out_ret_byte, gboolean *out_ret_boolean, gint16 *out_ret_int16, guint16 *out_ret_uint16, gint *out_ret_int32, guint *out_ret_uint32, gint64 *out_ret_int64, guint64 *out_ret_uint64, gdouble *out_ret_double, gchar **out_ret_string, gchar **out_ret_objpath, gchar **out_ret_signature, gchar **out_ret_bytestring, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "TestPrimitiveTypes", g_variant_new ("(ybnqiuxtdsog^ay)", arg_val_byte, arg_val_boolean, arg_val_int16, arg_val_uint16, arg_val_int32, arg_val_uint32, arg_val_int64, arg_val_uint64, arg_val_double, arg_val_string, arg_val_objpath, arg_val_signature, arg_val_bytestring), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "(ybnqiuxtdsog^ay)", out_ret_byte, out_ret_boolean, out_ret_int16, out_ret_uint16, out_ret_int32, out_ret_uint32, out_ret_int64, out_ret_uint64, out_ret_double, out_ret_string, out_ret_objpath, out_ret_signature, out_ret_bytestring); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_test_non_primitive_types: * @proxy: A #TestFrobberProxy. * @arg_dict_s_to_s: Argument to pass with the method invocation. * @arg_dict_s_to_pairs: Argument to pass with the method invocation. * @arg_a_struct: Argument to pass with the method invocation. * @arg_array_of_strings: Argument to pass with the method invocation. * @arg_array_of_objpaths: Argument to pass with the method invocation. * @arg_array_of_signatures: Argument to pass with the method invocation. * @arg_array_of_bytestrings: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the TestNonPrimitiveTypes() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_test_non_primitive_types_finish() to get the result of the operation. * * See test_frobber_call_test_non_primitive_types_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_test_non_primitive_types ( TestFrobber *proxy, GVariant *arg_dict_s_to_s, GVariant *arg_dict_s_to_pairs, GVariant *arg_a_struct, const gchar *const *arg_array_of_strings, const gchar *const *arg_array_of_objpaths, GVariant *arg_array_of_signatures, const gchar *const *arg_array_of_bytestrings, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "TestNonPrimitiveTypes", g_variant_new ("(@a{ss}@a{s(ii)}@(iss)^as^ao@ag^aay)", arg_dict_s_to_s, arg_dict_s_to_pairs, arg_a_struct, arg_array_of_strings, arg_array_of_objpaths, arg_array_of_signatures, arg_array_of_bytestrings), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_test_non_primitive_types_finish: * @proxy: A #TestFrobberProxy. * @out_result: (out): Return location for return parameter or %NULL to ignore. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_test_non_primitive_types(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_test_non_primitive_types(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_test_non_primitive_types_finish ( TestFrobber *proxy, gchar **out_result, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "(s)", out_result); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_test_non_primitive_types_sync: * @proxy: A #TestFrobberProxy. * @arg_dict_s_to_s: Argument to pass with the method invocation. * @arg_dict_s_to_pairs: Argument to pass with the method invocation. * @arg_a_struct: Argument to pass with the method invocation. * @arg_array_of_strings: Argument to pass with the method invocation. * @arg_array_of_objpaths: Argument to pass with the method invocation. * @arg_array_of_signatures: Argument to pass with the method invocation. * @arg_array_of_bytestrings: Argument to pass with the method invocation. * @out_result: (out): Return location for return parameter or %NULL to ignore. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the TestNonPrimitiveTypes() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_test_non_primitive_types() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_test_non_primitive_types_sync ( TestFrobber *proxy, GVariant *arg_dict_s_to_s, GVariant *arg_dict_s_to_pairs, GVariant *arg_a_struct, const gchar *const *arg_array_of_strings, const gchar *const *arg_array_of_objpaths, GVariant *arg_array_of_signatures, const gchar *const *arg_array_of_bytestrings, gchar **out_result, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "TestNonPrimitiveTypes", g_variant_new ("(@a{ss}@a{s(ii)}@(iss)^as^ao@ag^aay)", arg_dict_s_to_s, arg_dict_s_to_pairs, arg_a_struct, arg_array_of_strings, arg_array_of_objpaths, arg_array_of_signatures, arg_array_of_bytestrings), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "(s)", out_result); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_test_asv: * @proxy: A #TestFrobberProxy. * @arg_asv: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the TestAsv() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_test_asv_finish() to get the result of the operation. * * See test_frobber_call_test_asv_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_test_asv ( TestFrobber *proxy, GVariant *arg_asv, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "TestAsv", g_variant_new ("(@a{sv})", arg_asv), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_test_asv_finish: * @proxy: A #TestFrobberProxy. * @out_result: (out): Return location for return parameter or %NULL to ignore. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_test_asv(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_test_asv(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_test_asv_finish ( TestFrobber *proxy, gchar **out_result, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "(s)", out_result); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_test_asv_sync: * @proxy: A #TestFrobberProxy. * @arg_asv: Argument to pass with the method invocation. * @out_result: (out): Return location for return parameter or %NULL to ignore. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the TestAsv() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_test_asv() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_test_asv_sync ( TestFrobber *proxy, GVariant *arg_asv, gchar **out_result, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "TestAsv", g_variant_new ("(@a{sv})", arg_asv), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "(s)", out_result); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_test_variant: * @proxy: A #TestFrobberProxy. * @arg_v: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the TestVariant() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_test_variant_finish() to get the result of the operation. * * See test_frobber_call_test_variant_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_test_variant ( TestFrobber *proxy, GVariant *arg_v, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "TestVariant", g_variant_new ("(@v)", arg_v), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_test_variant_finish: * @proxy: A #TestFrobberProxy. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_test_variant(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_test_variant(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_test_variant_finish ( TestFrobber *proxy, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_test_variant_sync: * @proxy: A #TestFrobberProxy. * @arg_v: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the TestVariant() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_test_variant() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_test_variant_sync ( TestFrobber *proxy, GVariant *arg_v, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "TestVariant", g_variant_new ("(@v)", arg_v), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_request_signal_emission: * @proxy: A #TestFrobberProxy. * @arg_which_one: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the RequestSignalEmission() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_request_signal_emission_finish() to get the result of the operation. * * See test_frobber_call_request_signal_emission_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_request_signal_emission ( TestFrobber *proxy, gint arg_which_one, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "RequestSignalEmission", g_variant_new ("(i)", arg_which_one), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_request_signal_emission_finish: * @proxy: A #TestFrobberProxy. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_request_signal_emission(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_request_signal_emission(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_request_signal_emission_finish ( TestFrobber *proxy, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_request_signal_emission_sync: * @proxy: A #TestFrobberProxy. * @arg_which_one: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the RequestSignalEmission() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_request_signal_emission() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_request_signal_emission_sync ( TestFrobber *proxy, gint arg_which_one, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "RequestSignalEmission", g_variant_new ("(i)", arg_which_one), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_request_property_mods: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the RequestPropertyMods() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_request_property_mods_finish() to get the result of the operation. * * See test_frobber_call_request_property_mods_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_request_property_mods ( TestFrobber *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "RequestPropertyMods", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_request_property_mods_finish: * @proxy: A #TestFrobberProxy. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_request_property_mods(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_request_property_mods(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_request_property_mods_finish ( TestFrobber *proxy, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_request_property_mods_sync: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the RequestPropertyMods() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_request_property_mods() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_request_property_mods_sync ( TestFrobber *proxy, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "RequestPropertyMods", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_request_multi_property_mods: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the RequestMultiPropertyMods() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_request_multi_property_mods_finish() to get the result of the operation. * * See test_frobber_call_request_multi_property_mods_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_request_multi_property_mods ( TestFrobber *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "RequestMultiPropertyMods", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_request_multi_property_mods_finish: * @proxy: A #TestFrobberProxy. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_request_multi_property_mods(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_request_multi_property_mods(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_request_multi_property_mods_finish ( TestFrobber *proxy, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_request_multi_property_mods_sync: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the RequestMultiPropertyMods() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_request_multi_property_mods() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_request_multi_property_mods_sync ( TestFrobber *proxy, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "RequestMultiPropertyMods", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_unimplemented_method: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the UnimplementedMethod() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_unimplemented_method_finish() to get the result of the operation. * * See test_frobber_call_unimplemented_method_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_unimplemented_method ( TestFrobber *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "UnimplementedMethod", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_unimplemented_method_finish: * @proxy: A #TestFrobberProxy. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_unimplemented_method(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_unimplemented_method(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_unimplemented_method_finish ( TestFrobber *proxy, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_unimplemented_method_sync: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the UnimplementedMethod() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_unimplemented_method() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_unimplemented_method_sync ( TestFrobber *proxy, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "UnimplementedMethod", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_property_cancellation: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the PropertyCancellation() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_property_cancellation_finish() to get the result of the operation. * * See test_frobber_call_property_cancellation_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_property_cancellation ( TestFrobber *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "PropertyCancellation", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_property_cancellation_finish: * @proxy: A #TestFrobberProxy. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_property_cancellation(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_property_cancellation(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_property_cancellation_finish ( TestFrobber *proxy, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_property_cancellation_sync: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the PropertyCancellation() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_property_cancellation() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_property_cancellation_sync ( TestFrobber *proxy, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "PropertyCancellation", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_delete_all_objects: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the DeleteAllObjects() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_delete_all_objects_finish() to get the result of the operation. * * See test_frobber_call_delete_all_objects_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_delete_all_objects ( TestFrobber *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "DeleteAllObjects", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_delete_all_objects_finish: * @proxy: A #TestFrobberProxy. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_delete_all_objects(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_delete_all_objects(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_delete_all_objects_finish ( TestFrobber *proxy, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_delete_all_objects_sync: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the DeleteAllObjects() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_delete_all_objects() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_delete_all_objects_sync ( TestFrobber *proxy, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "DeleteAllObjects", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_create_object: * @proxy: A #TestFrobberProxy. * @arg_at_path: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the CreateObject() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_create_object_finish() to get the result of the operation. * * See test_frobber_call_create_object_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_create_object ( TestFrobber *proxy, const gchar *arg_at_path, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "CreateObject", g_variant_new ("(o)", arg_at_path), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_create_object_finish: * @proxy: A #TestFrobberProxy. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_create_object(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_create_object(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_create_object_finish ( TestFrobber *proxy, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_create_object_sync: * @proxy: A #TestFrobberProxy. * @arg_at_path: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the CreateObject() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_create_object() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_create_object_sync ( TestFrobber *proxy, const gchar *arg_at_path, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "CreateObject", g_variant_new ("(o)", arg_at_path), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_delete_object: * @proxy: A #TestFrobberProxy. * @arg_path: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the DeleteObject() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_delete_object_finish() to get the result of the operation. * * See test_frobber_call_delete_object_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_delete_object ( TestFrobber *proxy, const gchar *arg_path, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "DeleteObject", g_variant_new ("(o)", arg_path), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_delete_object_finish: * @proxy: A #TestFrobberProxy. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_delete_object(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_delete_object(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_delete_object_finish ( TestFrobber *proxy, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_delete_object_sync: * @proxy: A #TestFrobberProxy. * @arg_path: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the DeleteObject() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_delete_object() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_delete_object_sync ( TestFrobber *proxy, const gchar *arg_path, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "DeleteObject", g_variant_new ("(o)", arg_path), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_add_alpha: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the AddAlpha() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_add_alpha_finish() to get the result of the operation. * * See test_frobber_call_add_alpha_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_add_alpha ( TestFrobber *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "AddAlpha", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_add_alpha_finish: * @proxy: A #TestFrobberProxy. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_add_alpha(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_add_alpha(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_add_alpha_finish ( TestFrobber *proxy, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_add_alpha_sync: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the AddAlpha() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_add_alpha() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_add_alpha_sync ( TestFrobber *proxy, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "AddAlpha", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_remove_alpha: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the RemoveAlpha() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_remove_alpha_finish() to get the result of the operation. * * See test_frobber_call_remove_alpha_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_remove_alpha ( TestFrobber *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "RemoveAlpha", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_remove_alpha_finish: * @proxy: A #TestFrobberProxy. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_remove_alpha(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_remove_alpha(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_remove_alpha_finish ( TestFrobber *proxy, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_remove_alpha_sync: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the RemoveAlpha() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_remove_alpha() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_remove_alpha_sync ( TestFrobber *proxy, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "RemoveAlpha", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_create_clique: * @proxy: A #TestFrobberProxy. * @arg_name: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the CreateClique() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_create_clique_finish() to get the result of the operation. * * See test_frobber_call_create_clique_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_create_clique ( TestFrobber *proxy, const gchar *arg_name, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "CreateClique", g_variant_new ("(s)", arg_name), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_create_clique_finish: * @proxy: A #TestFrobberProxy. * @out_member: (out): Return location for return parameter or %NULL to ignore. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_create_clique(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_create_clique(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_create_clique_finish ( TestFrobber *proxy, gchar **out_member, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "(o)", out_member); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_create_clique_sync: * @proxy: A #TestFrobberProxy. * @arg_name: Argument to pass with the method invocation. * @out_member: (out): Return location for return parameter or %NULL to ignore. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the CreateClique() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_create_clique() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_create_clique_sync ( TestFrobber *proxy, const gchar *arg_name, gchar **out_member, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "CreateClique", g_variant_new ("(s)", arg_name), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "(o)", out_member); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_emit_hidden: * @proxy: A #TestFrobberProxy. * @arg_name: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the EmitHidden() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_emit_hidden_finish() to get the result of the operation. * * See test_frobber_call_emit_hidden_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_emit_hidden ( TestFrobber *proxy, const gchar *arg_name, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "EmitHidden", g_variant_new ("(s)", arg_name), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_emit_hidden_finish: * @proxy: A #TestFrobberProxy. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_emit_hidden(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_emit_hidden(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_emit_hidden_finish ( TestFrobber *proxy, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_emit_hidden_sync: * @proxy: A #TestFrobberProxy. * @arg_name: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the EmitHidden() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_emit_hidden() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_emit_hidden_sync ( TestFrobber *proxy, const gchar *arg_name, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "EmitHidden", g_variant_new ("(s)", arg_name), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_claim_other_name: * @proxy: A #TestFrobberProxy. * @arg_name: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the ClaimOtherName() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_claim_other_name_finish() to get the result of the operation. * * See test_frobber_call_claim_other_name_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_claim_other_name ( TestFrobber *proxy, const gchar *arg_name, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "ClaimOtherName", g_variant_new ("(s)", arg_name), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_claim_other_name_finish: * @proxy: A #TestFrobberProxy. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_claim_other_name(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_claim_other_name(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_claim_other_name_finish ( TestFrobber *proxy, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_claim_other_name_sync: * @proxy: A #TestFrobberProxy. * @arg_name: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the ClaimOtherName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_claim_other_name() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_claim_other_name_sync ( TestFrobber *proxy, const gchar *arg_name, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "ClaimOtherName", g_variant_new ("(s)", arg_name), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_release_other_name: * @proxy: A #TestFrobberProxy. * @arg_name: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the ReleaseOtherName() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_release_other_name_finish() to get the result of the operation. * * See test_frobber_call_release_other_name_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_release_other_name ( TestFrobber *proxy, const gchar *arg_name, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "ReleaseOtherName", g_variant_new ("(s)", arg_name), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_release_other_name_finish: * @proxy: A #TestFrobberProxy. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_release_other_name(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_release_other_name(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_release_other_name_finish ( TestFrobber *proxy, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_release_other_name_sync: * @proxy: A #TestFrobberProxy. * @arg_name: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the ReleaseOtherName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_release_other_name() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_release_other_name_sync ( TestFrobber *proxy, const gchar *arg_name, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "ReleaseOtherName", g_variant_new ("(s)", arg_name), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "()"); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_tell_me_your_name: * @proxy: A #TestFrobberProxy. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the TellMeYourName() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_tell_me_your_name_finish() to get the result of the operation. * * See test_frobber_call_tell_me_your_name_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_tell_me_your_name ( TestFrobber *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "TellMeYourName", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_tell_me_your_name_finish: * @proxy: A #TestFrobberProxy. * @out_name: (out): Return location for return parameter or %NULL to ignore. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_tell_me_your_name(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_tell_me_your_name(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_tell_me_your_name_finish ( TestFrobber *proxy, gchar **out_name, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "(s)", out_name); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_tell_me_your_name_sync: * @proxy: A #TestFrobberProxy. * @out_name: (out): Return location for return parameter or %NULL to ignore. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the TellMeYourName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_tell_me_your_name() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_tell_me_your_name_sync ( TestFrobber *proxy, gchar **out_name, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "TellMeYourName", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "(s)", out_name); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_make_test_fd: * @proxy: A #TestFrobberProxy. * @arg_type: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * * Asynchronously invokes the MakeTestFd() D-Bus method on @proxy. * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_call_make_test_fd_finish() to get the result of the operation. * * See test_frobber_call_make_test_fd_sync() for the synchronous, blocking version of this method. */ void test_frobber_call_make_test_fd ( TestFrobber *proxy, const gchar *arg_type, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "MakeTestFd", g_variant_new ("(s)", arg_type), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); } /** * test_frobber_call_make_test_fd_finish: * @proxy: A #TestFrobberProxy. * @out_fd: (out): Return location for return parameter or %NULL to ignore. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_call_make_test_fd(). * @error: Return location for error or %NULL. * * Finishes an operation started with test_frobber_call_make_test_fd(). * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_make_test_fd_finish ( TestFrobber *proxy, GVariant **out_fd, GAsyncResult *res, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "(@h)", out_fd); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_call_make_test_fd_sync: * @proxy: A #TestFrobberProxy. * @arg_type: Argument to pass with the method invocation. * @out_fd: (out): Return location for return parameter or %NULL to ignore. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the MakeTestFd() D-Bus method on @proxy. The calling thread is blocked until a reply is received. * * See test_frobber_call_make_test_fd() for the asynchronous version of this method. * * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. */ gboolean test_frobber_call_make_test_fd_sync ( TestFrobber *proxy, const gchar *arg_type, GVariant **out_fd, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "MakeTestFd", g_variant_new ("(s)", arg_type), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); if (_ret == NULL) goto _out; g_variant_get (_ret, "(@h)", out_fd); g_variant_unref (_ret); _out: return _ret != NULL; } /** * test_frobber_complete_hello_world: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * @response: Parameter to return. * * Helper function used in service implementations to finish handling invocations of the HelloWorld() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_hello_world ( TestFrobber *object, GDBusMethodInvocation *invocation, const gchar *response) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", response)); } /** * test_frobber_complete_never_return: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * * Helper function used in service implementations to finish handling invocations of the NeverReturn() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_never_return ( TestFrobber *object, GDBusMethodInvocation *invocation) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } /** * test_frobber_complete_test_primitive_types: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * @ret_byte: Parameter to return. * @ret_boolean: Parameter to return. * @ret_int16: Parameter to return. * @ret_uint16: Parameter to return. * @ret_int32: Parameter to return. * @ret_uint32: Parameter to return. * @ret_int64: Parameter to return. * @ret_uint64: Parameter to return. * @ret_double: Parameter to return. * @ret_string: Parameter to return. * @ret_objpath: Parameter to return. * @ret_signature: Parameter to return. * @ret_bytestring: Parameter to return. * * Helper function used in service implementations to finish handling invocations of the TestPrimitiveTypes() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_test_primitive_types ( TestFrobber *object, GDBusMethodInvocation *invocation, guchar ret_byte, gboolean ret_boolean, gint16 ret_int16, guint16 ret_uint16, gint ret_int32, guint ret_uint32, gint64 ret_int64, guint64 ret_uint64, gdouble ret_double, const gchar *ret_string, const gchar *ret_objpath, const gchar *ret_signature, const gchar *ret_bytestring) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("(ybnqiuxtdsog^ay)", ret_byte, ret_boolean, ret_int16, ret_uint16, ret_int32, ret_uint32, ret_int64, ret_uint64, ret_double, ret_string, ret_objpath, ret_signature, ret_bytestring)); } /** * test_frobber_complete_test_non_primitive_types: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * @result: Parameter to return. * * Helper function used in service implementations to finish handling invocations of the TestNonPrimitiveTypes() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_test_non_primitive_types ( TestFrobber *object, GDBusMethodInvocation *invocation, const gchar *result) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", result)); } /** * test_frobber_complete_test_asv: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * @result: Parameter to return. * * Helper function used in service implementations to finish handling invocations of the TestAsv() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_test_asv ( TestFrobber *object, GDBusMethodInvocation *invocation, const gchar *result) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", result)); } /** * test_frobber_complete_test_variant: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * * Helper function used in service implementations to finish handling invocations of the TestVariant() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_test_variant ( TestFrobber *object, GDBusMethodInvocation *invocation) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } /** * test_frobber_complete_request_signal_emission: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * * Helper function used in service implementations to finish handling invocations of the RequestSignalEmission() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_request_signal_emission ( TestFrobber *object, GDBusMethodInvocation *invocation) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } /** * test_frobber_complete_request_property_mods: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * * Helper function used in service implementations to finish handling invocations of the RequestPropertyMods() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_request_property_mods ( TestFrobber *object, GDBusMethodInvocation *invocation) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } /** * test_frobber_complete_request_multi_property_mods: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * * Helper function used in service implementations to finish handling invocations of the RequestMultiPropertyMods() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_request_multi_property_mods ( TestFrobber *object, GDBusMethodInvocation *invocation) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } /** * test_frobber_complete_unimplemented_method: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * * Helper function used in service implementations to finish handling invocations of the UnimplementedMethod() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_unimplemented_method ( TestFrobber *object, GDBusMethodInvocation *invocation) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } /** * test_frobber_complete_property_cancellation: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * * Helper function used in service implementations to finish handling invocations of the PropertyCancellation() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_property_cancellation ( TestFrobber *object, GDBusMethodInvocation *invocation) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } /** * test_frobber_complete_delete_all_objects: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * * Helper function used in service implementations to finish handling invocations of the DeleteAllObjects() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_delete_all_objects ( TestFrobber *object, GDBusMethodInvocation *invocation) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } /** * test_frobber_complete_create_object: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * * Helper function used in service implementations to finish handling invocations of the CreateObject() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_create_object ( TestFrobber *object, GDBusMethodInvocation *invocation) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } /** * test_frobber_complete_delete_object: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * * Helper function used in service implementations to finish handling invocations of the DeleteObject() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_delete_object ( TestFrobber *object, GDBusMethodInvocation *invocation) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } /** * test_frobber_complete_add_alpha: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * * Helper function used in service implementations to finish handling invocations of the AddAlpha() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_add_alpha ( TestFrobber *object, GDBusMethodInvocation *invocation) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } /** * test_frobber_complete_remove_alpha: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * * Helper function used in service implementations to finish handling invocations of the RemoveAlpha() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_remove_alpha ( TestFrobber *object, GDBusMethodInvocation *invocation) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } /** * test_frobber_complete_create_clique: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * @member: Parameter to return. * * Helper function used in service implementations to finish handling invocations of the CreateClique() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_create_clique ( TestFrobber *object, GDBusMethodInvocation *invocation, const gchar *member) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("(o)", member)); } /** * test_frobber_complete_emit_hidden: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * * Helper function used in service implementations to finish handling invocations of the EmitHidden() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_emit_hidden ( TestFrobber *object, GDBusMethodInvocation *invocation) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } /** * test_frobber_complete_claim_other_name: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * * Helper function used in service implementations to finish handling invocations of the ClaimOtherName() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_claim_other_name ( TestFrobber *object, GDBusMethodInvocation *invocation) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } /** * test_frobber_complete_release_other_name: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * * Helper function used in service implementations to finish handling invocations of the ReleaseOtherName() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_release_other_name ( TestFrobber *object, GDBusMethodInvocation *invocation) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } /** * test_frobber_complete_tell_me_your_name: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * @name: Parameter to return. * * Helper function used in service implementations to finish handling invocations of the TellMeYourName() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_tell_me_your_name ( TestFrobber *object, GDBusMethodInvocation *invocation, const gchar *name) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", name)); } /** * test_frobber_complete_make_test_fd: * @object: A #TestFrobber. * @invocation: (transfer full): A #GDBusMethodInvocation. * @fd: Parameter to return. * * Helper function used in service implementations to finish handling invocations of the MakeTestFd() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. * * This method will free @invocation, you cannot use it afterwards. */ void test_frobber_complete_make_test_fd ( TestFrobber *object, GDBusMethodInvocation *invocation, GVariant *fd) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("(@h)", fd)); } /* ------------------------------------------------------------------------ */ /** * TestFrobberProxy: * * The #TestFrobberProxy structure contains only private data and should only be accessed using the provided API. */ /** * TestFrobberProxyClass: * @parent_class: The parent class. * * Class structure for #TestFrobberProxy. */ struct _TestFrobberProxyPrivate { GData *qdata; }; static void test_frobber_proxy_iface_init (TestFrobberIface *iface); #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (TestFrobberProxy, test_frobber_proxy, G_TYPE_DBUS_PROXY, G_ADD_PRIVATE (TestFrobberProxy) G_IMPLEMENT_INTERFACE (TEST_TYPE_FROBBER, test_frobber_proxy_iface_init)); #else G_DEFINE_TYPE_WITH_CODE (TestFrobberProxy, test_frobber_proxy, G_TYPE_DBUS_PROXY, G_IMPLEMENT_INTERFACE (TEST_TYPE_FROBBER, test_frobber_proxy_iface_init)); #endif static void test_frobber_proxy_finalize (GObject *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); g_datalist_clear (&proxy->priv->qdata); G_OBJECT_CLASS (test_frobber_proxy_parent_class)->finalize (object); } static void test_frobber_proxy_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec G_GNUC_UNUSED) { const _ExtendedGDBusPropertyInfo *info; GVariant *variant; g_assert (prop_id != 0 && prop_id - 1 < 20); info = _test_frobber_property_info_pointers[prop_id - 1]; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); if (info->use_gvariant) { g_value_set_variant (value, variant); } else { if (variant != NULL) g_dbus_gvariant_to_gvalue (variant, value); } if (variant != NULL) g_variant_unref (variant); } static void test_frobber_proxy_set_property_cb (GDBusProxy *proxy, GAsyncResult *res, gpointer user_data) { const _ExtendedGDBusPropertyInfo *info = user_data; GError *error; GVariant *_ret; error = NULL; _ret = g_dbus_proxy_call_finish (proxy, res, &error); if (!_ret) { g_warning ("Error setting property '%s' on interface com.redhat.Cockpit.DBusTests.Frobber: %s (%s, %d)", info->parent_struct.name, error->message, g_quark_to_string (error->domain), error->code); g_error_free (error); } else { g_variant_unref (_ret); } } static void test_frobber_proxy_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec G_GNUC_UNUSED) { const _ExtendedGDBusPropertyInfo *info; GVariant *variant; g_assert (prop_id != 0 && prop_id - 1 < 20); info = _test_frobber_property_info_pointers[prop_id - 1]; variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); g_dbus_proxy_call (G_DBUS_PROXY (object), "org.freedesktop.DBus.Properties.Set", g_variant_new ("(ssv)", "com.redhat.Cockpit.DBusTests.Frobber", info->parent_struct.name, variant), G_DBUS_CALL_FLAGS_NONE, -1, NULL, (GAsyncReadyCallback) test_frobber_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); g_variant_unref (variant); } static void test_frobber_proxy_g_signal (GDBusProxy *proxy, const gchar *sender_name G_GNUC_UNUSED, const gchar *signal_name, GVariant *parameters) { _ExtendedGDBusSignalInfo *info; GVariantIter iter; GVariant *child; GValue *paramv; guint num_params; guint n; guint signal_id; info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_test_frobber_interface_info.parent_struct, signal_name); if (info == NULL) return; num_params = g_variant_n_children (parameters); paramv = g_new0 (GValue, num_params + 1); g_value_init (¶mv[0], TEST_TYPE_FROBBER); g_value_set_object (¶mv[0], proxy); g_variant_iter_init (&iter, parameters); n = 1; while ((child = g_variant_iter_next_value (&iter)) != NULL) { _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; if (arg_info->use_gvariant) { g_value_init (¶mv[n], G_TYPE_VARIANT); g_value_set_variant (¶mv[n], child); n++; } else g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); g_variant_unref (child); } signal_id = g_signal_lookup (info->signal_name, TEST_TYPE_FROBBER); g_signal_emitv (paramv, signal_id, 0, NULL); for (n = 0; n < num_params + 1; n++) g_value_unset (¶mv[n]); g_free (paramv); } static void test_frobber_proxy_g_properties_changed (GDBusProxy *_proxy, GVariant *changed_properties, const gchar *const *invalidated_properties) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (_proxy); guint n; const gchar *key; GVariantIter *iter; _ExtendedGDBusPropertyInfo *info; g_variant_get (changed_properties, "a{sv}", &iter); while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) { info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_frobber_interface_info.parent_struct, key); g_datalist_remove_data (&proxy->priv->qdata, key); if (info != NULL) g_object_notify (G_OBJECT (proxy), info->hyphen_name); } g_variant_iter_free (iter); for (n = 0; invalidated_properties[n] != NULL; n++) { info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_frobber_interface_info.parent_struct, invalidated_properties[n]); g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); if (info != NULL) g_object_notify (G_OBJECT (proxy), info->hyphen_name); } } static guchar test_frobber_proxy_get_y (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; guchar value = 0; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "y"); if (variant != NULL) { value = g_variant_get_byte (variant); g_variant_unref (variant); } return value; } static gboolean test_frobber_proxy_get_b (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; gboolean value = 0; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "b"); if (variant != NULL) { value = g_variant_get_boolean (variant); g_variant_unref (variant); } return value; } static gint16 test_frobber_proxy_get_n (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; gint16 value = 0; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "n"); if (variant != NULL) { value = g_variant_get_int16 (variant); g_variant_unref (variant); } return value; } static guint16 test_frobber_proxy_get_q (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; guint16 value = 0; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "q"); if (variant != NULL) { value = g_variant_get_uint16 (variant); g_variant_unref (variant); } return value; } static gint test_frobber_proxy_get_i (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; gint value = 0; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "i"); if (variant != NULL) { value = g_variant_get_int32 (variant); g_variant_unref (variant); } return value; } static guint test_frobber_proxy_get_u (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; guint value = 0; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "u"); if (variant != NULL) { value = g_variant_get_uint32 (variant); g_variant_unref (variant); } return value; } static gint64 test_frobber_proxy_get_x (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; gint64 value = 0; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "x"); if (variant != NULL) { value = g_variant_get_int64 (variant); g_variant_unref (variant); } return value; } static guint64 test_frobber_proxy_get_t (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; guint64 value = 0; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "t"); if (variant != NULL) { value = g_variant_get_uint64 (variant); g_variant_unref (variant); } return value; } static gdouble test_frobber_proxy_get_d (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; gdouble value = 0; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "d"); if (variant != NULL) { value = g_variant_get_double (variant); g_variant_unref (variant); } return value; } static const gchar * test_frobber_proxy_get_s (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; const gchar *value = NULL; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "s"); if (variant != NULL) { value = g_variant_get_string (variant, NULL); g_variant_unref (variant); } return value; } static const gchar * test_frobber_proxy_get_o (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; const gchar *value = NULL; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "o"); if (variant != NULL) { value = g_variant_get_string (variant, NULL); g_variant_unref (variant); } return value; } static const gchar * test_frobber_proxy_get_g (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; const gchar *value = NULL; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "g"); if (variant != NULL) { value = g_variant_get_string (variant, NULL); g_variant_unref (variant); } return value; } static const gchar * test_frobber_proxy_get_ay (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; const gchar *value = NULL; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "ay"); if (variant != NULL) { value = g_variant_get_bytestring (variant); g_variant_unref (variant); } return value; } static const gchar *const * test_frobber_proxy_get_as (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; const gchar *const *value = NULL; value = g_datalist_get_data (&proxy->priv->qdata, "as"); if (value != NULL) return value; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "as"); if (variant != NULL) { value = g_variant_get_strv (variant, NULL); g_datalist_set_data_full (&proxy->priv->qdata, "as", (gpointer) value, g_free); g_variant_unref (variant); } return value; } static const gchar *const * test_frobber_proxy_get_aay (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; const gchar *const *value = NULL; value = g_datalist_get_data (&proxy->priv->qdata, "aay"); if (value != NULL) return value; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "aay"); if (variant != NULL) { value = g_variant_get_bytestring_array (variant, NULL); g_datalist_set_data_full (&proxy->priv->qdata, "aay", (gpointer) value, g_free); g_variant_unref (variant); } return value; } static const gchar *const * test_frobber_proxy_get_ao (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; const gchar *const *value = NULL; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "ao"); if (variant != NULL) { value = g_variant_get_objv (variant, NULL); g_variant_unref (variant); } return value; } static GVariant * test_frobber_proxy_get_ag (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; GVariant *value = NULL; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "ag"); value = variant; if (variant != NULL) g_variant_unref (variant); return value; } static const gchar * test_frobber_proxy_get_finally_normal_name (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; const gchar *value = NULL; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "FinallyNormalName"); if (variant != NULL) { value = g_variant_get_string (variant, NULL); g_variant_unref (variant); } return value; } static const gchar * test_frobber_proxy_get_readonly_property (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; const gchar *value = NULL; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "ReadonlyProperty"); if (variant != NULL) { value = g_variant_get_string (variant, NULL); g_variant_unref (variant); } return value; } static const gchar * test_frobber_proxy_get_writeonly_property (TestFrobber *object) { TestFrobberProxy *proxy = TEST_FROBBER_PROXY (object); GVariant *variant; const gchar *value = NULL; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "WriteonlyProperty"); if (variant != NULL) { value = g_variant_get_string (variant, NULL); g_variant_unref (variant); } return value; } static void test_frobber_proxy_init (TestFrobberProxy *proxy) { #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 proxy->priv = test_frobber_proxy_get_instance_private (proxy); #else proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TEST_TYPE_FROBBER_PROXY, TestFrobberProxyPrivate); #endif g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), test_frobber_interface_info ()); } static void test_frobber_proxy_class_init (TestFrobberProxyClass *klass) { GObjectClass *gobject_class; GDBusProxyClass *proxy_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = test_frobber_proxy_finalize; gobject_class->get_property = test_frobber_proxy_get_property; gobject_class->set_property = test_frobber_proxy_set_property; proxy_class = G_DBUS_PROXY_CLASS (klass); proxy_class->g_signal = test_frobber_proxy_g_signal; proxy_class->g_properties_changed = test_frobber_proxy_g_properties_changed; test_frobber_override_properties (gobject_class, 1); #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 g_type_class_add_private (klass, sizeof (TestFrobberProxyPrivate)); #endif } static void test_frobber_proxy_iface_init (TestFrobberIface *iface) { iface->get_y = test_frobber_proxy_get_y; iface->get_b = test_frobber_proxy_get_b; iface->get_n = test_frobber_proxy_get_n; iface->get_q = test_frobber_proxy_get_q; iface->get_i = test_frobber_proxy_get_i; iface->get_u = test_frobber_proxy_get_u; iface->get_x = test_frobber_proxy_get_x; iface->get_t = test_frobber_proxy_get_t; iface->get_d = test_frobber_proxy_get_d; iface->get_s = test_frobber_proxy_get_s; iface->get_o = test_frobber_proxy_get_o; iface->get_g = test_frobber_proxy_get_g; iface->get_ay = test_frobber_proxy_get_ay; iface->get_as = test_frobber_proxy_get_as; iface->get_aay = test_frobber_proxy_get_aay; iface->get_ao = test_frobber_proxy_get_ao; iface->get_ag = test_frobber_proxy_get_ag; iface->get_finally_normal_name = test_frobber_proxy_get_finally_normal_name; iface->get_readonly_property = test_frobber_proxy_get_readonly_property; iface->get_writeonly_property = test_frobber_proxy_get_writeonly_property; } /** * test_frobber_proxy_new: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * * Asynchronously creates a proxy for the D-Bus interface com.redhat.Cockpit.DBusTests.Frobber. See g_dbus_proxy_new() for more details. * * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_proxy_new_finish() to get the result of the operation. * * See test_frobber_proxy_new_sync() for the synchronous, blocking version of this constructor. */ void test_frobber_proxy_new ( GDBusConnection *connection, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_async_initable_new_async (TEST_TYPE_FROBBER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Frobber", NULL); } /** * test_frobber_proxy_new_finish: * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_proxy_new(). * @error: Return location for error or %NULL * * Finishes an operation started with test_frobber_proxy_new(). * * Returns: (transfer full) (type TestFrobberProxy): The constructed proxy object or %NULL if @error is set. */ TestFrobber * test_frobber_proxy_new_finish ( GAsyncResult *res, GError **error) { GObject *ret; GObject *source_object; source_object = g_async_result_get_source_object (res); ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); g_object_unref (source_object); if (ret != NULL) return TEST_FROBBER (ret); else return NULL; } /** * test_frobber_proxy_new_sync: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Synchronously creates a proxy for the D-Bus interface com.redhat.Cockpit.DBusTests.Frobber. See g_dbus_proxy_new_sync() for more details. * * The calling thread is blocked until a reply is received. * * See test_frobber_proxy_new() for the asynchronous version of this constructor. * * Returns: (transfer full) (type TestFrobberProxy): The constructed proxy object or %NULL if @error is set. */ TestFrobber * test_frobber_proxy_new_sync ( GDBusConnection *connection, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GError **error) { GInitable *ret; ret = g_initable_new (TEST_TYPE_FROBBER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Frobber", NULL); if (ret != NULL) return TEST_FROBBER (ret); else return NULL; } /** * test_frobber_proxy_new_for_bus: * @bus_type: A #GBusType. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * * Like test_frobber_proxy_new() but takes a #GBusType instead of a #GDBusConnection. * * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_frobber_proxy_new_for_bus_finish() to get the result of the operation. * * See test_frobber_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. */ void test_frobber_proxy_new_for_bus ( GBusType bus_type, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_async_initable_new_async (TEST_TYPE_FROBBER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Frobber", NULL); } /** * test_frobber_proxy_new_for_bus_finish: * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_frobber_proxy_new_for_bus(). * @error: Return location for error or %NULL * * Finishes an operation started with test_frobber_proxy_new_for_bus(). * * Returns: (transfer full) (type TestFrobberProxy): The constructed proxy object or %NULL if @error is set. */ TestFrobber * test_frobber_proxy_new_for_bus_finish ( GAsyncResult *res, GError **error) { GObject *ret; GObject *source_object; source_object = g_async_result_get_source_object (res); ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); g_object_unref (source_object); if (ret != NULL) return TEST_FROBBER (ret); else return NULL; } /** * test_frobber_proxy_new_for_bus_sync: * @bus_type: A #GBusType. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Like test_frobber_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. * * The calling thread is blocked until a reply is received. * * See test_frobber_proxy_new_for_bus() for the asynchronous version of this constructor. * * Returns: (transfer full) (type TestFrobberProxy): The constructed proxy object or %NULL if @error is set. */ TestFrobber * test_frobber_proxy_new_for_bus_sync ( GBusType bus_type, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GError **error) { GInitable *ret; ret = g_initable_new (TEST_TYPE_FROBBER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Frobber", NULL); if (ret != NULL) return TEST_FROBBER (ret); else return NULL; } /* ------------------------------------------------------------------------ */ /** * TestFrobberSkeleton: * * The #TestFrobberSkeleton structure contains only private data and should only be accessed using the provided API. */ /** * TestFrobberSkeletonClass: * @parent_class: The parent class. * * Class structure for #TestFrobberSkeleton. */ struct _TestFrobberSkeletonPrivate { GValue *properties; GList *changed_properties; GSource *changed_properties_idle_source; GMainContext *context; GMutex lock; }; static void _test_frobber_skeleton_handle_method_call ( GDBusConnection *connection G_GNUC_UNUSED, const gchar *sender G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, const gchar *method_name, GVariant *parameters, GDBusMethodInvocation *invocation, gpointer user_data) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (user_data); _ExtendedGDBusMethodInfo *info; GVariantIter iter; GVariant *child; GValue *paramv; guint num_params; guint num_extra; guint n; guint signal_id; GValue return_value = G_VALUE_INIT; info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); g_assert (info != NULL); num_params = g_variant_n_children (parameters); num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); n = 0; g_value_init (¶mv[n], TEST_TYPE_FROBBER); g_value_set_object (¶mv[n++], skeleton); g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); g_value_set_object (¶mv[n++], invocation); if (info->pass_fdlist) { #ifdef G_OS_UNIX g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); #else g_assert_not_reached (); #endif } g_variant_iter_init (&iter, parameters); while ((child = g_variant_iter_next_value (&iter)) != NULL) { _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; if (arg_info->use_gvariant) { g_value_init (¶mv[n], G_TYPE_VARIANT); g_value_set_variant (¶mv[n], child); n++; } else g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); g_variant_unref (child); } signal_id = g_signal_lookup (info->signal_name, TEST_TYPE_FROBBER); g_value_init (&return_value, G_TYPE_BOOLEAN); g_signal_emitv (paramv, signal_id, 0, &return_value); if (!g_value_get_boolean (&return_value)) g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); g_value_unset (&return_value); for (n = 0; n < num_params + num_extra; n++) g_value_unset (¶mv[n]); g_free (paramv); } static GVariant * _test_frobber_skeleton_handle_get_property ( GDBusConnection *connection G_GNUC_UNUSED, const gchar *sender G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name G_GNUC_UNUSED, const gchar *property_name, GError **error, gpointer user_data) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (user_data); GValue value = G_VALUE_INIT; GParamSpec *pspec; _ExtendedGDBusPropertyInfo *info; GVariant *ret; ret = NULL; info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_frobber_interface_info.parent_struct, property_name); g_assert (info != NULL); pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); if (pspec == NULL) { g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); } else { g_value_init (&value, pspec->value_type); g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); g_value_unset (&value); } return ret; } static gboolean _test_frobber_skeleton_handle_set_property ( GDBusConnection *connection G_GNUC_UNUSED, const gchar *sender G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name G_GNUC_UNUSED, const gchar *property_name, GVariant *variant, GError **error, gpointer user_data) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (user_data); GValue value = G_VALUE_INIT; GParamSpec *pspec; _ExtendedGDBusPropertyInfo *info; gboolean ret; ret = FALSE; info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_frobber_interface_info.parent_struct, property_name); g_assert (info != NULL); pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); if (pspec == NULL) { g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); } else { if (info->use_gvariant) g_value_set_variant (&value, variant); else g_dbus_gvariant_to_gvalue (variant, &value); g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); g_value_unset (&value); ret = TRUE; } return ret; } static const GDBusInterfaceVTable _test_frobber_skeleton_vtable = { _test_frobber_skeleton_handle_method_call, _test_frobber_skeleton_handle_get_property, _test_frobber_skeleton_handle_set_property, {NULL} }; static GDBusInterfaceInfo * test_frobber_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) { return test_frobber_interface_info (); } static GDBusInterfaceVTable * test_frobber_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) { return (GDBusInterfaceVTable *) &_test_frobber_skeleton_vtable; } static GVariant * test_frobber_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (_skeleton); GVariantBuilder builder; guint n; g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); if (_test_frobber_interface_info.parent_struct.properties == NULL) goto out; for (n = 0; _test_frobber_interface_info.parent_struct.properties[n] != NULL; n++) { GDBusPropertyInfo *info = _test_frobber_interface_info.parent_struct.properties[n]; if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) { GVariant *value; value = _test_frobber_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.redhat.Cockpit.DBusTests.Frobber", info->name, NULL, skeleton); if (value != NULL) { g_variant_take_ref (value); g_variant_builder_add (&builder, "{sv}", info->name, value); g_variant_unref (value); } } } out: return g_variant_builder_end (&builder); } static gboolean _test_frobber_emit_changed (gpointer user_data); static void test_frobber_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (_skeleton); gboolean emit_changed = FALSE; g_mutex_lock (&skeleton->priv->lock); if (skeleton->priv->changed_properties_idle_source != NULL) { g_source_destroy (skeleton->priv->changed_properties_idle_source); skeleton->priv->changed_properties_idle_source = NULL; emit_changed = TRUE; } g_mutex_unlock (&skeleton->priv->lock); if (emit_changed) _test_frobber_emit_changed (skeleton); } static void _test_frobber_on_signal_test_signal ( TestFrobber *object, gint arg_val_int32, const gchar *const *arg_array_of_strings, const gchar *const *arg_array_of_objpaths, GVariant *arg_dict_s_to_pairs) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); GList *connections, *l; GVariant *signal_variant; connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); signal_variant = g_variant_ref_sink (g_variant_new ("(i^as^ao@a{s(ii)})", arg_val_int32, arg_array_of_strings, arg_array_of_objpaths, arg_dict_s_to_pairs)); for (l = connections; l != NULL; l = l->next) { GDBusConnection *connection = l->data; g_dbus_connection_emit_signal (connection, NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.redhat.Cockpit.DBusTests.Frobber", "TestSignal", signal_variant, NULL); } g_variant_unref (signal_variant); g_list_free_full (connections, g_object_unref); } static void _test_frobber_on_signal_another_signal ( TestFrobber *object, const gchar *arg_word) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); GList *connections, *l; GVariant *signal_variant; connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); signal_variant = g_variant_ref_sink (g_variant_new ("(s)", arg_word)); for (l = connections; l != NULL; l = l->next) { GDBusConnection *connection = l->data; g_dbus_connection_emit_signal (connection, NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.redhat.Cockpit.DBusTests.Frobber", "AnotherSignal", signal_variant, NULL); } g_variant_unref (signal_variant); g_list_free_full (connections, g_object_unref); } static void test_frobber_skeleton_iface_init (TestFrobberIface *iface); #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (TestFrobberSkeleton, test_frobber_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, G_ADD_PRIVATE (TestFrobberSkeleton) G_IMPLEMENT_INTERFACE (TEST_TYPE_FROBBER, test_frobber_skeleton_iface_init)); #else G_DEFINE_TYPE_WITH_CODE (TestFrobberSkeleton, test_frobber_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, G_IMPLEMENT_INTERFACE (TEST_TYPE_FROBBER, test_frobber_skeleton_iface_init)); #endif static void test_frobber_skeleton_finalize (GObject *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); guint n; for (n = 0; n < 20; n++) g_value_unset (&skeleton->priv->properties[n]); g_free (skeleton->priv->properties); g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); if (skeleton->priv->changed_properties_idle_source != NULL) g_source_destroy (skeleton->priv->changed_properties_idle_source); g_main_context_unref (skeleton->priv->context); g_mutex_clear (&skeleton->priv->lock); G_OBJECT_CLASS (test_frobber_skeleton_parent_class)->finalize (object); } static void test_frobber_skeleton_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec G_GNUC_UNUSED) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); g_assert (prop_id != 0 && prop_id - 1 < 20); g_mutex_lock (&skeleton->priv->lock); g_value_copy (&skeleton->priv->properties[prop_id - 1], value); g_mutex_unlock (&skeleton->priv->lock); } static gboolean _test_frobber_emit_changed (gpointer user_data) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (user_data); GList *l; GVariantBuilder builder; GVariantBuilder invalidated_builder; guint num_changes; g_mutex_lock (&skeleton->priv->lock); g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) { ChangedProperty *cp = l->data; GVariant *variant; const GValue *cur_value; cur_value = &skeleton->priv->properties[cp->prop_id - 1]; if (!_g_value_equal (cur_value, &cp->orig_value)) { variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); g_variant_unref (variant); num_changes++; } } if (num_changes > 0) { GList *connections, *ll; GVariant *signal_variant; signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "com.redhat.Cockpit.DBusTests.Frobber", &builder, &invalidated_builder)); connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); for (ll = connections; ll != NULL; ll = ll->next) { GDBusConnection *connection = ll->data; g_dbus_connection_emit_signal (connection, NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.DBus.Properties", "PropertiesChanged", signal_variant, NULL); } g_variant_unref (signal_variant); g_list_free_full (connections, g_object_unref); } else { g_variant_builder_clear (&builder); g_variant_builder_clear (&invalidated_builder); } g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); skeleton->priv->changed_properties = NULL; skeleton->priv->changed_properties_idle_source = NULL; g_mutex_unlock (&skeleton->priv->lock); return FALSE; } static void _test_frobber_schedule_emit_changed (TestFrobberSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) { ChangedProperty *cp; GList *l; cp = NULL; for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) { ChangedProperty *i_cp = l->data; if (i_cp->info == info) { cp = i_cp; break; } } if (cp == NULL) { cp = g_new0 (ChangedProperty, 1); cp->prop_id = prop_id; cp->info = info; skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); g_value_copy (orig_value, &cp->orig_value); } } static void test_frobber_skeleton_notify (GObject *object, GParamSpec *pspec G_GNUC_UNUSED) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); g_mutex_lock (&skeleton->priv->lock); if (skeleton->priv->changed_properties != NULL && skeleton->priv->changed_properties_idle_source == NULL) { skeleton->priv->changed_properties_idle_source = g_idle_source_new (); g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); g_source_set_callback (skeleton->priv->changed_properties_idle_source, _test_frobber_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _test_frobber_emit_changed"); g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); g_source_unref (skeleton->priv->changed_properties_idle_source); } g_mutex_unlock (&skeleton->priv->lock); } static void test_frobber_skeleton_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); g_assert (prop_id != 0 && prop_id - 1 < 20); g_mutex_lock (&skeleton->priv->lock); g_object_freeze_notify (object); if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) { if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL) _test_frobber_schedule_emit_changed (skeleton, _test_frobber_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]); g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); g_object_notify_by_pspec (object, pspec); } g_mutex_unlock (&skeleton->priv->lock); g_object_thaw_notify (object); } static void test_frobber_skeleton_init (TestFrobberSkeleton *skeleton) { #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 skeleton->priv = test_frobber_skeleton_get_instance_private (skeleton); #else skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TEST_TYPE_FROBBER_SKELETON, TestFrobberSkeletonPrivate); #endif g_mutex_init (&skeleton->priv->lock); skeleton->priv->context = g_main_context_ref_thread_default (); skeleton->priv->properties = g_new0 (GValue, 20); g_value_init (&skeleton->priv->properties[0], G_TYPE_UCHAR); g_value_init (&skeleton->priv->properties[1], G_TYPE_BOOLEAN); g_value_init (&skeleton->priv->properties[2], G_TYPE_INT); g_value_init (&skeleton->priv->properties[3], G_TYPE_UINT); g_value_init (&skeleton->priv->properties[4], G_TYPE_INT); g_value_init (&skeleton->priv->properties[5], G_TYPE_UINT); g_value_init (&skeleton->priv->properties[6], G_TYPE_INT64); g_value_init (&skeleton->priv->properties[7], G_TYPE_UINT64); g_value_init (&skeleton->priv->properties[8], G_TYPE_DOUBLE); g_value_init (&skeleton->priv->properties[9], G_TYPE_STRING); g_value_init (&skeleton->priv->properties[10], G_TYPE_STRING); g_value_init (&skeleton->priv->properties[11], G_TYPE_STRING); g_value_init (&skeleton->priv->properties[12], G_TYPE_STRING); g_value_init (&skeleton->priv->properties[13], G_TYPE_STRV); g_value_init (&skeleton->priv->properties[14], G_TYPE_STRV); g_value_init (&skeleton->priv->properties[15], G_TYPE_STRV); g_value_init (&skeleton->priv->properties[16], G_TYPE_VARIANT); g_value_init (&skeleton->priv->properties[17], G_TYPE_STRING); g_value_init (&skeleton->priv->properties[18], G_TYPE_STRING); g_value_init (&skeleton->priv->properties[19], G_TYPE_STRING); } static guchar test_frobber_skeleton_get_y (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); guchar value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_uchar (&(skeleton->priv->properties[0])); g_mutex_unlock (&skeleton->priv->lock); return value; } static gboolean test_frobber_skeleton_get_b (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); gboolean value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_boolean (&(skeleton->priv->properties[1])); g_mutex_unlock (&skeleton->priv->lock); return value; } static gint16 test_frobber_skeleton_get_n (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); gint value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_int (&(skeleton->priv->properties[2])); g_mutex_unlock (&skeleton->priv->lock); return value; } static guint16 test_frobber_skeleton_get_q (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); guint value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_uint (&(skeleton->priv->properties[3])); g_mutex_unlock (&skeleton->priv->lock); return value; } static gint test_frobber_skeleton_get_i (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); gint value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_int (&(skeleton->priv->properties[4])); g_mutex_unlock (&skeleton->priv->lock); return value; } static guint test_frobber_skeleton_get_u (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); guint value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_uint (&(skeleton->priv->properties[5])); g_mutex_unlock (&skeleton->priv->lock); return value; } static gint64 test_frobber_skeleton_get_x (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); gint64 value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_int64 (&(skeleton->priv->properties[6])); g_mutex_unlock (&skeleton->priv->lock); return value; } static guint64 test_frobber_skeleton_get_t (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); guint64 value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_uint64 (&(skeleton->priv->properties[7])); g_mutex_unlock (&skeleton->priv->lock); return value; } static gdouble test_frobber_skeleton_get_d (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); gdouble value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_double (&(skeleton->priv->properties[8])); g_mutex_unlock (&skeleton->priv->lock); return value; } static const gchar * test_frobber_skeleton_get_s (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); const gchar *value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_string (&(skeleton->priv->properties[9])); g_mutex_unlock (&skeleton->priv->lock); return value; } static const gchar * test_frobber_skeleton_get_o (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); const gchar *value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_string (&(skeleton->priv->properties[10])); g_mutex_unlock (&skeleton->priv->lock); return value; } static const gchar * test_frobber_skeleton_get_g (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); const gchar *value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_string (&(skeleton->priv->properties[11])); g_mutex_unlock (&skeleton->priv->lock); return value; } static const gchar * test_frobber_skeleton_get_ay (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); const gchar *value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_string (&(skeleton->priv->properties[12])); g_mutex_unlock (&skeleton->priv->lock); return value; } static const gchar *const * test_frobber_skeleton_get_as (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); const gchar *const *value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_boxed (&(skeleton->priv->properties[13])); g_mutex_unlock (&skeleton->priv->lock); return value; } static const gchar *const * test_frobber_skeleton_get_aay (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); const gchar *const *value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_boxed (&(skeleton->priv->properties[14])); g_mutex_unlock (&skeleton->priv->lock); return value; } static const gchar *const * test_frobber_skeleton_get_ao (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); const gchar *const *value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_boxed (&(skeleton->priv->properties[15])); g_mutex_unlock (&skeleton->priv->lock); return value; } static GVariant * test_frobber_skeleton_get_ag (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); GVariant *value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_variant (&(skeleton->priv->properties[16])); g_mutex_unlock (&skeleton->priv->lock); return value; } static const gchar * test_frobber_skeleton_get_finally_normal_name (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); const gchar *value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_string (&(skeleton->priv->properties[17])); g_mutex_unlock (&skeleton->priv->lock); return value; } static const gchar * test_frobber_skeleton_get_readonly_property (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); const gchar *value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_string (&(skeleton->priv->properties[18])); g_mutex_unlock (&skeleton->priv->lock); return value; } static const gchar * test_frobber_skeleton_get_writeonly_property (TestFrobber *object) { TestFrobberSkeleton *skeleton = TEST_FROBBER_SKELETON (object); const gchar *value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_string (&(skeleton->priv->properties[19])); g_mutex_unlock (&skeleton->priv->lock); return value; } static void test_frobber_skeleton_class_init (TestFrobberSkeletonClass *klass) { GObjectClass *gobject_class; GDBusInterfaceSkeletonClass *skeleton_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = test_frobber_skeleton_finalize; gobject_class->get_property = test_frobber_skeleton_get_property; gobject_class->set_property = test_frobber_skeleton_set_property; gobject_class->notify = test_frobber_skeleton_notify; test_frobber_override_properties (gobject_class, 1); skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); skeleton_class->get_info = test_frobber_skeleton_dbus_interface_get_info; skeleton_class->get_properties = test_frobber_skeleton_dbus_interface_get_properties; skeleton_class->flush = test_frobber_skeleton_dbus_interface_flush; skeleton_class->get_vtable = test_frobber_skeleton_dbus_interface_get_vtable; #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 g_type_class_add_private (klass, sizeof (TestFrobberSkeletonPrivate)); #endif } static void test_frobber_skeleton_iface_init (TestFrobberIface *iface) { iface->test_signal = _test_frobber_on_signal_test_signal; iface->another_signal = _test_frobber_on_signal_another_signal; iface->get_y = test_frobber_skeleton_get_y; iface->get_b = test_frobber_skeleton_get_b; iface->get_n = test_frobber_skeleton_get_n; iface->get_q = test_frobber_skeleton_get_q; iface->get_i = test_frobber_skeleton_get_i; iface->get_u = test_frobber_skeleton_get_u; iface->get_x = test_frobber_skeleton_get_x; iface->get_t = test_frobber_skeleton_get_t; iface->get_d = test_frobber_skeleton_get_d; iface->get_s = test_frobber_skeleton_get_s; iface->get_o = test_frobber_skeleton_get_o; iface->get_g = test_frobber_skeleton_get_g; iface->get_ay = test_frobber_skeleton_get_ay; iface->get_as = test_frobber_skeleton_get_as; iface->get_aay = test_frobber_skeleton_get_aay; iface->get_ao = test_frobber_skeleton_get_ao; iface->get_ag = test_frobber_skeleton_get_ag; iface->get_finally_normal_name = test_frobber_skeleton_get_finally_normal_name; iface->get_readonly_property = test_frobber_skeleton_get_readonly_property; iface->get_writeonly_property = test_frobber_skeleton_get_writeonly_property; } /** * test_frobber_skeleton_new: * * Creates a skeleton object for the D-Bus interface com.redhat.Cockpit.DBusTests.Frobber. * * Returns: (transfer full) (type TestFrobberSkeleton): The skeleton object. */ TestFrobber * test_frobber_skeleton_new (void) { return TEST_FROBBER (g_object_new (TEST_TYPE_FROBBER_SKELETON, NULL)); } /* ------------------------------------------------------------------------ * Code for interface com.redhat.Cockpit.DBusTests.Clique * ------------------------------------------------------------------------ */ /** * SECTION:TestClique * @title: TestClique * @short_description: Generated C code for the com.redhat.Cockpit.DBusTests.Clique D-Bus interface * * This section contains code for working with the com.redhat.Cockpit.DBusTests.Clique D-Bus interface in C. */ /* ---- Introspection data for com.redhat.Cockpit.DBusTests.Clique ---- */ static const _ExtendedGDBusPropertyInfo _test_clique_property_info_friend = { { -1, (gchar *) "Friend", (gchar *) "o", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL }, "friend", FALSE }; static const _ExtendedGDBusPropertyInfo * const _test_clique_property_info_pointers[] = { &_test_clique_property_info_friend, NULL }; static const _ExtendedGDBusInterfaceInfo _test_clique_interface_info = { { -1, (gchar *) "com.redhat.Cockpit.DBusTests.Clique", NULL, NULL, (GDBusPropertyInfo **) &_test_clique_property_info_pointers, NULL }, "clique", }; /** * test_clique_interface_info: * * Gets a machine-readable description of the com.redhat.Cockpit.DBusTests.Clique D-Bus interface. * * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. */ GDBusInterfaceInfo * test_clique_interface_info (void) { return (GDBusInterfaceInfo *) &_test_clique_interface_info.parent_struct; } /** * test_clique_override_properties: * @klass: The class structure for a #GObject-derived class. * @property_id_begin: The property id to assign to the first overridden property. * * Overrides all #GObject properties in the #TestClique interface for a concrete class. * The properties are overridden in the order they are defined. * * Returns: The last property id. */ guint test_clique_override_properties (GObjectClass *klass, guint property_id_begin) { g_object_class_override_property (klass, property_id_begin++, "friend"); return property_id_begin - 1; } /** * TestClique: * * Abstract interface type for the D-Bus interface com.redhat.Cockpit.DBusTests.Clique. */ /** * TestCliqueIface: * @parent_iface: The parent interface. * @get_friend: Getter for the #TestClique:friend property. * * Virtual table for the D-Bus interface com.redhat.Cockpit.DBusTests.Clique. */ typedef TestCliqueIface TestCliqueInterface; G_DEFINE_INTERFACE (TestClique, test_clique, G_TYPE_OBJECT); static void test_clique_default_init (TestCliqueIface *iface) { /* GObject properties for D-Bus properties: */ /** * TestClique:friend: * * Represents the D-Bus property "Friend". * * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. */ g_object_interface_install_property (iface, g_param_spec_string ("friend", "Friend", "Friend", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } /** * test_clique_get_friend: (skip) * @object: A #TestClique. * * Gets the value of the "Friend" D-Bus property. * * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. * * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use test_clique_dup_friend() if on another thread. * * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. */ const gchar * test_clique_get_friend (TestClique *object) { return TEST_CLIQUE_GET_IFACE (object)->get_friend (object); } /** * test_clique_dup_friend: (skip) * @object: A #TestClique. * * Gets a copy of the "Friend" D-Bus property. * * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. * * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). */ gchar * test_clique_dup_friend (TestClique *object) { gchar *value; g_object_get (G_OBJECT (object), "friend", &value, NULL); return value; } /** * test_clique_set_friend: (skip) * @object: A #TestClique. * @value: The value to set. * * Sets the "Friend" D-Bus property to @value. * * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. */ void test_clique_set_friend (TestClique *object, const gchar *value) { g_object_set (G_OBJECT (object), "friend", value, NULL); } /* ------------------------------------------------------------------------ */ /** * TestCliqueProxy: * * The #TestCliqueProxy structure contains only private data and should only be accessed using the provided API. */ /** * TestCliqueProxyClass: * @parent_class: The parent class. * * Class structure for #TestCliqueProxy. */ struct _TestCliqueProxyPrivate { GData *qdata; }; static void test_clique_proxy_iface_init (TestCliqueIface *iface); #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (TestCliqueProxy, test_clique_proxy, G_TYPE_DBUS_PROXY, G_ADD_PRIVATE (TestCliqueProxy) G_IMPLEMENT_INTERFACE (TEST_TYPE_CLIQUE, test_clique_proxy_iface_init)); #else G_DEFINE_TYPE_WITH_CODE (TestCliqueProxy, test_clique_proxy, G_TYPE_DBUS_PROXY, G_IMPLEMENT_INTERFACE (TEST_TYPE_CLIQUE, test_clique_proxy_iface_init)); #endif static void test_clique_proxy_finalize (GObject *object) { TestCliqueProxy *proxy = TEST_CLIQUE_PROXY (object); g_datalist_clear (&proxy->priv->qdata); G_OBJECT_CLASS (test_clique_proxy_parent_class)->finalize (object); } static void test_clique_proxy_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec G_GNUC_UNUSED) { const _ExtendedGDBusPropertyInfo *info; GVariant *variant; g_assert (prop_id != 0 && prop_id - 1 < 1); info = _test_clique_property_info_pointers[prop_id - 1]; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); if (info->use_gvariant) { g_value_set_variant (value, variant); } else { if (variant != NULL) g_dbus_gvariant_to_gvalue (variant, value); } if (variant != NULL) g_variant_unref (variant); } static void test_clique_proxy_set_property_cb (GDBusProxy *proxy, GAsyncResult *res, gpointer user_data) { const _ExtendedGDBusPropertyInfo *info = user_data; GError *error; GVariant *_ret; error = NULL; _ret = g_dbus_proxy_call_finish (proxy, res, &error); if (!_ret) { g_warning ("Error setting property '%s' on interface com.redhat.Cockpit.DBusTests.Clique: %s (%s, %d)", info->parent_struct.name, error->message, g_quark_to_string (error->domain), error->code); g_error_free (error); } else { g_variant_unref (_ret); } } static void test_clique_proxy_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec G_GNUC_UNUSED) { const _ExtendedGDBusPropertyInfo *info; GVariant *variant; g_assert (prop_id != 0 && prop_id - 1 < 1); info = _test_clique_property_info_pointers[prop_id - 1]; variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); g_dbus_proxy_call (G_DBUS_PROXY (object), "org.freedesktop.DBus.Properties.Set", g_variant_new ("(ssv)", "com.redhat.Cockpit.DBusTests.Clique", info->parent_struct.name, variant), G_DBUS_CALL_FLAGS_NONE, -1, NULL, (GAsyncReadyCallback) test_clique_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); g_variant_unref (variant); } static void test_clique_proxy_g_signal (GDBusProxy *proxy, const gchar *sender_name G_GNUC_UNUSED, const gchar *signal_name, GVariant *parameters) { _ExtendedGDBusSignalInfo *info; GVariantIter iter; GVariant *child; GValue *paramv; guint num_params; guint n; guint signal_id; info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_test_clique_interface_info.parent_struct, signal_name); if (info == NULL) return; num_params = g_variant_n_children (parameters); paramv = g_new0 (GValue, num_params + 1); g_value_init (¶mv[0], TEST_TYPE_CLIQUE); g_value_set_object (¶mv[0], proxy); g_variant_iter_init (&iter, parameters); n = 1; while ((child = g_variant_iter_next_value (&iter)) != NULL) { _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; if (arg_info->use_gvariant) { g_value_init (¶mv[n], G_TYPE_VARIANT); g_value_set_variant (¶mv[n], child); n++; } else g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); g_variant_unref (child); } signal_id = g_signal_lookup (info->signal_name, TEST_TYPE_CLIQUE); g_signal_emitv (paramv, signal_id, 0, NULL); for (n = 0; n < num_params + 1; n++) g_value_unset (¶mv[n]); g_free (paramv); } static void test_clique_proxy_g_properties_changed (GDBusProxy *_proxy, GVariant *changed_properties, const gchar *const *invalidated_properties) { TestCliqueProxy *proxy = TEST_CLIQUE_PROXY (_proxy); guint n; const gchar *key; GVariantIter *iter; _ExtendedGDBusPropertyInfo *info; g_variant_get (changed_properties, "a{sv}", &iter); while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) { info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_clique_interface_info.parent_struct, key); g_datalist_remove_data (&proxy->priv->qdata, key); if (info != NULL) g_object_notify (G_OBJECT (proxy), info->hyphen_name); } g_variant_iter_free (iter); for (n = 0; invalidated_properties[n] != NULL; n++) { info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_clique_interface_info.parent_struct, invalidated_properties[n]); g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); if (info != NULL) g_object_notify (G_OBJECT (proxy), info->hyphen_name); } } static const gchar * test_clique_proxy_get_friend (TestClique *object) { TestCliqueProxy *proxy = TEST_CLIQUE_PROXY (object); GVariant *variant; const gchar *value = NULL; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Friend"); if (variant != NULL) { value = g_variant_get_string (variant, NULL); g_variant_unref (variant); } return value; } static void test_clique_proxy_init (TestCliqueProxy *proxy) { #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 proxy->priv = test_clique_proxy_get_instance_private (proxy); #else proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TEST_TYPE_CLIQUE_PROXY, TestCliqueProxyPrivate); #endif g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), test_clique_interface_info ()); } static void test_clique_proxy_class_init (TestCliqueProxyClass *klass) { GObjectClass *gobject_class; GDBusProxyClass *proxy_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = test_clique_proxy_finalize; gobject_class->get_property = test_clique_proxy_get_property; gobject_class->set_property = test_clique_proxy_set_property; proxy_class = G_DBUS_PROXY_CLASS (klass); proxy_class->g_signal = test_clique_proxy_g_signal; proxy_class->g_properties_changed = test_clique_proxy_g_properties_changed; test_clique_override_properties (gobject_class, 1); #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 g_type_class_add_private (klass, sizeof (TestCliqueProxyPrivate)); #endif } static void test_clique_proxy_iface_init (TestCliqueIface *iface) { iface->get_friend = test_clique_proxy_get_friend; } /** * test_clique_proxy_new: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * * Asynchronously creates a proxy for the D-Bus interface com.redhat.Cockpit.DBusTests.Clique. See g_dbus_proxy_new() for more details. * * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_clique_proxy_new_finish() to get the result of the operation. * * See test_clique_proxy_new_sync() for the synchronous, blocking version of this constructor. */ void test_clique_proxy_new ( GDBusConnection *connection, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_async_initable_new_async (TEST_TYPE_CLIQUE_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Clique", NULL); } /** * test_clique_proxy_new_finish: * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_clique_proxy_new(). * @error: Return location for error or %NULL * * Finishes an operation started with test_clique_proxy_new(). * * Returns: (transfer full) (type TestCliqueProxy): The constructed proxy object or %NULL if @error is set. */ TestClique * test_clique_proxy_new_finish ( GAsyncResult *res, GError **error) { GObject *ret; GObject *source_object; source_object = g_async_result_get_source_object (res); ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); g_object_unref (source_object); if (ret != NULL) return TEST_CLIQUE (ret); else return NULL; } /** * test_clique_proxy_new_sync: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Synchronously creates a proxy for the D-Bus interface com.redhat.Cockpit.DBusTests.Clique. See g_dbus_proxy_new_sync() for more details. * * The calling thread is blocked until a reply is received. * * See test_clique_proxy_new() for the asynchronous version of this constructor. * * Returns: (transfer full) (type TestCliqueProxy): The constructed proxy object or %NULL if @error is set. */ TestClique * test_clique_proxy_new_sync ( GDBusConnection *connection, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GError **error) { GInitable *ret; ret = g_initable_new (TEST_TYPE_CLIQUE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Clique", NULL); if (ret != NULL) return TEST_CLIQUE (ret); else return NULL; } /** * test_clique_proxy_new_for_bus: * @bus_type: A #GBusType. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * * Like test_clique_proxy_new() but takes a #GBusType instead of a #GDBusConnection. * * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_clique_proxy_new_for_bus_finish() to get the result of the operation. * * See test_clique_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. */ void test_clique_proxy_new_for_bus ( GBusType bus_type, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_async_initable_new_async (TEST_TYPE_CLIQUE_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Clique", NULL); } /** * test_clique_proxy_new_for_bus_finish: * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_clique_proxy_new_for_bus(). * @error: Return location for error or %NULL * * Finishes an operation started with test_clique_proxy_new_for_bus(). * * Returns: (transfer full) (type TestCliqueProxy): The constructed proxy object or %NULL if @error is set. */ TestClique * test_clique_proxy_new_for_bus_finish ( GAsyncResult *res, GError **error) { GObject *ret; GObject *source_object; source_object = g_async_result_get_source_object (res); ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); g_object_unref (source_object); if (ret != NULL) return TEST_CLIQUE (ret); else return NULL; } /** * test_clique_proxy_new_for_bus_sync: * @bus_type: A #GBusType. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Like test_clique_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. * * The calling thread is blocked until a reply is received. * * See test_clique_proxy_new_for_bus() for the asynchronous version of this constructor. * * Returns: (transfer full) (type TestCliqueProxy): The constructed proxy object or %NULL if @error is set. */ TestClique * test_clique_proxy_new_for_bus_sync ( GBusType bus_type, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GError **error) { GInitable *ret; ret = g_initable_new (TEST_TYPE_CLIQUE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Clique", NULL); if (ret != NULL) return TEST_CLIQUE (ret); else return NULL; } /* ------------------------------------------------------------------------ */ /** * TestCliqueSkeleton: * * The #TestCliqueSkeleton structure contains only private data and should only be accessed using the provided API. */ /** * TestCliqueSkeletonClass: * @parent_class: The parent class. * * Class structure for #TestCliqueSkeleton. */ struct _TestCliqueSkeletonPrivate { GValue *properties; GList *changed_properties; GSource *changed_properties_idle_source; GMainContext *context; GMutex lock; }; static void _test_clique_skeleton_handle_method_call ( GDBusConnection *connection G_GNUC_UNUSED, const gchar *sender G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, const gchar *method_name, GVariant *parameters, GDBusMethodInvocation *invocation, gpointer user_data) { TestCliqueSkeleton *skeleton = TEST_CLIQUE_SKELETON (user_data); _ExtendedGDBusMethodInfo *info; GVariantIter iter; GVariant *child; GValue *paramv; guint num_params; guint num_extra; guint n; guint signal_id; GValue return_value = G_VALUE_INIT; info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); g_assert (info != NULL); num_params = g_variant_n_children (parameters); num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); n = 0; g_value_init (¶mv[n], TEST_TYPE_CLIQUE); g_value_set_object (¶mv[n++], skeleton); g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); g_value_set_object (¶mv[n++], invocation); if (info->pass_fdlist) { #ifdef G_OS_UNIX g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); #else g_assert_not_reached (); #endif } g_variant_iter_init (&iter, parameters); while ((child = g_variant_iter_next_value (&iter)) != NULL) { _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; if (arg_info->use_gvariant) { g_value_init (¶mv[n], G_TYPE_VARIANT); g_value_set_variant (¶mv[n], child); n++; } else g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); g_variant_unref (child); } signal_id = g_signal_lookup (info->signal_name, TEST_TYPE_CLIQUE); g_value_init (&return_value, G_TYPE_BOOLEAN); g_signal_emitv (paramv, signal_id, 0, &return_value); if (!g_value_get_boolean (&return_value)) g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); g_value_unset (&return_value); for (n = 0; n < num_params + num_extra; n++) g_value_unset (¶mv[n]); g_free (paramv); } static GVariant * _test_clique_skeleton_handle_get_property ( GDBusConnection *connection G_GNUC_UNUSED, const gchar *sender G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name G_GNUC_UNUSED, const gchar *property_name, GError **error, gpointer user_data) { TestCliqueSkeleton *skeleton = TEST_CLIQUE_SKELETON (user_data); GValue value = G_VALUE_INIT; GParamSpec *pspec; _ExtendedGDBusPropertyInfo *info; GVariant *ret; ret = NULL; info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_clique_interface_info.parent_struct, property_name); g_assert (info != NULL); pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); if (pspec == NULL) { g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); } else { g_value_init (&value, pspec->value_type); g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); g_value_unset (&value); } return ret; } static gboolean _test_clique_skeleton_handle_set_property ( GDBusConnection *connection G_GNUC_UNUSED, const gchar *sender G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name G_GNUC_UNUSED, const gchar *property_name, GVariant *variant, GError **error, gpointer user_data) { TestCliqueSkeleton *skeleton = TEST_CLIQUE_SKELETON (user_data); GValue value = G_VALUE_INIT; GParamSpec *pspec; _ExtendedGDBusPropertyInfo *info; gboolean ret; ret = FALSE; info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_clique_interface_info.parent_struct, property_name); g_assert (info != NULL); pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); if (pspec == NULL) { g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); } else { if (info->use_gvariant) g_value_set_variant (&value, variant); else g_dbus_gvariant_to_gvalue (variant, &value); g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); g_value_unset (&value); ret = TRUE; } return ret; } static const GDBusInterfaceVTable _test_clique_skeleton_vtable = { _test_clique_skeleton_handle_method_call, _test_clique_skeleton_handle_get_property, _test_clique_skeleton_handle_set_property, {NULL} }; static GDBusInterfaceInfo * test_clique_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) { return test_clique_interface_info (); } static GDBusInterfaceVTable * test_clique_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) { return (GDBusInterfaceVTable *) &_test_clique_skeleton_vtable; } static GVariant * test_clique_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) { TestCliqueSkeleton *skeleton = TEST_CLIQUE_SKELETON (_skeleton); GVariantBuilder builder; guint n; g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); if (_test_clique_interface_info.parent_struct.properties == NULL) goto out; for (n = 0; _test_clique_interface_info.parent_struct.properties[n] != NULL; n++) { GDBusPropertyInfo *info = _test_clique_interface_info.parent_struct.properties[n]; if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) { GVariant *value; value = _test_clique_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.redhat.Cockpit.DBusTests.Clique", info->name, NULL, skeleton); if (value != NULL) { g_variant_take_ref (value); g_variant_builder_add (&builder, "{sv}", info->name, value); g_variant_unref (value); } } } out: return g_variant_builder_end (&builder); } static gboolean _test_clique_emit_changed (gpointer user_data); static void test_clique_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) { TestCliqueSkeleton *skeleton = TEST_CLIQUE_SKELETON (_skeleton); gboolean emit_changed = FALSE; g_mutex_lock (&skeleton->priv->lock); if (skeleton->priv->changed_properties_idle_source != NULL) { g_source_destroy (skeleton->priv->changed_properties_idle_source); skeleton->priv->changed_properties_idle_source = NULL; emit_changed = TRUE; } g_mutex_unlock (&skeleton->priv->lock); if (emit_changed) _test_clique_emit_changed (skeleton); } static void test_clique_skeleton_iface_init (TestCliqueIface *iface); #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (TestCliqueSkeleton, test_clique_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, G_ADD_PRIVATE (TestCliqueSkeleton) G_IMPLEMENT_INTERFACE (TEST_TYPE_CLIQUE, test_clique_skeleton_iface_init)); #else G_DEFINE_TYPE_WITH_CODE (TestCliqueSkeleton, test_clique_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, G_IMPLEMENT_INTERFACE (TEST_TYPE_CLIQUE, test_clique_skeleton_iface_init)); #endif static void test_clique_skeleton_finalize (GObject *object) { TestCliqueSkeleton *skeleton = TEST_CLIQUE_SKELETON (object); guint n; for (n = 0; n < 1; n++) g_value_unset (&skeleton->priv->properties[n]); g_free (skeleton->priv->properties); g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); if (skeleton->priv->changed_properties_idle_source != NULL) g_source_destroy (skeleton->priv->changed_properties_idle_source); g_main_context_unref (skeleton->priv->context); g_mutex_clear (&skeleton->priv->lock); G_OBJECT_CLASS (test_clique_skeleton_parent_class)->finalize (object); } static void test_clique_skeleton_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec G_GNUC_UNUSED) { TestCliqueSkeleton *skeleton = TEST_CLIQUE_SKELETON (object); g_assert (prop_id != 0 && prop_id - 1 < 1); g_mutex_lock (&skeleton->priv->lock); g_value_copy (&skeleton->priv->properties[prop_id - 1], value); g_mutex_unlock (&skeleton->priv->lock); } static gboolean _test_clique_emit_changed (gpointer user_data) { TestCliqueSkeleton *skeleton = TEST_CLIQUE_SKELETON (user_data); GList *l; GVariantBuilder builder; GVariantBuilder invalidated_builder; guint num_changes; g_mutex_lock (&skeleton->priv->lock); g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) { ChangedProperty *cp = l->data; GVariant *variant; const GValue *cur_value; cur_value = &skeleton->priv->properties[cp->prop_id - 1]; if (!_g_value_equal (cur_value, &cp->orig_value)) { variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); g_variant_unref (variant); num_changes++; } } if (num_changes > 0) { GList *connections, *ll; GVariant *signal_variant; signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "com.redhat.Cockpit.DBusTests.Clique", &builder, &invalidated_builder)); connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); for (ll = connections; ll != NULL; ll = ll->next) { GDBusConnection *connection = ll->data; g_dbus_connection_emit_signal (connection, NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.DBus.Properties", "PropertiesChanged", signal_variant, NULL); } g_variant_unref (signal_variant); g_list_free_full (connections, g_object_unref); } else { g_variant_builder_clear (&builder); g_variant_builder_clear (&invalidated_builder); } g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); skeleton->priv->changed_properties = NULL; skeleton->priv->changed_properties_idle_source = NULL; g_mutex_unlock (&skeleton->priv->lock); return FALSE; } static void _test_clique_schedule_emit_changed (TestCliqueSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) { ChangedProperty *cp; GList *l; cp = NULL; for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) { ChangedProperty *i_cp = l->data; if (i_cp->info == info) { cp = i_cp; break; } } if (cp == NULL) { cp = g_new0 (ChangedProperty, 1); cp->prop_id = prop_id; cp->info = info; skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); g_value_copy (orig_value, &cp->orig_value); } } static void test_clique_skeleton_notify (GObject *object, GParamSpec *pspec G_GNUC_UNUSED) { TestCliqueSkeleton *skeleton = TEST_CLIQUE_SKELETON (object); g_mutex_lock (&skeleton->priv->lock); if (skeleton->priv->changed_properties != NULL && skeleton->priv->changed_properties_idle_source == NULL) { skeleton->priv->changed_properties_idle_source = g_idle_source_new (); g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); g_source_set_callback (skeleton->priv->changed_properties_idle_source, _test_clique_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _test_clique_emit_changed"); g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); g_source_unref (skeleton->priv->changed_properties_idle_source); } g_mutex_unlock (&skeleton->priv->lock); } static void test_clique_skeleton_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { TestCliqueSkeleton *skeleton = TEST_CLIQUE_SKELETON (object); g_assert (prop_id != 0 && prop_id - 1 < 1); g_mutex_lock (&skeleton->priv->lock); g_object_freeze_notify (object); if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) { if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL) _test_clique_schedule_emit_changed (skeleton, _test_clique_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]); g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); g_object_notify_by_pspec (object, pspec); } g_mutex_unlock (&skeleton->priv->lock); g_object_thaw_notify (object); } static void test_clique_skeleton_init (TestCliqueSkeleton *skeleton) { #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 skeleton->priv = test_clique_skeleton_get_instance_private (skeleton); #else skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TEST_TYPE_CLIQUE_SKELETON, TestCliqueSkeletonPrivate); #endif g_mutex_init (&skeleton->priv->lock); skeleton->priv->context = g_main_context_ref_thread_default (); skeleton->priv->properties = g_new0 (GValue, 1); g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING); } static const gchar * test_clique_skeleton_get_friend (TestClique *object) { TestCliqueSkeleton *skeleton = TEST_CLIQUE_SKELETON (object); const gchar *value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_string (&(skeleton->priv->properties[0])); g_mutex_unlock (&skeleton->priv->lock); return value; } static void test_clique_skeleton_class_init (TestCliqueSkeletonClass *klass) { GObjectClass *gobject_class; GDBusInterfaceSkeletonClass *skeleton_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = test_clique_skeleton_finalize; gobject_class->get_property = test_clique_skeleton_get_property; gobject_class->set_property = test_clique_skeleton_set_property; gobject_class->notify = test_clique_skeleton_notify; test_clique_override_properties (gobject_class, 1); skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); skeleton_class->get_info = test_clique_skeleton_dbus_interface_get_info; skeleton_class->get_properties = test_clique_skeleton_dbus_interface_get_properties; skeleton_class->flush = test_clique_skeleton_dbus_interface_flush; skeleton_class->get_vtable = test_clique_skeleton_dbus_interface_get_vtable; #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 g_type_class_add_private (klass, sizeof (TestCliqueSkeletonPrivate)); #endif } static void test_clique_skeleton_iface_init (TestCliqueIface *iface) { iface->get_friend = test_clique_skeleton_get_friend; } /** * test_clique_skeleton_new: * * Creates a skeleton object for the D-Bus interface com.redhat.Cockpit.DBusTests.Clique. * * Returns: (transfer full) (type TestCliqueSkeleton): The skeleton object. */ TestClique * test_clique_skeleton_new (void) { return TEST_CLIQUE (g_object_new (TEST_TYPE_CLIQUE_SKELETON, NULL)); } /* ------------------------------------------------------------------------ * Code for interface com.redhat.Cockpit.DBusTests.Hidden * ------------------------------------------------------------------------ */ /** * SECTION:TestHidden * @title: TestHidden * @short_description: Generated C code for the com.redhat.Cockpit.DBusTests.Hidden D-Bus interface * * This section contains code for working with the com.redhat.Cockpit.DBusTests.Hidden D-Bus interface in C. */ /* ---- Introspection data for com.redhat.Cockpit.DBusTests.Hidden ---- */ static const _ExtendedGDBusPropertyInfo _test_hidden_property_info_name = { { -1, (gchar *) "Name", (gchar *) "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL }, "name", FALSE }; static const _ExtendedGDBusPropertyInfo * const _test_hidden_property_info_pointers[] = { &_test_hidden_property_info_name, NULL }; static const _ExtendedGDBusInterfaceInfo _test_hidden_interface_info = { { -1, (gchar *) "com.redhat.Cockpit.DBusTests.Hidden", NULL, NULL, (GDBusPropertyInfo **) &_test_hidden_property_info_pointers, NULL }, "hidden", }; /** * test_hidden_interface_info: * * Gets a machine-readable description of the com.redhat.Cockpit.DBusTests.Hidden D-Bus interface. * * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. */ GDBusInterfaceInfo * test_hidden_interface_info (void) { return (GDBusInterfaceInfo *) &_test_hidden_interface_info.parent_struct; } /** * test_hidden_override_properties: * @klass: The class structure for a #GObject-derived class. * @property_id_begin: The property id to assign to the first overridden property. * * Overrides all #GObject properties in the #TestHidden interface for a concrete class. * The properties are overridden in the order they are defined. * * Returns: The last property id. */ guint test_hidden_override_properties (GObjectClass *klass, guint property_id_begin) { g_object_class_override_property (klass, property_id_begin++, "name"); return property_id_begin - 1; } /** * TestHidden: * * Abstract interface type for the D-Bus interface com.redhat.Cockpit.DBusTests.Hidden. */ /** * TestHiddenIface: * @parent_iface: The parent interface. * @get_name: Getter for the #TestHidden:name property. * * Virtual table for the D-Bus interface com.redhat.Cockpit.DBusTests.Hidden. */ typedef TestHiddenIface TestHiddenInterface; G_DEFINE_INTERFACE (TestHidden, test_hidden, G_TYPE_OBJECT); static void test_hidden_default_init (TestHiddenIface *iface) { /* GObject properties for D-Bus properties: */ /** * TestHidden:name: * * Represents the D-Bus property "Name". * * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. */ g_object_interface_install_property (iface, g_param_spec_string ("name", "Name", "Name", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } /** * test_hidden_get_name: (skip) * @object: A #TestHidden. * * Gets the value of the "Name" D-Bus property. * * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. * * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use test_hidden_dup_name() if on another thread. * * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. */ const gchar * test_hidden_get_name (TestHidden *object) { return TEST_HIDDEN_GET_IFACE (object)->get_name (object); } /** * test_hidden_dup_name: (skip) * @object: A #TestHidden. * * Gets a copy of the "Name" D-Bus property. * * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. * * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). */ gchar * test_hidden_dup_name (TestHidden *object) { gchar *value; g_object_get (G_OBJECT (object), "name", &value, NULL); return value; } /** * test_hidden_set_name: (skip) * @object: A #TestHidden. * @value: The value to set. * * Sets the "Name" D-Bus property to @value. * * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. */ void test_hidden_set_name (TestHidden *object, const gchar *value) { g_object_set (G_OBJECT (object), "name", value, NULL); } /* ------------------------------------------------------------------------ */ /** * TestHiddenProxy: * * The #TestHiddenProxy structure contains only private data and should only be accessed using the provided API. */ /** * TestHiddenProxyClass: * @parent_class: The parent class. * * Class structure for #TestHiddenProxy. */ struct _TestHiddenProxyPrivate { GData *qdata; }; static void test_hidden_proxy_iface_init (TestHiddenIface *iface); #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (TestHiddenProxy, test_hidden_proxy, G_TYPE_DBUS_PROXY, G_ADD_PRIVATE (TestHiddenProxy) G_IMPLEMENT_INTERFACE (TEST_TYPE_HIDDEN, test_hidden_proxy_iface_init)); #else G_DEFINE_TYPE_WITH_CODE (TestHiddenProxy, test_hidden_proxy, G_TYPE_DBUS_PROXY, G_IMPLEMENT_INTERFACE (TEST_TYPE_HIDDEN, test_hidden_proxy_iface_init)); #endif static void test_hidden_proxy_finalize (GObject *object) { TestHiddenProxy *proxy = TEST_HIDDEN_PROXY (object); g_datalist_clear (&proxy->priv->qdata); G_OBJECT_CLASS (test_hidden_proxy_parent_class)->finalize (object); } static void test_hidden_proxy_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec G_GNUC_UNUSED) { const _ExtendedGDBusPropertyInfo *info; GVariant *variant; g_assert (prop_id != 0 && prop_id - 1 < 1); info = _test_hidden_property_info_pointers[prop_id - 1]; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); if (info->use_gvariant) { g_value_set_variant (value, variant); } else { if (variant != NULL) g_dbus_gvariant_to_gvalue (variant, value); } if (variant != NULL) g_variant_unref (variant); } static void test_hidden_proxy_set_property_cb (GDBusProxy *proxy, GAsyncResult *res, gpointer user_data) { const _ExtendedGDBusPropertyInfo *info = user_data; GError *error; GVariant *_ret; error = NULL; _ret = g_dbus_proxy_call_finish (proxy, res, &error); if (!_ret) { g_warning ("Error setting property '%s' on interface com.redhat.Cockpit.DBusTests.Hidden: %s (%s, %d)", info->parent_struct.name, error->message, g_quark_to_string (error->domain), error->code); g_error_free (error); } else { g_variant_unref (_ret); } } static void test_hidden_proxy_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec G_GNUC_UNUSED) { const _ExtendedGDBusPropertyInfo *info; GVariant *variant; g_assert (prop_id != 0 && prop_id - 1 < 1); info = _test_hidden_property_info_pointers[prop_id - 1]; variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); g_dbus_proxy_call (G_DBUS_PROXY (object), "org.freedesktop.DBus.Properties.Set", g_variant_new ("(ssv)", "com.redhat.Cockpit.DBusTests.Hidden", info->parent_struct.name, variant), G_DBUS_CALL_FLAGS_NONE, -1, NULL, (GAsyncReadyCallback) test_hidden_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); g_variant_unref (variant); } static void test_hidden_proxy_g_signal (GDBusProxy *proxy, const gchar *sender_name G_GNUC_UNUSED, const gchar *signal_name, GVariant *parameters) { _ExtendedGDBusSignalInfo *info; GVariantIter iter; GVariant *child; GValue *paramv; guint num_params; guint n; guint signal_id; info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_test_hidden_interface_info.parent_struct, signal_name); if (info == NULL) return; num_params = g_variant_n_children (parameters); paramv = g_new0 (GValue, num_params + 1); g_value_init (¶mv[0], TEST_TYPE_HIDDEN); g_value_set_object (¶mv[0], proxy); g_variant_iter_init (&iter, parameters); n = 1; while ((child = g_variant_iter_next_value (&iter)) != NULL) { _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; if (arg_info->use_gvariant) { g_value_init (¶mv[n], G_TYPE_VARIANT); g_value_set_variant (¶mv[n], child); n++; } else g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); g_variant_unref (child); } signal_id = g_signal_lookup (info->signal_name, TEST_TYPE_HIDDEN); g_signal_emitv (paramv, signal_id, 0, NULL); for (n = 0; n < num_params + 1; n++) g_value_unset (¶mv[n]); g_free (paramv); } static void test_hidden_proxy_g_properties_changed (GDBusProxy *_proxy, GVariant *changed_properties, const gchar *const *invalidated_properties) { TestHiddenProxy *proxy = TEST_HIDDEN_PROXY (_proxy); guint n; const gchar *key; GVariantIter *iter; _ExtendedGDBusPropertyInfo *info; g_variant_get (changed_properties, "a{sv}", &iter); while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) { info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_hidden_interface_info.parent_struct, key); g_datalist_remove_data (&proxy->priv->qdata, key); if (info != NULL) g_object_notify (G_OBJECT (proxy), info->hyphen_name); } g_variant_iter_free (iter); for (n = 0; invalidated_properties[n] != NULL; n++) { info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_hidden_interface_info.parent_struct, invalidated_properties[n]); g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); if (info != NULL) g_object_notify (G_OBJECT (proxy), info->hyphen_name); } } static const gchar * test_hidden_proxy_get_name (TestHidden *object) { TestHiddenProxy *proxy = TEST_HIDDEN_PROXY (object); GVariant *variant; const gchar *value = NULL; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Name"); if (variant != NULL) { value = g_variant_get_string (variant, NULL); g_variant_unref (variant); } return value; } static void test_hidden_proxy_init (TestHiddenProxy *proxy) { #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 proxy->priv = test_hidden_proxy_get_instance_private (proxy); #else proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TEST_TYPE_HIDDEN_PROXY, TestHiddenProxyPrivate); #endif g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), test_hidden_interface_info ()); } static void test_hidden_proxy_class_init (TestHiddenProxyClass *klass) { GObjectClass *gobject_class; GDBusProxyClass *proxy_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = test_hidden_proxy_finalize; gobject_class->get_property = test_hidden_proxy_get_property; gobject_class->set_property = test_hidden_proxy_set_property; proxy_class = G_DBUS_PROXY_CLASS (klass); proxy_class->g_signal = test_hidden_proxy_g_signal; proxy_class->g_properties_changed = test_hidden_proxy_g_properties_changed; test_hidden_override_properties (gobject_class, 1); #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 g_type_class_add_private (klass, sizeof (TestHiddenProxyPrivate)); #endif } static void test_hidden_proxy_iface_init (TestHiddenIface *iface) { iface->get_name = test_hidden_proxy_get_name; } /** * test_hidden_proxy_new: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * * Asynchronously creates a proxy for the D-Bus interface com.redhat.Cockpit.DBusTests.Hidden. See g_dbus_proxy_new() for more details. * * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_hidden_proxy_new_finish() to get the result of the operation. * * See test_hidden_proxy_new_sync() for the synchronous, blocking version of this constructor. */ void test_hidden_proxy_new ( GDBusConnection *connection, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_async_initable_new_async (TEST_TYPE_HIDDEN_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Hidden", NULL); } /** * test_hidden_proxy_new_finish: * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_hidden_proxy_new(). * @error: Return location for error or %NULL * * Finishes an operation started with test_hidden_proxy_new(). * * Returns: (transfer full) (type TestHiddenProxy): The constructed proxy object or %NULL if @error is set. */ TestHidden * test_hidden_proxy_new_finish ( GAsyncResult *res, GError **error) { GObject *ret; GObject *source_object; source_object = g_async_result_get_source_object (res); ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); g_object_unref (source_object); if (ret != NULL) return TEST_HIDDEN (ret); else return NULL; } /** * test_hidden_proxy_new_sync: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Synchronously creates a proxy for the D-Bus interface com.redhat.Cockpit.DBusTests.Hidden. See g_dbus_proxy_new_sync() for more details. * * The calling thread is blocked until a reply is received. * * See test_hidden_proxy_new() for the asynchronous version of this constructor. * * Returns: (transfer full) (type TestHiddenProxy): The constructed proxy object or %NULL if @error is set. */ TestHidden * test_hidden_proxy_new_sync ( GDBusConnection *connection, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GError **error) { GInitable *ret; ret = g_initable_new (TEST_TYPE_HIDDEN_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Hidden", NULL); if (ret != NULL) return TEST_HIDDEN (ret); else return NULL; } /** * test_hidden_proxy_new_for_bus: * @bus_type: A #GBusType. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * * Like test_hidden_proxy_new() but takes a #GBusType instead of a #GDBusConnection. * * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_hidden_proxy_new_for_bus_finish() to get the result of the operation. * * See test_hidden_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. */ void test_hidden_proxy_new_for_bus ( GBusType bus_type, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_async_initable_new_async (TEST_TYPE_HIDDEN_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Hidden", NULL); } /** * test_hidden_proxy_new_for_bus_finish: * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_hidden_proxy_new_for_bus(). * @error: Return location for error or %NULL * * Finishes an operation started with test_hidden_proxy_new_for_bus(). * * Returns: (transfer full) (type TestHiddenProxy): The constructed proxy object or %NULL if @error is set. */ TestHidden * test_hidden_proxy_new_for_bus_finish ( GAsyncResult *res, GError **error) { GObject *ret; GObject *source_object; source_object = g_async_result_get_source_object (res); ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); g_object_unref (source_object); if (ret != NULL) return TEST_HIDDEN (ret); else return NULL; } /** * test_hidden_proxy_new_for_bus_sync: * @bus_type: A #GBusType. * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Like test_hidden_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. * * The calling thread is blocked until a reply is received. * * See test_hidden_proxy_new_for_bus() for the asynchronous version of this constructor. * * Returns: (transfer full) (type TestHiddenProxy): The constructed proxy object or %NULL if @error is set. */ TestHidden * test_hidden_proxy_new_for_bus_sync ( GBusType bus_type, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GError **error) { GInitable *ret; ret = g_initable_new (TEST_TYPE_HIDDEN_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.redhat.Cockpit.DBusTests.Hidden", NULL); if (ret != NULL) return TEST_HIDDEN (ret); else return NULL; } /* ------------------------------------------------------------------------ */ /** * TestHiddenSkeleton: * * The #TestHiddenSkeleton structure contains only private data and should only be accessed using the provided API. */ /** * TestHiddenSkeletonClass: * @parent_class: The parent class. * * Class structure for #TestHiddenSkeleton. */ struct _TestHiddenSkeletonPrivate { GValue *properties; GList *changed_properties; GSource *changed_properties_idle_source; GMainContext *context; GMutex lock; }; static void _test_hidden_skeleton_handle_method_call ( GDBusConnection *connection G_GNUC_UNUSED, const gchar *sender G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, const gchar *method_name, GVariant *parameters, GDBusMethodInvocation *invocation, gpointer user_data) { TestHiddenSkeleton *skeleton = TEST_HIDDEN_SKELETON (user_data); _ExtendedGDBusMethodInfo *info; GVariantIter iter; GVariant *child; GValue *paramv; guint num_params; guint num_extra; guint n; guint signal_id; GValue return_value = G_VALUE_INIT; info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); g_assert (info != NULL); num_params = g_variant_n_children (parameters); num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); n = 0; g_value_init (¶mv[n], TEST_TYPE_HIDDEN); g_value_set_object (¶mv[n++], skeleton); g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); g_value_set_object (¶mv[n++], invocation); if (info->pass_fdlist) { #ifdef G_OS_UNIX g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); #else g_assert_not_reached (); #endif } g_variant_iter_init (&iter, parameters); while ((child = g_variant_iter_next_value (&iter)) != NULL) { _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; if (arg_info->use_gvariant) { g_value_init (¶mv[n], G_TYPE_VARIANT); g_value_set_variant (¶mv[n], child); n++; } else g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); g_variant_unref (child); } signal_id = g_signal_lookup (info->signal_name, TEST_TYPE_HIDDEN); g_value_init (&return_value, G_TYPE_BOOLEAN); g_signal_emitv (paramv, signal_id, 0, &return_value); if (!g_value_get_boolean (&return_value)) g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); g_value_unset (&return_value); for (n = 0; n < num_params + num_extra; n++) g_value_unset (¶mv[n]); g_free (paramv); } static GVariant * _test_hidden_skeleton_handle_get_property ( GDBusConnection *connection G_GNUC_UNUSED, const gchar *sender G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name G_GNUC_UNUSED, const gchar *property_name, GError **error, gpointer user_data) { TestHiddenSkeleton *skeleton = TEST_HIDDEN_SKELETON (user_data); GValue value = G_VALUE_INIT; GParamSpec *pspec; _ExtendedGDBusPropertyInfo *info; GVariant *ret; ret = NULL; info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_hidden_interface_info.parent_struct, property_name); g_assert (info != NULL); pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); if (pspec == NULL) { g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); } else { g_value_init (&value, pspec->value_type); g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); g_value_unset (&value); } return ret; } static gboolean _test_hidden_skeleton_handle_set_property ( GDBusConnection *connection G_GNUC_UNUSED, const gchar *sender G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name G_GNUC_UNUSED, const gchar *property_name, GVariant *variant, GError **error, gpointer user_data) { TestHiddenSkeleton *skeleton = TEST_HIDDEN_SKELETON (user_data); GValue value = G_VALUE_INIT; GParamSpec *pspec; _ExtendedGDBusPropertyInfo *info; gboolean ret; ret = FALSE; info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_test_hidden_interface_info.parent_struct, property_name); g_assert (info != NULL); pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); if (pspec == NULL) { g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); } else { if (info->use_gvariant) g_value_set_variant (&value, variant); else g_dbus_gvariant_to_gvalue (variant, &value); g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); g_value_unset (&value); ret = TRUE; } return ret; } static const GDBusInterfaceVTable _test_hidden_skeleton_vtable = { _test_hidden_skeleton_handle_method_call, _test_hidden_skeleton_handle_get_property, _test_hidden_skeleton_handle_set_property, {NULL} }; static GDBusInterfaceInfo * test_hidden_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) { return test_hidden_interface_info (); } static GDBusInterfaceVTable * test_hidden_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) { return (GDBusInterfaceVTable *) &_test_hidden_skeleton_vtable; } static GVariant * test_hidden_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) { TestHiddenSkeleton *skeleton = TEST_HIDDEN_SKELETON (_skeleton); GVariantBuilder builder; guint n; g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); if (_test_hidden_interface_info.parent_struct.properties == NULL) goto out; for (n = 0; _test_hidden_interface_info.parent_struct.properties[n] != NULL; n++) { GDBusPropertyInfo *info = _test_hidden_interface_info.parent_struct.properties[n]; if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) { GVariant *value; value = _test_hidden_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.redhat.Cockpit.DBusTests.Hidden", info->name, NULL, skeleton); if (value != NULL) { g_variant_take_ref (value); g_variant_builder_add (&builder, "{sv}", info->name, value); g_variant_unref (value); } } } out: return g_variant_builder_end (&builder); } static gboolean _test_hidden_emit_changed (gpointer user_data); static void test_hidden_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) { TestHiddenSkeleton *skeleton = TEST_HIDDEN_SKELETON (_skeleton); gboolean emit_changed = FALSE; g_mutex_lock (&skeleton->priv->lock); if (skeleton->priv->changed_properties_idle_source != NULL) { g_source_destroy (skeleton->priv->changed_properties_idle_source); skeleton->priv->changed_properties_idle_source = NULL; emit_changed = TRUE; } g_mutex_unlock (&skeleton->priv->lock); if (emit_changed) _test_hidden_emit_changed (skeleton); } static void test_hidden_skeleton_iface_init (TestHiddenIface *iface); #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (TestHiddenSkeleton, test_hidden_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, G_ADD_PRIVATE (TestHiddenSkeleton) G_IMPLEMENT_INTERFACE (TEST_TYPE_HIDDEN, test_hidden_skeleton_iface_init)); #else G_DEFINE_TYPE_WITH_CODE (TestHiddenSkeleton, test_hidden_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, G_IMPLEMENT_INTERFACE (TEST_TYPE_HIDDEN, test_hidden_skeleton_iface_init)); #endif static void test_hidden_skeleton_finalize (GObject *object) { TestHiddenSkeleton *skeleton = TEST_HIDDEN_SKELETON (object); guint n; for (n = 0; n < 1; n++) g_value_unset (&skeleton->priv->properties[n]); g_free (skeleton->priv->properties); g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); if (skeleton->priv->changed_properties_idle_source != NULL) g_source_destroy (skeleton->priv->changed_properties_idle_source); g_main_context_unref (skeleton->priv->context); g_mutex_clear (&skeleton->priv->lock); G_OBJECT_CLASS (test_hidden_skeleton_parent_class)->finalize (object); } static void test_hidden_skeleton_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec G_GNUC_UNUSED) { TestHiddenSkeleton *skeleton = TEST_HIDDEN_SKELETON (object); g_assert (prop_id != 0 && prop_id - 1 < 1); g_mutex_lock (&skeleton->priv->lock); g_value_copy (&skeleton->priv->properties[prop_id - 1], value); g_mutex_unlock (&skeleton->priv->lock); } static gboolean _test_hidden_emit_changed (gpointer user_data) { TestHiddenSkeleton *skeleton = TEST_HIDDEN_SKELETON (user_data); GList *l; GVariantBuilder builder; GVariantBuilder invalidated_builder; guint num_changes; g_mutex_lock (&skeleton->priv->lock); g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) { ChangedProperty *cp = l->data; GVariant *variant; const GValue *cur_value; cur_value = &skeleton->priv->properties[cp->prop_id - 1]; if (!_g_value_equal (cur_value, &cp->orig_value)) { variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); g_variant_unref (variant); num_changes++; } } if (num_changes > 0) { GList *connections, *ll; GVariant *signal_variant; signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "com.redhat.Cockpit.DBusTests.Hidden", &builder, &invalidated_builder)); connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); for (ll = connections; ll != NULL; ll = ll->next) { GDBusConnection *connection = ll->data; g_dbus_connection_emit_signal (connection, NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.DBus.Properties", "PropertiesChanged", signal_variant, NULL); } g_variant_unref (signal_variant); g_list_free_full (connections, g_object_unref); } else { g_variant_builder_clear (&builder); g_variant_builder_clear (&invalidated_builder); } g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); skeleton->priv->changed_properties = NULL; skeleton->priv->changed_properties_idle_source = NULL; g_mutex_unlock (&skeleton->priv->lock); return FALSE; } static void _test_hidden_schedule_emit_changed (TestHiddenSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) { ChangedProperty *cp; GList *l; cp = NULL; for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) { ChangedProperty *i_cp = l->data; if (i_cp->info == info) { cp = i_cp; break; } } if (cp == NULL) { cp = g_new0 (ChangedProperty, 1); cp->prop_id = prop_id; cp->info = info; skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); g_value_copy (orig_value, &cp->orig_value); } } static void test_hidden_skeleton_notify (GObject *object, GParamSpec *pspec G_GNUC_UNUSED) { TestHiddenSkeleton *skeleton = TEST_HIDDEN_SKELETON (object); g_mutex_lock (&skeleton->priv->lock); if (skeleton->priv->changed_properties != NULL && skeleton->priv->changed_properties_idle_source == NULL) { skeleton->priv->changed_properties_idle_source = g_idle_source_new (); g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); g_source_set_callback (skeleton->priv->changed_properties_idle_source, _test_hidden_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _test_hidden_emit_changed"); g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); g_source_unref (skeleton->priv->changed_properties_idle_source); } g_mutex_unlock (&skeleton->priv->lock); } static void test_hidden_skeleton_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { TestHiddenSkeleton *skeleton = TEST_HIDDEN_SKELETON (object); g_assert (prop_id != 0 && prop_id - 1 < 1); g_mutex_lock (&skeleton->priv->lock); g_object_freeze_notify (object); if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) { if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL) _test_hidden_schedule_emit_changed (skeleton, _test_hidden_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]); g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); g_object_notify_by_pspec (object, pspec); } g_mutex_unlock (&skeleton->priv->lock); g_object_thaw_notify (object); } static void test_hidden_skeleton_init (TestHiddenSkeleton *skeleton) { #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 skeleton->priv = test_hidden_skeleton_get_instance_private (skeleton); #else skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TEST_TYPE_HIDDEN_SKELETON, TestHiddenSkeletonPrivate); #endif g_mutex_init (&skeleton->priv->lock); skeleton->priv->context = g_main_context_ref_thread_default (); skeleton->priv->properties = g_new0 (GValue, 1); g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING); } static const gchar * test_hidden_skeleton_get_name (TestHidden *object) { TestHiddenSkeleton *skeleton = TEST_HIDDEN_SKELETON (object); const gchar *value; g_mutex_lock (&skeleton->priv->lock); value = g_value_get_string (&(skeleton->priv->properties[0])); g_mutex_unlock (&skeleton->priv->lock); return value; } static void test_hidden_skeleton_class_init (TestHiddenSkeletonClass *klass) { GObjectClass *gobject_class; GDBusInterfaceSkeletonClass *skeleton_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = test_hidden_skeleton_finalize; gobject_class->get_property = test_hidden_skeleton_get_property; gobject_class->set_property = test_hidden_skeleton_set_property; gobject_class->notify = test_hidden_skeleton_notify; test_hidden_override_properties (gobject_class, 1); skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); skeleton_class->get_info = test_hidden_skeleton_dbus_interface_get_info; skeleton_class->get_properties = test_hidden_skeleton_dbus_interface_get_properties; skeleton_class->flush = test_hidden_skeleton_dbus_interface_flush; skeleton_class->get_vtable = test_hidden_skeleton_dbus_interface_get_vtable; #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 g_type_class_add_private (klass, sizeof (TestHiddenSkeletonPrivate)); #endif } static void test_hidden_skeleton_iface_init (TestHiddenIface *iface) { iface->get_name = test_hidden_skeleton_get_name; } /** * test_hidden_skeleton_new: * * Creates a skeleton object for the D-Bus interface com.redhat.Cockpit.DBusTests.Hidden. * * Returns: (transfer full) (type TestHiddenSkeleton): The skeleton object. */ TestHidden * test_hidden_skeleton_new (void) { return TEST_HIDDEN (g_object_new (TEST_TYPE_HIDDEN_SKELETON, NULL)); } /* ------------------------------------------------------------------------ * Code for Object, ObjectProxy and ObjectSkeleton * ------------------------------------------------------------------------ */ /** * SECTION:TestObject * @title: TestObject * @short_description: Specialized GDBusObject types * * This section contains the #TestObject, #TestObjectProxy, and #TestObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces. */ /** * TestObject: * * The #TestObject type is a specialized container of interfaces. */ /** * TestObjectIface: * @parent_iface: The parent interface. * * Virtual table for the #TestObject interface. */ typedef TestObjectIface TestObjectInterface; G_DEFINE_INTERFACE_WITH_CODE (TestObject, test_object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT)); static void test_object_default_init (TestObjectIface *iface) { /** * TestObject:alpha: * * The #TestAlpha instance corresponding to the D-Bus interface com.redhat.Cockpit.DBusTests.Alpha, if any. * * Connect to the #GObject::notify signal to get informed of property changes. */ g_object_interface_install_property (iface, g_param_spec_object ("alpha", "alpha", "alpha", TEST_TYPE_ALPHA, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS)); /** * TestObject:frobber: * * The #TestFrobber instance corresponding to the D-Bus interface com.redhat.Cockpit.DBusTests.Frobber, if any. * * Connect to the #GObject::notify signal to get informed of property changes. */ g_object_interface_install_property (iface, g_param_spec_object ("frobber", "frobber", "frobber", TEST_TYPE_FROBBER, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS)); /** * TestObject:clique: * * The #TestClique instance corresponding to the D-Bus interface com.redhat.Cockpit.DBusTests.Clique, if any. * * Connect to the #GObject::notify signal to get informed of property changes. */ g_object_interface_install_property (iface, g_param_spec_object ("clique", "clique", "clique", TEST_TYPE_CLIQUE, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS)); /** * TestObject:hidden: * * The #TestHidden instance corresponding to the D-Bus interface com.redhat.Cockpit.DBusTests.Hidden, if any. * * Connect to the #GObject::notify signal to get informed of property changes. */ g_object_interface_install_property (iface, g_param_spec_object ("hidden", "hidden", "hidden", TEST_TYPE_HIDDEN, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS)); } /** * test_object_get_alpha: * @object: A #TestObject. * * Gets the #TestAlpha instance for the D-Bus interface com.redhat.Cockpit.DBusTests.Alpha on @object, if any. * * Returns: (transfer full): A #TestAlpha that must be freed with g_object_unref() or %NULL if @object does not implement the interface. */ TestAlpha *test_object_get_alpha (TestObject *object) { GDBusInterface *ret; ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Alpha"); if (ret == NULL) return NULL; return TEST_ALPHA (ret); } /** * test_object_get_frobber: * @object: A #TestObject. * * Gets the #TestFrobber instance for the D-Bus interface com.redhat.Cockpit.DBusTests.Frobber on @object, if any. * * Returns: (transfer full): A #TestFrobber that must be freed with g_object_unref() or %NULL if @object does not implement the interface. */ TestFrobber *test_object_get_frobber (TestObject *object) { GDBusInterface *ret; ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Frobber"); if (ret == NULL) return NULL; return TEST_FROBBER (ret); } /** * test_object_get_clique: * @object: A #TestObject. * * Gets the #TestClique instance for the D-Bus interface com.redhat.Cockpit.DBusTests.Clique on @object, if any. * * Returns: (transfer full): A #TestClique that must be freed with g_object_unref() or %NULL if @object does not implement the interface. */ TestClique *test_object_get_clique (TestObject *object) { GDBusInterface *ret; ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Clique"); if (ret == NULL) return NULL; return TEST_CLIQUE (ret); } /** * test_object_get_hidden: * @object: A #TestObject. * * Gets the #TestHidden instance for the D-Bus interface com.redhat.Cockpit.DBusTests.Hidden on @object, if any. * * Returns: (transfer full): A #TestHidden that must be freed with g_object_unref() or %NULL if @object does not implement the interface. */ TestHidden *test_object_get_hidden (TestObject *object) { GDBusInterface *ret; ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Hidden"); if (ret == NULL) return NULL; return TEST_HIDDEN (ret); } /** * test_object_peek_alpha: (skip) * @object: A #TestObject. * * Like test_object_get_alpha() but doesn't increase the reference count on the returned object. * * It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running. * * Returns: (transfer none): A #TestAlpha or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. */ TestAlpha *test_object_peek_alpha (TestObject *object) { GDBusInterface *ret; ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Alpha"); if (ret == NULL) return NULL; g_object_unref (ret); return TEST_ALPHA (ret); } /** * test_object_peek_frobber: (skip) * @object: A #TestObject. * * Like test_object_get_frobber() but doesn't increase the reference count on the returned object. * * It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running. * * Returns: (transfer none): A #TestFrobber or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. */ TestFrobber *test_object_peek_frobber (TestObject *object) { GDBusInterface *ret; ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Frobber"); if (ret == NULL) return NULL; g_object_unref (ret); return TEST_FROBBER (ret); } /** * test_object_peek_clique: (skip) * @object: A #TestObject. * * Like test_object_get_clique() but doesn't increase the reference count on the returned object. * * It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running. * * Returns: (transfer none): A #TestClique or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. */ TestClique *test_object_peek_clique (TestObject *object) { GDBusInterface *ret; ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Clique"); if (ret == NULL) return NULL; g_object_unref (ret); return TEST_CLIQUE (ret); } /** * test_object_peek_hidden: (skip) * @object: A #TestObject. * * Like test_object_get_hidden() but doesn't increase the reference count on the returned object. * * It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running. * * Returns: (transfer none): A #TestHidden or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. */ TestHidden *test_object_peek_hidden (TestObject *object) { GDBusInterface *ret; ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Hidden"); if (ret == NULL) return NULL; g_object_unref (ret); return TEST_HIDDEN (ret); } static void test_object_notify (GDBusObject *object, GDBusInterface *interface) { _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface); /* info can be NULL if the other end is using a D-Bus interface we don't know * anything about, for example old generated code in this process talking to * newer generated code in the other process. */ if (info != NULL) g_object_notify (G_OBJECT (object), info->hyphen_name); } /** * TestObjectProxy: * * The #TestObjectProxy structure contains only private data and should only be accessed using the provided API. */ /** * TestObjectProxyClass: * @parent_class: The parent class. * * Class structure for #TestObjectProxy. */ static void test_object_proxy__test_object_iface_init (TestObjectIface *iface G_GNUC_UNUSED) { } static void test_object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface) { iface->interface_added = test_object_notify; iface->interface_removed = test_object_notify; } G_DEFINE_TYPE_WITH_CODE (TestObjectProxy, test_object_proxy, G_TYPE_DBUS_OBJECT_PROXY, G_IMPLEMENT_INTERFACE (TEST_TYPE_OBJECT, test_object_proxy__test_object_iface_init) G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, test_object_proxy__g_dbus_object_iface_init)); static void test_object_proxy_init (TestObjectProxy *object G_GNUC_UNUSED) { } static void test_object_proxy_set_property (GObject *gobject, guint prop_id, const GValue *value G_GNUC_UNUSED, GParamSpec *pspec) { G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); } static void test_object_proxy_get_property (GObject *gobject, guint prop_id, GValue *value, GParamSpec *pspec) { TestObjectProxy *object = TEST_OBJECT_PROXY (gobject); GDBusInterface *interface; switch (prop_id) { case 1: interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Alpha"); g_value_take_object (value, interface); break; case 2: interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Frobber"); g_value_take_object (value, interface); break; case 3: interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Clique"); g_value_take_object (value, interface); break; case 4: interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Hidden"); g_value_take_object (value, interface); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); break; } } static void test_object_proxy_class_init (TestObjectProxyClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->set_property = test_object_proxy_set_property; gobject_class->get_property = test_object_proxy_get_property; g_object_class_override_property (gobject_class, 1, "alpha"); g_object_class_override_property (gobject_class, 2, "frobber"); g_object_class_override_property (gobject_class, 3, "clique"); g_object_class_override_property (gobject_class, 4, "hidden"); } /** * test_object_proxy_new: * @connection: A #GDBusConnection. * @object_path: An object path. * * Creates a new proxy object. * * Returns: (transfer full): The proxy object. */ TestObjectProxy * test_object_proxy_new (GDBusConnection *connection, const gchar *object_path) { g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); return TEST_OBJECT_PROXY (g_object_new (TEST_TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL)); } /** * TestObjectSkeleton: * * The #TestObjectSkeleton structure contains only private data and should only be accessed using the provided API. */ /** * TestObjectSkeletonClass: * @parent_class: The parent class. * * Class structure for #TestObjectSkeleton. */ static void test_object_skeleton__test_object_iface_init (TestObjectIface *iface G_GNUC_UNUSED) { } static void test_object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface) { iface->interface_added = test_object_notify; iface->interface_removed = test_object_notify; } G_DEFINE_TYPE_WITH_CODE (TestObjectSkeleton, test_object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON, G_IMPLEMENT_INTERFACE (TEST_TYPE_OBJECT, test_object_skeleton__test_object_iface_init) G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, test_object_skeleton__g_dbus_object_iface_init)); static void test_object_skeleton_init (TestObjectSkeleton *object G_GNUC_UNUSED) { } static void test_object_skeleton_set_property (GObject *gobject, guint prop_id, const GValue *value, GParamSpec *pspec) { TestObjectSkeleton *object = TEST_OBJECT_SKELETON (gobject); GDBusInterfaceSkeleton *interface; switch (prop_id) { case 1: interface = g_value_get_object (value); if (interface != NULL) { g_warn_if_fail (TEST_IS_ALPHA (interface)); g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface); } else { g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "com.redhat.Cockpit.DBusTests.Alpha"); } break; case 2: interface = g_value_get_object (value); if (interface != NULL) { g_warn_if_fail (TEST_IS_FROBBER (interface)); g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface); } else { g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "com.redhat.Cockpit.DBusTests.Frobber"); } break; case 3: interface = g_value_get_object (value); if (interface != NULL) { g_warn_if_fail (TEST_IS_CLIQUE (interface)); g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface); } else { g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "com.redhat.Cockpit.DBusTests.Clique"); } break; case 4: interface = g_value_get_object (value); if (interface != NULL) { g_warn_if_fail (TEST_IS_HIDDEN (interface)); g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface); } else { g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "com.redhat.Cockpit.DBusTests.Hidden"); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); break; } } static void test_object_skeleton_get_property (GObject *gobject, guint prop_id, GValue *value, GParamSpec *pspec) { TestObjectSkeleton *object = TEST_OBJECT_SKELETON (gobject); GDBusInterface *interface; switch (prop_id) { case 1: interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Alpha"); g_value_take_object (value, interface); break; case 2: interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Frobber"); g_value_take_object (value, interface); break; case 3: interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Clique"); g_value_take_object (value, interface); break; case 4: interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "com.redhat.Cockpit.DBusTests.Hidden"); g_value_take_object (value, interface); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); break; } } static void test_object_skeleton_class_init (TestObjectSkeletonClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->set_property = test_object_skeleton_set_property; gobject_class->get_property = test_object_skeleton_get_property; g_object_class_override_property (gobject_class, 1, "alpha"); g_object_class_override_property (gobject_class, 2, "frobber"); g_object_class_override_property (gobject_class, 3, "clique"); g_object_class_override_property (gobject_class, 4, "hidden"); } /** * test_object_skeleton_new: * @object_path: An object path. * * Creates a new skeleton object. * * Returns: (transfer full): The skeleton object. */ TestObjectSkeleton * test_object_skeleton_new (const gchar *object_path) { g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); return TEST_OBJECT_SKELETON (g_object_new (TEST_TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL)); } /** * test_object_skeleton_set_alpha: * @object: A #TestObjectSkeleton. * @interface_: (allow-none): A #TestAlpha or %NULL to clear the interface. * * Sets the #TestAlpha instance for the D-Bus interface com.redhat.Cockpit.DBusTests.Alpha on @object. */ void test_object_skeleton_set_alpha (TestObjectSkeleton *object, TestAlpha *interface_) { g_object_set (G_OBJECT (object), "alpha", interface_, NULL); } /** * test_object_skeleton_set_frobber: * @object: A #TestObjectSkeleton. * @interface_: (allow-none): A #TestFrobber or %NULL to clear the interface. * * Sets the #TestFrobber instance for the D-Bus interface com.redhat.Cockpit.DBusTests.Frobber on @object. */ void test_object_skeleton_set_frobber (TestObjectSkeleton *object, TestFrobber *interface_) { g_object_set (G_OBJECT (object), "frobber", interface_, NULL); } /** * test_object_skeleton_set_clique: * @object: A #TestObjectSkeleton. * @interface_: (allow-none): A #TestClique or %NULL to clear the interface. * * Sets the #TestClique instance for the D-Bus interface com.redhat.Cockpit.DBusTests.Clique on @object. */ void test_object_skeleton_set_clique (TestObjectSkeleton *object, TestClique *interface_) { g_object_set (G_OBJECT (object), "clique", interface_, NULL); } /** * test_object_skeleton_set_hidden: * @object: A #TestObjectSkeleton. * @interface_: (allow-none): A #TestHidden or %NULL to clear the interface. * * Sets the #TestHidden instance for the D-Bus interface com.redhat.Cockpit.DBusTests.Hidden on @object. */ void test_object_skeleton_set_hidden (TestObjectSkeleton *object, TestHidden *interface_) { g_object_set (G_OBJECT (object), "hidden", interface_, NULL); } /* ------------------------------------------------------------------------ * Code for ObjectManager client * ------------------------------------------------------------------------ */ /** * SECTION:TestObjectManagerClient * @title: TestObjectManagerClient * @short_description: Generated GDBusObjectManagerClient type * * This section contains a #GDBusObjectManagerClient that uses test_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. */ /** * TestObjectManagerClient: * * The #TestObjectManagerClient structure contains only private data and should only be accessed using the provided API. */ /** * TestObjectManagerClientClass: * @parent_class: The parent class. * * Class structure for #TestObjectManagerClient. */ G_DEFINE_TYPE (TestObjectManagerClient, test_object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT); static void test_object_manager_client_init (TestObjectManagerClient *manager G_GNUC_UNUSED) { } static void test_object_manager_client_class_init (TestObjectManagerClientClass *klass G_GNUC_UNUSED) { } /** * test_object_manager_client_get_proxy_type: * @manager: A #GDBusObjectManagerClient. * @object_path: The object path of the remote object (unused). * @interface_name: (allow-none): Interface name of the remote object or %NULL to get the object proxy #GType. * @user_data: User data (unused). * * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy- and #GDBusProxy-derived types. * * Returns: A #GDBusProxy-derived #GType if @interface_name is not %NULL, otherwise the #GType for #TestObjectProxy. */ GType test_object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED) { static gsize once_init_value = 0; static GHashTable *lookup_hash; GType ret; if (interface_name == NULL) return TEST_TYPE_OBJECT_PROXY; if (g_once_init_enter (&once_init_value)) { lookup_hash = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (lookup_hash, (gpointer) "com.redhat.Cockpit.DBusTests.Alpha", GSIZE_TO_POINTER (TEST_TYPE_ALPHA_PROXY)); g_hash_table_insert (lookup_hash, (gpointer) "com.redhat.Cockpit.DBusTests.Frobber", GSIZE_TO_POINTER (TEST_TYPE_FROBBER_PROXY)); g_hash_table_insert (lookup_hash, (gpointer) "com.redhat.Cockpit.DBusTests.Clique", GSIZE_TO_POINTER (TEST_TYPE_CLIQUE_PROXY)); g_hash_table_insert (lookup_hash, (gpointer) "com.redhat.Cockpit.DBusTests.Hidden", GSIZE_TO_POINTER (TEST_TYPE_HIDDEN_PROXY)); g_once_init_leave (&once_init_value, 1); } ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name)); if (ret == (GType) 0) ret = G_TYPE_DBUS_PROXY; return ret; } /** * test_object_manager_client_new: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration. * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * * Asynchronously creates #GDBusObjectManagerClient using test_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details. * * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_object_manager_client_new_finish() to get the result of the operation. * * See test_object_manager_client_new_sync() for the synchronous, blocking version of this constructor. */ void test_object_manager_client_new ( GDBusConnection *connection, GDBusObjectManagerClientFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_async_initable_new_async (TEST_TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", test_object_manager_client_get_proxy_type, NULL); } /** * test_object_manager_client_new_finish: * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_object_manager_client_new(). * @error: Return location for error or %NULL * * Finishes an operation started with test_object_manager_client_new(). * * Returns: (transfer full) (type TestObjectManagerClient): The constructed object manager client or %NULL if @error is set. */ GDBusObjectManager * test_object_manager_client_new_finish ( GAsyncResult *res, GError **error) { GObject *ret; GObject *source_object; source_object = g_async_result_get_source_object (res); ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); g_object_unref (source_object); if (ret != NULL) return G_DBUS_OBJECT_MANAGER (ret); else return NULL; } /** * test_object_manager_client_new_sync: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration. * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Synchronously creates #GDBusObjectManagerClient using test_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details. * * The calling thread is blocked until a reply is received. * * See test_object_manager_client_new() for the asynchronous version of this constructor. * * Returns: (transfer full) (type TestObjectManagerClient): The constructed object manager client or %NULL if @error is set. */ GDBusObjectManager * test_object_manager_client_new_sync ( GDBusConnection *connection, GDBusObjectManagerClientFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GError **error) { GInitable *ret; ret = g_initable_new (TEST_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", test_object_manager_client_get_proxy_type, NULL); if (ret != NULL) return G_DBUS_OBJECT_MANAGER (ret); else return NULL; } /** * test_object_manager_client_new_for_bus: * @bus_type: A #GBusType. * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * * Like test_object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection. * * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call test_object_manager_client_new_for_bus_finish() to get the result of the operation. * * See test_object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor. */ void test_object_manager_client_new_for_bus ( GBusType bus_type, GDBusObjectManagerClientFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_async_initable_new_async (TEST_TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", test_object_manager_client_get_proxy_type, NULL); } /** * test_object_manager_client_new_for_bus_finish: * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to test_object_manager_client_new_for_bus(). * @error: Return location for error or %NULL * * Finishes an operation started with test_object_manager_client_new_for_bus(). * * Returns: (transfer full) (type TestObjectManagerClient): The constructed object manager client or %NULL if @error is set. */ GDBusObjectManager * test_object_manager_client_new_for_bus_finish ( GAsyncResult *res, GError **error) { GObject *ret; GObject *source_object; source_object = g_async_result_get_source_object (res); ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); g_object_unref (source_object); if (ret != NULL) return G_DBUS_OBJECT_MANAGER (ret); else return NULL; } /** * test_object_manager_client_new_for_bus_sync: * @bus_type: A #GBusType. * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Like test_object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection. * * The calling thread is blocked until a reply is received. * * See test_object_manager_client_new_for_bus() for the asynchronous version of this constructor. * * Returns: (transfer full) (type TestObjectManagerClient): The constructed object manager client or %NULL if @error is set. */ GDBusObjectManager * test_object_manager_client_new_for_bus_sync ( GBusType bus_type, GDBusObjectManagerClientFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GError **error) { GInitable *ret; ret = g_initable_new (TEST_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", test_object_manager_client_get_proxy_type, NULL); if (ret != NULL) return G_DBUS_OBJECT_MANAGER (ret); else return NULL; }