Created
October 21, 2025 21:12
-
-
Save swick/b68425cc0417cfa3a70e85d2def3071b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * This file is generated by gdbus-codegen, do not modify it. | |
| * | |
| * The license of this code is the same as for the D-Bus interface description | |
| * it was derived from. Note that it links to GLib, so must comply with the | |
| * LGPL linking clauses. | |
| */ | |
| #ifdef HAVE_CONFIG_H | |
| # include "config.h" | |
| #endif | |
| #include "dex-dbus-ping-pong.h" | |
| #include <string.h> | |
| #ifdef G_OS_UNIX | |
| # include <gio/gunixfdlist.h> | |
| #endif | |
| #ifdef G_ENABLE_DEBUG | |
| #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) | |
| #define g_marshal_value_peek_char(v) g_value_get_schar (v) | |
| #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) | |
| #define g_marshal_value_peek_int(v) g_value_get_int (v) | |
| #define g_marshal_value_peek_uint(v) g_value_get_uint (v) | |
| #define g_marshal_value_peek_long(v) g_value_get_long (v) | |
| #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) | |
| #define g_marshal_value_peek_int64(v) g_value_get_int64 (v) | |
| #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) | |
| #define g_marshal_value_peek_enum(v) g_value_get_enum (v) | |
| #define g_marshal_value_peek_flags(v) g_value_get_flags (v) | |
| #define g_marshal_value_peek_float(v) g_value_get_float (v) | |
| #define g_marshal_value_peek_double(v) g_value_get_double (v) | |
| #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) | |
| #define g_marshal_value_peek_param(v) g_value_get_param (v) | |
| #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) | |
| #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) | |
| #define g_marshal_value_peek_object(v) g_value_get_object (v) | |
| #define g_marshal_value_peek_variant(v) g_value_get_variant (v) | |
| #else /* !G_ENABLE_DEBUG */ | |
| /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. | |
| * Do not access GValues directly in your code. Instead, use the | |
| * g_value_get_*() functions | |
| */ | |
| #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int | |
| #define g_marshal_value_peek_char(v) (v)->data[0].v_int | |
| #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint | |
| #define g_marshal_value_peek_int(v) (v)->data[0].v_int | |
| #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint | |
| #define g_marshal_value_peek_long(v) (v)->data[0].v_long | |
| #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong | |
| #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 | |
| #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 | |
| #define g_marshal_value_peek_enum(v) (v)->data[0].v_long | |
| #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong | |
| #define g_marshal_value_peek_float(v) (v)->data[0].v_float | |
| #define g_marshal_value_peek_double(v) (v)->data[0].v_double | |
| #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer | |
| #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer | |
| #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer | |
| #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer | |
| #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer | |
| #define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer | |
| #endif /* !G_ENABLE_DEBUG */ | |
| 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; | |
| guint use_gvariant : 1; | |
| guint emits_changed_signal : 1; | |
| } _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; | |
| } | |
| typedef struct | |
| { | |
| GDBusProxy *proxy; | |
| DexPromise *promise; | |
| gulong cancelled_handler_id; | |
| guint signalled_handler_id; | |
| } GDBusFutureSignalData; | |
| static gboolean | |
| gdbus_future_signal_data_free_idle_cb (GDBusFutureSignalData *data) | |
| { | |
| g_cancellable_disconnect (dex_promise_get_cancellable (data->promise), | |
| data->cancelled_handler_id); | |
| g_clear_pointer (&data->promise, dex_unref); | |
| free (data); | |
| return G_SOURCE_REMOVE; | |
| } | |
| static void | |
| gdbus_future_signal_data_free (GDBusFutureSignalData *data) | |
| { | |
| g_signal_handler_disconnect (data->proxy, | |
| data->signalled_handler_id); | |
| g_clear_object (&data->proxy); | |
| g_idle_add ((GSourceFunc) gdbus_future_signal_data_free_idle_cb, data); | |
| } | |
| G_GNUC_UNUSED static void | |
| gdbus_future_signal_cancelled_cb (GCancellable *cancellable, | |
| gpointer user_data) | |
| { | |
| GDBusFutureSignalData *data = user_data; | |
| if (!data->proxy) | |
| return; | |
| dex_promise_reject (data->promise, | |
| g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, | |
| "Cancelled")); | |
| data->cancelled_handler_id = 0; | |
| gdbus_future_signal_data_free (data); | |
| } | |
| static void | |
| _g_dbus_codegen_marshal_VOID__BOOLEAN_VARIANT ( | |
| GClosure *closure, | |
| GValue *return_value G_GNUC_UNUSED, | |
| unsigned int n_param_values, | |
| const GValue *param_values, | |
| void *invocation_hint G_GNUC_UNUSED, | |
| void *marshal_data) | |
| { | |
| typedef void (*_GDbusCodegenMarshalVoid_BooleanVariantFunc) | |
| (void *data1, | |
| gboolean arg_active, | |
| GVariant *arg_options, | |
| void *data2); | |
| _GDbusCodegenMarshalVoid_BooleanVariantFunc callback; | |
| GCClosure *cc = (GCClosure*) closure; | |
| void *data1, *data2; | |
| g_return_if_fail (n_param_values == 3); | |
| if (G_CCLOSURE_SWAP_DATA (closure)) | |
| { | |
| data1 = closure->data; | |
| data2 = g_value_peek_pointer (param_values + 0); | |
| } | |
| else | |
| { | |
| data1 = g_value_peek_pointer (param_values + 0); | |
| data2 = closure->data; | |
| } | |
| callback = (_GDbusCodegenMarshalVoid_BooleanVariantFunc) | |
| (marshal_data ? marshal_data : cc->callback); | |
| callback (data1, | |
| g_marshal_value_peek_boolean (param_values + 1), | |
| g_marshal_value_peek_variant (param_values + 2), | |
| data2); | |
| } | |
| static void | |
| _g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING ( | |
| GClosure *closure, | |
| GValue *return_value, | |
| unsigned int n_param_values, | |
| const GValue *param_values, | |
| void *invocation_hint G_GNUC_UNUSED, | |
| void *marshal_data) | |
| { | |
| typedef gboolean (*_GDbusCodegenMarshalBoolean_ObjectStringFunc) | |
| (void *data1, | |
| GDBusMethodInvocation *arg_method_invocation, | |
| const gchar *arg_name, | |
| void *data2); | |
| _GDbusCodegenMarshalBoolean_ObjectStringFunc callback; | |
| GCClosure *cc = (GCClosure*) closure; | |
| void *data1, *data2; | |
| gboolean v_return; | |
| g_return_if_fail (return_value != NULL); | |
| g_return_if_fail (n_param_values == 3); | |
| if (G_CCLOSURE_SWAP_DATA (closure)) | |
| { | |
| data1 = closure->data; | |
| data2 = g_value_peek_pointer (param_values + 0); | |
| } | |
| else | |
| { | |
| data1 = g_value_peek_pointer (param_values + 0); | |
| data2 = closure->data; | |
| } | |
| callback = (_GDbusCodegenMarshalBoolean_ObjectStringFunc) | |
| (marshal_data ? marshal_data : cc->callback); | |
| v_return = | |
| callback (data1, | |
| g_marshal_value_peek_object (param_values + 1), | |
| g_marshal_value_peek_string (param_values + 2), | |
| data2); | |
| g_value_set_boolean (return_value, v_return); | |
| } | |
| /* ------------------------------------------------------------------------ | |
| * Code for interface org.example.PingPong | |
| * ------------------------------------------------------------------------ | |
| */ | |
| /** | |
| * SECTION:DexDbusPingPong | |
| * @title: DexDbusPingPong | |
| * @short_description: Generated C code for the org.example.PingPong D-Bus interface | |
| * | |
| * This section contains code for working with the <link linkend="gdbus-interface-org-example-PingPong.top_of_page">org.example.PingPong</link> D-Bus interface in C. | |
| */ | |
| enum | |
| { | |
| DEX_DBUS__PING_PONG_RELOADING, | |
| }; | |
| static unsigned DEX_DBUS__PING_PONG_SIGNALS[1] = { 0 }; | |
| /* ---- Introspection data for org.example.PingPong ---- */ | |
| static const _ExtendedGDBusArgInfo _dex_dbus_ping_pong_method_info_ping_IN_ARG_name = | |
| { | |
| { | |
| -1, | |
| (gchar *) "name", | |
| (gchar *) "s", | |
| NULL | |
| }, | |
| FALSE | |
| }; | |
| static const GDBusArgInfo * const _dex_dbus_ping_pong_method_info_ping_IN_ARG_pointers[] = | |
| { | |
| &_dex_dbus_ping_pong_method_info_ping_IN_ARG_name.parent_struct, | |
| NULL | |
| }; | |
| static const _ExtendedGDBusArgInfo _dex_dbus_ping_pong_method_info_ping_OUT_ARG_pong = | |
| { | |
| { | |
| -1, | |
| (gchar *) "pong", | |
| (gchar *) "s", | |
| NULL | |
| }, | |
| FALSE | |
| }; | |
| static const GDBusArgInfo * const _dex_dbus_ping_pong_method_info_ping_OUT_ARG_pointers[] = | |
| { | |
| &_dex_dbus_ping_pong_method_info_ping_OUT_ARG_pong.parent_struct, | |
| NULL | |
| }; | |
| static const _ExtendedGDBusMethodInfo _dex_dbus_ping_pong_method_info_ping = | |
| { | |
| { | |
| -1, | |
| (gchar *) "Ping", | |
| (GDBusArgInfo **) &_dex_dbus_ping_pong_method_info_ping_IN_ARG_pointers, | |
| (GDBusArgInfo **) &_dex_dbus_ping_pong_method_info_ping_OUT_ARG_pointers, | |
| NULL | |
| }, | |
| "handle-ping", | |
| FALSE | |
| }; | |
| static const GDBusMethodInfo * const _dex_dbus_ping_pong_method_info_pointers[] = | |
| { | |
| &_dex_dbus_ping_pong_method_info_ping.parent_struct, | |
| NULL | |
| }; | |
| static const _ExtendedGDBusArgInfo _dex_dbus_ping_pong_signal_info_reloading_ARG_active = | |
| { | |
| { | |
| -1, | |
| (gchar *) "active", | |
| (gchar *) "b", | |
| NULL | |
| }, | |
| FALSE | |
| }; | |
| static const _ExtendedGDBusArgInfo _dex_dbus_ping_pong_signal_info_reloading_ARG_options = | |
| { | |
| { | |
| -1, | |
| (gchar *) "options", | |
| (gchar *) "a{sv}", | |
| NULL | |
| }, | |
| FALSE | |
| }; | |
| static const GDBusArgInfo * const _dex_dbus_ping_pong_signal_info_reloading_ARG_pointers[] = | |
| { | |
| &_dex_dbus_ping_pong_signal_info_reloading_ARG_active.parent_struct, | |
| &_dex_dbus_ping_pong_signal_info_reloading_ARG_options.parent_struct, | |
| NULL | |
| }; | |
| static const _ExtendedGDBusSignalInfo _dex_dbus_ping_pong_signal_info_reloading = | |
| { | |
| { | |
| -1, | |
| (gchar *) "Reloading", | |
| (GDBusArgInfo **) &_dex_dbus_ping_pong_signal_info_reloading_ARG_pointers, | |
| NULL | |
| }, | |
| "reloading" | |
| }; | |
| static const GDBusSignalInfo * const _dex_dbus_ping_pong_signal_info_pointers[] = | |
| { | |
| &_dex_dbus_ping_pong_signal_info_reloading.parent_struct, | |
| NULL | |
| }; | |
| static const _ExtendedGDBusPropertyInfo _dex_dbus_ping_pong_property_info_version = | |
| { | |
| { | |
| -1, | |
| (gchar *) "Version", | |
| (gchar *) "s", | |
| G_DBUS_PROPERTY_INFO_FLAGS_READABLE, | |
| NULL | |
| }, | |
| "version", | |
| FALSE, | |
| TRUE | |
| }; | |
| static const GDBusPropertyInfo * const _dex_dbus_ping_pong_property_info_pointers[] = | |
| { | |
| &_dex_dbus_ping_pong_property_info_version.parent_struct, | |
| NULL | |
| }; | |
| static const _ExtendedGDBusInterfaceInfo _dex_dbus_ping_pong_interface_info = | |
| { | |
| { | |
| -1, | |
| (gchar *) "org.example.PingPong", | |
| (GDBusMethodInfo **) &_dex_dbus_ping_pong_method_info_pointers, | |
| (GDBusSignalInfo **) &_dex_dbus_ping_pong_signal_info_pointers, | |
| (GDBusPropertyInfo **) &_dex_dbus_ping_pong_property_info_pointers, | |
| NULL | |
| }, | |
| "ping-pong", | |
| }; | |
| /** | |
| * dex_dbus_ping_pong_interface_info: | |
| * | |
| * Gets a machine-readable description of the <link linkend="gdbus-interface-org-example-PingPong.top_of_page">org.example.PingPong</link> D-Bus interface. | |
| * | |
| * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. | |
| */ | |
| GDBusInterfaceInfo * | |
| dex_dbus_ping_pong_interface_info (void) | |
| { | |
| return (GDBusInterfaceInfo *) &_dex_dbus_ping_pong_interface_info.parent_struct; | |
| } | |
| /** | |
| * dex_dbus_ping_pong_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 #DexDbusPingPong interface for a concrete class. | |
| * The properties are overridden in the order they are defined. | |
| * | |
| * Returns: The last property id. | |
| */ | |
| guint | |
| dex_dbus_ping_pong_override_properties (GObjectClass *klass, guint property_id_begin) | |
| { | |
| g_object_class_override_property (klass, property_id_begin++, "version"); | |
| return property_id_begin - 1; | |
| } | |
| inline static void | |
| dex_dbus_ping_pong_signal_marshal_reloading ( | |
| GClosure *closure, | |
| GValue *return_value, | |
| unsigned int n_param_values, | |
| const GValue *param_values, | |
| void *invocation_hint, | |
| void *marshal_data) | |
| { | |
| _g_dbus_codegen_marshal_VOID__BOOLEAN_VARIANT (closure, | |
| return_value, n_param_values, param_values, invocation_hint, marshal_data); | |
| } | |
| inline static void | |
| dex_dbus_ping_pong_method_marshal_ping ( | |
| GClosure *closure, | |
| GValue *return_value, | |
| unsigned int n_param_values, | |
| const GValue *param_values, | |
| void *invocation_hint, | |
| void *marshal_data) | |
| { | |
| _g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING (closure, | |
| return_value, n_param_values, param_values, invocation_hint, marshal_data); | |
| } | |
| /** | |
| * DexDbusPingPong: | |
| * | |
| * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-example-PingPong.top_of_page">org.example.PingPong</link>. | |
| */ | |
| /** | |
| * DexDbusPingPongIface: | |
| * @parent_iface: The parent interface. | |
| * @handle_ping: Handler for the #DexDbusPingPong::handle-ping signal. | |
| * @get_version: Getter for the #DexDbusPingPong:version property. | |
| * @reloading: Handler for the #DexDbusPingPong::reloading signal. | |
| * | |
| * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-example-PingPong.top_of_page">org.example.PingPong</link>. | |
| */ | |
| typedef DexDbusPingPongIface DexDbusPingPongInterface; | |
| G_DEFINE_INTERFACE (DexDbusPingPong, dex_dbus_ping_pong, G_TYPE_OBJECT) | |
| static void | |
| dex_dbus_ping_pong_default_init (DexDbusPingPongIface *iface) | |
| { | |
| /* GObject signals for incoming D-Bus method calls: */ | |
| /** | |
| * DexDbusPingPong::handle-ping: | |
| * @object: A #DexDbusPingPong. | |
| * @invocation: A #GDBusMethodInvocation. | |
| * @arg_name: Argument passed by remote caller. | |
| * | |
| * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-example-PingPong.Ping">Ping()</link> 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 dex_dbus_ping_pong_complete_ping() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. | |
| * | |
| * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. | |
| */ | |
| g_signal_new ("handle-ping", | |
| G_TYPE_FROM_INTERFACE (iface), | |
| G_SIGNAL_RUN_LAST, | |
| G_STRUCT_OFFSET (DexDbusPingPongIface, handle_ping), | |
| g_signal_accumulator_true_handled, | |
| NULL, | |
| dex_dbus_ping_pong_method_marshal_ping, | |
| G_TYPE_BOOLEAN, | |
| 2, | |
| G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); | |
| /* GObject signals for received D-Bus signals: */ | |
| /** | |
| * DexDbusPingPong::reloading: | |
| * @object: A #DexDbusPingPong. | |
| * @arg_active: Argument. | |
| * @arg_options: Argument. | |
| * | |
| * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-example-PingPong.Reloading">"Reloading"</link> 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. | |
| */ | |
| DEX_DBUS__PING_PONG_SIGNALS[DEX_DBUS__PING_PONG_RELOADING] = | |
| g_signal_new ("reloading", | |
| G_TYPE_FROM_INTERFACE (iface), | |
| G_SIGNAL_RUN_LAST, | |
| G_STRUCT_OFFSET (DexDbusPingPongIface, reloading), | |
| NULL, | |
| NULL, | |
| dex_dbus_ping_pong_signal_marshal_reloading, | |
| G_TYPE_NONE, | |
| 2, G_TYPE_BOOLEAN, G_TYPE_VARIANT); | |
| /* GObject properties for D-Bus properties: */ | |
| /** | |
| * DexDbusPingPong:version: | |
| * | |
| * Represents the D-Bus property <link linkend="gdbus-property-org-example-PingPong.Version">"Version"</link>. | |
| * | |
| * 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 ("version", "Version", "Version", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); | |
| } | |
| /** | |
| * dex_dbus_ping_pong_get_version: (skip) | |
| * @object: A #DexDbusPingPong. | |
| * | |
| * Gets the value of the <link linkend="gdbus-property-org-example-PingPong.Version">"Version"</link> 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 dex_dbus_ping_pong_dup_version() if on another thread. | |
| * | |
| * Returns: (transfer none) (nullable): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. | |
| */ | |
| const gchar * | |
| dex_dbus_ping_pong_get_version (DexDbusPingPong *object) | |
| { | |
| g_return_val_if_fail (DEX_DBUS_IS_PING_PONG (object), NULL); | |
| return DEX_DBUS_PING_PONG_GET_IFACE (object)->get_version (object); | |
| } | |
| /** | |
| * dex_dbus_ping_pong_dup_version: (skip) | |
| * @object: A #DexDbusPingPong. | |
| * | |
| * Gets a copy of the <link linkend="gdbus-property-org-example-PingPong.Version">"Version"</link> 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) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). | |
| */ | |
| gchar * | |
| dex_dbus_ping_pong_dup_version (DexDbusPingPong *object) | |
| { | |
| gchar *value; | |
| g_object_get (G_OBJECT (object), "version", &value, NULL); | |
| return value; | |
| } | |
| /** | |
| * dex_dbus_ping_pong_set_version: (skip) | |
| * @object: A #DexDbusPingPong. | |
| * @value: The value to set. | |
| * | |
| * Sets the <link linkend="gdbus-property-org-example-PingPong.Version">"Version"</link> 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 | |
| dex_dbus_ping_pong_set_version (DexDbusPingPong *object, const gchar *value) | |
| { | |
| g_object_set (G_OBJECT (object), "version", value, NULL); | |
| } | |
| /** | |
| * dex_dbus_ping_pong_emit_reloading: | |
| * @object: A #DexDbusPingPong. | |
| * @arg_active: Argument to pass with the signal. | |
| * @arg_options: Argument to pass with the signal. | |
| * | |
| * Emits the <link linkend="gdbus-signal-org-example-PingPong.Reloading">"Reloading"</link> D-Bus signal. | |
| */ | |
| void | |
| dex_dbus_ping_pong_emit_reloading ( | |
| DexDbusPingPong *object, | |
| gboolean arg_active, | |
| GVariant *arg_options) | |
| { | |
| g_signal_emit (object, DEX_DBUS__PING_PONG_SIGNALS[DEX_DBUS__PING_PONG_RELOADING], 0, arg_active, arg_options); | |
| } | |
| /** | |
| * dex_dbus_ping_pong_call_ping: | |
| * @proxy: A #DexDbusPingPongProxy. | |
| * @arg_name: Argument to pass with the method invocation. | |
| * @cancellable: (nullable): 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 <link linkend="gdbus-method-org-example-PingPong.Ping">Ping()</link> 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 (see g_main_context_push_thread_default()). | |
| * You can then call dex_dbus_ping_pong_call_ping_finish() to get the result of the operation. | |
| * | |
| * See dex_dbus_ping_pong_call_ping_sync() for the synchronous, blocking version of this method. | |
| */ | |
| void | |
| dex_dbus_ping_pong_call_ping ( | |
| DexDbusPingPong *proxy, | |
| const gchar *arg_name, | |
| GCancellable *cancellable, | |
| GAsyncReadyCallback callback, | |
| gpointer user_data) | |
| { | |
| g_dbus_proxy_call (G_DBUS_PROXY (proxy), | |
| "Ping", | |
| g_variant_new ("(s)", | |
| arg_name), | |
| G_DBUS_CALL_FLAGS_NONE, | |
| -1, | |
| cancellable, | |
| callback, | |
| user_data); | |
| } | |
| /** | |
| * dex_dbus_ping_pong_call_ping_finish: | |
| * @proxy: A #DexDbusPingPongProxy. | |
| * @out_pong: (out) (optional): Return location for return parameter or %NULL to ignore. | |
| * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to dex_dbus_ping_pong_call_ping(). | |
| * @error: Return location for error or %NULL. | |
| * | |
| * Finishes an operation started with dex_dbus_ping_pong_call_ping(). | |
| * | |
| * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. | |
| */ | |
| gboolean | |
| dex_dbus_ping_pong_call_ping_finish ( | |
| DexDbusPingPong *proxy, | |
| gchar ** out_pong, | |
| 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_pong); | |
| g_variant_unref (_ret); | |
| _out: | |
| return _ret != NULL; | |
| } | |
| /** | |
| * dex_dbus_ping_pong_call_ping_sync: | |
| * @proxy: A #DexDbusPingPongProxy. | |
| * @arg_name: Argument to pass with the method invocation. | |
| * @out_pong: (out) (optional): Return location for return parameter or %NULL to ignore. | |
| * @cancellable: (nullable): A #GCancellable or %NULL. | |
| * @error: Return location for error or %NULL. | |
| * | |
| * Synchronously invokes the <link linkend="gdbus-method-org-example-PingPong.Ping">Ping()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. | |
| * | |
| * See dex_dbus_ping_pong_call_ping() for the asynchronous version of this method. | |
| * | |
| * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. | |
| */ | |
| gboolean | |
| dex_dbus_ping_pong_call_ping_sync ( | |
| DexDbusPingPong *proxy, | |
| const gchar *arg_name, | |
| gchar ** out_pong, | |
| GCancellable *cancellable, | |
| GError **error) | |
| { | |
| GVariant *_ret; | |
| _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), | |
| "Ping", | |
| g_variant_new ("(s)", | |
| arg_name), | |
| G_DBUS_CALL_FLAGS_NONE, | |
| -1, | |
| cancellable, | |
| error); | |
| if (_ret == NULL) | |
| goto _out; | |
| g_variant_get (_ret, | |
| "(s)", | |
| out_pong); | |
| g_variant_unref (_ret); | |
| _out: | |
| return _ret != NULL; | |
| } | |
| /** | |
| * dex_dbus_ping_pong_complete_ping: | |
| * @object: A #DexDbusPingPong. | |
| * @invocation: (transfer full): A #GDBusMethodInvocation. | |
| * @pong: Parameter to return. | |
| * | |
| * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-example-PingPong.Ping">Ping()</link> 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 | |
| dex_dbus_ping_pong_complete_ping ( | |
| DexDbusPingPong *object G_GNUC_UNUSED, | |
| GDBusMethodInvocation *invocation, | |
| const gchar *pong) | |
| { | |
| g_dbus_method_invocation_return_value (invocation, | |
| g_variant_new ("(s)", | |
| pong)); | |
| } | |
| /* ------------------------------------------------------------------------ */ | |
| /** | |
| * DexDbusPingPongProxy: | |
| * | |
| * The #DexDbusPingPongProxy structure contains only private data and should only be accessed using the provided API. | |
| */ | |
| /** | |
| * DexDbusPingPongProxyClass: | |
| * @parent_class: The parent class. | |
| * | |
| * Class structure for #DexDbusPingPongProxy. | |
| */ | |
| struct _DexDbusPingPongProxyPrivate | |
| { | |
| GData *qdata; | |
| }; | |
| static void dex_dbus_ping_pong_proxy_iface_init (DexDbusPingPongIface *iface); | |
| #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 | |
| G_DEFINE_TYPE_WITH_CODE (DexDbusPingPongProxy, dex_dbus_ping_pong_proxy, G_TYPE_DBUS_PROXY, | |
| G_ADD_PRIVATE (DexDbusPingPongProxy) | |
| G_IMPLEMENT_INTERFACE (DEX_DBUS_TYPE_PING_PONG, dex_dbus_ping_pong_proxy_iface_init)) | |
| #else | |
| G_DEFINE_TYPE_WITH_CODE (DexDbusPingPongProxy, dex_dbus_ping_pong_proxy, G_TYPE_DBUS_PROXY, | |
| G_IMPLEMENT_INTERFACE (DEX_DBUS_TYPE_PING_PONG, dex_dbus_ping_pong_proxy_iface_init)) | |
| #endif | |
| static void | |
| dex_dbus_ping_pong_proxy_finalize (GObject *object) | |
| { | |
| DexDbusPingPongProxy *proxy = DEX_DBUS_PING_PONG_PROXY (object); | |
| g_datalist_clear (&proxy->priv->qdata); | |
| G_OBJECT_CLASS (dex_dbus_ping_pong_proxy_parent_class)->finalize (object); | |
| } | |
| static void | |
| dex_dbus_ping_pong_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 = (const _ExtendedGDBusPropertyInfo *) _dex_dbus_ping_pong_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 | |
| dex_dbus_ping_pong_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 org.example.PingPong: %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 | |
| dex_dbus_ping_pong_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 = (const _ExtendedGDBusPropertyInfo *) _dex_dbus_ping_pong_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)", "org.example.PingPong", info->parent_struct.name, variant), | |
| G_DBUS_CALL_FLAGS_NONE, | |
| -1, | |
| NULL, (GAsyncReadyCallback) dex_dbus_ping_pong_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); | |
| g_variant_unref (variant); | |
| } | |
| static void | |
| dex_dbus_ping_pong_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; | |
| gsize num_params; | |
| gsize n; | |
| guint signal_id; | |
| info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_dex_dbus_ping_pong_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], DEX_DBUS_TYPE_PING_PONG); | |
| 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, DEX_DBUS_TYPE_PING_PONG); | |
| 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 | |
| dex_dbus_ping_pong_proxy_g_properties_changed (GDBusProxy *_proxy, | |
| GVariant *changed_properties, | |
| const gchar *const *invalidated_properties) | |
| { | |
| DexDbusPingPongProxy *proxy = DEX_DBUS_PING_PONG_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 *) &_dex_dbus_ping_pong_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 *) &_dex_dbus_ping_pong_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 * | |
| dex_dbus_ping_pong_proxy_get_version (DexDbusPingPong *object) | |
| { | |
| DexDbusPingPongProxy *proxy = DEX_DBUS_PING_PONG_PROXY (object); | |
| GVariant *variant; | |
| const gchar *value = NULL; | |
| variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Version"); | |
| if (variant != NULL) | |
| { | |
| value = g_variant_get_string (variant, NULL); | |
| g_variant_unref (variant); | |
| } | |
| return value; | |
| } | |
| static void | |
| dex_dbus_ping_pong_proxy_init (DexDbusPingPongProxy *proxy) | |
| { | |
| #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 | |
| proxy->priv = dex_dbus_ping_pong_proxy_get_instance_private (proxy); | |
| #else | |
| proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, DEX_DBUS_TYPE_PING_PONG_PROXY, DexDbusPingPongProxyPrivate); | |
| #endif | |
| g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), dex_dbus_ping_pong_interface_info ()); | |
| } | |
| static void | |
| dex_dbus_ping_pong_proxy_class_init (DexDbusPingPongProxyClass *klass) | |
| { | |
| GObjectClass *gobject_class; | |
| GDBusProxyClass *proxy_class; | |
| gobject_class = G_OBJECT_CLASS (klass); | |
| gobject_class->finalize = dex_dbus_ping_pong_proxy_finalize; | |
| gobject_class->get_property = dex_dbus_ping_pong_proxy_get_property; | |
| gobject_class->set_property = dex_dbus_ping_pong_proxy_set_property; | |
| proxy_class = G_DBUS_PROXY_CLASS (klass); | |
| proxy_class->g_signal = dex_dbus_ping_pong_proxy_g_signal; | |
| proxy_class->g_properties_changed = dex_dbus_ping_pong_proxy_g_properties_changed; | |
| dex_dbus_ping_pong_override_properties (gobject_class, 1); | |
| #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 | |
| g_type_class_add_private (klass, sizeof (DexDbusPingPongProxyPrivate)); | |
| #endif | |
| } | |
| static void | |
| dex_dbus_ping_pong_proxy_iface_init (DexDbusPingPongIface *iface) | |
| { | |
| iface->get_version = dex_dbus_ping_pong_proxy_get_version; | |
| } | |
| /** | |
| * dex_dbus_ping_pong_proxy_new: | |
| * @connection: A #GDBusConnection. | |
| * @flags: Flags from the #GDBusProxyFlags enumeration. | |
| * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. | |
| * @object_path: An object path. | |
| * @cancellable: (nullable): 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 <link linkend="gdbus-interface-org-example-PingPong.top_of_page">org.example.PingPong</link>. 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 (see g_main_context_push_thread_default()). | |
| * You can then call dex_dbus_ping_pong_proxy_new_finish() to get the result of the operation. | |
| * | |
| * See dex_dbus_ping_pong_proxy_new_sync() for the synchronous, blocking version of this constructor. | |
| */ | |
| void | |
| dex_dbus_ping_pong_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 (DEX_DBUS_TYPE_PING_PONG_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", "org.example.PingPong", NULL); | |
| } | |
| /** | |
| * dex_dbus_ping_pong_proxy_new_finish: | |
| * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to dex_dbus_ping_pong_proxy_new(). | |
| * @error: Return location for error or %NULL | |
| * | |
| * Finishes an operation started with dex_dbus_ping_pong_proxy_new(). | |
| * | |
| * Returns: (transfer full) (type DexDbusPingPongProxy): The constructed proxy object or %NULL if @error is set. | |
| */ | |
| DexDbusPingPong * | |
| dex_dbus_ping_pong_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 DEX_DBUS_PING_PONG (ret); | |
| else | |
| return NULL; | |
| } | |
| /** | |
| * dex_dbus_ping_pong_proxy_new_sync: | |
| * @connection: A #GDBusConnection. | |
| * @flags: Flags from the #GDBusProxyFlags enumeration. | |
| * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. | |
| * @object_path: An object path. | |
| * @cancellable: (nullable): A #GCancellable or %NULL. | |
| * @error: Return location for error or %NULL | |
| * | |
| * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-example-PingPong.top_of_page">org.example.PingPong</link>. See g_dbus_proxy_new_sync() for more details. | |
| * | |
| * The calling thread is blocked until a reply is received. | |
| * | |
| * See dex_dbus_ping_pong_proxy_new() for the asynchronous version of this constructor. | |
| * | |
| * Returns: (transfer full) (type DexDbusPingPongProxy): The constructed proxy object or %NULL if @error is set. | |
| */ | |
| DexDbusPingPong * | |
| dex_dbus_ping_pong_proxy_new_sync ( | |
| GDBusConnection *connection, | |
| GDBusProxyFlags flags, | |
| const gchar *name, | |
| const gchar *object_path, | |
| GCancellable *cancellable, | |
| GError **error) | |
| { | |
| GInitable *ret; | |
| ret = g_initable_new (DEX_DBUS_TYPE_PING_PONG_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.example.PingPong", NULL); | |
| if (ret != NULL) | |
| return DEX_DBUS_PING_PONG (ret); | |
| else | |
| return NULL; | |
| } | |
| /** | |
| * dex_dbus_ping_pong_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: (nullable): A #GCancellable or %NULL. | |
| * @callback: A #GAsyncReadyCallback to call when the request is satisfied. | |
| * @user_data: User data to pass to @callback. | |
| * | |
| * Like dex_dbus_ping_pong_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 (see g_main_context_push_thread_default()). | |
| * You can then call dex_dbus_ping_pong_proxy_new_for_bus_finish() to get the result of the operation. | |
| * | |
| * See dex_dbus_ping_pong_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. | |
| */ | |
| void | |
| dex_dbus_ping_pong_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 (DEX_DBUS_TYPE_PING_PONG_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", "org.example.PingPong", NULL); | |
| } | |
| /** | |
| * dex_dbus_ping_pong_proxy_new_for_bus_finish: | |
| * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to dex_dbus_ping_pong_proxy_new_for_bus(). | |
| * @error: Return location for error or %NULL | |
| * | |
| * Finishes an operation started with dex_dbus_ping_pong_proxy_new_for_bus(). | |
| * | |
| * Returns: (transfer full) (type DexDbusPingPongProxy): The constructed proxy object or %NULL if @error is set. | |
| */ | |
| DexDbusPingPong * | |
| dex_dbus_ping_pong_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 DEX_DBUS_PING_PONG (ret); | |
| else | |
| return NULL; | |
| } | |
| /** | |
| * dex_dbus_ping_pong_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: (nullable): A #GCancellable or %NULL. | |
| * @error: Return location for error or %NULL | |
| * | |
| * Like dex_dbus_ping_pong_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. | |
| * | |
| * The calling thread is blocked until a reply is received. | |
| * | |
| * See dex_dbus_ping_pong_proxy_new_for_bus() for the asynchronous version of this constructor. | |
| * | |
| * Returns: (transfer full) (type DexDbusPingPongProxy): The constructed proxy object or %NULL if @error is set. | |
| */ | |
| DexDbusPingPong * | |
| dex_dbus_ping_pong_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 (DEX_DBUS_TYPE_PING_PONG_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.example.PingPong", NULL); | |
| if (ret != NULL) | |
| return DEX_DBUS_PING_PONG (ret); | |
| else | |
| return NULL; | |
| } | |
| /* ------------------------------------------------------------------------ */ | |
| /** | |
| * DexDbusPingPongSkeleton: | |
| * | |
| * The #DexDbusPingPongSkeleton structure contains only private data and should only be accessed using the provided API. | |
| */ | |
| /** | |
| * DexDbusPingPongSkeletonClass: | |
| * @parent_class: The parent class. | |
| * | |
| * Class structure for #DexDbusPingPongSkeleton. | |
| */ | |
| struct _DexDbusPingPongSkeletonPrivate | |
| { | |
| GValue *properties; | |
| GList *changed_properties; | |
| GSource *changed_properties_idle_source; | |
| GMainContext *context; | |
| GMutex lock; | |
| }; | |
| static void | |
| _dex_dbus_ping_pong_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) | |
| { | |
| DexDbusPingPongSkeleton *skeleton = DEX_DBUS_PING_PONG_SKELETON (user_data); | |
| _ExtendedGDBusMethodInfo *info; | |
| GVariantIter iter; | |
| GVariant *child; | |
| GValue *paramv; | |
| gsize num_params; | |
| guint num_extra; | |
| gsize 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], DEX_DBUS_TYPE_PING_PONG); | |
| 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, DEX_DBUS_TYPE_PING_PONG); | |
| 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 * | |
| _dex_dbus_ping_pong_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) | |
| { | |
| DexDbusPingPongSkeleton *skeleton = DEX_DBUS_PING_PONG_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 *) &_dex_dbus_ping_pong_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 | |
| _dex_dbus_ping_pong_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) | |
| { | |
| DexDbusPingPongSkeleton *skeleton = DEX_DBUS_PING_PONG_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 *) &_dex_dbus_ping_pong_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 _dex_dbus_ping_pong_skeleton_vtable = | |
| { | |
| _dex_dbus_ping_pong_skeleton_handle_method_call, | |
| _dex_dbus_ping_pong_skeleton_handle_get_property, | |
| _dex_dbus_ping_pong_skeleton_handle_set_property, | |
| {NULL} | |
| }; | |
| static GDBusInterfaceInfo * | |
| dex_dbus_ping_pong_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) | |
| { | |
| return dex_dbus_ping_pong_interface_info (); | |
| } | |
| static GDBusInterfaceVTable * | |
| dex_dbus_ping_pong_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) | |
| { | |
| return (GDBusInterfaceVTable *) &_dex_dbus_ping_pong_skeleton_vtable; | |
| } | |
| static GVariant * | |
| dex_dbus_ping_pong_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) | |
| { | |
| DexDbusPingPongSkeleton *skeleton = DEX_DBUS_PING_PONG_SKELETON (_skeleton); | |
| GVariantBuilder builder; | |
| guint n; | |
| #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84 | |
| g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}")); | |
| #else | |
| g_variant_builder_init(&builder, G_VARIANT_TYPE ("a{sv}")); | |
| #endif | |
| if (_dex_dbus_ping_pong_interface_info.parent_struct.properties == NULL) | |
| goto out; | |
| for (n = 0; _dex_dbus_ping_pong_interface_info.parent_struct.properties[n] != NULL; n++) | |
| { | |
| GDBusPropertyInfo *info = _dex_dbus_ping_pong_interface_info.parent_struct.properties[n]; | |
| if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) | |
| { | |
| GVariant *value; | |
| value = _dex_dbus_ping_pong_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)), "org.example.PingPong", 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 _dex_dbus_ping_pong_emit_changed (gpointer user_data); | |
| static void | |
| dex_dbus_ping_pong_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) | |
| { | |
| DexDbusPingPongSkeleton *skeleton = DEX_DBUS_PING_PONG_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) | |
| _dex_dbus_ping_pong_emit_changed (skeleton); | |
| } | |
| static void | |
| _dex_dbus_ping_pong_on_signal_reloading ( | |
| DexDbusPingPong *object, | |
| gboolean arg_active, | |
| GVariant *arg_options) | |
| { | |
| DexDbusPingPongSkeleton *skeleton = DEX_DBUS_PING_PONG_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 ("(b@a{sv})", | |
| arg_active, | |
| arg_options)); | |
| 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)), "org.example.PingPong", "Reloading", | |
| signal_variant, NULL); | |
| } | |
| g_variant_unref (signal_variant); | |
| g_list_free_full (connections, g_object_unref); | |
| } | |
| static void dex_dbus_ping_pong_skeleton_iface_init (DexDbusPingPongIface *iface); | |
| #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 | |
| G_DEFINE_TYPE_WITH_CODE (DexDbusPingPongSkeleton, dex_dbus_ping_pong_skeleton, DEX_TYPE_DBUS_INTERFACE_SKELETON, | |
| G_ADD_PRIVATE (DexDbusPingPongSkeleton) | |
| G_IMPLEMENT_INTERFACE (DEX_DBUS_TYPE_PING_PONG, dex_dbus_ping_pong_skeleton_iface_init)) | |
| #else | |
| G_DEFINE_TYPE_WITH_CODE (DexDbusPingPongSkeleton, dex_dbus_ping_pong_skeleton, DEX_TYPE_DBUS_INTERFACE_SKELETON, | |
| G_IMPLEMENT_INTERFACE (DEX_DBUS_TYPE_PING_PONG, dex_dbus_ping_pong_skeleton_iface_init)) | |
| #endif | |
| static void | |
| dex_dbus_ping_pong_skeleton_finalize (GObject *object) | |
| { | |
| DexDbusPingPongSkeleton *skeleton = DEX_DBUS_PING_PONG_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 GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 | |
| /* coverity[missing_lock : SUPPRESS] */ | |
| g_clear_pointer (&skeleton->priv->changed_properties_idle_source, g_source_destroy); | |
| #else | |
| if (skeleton->priv->changed_properties_idle_source != NULL) | |
| g_source_destroy (skeleton->priv->changed_properties_idle_source); | |
| skeleton->priv->changed_properties_idle_source = NULL; | |
| #endif | |
| g_main_context_unref (skeleton->priv->context); | |
| g_mutex_clear (&skeleton->priv->lock); | |
| G_OBJECT_CLASS (dex_dbus_ping_pong_skeleton_parent_class)->finalize (object); | |
| } | |
| static void | |
| dex_dbus_ping_pong_skeleton_get_property (GObject *object, | |
| guint prop_id, | |
| GValue *value, | |
| GParamSpec *pspec G_GNUC_UNUSED) | |
| { | |
| DexDbusPingPongSkeleton *skeleton = DEX_DBUS_PING_PONG_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 | |
| _dex_dbus_ping_pong_emit_changed (gpointer user_data) | |
| { | |
| DexDbusPingPongSkeleton *skeleton = DEX_DBUS_PING_PONG_SKELETON (user_data); | |
| GList *l; | |
| GVariantBuilder builder; | |
| GVariantBuilder invalidated_builder; | |
| guint num_changes; | |
| g_mutex_lock (&skeleton->priv->lock); | |
| #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84 | |
| g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}")); | |
| g_variant_builder_init_static (&invalidated_builder, G_VARIANT_TYPE ("as")); | |
| #else | |
| g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); | |
| g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); | |
| #endif | |
| 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)", "org.example.PingPong", | |
| &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 | |
| _dex_dbus_ping_pong_schedule_emit_changed (DexDbusPingPongSkeleton *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 | |
| dex_dbus_ping_pong_skeleton_notify (GObject *object, | |
| GParamSpec *pspec G_GNUC_UNUSED) | |
| { | |
| DexDbusPingPongSkeleton *skeleton = DEX_DBUS_PING_PONG_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, _dex_dbus_ping_pong_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); | |
| g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _dex_dbus_ping_pong_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 | |
| dex_dbus_ping_pong_skeleton_set_property (GObject *object, | |
| guint prop_id, | |
| const GValue *value, | |
| GParamSpec *pspec) | |
| { | |
| const _ExtendedGDBusPropertyInfo *info; | |
| DexDbusPingPongSkeleton *skeleton = DEX_DBUS_PING_PONG_SKELETON (object); | |
| g_assert (prop_id != 0 && prop_id - 1 < 1); | |
| info = (const _ExtendedGDBusPropertyInfo *) _dex_dbus_ping_pong_property_info_pointers[prop_id - 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 && | |
| info->emits_changed_signal) | |
| _dex_dbus_ping_pong_schedule_emit_changed (skeleton, info, 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 | |
| dex_dbus_ping_pong_skeleton_init (DexDbusPingPongSkeleton *skeleton) | |
| { | |
| #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 | |
| skeleton->priv = dex_dbus_ping_pong_skeleton_get_instance_private (skeleton); | |
| #else | |
| skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, DEX_DBUS_TYPE_PING_PONG_SKELETON, DexDbusPingPongSkeletonPrivate); | |
| #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 * | |
| dex_dbus_ping_pong_skeleton_get_version (DexDbusPingPong *object) | |
| { | |
| DexDbusPingPongSkeleton *skeleton = DEX_DBUS_PING_PONG_SKELETON (object); | |
| const gchar *value; | |
| g_mutex_lock (&skeleton->priv->lock); | |
| value = g_marshal_value_peek_string (&(skeleton->priv->properties[0])); | |
| g_mutex_unlock (&skeleton->priv->lock); | |
| return value; | |
| } | |
| static void | |
| dex_dbus_ping_pong_skeleton_class_init (DexDbusPingPongSkeletonClass *klass) | |
| { | |
| GObjectClass *gobject_class; | |
| GDBusInterfaceSkeletonClass *skeleton_class; | |
| gobject_class = G_OBJECT_CLASS (klass); | |
| gobject_class->finalize = dex_dbus_ping_pong_skeleton_finalize; | |
| gobject_class->get_property = dex_dbus_ping_pong_skeleton_get_property; | |
| gobject_class->set_property = dex_dbus_ping_pong_skeleton_set_property; | |
| gobject_class->notify = dex_dbus_ping_pong_skeleton_notify; | |
| dex_dbus_ping_pong_override_properties (gobject_class, 1); | |
| skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); | |
| skeleton_class->get_info = dex_dbus_ping_pong_skeleton_dbus_interface_get_info; | |
| skeleton_class->get_properties = dex_dbus_ping_pong_skeleton_dbus_interface_get_properties; | |
| skeleton_class->flush = dex_dbus_ping_pong_skeleton_dbus_interface_flush; | |
| skeleton_class->get_vtable = dex_dbus_ping_pong_skeleton_dbus_interface_get_vtable; | |
| #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 | |
| g_type_class_add_private (klass, sizeof (DexDbusPingPongSkeletonPrivate)); | |
| #endif | |
| } | |
| static void | |
| dex_dbus_ping_pong_skeleton_iface_init (DexDbusPingPongIface *iface) | |
| { | |
| iface->reloading = _dex_dbus_ping_pong_on_signal_reloading; | |
| iface->get_version = dex_dbus_ping_pong_skeleton_get_version; | |
| } | |
| /** | |
| * dex_dbus_ping_pong_skeleton_new: | |
| * | |
| * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-example-PingPong.top_of_page">org.example.PingPong</link>. | |
| * | |
| * Returns: (transfer full) (type DexDbusPingPongSkeleton): The skeleton object. | |
| */ | |
| DexDbusPingPong * | |
| dex_dbus_ping_pong_skeleton_new (void) | |
| { | |
| return DEX_DBUS_PING_PONG (g_object_new (DEX_DBUS_TYPE_PING_PONG_SKELETON, NULL)); | |
| } | |
| static void | |
| dex_dbus_ping_pong_proxy_new_future_cb ( | |
| GObject *object G_GNUC_UNUSED, | |
| GAsyncResult *result, | |
| gpointer user_data) | |
| { | |
| DexPromise *promise = DEX_PROMISE (user_data); | |
| DexDbusPingPong *proxy; | |
| GError *error = NULL; | |
| G_GNUC_BEGIN_IGNORE_DEPRECATIONS | |
| proxy = dex_dbus_ping_pong_proxy_new_finish (result, &error); | |
| G_GNUC_END_IGNORE_DEPRECATIONS | |
| if (proxy == NULL) | |
| dex_promise_reject (promise, error); | |
| else | |
| dex_promise_resolve_object (promise, proxy); | |
| } | |
| /** | |
| * dex_dbus_ping_pong_proxy_new_future: | |
| * @connection: A #GDBusConnection. | |
| * @flags: Flags from the #GDBusProxyFlags enumeration. | |
| * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. | |
| * @object_path: An object path. | |
| * | |
| * Returns a future which resolves to a proxy for the D-Bus interface <link linkend="gdbus-interface-org-example-PingPong.top_of_page">org.example.PingPong</link>. See g_dbus_proxy_new() for more details. | |
| * | |
| * See dex_dbus_ping_pong_proxy_new_sync() for the synchronous, blocking version of this constructor. | |
| */ | |
| DexFuture * | |
| dex_dbus_ping_pong_proxy_new_future ( | |
| GDBusConnection *connection, | |
| GDBusProxyFlags flags, | |
| const gchar *name, | |
| const gchar *object_path) | |
| { | |
| DexPromise *promise = dex_promise_new_cancellable (); | |
| G_GNUC_BEGIN_IGNORE_DEPRECATIONS | |
| dex_dbus_ping_pong_proxy_new ( | |
| connection, | |
| flags, | |
| name, | |
| object_path, | |
| dex_promise_get_cancellable (promise), | |
| dex_dbus_ping_pong_proxy_new_future_cb, | |
| dex_ref (promise)); | |
| G_GNUC_END_IGNORE_DEPRECATIONS | |
| return DEX_FUTURE (promise); | |
| } | |
| DexDbusPingPongPingResult * | |
| dex_dbus_ping_pong_ping_result_copy (DexDbusPingPongPingResult *r) | |
| { | |
| DexDbusPingPongPingResult *n = g_new0 (DexDbusPingPongPingResult, 1); | |
| n->pong = r->pong ? g_strdup (r->pong) : NULL; | |
| return n; | |
| } | |
| void | |
| dex_dbus_ping_pong_ping_result_free (DexDbusPingPongPingResult *r) | |
| { | |
| g_free (r->pong); | |
| free (r); | |
| } | |
| G_DEFINE_BOXED_TYPE ( | |
| DexDbusPingPongPingResult, | |
| dex_dbus_ping_pong_ping_result, | |
| dex_dbus_ping_pong_ping_result_copy, | |
| dex_dbus_ping_pong_ping_result_free) | |
| static void | |
| dex_dbus_ping_pong_call_ping_future_cb ( | |
| GObject *object, | |
| GAsyncResult *result, | |
| gpointer user_data) | |
| { | |
| DexPromise *promise = DEX_PROMISE (user_data); | |
| GError *error = NULL; | |
| DexDbusPingPongPingResult *r; | |
| gchar * arg_pong; | |
| G_GNUC_BEGIN_IGNORE_DEPRECATIONS | |
| gboolean success = dex_dbus_ping_pong_call_ping_finish ( | |
| DEX_DBUS_PING_PONG (object), | |
| &arg_pong, | |
| result, | |
| &error); | |
| G_GNUC_END_IGNORE_DEPRECATIONS | |
| if (!success) | |
| return dex_promise_reject (promise, error); | |
| r = g_new0 (DexDbusPingPongPingResult, 1); | |
| r->pong = arg_pong; | |
| dex_promise_resolve_boxed ( | |
| promise, | |
| DEX_DBUS_TYPE_PING_PONG_PING_RESULT, | |
| r); | |
| } | |
| /** | |
| * dex_dbus_ping_pong_call_ping_future: | |
| * @proxy: A #DexDbusPingPongProxy. | |
| * @arg_name: Argument to pass with the method invocation. | |
| * | |
| * Invokes the <link linkend="gdbus-method-org-example-PingPong.Ping">Ping()</link> D-Bus method on @proxy and returns a future representing the invocation. | |
| * | |
| * The future resolves to the boxed #DexDbusPingPongPingResult on success. | |
| * | |
| * Returns: (transfer full): The future | |
| * | |
| * See dex_dbus_ping_pong_call_ping_sync() for the synchronous, blocking version of this method. | |
| */ | |
| DexFuture * | |
| dex_dbus_ping_pong_call_ping_future ( | |
| DexDbusPingPong *proxy, | |
| const gchar *arg_name) | |
| { | |
| DexPromise *promise = dex_promise_new_cancellable (); | |
| G_GNUC_BEGIN_IGNORE_DEPRECATIONS | |
| dex_dbus_ping_pong_call_ping ( | |
| proxy, | |
| arg_name, | |
| dex_promise_get_cancellable (promise), | |
| dex_dbus_ping_pong_call_ping_future_cb, | |
| dex_ref (promise)); | |
| G_GNUC_END_IGNORE_DEPRECATIONS | |
| return DEX_FUTURE (promise); | |
| } | |
| DexDbusPingPongReloadingSignal * | |
| dex_dbus_ping_pong_reloading_signal_copy (DexDbusPingPongReloadingSignal *r) | |
| { | |
| DexDbusPingPongReloadingSignal *n = g_new0 (DexDbusPingPongReloadingSignal, 1); | |
| n->active = r->active; | |
| n->options = r->options ? g_variant_ref (r->options) : NULL; | |
| return n; | |
| } | |
| void | |
| dex_dbus_ping_pong_reloading_signal_free (DexDbusPingPongReloadingSignal *r) | |
| { | |
| g_variant_unref (r->options); | |
| free (r); | |
| } | |
| G_DEFINE_BOXED_TYPE ( | |
| DexDbusPingPongReloadingSignal, | |
| dex_dbus_ping_pong_reloading_signal, | |
| dex_dbus_ping_pong_reloading_signal_copy, | |
| dex_dbus_ping_pong_reloading_signal_free) | |
| static void | |
| _dex_dbus_ping_pong_wait_reloading_signalled_cb ( | |
| DexDbusPingPong *proxy, | |
| gboolean arg_active, | |
| GVariant *arg_options, | |
| gpointer user_data) | |
| { | |
| GDBusFutureSignalData *data = user_data; | |
| DexDbusPingPongReloadingSignal *signal = g_new0 (DexDbusPingPongReloadingSignal, 1); | |
| signal->active = arg_active; | |
| signal->options = arg_options ? g_variant_ref (arg_options) : NULL; | |
| dex_promise_resolve_boxed (data->promise, DEX_DBUS_TYPE_PING_PONG_RELOADING_SIGNAL, signal); | |
| gdbus_future_signal_data_free (data); | |
| } | |
| /** | |
| * dex_dbus_ping_pong_wait_reloading_future: | |
| * @proxy: A #DexDbusPingPongProxy. | |
| * | |
| * Waits for a org.example.PingPong::reloading() D-Bus signal on @proxy and returns a future representing the signal emission. | |
| * | |
| * The future resolves to the boxed #DexDbusPingPongReloadingSignal on success. | |
| * | |
| * Returns: (transfer full): The future | |
| */ | |
| DexFuture * | |
| dex_dbus_ping_pong_wait_reloading_future (DexDbusPingPong *proxy){ | |
| GDBusFutureSignalData *data = g_new0 (GDBusFutureSignalData, 1); | |
| data->proxy = G_DBUS_PROXY (g_object_ref (proxy)); | |
| data->promise = dex_promise_new_cancellable (); | |
| data->cancelled_handler_id = | |
| g_cancellable_connect (dex_promise_get_cancellable (data->promise), | |
| G_CALLBACK (gdbus_future_signal_cancelled_cb), | |
| data, NULL); | |
| data->signalled_handler_id = | |
| g_signal_connect (proxy, "reloading", | |
| G_CALLBACK (_dex_dbus_ping_pong_wait_reloading_signalled_cb), | |
| data); | |
| return DEX_FUTURE (dex_ref (data->promise)); | |
| } | |
| G_DEFINE_FINAL_TYPE (DexDbusPingPongSignalMonitor, | |
| dex_dbus_ping_pong_signal_monitor, | |
| G_TYPE_OBJECT) | |
| static void | |
| dex_dbus_ping_pong_signal_monitor_reloading_cb ( | |
| DexDbusPingPongSignalMonitor *self, | |
| gboolean arg_active, | |
| GVariant *arg_options, | |
| DexDbusPingPong *object) | |
| { | |
| g_autoptr(DexDbusPingPongReloadingSignal) signal = NULL; | |
| g_autoptr(DexFuture) future = NULL; | |
| if (self->reloading_channel == NULL || !dex_channel_can_send (self->reloading_channel)) | |
| return; | |
| signal = g_new0 (DexDbusPingPongReloadingSignal, 1); | |
| signal->active = arg_active; | |
| signal->options = arg_options ? g_variant_ref (arg_options) : NULL; | |
| future = dex_future_new_take_boxed (DEX_DBUS_TYPE_PING_PONG_RELOADING_SIGNAL, | |
| g_steal_pointer (&signal)); | |
| dex_future_disown (dex_channel_send (self->reloading_channel, g_steal_pointer (&future))); | |
| } | |
| static void | |
| dex_dbus_ping_pong_signal_monitor_finalize (GObject *object) | |
| { | |
| DexDbusPingPongSignalMonitor *self = DEX_DBUS_PING_PONG_SIGNAL_MONITOR (object); | |
| g_clear_signal_handler (&self->reloading_signal_id, self->object); | |
| if (self->reloading_channel) | |
| dex_channel_close_send (self->reloading_channel); | |
| dex_clear (&self->reloading_channel); | |
| g_clear_object (&self->object); | |
| G_OBJECT_CLASS (dex_dbus_ping_pong_signal_monitor_parent_class)->finalize (object); | |
| } | |
| static void | |
| dex_dbus_ping_pong_signal_monitor_class_init (DexDbusPingPongSignalMonitorClass *klass) | |
| { | |
| GObjectClass *object_class = G_OBJECT_CLASS (klass); | |
| object_class->finalize = dex_dbus_ping_pong_signal_monitor_finalize; | |
| } | |
| static void | |
| dex_dbus_ping_pong_signal_monitor_init (DexDbusPingPongSignalMonitor *self) | |
| { | |
| } | |
| DexDbusPingPongSignalMonitor * | |
| dex_dbus_ping_pong_signal_monitor_new ( | |
| DexDbusPingPong *object, | |
| DexDbusPingPongSignals signals) | |
| { | |
| g_autoptr(DexDbusPingPongSignalMonitor) self = NULL; | |
| self = g_object_new (DEX_DBUS_TYPE_PING_PONG_SIGNAL_MONITOR, NULL); | |
| g_set_object (&self->object, object); | |
| if (signals & DEX_DBUS_PING_PONG_SIGNAL_RELOADING) | |
| { | |
| self->reloading_channel = dex_channel_new (0); | |
| self->reloading_signal_id = | |
| g_signal_connect_object (self->object, | |
| "reloading", | |
| G_CALLBACK (dex_dbus_ping_pong_signal_monitor_reloading_cb), | |
| self, | |
| G_CONNECT_SWAPPED); | |
| } | |
| return g_steal_pointer (&self); | |
| } | |
| void | |
| dex_dbus_ping_pong_signal_monitor_cancel (DexDbusPingPongSignalMonitor *self) | |
| { | |
| g_return_if_fail (DEX_DBUS_IS_PING_PONG_SIGNAL_MONITOR (self)); | |
| g_clear_signal_handler (&self->reloading_signal_id, self->object); | |
| if (self->reloading_channel) | |
| dex_channel_close_send (self->reloading_channel); | |
| g_clear_object (&self->object); | |
| } | |
| DexFuture * | |
| dex_dbus_ping_pong_signal_monitor_next_reloading (DexDbusPingPongSignalMonitor *self) | |
| { | |
| g_return_val_if_fail (DEX_DBUS_IS_PING_PONG_SIGNAL_MONITOR (self), NULL); | |
| if (self->reloading_channel != NULL) | |
| return dex_channel_receive (self->reloading_channel); | |
| return dex_future_new_reject (G_IO_ERROR, | |
| G_IO_ERROR_CANCELLED, | |
| "Monitoring cancelled"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * This file is generated by gdbus-codegen, do not modify it. | |
| * | |
| * The license of this code is the same as for the D-Bus interface description | |
| * it was derived from. Note that it links to GLib, so must comply with the | |
| * LGPL linking clauses. | |
| */ | |
| #ifndef __DEX_DBUS_PING_PONG_H__ | |
| #define __DEX_DBUS_PING_PONG_H__ | |
| #include <gio/gio.h> | |
| #include <libdex.h> | |
| G_BEGIN_DECLS | |
| /* ------------------------------------------------------------------------ */ | |
| /* Declarations for org.example.PingPong */ | |
| #define DEX_DBUS_TYPE_PING_PONG (dex_dbus_ping_pong_get_type ()) | |
| #define DEX_DBUS_PING_PONG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DEX_DBUS_TYPE_PING_PONG, DexDbusPingPong)) | |
| #define DEX_DBUS_IS_PING_PONG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), DEX_DBUS_TYPE_PING_PONG)) | |
| #define DEX_DBUS_PING_PONG_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), DEX_DBUS_TYPE_PING_PONG, DexDbusPingPongIface)) | |
| struct _DexDbusPingPong; | |
| typedef struct _DexDbusPingPong DexDbusPingPong; | |
| typedef struct _DexDbusPingPongIface DexDbusPingPongIface; | |
| struct _DexDbusPingPongIface | |
| { | |
| GTypeInterface parent_iface; | |
| gboolean (*handle_ping) ( | |
| DexDbusPingPong *object, | |
| GDBusMethodInvocation *invocation, | |
| const gchar *arg_name); | |
| const gchar * (*get_version) (DexDbusPingPong *object); | |
| void (*reloading) ( | |
| DexDbusPingPong *object, | |
| gboolean arg_active, | |
| GVariant *arg_options); | |
| }; | |
| #if GLIB_CHECK_VERSION(2, 44, 0) | |
| G_DEFINE_AUTOPTR_CLEANUP_FUNC (DexDbusPingPong, g_object_unref) | |
| #endif | |
| GType dex_dbus_ping_pong_get_type (void) G_GNUC_CONST; | |
| GDBusInterfaceInfo *dex_dbus_ping_pong_interface_info (void); | |
| guint dex_dbus_ping_pong_override_properties (GObjectClass *klass, guint property_id_begin); | |
| /* D-Bus method call completion functions: */ | |
| void dex_dbus_ping_pong_complete_ping ( | |
| DexDbusPingPong *object, | |
| GDBusMethodInvocation *invocation, | |
| const gchar *pong); | |
| /* D-Bus signal emissions functions: */ | |
| void dex_dbus_ping_pong_emit_reloading ( | |
| DexDbusPingPong *object, | |
| gboolean arg_active, | |
| GVariant *arg_options); | |
| /* D-Bus method calls: */ | |
| void dex_dbus_ping_pong_call_ping ( | |
| DexDbusPingPong *proxy, | |
| const gchar *arg_name, | |
| GCancellable *cancellable, | |
| GAsyncReadyCallback callback, | |
| gpointer user_data); | |
| gboolean dex_dbus_ping_pong_call_ping_finish ( | |
| DexDbusPingPong *proxy, | |
| gchar ** out_pong, | |
| GAsyncResult *res, | |
| GError **error); | |
| gboolean dex_dbus_ping_pong_call_ping_sync ( | |
| DexDbusPingPong *proxy, | |
| const gchar *arg_name, | |
| gchar ** out_pong, | |
| GCancellable *cancellable, | |
| GError **error); | |
| /* D-Bus property accessors: */ | |
| const gchar *dex_dbus_ping_pong_get_version (DexDbusPingPong *object); | |
| gchar *dex_dbus_ping_pong_dup_version (DexDbusPingPong *object); | |
| void dex_dbus_ping_pong_set_version (DexDbusPingPong *object, const gchar *value); | |
| /* ---- */ | |
| #define DEX_DBUS_TYPE_PING_PONG_PROXY (dex_dbus_ping_pong_proxy_get_type ()) | |
| #define DEX_DBUS_PING_PONG_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DEX_DBUS_TYPE_PING_PONG_PROXY, DexDbusPingPongProxy)) | |
| #define DEX_DBUS_PING_PONG_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), DEX_DBUS_TYPE_PING_PONG_PROXY, DexDbusPingPongProxyClass)) | |
| #define DEX_DBUS_PING_PONG_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), DEX_DBUS_TYPE_PING_PONG_PROXY, DexDbusPingPongProxyClass)) | |
| #define DEX_DBUS_IS_PING_PONG_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), DEX_DBUS_TYPE_PING_PONG_PROXY)) | |
| #define DEX_DBUS_IS_PING_PONG_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), DEX_DBUS_TYPE_PING_PONG_PROXY)) | |
| typedef struct _DexDbusPingPongProxy DexDbusPingPongProxy; | |
| typedef struct _DexDbusPingPongProxyClass DexDbusPingPongProxyClass; | |
| typedef struct _DexDbusPingPongProxyPrivate DexDbusPingPongProxyPrivate; | |
| struct _DexDbusPingPongProxy | |
| { | |
| /*< private >*/ | |
| GDBusProxy parent_instance; | |
| DexDbusPingPongProxyPrivate *priv; | |
| }; | |
| struct _DexDbusPingPongProxyClass | |
| { | |
| GDBusProxyClass parent_class; | |
| }; | |
| GType dex_dbus_ping_pong_proxy_get_type (void) G_GNUC_CONST; | |
| #if GLIB_CHECK_VERSION(2, 44, 0) | |
| G_DEFINE_AUTOPTR_CLEANUP_FUNC (DexDbusPingPongProxy, g_object_unref) | |
| #endif | |
| void dex_dbus_ping_pong_proxy_new ( | |
| GDBusConnection *connection, | |
| GDBusProxyFlags flags, | |
| const gchar *name, | |
| const gchar *object_path, | |
| GCancellable *cancellable, | |
| GAsyncReadyCallback callback, | |
| gpointer user_data); | |
| DexDbusPingPong *dex_dbus_ping_pong_proxy_new_finish ( | |
| GAsyncResult *res, | |
| GError **error); | |
| DexDbusPingPong *dex_dbus_ping_pong_proxy_new_sync ( | |
| GDBusConnection *connection, | |
| GDBusProxyFlags flags, | |
| const gchar *name, | |
| const gchar *object_path, | |
| GCancellable *cancellable, | |
| GError **error); | |
| void dex_dbus_ping_pong_proxy_new_for_bus ( | |
| GBusType bus_type, | |
| GDBusProxyFlags flags, | |
| const gchar *name, | |
| const gchar *object_path, | |
| GCancellable *cancellable, | |
| GAsyncReadyCallback callback, | |
| gpointer user_data); | |
| DexDbusPingPong *dex_dbus_ping_pong_proxy_new_for_bus_finish ( | |
| GAsyncResult *res, | |
| GError **error); | |
| DexDbusPingPong *dex_dbus_ping_pong_proxy_new_for_bus_sync ( | |
| GBusType bus_type, | |
| GDBusProxyFlags flags, | |
| const gchar *name, | |
| const gchar *object_path, | |
| GCancellable *cancellable, | |
| GError **error); | |
| /* ---- */ | |
| #define DEX_DBUS_TYPE_PING_PONG_SKELETON (dex_dbus_ping_pong_skeleton_get_type ()) | |
| #define DEX_DBUS_PING_PONG_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DEX_DBUS_TYPE_PING_PONG_SKELETON, DexDbusPingPongSkeleton)) | |
| #define DEX_DBUS_PING_PONG_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), DEX_DBUS_TYPE_PING_PONG_SKELETON, DexDbusPingPongSkeletonClass)) | |
| #define DEX_DBUS_PING_PONG_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), DEX_DBUS_TYPE_PING_PONG_SKELETON, DexDbusPingPongSkeletonClass)) | |
| #define DEX_DBUS_IS_PING_PONG_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), DEX_DBUS_TYPE_PING_PONG_SKELETON)) | |
| #define DEX_DBUS_IS_PING_PONG_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), DEX_DBUS_TYPE_PING_PONG_SKELETON)) | |
| typedef struct _DexDbusPingPongSkeleton DexDbusPingPongSkeleton; | |
| typedef struct _DexDbusPingPongSkeletonClass DexDbusPingPongSkeletonClass; | |
| typedef struct _DexDbusPingPongSkeletonPrivate DexDbusPingPongSkeletonPrivate; | |
| struct _DexDbusPingPongSkeleton | |
| { | |
| /*< private >*/ | |
| DexDBusInterfaceSkeleton parent_instance; | |
| DexDbusPingPongSkeletonPrivate *priv; | |
| }; | |
| struct _DexDbusPingPongSkeletonClass | |
| { | |
| DexDBusInterfaceSkeletonClass parent_class; | |
| }; | |
| GType dex_dbus_ping_pong_skeleton_get_type (void) G_GNUC_CONST; | |
| #if GLIB_CHECK_VERSION(2, 44, 0) | |
| G_DEFINE_AUTOPTR_CLEANUP_FUNC (DexDbusPingPongSkeleton, g_object_unref) | |
| #endif | |
| DexDbusPingPong *dex_dbus_ping_pong_skeleton_new (void); | |
| DexFuture * dex_dbus_ping_pong_proxy_new_future ( | |
| GDBusConnection *connection, | |
| GDBusProxyFlags flags, | |
| const gchar *name, | |
| const gchar *object_path); | |
| typedef struct _DexDbusPingPongPingResult | |
| { | |
| gchar * pong; | |
| } DexDbusPingPongPingResult; | |
| #define DEX_DBUS_TYPE_PING_PONG_PING_RESULT (dex_dbus_ping_pong_ping_result_get_type ()) | |
| GType dex_dbus_ping_pong_ping_result_get_type (void) G_GNUC_CONST; | |
| DexDbusPingPongPingResult * dex_dbus_ping_pong_ping_result_copy (DexDbusPingPongPingResult *result); | |
| void dex_dbus_ping_pong_ping_result_free (DexDbusPingPongPingResult *result); | |
| G_DEFINE_AUTOPTR_CLEANUP_FUNC (DexDbusPingPongPingResult, dex_dbus_ping_pong_ping_result_free) | |
| DexFuture * dex_dbus_ping_pong_call_ping_future ( | |
| DexDbusPingPong *proxy, | |
| const gchar *arg_name); | |
| typedef struct _DexDbusPingPongReloadingSignal | |
| { | |
| gboolean active; | |
| GVariant * options; | |
| } DexDbusPingPongReloadingSignal; | |
| #define DEX_DBUS_TYPE_PING_PONG_RELOADING_SIGNAL (dex_dbus_ping_pong_reloading_signal_get_type ()) | |
| GType dex_dbus_ping_pong_reloading_signal_get_type (void) G_GNUC_CONST; | |
| DexDbusPingPongReloadingSignal * dex_dbus_ping_pong_reloading_signal_copy (DexDbusPingPongReloadingSignal *signal); | |
| void dex_dbus_ping_pong_reloading_signal_free (DexDbusPingPongReloadingSignal *signal); | |
| #if GLIB_CHECK_VERSION(2, 44, 0) | |
| G_DEFINE_AUTOPTR_CLEANUP_FUNC (DexDbusPingPongReloadingSignal, dex_dbus_ping_pong_reloading_signal_free) | |
| #endif | |
| DexFuture * dex_dbus_ping_pong_wait_reloading_future (DexDbusPingPong *proxy); | |
| typedef enum _DexDbusPingPongSignals | |
| { | |
| DEX_DBUS_PING_PONG_SIGNAL_RELOADING = (1 << 0), | |
| } DexDbusPingPongSignals; | |
| struct _DexDbusPingPongSignalMonitor | |
| { | |
| GObject parent_instance; | |
| DexDbusPingPong *object; | |
| DexChannel *reloading_channel; | |
| gulong reloading_signal_id; | |
| }; | |
| #define DEX_DBUS_TYPE_PING_PONG_SIGNAL_MONITOR (dex_dbus_ping_pong_signal_monitor_get_type()) | |
| G_DECLARE_FINAL_TYPE (DexDbusPingPongSignalMonitor, | |
| dex_dbus_ping_pong_signal_monitor, | |
| DEX_DBUS, PING_PONG_SIGNAL_MONITOR, | |
| GObject) | |
| DexDbusPingPongSignalMonitor * | |
| dex_dbus_ping_pong_signal_monitor_new ( | |
| DexDbusPingPong *object, | |
| DexDbusPingPongSignals signals); | |
| void | |
| dex_dbus_ping_pong_signal_monitor_cancel (DexDbusPingPongSignalMonitor *self); | |
| DexFuture * | |
| dex_dbus_ping_pong_signal_monitor_next_reloading (DexDbusPingPongSignalMonitor *self); | |
| G_END_DECLS | |
| #endif /* __DEX_DBUS_PING_PONG_H__ */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment