2 * Generated by gdbus-codegen 2.52.0. DO NOT EDIT.
4 * The license of this code is the same as for the source it was derived from.
11 #include "lightmediascanner_interface.h"
15 # include <gio/gunixfdlist.h>
20 GDBusArgInfo parent_struct;
21 gboolean use_gvariant;
22 } _ExtendedGDBusArgInfo;
26 GDBusMethodInfo parent_struct;
27 const gchar *signal_name;
29 } _ExtendedGDBusMethodInfo;
33 GDBusSignalInfo parent_struct;
34 const gchar *signal_name;
35 } _ExtendedGDBusSignalInfo;
39 GDBusPropertyInfo parent_struct;
40 const gchar *hyphen_name;
41 gboolean use_gvariant;
42 } _ExtendedGDBusPropertyInfo;
46 GDBusInterfaceInfo parent_struct;
47 const gchar *hyphen_name;
48 } _ExtendedGDBusInterfaceInfo;
52 const _ExtendedGDBusPropertyInfo *info;
54 GValue orig_value; /* the value before the change */
58 _changed_property_free (ChangedProperty *data)
60 g_value_unset (&data->orig_value);
65 _g_strv_equal0 (gchar **a, gchar **b)
69 if (a == NULL && b == NULL)
74 if (a == NULL || b == NULL)
76 if (g_strv_length (a) != g_strv_length (b))
78 for (n = 0; a[n] != NULL; n++)
79 if (g_strcmp0 (a[n], b[n]) != 0)
87 _g_variant_equal0 (GVariant *a, GVariant *b)
90 if (a == NULL && b == NULL)
95 if (a == NULL || b == NULL)
97 ret = g_variant_equal (a, b);
102 G_GNUC_UNUSED static gboolean
103 _g_value_equal (const GValue *a, const GValue *b)
105 gboolean ret = FALSE;
106 g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
107 switch (G_VALUE_TYPE (a))
110 ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
113 ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
116 ret = (g_value_get_int (a) == g_value_get_int (b));
119 ret = (g_value_get_uint (a) == g_value_get_uint (b));
122 ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
125 ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
129 /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
130 gdouble da = g_value_get_double (a);
131 gdouble db = g_value_get_double (b);
132 ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
136 ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
139 ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
142 if (G_VALUE_TYPE (a) == G_TYPE_STRV)
143 ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
145 g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
151 /* ------------------------------------------------------------------------
152 * Code for interface org.freedesktop.DBus.Properties
153 * ------------------------------------------------------------------------
157 * SECTION:OrgFreedesktopDBusProperties
158 * @title: OrgFreedesktopDBusProperties
159 * @short_description: Generated C code for the org.freedesktop.DBus.Properties D-Bus interface
161 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link> D-Bus interface in C.
164 /* ---- Introspection data for org.freedesktop.DBus.Properties ---- */
166 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_get_IN_ARG_interface_name =
170 (gchar *) "interface_name",
177 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_get_IN_ARG_property_name =
181 (gchar *) "property_name",
188 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_method_info_get_IN_ARG_pointers[] =
190 &_org_freedesktop_dbus_properties_method_info_get_IN_ARG_interface_name,
191 &_org_freedesktop_dbus_properties_method_info_get_IN_ARG_property_name,
195 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_get_OUT_ARG_value =
206 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_method_info_get_OUT_ARG_pointers[] =
208 &_org_freedesktop_dbus_properties_method_info_get_OUT_ARG_value,
212 static const _ExtendedGDBusMethodInfo _org_freedesktop_dbus_properties_method_info_get =
217 (GDBusArgInfo **) &_org_freedesktop_dbus_properties_method_info_get_IN_ARG_pointers,
218 (GDBusArgInfo **) &_org_freedesktop_dbus_properties_method_info_get_OUT_ARG_pointers,
225 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_get_all_IN_ARG_interface_name =
229 (gchar *) "interface_name",
236 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_method_info_get_all_IN_ARG_pointers[] =
238 &_org_freedesktop_dbus_properties_method_info_get_all_IN_ARG_interface_name,
242 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_get_all_OUT_ARG_properties =
246 (gchar *) "properties",
253 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_method_info_get_all_OUT_ARG_pointers[] =
255 &_org_freedesktop_dbus_properties_method_info_get_all_OUT_ARG_properties,
259 static const _ExtendedGDBusMethodInfo _org_freedesktop_dbus_properties_method_info_get_all =
264 (GDBusArgInfo **) &_org_freedesktop_dbus_properties_method_info_get_all_IN_ARG_pointers,
265 (GDBusArgInfo **) &_org_freedesktop_dbus_properties_method_info_get_all_OUT_ARG_pointers,
272 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_set_IN_ARG_interface_name =
276 (gchar *) "interface_name",
283 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_set_IN_ARG_property_name =
287 (gchar *) "property_name",
294 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_set_IN_ARG_value =
305 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_method_info_set_IN_ARG_pointers[] =
307 &_org_freedesktop_dbus_properties_method_info_set_IN_ARG_interface_name,
308 &_org_freedesktop_dbus_properties_method_info_set_IN_ARG_property_name,
309 &_org_freedesktop_dbus_properties_method_info_set_IN_ARG_value,
313 static const _ExtendedGDBusMethodInfo _org_freedesktop_dbus_properties_method_info_set =
318 (GDBusArgInfo **) &_org_freedesktop_dbus_properties_method_info_set_IN_ARG_pointers,
326 static const _ExtendedGDBusMethodInfo * const _org_freedesktop_dbus_properties_method_info_pointers[] =
328 &_org_freedesktop_dbus_properties_method_info_get,
329 &_org_freedesktop_dbus_properties_method_info_get_all,
330 &_org_freedesktop_dbus_properties_method_info_set,
334 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_interface_name =
338 (gchar *) "interface_name",
345 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_changed_properties =
349 (gchar *) "changed_properties",
356 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_invalidated_properties =
360 (gchar *) "invalidated_properties",
367 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_pointers[] =
369 &_org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_interface_name,
370 &_org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_changed_properties,
371 &_org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_invalidated_properties,
375 static const _ExtendedGDBusSignalInfo _org_freedesktop_dbus_properties_signal_info_properties_changed =
379 (gchar *) "PropertiesChanged",
380 (GDBusArgInfo **) &_org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_pointers,
386 static const _ExtendedGDBusSignalInfo * const _org_freedesktop_dbus_properties_signal_info_pointers[] =
388 &_org_freedesktop_dbus_properties_signal_info_properties_changed,
392 static const _ExtendedGDBusInterfaceInfo _org_freedesktop_dbus_properties_interface_info =
396 (gchar *) "org.freedesktop.DBus.Properties",
397 (GDBusMethodInfo **) &_org_freedesktop_dbus_properties_method_info_pointers,
398 (GDBusSignalInfo **) &_org_freedesktop_dbus_properties_signal_info_pointers,
402 "org-freedesktop-dbus-properties",
407 * org_freedesktop_dbus_properties_interface_info:
409 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link> D-Bus interface.
411 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
414 org_freedesktop_dbus_properties_interface_info (void)
416 return (GDBusInterfaceInfo *) &_org_freedesktop_dbus_properties_interface_info.parent_struct;
420 * org_freedesktop_dbus_properties_override_properties:
421 * @klass: The class structure for a #GObject<!-- -->-derived class.
422 * @property_id_begin: The property id to assign to the first overridden property.
424 * Overrides all #GObject properties in the #OrgFreedesktopDBusProperties interface for a concrete class.
425 * The properties are overridden in the order they are defined.
427 * Returns: The last property id.
430 org_freedesktop_dbus_properties_override_properties (GObjectClass *klass, guint property_id_begin)
432 return property_id_begin - 1;
438 * OrgFreedesktopDBusProperties:
440 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>.
444 * OrgFreedesktopDBusPropertiesIface:
445 * @parent_iface: The parent interface.
446 * @handle_get: Handler for the #OrgFreedesktopDBusProperties::handle-get signal.
447 * @handle_get_all: Handler for the #OrgFreedesktopDBusProperties::handle-get-all signal.
448 * @handle_set: Handler for the #OrgFreedesktopDBusProperties::handle-set signal.
449 * @properties_changed: Handler for the #OrgFreedesktopDBusProperties::properties-changed signal.
451 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>.
454 typedef OrgFreedesktopDBusPropertiesIface OrgFreedesktopDBusPropertiesInterface;
455 G_DEFINE_INTERFACE (OrgFreedesktopDBusProperties, org_freedesktop_dbus_properties, G_TYPE_OBJECT);
458 org_freedesktop_dbus_properties_default_init (OrgFreedesktopDBusPropertiesIface *iface)
460 /* GObject signals for incoming D-Bus method calls: */
462 * OrgFreedesktopDBusProperties::handle-get:
463 * @object: A #OrgFreedesktopDBusProperties.
464 * @invocation: A #GDBusMethodInvocation.
465 * @arg_interface_name: Argument passed by remote caller.
466 * @arg_property_name: Argument passed by remote caller.
468 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Get">Get()</link> D-Bus method.
470 * 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 org_freedesktop_dbus_properties_complete_get() 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.
472 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
474 g_signal_new ("handle-get",
475 G_TYPE_FROM_INTERFACE (iface),
477 G_STRUCT_OFFSET (OrgFreedesktopDBusPropertiesIface, handle_get),
478 g_signal_accumulator_true_handled,
480 g_cclosure_marshal_generic,
483 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING);
486 * OrgFreedesktopDBusProperties::handle-get-all:
487 * @object: A #OrgFreedesktopDBusProperties.
488 * @invocation: A #GDBusMethodInvocation.
489 * @arg_interface_name: Argument passed by remote caller.
491 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.GetAll">GetAll()</link> D-Bus method.
493 * 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 org_freedesktop_dbus_properties_complete_get_all() 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.
495 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
497 g_signal_new ("handle-get-all",
498 G_TYPE_FROM_INTERFACE (iface),
500 G_STRUCT_OFFSET (OrgFreedesktopDBusPropertiesIface, handle_get_all),
501 g_signal_accumulator_true_handled,
503 g_cclosure_marshal_generic,
506 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
509 * OrgFreedesktopDBusProperties::handle-set:
510 * @object: A #OrgFreedesktopDBusProperties.
511 * @invocation: A #GDBusMethodInvocation.
512 * @arg_interface_name: Argument passed by remote caller.
513 * @arg_property_name: Argument passed by remote caller.
514 * @arg_value: Argument passed by remote caller.
516 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Set">Set()</link> D-Bus method.
518 * 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 org_freedesktop_dbus_properties_complete_set() 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.
520 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
522 g_signal_new ("handle-set",
523 G_TYPE_FROM_INTERFACE (iface),
525 G_STRUCT_OFFSET (OrgFreedesktopDBusPropertiesIface, handle_set),
526 g_signal_accumulator_true_handled,
528 g_cclosure_marshal_generic,
531 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT);
533 /* GObject signals for received D-Bus signals: */
535 * OrgFreedesktopDBusProperties::properties-changed:
536 * @object: A #OrgFreedesktopDBusProperties.
537 * @arg_interface_name: Argument.
538 * @arg_changed_properties: Argument.
539 * @arg_invalidated_properties: Argument.
541 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-DBus-Properties.PropertiesChanged">"PropertiesChanged"</link> is received.
543 * 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.
545 g_signal_new ("properties-changed",
546 G_TYPE_FROM_INTERFACE (iface),
548 G_STRUCT_OFFSET (OrgFreedesktopDBusPropertiesIface, properties_changed),
551 g_cclosure_marshal_generic,
553 3, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_STRV);
558 * org_freedesktop_dbus_properties_emit_properties_changed:
559 * @object: A #OrgFreedesktopDBusProperties.
560 * @arg_interface_name: Argument to pass with the signal.
561 * @arg_changed_properties: Argument to pass with the signal.
562 * @arg_invalidated_properties: Argument to pass with the signal.
564 * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus-Properties.PropertiesChanged">"PropertiesChanged"</link> D-Bus signal.
567 org_freedesktop_dbus_properties_emit_properties_changed (
568 OrgFreedesktopDBusProperties *object,
569 const gchar *arg_interface_name,
570 GVariant *arg_changed_properties,
571 const gchar *const *arg_invalidated_properties)
573 g_signal_emit_by_name (object, "properties-changed", arg_interface_name, arg_changed_properties, arg_invalidated_properties);
577 * org_freedesktop_dbus_properties_call_get:
578 * @proxy: A #OrgFreedesktopDBusPropertiesProxy.
579 * @arg_interface_name: Argument to pass with the method invocation.
580 * @arg_property_name: Argument to pass with the method invocation.
581 * @cancellable: (allow-none): A #GCancellable or %NULL.
582 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
583 * @user_data: User data to pass to @callback.
585 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Get">Get()</link> D-Bus method on @proxy.
586 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
587 * You can then call org_freedesktop_dbus_properties_call_get_finish() to get the result of the operation.
589 * See org_freedesktop_dbus_properties_call_get_sync() for the synchronous, blocking version of this method.
592 org_freedesktop_dbus_properties_call_get (
593 OrgFreedesktopDBusProperties *proxy,
594 const gchar *arg_interface_name,
595 const gchar *arg_property_name,
596 GCancellable *cancellable,
597 GAsyncReadyCallback callback,
600 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
602 g_variant_new ("(ss)",
605 G_DBUS_CALL_FLAGS_NONE,
613 * org_freedesktop_dbus_properties_call_get_finish:
614 * @proxy: A #OrgFreedesktopDBusPropertiesProxy.
615 * @out_value: (out): Return location for return parameter or %NULL to ignore.
616 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_properties_call_get().
617 * @error: Return location for error or %NULL.
619 * Finishes an operation started with org_freedesktop_dbus_properties_call_get().
621 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
624 org_freedesktop_dbus_properties_call_get_finish (
625 OrgFreedesktopDBusProperties *proxy,
626 GVariant **out_value,
631 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
637 g_variant_unref (_ret);
643 * org_freedesktop_dbus_properties_call_get_sync:
644 * @proxy: A #OrgFreedesktopDBusPropertiesProxy.
645 * @arg_interface_name: Argument to pass with the method invocation.
646 * @arg_property_name: Argument to pass with the method invocation.
647 * @out_value: (out): Return location for return parameter or %NULL to ignore.
648 * @cancellable: (allow-none): A #GCancellable or %NULL.
649 * @error: Return location for error or %NULL.
651 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Get">Get()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
653 * See org_freedesktop_dbus_properties_call_get() for the asynchronous version of this method.
655 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
658 org_freedesktop_dbus_properties_call_get_sync (
659 OrgFreedesktopDBusProperties *proxy,
660 const gchar *arg_interface_name,
661 const gchar *arg_property_name,
662 GVariant **out_value,
663 GCancellable *cancellable,
667 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
669 g_variant_new ("(ss)",
672 G_DBUS_CALL_FLAGS_NONE,
681 g_variant_unref (_ret);
687 * org_freedesktop_dbus_properties_call_get_all:
688 * @proxy: A #OrgFreedesktopDBusPropertiesProxy.
689 * @arg_interface_name: Argument to pass with the method invocation.
690 * @cancellable: (allow-none): A #GCancellable or %NULL.
691 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
692 * @user_data: User data to pass to @callback.
694 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.GetAll">GetAll()</link> D-Bus method on @proxy.
695 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
696 * You can then call org_freedesktop_dbus_properties_call_get_all_finish() to get the result of the operation.
698 * See org_freedesktop_dbus_properties_call_get_all_sync() for the synchronous, blocking version of this method.
701 org_freedesktop_dbus_properties_call_get_all (
702 OrgFreedesktopDBusProperties *proxy,
703 const gchar *arg_interface_name,
704 GCancellable *cancellable,
705 GAsyncReadyCallback callback,
708 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
710 g_variant_new ("(s)",
712 G_DBUS_CALL_FLAGS_NONE,
720 * org_freedesktop_dbus_properties_call_get_all_finish:
721 * @proxy: A #OrgFreedesktopDBusPropertiesProxy.
722 * @out_properties: (out): Return location for return parameter or %NULL to ignore.
723 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_properties_call_get_all().
724 * @error: Return location for error or %NULL.
726 * Finishes an operation started with org_freedesktop_dbus_properties_call_get_all().
728 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
731 org_freedesktop_dbus_properties_call_get_all_finish (
732 OrgFreedesktopDBusProperties *proxy,
733 GVariant **out_properties,
738 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
744 g_variant_unref (_ret);
750 * org_freedesktop_dbus_properties_call_get_all_sync:
751 * @proxy: A #OrgFreedesktopDBusPropertiesProxy.
752 * @arg_interface_name: Argument to pass with the method invocation.
753 * @out_properties: (out): Return location for return parameter or %NULL to ignore.
754 * @cancellable: (allow-none): A #GCancellable or %NULL.
755 * @error: Return location for error or %NULL.
757 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.GetAll">GetAll()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
759 * See org_freedesktop_dbus_properties_call_get_all() for the asynchronous version of this method.
761 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
764 org_freedesktop_dbus_properties_call_get_all_sync (
765 OrgFreedesktopDBusProperties *proxy,
766 const gchar *arg_interface_name,
767 GVariant **out_properties,
768 GCancellable *cancellable,
772 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
774 g_variant_new ("(s)",
776 G_DBUS_CALL_FLAGS_NONE,
785 g_variant_unref (_ret);
791 * org_freedesktop_dbus_properties_call_set:
792 * @proxy: A #OrgFreedesktopDBusPropertiesProxy.
793 * @arg_interface_name: Argument to pass with the method invocation.
794 * @arg_property_name: Argument to pass with the method invocation.
795 * @arg_value: Argument to pass with the method invocation.
796 * @cancellable: (allow-none): A #GCancellable or %NULL.
797 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
798 * @user_data: User data to pass to @callback.
800 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Set">Set()</link> D-Bus method on @proxy.
801 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
802 * You can then call org_freedesktop_dbus_properties_call_set_finish() to get the result of the operation.
804 * See org_freedesktop_dbus_properties_call_set_sync() for the synchronous, blocking version of this method.
807 org_freedesktop_dbus_properties_call_set (
808 OrgFreedesktopDBusProperties *proxy,
809 const gchar *arg_interface_name,
810 const gchar *arg_property_name,
812 GCancellable *cancellable,
813 GAsyncReadyCallback callback,
816 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
818 g_variant_new ("(ss@v)",
822 G_DBUS_CALL_FLAGS_NONE,
830 * org_freedesktop_dbus_properties_call_set_finish:
831 * @proxy: A #OrgFreedesktopDBusPropertiesProxy.
832 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_properties_call_set().
833 * @error: Return location for error or %NULL.
835 * Finishes an operation started with org_freedesktop_dbus_properties_call_set().
837 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
840 org_freedesktop_dbus_properties_call_set_finish (
841 OrgFreedesktopDBusProperties *proxy,
846 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
851 g_variant_unref (_ret);
857 * org_freedesktop_dbus_properties_call_set_sync:
858 * @proxy: A #OrgFreedesktopDBusPropertiesProxy.
859 * @arg_interface_name: Argument to pass with the method invocation.
860 * @arg_property_name: Argument to pass with the method invocation.
861 * @arg_value: Argument to pass with the method invocation.
862 * @cancellable: (allow-none): A #GCancellable or %NULL.
863 * @error: Return location for error or %NULL.
865 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Set">Set()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
867 * See org_freedesktop_dbus_properties_call_set() for the asynchronous version of this method.
869 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
872 org_freedesktop_dbus_properties_call_set_sync (
873 OrgFreedesktopDBusProperties *proxy,
874 const gchar *arg_interface_name,
875 const gchar *arg_property_name,
877 GCancellable *cancellable,
881 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
883 g_variant_new ("(ss@v)",
887 G_DBUS_CALL_FLAGS_NONE,
895 g_variant_unref (_ret);
901 * org_freedesktop_dbus_properties_complete_get:
902 * @object: A #OrgFreedesktopDBusProperties.
903 * @invocation: (transfer full): A #GDBusMethodInvocation.
904 * @value: Parameter to return.
906 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Get">Get()</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.
908 * This method will free @invocation, you cannot use it afterwards.
911 org_freedesktop_dbus_properties_complete_get (
912 OrgFreedesktopDBusProperties *object,
913 GDBusMethodInvocation *invocation,
916 g_dbus_method_invocation_return_value (invocation,
917 g_variant_new ("(@v)",
922 * org_freedesktop_dbus_properties_complete_get_all:
923 * @object: A #OrgFreedesktopDBusProperties.
924 * @invocation: (transfer full): A #GDBusMethodInvocation.
925 * @properties: Parameter to return.
927 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.GetAll">GetAll()</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.
929 * This method will free @invocation, you cannot use it afterwards.
932 org_freedesktop_dbus_properties_complete_get_all (
933 OrgFreedesktopDBusProperties *object,
934 GDBusMethodInvocation *invocation,
935 GVariant *properties)
937 g_dbus_method_invocation_return_value (invocation,
938 g_variant_new ("(@a{sv})",
943 * org_freedesktop_dbus_properties_complete_set:
944 * @object: A #OrgFreedesktopDBusProperties.
945 * @invocation: (transfer full): A #GDBusMethodInvocation.
947 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Set">Set()</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.
949 * This method will free @invocation, you cannot use it afterwards.
952 org_freedesktop_dbus_properties_complete_set (
953 OrgFreedesktopDBusProperties *object,
954 GDBusMethodInvocation *invocation)
956 g_dbus_method_invocation_return_value (invocation,
957 g_variant_new ("()"));
960 /* ------------------------------------------------------------------------ */
963 * OrgFreedesktopDBusPropertiesProxy:
965 * The #OrgFreedesktopDBusPropertiesProxy structure contains only private data and should only be accessed using the provided API.
969 * OrgFreedesktopDBusPropertiesProxyClass:
970 * @parent_class: The parent class.
972 * Class structure for #OrgFreedesktopDBusPropertiesProxy.
975 struct _OrgFreedesktopDBusPropertiesProxyPrivate
980 static void org_freedesktop_dbus_properties_proxy_iface_init (OrgFreedesktopDBusPropertiesIface *iface);
982 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
983 G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusPropertiesProxy, org_freedesktop_dbus_properties_proxy, G_TYPE_DBUS_PROXY,
984 G_ADD_PRIVATE (OrgFreedesktopDBusPropertiesProxy)
985 G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES, org_freedesktop_dbus_properties_proxy_iface_init));
988 G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusPropertiesProxy, org_freedesktop_dbus_properties_proxy, G_TYPE_DBUS_PROXY,
989 G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES, org_freedesktop_dbus_properties_proxy_iface_init));
993 org_freedesktop_dbus_properties_proxy_finalize (GObject *object)
995 OrgFreedesktopDBusPropertiesProxy *proxy = ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY (object);
996 g_datalist_clear (&proxy->priv->qdata);
997 G_OBJECT_CLASS (org_freedesktop_dbus_properties_proxy_parent_class)->finalize (object);
1001 org_freedesktop_dbus_properties_proxy_get_property (GObject *object,
1004 GParamSpec *pspec G_GNUC_UNUSED)
1009 org_freedesktop_dbus_properties_proxy_set_property (GObject *object,
1011 const GValue *value,
1012 GParamSpec *pspec G_GNUC_UNUSED)
1017 org_freedesktop_dbus_properties_proxy_g_signal (GDBusProxy *proxy,
1018 const gchar *sender_name G_GNUC_UNUSED,
1019 const gchar *signal_name,
1020 GVariant *parameters)
1022 _ExtendedGDBusSignalInfo *info;
1029 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_properties_interface_info.parent_struct, signal_name);
1032 num_params = g_variant_n_children (parameters);
1033 paramv = g_new0 (GValue, num_params + 1);
1034 g_value_init (¶mv[0], TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES);
1035 g_value_set_object (¶mv[0], proxy);
1036 g_variant_iter_init (&iter, parameters);
1038 while ((child = g_variant_iter_next_value (&iter)) != NULL)
1040 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
1041 if (arg_info->use_gvariant)
1043 g_value_init (¶mv[n], G_TYPE_VARIANT);
1044 g_value_set_variant (¶mv[n], child);
1048 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
1049 g_variant_unref (child);
1051 signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES);
1052 g_signal_emitv (paramv, signal_id, 0, NULL);
1053 for (n = 0; n < num_params + 1; n++)
1054 g_value_unset (¶mv[n]);
1059 org_freedesktop_dbus_properties_proxy_g_properties_changed (GDBusProxy *_proxy,
1060 GVariant *changed_properties,
1061 const gchar *const *invalidated_properties)
1063 OrgFreedesktopDBusPropertiesProxy *proxy = ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY (_proxy);
1067 _ExtendedGDBusPropertyInfo *info;
1068 g_variant_get (changed_properties, "a{sv}", &iter);
1069 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
1071 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_properties_interface_info.parent_struct, key);
1072 g_datalist_remove_data (&proxy->priv->qdata, key);
1074 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1076 g_variant_iter_free (iter);
1077 for (n = 0; invalidated_properties[n] != NULL; n++)
1079 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_properties_interface_info.parent_struct, invalidated_properties[n]);
1080 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
1082 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1087 org_freedesktop_dbus_properties_proxy_init (OrgFreedesktopDBusPropertiesProxy *proxy)
1089 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1090 proxy->priv = org_freedesktop_dbus_properties_proxy_get_instance_private (proxy);
1092 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY, OrgFreedesktopDBusPropertiesProxyPrivate);
1095 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), org_freedesktop_dbus_properties_interface_info ());
1099 org_freedesktop_dbus_properties_proxy_class_init (OrgFreedesktopDBusPropertiesProxyClass *klass)
1101 GObjectClass *gobject_class;
1102 GDBusProxyClass *proxy_class;
1104 gobject_class = G_OBJECT_CLASS (klass);
1105 gobject_class->finalize = org_freedesktop_dbus_properties_proxy_finalize;
1106 gobject_class->get_property = org_freedesktop_dbus_properties_proxy_get_property;
1107 gobject_class->set_property = org_freedesktop_dbus_properties_proxy_set_property;
1109 proxy_class = G_DBUS_PROXY_CLASS (klass);
1110 proxy_class->g_signal = org_freedesktop_dbus_properties_proxy_g_signal;
1111 proxy_class->g_properties_changed = org_freedesktop_dbus_properties_proxy_g_properties_changed;
1113 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1114 g_type_class_add_private (klass, sizeof (OrgFreedesktopDBusPropertiesProxyPrivate));
1119 org_freedesktop_dbus_properties_proxy_iface_init (OrgFreedesktopDBusPropertiesIface *iface)
1124 * org_freedesktop_dbus_properties_proxy_new:
1125 * @connection: A #GDBusConnection.
1126 * @flags: Flags from the #GDBusProxyFlags enumeration.
1127 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1128 * @object_path: An object path.
1129 * @cancellable: (allow-none): A #GCancellable or %NULL.
1130 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1131 * @user_data: User data to pass to @callback.
1133 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>. See g_dbus_proxy_new() for more details.
1135 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1136 * You can then call org_freedesktop_dbus_properties_proxy_new_finish() to get the result of the operation.
1138 * See org_freedesktop_dbus_properties_proxy_new_sync() for the synchronous, blocking version of this constructor.
1141 org_freedesktop_dbus_properties_proxy_new (
1142 GDBusConnection *connection,
1143 GDBusProxyFlags flags,
1145 const gchar *object_path,
1146 GCancellable *cancellable,
1147 GAsyncReadyCallback callback,
1150 g_async_initable_new_async (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_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.freedesktop.DBus.Properties", NULL);
1154 * org_freedesktop_dbus_properties_proxy_new_finish:
1155 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_properties_proxy_new().
1156 * @error: Return location for error or %NULL
1158 * Finishes an operation started with org_freedesktop_dbus_properties_proxy_new().
1160 * Returns: (transfer full) (type OrgFreedesktopDBusPropertiesProxy): The constructed proxy object or %NULL if @error is set.
1162 OrgFreedesktopDBusProperties *
1163 org_freedesktop_dbus_properties_proxy_new_finish (
1168 GObject *source_object;
1169 source_object = g_async_result_get_source_object (res);
1170 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1171 g_object_unref (source_object);
1173 return ORG_FREEDESKTOP_DBUS_PROPERTIES (ret);
1179 * org_freedesktop_dbus_properties_proxy_new_sync:
1180 * @connection: A #GDBusConnection.
1181 * @flags: Flags from the #GDBusProxyFlags enumeration.
1182 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1183 * @object_path: An object path.
1184 * @cancellable: (allow-none): A #GCancellable or %NULL.
1185 * @error: Return location for error or %NULL
1187 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>. See g_dbus_proxy_new_sync() for more details.
1189 * The calling thread is blocked until a reply is received.
1191 * See org_freedesktop_dbus_properties_proxy_new() for the asynchronous version of this constructor.
1193 * Returns: (transfer full) (type OrgFreedesktopDBusPropertiesProxy): The constructed proxy object or %NULL if @error is set.
1195 OrgFreedesktopDBusProperties *
1196 org_freedesktop_dbus_properties_proxy_new_sync (
1197 GDBusConnection *connection,
1198 GDBusProxyFlags flags,
1200 const gchar *object_path,
1201 GCancellable *cancellable,
1205 ret = g_initable_new (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.DBus.Properties", NULL);
1207 return ORG_FREEDESKTOP_DBUS_PROPERTIES (ret);
1214 * org_freedesktop_dbus_properties_proxy_new_for_bus:
1215 * @bus_type: A #GBusType.
1216 * @flags: Flags from the #GDBusProxyFlags enumeration.
1217 * @name: A bus name (well-known or unique).
1218 * @object_path: An object path.
1219 * @cancellable: (allow-none): A #GCancellable or %NULL.
1220 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1221 * @user_data: User data to pass to @callback.
1223 * Like org_freedesktop_dbus_properties_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
1225 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1226 * You can then call org_freedesktop_dbus_properties_proxy_new_for_bus_finish() to get the result of the operation.
1228 * See org_freedesktop_dbus_properties_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
1231 org_freedesktop_dbus_properties_proxy_new_for_bus (
1233 GDBusProxyFlags flags,
1235 const gchar *object_path,
1236 GCancellable *cancellable,
1237 GAsyncReadyCallback callback,
1240 g_async_initable_new_async (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_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.freedesktop.DBus.Properties", NULL);
1244 * org_freedesktop_dbus_properties_proxy_new_for_bus_finish:
1245 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_properties_proxy_new_for_bus().
1246 * @error: Return location for error or %NULL
1248 * Finishes an operation started with org_freedesktop_dbus_properties_proxy_new_for_bus().
1250 * Returns: (transfer full) (type OrgFreedesktopDBusPropertiesProxy): The constructed proxy object or %NULL if @error is set.
1252 OrgFreedesktopDBusProperties *
1253 org_freedesktop_dbus_properties_proxy_new_for_bus_finish (
1258 GObject *source_object;
1259 source_object = g_async_result_get_source_object (res);
1260 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1261 g_object_unref (source_object);
1263 return ORG_FREEDESKTOP_DBUS_PROPERTIES (ret);
1269 * org_freedesktop_dbus_properties_proxy_new_for_bus_sync:
1270 * @bus_type: A #GBusType.
1271 * @flags: Flags from the #GDBusProxyFlags enumeration.
1272 * @name: A bus name (well-known or unique).
1273 * @object_path: An object path.
1274 * @cancellable: (allow-none): A #GCancellable or %NULL.
1275 * @error: Return location for error or %NULL
1277 * Like org_freedesktop_dbus_properties_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
1279 * The calling thread is blocked until a reply is received.
1281 * See org_freedesktop_dbus_properties_proxy_new_for_bus() for the asynchronous version of this constructor.
1283 * Returns: (transfer full) (type OrgFreedesktopDBusPropertiesProxy): The constructed proxy object or %NULL if @error is set.
1285 OrgFreedesktopDBusProperties *
1286 org_freedesktop_dbus_properties_proxy_new_for_bus_sync (
1288 GDBusProxyFlags flags,
1290 const gchar *object_path,
1291 GCancellable *cancellable,
1295 ret = g_initable_new (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.DBus.Properties", NULL);
1297 return ORG_FREEDESKTOP_DBUS_PROPERTIES (ret);
1303 /* ------------------------------------------------------------------------ */
1306 * OrgFreedesktopDBusPropertiesSkeleton:
1308 * The #OrgFreedesktopDBusPropertiesSkeleton structure contains only private data and should only be accessed using the provided API.
1312 * OrgFreedesktopDBusPropertiesSkeletonClass:
1313 * @parent_class: The parent class.
1315 * Class structure for #OrgFreedesktopDBusPropertiesSkeleton.
1318 struct _OrgFreedesktopDBusPropertiesSkeletonPrivate
1321 GList *changed_properties;
1322 GSource *changed_properties_idle_source;
1323 GMainContext *context;
1328 _org_freedesktop_dbus_properties_skeleton_handle_method_call (
1329 GDBusConnection *connection G_GNUC_UNUSED,
1330 const gchar *sender G_GNUC_UNUSED,
1331 const gchar *object_path G_GNUC_UNUSED,
1332 const gchar *interface_name,
1333 const gchar *method_name,
1334 GVariant *parameters,
1335 GDBusMethodInvocation *invocation,
1338 OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (user_data);
1339 _ExtendedGDBusMethodInfo *info;
1347 GValue return_value = G_VALUE_INIT;
1348 info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
1349 g_assert (info != NULL);
1350 num_params = g_variant_n_children (parameters);
1351 num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
1353 g_value_init (¶mv[n], TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES);
1354 g_value_set_object (¶mv[n++], skeleton);
1355 g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
1356 g_value_set_object (¶mv[n++], invocation);
1357 if (info->pass_fdlist)
1360 g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
1361 g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
1363 g_assert_not_reached ();
1366 g_variant_iter_init (&iter, parameters);
1367 while ((child = g_variant_iter_next_value (&iter)) != NULL)
1369 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
1370 if (arg_info->use_gvariant)
1372 g_value_init (¶mv[n], G_TYPE_VARIANT);
1373 g_value_set_variant (¶mv[n], child);
1377 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
1378 g_variant_unref (child);
1380 signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES);
1381 g_value_init (&return_value, G_TYPE_BOOLEAN);
1382 g_signal_emitv (paramv, signal_id, 0, &return_value);
1383 if (!g_value_get_boolean (&return_value))
1384 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);
1385 g_value_unset (&return_value);
1386 for (n = 0; n < num_params + num_extra; n++)
1387 g_value_unset (¶mv[n]);
1392 _org_freedesktop_dbus_properties_skeleton_handle_get_property (
1393 GDBusConnection *connection G_GNUC_UNUSED,
1394 const gchar *sender G_GNUC_UNUSED,
1395 const gchar *object_path G_GNUC_UNUSED,
1396 const gchar *interface_name G_GNUC_UNUSED,
1397 const gchar *property_name,
1401 OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (user_data);
1402 GValue value = G_VALUE_INIT;
1404 _ExtendedGDBusPropertyInfo *info;
1407 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_properties_interface_info.parent_struct, property_name);
1408 g_assert (info != NULL);
1409 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1412 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1416 g_value_init (&value, pspec->value_type);
1417 g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1418 ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
1419 g_value_unset (&value);
1425 _org_freedesktop_dbus_properties_skeleton_handle_set_property (
1426 GDBusConnection *connection G_GNUC_UNUSED,
1427 const gchar *sender G_GNUC_UNUSED,
1428 const gchar *object_path G_GNUC_UNUSED,
1429 const gchar *interface_name G_GNUC_UNUSED,
1430 const gchar *property_name,
1435 OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (user_data);
1436 GValue value = G_VALUE_INIT;
1438 _ExtendedGDBusPropertyInfo *info;
1441 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_properties_interface_info.parent_struct, property_name);
1442 g_assert (info != NULL);
1443 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1446 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1450 if (info->use_gvariant)
1451 g_value_set_variant (&value, variant);
1453 g_dbus_gvariant_to_gvalue (variant, &value);
1454 g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1455 g_value_unset (&value);
1461 static const GDBusInterfaceVTable _org_freedesktop_dbus_properties_skeleton_vtable =
1463 _org_freedesktop_dbus_properties_skeleton_handle_method_call,
1464 _org_freedesktop_dbus_properties_skeleton_handle_get_property,
1465 _org_freedesktop_dbus_properties_skeleton_handle_set_property,
1469 static GDBusInterfaceInfo *
1470 org_freedesktop_dbus_properties_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1472 return org_freedesktop_dbus_properties_interface_info ();
1475 static GDBusInterfaceVTable *
1476 org_freedesktop_dbus_properties_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1478 return (GDBusInterfaceVTable *) &_org_freedesktop_dbus_properties_skeleton_vtable;
1482 org_freedesktop_dbus_properties_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
1484 OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (_skeleton);
1486 GVariantBuilder builder;
1488 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
1489 if (_org_freedesktop_dbus_properties_interface_info.parent_struct.properties == NULL)
1491 for (n = 0; _org_freedesktop_dbus_properties_interface_info.parent_struct.properties[n] != NULL; n++)
1493 GDBusPropertyInfo *info = _org_freedesktop_dbus_properties_interface_info.parent_struct.properties[n];
1494 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
1497 value = _org_freedesktop_dbus_properties_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.freedesktop.DBus.Properties", info->name, NULL, skeleton);
1500 g_variant_take_ref (value);
1501 g_variant_builder_add (&builder, "{sv}", info->name, value);
1502 g_variant_unref (value);
1507 return g_variant_builder_end (&builder);
1511 org_freedesktop_dbus_properties_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
1516 _org_freedesktop_dbus_properties_on_signal_properties_changed (
1517 OrgFreedesktopDBusProperties *object,
1518 const gchar *arg_interface_name,
1519 GVariant *arg_changed_properties,
1520 const gchar *const *arg_invalidated_properties)
1522 OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (object);
1524 GList *connections, *l;
1525 GVariant *signal_variant;
1526 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
1528 signal_variant = g_variant_ref_sink (g_variant_new ("(s@a{sv}^as)",
1530 arg_changed_properties,
1531 arg_invalidated_properties));
1532 for (l = connections; l != NULL; l = l->next)
1534 GDBusConnection *connection = l->data;
1535 g_dbus_connection_emit_signal (connection,
1536 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.DBus.Properties", "PropertiesChanged",
1537 signal_variant, NULL);
1539 g_variant_unref (signal_variant);
1540 g_list_free_full (connections, g_object_unref);
1543 static void org_freedesktop_dbus_properties_skeleton_iface_init (OrgFreedesktopDBusPropertiesIface *iface);
1544 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1545 G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusPropertiesSkeleton, org_freedesktop_dbus_properties_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
1546 G_ADD_PRIVATE (OrgFreedesktopDBusPropertiesSkeleton)
1547 G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES, org_freedesktop_dbus_properties_skeleton_iface_init));
1550 G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusPropertiesSkeleton, org_freedesktop_dbus_properties_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
1551 G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES, org_freedesktop_dbus_properties_skeleton_iface_init));
1555 org_freedesktop_dbus_properties_skeleton_finalize (GObject *object)
1557 OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (object);
1558 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
1559 if (skeleton->priv->changed_properties_idle_source != NULL)
1560 g_source_destroy (skeleton->priv->changed_properties_idle_source);
1561 g_main_context_unref (skeleton->priv->context);
1562 g_mutex_clear (&skeleton->priv->lock);
1563 G_OBJECT_CLASS (org_freedesktop_dbus_properties_skeleton_parent_class)->finalize (object);
1567 org_freedesktop_dbus_properties_skeleton_init (OrgFreedesktopDBusPropertiesSkeleton *skeleton)
1569 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1570 skeleton->priv = org_freedesktop_dbus_properties_skeleton_get_instance_private (skeleton);
1572 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON, OrgFreedesktopDBusPropertiesSkeletonPrivate);
1575 g_mutex_init (&skeleton->priv->lock);
1576 skeleton->priv->context = g_main_context_ref_thread_default ();
1580 org_freedesktop_dbus_properties_skeleton_class_init (OrgFreedesktopDBusPropertiesSkeletonClass *klass)
1582 GObjectClass *gobject_class;
1583 GDBusInterfaceSkeletonClass *skeleton_class;
1585 gobject_class = G_OBJECT_CLASS (klass);
1586 gobject_class->finalize = org_freedesktop_dbus_properties_skeleton_finalize;
1588 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
1589 skeleton_class->get_info = org_freedesktop_dbus_properties_skeleton_dbus_interface_get_info;
1590 skeleton_class->get_properties = org_freedesktop_dbus_properties_skeleton_dbus_interface_get_properties;
1591 skeleton_class->flush = org_freedesktop_dbus_properties_skeleton_dbus_interface_flush;
1592 skeleton_class->get_vtable = org_freedesktop_dbus_properties_skeleton_dbus_interface_get_vtable;
1594 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1595 g_type_class_add_private (klass, sizeof (OrgFreedesktopDBusPropertiesSkeletonPrivate));
1600 org_freedesktop_dbus_properties_skeleton_iface_init (OrgFreedesktopDBusPropertiesIface *iface)
1602 iface->properties_changed = _org_freedesktop_dbus_properties_on_signal_properties_changed;
1606 * org_freedesktop_dbus_properties_skeleton_new:
1608 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>.
1610 * Returns: (transfer full) (type OrgFreedesktopDBusPropertiesSkeleton): The skeleton object.
1612 OrgFreedesktopDBusProperties *
1613 org_freedesktop_dbus_properties_skeleton_new (void)
1615 return ORG_FREEDESKTOP_DBUS_PROPERTIES (g_object_new (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON, NULL));
1618 /* ------------------------------------------------------------------------
1619 * Code for interface org.freedesktop.DBus.Introspectable
1620 * ------------------------------------------------------------------------
1624 * SECTION:OrgFreedesktopDBusIntrospectable
1625 * @title: OrgFreedesktopDBusIntrospectable
1626 * @short_description: Generated C code for the org.freedesktop.DBus.Introspectable D-Bus interface
1628 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-DBus-Introspectable.top_of_page">org.freedesktop.DBus.Introspectable</link> D-Bus interface in C.
1631 /* ---- Introspection data for org.freedesktop.DBus.Introspectable ---- */
1633 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_introspectable_method_info_introspect_OUT_ARG_xml_data =
1637 (gchar *) "xml_data",
1644 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_introspectable_method_info_introspect_OUT_ARG_pointers[] =
1646 &_org_freedesktop_dbus_introspectable_method_info_introspect_OUT_ARG_xml_data,
1650 static const _ExtendedGDBusMethodInfo _org_freedesktop_dbus_introspectable_method_info_introspect =
1654 (gchar *) "Introspect",
1656 (GDBusArgInfo **) &_org_freedesktop_dbus_introspectable_method_info_introspect_OUT_ARG_pointers,
1659 "handle-introspect",
1663 static const _ExtendedGDBusMethodInfo * const _org_freedesktop_dbus_introspectable_method_info_pointers[] =
1665 &_org_freedesktop_dbus_introspectable_method_info_introspect,
1669 static const _ExtendedGDBusInterfaceInfo _org_freedesktop_dbus_introspectable_interface_info =
1673 (gchar *) "org.freedesktop.DBus.Introspectable",
1674 (GDBusMethodInfo **) &_org_freedesktop_dbus_introspectable_method_info_pointers,
1679 "org-freedesktop-dbus-introspectable",
1684 * org_freedesktop_dbus_introspectable_interface_info:
1686 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-DBus-Introspectable.top_of_page">org.freedesktop.DBus.Introspectable</link> D-Bus interface.
1688 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
1690 GDBusInterfaceInfo *
1691 org_freedesktop_dbus_introspectable_interface_info (void)
1693 return (GDBusInterfaceInfo *) &_org_freedesktop_dbus_introspectable_interface_info.parent_struct;
1697 * org_freedesktop_dbus_introspectable_override_properties:
1698 * @klass: The class structure for a #GObject<!-- -->-derived class.
1699 * @property_id_begin: The property id to assign to the first overridden property.
1701 * Overrides all #GObject properties in the #OrgFreedesktopDBusIntrospectable interface for a concrete class.
1702 * The properties are overridden in the order they are defined.
1704 * Returns: The last property id.
1707 org_freedesktop_dbus_introspectable_override_properties (GObjectClass *klass, guint property_id_begin)
1709 return property_id_begin - 1;
1715 * OrgFreedesktopDBusIntrospectable:
1717 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Introspectable.top_of_page">org.freedesktop.DBus.Introspectable</link>.
1721 * OrgFreedesktopDBusIntrospectableIface:
1722 * @parent_iface: The parent interface.
1723 * @handle_introspect: Handler for the #OrgFreedesktopDBusIntrospectable::handle-introspect signal.
1725 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Introspectable.top_of_page">org.freedesktop.DBus.Introspectable</link>.
1728 typedef OrgFreedesktopDBusIntrospectableIface OrgFreedesktopDBusIntrospectableInterface;
1729 G_DEFINE_INTERFACE (OrgFreedesktopDBusIntrospectable, org_freedesktop_dbus_introspectable, G_TYPE_OBJECT);
1732 org_freedesktop_dbus_introspectable_default_init (OrgFreedesktopDBusIntrospectableIface *iface)
1734 /* GObject signals for incoming D-Bus method calls: */
1736 * OrgFreedesktopDBusIntrospectable::handle-introspect:
1737 * @object: A #OrgFreedesktopDBusIntrospectable.
1738 * @invocation: A #GDBusMethodInvocation.
1740 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Introspectable.Introspect">Introspect()</link> D-Bus method.
1742 * 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 org_freedesktop_dbus_introspectable_complete_introspect() 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.
1744 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
1746 g_signal_new ("handle-introspect",
1747 G_TYPE_FROM_INTERFACE (iface),
1749 G_STRUCT_OFFSET (OrgFreedesktopDBusIntrospectableIface, handle_introspect),
1750 g_signal_accumulator_true_handled,
1752 g_cclosure_marshal_generic,
1755 G_TYPE_DBUS_METHOD_INVOCATION);
1760 * org_freedesktop_dbus_introspectable_call_introspect:
1761 * @proxy: A #OrgFreedesktopDBusIntrospectableProxy.
1762 * @cancellable: (allow-none): A #GCancellable or %NULL.
1763 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1764 * @user_data: User data to pass to @callback.
1766 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Introspectable.Introspect">Introspect()</link> D-Bus method on @proxy.
1767 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1768 * You can then call org_freedesktop_dbus_introspectable_call_introspect_finish() to get the result of the operation.
1770 * See org_freedesktop_dbus_introspectable_call_introspect_sync() for the synchronous, blocking version of this method.
1773 org_freedesktop_dbus_introspectable_call_introspect (
1774 OrgFreedesktopDBusIntrospectable *proxy,
1775 GCancellable *cancellable,
1776 GAsyncReadyCallback callback,
1779 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1781 g_variant_new ("()"),
1782 G_DBUS_CALL_FLAGS_NONE,
1790 * org_freedesktop_dbus_introspectable_call_introspect_finish:
1791 * @proxy: A #OrgFreedesktopDBusIntrospectableProxy.
1792 * @out_xml_data: (out): Return location for return parameter or %NULL to ignore.
1793 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_introspectable_call_introspect().
1794 * @error: Return location for error or %NULL.
1796 * Finishes an operation started with org_freedesktop_dbus_introspectable_call_introspect().
1798 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1801 org_freedesktop_dbus_introspectable_call_introspect_finish (
1802 OrgFreedesktopDBusIntrospectable *proxy,
1803 gchar **out_xml_data,
1808 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1811 g_variant_get (_ret,
1814 g_variant_unref (_ret);
1816 return _ret != NULL;
1820 * org_freedesktop_dbus_introspectable_call_introspect_sync:
1821 * @proxy: A #OrgFreedesktopDBusIntrospectableProxy.
1822 * @out_xml_data: (out): Return location for return parameter or %NULL to ignore.
1823 * @cancellable: (allow-none): A #GCancellable or %NULL.
1824 * @error: Return location for error or %NULL.
1826 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Introspectable.Introspect">Introspect()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1828 * See org_freedesktop_dbus_introspectable_call_introspect() for the asynchronous version of this method.
1830 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1833 org_freedesktop_dbus_introspectable_call_introspect_sync (
1834 OrgFreedesktopDBusIntrospectable *proxy,
1835 gchar **out_xml_data,
1836 GCancellable *cancellable,
1840 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1842 g_variant_new ("()"),
1843 G_DBUS_CALL_FLAGS_NONE,
1849 g_variant_get (_ret,
1852 g_variant_unref (_ret);
1854 return _ret != NULL;
1858 * org_freedesktop_dbus_introspectable_complete_introspect:
1859 * @object: A #OrgFreedesktopDBusIntrospectable.
1860 * @invocation: (transfer full): A #GDBusMethodInvocation.
1861 * @xml_data: Parameter to return.
1863 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus-Introspectable.Introspect">Introspect()</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.
1865 * This method will free @invocation, you cannot use it afterwards.
1868 org_freedesktop_dbus_introspectable_complete_introspect (
1869 OrgFreedesktopDBusIntrospectable *object,
1870 GDBusMethodInvocation *invocation,
1871 const gchar *xml_data)
1873 g_dbus_method_invocation_return_value (invocation,
1874 g_variant_new ("(s)",
1878 /* ------------------------------------------------------------------------ */
1881 * OrgFreedesktopDBusIntrospectableProxy:
1883 * The #OrgFreedesktopDBusIntrospectableProxy structure contains only private data and should only be accessed using the provided API.
1887 * OrgFreedesktopDBusIntrospectableProxyClass:
1888 * @parent_class: The parent class.
1890 * Class structure for #OrgFreedesktopDBusIntrospectableProxy.
1893 struct _OrgFreedesktopDBusIntrospectableProxyPrivate
1898 static void org_freedesktop_dbus_introspectable_proxy_iface_init (OrgFreedesktopDBusIntrospectableIface *iface);
1900 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1901 G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusIntrospectableProxy, org_freedesktop_dbus_introspectable_proxy, G_TYPE_DBUS_PROXY,
1902 G_ADD_PRIVATE (OrgFreedesktopDBusIntrospectableProxy)
1903 G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE, org_freedesktop_dbus_introspectable_proxy_iface_init));
1906 G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusIntrospectableProxy, org_freedesktop_dbus_introspectable_proxy, G_TYPE_DBUS_PROXY,
1907 G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE, org_freedesktop_dbus_introspectable_proxy_iface_init));
1911 org_freedesktop_dbus_introspectable_proxy_finalize (GObject *object)
1913 OrgFreedesktopDBusIntrospectableProxy *proxy = ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_PROXY (object);
1914 g_datalist_clear (&proxy->priv->qdata);
1915 G_OBJECT_CLASS (org_freedesktop_dbus_introspectable_proxy_parent_class)->finalize (object);
1919 org_freedesktop_dbus_introspectable_proxy_get_property (GObject *object,
1922 GParamSpec *pspec G_GNUC_UNUSED)
1927 org_freedesktop_dbus_introspectable_proxy_set_property (GObject *object,
1929 const GValue *value,
1930 GParamSpec *pspec G_GNUC_UNUSED)
1935 org_freedesktop_dbus_introspectable_proxy_g_signal (GDBusProxy *proxy,
1936 const gchar *sender_name G_GNUC_UNUSED,
1937 const gchar *signal_name,
1938 GVariant *parameters)
1940 _ExtendedGDBusSignalInfo *info;
1947 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_introspectable_interface_info.parent_struct, signal_name);
1950 num_params = g_variant_n_children (parameters);
1951 paramv = g_new0 (GValue, num_params + 1);
1952 g_value_init (¶mv[0], TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE);
1953 g_value_set_object (¶mv[0], proxy);
1954 g_variant_iter_init (&iter, parameters);
1956 while ((child = g_variant_iter_next_value (&iter)) != NULL)
1958 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
1959 if (arg_info->use_gvariant)
1961 g_value_init (¶mv[n], G_TYPE_VARIANT);
1962 g_value_set_variant (¶mv[n], child);
1966 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
1967 g_variant_unref (child);
1969 signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE);
1970 g_signal_emitv (paramv, signal_id, 0, NULL);
1971 for (n = 0; n < num_params + 1; n++)
1972 g_value_unset (¶mv[n]);
1977 org_freedesktop_dbus_introspectable_proxy_g_properties_changed (GDBusProxy *_proxy,
1978 GVariant *changed_properties,
1979 const gchar *const *invalidated_properties)
1981 OrgFreedesktopDBusIntrospectableProxy *proxy = ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_PROXY (_proxy);
1985 _ExtendedGDBusPropertyInfo *info;
1986 g_variant_get (changed_properties, "a{sv}", &iter);
1987 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
1989 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_introspectable_interface_info.parent_struct, key);
1990 g_datalist_remove_data (&proxy->priv->qdata, key);
1992 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1994 g_variant_iter_free (iter);
1995 for (n = 0; invalidated_properties[n] != NULL; n++)
1997 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_introspectable_interface_info.parent_struct, invalidated_properties[n]);
1998 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
2000 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
2005 org_freedesktop_dbus_introspectable_proxy_init (OrgFreedesktopDBusIntrospectableProxy *proxy)
2007 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2008 proxy->priv = org_freedesktop_dbus_introspectable_proxy_get_instance_private (proxy);
2010 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_PROXY, OrgFreedesktopDBusIntrospectableProxyPrivate);
2013 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), org_freedesktop_dbus_introspectable_interface_info ());
2017 org_freedesktop_dbus_introspectable_proxy_class_init (OrgFreedesktopDBusIntrospectableProxyClass *klass)
2019 GObjectClass *gobject_class;
2020 GDBusProxyClass *proxy_class;
2022 gobject_class = G_OBJECT_CLASS (klass);
2023 gobject_class->finalize = org_freedesktop_dbus_introspectable_proxy_finalize;
2024 gobject_class->get_property = org_freedesktop_dbus_introspectable_proxy_get_property;
2025 gobject_class->set_property = org_freedesktop_dbus_introspectable_proxy_set_property;
2027 proxy_class = G_DBUS_PROXY_CLASS (klass);
2028 proxy_class->g_signal = org_freedesktop_dbus_introspectable_proxy_g_signal;
2029 proxy_class->g_properties_changed = org_freedesktop_dbus_introspectable_proxy_g_properties_changed;
2031 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
2032 g_type_class_add_private (klass, sizeof (OrgFreedesktopDBusIntrospectableProxyPrivate));
2037 org_freedesktop_dbus_introspectable_proxy_iface_init (OrgFreedesktopDBusIntrospectableIface *iface)
2042 * org_freedesktop_dbus_introspectable_proxy_new:
2043 * @connection: A #GDBusConnection.
2044 * @flags: Flags from the #GDBusProxyFlags enumeration.
2045 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
2046 * @object_path: An object path.
2047 * @cancellable: (allow-none): A #GCancellable or %NULL.
2048 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
2049 * @user_data: User data to pass to @callback.
2051 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Introspectable.top_of_page">org.freedesktop.DBus.Introspectable</link>. See g_dbus_proxy_new() for more details.
2053 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
2054 * You can then call org_freedesktop_dbus_introspectable_proxy_new_finish() to get the result of the operation.
2056 * See org_freedesktop_dbus_introspectable_proxy_new_sync() for the synchronous, blocking version of this constructor.
2059 org_freedesktop_dbus_introspectable_proxy_new (
2060 GDBusConnection *connection,
2061 GDBusProxyFlags flags,
2063 const gchar *object_path,
2064 GCancellable *cancellable,
2065 GAsyncReadyCallback callback,
2068 g_async_initable_new_async (TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_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.freedesktop.DBus.Introspectable", NULL);
2072 * org_freedesktop_dbus_introspectable_proxy_new_finish:
2073 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_introspectable_proxy_new().
2074 * @error: Return location for error or %NULL
2076 * Finishes an operation started with org_freedesktop_dbus_introspectable_proxy_new().
2078 * Returns: (transfer full) (type OrgFreedesktopDBusIntrospectableProxy): The constructed proxy object or %NULL if @error is set.
2080 OrgFreedesktopDBusIntrospectable *
2081 org_freedesktop_dbus_introspectable_proxy_new_finish (
2086 GObject *source_object;
2087 source_object = g_async_result_get_source_object (res);
2088 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
2089 g_object_unref (source_object);
2091 return ORG_FREEDESKTOP_DBUS_INTROSPECTABLE (ret);
2097 * org_freedesktop_dbus_introspectable_proxy_new_sync:
2098 * @connection: A #GDBusConnection.
2099 * @flags: Flags from the #GDBusProxyFlags enumeration.
2100 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
2101 * @object_path: An object path.
2102 * @cancellable: (allow-none): A #GCancellable or %NULL.
2103 * @error: Return location for error or %NULL
2105 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Introspectable.top_of_page">org.freedesktop.DBus.Introspectable</link>. See g_dbus_proxy_new_sync() for more details.
2107 * The calling thread is blocked until a reply is received.
2109 * See org_freedesktop_dbus_introspectable_proxy_new() for the asynchronous version of this constructor.
2111 * Returns: (transfer full) (type OrgFreedesktopDBusIntrospectableProxy): The constructed proxy object or %NULL if @error is set.
2113 OrgFreedesktopDBusIntrospectable *
2114 org_freedesktop_dbus_introspectable_proxy_new_sync (
2115 GDBusConnection *connection,
2116 GDBusProxyFlags flags,
2118 const gchar *object_path,
2119 GCancellable *cancellable,
2123 ret = g_initable_new (TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.DBus.Introspectable", NULL);
2125 return ORG_FREEDESKTOP_DBUS_INTROSPECTABLE (ret);
2132 * org_freedesktop_dbus_introspectable_proxy_new_for_bus:
2133 * @bus_type: A #GBusType.
2134 * @flags: Flags from the #GDBusProxyFlags enumeration.
2135 * @name: A bus name (well-known or unique).
2136 * @object_path: An object path.
2137 * @cancellable: (allow-none): A #GCancellable or %NULL.
2138 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
2139 * @user_data: User data to pass to @callback.
2141 * Like org_freedesktop_dbus_introspectable_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
2143 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
2144 * You can then call org_freedesktop_dbus_introspectable_proxy_new_for_bus_finish() to get the result of the operation.
2146 * See org_freedesktop_dbus_introspectable_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
2149 org_freedesktop_dbus_introspectable_proxy_new_for_bus (
2151 GDBusProxyFlags flags,
2153 const gchar *object_path,
2154 GCancellable *cancellable,
2155 GAsyncReadyCallback callback,
2158 g_async_initable_new_async (TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_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.freedesktop.DBus.Introspectable", NULL);
2162 * org_freedesktop_dbus_introspectable_proxy_new_for_bus_finish:
2163 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_introspectable_proxy_new_for_bus().
2164 * @error: Return location for error or %NULL
2166 * Finishes an operation started with org_freedesktop_dbus_introspectable_proxy_new_for_bus().
2168 * Returns: (transfer full) (type OrgFreedesktopDBusIntrospectableProxy): The constructed proxy object or %NULL if @error is set.
2170 OrgFreedesktopDBusIntrospectable *
2171 org_freedesktop_dbus_introspectable_proxy_new_for_bus_finish (
2176 GObject *source_object;
2177 source_object = g_async_result_get_source_object (res);
2178 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
2179 g_object_unref (source_object);
2181 return ORG_FREEDESKTOP_DBUS_INTROSPECTABLE (ret);
2187 * org_freedesktop_dbus_introspectable_proxy_new_for_bus_sync:
2188 * @bus_type: A #GBusType.
2189 * @flags: Flags from the #GDBusProxyFlags enumeration.
2190 * @name: A bus name (well-known or unique).
2191 * @object_path: An object path.
2192 * @cancellable: (allow-none): A #GCancellable or %NULL.
2193 * @error: Return location for error or %NULL
2195 * Like org_freedesktop_dbus_introspectable_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
2197 * The calling thread is blocked until a reply is received.
2199 * See org_freedesktop_dbus_introspectable_proxy_new_for_bus() for the asynchronous version of this constructor.
2201 * Returns: (transfer full) (type OrgFreedesktopDBusIntrospectableProxy): The constructed proxy object or %NULL if @error is set.
2203 OrgFreedesktopDBusIntrospectable *
2204 org_freedesktop_dbus_introspectable_proxy_new_for_bus_sync (
2206 GDBusProxyFlags flags,
2208 const gchar *object_path,
2209 GCancellable *cancellable,
2213 ret = g_initable_new (TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.DBus.Introspectable", NULL);
2215 return ORG_FREEDESKTOP_DBUS_INTROSPECTABLE (ret);
2221 /* ------------------------------------------------------------------------ */
2224 * OrgFreedesktopDBusIntrospectableSkeleton:
2226 * The #OrgFreedesktopDBusIntrospectableSkeleton structure contains only private data and should only be accessed using the provided API.
2230 * OrgFreedesktopDBusIntrospectableSkeletonClass:
2231 * @parent_class: The parent class.
2233 * Class structure for #OrgFreedesktopDBusIntrospectableSkeleton.
2236 struct _OrgFreedesktopDBusIntrospectableSkeletonPrivate
2239 GList *changed_properties;
2240 GSource *changed_properties_idle_source;
2241 GMainContext *context;
2246 _org_freedesktop_dbus_introspectable_skeleton_handle_method_call (
2247 GDBusConnection *connection G_GNUC_UNUSED,
2248 const gchar *sender G_GNUC_UNUSED,
2249 const gchar *object_path G_GNUC_UNUSED,
2250 const gchar *interface_name,
2251 const gchar *method_name,
2252 GVariant *parameters,
2253 GDBusMethodInvocation *invocation,
2256 OrgFreedesktopDBusIntrospectableSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_SKELETON (user_data);
2257 _ExtendedGDBusMethodInfo *info;
2265 GValue return_value = G_VALUE_INIT;
2266 info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
2267 g_assert (info != NULL);
2268 num_params = g_variant_n_children (parameters);
2269 num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
2271 g_value_init (¶mv[n], TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE);
2272 g_value_set_object (¶mv[n++], skeleton);
2273 g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
2274 g_value_set_object (¶mv[n++], invocation);
2275 if (info->pass_fdlist)
2278 g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
2279 g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
2281 g_assert_not_reached ();
2284 g_variant_iter_init (&iter, parameters);
2285 while ((child = g_variant_iter_next_value (&iter)) != NULL)
2287 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
2288 if (arg_info->use_gvariant)
2290 g_value_init (¶mv[n], G_TYPE_VARIANT);
2291 g_value_set_variant (¶mv[n], child);
2295 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
2296 g_variant_unref (child);
2298 signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE);
2299 g_value_init (&return_value, G_TYPE_BOOLEAN);
2300 g_signal_emitv (paramv, signal_id, 0, &return_value);
2301 if (!g_value_get_boolean (&return_value))
2302 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);
2303 g_value_unset (&return_value);
2304 for (n = 0; n < num_params + num_extra; n++)
2305 g_value_unset (¶mv[n]);
2310 _org_freedesktop_dbus_introspectable_skeleton_handle_get_property (
2311 GDBusConnection *connection G_GNUC_UNUSED,
2312 const gchar *sender G_GNUC_UNUSED,
2313 const gchar *object_path G_GNUC_UNUSED,
2314 const gchar *interface_name G_GNUC_UNUSED,
2315 const gchar *property_name,
2319 OrgFreedesktopDBusIntrospectableSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_SKELETON (user_data);
2320 GValue value = G_VALUE_INIT;
2322 _ExtendedGDBusPropertyInfo *info;
2325 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_introspectable_interface_info.parent_struct, property_name);
2326 g_assert (info != NULL);
2327 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
2330 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
2334 g_value_init (&value, pspec->value_type);
2335 g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
2336 ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
2337 g_value_unset (&value);
2343 _org_freedesktop_dbus_introspectable_skeleton_handle_set_property (
2344 GDBusConnection *connection G_GNUC_UNUSED,
2345 const gchar *sender G_GNUC_UNUSED,
2346 const gchar *object_path G_GNUC_UNUSED,
2347 const gchar *interface_name G_GNUC_UNUSED,
2348 const gchar *property_name,
2353 OrgFreedesktopDBusIntrospectableSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_SKELETON (user_data);
2354 GValue value = G_VALUE_INIT;
2356 _ExtendedGDBusPropertyInfo *info;
2359 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_introspectable_interface_info.parent_struct, property_name);
2360 g_assert (info != NULL);
2361 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
2364 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
2368 if (info->use_gvariant)
2369 g_value_set_variant (&value, variant);
2371 g_dbus_gvariant_to_gvalue (variant, &value);
2372 g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
2373 g_value_unset (&value);
2379 static const GDBusInterfaceVTable _org_freedesktop_dbus_introspectable_skeleton_vtable =
2381 _org_freedesktop_dbus_introspectable_skeleton_handle_method_call,
2382 _org_freedesktop_dbus_introspectable_skeleton_handle_get_property,
2383 _org_freedesktop_dbus_introspectable_skeleton_handle_set_property,
2387 static GDBusInterfaceInfo *
2388 org_freedesktop_dbus_introspectable_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
2390 return org_freedesktop_dbus_introspectable_interface_info ();
2393 static GDBusInterfaceVTable *
2394 org_freedesktop_dbus_introspectable_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
2396 return (GDBusInterfaceVTable *) &_org_freedesktop_dbus_introspectable_skeleton_vtable;
2400 org_freedesktop_dbus_introspectable_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
2402 OrgFreedesktopDBusIntrospectableSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_SKELETON (_skeleton);
2404 GVariantBuilder builder;
2406 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
2407 if (_org_freedesktop_dbus_introspectable_interface_info.parent_struct.properties == NULL)
2409 for (n = 0; _org_freedesktop_dbus_introspectable_interface_info.parent_struct.properties[n] != NULL; n++)
2411 GDBusPropertyInfo *info = _org_freedesktop_dbus_introspectable_interface_info.parent_struct.properties[n];
2412 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
2415 value = _org_freedesktop_dbus_introspectable_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.freedesktop.DBus.Introspectable", info->name, NULL, skeleton);
2418 g_variant_take_ref (value);
2419 g_variant_builder_add (&builder, "{sv}", info->name, value);
2420 g_variant_unref (value);
2425 return g_variant_builder_end (&builder);
2429 org_freedesktop_dbus_introspectable_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
2433 static void org_freedesktop_dbus_introspectable_skeleton_iface_init (OrgFreedesktopDBusIntrospectableIface *iface);
2434 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2435 G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusIntrospectableSkeleton, org_freedesktop_dbus_introspectable_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
2436 G_ADD_PRIVATE (OrgFreedesktopDBusIntrospectableSkeleton)
2437 G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE, org_freedesktop_dbus_introspectable_skeleton_iface_init));
2440 G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusIntrospectableSkeleton, org_freedesktop_dbus_introspectable_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
2441 G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE, org_freedesktop_dbus_introspectable_skeleton_iface_init));
2445 org_freedesktop_dbus_introspectable_skeleton_finalize (GObject *object)
2447 OrgFreedesktopDBusIntrospectableSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_SKELETON (object);
2448 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
2449 if (skeleton->priv->changed_properties_idle_source != NULL)
2450 g_source_destroy (skeleton->priv->changed_properties_idle_source);
2451 g_main_context_unref (skeleton->priv->context);
2452 g_mutex_clear (&skeleton->priv->lock);
2453 G_OBJECT_CLASS (org_freedesktop_dbus_introspectable_skeleton_parent_class)->finalize (object);
2457 org_freedesktop_dbus_introspectable_skeleton_init (OrgFreedesktopDBusIntrospectableSkeleton *skeleton)
2459 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2460 skeleton->priv = org_freedesktop_dbus_introspectable_skeleton_get_instance_private (skeleton);
2462 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_SKELETON, OrgFreedesktopDBusIntrospectableSkeletonPrivate);
2465 g_mutex_init (&skeleton->priv->lock);
2466 skeleton->priv->context = g_main_context_ref_thread_default ();
2470 org_freedesktop_dbus_introspectable_skeleton_class_init (OrgFreedesktopDBusIntrospectableSkeletonClass *klass)
2472 GObjectClass *gobject_class;
2473 GDBusInterfaceSkeletonClass *skeleton_class;
2475 gobject_class = G_OBJECT_CLASS (klass);
2476 gobject_class->finalize = org_freedesktop_dbus_introspectable_skeleton_finalize;
2478 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
2479 skeleton_class->get_info = org_freedesktop_dbus_introspectable_skeleton_dbus_interface_get_info;
2480 skeleton_class->get_properties = org_freedesktop_dbus_introspectable_skeleton_dbus_interface_get_properties;
2481 skeleton_class->flush = org_freedesktop_dbus_introspectable_skeleton_dbus_interface_flush;
2482 skeleton_class->get_vtable = org_freedesktop_dbus_introspectable_skeleton_dbus_interface_get_vtable;
2484 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
2485 g_type_class_add_private (klass, sizeof (OrgFreedesktopDBusIntrospectableSkeletonPrivate));
2490 org_freedesktop_dbus_introspectable_skeleton_iface_init (OrgFreedesktopDBusIntrospectableIface *iface)
2495 * org_freedesktop_dbus_introspectable_skeleton_new:
2497 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Introspectable.top_of_page">org.freedesktop.DBus.Introspectable</link>.
2499 * Returns: (transfer full) (type OrgFreedesktopDBusIntrospectableSkeleton): The skeleton object.
2501 OrgFreedesktopDBusIntrospectable *
2502 org_freedesktop_dbus_introspectable_skeleton_new (void)
2504 return ORG_FREEDESKTOP_DBUS_INTROSPECTABLE (g_object_new (TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_SKELETON, NULL));
2507 /* ------------------------------------------------------------------------
2508 * Code for interface org.freedesktop.DBus.Peer
2509 * ------------------------------------------------------------------------
2513 * SECTION:OrgFreedesktopDBusPeer
2514 * @title: OrgFreedesktopDBusPeer
2515 * @short_description: Generated C code for the org.freedesktop.DBus.Peer D-Bus interface
2517 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-DBus-Peer.top_of_page">org.freedesktop.DBus.Peer</link> D-Bus interface in C.
2520 /* ---- Introspection data for org.freedesktop.DBus.Peer ---- */
2522 static const _ExtendedGDBusMethodInfo _org_freedesktop_dbus_peer_method_info_ping =
2535 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_peer_method_info_get_machine_id_OUT_ARG_machine_uuid =
2539 (gchar *) "machine_uuid",
2546 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_peer_method_info_get_machine_id_OUT_ARG_pointers[] =
2548 &_org_freedesktop_dbus_peer_method_info_get_machine_id_OUT_ARG_machine_uuid,
2552 static const _ExtendedGDBusMethodInfo _org_freedesktop_dbus_peer_method_info_get_machine_id =
2556 (gchar *) "GetMachineId",
2558 (GDBusArgInfo **) &_org_freedesktop_dbus_peer_method_info_get_machine_id_OUT_ARG_pointers,
2561 "handle-get-machine-id",
2565 static const _ExtendedGDBusMethodInfo * const _org_freedesktop_dbus_peer_method_info_pointers[] =
2567 &_org_freedesktop_dbus_peer_method_info_ping,
2568 &_org_freedesktop_dbus_peer_method_info_get_machine_id,
2572 static const _ExtendedGDBusInterfaceInfo _org_freedesktop_dbus_peer_interface_info =
2576 (gchar *) "org.freedesktop.DBus.Peer",
2577 (GDBusMethodInfo **) &_org_freedesktop_dbus_peer_method_info_pointers,
2582 "org-freedesktop-dbus-peer",
2587 * org_freedesktop_dbus_peer_interface_info:
2589 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-DBus-Peer.top_of_page">org.freedesktop.DBus.Peer</link> D-Bus interface.
2591 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
2593 GDBusInterfaceInfo *
2594 org_freedesktop_dbus_peer_interface_info (void)
2596 return (GDBusInterfaceInfo *) &_org_freedesktop_dbus_peer_interface_info.parent_struct;
2600 * org_freedesktop_dbus_peer_override_properties:
2601 * @klass: The class structure for a #GObject<!-- -->-derived class.
2602 * @property_id_begin: The property id to assign to the first overridden property.
2604 * Overrides all #GObject properties in the #OrgFreedesktopDBusPeer interface for a concrete class.
2605 * The properties are overridden in the order they are defined.
2607 * Returns: The last property id.
2610 org_freedesktop_dbus_peer_override_properties (GObjectClass *klass, guint property_id_begin)
2612 return property_id_begin - 1;
2618 * OrgFreedesktopDBusPeer:
2620 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Peer.top_of_page">org.freedesktop.DBus.Peer</link>.
2624 * OrgFreedesktopDBusPeerIface:
2625 * @parent_iface: The parent interface.
2626 * @handle_get_machine_id: Handler for the #OrgFreedesktopDBusPeer::handle-get-machine-id signal.
2627 * @handle_ping: Handler for the #OrgFreedesktopDBusPeer::handle-ping signal.
2629 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Peer.top_of_page">org.freedesktop.DBus.Peer</link>.
2632 typedef OrgFreedesktopDBusPeerIface OrgFreedesktopDBusPeerInterface;
2633 G_DEFINE_INTERFACE (OrgFreedesktopDBusPeer, org_freedesktop_dbus_peer, G_TYPE_OBJECT);
2636 org_freedesktop_dbus_peer_default_init (OrgFreedesktopDBusPeerIface *iface)
2638 /* GObject signals for incoming D-Bus method calls: */
2640 * OrgFreedesktopDBusPeer::handle-ping:
2641 * @object: A #OrgFreedesktopDBusPeer.
2642 * @invocation: A #GDBusMethodInvocation.
2644 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.Ping">Ping()</link> D-Bus method.
2646 * 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 org_freedesktop_dbus_peer_complete_ping() 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.
2648 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
2650 g_signal_new ("handle-ping",
2651 G_TYPE_FROM_INTERFACE (iface),
2653 G_STRUCT_OFFSET (OrgFreedesktopDBusPeerIface, handle_ping),
2654 g_signal_accumulator_true_handled,
2656 g_cclosure_marshal_generic,
2659 G_TYPE_DBUS_METHOD_INVOCATION);
2662 * OrgFreedesktopDBusPeer::handle-get-machine-id:
2663 * @object: A #OrgFreedesktopDBusPeer.
2664 * @invocation: A #GDBusMethodInvocation.
2666 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.GetMachineId">GetMachineId()</link> D-Bus method.
2668 * 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 org_freedesktop_dbus_peer_complete_get_machine_id() 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.
2670 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
2672 g_signal_new ("handle-get-machine-id",
2673 G_TYPE_FROM_INTERFACE (iface),
2675 G_STRUCT_OFFSET (OrgFreedesktopDBusPeerIface, handle_get_machine_id),
2676 g_signal_accumulator_true_handled,
2678 g_cclosure_marshal_generic,
2681 G_TYPE_DBUS_METHOD_INVOCATION);
2686 * org_freedesktop_dbus_peer_call_ping:
2687 * @proxy: A #OrgFreedesktopDBusPeerProxy.
2688 * @cancellable: (allow-none): A #GCancellable or %NULL.
2689 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2690 * @user_data: User data to pass to @callback.
2692 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.Ping">Ping()</link> D-Bus method on @proxy.
2693 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
2694 * You can then call org_freedesktop_dbus_peer_call_ping_finish() to get the result of the operation.
2696 * See org_freedesktop_dbus_peer_call_ping_sync() for the synchronous, blocking version of this method.
2699 org_freedesktop_dbus_peer_call_ping (
2700 OrgFreedesktopDBusPeer *proxy,
2701 GCancellable *cancellable,
2702 GAsyncReadyCallback callback,
2705 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2707 g_variant_new ("()"),
2708 G_DBUS_CALL_FLAGS_NONE,
2716 * org_freedesktop_dbus_peer_call_ping_finish:
2717 * @proxy: A #OrgFreedesktopDBusPeerProxy.
2718 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_peer_call_ping().
2719 * @error: Return location for error or %NULL.
2721 * Finishes an operation started with org_freedesktop_dbus_peer_call_ping().
2723 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
2726 org_freedesktop_dbus_peer_call_ping_finish (
2727 OrgFreedesktopDBusPeer *proxy,
2732 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2735 g_variant_get (_ret,
2737 g_variant_unref (_ret);
2739 return _ret != NULL;
2743 * org_freedesktop_dbus_peer_call_ping_sync:
2744 * @proxy: A #OrgFreedesktopDBusPeerProxy.
2745 * @cancellable: (allow-none): A #GCancellable or %NULL.
2746 * @error: Return location for error or %NULL.
2748 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.Ping">Ping()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2750 * See org_freedesktop_dbus_peer_call_ping() for the asynchronous version of this method.
2752 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
2755 org_freedesktop_dbus_peer_call_ping_sync (
2756 OrgFreedesktopDBusPeer *proxy,
2757 GCancellable *cancellable,
2761 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2763 g_variant_new ("()"),
2764 G_DBUS_CALL_FLAGS_NONE,
2770 g_variant_get (_ret,
2772 g_variant_unref (_ret);
2774 return _ret != NULL;
2778 * org_freedesktop_dbus_peer_call_get_machine_id:
2779 * @proxy: A #OrgFreedesktopDBusPeerProxy.
2780 * @cancellable: (allow-none): A #GCancellable or %NULL.
2781 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2782 * @user_data: User data to pass to @callback.
2784 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.GetMachineId">GetMachineId()</link> D-Bus method on @proxy.
2785 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
2786 * You can then call org_freedesktop_dbus_peer_call_get_machine_id_finish() to get the result of the operation.
2788 * See org_freedesktop_dbus_peer_call_get_machine_id_sync() for the synchronous, blocking version of this method.
2791 org_freedesktop_dbus_peer_call_get_machine_id (
2792 OrgFreedesktopDBusPeer *proxy,
2793 GCancellable *cancellable,
2794 GAsyncReadyCallback callback,
2797 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2799 g_variant_new ("()"),
2800 G_DBUS_CALL_FLAGS_NONE,
2808 * org_freedesktop_dbus_peer_call_get_machine_id_finish:
2809 * @proxy: A #OrgFreedesktopDBusPeerProxy.
2810 * @out_machine_uuid: (out): Return location for return parameter or %NULL to ignore.
2811 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_peer_call_get_machine_id().
2812 * @error: Return location for error or %NULL.
2814 * Finishes an operation started with org_freedesktop_dbus_peer_call_get_machine_id().
2816 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
2819 org_freedesktop_dbus_peer_call_get_machine_id_finish (
2820 OrgFreedesktopDBusPeer *proxy,
2821 gchar **out_machine_uuid,
2826 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2829 g_variant_get (_ret,
2832 g_variant_unref (_ret);
2834 return _ret != NULL;
2838 * org_freedesktop_dbus_peer_call_get_machine_id_sync:
2839 * @proxy: A #OrgFreedesktopDBusPeerProxy.
2840 * @out_machine_uuid: (out): Return location for return parameter or %NULL to ignore.
2841 * @cancellable: (allow-none): A #GCancellable or %NULL.
2842 * @error: Return location for error or %NULL.
2844 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.GetMachineId">GetMachineId()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2846 * See org_freedesktop_dbus_peer_call_get_machine_id() for the asynchronous version of this method.
2848 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
2851 org_freedesktop_dbus_peer_call_get_machine_id_sync (
2852 OrgFreedesktopDBusPeer *proxy,
2853 gchar **out_machine_uuid,
2854 GCancellable *cancellable,
2858 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2860 g_variant_new ("()"),
2861 G_DBUS_CALL_FLAGS_NONE,
2867 g_variant_get (_ret,
2870 g_variant_unref (_ret);
2872 return _ret != NULL;
2876 * org_freedesktop_dbus_peer_complete_ping:
2877 * @object: A #OrgFreedesktopDBusPeer.
2878 * @invocation: (transfer full): A #GDBusMethodInvocation.
2880 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.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.
2882 * This method will free @invocation, you cannot use it afterwards.
2885 org_freedesktop_dbus_peer_complete_ping (
2886 OrgFreedesktopDBusPeer *object,
2887 GDBusMethodInvocation *invocation)
2889 g_dbus_method_invocation_return_value (invocation,
2890 g_variant_new ("()"));
2894 * org_freedesktop_dbus_peer_complete_get_machine_id:
2895 * @object: A #OrgFreedesktopDBusPeer.
2896 * @invocation: (transfer full): A #GDBusMethodInvocation.
2897 * @machine_uuid: Parameter to return.
2899 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.GetMachineId">GetMachineId()</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.
2901 * This method will free @invocation, you cannot use it afterwards.
2904 org_freedesktop_dbus_peer_complete_get_machine_id (
2905 OrgFreedesktopDBusPeer *object,
2906 GDBusMethodInvocation *invocation,
2907 const gchar *machine_uuid)
2909 g_dbus_method_invocation_return_value (invocation,
2910 g_variant_new ("(s)",
2914 /* ------------------------------------------------------------------------ */
2917 * OrgFreedesktopDBusPeerProxy:
2919 * The #OrgFreedesktopDBusPeerProxy structure contains only private data and should only be accessed using the provided API.
2923 * OrgFreedesktopDBusPeerProxyClass:
2924 * @parent_class: The parent class.
2926 * Class structure for #OrgFreedesktopDBusPeerProxy.
2929 struct _OrgFreedesktopDBusPeerProxyPrivate
2934 static void org_freedesktop_dbus_peer_proxy_iface_init (OrgFreedesktopDBusPeerIface *iface);
2936 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2937 G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusPeerProxy, org_freedesktop_dbus_peer_proxy, G_TYPE_DBUS_PROXY,
2938 G_ADD_PRIVATE (OrgFreedesktopDBusPeerProxy)
2939 G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_PEER, org_freedesktop_dbus_peer_proxy_iface_init));
2942 G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusPeerProxy, org_freedesktop_dbus_peer_proxy, G_TYPE_DBUS_PROXY,
2943 G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_PEER, org_freedesktop_dbus_peer_proxy_iface_init));
2947 org_freedesktop_dbus_peer_proxy_finalize (GObject *object)
2949 OrgFreedesktopDBusPeerProxy *proxy = ORG_FREEDESKTOP_DBUS_PEER_PROXY (object);
2950 g_datalist_clear (&proxy->priv->qdata);
2951 G_OBJECT_CLASS (org_freedesktop_dbus_peer_proxy_parent_class)->finalize (object);
2955 org_freedesktop_dbus_peer_proxy_get_property (GObject *object,
2958 GParamSpec *pspec G_GNUC_UNUSED)
2963 org_freedesktop_dbus_peer_proxy_set_property (GObject *object,
2965 const GValue *value,
2966 GParamSpec *pspec G_GNUC_UNUSED)
2971 org_freedesktop_dbus_peer_proxy_g_signal (GDBusProxy *proxy,
2972 const gchar *sender_name G_GNUC_UNUSED,
2973 const gchar *signal_name,
2974 GVariant *parameters)
2976 _ExtendedGDBusSignalInfo *info;
2983 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_peer_interface_info.parent_struct, signal_name);
2986 num_params = g_variant_n_children (parameters);
2987 paramv = g_new0 (GValue, num_params + 1);
2988 g_value_init (¶mv[0], TYPE_ORG_FREEDESKTOP_DBUS_PEER);
2989 g_value_set_object (¶mv[0], proxy);
2990 g_variant_iter_init (&iter, parameters);
2992 while ((child = g_variant_iter_next_value (&iter)) != NULL)
2994 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
2995 if (arg_info->use_gvariant)
2997 g_value_init (¶mv[n], G_TYPE_VARIANT);
2998 g_value_set_variant (¶mv[n], child);
3002 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
3003 g_variant_unref (child);
3005 signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_FREEDESKTOP_DBUS_PEER);
3006 g_signal_emitv (paramv, signal_id, 0, NULL);
3007 for (n = 0; n < num_params + 1; n++)
3008 g_value_unset (¶mv[n]);
3013 org_freedesktop_dbus_peer_proxy_g_properties_changed (GDBusProxy *_proxy,
3014 GVariant *changed_properties,
3015 const gchar *const *invalidated_properties)
3017 OrgFreedesktopDBusPeerProxy *proxy = ORG_FREEDESKTOP_DBUS_PEER_PROXY (_proxy);
3021 _ExtendedGDBusPropertyInfo *info;
3022 g_variant_get (changed_properties, "a{sv}", &iter);
3023 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
3025 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_peer_interface_info.parent_struct, key);
3026 g_datalist_remove_data (&proxy->priv->qdata, key);
3028 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
3030 g_variant_iter_free (iter);
3031 for (n = 0; invalidated_properties[n] != NULL; n++)
3033 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_peer_interface_info.parent_struct, invalidated_properties[n]);
3034 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
3036 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
3041 org_freedesktop_dbus_peer_proxy_init (OrgFreedesktopDBusPeerProxy *proxy)
3043 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3044 proxy->priv = org_freedesktop_dbus_peer_proxy_get_instance_private (proxy);
3046 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_ORG_FREEDESKTOP_DBUS_PEER_PROXY, OrgFreedesktopDBusPeerProxyPrivate);
3049 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), org_freedesktop_dbus_peer_interface_info ());
3053 org_freedesktop_dbus_peer_proxy_class_init (OrgFreedesktopDBusPeerProxyClass *klass)
3055 GObjectClass *gobject_class;
3056 GDBusProxyClass *proxy_class;
3058 gobject_class = G_OBJECT_CLASS (klass);
3059 gobject_class->finalize = org_freedesktop_dbus_peer_proxy_finalize;
3060 gobject_class->get_property = org_freedesktop_dbus_peer_proxy_get_property;
3061 gobject_class->set_property = org_freedesktop_dbus_peer_proxy_set_property;
3063 proxy_class = G_DBUS_PROXY_CLASS (klass);
3064 proxy_class->g_signal = org_freedesktop_dbus_peer_proxy_g_signal;
3065 proxy_class->g_properties_changed = org_freedesktop_dbus_peer_proxy_g_properties_changed;
3067 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
3068 g_type_class_add_private (klass, sizeof (OrgFreedesktopDBusPeerProxyPrivate));
3073 org_freedesktop_dbus_peer_proxy_iface_init (OrgFreedesktopDBusPeerIface *iface)
3078 * org_freedesktop_dbus_peer_proxy_new:
3079 * @connection: A #GDBusConnection.
3080 * @flags: Flags from the #GDBusProxyFlags enumeration.
3081 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
3082 * @object_path: An object path.
3083 * @cancellable: (allow-none): A #GCancellable or %NULL.
3084 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
3085 * @user_data: User data to pass to @callback.
3087 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Peer.top_of_page">org.freedesktop.DBus.Peer</link>. See g_dbus_proxy_new() for more details.
3089 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
3090 * You can then call org_freedesktop_dbus_peer_proxy_new_finish() to get the result of the operation.
3092 * See org_freedesktop_dbus_peer_proxy_new_sync() for the synchronous, blocking version of this constructor.
3095 org_freedesktop_dbus_peer_proxy_new (
3096 GDBusConnection *connection,
3097 GDBusProxyFlags flags,
3099 const gchar *object_path,
3100 GCancellable *cancellable,
3101 GAsyncReadyCallback callback,
3104 g_async_initable_new_async (TYPE_ORG_FREEDESKTOP_DBUS_PEER_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.freedesktop.DBus.Peer", NULL);
3108 * org_freedesktop_dbus_peer_proxy_new_finish:
3109 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_peer_proxy_new().
3110 * @error: Return location for error or %NULL
3112 * Finishes an operation started with org_freedesktop_dbus_peer_proxy_new().
3114 * Returns: (transfer full) (type OrgFreedesktopDBusPeerProxy): The constructed proxy object or %NULL if @error is set.
3116 OrgFreedesktopDBusPeer *
3117 org_freedesktop_dbus_peer_proxy_new_finish (
3122 GObject *source_object;
3123 source_object = g_async_result_get_source_object (res);
3124 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
3125 g_object_unref (source_object);
3127 return ORG_FREEDESKTOP_DBUS_PEER (ret);
3133 * org_freedesktop_dbus_peer_proxy_new_sync:
3134 * @connection: A #GDBusConnection.
3135 * @flags: Flags from the #GDBusProxyFlags enumeration.
3136 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
3137 * @object_path: An object path.
3138 * @cancellable: (allow-none): A #GCancellable or %NULL.
3139 * @error: Return location for error or %NULL
3141 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Peer.top_of_page">org.freedesktop.DBus.Peer</link>. See g_dbus_proxy_new_sync() for more details.
3143 * The calling thread is blocked until a reply is received.
3145 * See org_freedesktop_dbus_peer_proxy_new() for the asynchronous version of this constructor.
3147 * Returns: (transfer full) (type OrgFreedesktopDBusPeerProxy): The constructed proxy object or %NULL if @error is set.
3149 OrgFreedesktopDBusPeer *
3150 org_freedesktop_dbus_peer_proxy_new_sync (
3151 GDBusConnection *connection,
3152 GDBusProxyFlags flags,
3154 const gchar *object_path,
3155 GCancellable *cancellable,
3159 ret = g_initable_new (TYPE_ORG_FREEDESKTOP_DBUS_PEER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.DBus.Peer", NULL);
3161 return ORG_FREEDESKTOP_DBUS_PEER (ret);
3168 * org_freedesktop_dbus_peer_proxy_new_for_bus:
3169 * @bus_type: A #GBusType.
3170 * @flags: Flags from the #GDBusProxyFlags enumeration.
3171 * @name: A bus name (well-known or unique).
3172 * @object_path: An object path.
3173 * @cancellable: (allow-none): A #GCancellable or %NULL.
3174 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
3175 * @user_data: User data to pass to @callback.
3177 * Like org_freedesktop_dbus_peer_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
3179 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
3180 * You can then call org_freedesktop_dbus_peer_proxy_new_for_bus_finish() to get the result of the operation.
3182 * See org_freedesktop_dbus_peer_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
3185 org_freedesktop_dbus_peer_proxy_new_for_bus (
3187 GDBusProxyFlags flags,
3189 const gchar *object_path,
3190 GCancellable *cancellable,
3191 GAsyncReadyCallback callback,
3194 g_async_initable_new_async (TYPE_ORG_FREEDESKTOP_DBUS_PEER_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.freedesktop.DBus.Peer", NULL);
3198 * org_freedesktop_dbus_peer_proxy_new_for_bus_finish:
3199 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_peer_proxy_new_for_bus().
3200 * @error: Return location for error or %NULL
3202 * Finishes an operation started with org_freedesktop_dbus_peer_proxy_new_for_bus().
3204 * Returns: (transfer full) (type OrgFreedesktopDBusPeerProxy): The constructed proxy object or %NULL if @error is set.
3206 OrgFreedesktopDBusPeer *
3207 org_freedesktop_dbus_peer_proxy_new_for_bus_finish (
3212 GObject *source_object;
3213 source_object = g_async_result_get_source_object (res);
3214 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
3215 g_object_unref (source_object);
3217 return ORG_FREEDESKTOP_DBUS_PEER (ret);
3223 * org_freedesktop_dbus_peer_proxy_new_for_bus_sync:
3224 * @bus_type: A #GBusType.
3225 * @flags: Flags from the #GDBusProxyFlags enumeration.
3226 * @name: A bus name (well-known or unique).
3227 * @object_path: An object path.
3228 * @cancellable: (allow-none): A #GCancellable or %NULL.
3229 * @error: Return location for error or %NULL
3231 * Like org_freedesktop_dbus_peer_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
3233 * The calling thread is blocked until a reply is received.
3235 * See org_freedesktop_dbus_peer_proxy_new_for_bus() for the asynchronous version of this constructor.
3237 * Returns: (transfer full) (type OrgFreedesktopDBusPeerProxy): The constructed proxy object or %NULL if @error is set.
3239 OrgFreedesktopDBusPeer *
3240 org_freedesktop_dbus_peer_proxy_new_for_bus_sync (
3242 GDBusProxyFlags flags,
3244 const gchar *object_path,
3245 GCancellable *cancellable,
3249 ret = g_initable_new (TYPE_ORG_FREEDESKTOP_DBUS_PEER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.DBus.Peer", NULL);
3251 return ORG_FREEDESKTOP_DBUS_PEER (ret);
3257 /* ------------------------------------------------------------------------ */
3260 * OrgFreedesktopDBusPeerSkeleton:
3262 * The #OrgFreedesktopDBusPeerSkeleton structure contains only private data and should only be accessed using the provided API.
3266 * OrgFreedesktopDBusPeerSkeletonClass:
3267 * @parent_class: The parent class.
3269 * Class structure for #OrgFreedesktopDBusPeerSkeleton.
3272 struct _OrgFreedesktopDBusPeerSkeletonPrivate
3275 GList *changed_properties;
3276 GSource *changed_properties_idle_source;
3277 GMainContext *context;
3282 _org_freedesktop_dbus_peer_skeleton_handle_method_call (
3283 GDBusConnection *connection G_GNUC_UNUSED,
3284 const gchar *sender G_GNUC_UNUSED,
3285 const gchar *object_path G_GNUC_UNUSED,
3286 const gchar *interface_name,
3287 const gchar *method_name,
3288 GVariant *parameters,
3289 GDBusMethodInvocation *invocation,
3292 OrgFreedesktopDBusPeerSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PEER_SKELETON (user_data);
3293 _ExtendedGDBusMethodInfo *info;
3301 GValue return_value = G_VALUE_INIT;
3302 info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
3303 g_assert (info != NULL);
3304 num_params = g_variant_n_children (parameters);
3305 num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
3307 g_value_init (¶mv[n], TYPE_ORG_FREEDESKTOP_DBUS_PEER);
3308 g_value_set_object (¶mv[n++], skeleton);
3309 g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
3310 g_value_set_object (¶mv[n++], invocation);
3311 if (info->pass_fdlist)
3314 g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
3315 g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
3317 g_assert_not_reached ();
3320 g_variant_iter_init (&iter, parameters);
3321 while ((child = g_variant_iter_next_value (&iter)) != NULL)
3323 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
3324 if (arg_info->use_gvariant)
3326 g_value_init (¶mv[n], G_TYPE_VARIANT);
3327 g_value_set_variant (¶mv[n], child);
3331 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
3332 g_variant_unref (child);
3334 signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_FREEDESKTOP_DBUS_PEER);
3335 g_value_init (&return_value, G_TYPE_BOOLEAN);
3336 g_signal_emitv (paramv, signal_id, 0, &return_value);
3337 if (!g_value_get_boolean (&return_value))
3338 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);
3339 g_value_unset (&return_value);
3340 for (n = 0; n < num_params + num_extra; n++)
3341 g_value_unset (¶mv[n]);
3346 _org_freedesktop_dbus_peer_skeleton_handle_get_property (
3347 GDBusConnection *connection G_GNUC_UNUSED,
3348 const gchar *sender G_GNUC_UNUSED,
3349 const gchar *object_path G_GNUC_UNUSED,
3350 const gchar *interface_name G_GNUC_UNUSED,
3351 const gchar *property_name,
3355 OrgFreedesktopDBusPeerSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PEER_SKELETON (user_data);
3356 GValue value = G_VALUE_INIT;
3358 _ExtendedGDBusPropertyInfo *info;
3361 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_peer_interface_info.parent_struct, property_name);
3362 g_assert (info != NULL);
3363 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
3366 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
3370 g_value_init (&value, pspec->value_type);
3371 g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
3372 ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
3373 g_value_unset (&value);
3379 _org_freedesktop_dbus_peer_skeleton_handle_set_property (
3380 GDBusConnection *connection G_GNUC_UNUSED,
3381 const gchar *sender G_GNUC_UNUSED,
3382 const gchar *object_path G_GNUC_UNUSED,
3383 const gchar *interface_name G_GNUC_UNUSED,
3384 const gchar *property_name,
3389 OrgFreedesktopDBusPeerSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PEER_SKELETON (user_data);
3390 GValue value = G_VALUE_INIT;
3392 _ExtendedGDBusPropertyInfo *info;
3395 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_peer_interface_info.parent_struct, property_name);
3396 g_assert (info != NULL);
3397 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
3400 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
3404 if (info->use_gvariant)
3405 g_value_set_variant (&value, variant);
3407 g_dbus_gvariant_to_gvalue (variant, &value);
3408 g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
3409 g_value_unset (&value);
3415 static const GDBusInterfaceVTable _org_freedesktop_dbus_peer_skeleton_vtable =
3417 _org_freedesktop_dbus_peer_skeleton_handle_method_call,
3418 _org_freedesktop_dbus_peer_skeleton_handle_get_property,
3419 _org_freedesktop_dbus_peer_skeleton_handle_set_property,
3423 static GDBusInterfaceInfo *
3424 org_freedesktop_dbus_peer_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
3426 return org_freedesktop_dbus_peer_interface_info ();
3429 static GDBusInterfaceVTable *
3430 org_freedesktop_dbus_peer_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
3432 return (GDBusInterfaceVTable *) &_org_freedesktop_dbus_peer_skeleton_vtable;
3436 org_freedesktop_dbus_peer_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
3438 OrgFreedesktopDBusPeerSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PEER_SKELETON (_skeleton);
3440 GVariantBuilder builder;
3442 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
3443 if (_org_freedesktop_dbus_peer_interface_info.parent_struct.properties == NULL)
3445 for (n = 0; _org_freedesktop_dbus_peer_interface_info.parent_struct.properties[n] != NULL; n++)
3447 GDBusPropertyInfo *info = _org_freedesktop_dbus_peer_interface_info.parent_struct.properties[n];
3448 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
3451 value = _org_freedesktop_dbus_peer_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.freedesktop.DBus.Peer", info->name, NULL, skeleton);
3454 g_variant_take_ref (value);
3455 g_variant_builder_add (&builder, "{sv}", info->name, value);
3456 g_variant_unref (value);
3461 return g_variant_builder_end (&builder);
3465 org_freedesktop_dbus_peer_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
3469 static void org_freedesktop_dbus_peer_skeleton_iface_init (OrgFreedesktopDBusPeerIface *iface);
3470 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3471 G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusPeerSkeleton, org_freedesktop_dbus_peer_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
3472 G_ADD_PRIVATE (OrgFreedesktopDBusPeerSkeleton)
3473 G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_PEER, org_freedesktop_dbus_peer_skeleton_iface_init));
3476 G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusPeerSkeleton, org_freedesktop_dbus_peer_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
3477 G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_PEER, org_freedesktop_dbus_peer_skeleton_iface_init));
3481 org_freedesktop_dbus_peer_skeleton_finalize (GObject *object)
3483 OrgFreedesktopDBusPeerSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PEER_SKELETON (object);
3484 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
3485 if (skeleton->priv->changed_properties_idle_source != NULL)
3486 g_source_destroy (skeleton->priv->changed_properties_idle_source);
3487 g_main_context_unref (skeleton->priv->context);
3488 g_mutex_clear (&skeleton->priv->lock);
3489 G_OBJECT_CLASS (org_freedesktop_dbus_peer_skeleton_parent_class)->finalize (object);
3493 org_freedesktop_dbus_peer_skeleton_init (OrgFreedesktopDBusPeerSkeleton *skeleton)
3495 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3496 skeleton->priv = org_freedesktop_dbus_peer_skeleton_get_instance_private (skeleton);
3498 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_ORG_FREEDESKTOP_DBUS_PEER_SKELETON, OrgFreedesktopDBusPeerSkeletonPrivate);
3501 g_mutex_init (&skeleton->priv->lock);
3502 skeleton->priv->context = g_main_context_ref_thread_default ();
3506 org_freedesktop_dbus_peer_skeleton_class_init (OrgFreedesktopDBusPeerSkeletonClass *klass)
3508 GObjectClass *gobject_class;
3509 GDBusInterfaceSkeletonClass *skeleton_class;
3511 gobject_class = G_OBJECT_CLASS (klass);
3512 gobject_class->finalize = org_freedesktop_dbus_peer_skeleton_finalize;
3514 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
3515 skeleton_class->get_info = org_freedesktop_dbus_peer_skeleton_dbus_interface_get_info;
3516 skeleton_class->get_properties = org_freedesktop_dbus_peer_skeleton_dbus_interface_get_properties;
3517 skeleton_class->flush = org_freedesktop_dbus_peer_skeleton_dbus_interface_flush;
3518 skeleton_class->get_vtable = org_freedesktop_dbus_peer_skeleton_dbus_interface_get_vtable;
3520 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
3521 g_type_class_add_private (klass, sizeof (OrgFreedesktopDBusPeerSkeletonPrivate));
3526 org_freedesktop_dbus_peer_skeleton_iface_init (OrgFreedesktopDBusPeerIface *iface)
3531 * org_freedesktop_dbus_peer_skeleton_new:
3533 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Peer.top_of_page">org.freedesktop.DBus.Peer</link>.
3535 * Returns: (transfer full) (type OrgFreedesktopDBusPeerSkeleton): The skeleton object.
3537 OrgFreedesktopDBusPeer *
3538 org_freedesktop_dbus_peer_skeleton_new (void)
3540 return ORG_FREEDESKTOP_DBUS_PEER (g_object_new (TYPE_ORG_FREEDESKTOP_DBUS_PEER_SKELETON, NULL));
3543 /* ------------------------------------------------------------------------
3544 * Code for interface org.lightmediascanner.Scanner1
3545 * ------------------------------------------------------------------------
3551 * @short_description: Generated C code for the org.lightmediascanner.Scanner1 D-Bus interface
3553 * This section contains code for working with the <link linkend="gdbus-interface-org-lightmediascanner-Scanner1.top_of_page">org.lightmediascanner.Scanner1</link> D-Bus interface in C.
3556 /* ---- Introspection data for org.lightmediascanner.Scanner1 ---- */
3558 static const _ExtendedGDBusArgInfo _scanner1_method_info_scan_IN_ARG_specification =
3562 (gchar *) "specification",
3569 static const _ExtendedGDBusArgInfo * const _scanner1_method_info_scan_IN_ARG_pointers[] =
3571 &_scanner1_method_info_scan_IN_ARG_specification,
3575 static const _ExtendedGDBusMethodInfo _scanner1_method_info_scan =
3580 (GDBusArgInfo **) &_scanner1_method_info_scan_IN_ARG_pointers,
3588 static const _ExtendedGDBusMethodInfo _scanner1_method_info_stop =
3601 static const _ExtendedGDBusMethodInfo _scanner1_method_info_request_write_lock =
3605 (gchar *) "RequestWriteLock",
3610 "handle-request-write-lock",
3614 static const _ExtendedGDBusMethodInfo _scanner1_method_info_release_write_lock =
3618 (gchar *) "ReleaseWriteLock",
3623 "handle-release-write-lock",
3627 static const _ExtendedGDBusMethodInfo * const _scanner1_method_info_pointers[] =
3629 &_scanner1_method_info_scan,
3630 &_scanner1_method_info_stop,
3631 &_scanner1_method_info_request_write_lock,
3632 &_scanner1_method_info_release_write_lock,
3636 static const _ExtendedGDBusArgInfo _scanner1_signal_info_scan_progress_ARG_Category =
3640 (gchar *) "Category",
3647 static const _ExtendedGDBusArgInfo _scanner1_signal_info_scan_progress_ARG_Path =
3658 static const _ExtendedGDBusArgInfo _scanner1_signal_info_scan_progress_ARG_UpToDate =
3662 (gchar *) "UpToDate",
3669 static const _ExtendedGDBusArgInfo _scanner1_signal_info_scan_progress_ARG_Processed =
3673 (gchar *) "Processed",
3680 static const _ExtendedGDBusArgInfo _scanner1_signal_info_scan_progress_ARG_Deleted =
3684 (gchar *) "Deleted",
3691 static const _ExtendedGDBusArgInfo _scanner1_signal_info_scan_progress_ARG_Skipped =
3695 (gchar *) "Skipped",
3702 static const _ExtendedGDBusArgInfo _scanner1_signal_info_scan_progress_ARG_Errors =
3713 static const _ExtendedGDBusArgInfo * const _scanner1_signal_info_scan_progress_ARG_pointers[] =
3715 &_scanner1_signal_info_scan_progress_ARG_Category,
3716 &_scanner1_signal_info_scan_progress_ARG_Path,
3717 &_scanner1_signal_info_scan_progress_ARG_UpToDate,
3718 &_scanner1_signal_info_scan_progress_ARG_Processed,
3719 &_scanner1_signal_info_scan_progress_ARG_Deleted,
3720 &_scanner1_signal_info_scan_progress_ARG_Skipped,
3721 &_scanner1_signal_info_scan_progress_ARG_Errors,
3725 static const _ExtendedGDBusSignalInfo _scanner1_signal_info_scan_progress =
3729 (gchar *) "ScanProgress",
3730 (GDBusArgInfo **) &_scanner1_signal_info_scan_progress_ARG_pointers,
3736 static const _ExtendedGDBusSignalInfo * const _scanner1_signal_info_pointers[] =
3738 &_scanner1_signal_info_scan_progress,
3742 static const _ExtendedGDBusPropertyInfo _scanner1_property_info_data_base_path =
3746 (gchar *) "DataBasePath",
3748 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
3755 static const _ExtendedGDBusPropertyInfo _scanner1_property_info_is_scanning =
3759 (gchar *) "IsScanning",
3761 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
3768 static const _ExtendedGDBusPropertyInfo _scanner1_property_info_write_locked =
3772 (gchar *) "WriteLocked",
3774 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
3781 static const _ExtendedGDBusPropertyInfo _scanner1_property_info_update_id =
3785 (gchar *) "UpdateID",
3787 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
3794 static const _ExtendedGDBusPropertyInfo _scanner1_property_info_categories =
3798 (gchar *) "Categories",
3800 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
3807 static const _ExtendedGDBusPropertyInfo * const _scanner1_property_info_pointers[] =
3809 &_scanner1_property_info_data_base_path,
3810 &_scanner1_property_info_is_scanning,
3811 &_scanner1_property_info_write_locked,
3812 &_scanner1_property_info_update_id,
3813 &_scanner1_property_info_categories,
3817 static const _ExtendedGDBusInterfaceInfo _scanner1_interface_info =
3821 (gchar *) "org.lightmediascanner.Scanner1",
3822 (GDBusMethodInfo **) &_scanner1_method_info_pointers,
3823 (GDBusSignalInfo **) &_scanner1_signal_info_pointers,
3824 (GDBusPropertyInfo **) &_scanner1_property_info_pointers,
3832 * scanner1_interface_info:
3834 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-lightmediascanner-Scanner1.top_of_page">org.lightmediascanner.Scanner1</link> D-Bus interface.
3836 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
3838 GDBusInterfaceInfo *
3839 scanner1_interface_info (void)
3841 return (GDBusInterfaceInfo *) &_scanner1_interface_info.parent_struct;
3845 * scanner1_override_properties:
3846 * @klass: The class structure for a #GObject<!-- -->-derived class.
3847 * @property_id_begin: The property id to assign to the first overridden property.
3849 * Overrides all #GObject properties in the #Scanner1 interface for a concrete class.
3850 * The properties are overridden in the order they are defined.
3852 * Returns: The last property id.
3855 scanner1_override_properties (GObjectClass *klass, guint property_id_begin)
3857 g_object_class_override_property (klass, property_id_begin++, "data-base-path");
3858 g_object_class_override_property (klass, property_id_begin++, "is-scanning");
3859 g_object_class_override_property (klass, property_id_begin++, "write-locked");
3860 g_object_class_override_property (klass, property_id_begin++, "update-id");
3861 g_object_class_override_property (klass, property_id_begin++, "categories");
3862 return property_id_begin - 1;
3870 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-lightmediascanner-Scanner1.top_of_page">org.lightmediascanner.Scanner1</link>.
3875 * @parent_iface: The parent interface.
3876 * @handle_release_write_lock: Handler for the #Scanner1::handle-release-write-lock signal.
3877 * @handle_request_write_lock: Handler for the #Scanner1::handle-request-write-lock signal.
3878 * @handle_scan: Handler for the #Scanner1::handle-scan signal.
3879 * @handle_stop: Handler for the #Scanner1::handle-stop signal.
3880 * @get_categories: Getter for the #Scanner1:categories property.
3881 * @get_data_base_path: Getter for the #Scanner1:data-base-path property.
3882 * @get_is_scanning: Getter for the #Scanner1:is-scanning property.
3883 * @get_update_id: Getter for the #Scanner1:update-id property.
3884 * @get_write_locked: Getter for the #Scanner1:write-locked property.
3885 * @scan_progress: Handler for the #Scanner1::scan-progress signal.
3887 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-lightmediascanner-Scanner1.top_of_page">org.lightmediascanner.Scanner1</link>.
3890 typedef Scanner1Iface Scanner1Interface;
3891 G_DEFINE_INTERFACE (Scanner1, scanner1, G_TYPE_OBJECT);
3894 scanner1_default_init (Scanner1Iface *iface)
3896 /* GObject signals for incoming D-Bus method calls: */
3898 * Scanner1::handle-scan:
3899 * @object: A #Scanner1.
3900 * @invocation: A #GDBusMethodInvocation.
3901 * @arg_specification: Argument passed by remote caller.
3903 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.Scan">Scan()</link> D-Bus method.
3905 * 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 scanner1_complete_scan() 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.
3907 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
3909 g_signal_new ("handle-scan",
3910 G_TYPE_FROM_INTERFACE (iface),
3912 G_STRUCT_OFFSET (Scanner1Iface, handle_scan),
3913 g_signal_accumulator_true_handled,
3915 g_cclosure_marshal_generic,
3918 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT);
3921 * Scanner1::handle-stop:
3922 * @object: A #Scanner1.
3923 * @invocation: A #GDBusMethodInvocation.
3925 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.Stop">Stop()</link> D-Bus method.
3927 * 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 scanner1_complete_stop() 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.
3929 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
3931 g_signal_new ("handle-stop",
3932 G_TYPE_FROM_INTERFACE (iface),
3934 G_STRUCT_OFFSET (Scanner1Iface, handle_stop),
3935 g_signal_accumulator_true_handled,
3937 g_cclosure_marshal_generic,
3940 G_TYPE_DBUS_METHOD_INVOCATION);
3943 * Scanner1::handle-request-write-lock:
3944 * @object: A #Scanner1.
3945 * @invocation: A #GDBusMethodInvocation.
3947 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.RequestWriteLock">RequestWriteLock()</link> D-Bus method.
3949 * 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 scanner1_complete_request_write_lock() 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.
3951 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
3953 g_signal_new ("handle-request-write-lock",
3954 G_TYPE_FROM_INTERFACE (iface),
3956 G_STRUCT_OFFSET (Scanner1Iface, handle_request_write_lock),
3957 g_signal_accumulator_true_handled,
3959 g_cclosure_marshal_generic,
3962 G_TYPE_DBUS_METHOD_INVOCATION);
3965 * Scanner1::handle-release-write-lock:
3966 * @object: A #Scanner1.
3967 * @invocation: A #GDBusMethodInvocation.
3969 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.ReleaseWriteLock">ReleaseWriteLock()</link> D-Bus method.
3971 * 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 scanner1_complete_release_write_lock() 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.
3973 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
3975 g_signal_new ("handle-release-write-lock",
3976 G_TYPE_FROM_INTERFACE (iface),
3978 G_STRUCT_OFFSET (Scanner1Iface, handle_release_write_lock),
3979 g_signal_accumulator_true_handled,
3981 g_cclosure_marshal_generic,
3984 G_TYPE_DBUS_METHOD_INVOCATION);
3986 /* GObject signals for received D-Bus signals: */
3988 * Scanner1::scan-progress:
3989 * @object: A #Scanner1.
3990 * @arg_Category: Argument.
3991 * @arg_Path: Argument.
3992 * @arg_UpToDate: Argument.
3993 * @arg_Processed: Argument.
3994 * @arg_Deleted: Argument.
3995 * @arg_Skipped: Argument.
3996 * @arg_Errors: Argument.
3998 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-lightmediascanner-Scanner1.ScanProgress">"ScanProgress"</link> is received.
4000 * 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.
4002 g_signal_new ("scan-progress",
4003 G_TYPE_FROM_INTERFACE (iface),
4005 G_STRUCT_OFFSET (Scanner1Iface, scan_progress),
4008 g_cclosure_marshal_generic,
4010 7, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT64, G_TYPE_UINT64, G_TYPE_UINT64, G_TYPE_UINT64, G_TYPE_UINT64);
4012 /* GObject properties for D-Bus properties: */
4014 * Scanner1:data-base-path:
4016 * Represents the D-Bus property <link linkend="gdbus-property-org-lightmediascanner-Scanner1.DataBasePath">"DataBasePath"</link>.
4018 * 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.
4020 g_object_interface_install_property (iface,
4021 g_param_spec_string ("data-base-path", "DataBasePath", "DataBasePath", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
4023 * Scanner1:is-scanning:
4025 * Represents the D-Bus property <link linkend="gdbus-property-org-lightmediascanner-Scanner1.IsScanning">"IsScanning"</link>.
4027 * 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.
4029 g_object_interface_install_property (iface,
4030 g_param_spec_boolean ("is-scanning", "IsScanning", "IsScanning", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
4032 * Scanner1:write-locked:
4034 * Represents the D-Bus property <link linkend="gdbus-property-org-lightmediascanner-Scanner1.WriteLocked">"WriteLocked"</link>.
4036 * 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.
4038 g_object_interface_install_property (iface,
4039 g_param_spec_boolean ("write-locked", "WriteLocked", "WriteLocked", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
4041 * Scanner1:update-id:
4043 * Represents the D-Bus property <link linkend="gdbus-property-org-lightmediascanner-Scanner1.UpdateID">"UpdateID"</link>.
4045 * 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.
4047 g_object_interface_install_property (iface,
4048 g_param_spec_uint64 ("update-id", "UpdateID", "UpdateID", 0, G_MAXUINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
4050 * Scanner1:categories:
4052 * Represents the D-Bus property <link linkend="gdbus-property-org-lightmediascanner-Scanner1.Categories">"Categories"</link>.
4054 * 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.
4056 g_object_interface_install_property (iface,
4057 g_param_spec_variant ("categories", "Categories", "Categories", G_VARIANT_TYPE ("a{sv}"), NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
4061 * scanner1_get_data_base_path: (skip)
4062 * @object: A #Scanner1.
4064 * Gets the value of the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.DataBasePath">"DataBasePath"</link> D-Bus property.
4066 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4068 * <warning>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 scanner1_dup_data_base_path() if on another thread.</warning>
4070 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
4073 scanner1_get_data_base_path (Scanner1 *object)
4075 return SCANNER1_GET_IFACE (object)->get_data_base_path (object);
4079 * scanner1_dup_data_base_path: (skip)
4080 * @object: A #Scanner1.
4082 * Gets a copy of the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.DataBasePath">"DataBasePath"</link> D-Bus property.
4084 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4086 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
4089 scanner1_dup_data_base_path (Scanner1 *object)
4092 g_object_get (G_OBJECT (object), "data-base-path", &value, NULL);
4097 * scanner1_set_data_base_path: (skip)
4098 * @object: A #Scanner1.
4099 * @value: The value to set.
4101 * Sets the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.DataBasePath">"DataBasePath"</link> D-Bus property to @value.
4103 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4106 scanner1_set_data_base_path (Scanner1 *object, const gchar *value)
4108 g_object_set (G_OBJECT (object), "data-base-path", value, NULL);
4112 * scanner1_get_is_scanning: (skip)
4113 * @object: A #Scanner1.
4115 * Gets the value of the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.IsScanning">"IsScanning"</link> D-Bus property.
4117 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4119 * Returns: The property value.
4122 scanner1_get_is_scanning (Scanner1 *object)
4124 return SCANNER1_GET_IFACE (object)->get_is_scanning (object);
4128 * scanner1_set_is_scanning: (skip)
4129 * @object: A #Scanner1.
4130 * @value: The value to set.
4132 * Sets the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.IsScanning">"IsScanning"</link> D-Bus property to @value.
4134 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4137 scanner1_set_is_scanning (Scanner1 *object, gboolean value)
4139 g_object_set (G_OBJECT (object), "is-scanning", value, NULL);
4143 * scanner1_get_write_locked: (skip)
4144 * @object: A #Scanner1.
4146 * Gets the value of the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.WriteLocked">"WriteLocked"</link> D-Bus property.
4148 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4150 * Returns: The property value.
4153 scanner1_get_write_locked (Scanner1 *object)
4155 return SCANNER1_GET_IFACE (object)->get_write_locked (object);
4159 * scanner1_set_write_locked: (skip)
4160 * @object: A #Scanner1.
4161 * @value: The value to set.
4163 * Sets the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.WriteLocked">"WriteLocked"</link> D-Bus property to @value.
4165 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4168 scanner1_set_write_locked (Scanner1 *object, gboolean value)
4170 g_object_set (G_OBJECT (object), "write-locked", value, NULL);
4174 * scanner1_get_update_id: (skip)
4175 * @object: A #Scanner1.
4177 * Gets the value of the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.UpdateID">"UpdateID"</link> D-Bus property.
4179 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4181 * Returns: The property value.
4184 scanner1_get_update_id (Scanner1 *object)
4186 return SCANNER1_GET_IFACE (object)->get_update_id (object);
4190 * scanner1_set_update_id: (skip)
4191 * @object: A #Scanner1.
4192 * @value: The value to set.
4194 * Sets the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.UpdateID">"UpdateID"</link> D-Bus property to @value.
4196 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4199 scanner1_set_update_id (Scanner1 *object, guint64 value)
4201 g_object_set (G_OBJECT (object), "update-id", value, NULL);
4205 * scanner1_get_categories: (skip)
4206 * @object: A #Scanner1.
4208 * Gets the value of the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.Categories">"Categories"</link> D-Bus property.
4210 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4212 * <warning>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 scanner1_dup_categories() if on another thread.</warning>
4214 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
4217 scanner1_get_categories (Scanner1 *object)
4219 return SCANNER1_GET_IFACE (object)->get_categories (object);
4223 * scanner1_dup_categories: (skip)
4224 * @object: A #Scanner1.
4226 * Gets a copy of the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.Categories">"Categories"</link> D-Bus property.
4228 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4230 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref().
4233 scanner1_dup_categories (Scanner1 *object)
4236 g_object_get (G_OBJECT (object), "categories", &value, NULL);
4241 * scanner1_set_categories: (skip)
4242 * @object: A #Scanner1.
4243 * @value: The value to set.
4245 * Sets the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.Categories">"Categories"</link> D-Bus property to @value.
4247 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4250 scanner1_set_categories (Scanner1 *object, GVariant *value)
4252 g_object_set (G_OBJECT (object), "categories", value, NULL);
4256 * scanner1_emit_scan_progress:
4257 * @object: A #Scanner1.
4258 * @arg_Category: Argument to pass with the signal.
4259 * @arg_Path: Argument to pass with the signal.
4260 * @arg_UpToDate: Argument to pass with the signal.
4261 * @arg_Processed: Argument to pass with the signal.
4262 * @arg_Deleted: Argument to pass with the signal.
4263 * @arg_Skipped: Argument to pass with the signal.
4264 * @arg_Errors: Argument to pass with the signal.
4266 * Emits the <link linkend="gdbus-signal-org-lightmediascanner-Scanner1.ScanProgress">"ScanProgress"</link> D-Bus signal.
4269 scanner1_emit_scan_progress (
4271 const gchar *arg_Category,
4272 const gchar *arg_Path,
4273 guint64 arg_UpToDate,
4274 guint64 arg_Processed,
4275 guint64 arg_Deleted,
4276 guint64 arg_Skipped,
4279 g_signal_emit_by_name (object, "scan-progress", arg_Category, arg_Path, arg_UpToDate, arg_Processed, arg_Deleted, arg_Skipped, arg_Errors);
4283 * scanner1_call_scan:
4284 * @proxy: A #Scanner1Proxy.
4285 * @arg_specification: Argument to pass with the method invocation.
4286 * @cancellable: (allow-none): A #GCancellable or %NULL.
4287 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
4288 * @user_data: User data to pass to @callback.
4290 * Asynchronously invokes the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.Scan">Scan()</link> D-Bus method on @proxy.
4291 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
4292 * You can then call scanner1_call_scan_finish() to get the result of the operation.
4294 * See scanner1_call_scan_sync() for the synchronous, blocking version of this method.
4297 scanner1_call_scan (
4299 GVariant *arg_specification,
4300 GCancellable *cancellable,
4301 GAsyncReadyCallback callback,
4304 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
4306 g_variant_new ("(@a{sv})",
4308 G_DBUS_CALL_FLAGS_NONE,
4316 * scanner1_call_scan_finish:
4317 * @proxy: A #Scanner1Proxy.
4318 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to scanner1_call_scan().
4319 * @error: Return location for error or %NULL.
4321 * Finishes an operation started with scanner1_call_scan().
4323 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4326 scanner1_call_scan_finish (
4332 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
4335 g_variant_get (_ret,
4337 g_variant_unref (_ret);
4339 return _ret != NULL;
4343 * scanner1_call_scan_sync:
4344 * @proxy: A #Scanner1Proxy.
4345 * @arg_specification: Argument to pass with the method invocation.
4346 * @cancellable: (allow-none): A #GCancellable or %NULL.
4347 * @error: Return location for error or %NULL.
4349 * Synchronously invokes the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.Scan">Scan()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
4351 * See scanner1_call_scan() for the asynchronous version of this method.
4353 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4356 scanner1_call_scan_sync (
4358 GVariant *arg_specification,
4359 GCancellable *cancellable,
4363 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
4365 g_variant_new ("(@a{sv})",
4367 G_DBUS_CALL_FLAGS_NONE,
4373 g_variant_get (_ret,
4375 g_variant_unref (_ret);
4377 return _ret != NULL;
4381 * scanner1_call_stop:
4382 * @proxy: A #Scanner1Proxy.
4383 * @cancellable: (allow-none): A #GCancellable or %NULL.
4384 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
4385 * @user_data: User data to pass to @callback.
4387 * Asynchronously invokes the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.Stop">Stop()</link> D-Bus method on @proxy.
4388 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
4389 * You can then call scanner1_call_stop_finish() to get the result of the operation.
4391 * See scanner1_call_stop_sync() for the synchronous, blocking version of this method.
4394 scanner1_call_stop (
4396 GCancellable *cancellable,
4397 GAsyncReadyCallback callback,
4400 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
4402 g_variant_new ("()"),
4403 G_DBUS_CALL_FLAGS_NONE,
4411 * scanner1_call_stop_finish:
4412 * @proxy: A #Scanner1Proxy.
4413 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to scanner1_call_stop().
4414 * @error: Return location for error or %NULL.
4416 * Finishes an operation started with scanner1_call_stop().
4418 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4421 scanner1_call_stop_finish (
4427 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
4430 g_variant_get (_ret,
4432 g_variant_unref (_ret);
4434 return _ret != NULL;
4438 * scanner1_call_stop_sync:
4439 * @proxy: A #Scanner1Proxy.
4440 * @cancellable: (allow-none): A #GCancellable or %NULL.
4441 * @error: Return location for error or %NULL.
4443 * Synchronously invokes the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.Stop">Stop()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
4445 * See scanner1_call_stop() for the asynchronous version of this method.
4447 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4450 scanner1_call_stop_sync (
4452 GCancellable *cancellable,
4456 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
4458 g_variant_new ("()"),
4459 G_DBUS_CALL_FLAGS_NONE,
4465 g_variant_get (_ret,
4467 g_variant_unref (_ret);
4469 return _ret != NULL;
4473 * scanner1_call_request_write_lock:
4474 * @proxy: A #Scanner1Proxy.
4475 * @cancellable: (allow-none): A #GCancellable or %NULL.
4476 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
4477 * @user_data: User data to pass to @callback.
4479 * Asynchronously invokes the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.RequestWriteLock">RequestWriteLock()</link> D-Bus method on @proxy.
4480 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
4481 * You can then call scanner1_call_request_write_lock_finish() to get the result of the operation.
4483 * See scanner1_call_request_write_lock_sync() for the synchronous, blocking version of this method.
4486 scanner1_call_request_write_lock (
4488 GCancellable *cancellable,
4489 GAsyncReadyCallback callback,
4492 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
4494 g_variant_new ("()"),
4495 G_DBUS_CALL_FLAGS_NONE,
4503 * scanner1_call_request_write_lock_finish:
4504 * @proxy: A #Scanner1Proxy.
4505 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to scanner1_call_request_write_lock().
4506 * @error: Return location for error or %NULL.
4508 * Finishes an operation started with scanner1_call_request_write_lock().
4510 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4513 scanner1_call_request_write_lock_finish (
4519 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
4522 g_variant_get (_ret,
4524 g_variant_unref (_ret);
4526 return _ret != NULL;
4530 * scanner1_call_request_write_lock_sync:
4531 * @proxy: A #Scanner1Proxy.
4532 * @cancellable: (allow-none): A #GCancellable or %NULL.
4533 * @error: Return location for error or %NULL.
4535 * Synchronously invokes the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.RequestWriteLock">RequestWriteLock()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
4537 * See scanner1_call_request_write_lock() for the asynchronous version of this method.
4539 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4542 scanner1_call_request_write_lock_sync (
4544 GCancellable *cancellable,
4548 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
4550 g_variant_new ("()"),
4551 G_DBUS_CALL_FLAGS_NONE,
4557 g_variant_get (_ret,
4559 g_variant_unref (_ret);
4561 return _ret != NULL;
4565 * scanner1_call_release_write_lock:
4566 * @proxy: A #Scanner1Proxy.
4567 * @cancellable: (allow-none): A #GCancellable or %NULL.
4568 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
4569 * @user_data: User data to pass to @callback.
4571 * Asynchronously invokes the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.ReleaseWriteLock">ReleaseWriteLock()</link> D-Bus method on @proxy.
4572 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
4573 * You can then call scanner1_call_release_write_lock_finish() to get the result of the operation.
4575 * See scanner1_call_release_write_lock_sync() for the synchronous, blocking version of this method.
4578 scanner1_call_release_write_lock (
4580 GCancellable *cancellable,
4581 GAsyncReadyCallback callback,
4584 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
4586 g_variant_new ("()"),
4587 G_DBUS_CALL_FLAGS_NONE,
4595 * scanner1_call_release_write_lock_finish:
4596 * @proxy: A #Scanner1Proxy.
4597 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to scanner1_call_release_write_lock().
4598 * @error: Return location for error or %NULL.
4600 * Finishes an operation started with scanner1_call_release_write_lock().
4602 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4605 scanner1_call_release_write_lock_finish (
4611 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
4614 g_variant_get (_ret,
4616 g_variant_unref (_ret);
4618 return _ret != NULL;
4622 * scanner1_call_release_write_lock_sync:
4623 * @proxy: A #Scanner1Proxy.
4624 * @cancellable: (allow-none): A #GCancellable or %NULL.
4625 * @error: Return location for error or %NULL.
4627 * Synchronously invokes the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.ReleaseWriteLock">ReleaseWriteLock()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
4629 * See scanner1_call_release_write_lock() for the asynchronous version of this method.
4631 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4634 scanner1_call_release_write_lock_sync (
4636 GCancellable *cancellable,
4640 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
4642 g_variant_new ("()"),
4643 G_DBUS_CALL_FLAGS_NONE,
4649 g_variant_get (_ret,
4651 g_variant_unref (_ret);
4653 return _ret != NULL;
4657 * scanner1_complete_scan:
4658 * @object: A #Scanner1.
4659 * @invocation: (transfer full): A #GDBusMethodInvocation.
4661 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.Scan">Scan()</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.
4663 * This method will free @invocation, you cannot use it afterwards.
4666 scanner1_complete_scan (
4668 GDBusMethodInvocation *invocation)
4670 g_dbus_method_invocation_return_value (invocation,
4671 g_variant_new ("()"));
4675 * scanner1_complete_stop:
4676 * @object: A #Scanner1.
4677 * @invocation: (transfer full): A #GDBusMethodInvocation.
4679 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.Stop">Stop()</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.
4681 * This method will free @invocation, you cannot use it afterwards.
4684 scanner1_complete_stop (
4686 GDBusMethodInvocation *invocation)
4688 g_dbus_method_invocation_return_value (invocation,
4689 g_variant_new ("()"));
4693 * scanner1_complete_request_write_lock:
4694 * @object: A #Scanner1.
4695 * @invocation: (transfer full): A #GDBusMethodInvocation.
4697 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.RequestWriteLock">RequestWriteLock()</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.
4699 * This method will free @invocation, you cannot use it afterwards.
4702 scanner1_complete_request_write_lock (
4704 GDBusMethodInvocation *invocation)
4706 g_dbus_method_invocation_return_value (invocation,
4707 g_variant_new ("()"));
4711 * scanner1_complete_release_write_lock:
4712 * @object: A #Scanner1.
4713 * @invocation: (transfer full): A #GDBusMethodInvocation.
4715 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.ReleaseWriteLock">ReleaseWriteLock()</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.
4717 * This method will free @invocation, you cannot use it afterwards.
4720 scanner1_complete_release_write_lock (
4722 GDBusMethodInvocation *invocation)
4724 g_dbus_method_invocation_return_value (invocation,
4725 g_variant_new ("()"));
4728 /* ------------------------------------------------------------------------ */
4733 * The #Scanner1Proxy structure contains only private data and should only be accessed using the provided API.
4737 * Scanner1ProxyClass:
4738 * @parent_class: The parent class.
4740 * Class structure for #Scanner1Proxy.
4743 struct _Scanner1ProxyPrivate
4748 static void scanner1_proxy_iface_init (Scanner1Iface *iface);
4750 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
4751 G_DEFINE_TYPE_WITH_CODE (Scanner1Proxy, scanner1_proxy, G_TYPE_DBUS_PROXY,
4752 G_ADD_PRIVATE (Scanner1Proxy)
4753 G_IMPLEMENT_INTERFACE (TYPE_SCANNER1, scanner1_proxy_iface_init));
4756 G_DEFINE_TYPE_WITH_CODE (Scanner1Proxy, scanner1_proxy, G_TYPE_DBUS_PROXY,
4757 G_IMPLEMENT_INTERFACE (TYPE_SCANNER1, scanner1_proxy_iface_init));
4761 scanner1_proxy_finalize (GObject *object)
4763 Scanner1Proxy *proxy = SCANNER1_PROXY (object);
4764 g_datalist_clear (&proxy->priv->qdata);
4765 G_OBJECT_CLASS (scanner1_proxy_parent_class)->finalize (object);
4769 scanner1_proxy_get_property (GObject *object,
4772 GParamSpec *pspec G_GNUC_UNUSED)
4774 const _ExtendedGDBusPropertyInfo *info;
4776 g_assert (prop_id != 0 && prop_id - 1 < 5);
4777 info = _scanner1_property_info_pointers[prop_id - 1];
4778 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
4779 if (info->use_gvariant)
4781 g_value_set_variant (value, variant);
4785 if (variant != NULL)
4786 g_dbus_gvariant_to_gvalue (variant, value);
4788 if (variant != NULL)
4789 g_variant_unref (variant);
4793 scanner1_proxy_set_property_cb (GDBusProxy *proxy,
4797 const _ExtendedGDBusPropertyInfo *info = user_data;
4801 _ret = g_dbus_proxy_call_finish (proxy, res, &error);
4804 g_warning ("Error setting property '%s' on interface org.lightmediascanner.Scanner1: %s (%s, %d)",
4805 info->parent_struct.name,
4806 error->message, g_quark_to_string (error->domain), error->code);
4807 g_error_free (error);
4811 g_variant_unref (_ret);
4816 scanner1_proxy_set_property (GObject *object,
4818 const GValue *value,
4819 GParamSpec *pspec G_GNUC_UNUSED)
4821 const _ExtendedGDBusPropertyInfo *info;
4823 g_assert (prop_id != 0 && prop_id - 1 < 5);
4824 info = _scanner1_property_info_pointers[prop_id - 1];
4825 variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
4826 g_dbus_proxy_call (G_DBUS_PROXY (object),
4827 "org.freedesktop.DBus.Properties.Set",
4828 g_variant_new ("(ssv)", "org.lightmediascanner.Scanner1", info->parent_struct.name, variant),
4829 G_DBUS_CALL_FLAGS_NONE,
4831 NULL, (GAsyncReadyCallback) scanner1_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
4832 g_variant_unref (variant);
4836 scanner1_proxy_g_signal (GDBusProxy *proxy,
4837 const gchar *sender_name G_GNUC_UNUSED,
4838 const gchar *signal_name,
4839 GVariant *parameters)
4841 _ExtendedGDBusSignalInfo *info;
4848 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_scanner1_interface_info.parent_struct, signal_name);
4851 num_params = g_variant_n_children (parameters);
4852 paramv = g_new0 (GValue, num_params + 1);
4853 g_value_init (¶mv[0], TYPE_SCANNER1);
4854 g_value_set_object (¶mv[0], proxy);
4855 g_variant_iter_init (&iter, parameters);
4857 while ((child = g_variant_iter_next_value (&iter)) != NULL)
4859 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
4860 if (arg_info->use_gvariant)
4862 g_value_init (¶mv[n], G_TYPE_VARIANT);
4863 g_value_set_variant (¶mv[n], child);
4867 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
4868 g_variant_unref (child);
4870 signal_id = g_signal_lookup (info->signal_name, TYPE_SCANNER1);
4871 g_signal_emitv (paramv, signal_id, 0, NULL);
4872 for (n = 0; n < num_params + 1; n++)
4873 g_value_unset (¶mv[n]);
4878 scanner1_proxy_g_properties_changed (GDBusProxy *_proxy,
4879 GVariant *changed_properties,
4880 const gchar *const *invalidated_properties)
4882 Scanner1Proxy *proxy = SCANNER1_PROXY (_proxy);
4886 _ExtendedGDBusPropertyInfo *info;
4887 g_variant_get (changed_properties, "a{sv}", &iter);
4888 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
4890 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_scanner1_interface_info.parent_struct, key);
4891 g_datalist_remove_data (&proxy->priv->qdata, key);
4893 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
4895 g_variant_iter_free (iter);
4896 for (n = 0; invalidated_properties[n] != NULL; n++)
4898 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_scanner1_interface_info.parent_struct, invalidated_properties[n]);
4899 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
4901 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
4905 static const gchar *
4906 scanner1_proxy_get_data_base_path (Scanner1 *object)
4908 Scanner1Proxy *proxy = SCANNER1_PROXY (object);
4910 const gchar *value = NULL;
4911 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "DataBasePath");
4912 if (variant != NULL)
4914 value = g_variant_get_string (variant, NULL);
4915 g_variant_unref (variant);
4921 scanner1_proxy_get_is_scanning (Scanner1 *object)
4923 Scanner1Proxy *proxy = SCANNER1_PROXY (object);
4926 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "IsScanning");
4927 if (variant != NULL)
4929 value = g_variant_get_boolean (variant);
4930 g_variant_unref (variant);
4936 scanner1_proxy_get_write_locked (Scanner1 *object)
4938 Scanner1Proxy *proxy = SCANNER1_PROXY (object);
4941 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "WriteLocked");
4942 if (variant != NULL)
4944 value = g_variant_get_boolean (variant);
4945 g_variant_unref (variant);
4951 scanner1_proxy_get_update_id (Scanner1 *object)
4953 Scanner1Proxy *proxy = SCANNER1_PROXY (object);
4956 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "UpdateID");
4957 if (variant != NULL)
4959 value = g_variant_get_uint64 (variant);
4960 g_variant_unref (variant);
4966 scanner1_proxy_get_categories (Scanner1 *object)
4968 Scanner1Proxy *proxy = SCANNER1_PROXY (object);
4970 GVariant *value = NULL;
4971 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Categories");
4973 if (variant != NULL)
4974 g_variant_unref (variant);
4979 scanner1_proxy_init (Scanner1Proxy *proxy)
4981 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
4982 proxy->priv = scanner1_proxy_get_instance_private (proxy);
4984 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_SCANNER1_PROXY, Scanner1ProxyPrivate);
4987 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), scanner1_interface_info ());
4991 scanner1_proxy_class_init (Scanner1ProxyClass *klass)
4993 GObjectClass *gobject_class;
4994 GDBusProxyClass *proxy_class;
4996 gobject_class = G_OBJECT_CLASS (klass);
4997 gobject_class->finalize = scanner1_proxy_finalize;
4998 gobject_class->get_property = scanner1_proxy_get_property;
4999 gobject_class->set_property = scanner1_proxy_set_property;
5001 proxy_class = G_DBUS_PROXY_CLASS (klass);
5002 proxy_class->g_signal = scanner1_proxy_g_signal;
5003 proxy_class->g_properties_changed = scanner1_proxy_g_properties_changed;
5005 scanner1_override_properties (gobject_class, 1);
5007 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
5008 g_type_class_add_private (klass, sizeof (Scanner1ProxyPrivate));
5013 scanner1_proxy_iface_init (Scanner1Iface *iface)
5015 iface->get_data_base_path = scanner1_proxy_get_data_base_path;
5016 iface->get_is_scanning = scanner1_proxy_get_is_scanning;
5017 iface->get_write_locked = scanner1_proxy_get_write_locked;
5018 iface->get_update_id = scanner1_proxy_get_update_id;
5019 iface->get_categories = scanner1_proxy_get_categories;
5023 * scanner1_proxy_new:
5024 * @connection: A #GDBusConnection.
5025 * @flags: Flags from the #GDBusProxyFlags enumeration.
5026 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
5027 * @object_path: An object path.
5028 * @cancellable: (allow-none): A #GCancellable or %NULL.
5029 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
5030 * @user_data: User data to pass to @callback.
5032 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-lightmediascanner-Scanner1.top_of_page">org.lightmediascanner.Scanner1</link>. See g_dbus_proxy_new() for more details.
5034 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
5035 * You can then call scanner1_proxy_new_finish() to get the result of the operation.
5037 * See scanner1_proxy_new_sync() for the synchronous, blocking version of this constructor.
5040 scanner1_proxy_new (
5041 GDBusConnection *connection,
5042 GDBusProxyFlags flags,
5044 const gchar *object_path,
5045 GCancellable *cancellable,
5046 GAsyncReadyCallback callback,
5049 g_async_initable_new_async (TYPE_SCANNER1_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.lightmediascanner.Scanner1", NULL);
5053 * scanner1_proxy_new_finish:
5054 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to scanner1_proxy_new().
5055 * @error: Return location for error or %NULL
5057 * Finishes an operation started with scanner1_proxy_new().
5059 * Returns: (transfer full) (type Scanner1Proxy): The constructed proxy object or %NULL if @error is set.
5062 scanner1_proxy_new_finish (
5067 GObject *source_object;
5068 source_object = g_async_result_get_source_object (res);
5069 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
5070 g_object_unref (source_object);
5072 return SCANNER1 (ret);
5078 * scanner1_proxy_new_sync:
5079 * @connection: A #GDBusConnection.
5080 * @flags: Flags from the #GDBusProxyFlags enumeration.
5081 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
5082 * @object_path: An object path.
5083 * @cancellable: (allow-none): A #GCancellable or %NULL.
5084 * @error: Return location for error or %NULL
5086 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-lightmediascanner-Scanner1.top_of_page">org.lightmediascanner.Scanner1</link>. See g_dbus_proxy_new_sync() for more details.
5088 * The calling thread is blocked until a reply is received.
5090 * See scanner1_proxy_new() for the asynchronous version of this constructor.
5092 * Returns: (transfer full) (type Scanner1Proxy): The constructed proxy object or %NULL if @error is set.
5095 scanner1_proxy_new_sync (
5096 GDBusConnection *connection,
5097 GDBusProxyFlags flags,
5099 const gchar *object_path,
5100 GCancellable *cancellable,
5104 ret = g_initable_new (TYPE_SCANNER1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.lightmediascanner.Scanner1", NULL);
5106 return SCANNER1 (ret);
5113 * scanner1_proxy_new_for_bus:
5114 * @bus_type: A #GBusType.
5115 * @flags: Flags from the #GDBusProxyFlags enumeration.
5116 * @name: A bus name (well-known or unique).
5117 * @object_path: An object path.
5118 * @cancellable: (allow-none): A #GCancellable or %NULL.
5119 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
5120 * @user_data: User data to pass to @callback.
5122 * Like scanner1_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
5124 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
5125 * You can then call scanner1_proxy_new_for_bus_finish() to get the result of the operation.
5127 * See scanner1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
5130 scanner1_proxy_new_for_bus (
5132 GDBusProxyFlags flags,
5134 const gchar *object_path,
5135 GCancellable *cancellable,
5136 GAsyncReadyCallback callback,
5139 g_async_initable_new_async (TYPE_SCANNER1_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.lightmediascanner.Scanner1", NULL);
5143 * scanner1_proxy_new_for_bus_finish:
5144 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to scanner1_proxy_new_for_bus().
5145 * @error: Return location for error or %NULL
5147 * Finishes an operation started with scanner1_proxy_new_for_bus().
5149 * Returns: (transfer full) (type Scanner1Proxy): The constructed proxy object or %NULL if @error is set.
5152 scanner1_proxy_new_for_bus_finish (
5157 GObject *source_object;
5158 source_object = g_async_result_get_source_object (res);
5159 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
5160 g_object_unref (source_object);
5162 return SCANNER1 (ret);
5168 * scanner1_proxy_new_for_bus_sync:
5169 * @bus_type: A #GBusType.
5170 * @flags: Flags from the #GDBusProxyFlags enumeration.
5171 * @name: A bus name (well-known or unique).
5172 * @object_path: An object path.
5173 * @cancellable: (allow-none): A #GCancellable or %NULL.
5174 * @error: Return location for error or %NULL
5176 * Like scanner1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
5178 * The calling thread is blocked until a reply is received.
5180 * See scanner1_proxy_new_for_bus() for the asynchronous version of this constructor.
5182 * Returns: (transfer full) (type Scanner1Proxy): The constructed proxy object or %NULL if @error is set.
5185 scanner1_proxy_new_for_bus_sync (
5187 GDBusProxyFlags flags,
5189 const gchar *object_path,
5190 GCancellable *cancellable,
5194 ret = g_initable_new (TYPE_SCANNER1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.lightmediascanner.Scanner1", NULL);
5196 return SCANNER1 (ret);
5202 /* ------------------------------------------------------------------------ */
5207 * The #Scanner1Skeleton structure contains only private data and should only be accessed using the provided API.
5211 * Scanner1SkeletonClass:
5212 * @parent_class: The parent class.
5214 * Class structure for #Scanner1Skeleton.
5217 struct _Scanner1SkeletonPrivate
5220 GList *changed_properties;
5221 GSource *changed_properties_idle_source;
5222 GMainContext *context;
5227 _scanner1_skeleton_handle_method_call (
5228 GDBusConnection *connection G_GNUC_UNUSED,
5229 const gchar *sender G_GNUC_UNUSED,
5230 const gchar *object_path G_GNUC_UNUSED,
5231 const gchar *interface_name,
5232 const gchar *method_name,
5233 GVariant *parameters,
5234 GDBusMethodInvocation *invocation,
5237 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (user_data);
5238 _ExtendedGDBusMethodInfo *info;
5246 GValue return_value = G_VALUE_INIT;
5247 info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
5248 g_assert (info != NULL);
5249 num_params = g_variant_n_children (parameters);
5250 num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
5252 g_value_init (¶mv[n], TYPE_SCANNER1);
5253 g_value_set_object (¶mv[n++], skeleton);
5254 g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
5255 g_value_set_object (¶mv[n++], invocation);
5256 if (info->pass_fdlist)
5259 g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
5260 g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
5262 g_assert_not_reached ();
5265 g_variant_iter_init (&iter, parameters);
5266 while ((child = g_variant_iter_next_value (&iter)) != NULL)
5268 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
5269 if (arg_info->use_gvariant)
5271 g_value_init (¶mv[n], G_TYPE_VARIANT);
5272 g_value_set_variant (¶mv[n], child);
5276 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
5277 g_variant_unref (child);
5279 signal_id = g_signal_lookup (info->signal_name, TYPE_SCANNER1);
5280 g_value_init (&return_value, G_TYPE_BOOLEAN);
5281 g_signal_emitv (paramv, signal_id, 0, &return_value);
5282 if (!g_value_get_boolean (&return_value))
5283 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);
5284 g_value_unset (&return_value);
5285 for (n = 0; n < num_params + num_extra; n++)
5286 g_value_unset (¶mv[n]);
5291 _scanner1_skeleton_handle_get_property (
5292 GDBusConnection *connection G_GNUC_UNUSED,
5293 const gchar *sender G_GNUC_UNUSED,
5294 const gchar *object_path G_GNUC_UNUSED,
5295 const gchar *interface_name G_GNUC_UNUSED,
5296 const gchar *property_name,
5300 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (user_data);
5301 GValue value = G_VALUE_INIT;
5303 _ExtendedGDBusPropertyInfo *info;
5306 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_scanner1_interface_info.parent_struct, property_name);
5307 g_assert (info != NULL);
5308 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
5311 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
5315 g_value_init (&value, pspec->value_type);
5316 g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
5317 ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
5318 g_value_unset (&value);
5324 _scanner1_skeleton_handle_set_property (
5325 GDBusConnection *connection G_GNUC_UNUSED,
5326 const gchar *sender G_GNUC_UNUSED,
5327 const gchar *object_path G_GNUC_UNUSED,
5328 const gchar *interface_name G_GNUC_UNUSED,
5329 const gchar *property_name,
5334 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (user_data);
5335 GValue value = G_VALUE_INIT;
5337 _ExtendedGDBusPropertyInfo *info;
5340 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_scanner1_interface_info.parent_struct, property_name);
5341 g_assert (info != NULL);
5342 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
5345 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
5349 if (info->use_gvariant)
5350 g_value_set_variant (&value, variant);
5352 g_dbus_gvariant_to_gvalue (variant, &value);
5353 g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
5354 g_value_unset (&value);
5360 static const GDBusInterfaceVTable _scanner1_skeleton_vtable =
5362 _scanner1_skeleton_handle_method_call,
5363 _scanner1_skeleton_handle_get_property,
5364 _scanner1_skeleton_handle_set_property,
5368 static GDBusInterfaceInfo *
5369 scanner1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
5371 return scanner1_interface_info ();
5374 static GDBusInterfaceVTable *
5375 scanner1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
5377 return (GDBusInterfaceVTable *) &_scanner1_skeleton_vtable;
5381 scanner1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
5383 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (_skeleton);
5385 GVariantBuilder builder;
5387 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
5388 if (_scanner1_interface_info.parent_struct.properties == NULL)
5390 for (n = 0; _scanner1_interface_info.parent_struct.properties[n] != NULL; n++)
5392 GDBusPropertyInfo *info = _scanner1_interface_info.parent_struct.properties[n];
5393 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
5396 value = _scanner1_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.lightmediascanner.Scanner1", info->name, NULL, skeleton);
5399 g_variant_take_ref (value);
5400 g_variant_builder_add (&builder, "{sv}", info->name, value);
5401 g_variant_unref (value);
5406 return g_variant_builder_end (&builder);
5409 static gboolean _scanner1_emit_changed (gpointer user_data);
5412 scanner1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
5414 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (_skeleton);
5415 gboolean emit_changed = FALSE;
5417 g_mutex_lock (&skeleton->priv->lock);
5418 if (skeleton->priv->changed_properties_idle_source != NULL)
5420 g_source_destroy (skeleton->priv->changed_properties_idle_source);
5421 skeleton->priv->changed_properties_idle_source = NULL;
5422 emit_changed = TRUE;
5424 g_mutex_unlock (&skeleton->priv->lock);
5427 _scanner1_emit_changed (skeleton);
5431 _scanner1_on_signal_scan_progress (
5433 const gchar *arg_Category,
5434 const gchar *arg_Path,
5435 guint64 arg_UpToDate,
5436 guint64 arg_Processed,
5437 guint64 arg_Deleted,
5438 guint64 arg_Skipped,
5441 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5443 GList *connections, *l;
5444 GVariant *signal_variant;
5445 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
5447 signal_variant = g_variant_ref_sink (g_variant_new ("(ssttttt)",
5455 for (l = connections; l != NULL; l = l->next)
5457 GDBusConnection *connection = l->data;
5458 g_dbus_connection_emit_signal (connection,
5459 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.lightmediascanner.Scanner1", "ScanProgress",
5460 signal_variant, NULL);
5462 g_variant_unref (signal_variant);
5463 g_list_free_full (connections, g_object_unref);
5466 static void scanner1_skeleton_iface_init (Scanner1Iface *iface);
5467 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
5468 G_DEFINE_TYPE_WITH_CODE (Scanner1Skeleton, scanner1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
5469 G_ADD_PRIVATE (Scanner1Skeleton)
5470 G_IMPLEMENT_INTERFACE (TYPE_SCANNER1, scanner1_skeleton_iface_init));
5473 G_DEFINE_TYPE_WITH_CODE (Scanner1Skeleton, scanner1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
5474 G_IMPLEMENT_INTERFACE (TYPE_SCANNER1, scanner1_skeleton_iface_init));
5478 scanner1_skeleton_finalize (GObject *object)
5480 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5482 for (n = 0; n < 5; n++)
5483 g_value_unset (&skeleton->priv->properties[n]);
5484 g_free (skeleton->priv->properties);
5485 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
5486 if (skeleton->priv->changed_properties_idle_source != NULL)
5487 g_source_destroy (skeleton->priv->changed_properties_idle_source);
5488 g_main_context_unref (skeleton->priv->context);
5489 g_mutex_clear (&skeleton->priv->lock);
5490 G_OBJECT_CLASS (scanner1_skeleton_parent_class)->finalize (object);
5494 scanner1_skeleton_get_property (GObject *object,
5497 GParamSpec *pspec G_GNUC_UNUSED)
5499 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5500 g_assert (prop_id != 0 && prop_id - 1 < 5);
5501 g_mutex_lock (&skeleton->priv->lock);
5502 g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
5503 g_mutex_unlock (&skeleton->priv->lock);
5507 _scanner1_emit_changed (gpointer user_data)
5509 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (user_data);
5511 GVariantBuilder builder;
5512 GVariantBuilder invalidated_builder;
5515 g_mutex_lock (&skeleton->priv->lock);
5516 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
5517 g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
5518 for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
5520 ChangedProperty *cp = l->data;
5522 const GValue *cur_value;
5524 cur_value = &skeleton->priv->properties[cp->prop_id - 1];
5525 if (!_g_value_equal (cur_value, &cp->orig_value))
5527 variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
5528 g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
5529 g_variant_unref (variant);
5533 if (num_changes > 0)
5535 GList *connections, *ll;
5536 GVariant *signal_variant;
5537 signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.lightmediascanner.Scanner1",
5538 &builder, &invalidated_builder));
5539 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
5540 for (ll = connections; ll != NULL; ll = ll->next)
5542 GDBusConnection *connection = ll->data;
5544 g_dbus_connection_emit_signal (connection,
5545 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
5546 "org.freedesktop.DBus.Properties",
5547 "PropertiesChanged",
5551 g_variant_unref (signal_variant);
5552 g_list_free_full (connections, g_object_unref);
5556 g_variant_builder_clear (&builder);
5557 g_variant_builder_clear (&invalidated_builder);
5559 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
5560 skeleton->priv->changed_properties = NULL;
5561 skeleton->priv->changed_properties_idle_source = NULL;
5562 g_mutex_unlock (&skeleton->priv->lock);
5567 _scanner1_schedule_emit_changed (Scanner1Skeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
5569 ChangedProperty *cp;
5572 for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
5574 ChangedProperty *i_cp = l->data;
5575 if (i_cp->info == info)
5583 cp = g_new0 (ChangedProperty, 1);
5584 cp->prop_id = prop_id;
5586 skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
5587 g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
5588 g_value_copy (orig_value, &cp->orig_value);
5593 scanner1_skeleton_notify (GObject *object,
5594 GParamSpec *pspec G_GNUC_UNUSED)
5596 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5597 g_mutex_lock (&skeleton->priv->lock);
5598 if (skeleton->priv->changed_properties != NULL &&
5599 skeleton->priv->changed_properties_idle_source == NULL)
5601 skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
5602 g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
5603 g_source_set_callback (skeleton->priv->changed_properties_idle_source, _scanner1_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
5604 g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _scanner1_emit_changed");
5605 g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
5606 g_source_unref (skeleton->priv->changed_properties_idle_source);
5608 g_mutex_unlock (&skeleton->priv->lock);
5612 scanner1_skeleton_set_property (GObject *object,
5614 const GValue *value,
5617 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5618 g_assert (prop_id != 0 && prop_id - 1 < 5);
5619 g_mutex_lock (&skeleton->priv->lock);
5620 g_object_freeze_notify (object);
5621 if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
5623 if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
5624 _scanner1_schedule_emit_changed (skeleton, _scanner1_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
5625 g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
5626 g_object_notify_by_pspec (object, pspec);
5628 g_mutex_unlock (&skeleton->priv->lock);
5629 g_object_thaw_notify (object);
5633 scanner1_skeleton_init (Scanner1Skeleton *skeleton)
5635 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
5636 skeleton->priv = scanner1_skeleton_get_instance_private (skeleton);
5638 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_SCANNER1_SKELETON, Scanner1SkeletonPrivate);
5641 g_mutex_init (&skeleton->priv->lock);
5642 skeleton->priv->context = g_main_context_ref_thread_default ();
5643 skeleton->priv->properties = g_new0 (GValue, 5);
5644 g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING);
5645 g_value_init (&skeleton->priv->properties[1], G_TYPE_BOOLEAN);
5646 g_value_init (&skeleton->priv->properties[2], G_TYPE_BOOLEAN);
5647 g_value_init (&skeleton->priv->properties[3], G_TYPE_UINT64);
5648 g_value_init (&skeleton->priv->properties[4], G_TYPE_VARIANT);
5651 static const gchar *
5652 scanner1_skeleton_get_data_base_path (Scanner1 *object)
5654 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5656 g_mutex_lock (&skeleton->priv->lock);
5657 value = g_value_get_string (&(skeleton->priv->properties[0]));
5658 g_mutex_unlock (&skeleton->priv->lock);
5663 scanner1_skeleton_get_is_scanning (Scanner1 *object)
5665 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5667 g_mutex_lock (&skeleton->priv->lock);
5668 value = g_value_get_boolean (&(skeleton->priv->properties[1]));
5669 g_mutex_unlock (&skeleton->priv->lock);
5674 scanner1_skeleton_get_write_locked (Scanner1 *object)
5676 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5678 g_mutex_lock (&skeleton->priv->lock);
5679 value = g_value_get_boolean (&(skeleton->priv->properties[2]));
5680 g_mutex_unlock (&skeleton->priv->lock);
5685 scanner1_skeleton_get_update_id (Scanner1 *object)
5687 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5689 g_mutex_lock (&skeleton->priv->lock);
5690 value = g_value_get_uint64 (&(skeleton->priv->properties[3]));
5691 g_mutex_unlock (&skeleton->priv->lock);
5696 scanner1_skeleton_get_categories (Scanner1 *object)
5698 Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5700 g_mutex_lock (&skeleton->priv->lock);
5701 value = g_value_get_variant (&(skeleton->priv->properties[4]));
5702 g_mutex_unlock (&skeleton->priv->lock);
5707 scanner1_skeleton_class_init (Scanner1SkeletonClass *klass)
5709 GObjectClass *gobject_class;
5710 GDBusInterfaceSkeletonClass *skeleton_class;
5712 gobject_class = G_OBJECT_CLASS (klass);
5713 gobject_class->finalize = scanner1_skeleton_finalize;
5714 gobject_class->get_property = scanner1_skeleton_get_property;
5715 gobject_class->set_property = scanner1_skeleton_set_property;
5716 gobject_class->notify = scanner1_skeleton_notify;
5719 scanner1_override_properties (gobject_class, 1);
5721 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
5722 skeleton_class->get_info = scanner1_skeleton_dbus_interface_get_info;
5723 skeleton_class->get_properties = scanner1_skeleton_dbus_interface_get_properties;
5724 skeleton_class->flush = scanner1_skeleton_dbus_interface_flush;
5725 skeleton_class->get_vtable = scanner1_skeleton_dbus_interface_get_vtable;
5727 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
5728 g_type_class_add_private (klass, sizeof (Scanner1SkeletonPrivate));
5733 scanner1_skeleton_iface_init (Scanner1Iface *iface)
5735 iface->scan_progress = _scanner1_on_signal_scan_progress;
5736 iface->get_data_base_path = scanner1_skeleton_get_data_base_path;
5737 iface->get_is_scanning = scanner1_skeleton_get_is_scanning;
5738 iface->get_write_locked = scanner1_skeleton_get_write_locked;
5739 iface->get_update_id = scanner1_skeleton_get_update_id;
5740 iface->get_categories = scanner1_skeleton_get_categories;
5744 * scanner1_skeleton_new:
5746 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-lightmediascanner-Scanner1.top_of_page">org.lightmediascanner.Scanner1</link>.
5748 * Returns: (transfer full) (type Scanner1Skeleton): The skeleton object.
5751 scanner1_skeleton_new (void)
5753 return SCANNER1 (g_object_new (TYPE_SCANNER1_SKELETON, NULL));