Add sound manager initial source code
[staging/soundmanager.git] / sample / mediaplayer / binding / gdbus / lightmediascanner_interface.c
1 /*
2  * Generated by gdbus-codegen 2.52.0. DO NOT EDIT.
3  *
4  * The license of this code is the same as for the source it was derived from.
5  */
6
7 #ifdef HAVE_CONFIG_H
8 #  include "config.h"
9 #endif
10
11 #include "lightmediascanner_interface.h"
12
13 #include <string.h>
14 #ifdef G_OS_UNIX
15 #  include <gio/gunixfdlist.h>
16 #endif
17
18 typedef struct
19 {
20   GDBusArgInfo parent_struct;
21   gboolean use_gvariant;
22 } _ExtendedGDBusArgInfo;
23
24 typedef struct
25 {
26   GDBusMethodInfo parent_struct;
27   const gchar *signal_name;
28   gboolean pass_fdlist;
29 } _ExtendedGDBusMethodInfo;
30
31 typedef struct
32 {
33   GDBusSignalInfo parent_struct;
34   const gchar *signal_name;
35 } _ExtendedGDBusSignalInfo;
36
37 typedef struct
38 {
39   GDBusPropertyInfo parent_struct;
40   const gchar *hyphen_name;
41   gboolean use_gvariant;
42 } _ExtendedGDBusPropertyInfo;
43
44 typedef struct
45 {
46   GDBusInterfaceInfo parent_struct;
47   const gchar *hyphen_name;
48 } _ExtendedGDBusInterfaceInfo;
49
50 typedef struct
51 {
52   const _ExtendedGDBusPropertyInfo *info;
53   guint prop_id;
54   GValue orig_value; /* the value before the change */
55 } ChangedProperty;
56
57 static void
58 _changed_property_free (ChangedProperty *data)
59 {
60   g_value_unset (&data->orig_value);
61   g_free (data);
62 }
63
64 static gboolean
65 _g_strv_equal0 (gchar **a, gchar **b)
66 {
67   gboolean ret = FALSE;
68   guint n;
69   if (a == NULL && b == NULL)
70     {
71       ret = TRUE;
72       goto out;
73     }
74   if (a == NULL || b == NULL)
75     goto out;
76   if (g_strv_length (a) != g_strv_length (b))
77     goto out;
78   for (n = 0; a[n] != NULL; n++)
79     if (g_strcmp0 (a[n], b[n]) != 0)
80       goto out;
81   ret = TRUE;
82 out:
83   return ret;
84 }
85
86 static gboolean
87 _g_variant_equal0 (GVariant *a, GVariant *b)
88 {
89   gboolean ret = FALSE;
90   if (a == NULL && b == NULL)
91     {
92       ret = TRUE;
93       goto out;
94     }
95   if (a == NULL || b == NULL)
96     goto out;
97   ret = g_variant_equal (a, b);
98 out:
99   return ret;
100 }
101
102 G_GNUC_UNUSED static gboolean
103 _g_value_equal (const GValue *a, const GValue *b)
104 {
105   gboolean ret = FALSE;
106   g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
107   switch (G_VALUE_TYPE (a))
108     {
109       case G_TYPE_BOOLEAN:
110         ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
111         break;
112       case G_TYPE_UCHAR:
113         ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
114         break;
115       case G_TYPE_INT:
116         ret = (g_value_get_int (a) == g_value_get_int (b));
117         break;
118       case G_TYPE_UINT:
119         ret = (g_value_get_uint (a) == g_value_get_uint (b));
120         break;
121       case G_TYPE_INT64:
122         ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
123         break;
124       case G_TYPE_UINT64:
125         ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
126         break;
127       case G_TYPE_DOUBLE:
128         {
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;
133         }
134         break;
135       case G_TYPE_STRING:
136         ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
137         break;
138       case G_TYPE_VARIANT:
139         ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
140         break;
141       default:
142         if (G_VALUE_TYPE (a) == G_TYPE_STRV)
143           ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
144         else
145           g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
146         break;
147     }
148   return ret;
149 }
150
151 /* ------------------------------------------------------------------------
152  * Code for interface org.freedesktop.DBus.Properties
153  * ------------------------------------------------------------------------
154  */
155
156 /**
157  * SECTION:OrgFreedesktopDBusProperties
158  * @title: OrgFreedesktopDBusProperties
159  * @short_description: Generated C code for the org.freedesktop.DBus.Properties D-Bus interface
160  *
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.
162  */
163
164 /* ---- Introspection data for org.freedesktop.DBus.Properties ---- */
165
166 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_get_IN_ARG_interface_name =
167 {
168   {
169     -1,
170     (gchar *) "interface_name",
171     (gchar *) "s",
172     NULL
173   },
174   FALSE
175 };
176
177 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_get_IN_ARG_property_name =
178 {
179   {
180     -1,
181     (gchar *) "property_name",
182     (gchar *) "s",
183     NULL
184   },
185   FALSE
186 };
187
188 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_method_info_get_IN_ARG_pointers[] =
189 {
190   &_org_freedesktop_dbus_properties_method_info_get_IN_ARG_interface_name,
191   &_org_freedesktop_dbus_properties_method_info_get_IN_ARG_property_name,
192   NULL
193 };
194
195 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_get_OUT_ARG_value =
196 {
197   {
198     -1,
199     (gchar *) "value",
200     (gchar *) "v",
201     NULL
202   },
203   FALSE
204 };
205
206 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_method_info_get_OUT_ARG_pointers[] =
207 {
208   &_org_freedesktop_dbus_properties_method_info_get_OUT_ARG_value,
209   NULL
210 };
211
212 static const _ExtendedGDBusMethodInfo _org_freedesktop_dbus_properties_method_info_get =
213 {
214   {
215     -1,
216     (gchar *) "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,
219     NULL
220   },
221   "handle-get",
222   FALSE
223 };
224
225 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_get_all_IN_ARG_interface_name =
226 {
227   {
228     -1,
229     (gchar *) "interface_name",
230     (gchar *) "s",
231     NULL
232   },
233   FALSE
234 };
235
236 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_method_info_get_all_IN_ARG_pointers[] =
237 {
238   &_org_freedesktop_dbus_properties_method_info_get_all_IN_ARG_interface_name,
239   NULL
240 };
241
242 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_get_all_OUT_ARG_properties =
243 {
244   {
245     -1,
246     (gchar *) "properties",
247     (gchar *) "a{sv}",
248     NULL
249   },
250   FALSE
251 };
252
253 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_method_info_get_all_OUT_ARG_pointers[] =
254 {
255   &_org_freedesktop_dbus_properties_method_info_get_all_OUT_ARG_properties,
256   NULL
257 };
258
259 static const _ExtendedGDBusMethodInfo _org_freedesktop_dbus_properties_method_info_get_all =
260 {
261   {
262     -1,
263     (gchar *) "GetAll",
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,
266     NULL
267   },
268   "handle-get-all",
269   FALSE
270 };
271
272 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_set_IN_ARG_interface_name =
273 {
274   {
275     -1,
276     (gchar *) "interface_name",
277     (gchar *) "s",
278     NULL
279   },
280   FALSE
281 };
282
283 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_set_IN_ARG_property_name =
284 {
285   {
286     -1,
287     (gchar *) "property_name",
288     (gchar *) "s",
289     NULL
290   },
291   FALSE
292 };
293
294 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_set_IN_ARG_value =
295 {
296   {
297     -1,
298     (gchar *) "value",
299     (gchar *) "v",
300     NULL
301   },
302   FALSE
303 };
304
305 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_method_info_set_IN_ARG_pointers[] =
306 {
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,
310   NULL
311 };
312
313 static const _ExtendedGDBusMethodInfo _org_freedesktop_dbus_properties_method_info_set =
314 {
315   {
316     -1,
317     (gchar *) "Set",
318     (GDBusArgInfo **) &_org_freedesktop_dbus_properties_method_info_set_IN_ARG_pointers,
319     NULL,
320     NULL
321   },
322   "handle-set",
323   FALSE
324 };
325
326 static const _ExtendedGDBusMethodInfo * const _org_freedesktop_dbus_properties_method_info_pointers[] =
327 {
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,
331   NULL
332 };
333
334 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_interface_name =
335 {
336   {
337     -1,
338     (gchar *) "interface_name",
339     (gchar *) "s",
340     NULL
341   },
342   FALSE
343 };
344
345 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_changed_properties =
346 {
347   {
348     -1,
349     (gchar *) "changed_properties",
350     (gchar *) "a{sv}",
351     NULL
352   },
353   FALSE
354 };
355
356 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_invalidated_properties =
357 {
358   {
359     -1,
360     (gchar *) "invalidated_properties",
361     (gchar *) "as",
362     NULL
363   },
364   FALSE
365 };
366
367 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_pointers[] =
368 {
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,
372   NULL
373 };
374
375 static const _ExtendedGDBusSignalInfo _org_freedesktop_dbus_properties_signal_info_properties_changed =
376 {
377   {
378     -1,
379     (gchar *) "PropertiesChanged",
380     (GDBusArgInfo **) &_org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_pointers,
381     NULL
382   },
383   "properties-changed"
384 };
385
386 static const _ExtendedGDBusSignalInfo * const _org_freedesktop_dbus_properties_signal_info_pointers[] =
387 {
388   &_org_freedesktop_dbus_properties_signal_info_properties_changed,
389   NULL
390 };
391
392 static const _ExtendedGDBusInterfaceInfo _org_freedesktop_dbus_properties_interface_info =
393 {
394   {
395     -1,
396     (gchar *) "org.freedesktop.DBus.Properties",
397     (GDBusMethodInfo **) &_org_freedesktop_dbus_properties_method_info_pointers,
398     (GDBusSignalInfo **) &_org_freedesktop_dbus_properties_signal_info_pointers,
399     NULL,
400     NULL
401   },
402   "org-freedesktop-dbus-properties",
403 };
404
405
406 /**
407  * org_freedesktop_dbus_properties_interface_info:
408  *
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.
410  *
411  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
412  */
413 GDBusInterfaceInfo *
414 org_freedesktop_dbus_properties_interface_info (void)
415 {
416   return (GDBusInterfaceInfo *) &_org_freedesktop_dbus_properties_interface_info.parent_struct;
417 }
418
419 /**
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.
423  *
424  * Overrides all #GObject properties in the #OrgFreedesktopDBusProperties interface for a concrete class.
425  * The properties are overridden in the order they are defined.
426  *
427  * Returns: The last property id.
428  */
429 guint
430 org_freedesktop_dbus_properties_override_properties (GObjectClass *klass, guint property_id_begin)
431 {
432   return property_id_begin - 1;
433 }
434
435
436
437 /**
438  * OrgFreedesktopDBusProperties:
439  *
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>.
441  */
442
443 /**
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.
450  *
451  * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>.
452  */
453
454 typedef OrgFreedesktopDBusPropertiesIface OrgFreedesktopDBusPropertiesInterface;
455 G_DEFINE_INTERFACE (OrgFreedesktopDBusProperties, org_freedesktop_dbus_properties, G_TYPE_OBJECT);
456
457 static void
458 org_freedesktop_dbus_properties_default_init (OrgFreedesktopDBusPropertiesIface *iface)
459 {
460   /* GObject signals for incoming D-Bus method calls: */
461   /**
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.
467    *
468    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Get">Get()</link> D-Bus method.
469    *
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.
471    *
472    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
473    */
474   g_signal_new ("handle-get",
475     G_TYPE_FROM_INTERFACE (iface),
476     G_SIGNAL_RUN_LAST,
477     G_STRUCT_OFFSET (OrgFreedesktopDBusPropertiesIface, handle_get),
478     g_signal_accumulator_true_handled,
479     NULL,
480     g_cclosure_marshal_generic,
481     G_TYPE_BOOLEAN,
482     3,
483     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING);
484
485   /**
486    * OrgFreedesktopDBusProperties::handle-get-all:
487    * @object: A #OrgFreedesktopDBusProperties.
488    * @invocation: A #GDBusMethodInvocation.
489    * @arg_interface_name: Argument passed by remote caller.
490    *
491    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.GetAll">GetAll()</link> D-Bus method.
492    *
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.
494    *
495    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
496    */
497   g_signal_new ("handle-get-all",
498     G_TYPE_FROM_INTERFACE (iface),
499     G_SIGNAL_RUN_LAST,
500     G_STRUCT_OFFSET (OrgFreedesktopDBusPropertiesIface, handle_get_all),
501     g_signal_accumulator_true_handled,
502     NULL,
503     g_cclosure_marshal_generic,
504     G_TYPE_BOOLEAN,
505     2,
506     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
507
508   /**
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.
515    *
516    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Set">Set()</link> D-Bus method.
517    *
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.
519    *
520    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
521    */
522   g_signal_new ("handle-set",
523     G_TYPE_FROM_INTERFACE (iface),
524     G_SIGNAL_RUN_LAST,
525     G_STRUCT_OFFSET (OrgFreedesktopDBusPropertiesIface, handle_set),
526     g_signal_accumulator_true_handled,
527     NULL,
528     g_cclosure_marshal_generic,
529     G_TYPE_BOOLEAN,
530     4,
531     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT);
532
533   /* GObject signals for received D-Bus signals: */
534   /**
535    * OrgFreedesktopDBusProperties::properties-changed:
536    * @object: A #OrgFreedesktopDBusProperties.
537    * @arg_interface_name: Argument.
538    * @arg_changed_properties: Argument.
539    * @arg_invalidated_properties: Argument.
540    *
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.
542    *
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.
544    */
545   g_signal_new ("properties-changed",
546     G_TYPE_FROM_INTERFACE (iface),
547     G_SIGNAL_RUN_LAST,
548     G_STRUCT_OFFSET (OrgFreedesktopDBusPropertiesIface, properties_changed),
549     NULL,
550     NULL,
551     g_cclosure_marshal_generic,
552     G_TYPE_NONE,
553     3, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_STRV);
554
555 }
556
557 /**
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.
563  *
564  * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus-Properties.PropertiesChanged">"PropertiesChanged"</link> D-Bus signal.
565  */
566 void
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)
572 {
573   g_signal_emit_by_name (object, "properties-changed", arg_interface_name, arg_changed_properties, arg_invalidated_properties);
574 }
575
576 /**
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.
584  *
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.
588  *
589  * See org_freedesktop_dbus_properties_call_get_sync() for the synchronous, blocking version of this method.
590  */
591 void
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,
598     gpointer user_data)
599 {
600   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
601     "Get",
602     g_variant_new ("(ss)",
603                    arg_interface_name,
604                    arg_property_name),
605     G_DBUS_CALL_FLAGS_NONE,
606     -1,
607     cancellable,
608     callback,
609     user_data);
610 }
611
612 /**
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.
618  *
619  * Finishes an operation started with org_freedesktop_dbus_properties_call_get().
620  *
621  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
622  */
623 gboolean
624 org_freedesktop_dbus_properties_call_get_finish (
625     OrgFreedesktopDBusProperties *proxy,
626     GVariant **out_value,
627     GAsyncResult *res,
628     GError **error)
629 {
630   GVariant *_ret;
631   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
632   if (_ret == NULL)
633     goto _out;
634   g_variant_get (_ret,
635                  "(@v)",
636                  out_value);
637   g_variant_unref (_ret);
638 _out:
639   return _ret != NULL;
640 }
641
642 /**
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.
650  *
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.
652  *
653  * See org_freedesktop_dbus_properties_call_get() for the asynchronous version of this method.
654  *
655  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
656  */
657 gboolean
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,
664     GError **error)
665 {
666   GVariant *_ret;
667   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
668     "Get",
669     g_variant_new ("(ss)",
670                    arg_interface_name,
671                    arg_property_name),
672     G_DBUS_CALL_FLAGS_NONE,
673     -1,
674     cancellable,
675     error);
676   if (_ret == NULL)
677     goto _out;
678   g_variant_get (_ret,
679                  "(@v)",
680                  out_value);
681   g_variant_unref (_ret);
682 _out:
683   return _ret != NULL;
684 }
685
686 /**
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.
693  *
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.
697  *
698  * See org_freedesktop_dbus_properties_call_get_all_sync() for the synchronous, blocking version of this method.
699  */
700 void
701 org_freedesktop_dbus_properties_call_get_all (
702     OrgFreedesktopDBusProperties *proxy,
703     const gchar *arg_interface_name,
704     GCancellable *cancellable,
705     GAsyncReadyCallback callback,
706     gpointer user_data)
707 {
708   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
709     "GetAll",
710     g_variant_new ("(s)",
711                    arg_interface_name),
712     G_DBUS_CALL_FLAGS_NONE,
713     -1,
714     cancellable,
715     callback,
716     user_data);
717 }
718
719 /**
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.
725  *
726  * Finishes an operation started with org_freedesktop_dbus_properties_call_get_all().
727  *
728  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
729  */
730 gboolean
731 org_freedesktop_dbus_properties_call_get_all_finish (
732     OrgFreedesktopDBusProperties *proxy,
733     GVariant **out_properties,
734     GAsyncResult *res,
735     GError **error)
736 {
737   GVariant *_ret;
738   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
739   if (_ret == NULL)
740     goto _out;
741   g_variant_get (_ret,
742                  "(@a{sv})",
743                  out_properties);
744   g_variant_unref (_ret);
745 _out:
746   return _ret != NULL;
747 }
748
749 /**
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.
756  *
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.
758  *
759  * See org_freedesktop_dbus_properties_call_get_all() for the asynchronous version of this method.
760  *
761  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
762  */
763 gboolean
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,
769     GError **error)
770 {
771   GVariant *_ret;
772   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
773     "GetAll",
774     g_variant_new ("(s)",
775                    arg_interface_name),
776     G_DBUS_CALL_FLAGS_NONE,
777     -1,
778     cancellable,
779     error);
780   if (_ret == NULL)
781     goto _out;
782   g_variant_get (_ret,
783                  "(@a{sv})",
784                  out_properties);
785   g_variant_unref (_ret);
786 _out:
787   return _ret != NULL;
788 }
789
790 /**
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.
799  *
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.
803  *
804  * See org_freedesktop_dbus_properties_call_set_sync() for the synchronous, blocking version of this method.
805  */
806 void
807 org_freedesktop_dbus_properties_call_set (
808     OrgFreedesktopDBusProperties *proxy,
809     const gchar *arg_interface_name,
810     const gchar *arg_property_name,
811     GVariant *arg_value,
812     GCancellable *cancellable,
813     GAsyncReadyCallback callback,
814     gpointer user_data)
815 {
816   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
817     "Set",
818     g_variant_new ("(ss@v)",
819                    arg_interface_name,
820                    arg_property_name,
821                    arg_value),
822     G_DBUS_CALL_FLAGS_NONE,
823     -1,
824     cancellable,
825     callback,
826     user_data);
827 }
828
829 /**
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.
834  *
835  * Finishes an operation started with org_freedesktop_dbus_properties_call_set().
836  *
837  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
838  */
839 gboolean
840 org_freedesktop_dbus_properties_call_set_finish (
841     OrgFreedesktopDBusProperties *proxy,
842     GAsyncResult *res,
843     GError **error)
844 {
845   GVariant *_ret;
846   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
847   if (_ret == NULL)
848     goto _out;
849   g_variant_get (_ret,
850                  "()");
851   g_variant_unref (_ret);
852 _out:
853   return _ret != NULL;
854 }
855
856 /**
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.
864  *
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.
866  *
867  * See org_freedesktop_dbus_properties_call_set() for the asynchronous version of this method.
868  *
869  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
870  */
871 gboolean
872 org_freedesktop_dbus_properties_call_set_sync (
873     OrgFreedesktopDBusProperties *proxy,
874     const gchar *arg_interface_name,
875     const gchar *arg_property_name,
876     GVariant *arg_value,
877     GCancellable *cancellable,
878     GError **error)
879 {
880   GVariant *_ret;
881   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
882     "Set",
883     g_variant_new ("(ss@v)",
884                    arg_interface_name,
885                    arg_property_name,
886                    arg_value),
887     G_DBUS_CALL_FLAGS_NONE,
888     -1,
889     cancellable,
890     error);
891   if (_ret == NULL)
892     goto _out;
893   g_variant_get (_ret,
894                  "()");
895   g_variant_unref (_ret);
896 _out:
897   return _ret != NULL;
898 }
899
900 /**
901  * org_freedesktop_dbus_properties_complete_get:
902  * @object: A #OrgFreedesktopDBusProperties.
903  * @invocation: (transfer full): A #GDBusMethodInvocation.
904  * @value: Parameter to return.
905  *
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.
907  *
908  * This method will free @invocation, you cannot use it afterwards.
909  */
910 void
911 org_freedesktop_dbus_properties_complete_get (
912     OrgFreedesktopDBusProperties *object,
913     GDBusMethodInvocation *invocation,
914     GVariant *value)
915 {
916   g_dbus_method_invocation_return_value (invocation,
917     g_variant_new ("(@v)",
918                    value));
919 }
920
921 /**
922  * org_freedesktop_dbus_properties_complete_get_all:
923  * @object: A #OrgFreedesktopDBusProperties.
924  * @invocation: (transfer full): A #GDBusMethodInvocation.
925  * @properties: Parameter to return.
926  *
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.
928  *
929  * This method will free @invocation, you cannot use it afterwards.
930  */
931 void
932 org_freedesktop_dbus_properties_complete_get_all (
933     OrgFreedesktopDBusProperties *object,
934     GDBusMethodInvocation *invocation,
935     GVariant *properties)
936 {
937   g_dbus_method_invocation_return_value (invocation,
938     g_variant_new ("(@a{sv})",
939                    properties));
940 }
941
942 /**
943  * org_freedesktop_dbus_properties_complete_set:
944  * @object: A #OrgFreedesktopDBusProperties.
945  * @invocation: (transfer full): A #GDBusMethodInvocation.
946  *
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.
948  *
949  * This method will free @invocation, you cannot use it afterwards.
950  */
951 void
952 org_freedesktop_dbus_properties_complete_set (
953     OrgFreedesktopDBusProperties *object,
954     GDBusMethodInvocation *invocation)
955 {
956   g_dbus_method_invocation_return_value (invocation,
957     g_variant_new ("()"));
958 }
959
960 /* ------------------------------------------------------------------------ */
961
962 /**
963  * OrgFreedesktopDBusPropertiesProxy:
964  *
965  * The #OrgFreedesktopDBusPropertiesProxy structure contains only private data and should only be accessed using the provided API.
966  */
967
968 /**
969  * OrgFreedesktopDBusPropertiesProxyClass:
970  * @parent_class: The parent class.
971  *
972  * Class structure for #OrgFreedesktopDBusPropertiesProxy.
973  */
974
975 struct _OrgFreedesktopDBusPropertiesProxyPrivate
976 {
977   GData *qdata;
978 };
979
980 static void org_freedesktop_dbus_properties_proxy_iface_init (OrgFreedesktopDBusPropertiesIface *iface);
981
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));
986
987 #else
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));
990
991 #endif
992 static void
993 org_freedesktop_dbus_properties_proxy_finalize (GObject *object)
994 {
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);
998 }
999
1000 static void
1001 org_freedesktop_dbus_properties_proxy_get_property (GObject      *object,
1002   guint         prop_id,
1003   GValue       *value,
1004   GParamSpec   *pspec G_GNUC_UNUSED)
1005 {
1006 }
1007
1008 static void
1009 org_freedesktop_dbus_properties_proxy_set_property (GObject      *object,
1010   guint         prop_id,
1011   const GValue *value,
1012   GParamSpec   *pspec G_GNUC_UNUSED)
1013 {
1014 }
1015
1016 static void
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)
1021 {
1022   _ExtendedGDBusSignalInfo *info;
1023   GVariantIter iter;
1024   GVariant *child;
1025   GValue *paramv;
1026   gsize num_params;
1027   gsize n;
1028   guint signal_id;
1029   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_properties_interface_info.parent_struct, signal_name);
1030   if (info == NULL)
1031     return;
1032   num_params = g_variant_n_children (parameters);
1033   paramv = g_new0 (GValue, num_params + 1);
1034   g_value_init (&paramv[0], TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES);
1035   g_value_set_object (&paramv[0], proxy);
1036   g_variant_iter_init (&iter, parameters);
1037   n = 1;
1038   while ((child = g_variant_iter_next_value (&iter)) != NULL)
1039     {
1040       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
1041       if (arg_info->use_gvariant)
1042         {
1043           g_value_init (&paramv[n], G_TYPE_VARIANT);
1044           g_value_set_variant (&paramv[n], child);
1045           n++;
1046         }
1047       else
1048         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
1049       g_variant_unref (child);
1050     }
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 (&paramv[n]);
1055   g_free (paramv);
1056 }
1057
1058 static void
1059 org_freedesktop_dbus_properties_proxy_g_properties_changed (GDBusProxy *_proxy,
1060   GVariant *changed_properties,
1061   const gchar *const *invalidated_properties)
1062 {
1063   OrgFreedesktopDBusPropertiesProxy *proxy = ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY (_proxy);
1064   guint n;
1065   const gchar *key;
1066   GVariantIter *iter;
1067   _ExtendedGDBusPropertyInfo *info;
1068   g_variant_get (changed_properties, "a{sv}", &iter);
1069   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
1070     {
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);
1073       if (info != NULL)
1074         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1075     }
1076   g_variant_iter_free (iter);
1077   for (n = 0; invalidated_properties[n] != NULL; n++)
1078     {
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]);
1081       if (info != NULL)
1082         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1083     }
1084 }
1085
1086 static void
1087 org_freedesktop_dbus_properties_proxy_init (OrgFreedesktopDBusPropertiesProxy *proxy)
1088 {
1089 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1090   proxy->priv = org_freedesktop_dbus_properties_proxy_get_instance_private (proxy);
1091 #else
1092   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY, OrgFreedesktopDBusPropertiesProxyPrivate);
1093 #endif
1094
1095   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), org_freedesktop_dbus_properties_interface_info ());
1096 }
1097
1098 static void
1099 org_freedesktop_dbus_properties_proxy_class_init (OrgFreedesktopDBusPropertiesProxyClass *klass)
1100 {
1101   GObjectClass *gobject_class;
1102   GDBusProxyClass *proxy_class;
1103
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;
1108
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;
1112
1113 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1114   g_type_class_add_private (klass, sizeof (OrgFreedesktopDBusPropertiesProxyPrivate));
1115 #endif
1116 }
1117
1118 static void
1119 org_freedesktop_dbus_properties_proxy_iface_init (OrgFreedesktopDBusPropertiesIface *iface)
1120 {
1121 }
1122
1123 /**
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.
1132  *
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.
1134  *
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.
1137  *
1138  * See org_freedesktop_dbus_properties_proxy_new_sync() for the synchronous, blocking version of this constructor.
1139  */
1140 void
1141 org_freedesktop_dbus_properties_proxy_new (
1142     GDBusConnection     *connection,
1143     GDBusProxyFlags      flags,
1144     const gchar         *name,
1145     const gchar         *object_path,
1146     GCancellable        *cancellable,
1147     GAsyncReadyCallback  callback,
1148     gpointer             user_data)
1149 {
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);
1151 }
1152
1153 /**
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
1157  *
1158  * Finishes an operation started with org_freedesktop_dbus_properties_proxy_new().
1159  *
1160  * Returns: (transfer full) (type OrgFreedesktopDBusPropertiesProxy): The constructed proxy object or %NULL if @error is set.
1161  */
1162 OrgFreedesktopDBusProperties *
1163 org_freedesktop_dbus_properties_proxy_new_finish (
1164     GAsyncResult        *res,
1165     GError             **error)
1166 {
1167   GObject *ret;
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);
1172   if (ret != NULL)
1173     return ORG_FREEDESKTOP_DBUS_PROPERTIES (ret);
1174   else
1175     return NULL;
1176 }
1177
1178 /**
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
1186  *
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.
1188  *
1189  * The calling thread is blocked until a reply is received.
1190  *
1191  * See org_freedesktop_dbus_properties_proxy_new() for the asynchronous version of this constructor.
1192  *
1193  * Returns: (transfer full) (type OrgFreedesktopDBusPropertiesProxy): The constructed proxy object or %NULL if @error is set.
1194  */
1195 OrgFreedesktopDBusProperties *
1196 org_freedesktop_dbus_properties_proxy_new_sync (
1197     GDBusConnection     *connection,
1198     GDBusProxyFlags      flags,
1199     const gchar         *name,
1200     const gchar         *object_path,
1201     GCancellable        *cancellable,
1202     GError             **error)
1203 {
1204   GInitable *ret;
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);
1206   if (ret != NULL)
1207     return ORG_FREEDESKTOP_DBUS_PROPERTIES (ret);
1208   else
1209     return NULL;
1210 }
1211
1212
1213 /**
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.
1222  *
1223  * Like org_freedesktop_dbus_properties_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
1224  *
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.
1227  *
1228  * See org_freedesktop_dbus_properties_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
1229  */
1230 void
1231 org_freedesktop_dbus_properties_proxy_new_for_bus (
1232     GBusType             bus_type,
1233     GDBusProxyFlags      flags,
1234     const gchar         *name,
1235     const gchar         *object_path,
1236     GCancellable        *cancellable,
1237     GAsyncReadyCallback  callback,
1238     gpointer             user_data)
1239 {
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);
1241 }
1242
1243 /**
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
1247  *
1248  * Finishes an operation started with org_freedesktop_dbus_properties_proxy_new_for_bus().
1249  *
1250  * Returns: (transfer full) (type OrgFreedesktopDBusPropertiesProxy): The constructed proxy object or %NULL if @error is set.
1251  */
1252 OrgFreedesktopDBusProperties *
1253 org_freedesktop_dbus_properties_proxy_new_for_bus_finish (
1254     GAsyncResult        *res,
1255     GError             **error)
1256 {
1257   GObject *ret;
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);
1262   if (ret != NULL)
1263     return ORG_FREEDESKTOP_DBUS_PROPERTIES (ret);
1264   else
1265     return NULL;
1266 }
1267
1268 /**
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
1276  *
1277  * Like org_freedesktop_dbus_properties_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
1278  *
1279  * The calling thread is blocked until a reply is received.
1280  *
1281  * See org_freedesktop_dbus_properties_proxy_new_for_bus() for the asynchronous version of this constructor.
1282  *
1283  * Returns: (transfer full) (type OrgFreedesktopDBusPropertiesProxy): The constructed proxy object or %NULL if @error is set.
1284  */
1285 OrgFreedesktopDBusProperties *
1286 org_freedesktop_dbus_properties_proxy_new_for_bus_sync (
1287     GBusType             bus_type,
1288     GDBusProxyFlags      flags,
1289     const gchar         *name,
1290     const gchar         *object_path,
1291     GCancellable        *cancellable,
1292     GError             **error)
1293 {
1294   GInitable *ret;
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);
1296   if (ret != NULL)
1297     return ORG_FREEDESKTOP_DBUS_PROPERTIES (ret);
1298   else
1299     return NULL;
1300 }
1301
1302
1303 /* ------------------------------------------------------------------------ */
1304
1305 /**
1306  * OrgFreedesktopDBusPropertiesSkeleton:
1307  *
1308  * The #OrgFreedesktopDBusPropertiesSkeleton structure contains only private data and should only be accessed using the provided API.
1309  */
1310
1311 /**
1312  * OrgFreedesktopDBusPropertiesSkeletonClass:
1313  * @parent_class: The parent class.
1314  *
1315  * Class structure for #OrgFreedesktopDBusPropertiesSkeleton.
1316  */
1317
1318 struct _OrgFreedesktopDBusPropertiesSkeletonPrivate
1319 {
1320   GValue *properties;
1321   GList *changed_properties;
1322   GSource *changed_properties_idle_source;
1323   GMainContext *context;
1324   GMutex lock;
1325 };
1326
1327 static void
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,
1336   gpointer user_data)
1337 {
1338   OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (user_data);
1339   _ExtendedGDBusMethodInfo *info;
1340   GVariantIter iter;
1341   GVariant *child;
1342   GValue *paramv;
1343   gsize num_params;
1344   guint num_extra;
1345   gsize n;
1346   guint signal_id;
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);
1352   n = 0;
1353   g_value_init (&paramv[n], TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES);
1354   g_value_set_object (&paramv[n++], skeleton);
1355   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
1356   g_value_set_object (&paramv[n++], invocation);
1357   if (info->pass_fdlist)
1358     {
1359 #ifdef G_OS_UNIX
1360       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
1361       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
1362 #else
1363       g_assert_not_reached ();
1364 #endif
1365     }
1366   g_variant_iter_init (&iter, parameters);
1367   while ((child = g_variant_iter_next_value (&iter)) != NULL)
1368     {
1369       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
1370       if (arg_info->use_gvariant)
1371         {
1372           g_value_init (&paramv[n], G_TYPE_VARIANT);
1373           g_value_set_variant (&paramv[n], child);
1374           n++;
1375         }
1376       else
1377         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
1378       g_variant_unref (child);
1379     }
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 (&paramv[n]);
1388   g_free (paramv);
1389 }
1390
1391 static GVariant *
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,
1398   GError **error,
1399   gpointer user_data)
1400 {
1401   OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (user_data);
1402   GValue value = G_VALUE_INIT;
1403   GParamSpec *pspec;
1404   _ExtendedGDBusPropertyInfo *info;
1405   GVariant *ret;
1406   ret = NULL;
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);
1410   if (pspec == NULL)
1411     {
1412       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1413     }
1414   else
1415     {
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);
1420     }
1421   return ret;
1422 }
1423
1424 static gboolean
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,
1431   GVariant *variant,
1432   GError **error,
1433   gpointer user_data)
1434 {
1435   OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (user_data);
1436   GValue value = G_VALUE_INIT;
1437   GParamSpec *pspec;
1438   _ExtendedGDBusPropertyInfo *info;
1439   gboolean ret;
1440   ret = FALSE;
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);
1444   if (pspec == NULL)
1445     {
1446       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1447     }
1448   else
1449     {
1450       if (info->use_gvariant)
1451         g_value_set_variant (&value, variant);
1452       else
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);
1456       ret = TRUE;
1457     }
1458   return ret;
1459 }
1460
1461 static const GDBusInterfaceVTable _org_freedesktop_dbus_properties_skeleton_vtable =
1462 {
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,
1466   {NULL}
1467 };
1468
1469 static GDBusInterfaceInfo *
1470 org_freedesktop_dbus_properties_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1471 {
1472   return org_freedesktop_dbus_properties_interface_info ();
1473 }
1474
1475 static GDBusInterfaceVTable *
1476 org_freedesktop_dbus_properties_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1477 {
1478   return (GDBusInterfaceVTable *) &_org_freedesktop_dbus_properties_skeleton_vtable;
1479 }
1480
1481 static GVariant *
1482 org_freedesktop_dbus_properties_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
1483 {
1484   OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (_skeleton);
1485
1486   GVariantBuilder builder;
1487   guint n;
1488   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
1489   if (_org_freedesktop_dbus_properties_interface_info.parent_struct.properties == NULL)
1490     goto out;
1491   for (n = 0; _org_freedesktop_dbus_properties_interface_info.parent_struct.properties[n] != NULL; n++)
1492     {
1493       GDBusPropertyInfo *info = _org_freedesktop_dbus_properties_interface_info.parent_struct.properties[n];
1494       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
1495         {
1496           GVariant *value;
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);
1498           if (value != NULL)
1499             {
1500               g_variant_take_ref (value);
1501               g_variant_builder_add (&builder, "{sv}", info->name, value);
1502               g_variant_unref (value);
1503             }
1504         }
1505     }
1506 out:
1507   return g_variant_builder_end (&builder);
1508 }
1509
1510 static void
1511 org_freedesktop_dbus_properties_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
1512 {
1513 }
1514
1515 static void
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)
1521 {
1522   OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (object);
1523
1524   GList      *connections, *l;
1525   GVariant   *signal_variant;
1526   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
1527
1528   signal_variant = g_variant_ref_sink (g_variant_new ("(s@a{sv}^as)",
1529                    arg_interface_name,
1530                    arg_changed_properties,
1531                    arg_invalidated_properties));
1532   for (l = connections; l != NULL; l = l->next)
1533     {
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);
1538     }
1539   g_variant_unref (signal_variant);
1540   g_list_free_full (connections, g_object_unref);
1541 }
1542
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));
1548
1549 #else
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));
1552
1553 #endif
1554 static void
1555 org_freedesktop_dbus_properties_skeleton_finalize (GObject *object)
1556 {
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);
1564 }
1565
1566 static void
1567 org_freedesktop_dbus_properties_skeleton_init (OrgFreedesktopDBusPropertiesSkeleton *skeleton)
1568 {
1569 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1570   skeleton->priv = org_freedesktop_dbus_properties_skeleton_get_instance_private (skeleton);
1571 #else
1572   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON, OrgFreedesktopDBusPropertiesSkeletonPrivate);
1573 #endif
1574
1575   g_mutex_init (&skeleton->priv->lock);
1576   skeleton->priv->context = g_main_context_ref_thread_default ();
1577 }
1578
1579 static void
1580 org_freedesktop_dbus_properties_skeleton_class_init (OrgFreedesktopDBusPropertiesSkeletonClass *klass)
1581 {
1582   GObjectClass *gobject_class;
1583   GDBusInterfaceSkeletonClass *skeleton_class;
1584
1585   gobject_class = G_OBJECT_CLASS (klass);
1586   gobject_class->finalize = org_freedesktop_dbus_properties_skeleton_finalize;
1587
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;
1593
1594 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1595   g_type_class_add_private (klass, sizeof (OrgFreedesktopDBusPropertiesSkeletonPrivate));
1596 #endif
1597 }
1598
1599 static void
1600 org_freedesktop_dbus_properties_skeleton_iface_init (OrgFreedesktopDBusPropertiesIface *iface)
1601 {
1602   iface->properties_changed = _org_freedesktop_dbus_properties_on_signal_properties_changed;
1603 }
1604
1605 /**
1606  * org_freedesktop_dbus_properties_skeleton_new:
1607  *
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>.
1609  *
1610  * Returns: (transfer full) (type OrgFreedesktopDBusPropertiesSkeleton): The skeleton object.
1611  */
1612 OrgFreedesktopDBusProperties *
1613 org_freedesktop_dbus_properties_skeleton_new (void)
1614 {
1615   return ORG_FREEDESKTOP_DBUS_PROPERTIES (g_object_new (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON, NULL));
1616 }
1617
1618 /* ------------------------------------------------------------------------
1619  * Code for interface org.freedesktop.DBus.Introspectable
1620  * ------------------------------------------------------------------------
1621  */
1622
1623 /**
1624  * SECTION:OrgFreedesktopDBusIntrospectable
1625  * @title: OrgFreedesktopDBusIntrospectable
1626  * @short_description: Generated C code for the org.freedesktop.DBus.Introspectable D-Bus interface
1627  *
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.
1629  */
1630
1631 /* ---- Introspection data for org.freedesktop.DBus.Introspectable ---- */
1632
1633 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_introspectable_method_info_introspect_OUT_ARG_xml_data =
1634 {
1635   {
1636     -1,
1637     (gchar *) "xml_data",
1638     (gchar *) "s",
1639     NULL
1640   },
1641   FALSE
1642 };
1643
1644 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_introspectable_method_info_introspect_OUT_ARG_pointers[] =
1645 {
1646   &_org_freedesktop_dbus_introspectable_method_info_introspect_OUT_ARG_xml_data,
1647   NULL
1648 };
1649
1650 static const _ExtendedGDBusMethodInfo _org_freedesktop_dbus_introspectable_method_info_introspect =
1651 {
1652   {
1653     -1,
1654     (gchar *) "Introspect",
1655     NULL,
1656     (GDBusArgInfo **) &_org_freedesktop_dbus_introspectable_method_info_introspect_OUT_ARG_pointers,
1657     NULL
1658   },
1659   "handle-introspect",
1660   FALSE
1661 };
1662
1663 static const _ExtendedGDBusMethodInfo * const _org_freedesktop_dbus_introspectable_method_info_pointers[] =
1664 {
1665   &_org_freedesktop_dbus_introspectable_method_info_introspect,
1666   NULL
1667 };
1668
1669 static const _ExtendedGDBusInterfaceInfo _org_freedesktop_dbus_introspectable_interface_info =
1670 {
1671   {
1672     -1,
1673     (gchar *) "org.freedesktop.DBus.Introspectable",
1674     (GDBusMethodInfo **) &_org_freedesktop_dbus_introspectable_method_info_pointers,
1675     NULL,
1676     NULL,
1677     NULL
1678   },
1679   "org-freedesktop-dbus-introspectable",
1680 };
1681
1682
1683 /**
1684  * org_freedesktop_dbus_introspectable_interface_info:
1685  *
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.
1687  *
1688  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
1689  */
1690 GDBusInterfaceInfo *
1691 org_freedesktop_dbus_introspectable_interface_info (void)
1692 {
1693   return (GDBusInterfaceInfo *) &_org_freedesktop_dbus_introspectable_interface_info.parent_struct;
1694 }
1695
1696 /**
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.
1700  *
1701  * Overrides all #GObject properties in the #OrgFreedesktopDBusIntrospectable interface for a concrete class.
1702  * The properties are overridden in the order they are defined.
1703  *
1704  * Returns: The last property id.
1705  */
1706 guint
1707 org_freedesktop_dbus_introspectable_override_properties (GObjectClass *klass, guint property_id_begin)
1708 {
1709   return property_id_begin - 1;
1710 }
1711
1712
1713
1714 /**
1715  * OrgFreedesktopDBusIntrospectable:
1716  *
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>.
1718  */
1719
1720 /**
1721  * OrgFreedesktopDBusIntrospectableIface:
1722  * @parent_iface: The parent interface.
1723  * @handle_introspect: Handler for the #OrgFreedesktopDBusIntrospectable::handle-introspect signal.
1724  *
1725  * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Introspectable.top_of_page">org.freedesktop.DBus.Introspectable</link>.
1726  */
1727
1728 typedef OrgFreedesktopDBusIntrospectableIface OrgFreedesktopDBusIntrospectableInterface;
1729 G_DEFINE_INTERFACE (OrgFreedesktopDBusIntrospectable, org_freedesktop_dbus_introspectable, G_TYPE_OBJECT);
1730
1731 static void
1732 org_freedesktop_dbus_introspectable_default_init (OrgFreedesktopDBusIntrospectableIface *iface)
1733 {
1734   /* GObject signals for incoming D-Bus method calls: */
1735   /**
1736    * OrgFreedesktopDBusIntrospectable::handle-introspect:
1737    * @object: A #OrgFreedesktopDBusIntrospectable.
1738    * @invocation: A #GDBusMethodInvocation.
1739    *
1740    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Introspectable.Introspect">Introspect()</link> D-Bus method.
1741    *
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.
1743    *
1744    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
1745    */
1746   g_signal_new ("handle-introspect",
1747     G_TYPE_FROM_INTERFACE (iface),
1748     G_SIGNAL_RUN_LAST,
1749     G_STRUCT_OFFSET (OrgFreedesktopDBusIntrospectableIface, handle_introspect),
1750     g_signal_accumulator_true_handled,
1751     NULL,
1752     g_cclosure_marshal_generic,
1753     G_TYPE_BOOLEAN,
1754     1,
1755     G_TYPE_DBUS_METHOD_INVOCATION);
1756
1757 }
1758
1759 /**
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.
1765  *
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.
1769  *
1770  * See org_freedesktop_dbus_introspectable_call_introspect_sync() for the synchronous, blocking version of this method.
1771  */
1772 void
1773 org_freedesktop_dbus_introspectable_call_introspect (
1774     OrgFreedesktopDBusIntrospectable *proxy,
1775     GCancellable *cancellable,
1776     GAsyncReadyCallback callback,
1777     gpointer user_data)
1778 {
1779   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1780     "Introspect",
1781     g_variant_new ("()"),
1782     G_DBUS_CALL_FLAGS_NONE,
1783     -1,
1784     cancellable,
1785     callback,
1786     user_data);
1787 }
1788
1789 /**
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.
1795  *
1796  * Finishes an operation started with org_freedesktop_dbus_introspectable_call_introspect().
1797  *
1798  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1799  */
1800 gboolean
1801 org_freedesktop_dbus_introspectable_call_introspect_finish (
1802     OrgFreedesktopDBusIntrospectable *proxy,
1803     gchar **out_xml_data,
1804     GAsyncResult *res,
1805     GError **error)
1806 {
1807   GVariant *_ret;
1808   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1809   if (_ret == NULL)
1810     goto _out;
1811   g_variant_get (_ret,
1812                  "(s)",
1813                  out_xml_data);
1814   g_variant_unref (_ret);
1815 _out:
1816   return _ret != NULL;
1817 }
1818
1819 /**
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.
1825  *
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.
1827  *
1828  * See org_freedesktop_dbus_introspectable_call_introspect() for the asynchronous version of this method.
1829  *
1830  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1831  */
1832 gboolean
1833 org_freedesktop_dbus_introspectable_call_introspect_sync (
1834     OrgFreedesktopDBusIntrospectable *proxy,
1835     gchar **out_xml_data,
1836     GCancellable *cancellable,
1837     GError **error)
1838 {
1839   GVariant *_ret;
1840   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1841     "Introspect",
1842     g_variant_new ("()"),
1843     G_DBUS_CALL_FLAGS_NONE,
1844     -1,
1845     cancellable,
1846     error);
1847   if (_ret == NULL)
1848     goto _out;
1849   g_variant_get (_ret,
1850                  "(s)",
1851                  out_xml_data);
1852   g_variant_unref (_ret);
1853 _out:
1854   return _ret != NULL;
1855 }
1856
1857 /**
1858  * org_freedesktop_dbus_introspectable_complete_introspect:
1859  * @object: A #OrgFreedesktopDBusIntrospectable.
1860  * @invocation: (transfer full): A #GDBusMethodInvocation.
1861  * @xml_data: Parameter to return.
1862  *
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.
1864  *
1865  * This method will free @invocation, you cannot use it afterwards.
1866  */
1867 void
1868 org_freedesktop_dbus_introspectable_complete_introspect (
1869     OrgFreedesktopDBusIntrospectable *object,
1870     GDBusMethodInvocation *invocation,
1871     const gchar *xml_data)
1872 {
1873   g_dbus_method_invocation_return_value (invocation,
1874     g_variant_new ("(s)",
1875                    xml_data));
1876 }
1877
1878 /* ------------------------------------------------------------------------ */
1879
1880 /**
1881  * OrgFreedesktopDBusIntrospectableProxy:
1882  *
1883  * The #OrgFreedesktopDBusIntrospectableProxy structure contains only private data and should only be accessed using the provided API.
1884  */
1885
1886 /**
1887  * OrgFreedesktopDBusIntrospectableProxyClass:
1888  * @parent_class: The parent class.
1889  *
1890  * Class structure for #OrgFreedesktopDBusIntrospectableProxy.
1891  */
1892
1893 struct _OrgFreedesktopDBusIntrospectableProxyPrivate
1894 {
1895   GData *qdata;
1896 };
1897
1898 static void org_freedesktop_dbus_introspectable_proxy_iface_init (OrgFreedesktopDBusIntrospectableIface *iface);
1899
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));
1904
1905 #else
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));
1908
1909 #endif
1910 static void
1911 org_freedesktop_dbus_introspectable_proxy_finalize (GObject *object)
1912 {
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);
1916 }
1917
1918 static void
1919 org_freedesktop_dbus_introspectable_proxy_get_property (GObject      *object,
1920   guint         prop_id,
1921   GValue       *value,
1922   GParamSpec   *pspec G_GNUC_UNUSED)
1923 {
1924 }
1925
1926 static void
1927 org_freedesktop_dbus_introspectable_proxy_set_property (GObject      *object,
1928   guint         prop_id,
1929   const GValue *value,
1930   GParamSpec   *pspec G_GNUC_UNUSED)
1931 {
1932 }
1933
1934 static void
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)
1939 {
1940   _ExtendedGDBusSignalInfo *info;
1941   GVariantIter iter;
1942   GVariant *child;
1943   GValue *paramv;
1944   gsize num_params;
1945   gsize n;
1946   guint signal_id;
1947   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_introspectable_interface_info.parent_struct, signal_name);
1948   if (info == NULL)
1949     return;
1950   num_params = g_variant_n_children (parameters);
1951   paramv = g_new0 (GValue, num_params + 1);
1952   g_value_init (&paramv[0], TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE);
1953   g_value_set_object (&paramv[0], proxy);
1954   g_variant_iter_init (&iter, parameters);
1955   n = 1;
1956   while ((child = g_variant_iter_next_value (&iter)) != NULL)
1957     {
1958       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
1959       if (arg_info->use_gvariant)
1960         {
1961           g_value_init (&paramv[n], G_TYPE_VARIANT);
1962           g_value_set_variant (&paramv[n], child);
1963           n++;
1964         }
1965       else
1966         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
1967       g_variant_unref (child);
1968     }
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 (&paramv[n]);
1973   g_free (paramv);
1974 }
1975
1976 static void
1977 org_freedesktop_dbus_introspectable_proxy_g_properties_changed (GDBusProxy *_proxy,
1978   GVariant *changed_properties,
1979   const gchar *const *invalidated_properties)
1980 {
1981   OrgFreedesktopDBusIntrospectableProxy *proxy = ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_PROXY (_proxy);
1982   guint n;
1983   const gchar *key;
1984   GVariantIter *iter;
1985   _ExtendedGDBusPropertyInfo *info;
1986   g_variant_get (changed_properties, "a{sv}", &iter);
1987   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
1988     {
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);
1991       if (info != NULL)
1992         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1993     }
1994   g_variant_iter_free (iter);
1995   for (n = 0; invalidated_properties[n] != NULL; n++)
1996     {
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]);
1999       if (info != NULL)
2000         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
2001     }
2002 }
2003
2004 static void
2005 org_freedesktop_dbus_introspectable_proxy_init (OrgFreedesktopDBusIntrospectableProxy *proxy)
2006 {
2007 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2008   proxy->priv = org_freedesktop_dbus_introspectable_proxy_get_instance_private (proxy);
2009 #else
2010   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_PROXY, OrgFreedesktopDBusIntrospectableProxyPrivate);
2011 #endif
2012
2013   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), org_freedesktop_dbus_introspectable_interface_info ());
2014 }
2015
2016 static void
2017 org_freedesktop_dbus_introspectable_proxy_class_init (OrgFreedesktopDBusIntrospectableProxyClass *klass)
2018 {
2019   GObjectClass *gobject_class;
2020   GDBusProxyClass *proxy_class;
2021
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;
2026
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;
2030
2031 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
2032   g_type_class_add_private (klass, sizeof (OrgFreedesktopDBusIntrospectableProxyPrivate));
2033 #endif
2034 }
2035
2036 static void
2037 org_freedesktop_dbus_introspectable_proxy_iface_init (OrgFreedesktopDBusIntrospectableIface *iface)
2038 {
2039 }
2040
2041 /**
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.
2050  *
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.
2052  *
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.
2055  *
2056  * See org_freedesktop_dbus_introspectable_proxy_new_sync() for the synchronous, blocking version of this constructor.
2057  */
2058 void
2059 org_freedesktop_dbus_introspectable_proxy_new (
2060     GDBusConnection     *connection,
2061     GDBusProxyFlags      flags,
2062     const gchar         *name,
2063     const gchar         *object_path,
2064     GCancellable        *cancellable,
2065     GAsyncReadyCallback  callback,
2066     gpointer             user_data)
2067 {
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);
2069 }
2070
2071 /**
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
2075  *
2076  * Finishes an operation started with org_freedesktop_dbus_introspectable_proxy_new().
2077  *
2078  * Returns: (transfer full) (type OrgFreedesktopDBusIntrospectableProxy): The constructed proxy object or %NULL if @error is set.
2079  */
2080 OrgFreedesktopDBusIntrospectable *
2081 org_freedesktop_dbus_introspectable_proxy_new_finish (
2082     GAsyncResult        *res,
2083     GError             **error)
2084 {
2085   GObject *ret;
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);
2090   if (ret != NULL)
2091     return ORG_FREEDESKTOP_DBUS_INTROSPECTABLE (ret);
2092   else
2093     return NULL;
2094 }
2095
2096 /**
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
2104  *
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.
2106  *
2107  * The calling thread is blocked until a reply is received.
2108  *
2109  * See org_freedesktop_dbus_introspectable_proxy_new() for the asynchronous version of this constructor.
2110  *
2111  * Returns: (transfer full) (type OrgFreedesktopDBusIntrospectableProxy): The constructed proxy object or %NULL if @error is set.
2112  */
2113 OrgFreedesktopDBusIntrospectable *
2114 org_freedesktop_dbus_introspectable_proxy_new_sync (
2115     GDBusConnection     *connection,
2116     GDBusProxyFlags      flags,
2117     const gchar         *name,
2118     const gchar         *object_path,
2119     GCancellable        *cancellable,
2120     GError             **error)
2121 {
2122   GInitable *ret;
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);
2124   if (ret != NULL)
2125     return ORG_FREEDESKTOP_DBUS_INTROSPECTABLE (ret);
2126   else
2127     return NULL;
2128 }
2129
2130
2131 /**
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.
2140  *
2141  * Like org_freedesktop_dbus_introspectable_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
2142  *
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.
2145  *
2146  * See org_freedesktop_dbus_introspectable_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
2147  */
2148 void
2149 org_freedesktop_dbus_introspectable_proxy_new_for_bus (
2150     GBusType             bus_type,
2151     GDBusProxyFlags      flags,
2152     const gchar         *name,
2153     const gchar         *object_path,
2154     GCancellable        *cancellable,
2155     GAsyncReadyCallback  callback,
2156     gpointer             user_data)
2157 {
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);
2159 }
2160
2161 /**
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
2165  *
2166  * Finishes an operation started with org_freedesktop_dbus_introspectable_proxy_new_for_bus().
2167  *
2168  * Returns: (transfer full) (type OrgFreedesktopDBusIntrospectableProxy): The constructed proxy object or %NULL if @error is set.
2169  */
2170 OrgFreedesktopDBusIntrospectable *
2171 org_freedesktop_dbus_introspectable_proxy_new_for_bus_finish (
2172     GAsyncResult        *res,
2173     GError             **error)
2174 {
2175   GObject *ret;
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);
2180   if (ret != NULL)
2181     return ORG_FREEDESKTOP_DBUS_INTROSPECTABLE (ret);
2182   else
2183     return NULL;
2184 }
2185
2186 /**
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
2194  *
2195  * Like org_freedesktop_dbus_introspectable_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
2196  *
2197  * The calling thread is blocked until a reply is received.
2198  *
2199  * See org_freedesktop_dbus_introspectable_proxy_new_for_bus() for the asynchronous version of this constructor.
2200  *
2201  * Returns: (transfer full) (type OrgFreedesktopDBusIntrospectableProxy): The constructed proxy object or %NULL if @error is set.
2202  */
2203 OrgFreedesktopDBusIntrospectable *
2204 org_freedesktop_dbus_introspectable_proxy_new_for_bus_sync (
2205     GBusType             bus_type,
2206     GDBusProxyFlags      flags,
2207     const gchar         *name,
2208     const gchar         *object_path,
2209     GCancellable        *cancellable,
2210     GError             **error)
2211 {
2212   GInitable *ret;
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);
2214   if (ret != NULL)
2215     return ORG_FREEDESKTOP_DBUS_INTROSPECTABLE (ret);
2216   else
2217     return NULL;
2218 }
2219
2220
2221 /* ------------------------------------------------------------------------ */
2222
2223 /**
2224  * OrgFreedesktopDBusIntrospectableSkeleton:
2225  *
2226  * The #OrgFreedesktopDBusIntrospectableSkeleton structure contains only private data and should only be accessed using the provided API.
2227  */
2228
2229 /**
2230  * OrgFreedesktopDBusIntrospectableSkeletonClass:
2231  * @parent_class: The parent class.
2232  *
2233  * Class structure for #OrgFreedesktopDBusIntrospectableSkeleton.
2234  */
2235
2236 struct _OrgFreedesktopDBusIntrospectableSkeletonPrivate
2237 {
2238   GValue *properties;
2239   GList *changed_properties;
2240   GSource *changed_properties_idle_source;
2241   GMainContext *context;
2242   GMutex lock;
2243 };
2244
2245 static void
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,
2254   gpointer user_data)
2255 {
2256   OrgFreedesktopDBusIntrospectableSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_SKELETON (user_data);
2257   _ExtendedGDBusMethodInfo *info;
2258   GVariantIter iter;
2259   GVariant *child;
2260   GValue *paramv;
2261   gsize num_params;
2262   guint num_extra;
2263   gsize n;
2264   guint signal_id;
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);
2270   n = 0;
2271   g_value_init (&paramv[n], TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE);
2272   g_value_set_object (&paramv[n++], skeleton);
2273   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
2274   g_value_set_object (&paramv[n++], invocation);
2275   if (info->pass_fdlist)
2276     {
2277 #ifdef G_OS_UNIX
2278       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
2279       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
2280 #else
2281       g_assert_not_reached ();
2282 #endif
2283     }
2284   g_variant_iter_init (&iter, parameters);
2285   while ((child = g_variant_iter_next_value (&iter)) != NULL)
2286     {
2287       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
2288       if (arg_info->use_gvariant)
2289         {
2290           g_value_init (&paramv[n], G_TYPE_VARIANT);
2291           g_value_set_variant (&paramv[n], child);
2292           n++;
2293         }
2294       else
2295         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
2296       g_variant_unref (child);
2297     }
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 (&paramv[n]);
2306   g_free (paramv);
2307 }
2308
2309 static GVariant *
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,
2316   GError **error,
2317   gpointer user_data)
2318 {
2319   OrgFreedesktopDBusIntrospectableSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_SKELETON (user_data);
2320   GValue value = G_VALUE_INIT;
2321   GParamSpec *pspec;
2322   _ExtendedGDBusPropertyInfo *info;
2323   GVariant *ret;
2324   ret = NULL;
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);
2328   if (pspec == NULL)
2329     {
2330       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
2331     }
2332   else
2333     {
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);
2338     }
2339   return ret;
2340 }
2341
2342 static gboolean
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,
2349   GVariant *variant,
2350   GError **error,
2351   gpointer user_data)
2352 {
2353   OrgFreedesktopDBusIntrospectableSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_SKELETON (user_data);
2354   GValue value = G_VALUE_INIT;
2355   GParamSpec *pspec;
2356   _ExtendedGDBusPropertyInfo *info;
2357   gboolean ret;
2358   ret = FALSE;
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);
2362   if (pspec == NULL)
2363     {
2364       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
2365     }
2366   else
2367     {
2368       if (info->use_gvariant)
2369         g_value_set_variant (&value, variant);
2370       else
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);
2374       ret = TRUE;
2375     }
2376   return ret;
2377 }
2378
2379 static const GDBusInterfaceVTable _org_freedesktop_dbus_introspectable_skeleton_vtable =
2380 {
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,
2384   {NULL}
2385 };
2386
2387 static GDBusInterfaceInfo *
2388 org_freedesktop_dbus_introspectable_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
2389 {
2390   return org_freedesktop_dbus_introspectable_interface_info ();
2391 }
2392
2393 static GDBusInterfaceVTable *
2394 org_freedesktop_dbus_introspectable_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
2395 {
2396   return (GDBusInterfaceVTable *) &_org_freedesktop_dbus_introspectable_skeleton_vtable;
2397 }
2398
2399 static GVariant *
2400 org_freedesktop_dbus_introspectable_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
2401 {
2402   OrgFreedesktopDBusIntrospectableSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_SKELETON (_skeleton);
2403
2404   GVariantBuilder builder;
2405   guint n;
2406   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
2407   if (_org_freedesktop_dbus_introspectable_interface_info.parent_struct.properties == NULL)
2408     goto out;
2409   for (n = 0; _org_freedesktop_dbus_introspectable_interface_info.parent_struct.properties[n] != NULL; n++)
2410     {
2411       GDBusPropertyInfo *info = _org_freedesktop_dbus_introspectable_interface_info.parent_struct.properties[n];
2412       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
2413         {
2414           GVariant *value;
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);
2416           if (value != NULL)
2417             {
2418               g_variant_take_ref (value);
2419               g_variant_builder_add (&builder, "{sv}", info->name, value);
2420               g_variant_unref (value);
2421             }
2422         }
2423     }
2424 out:
2425   return g_variant_builder_end (&builder);
2426 }
2427
2428 static void
2429 org_freedesktop_dbus_introspectable_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
2430 {
2431 }
2432
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));
2438
2439 #else
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));
2442
2443 #endif
2444 static void
2445 org_freedesktop_dbus_introspectable_skeleton_finalize (GObject *object)
2446 {
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);
2454 }
2455
2456 static void
2457 org_freedesktop_dbus_introspectable_skeleton_init (OrgFreedesktopDBusIntrospectableSkeleton *skeleton)
2458 {
2459 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2460   skeleton->priv = org_freedesktop_dbus_introspectable_skeleton_get_instance_private (skeleton);
2461 #else
2462   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_SKELETON, OrgFreedesktopDBusIntrospectableSkeletonPrivate);
2463 #endif
2464
2465   g_mutex_init (&skeleton->priv->lock);
2466   skeleton->priv->context = g_main_context_ref_thread_default ();
2467 }
2468
2469 static void
2470 org_freedesktop_dbus_introspectable_skeleton_class_init (OrgFreedesktopDBusIntrospectableSkeletonClass *klass)
2471 {
2472   GObjectClass *gobject_class;
2473   GDBusInterfaceSkeletonClass *skeleton_class;
2474
2475   gobject_class = G_OBJECT_CLASS (klass);
2476   gobject_class->finalize = org_freedesktop_dbus_introspectable_skeleton_finalize;
2477
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;
2483
2484 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
2485   g_type_class_add_private (klass, sizeof (OrgFreedesktopDBusIntrospectableSkeletonPrivate));
2486 #endif
2487 }
2488
2489 static void
2490 org_freedesktop_dbus_introspectable_skeleton_iface_init (OrgFreedesktopDBusIntrospectableIface *iface)
2491 {
2492 }
2493
2494 /**
2495  * org_freedesktop_dbus_introspectable_skeleton_new:
2496  *
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>.
2498  *
2499  * Returns: (transfer full) (type OrgFreedesktopDBusIntrospectableSkeleton): The skeleton object.
2500  */
2501 OrgFreedesktopDBusIntrospectable *
2502 org_freedesktop_dbus_introspectable_skeleton_new (void)
2503 {
2504   return ORG_FREEDESKTOP_DBUS_INTROSPECTABLE (g_object_new (TYPE_ORG_FREEDESKTOP_DBUS_INTROSPECTABLE_SKELETON, NULL));
2505 }
2506
2507 /* ------------------------------------------------------------------------
2508  * Code for interface org.freedesktop.DBus.Peer
2509  * ------------------------------------------------------------------------
2510  */
2511
2512 /**
2513  * SECTION:OrgFreedesktopDBusPeer
2514  * @title: OrgFreedesktopDBusPeer
2515  * @short_description: Generated C code for the org.freedesktop.DBus.Peer D-Bus interface
2516  *
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.
2518  */
2519
2520 /* ---- Introspection data for org.freedesktop.DBus.Peer ---- */
2521
2522 static const _ExtendedGDBusMethodInfo _org_freedesktop_dbus_peer_method_info_ping =
2523 {
2524   {
2525     -1,
2526     (gchar *) "Ping",
2527     NULL,
2528     NULL,
2529     NULL
2530   },
2531   "handle-ping",
2532   FALSE
2533 };
2534
2535 static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_peer_method_info_get_machine_id_OUT_ARG_machine_uuid =
2536 {
2537   {
2538     -1,
2539     (gchar *) "machine_uuid",
2540     (gchar *) "s",
2541     NULL
2542   },
2543   FALSE
2544 };
2545
2546 static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_peer_method_info_get_machine_id_OUT_ARG_pointers[] =
2547 {
2548   &_org_freedesktop_dbus_peer_method_info_get_machine_id_OUT_ARG_machine_uuid,
2549   NULL
2550 };
2551
2552 static const _ExtendedGDBusMethodInfo _org_freedesktop_dbus_peer_method_info_get_machine_id =
2553 {
2554   {
2555     -1,
2556     (gchar *) "GetMachineId",
2557     NULL,
2558     (GDBusArgInfo **) &_org_freedesktop_dbus_peer_method_info_get_machine_id_OUT_ARG_pointers,
2559     NULL
2560   },
2561   "handle-get-machine-id",
2562   FALSE
2563 };
2564
2565 static const _ExtendedGDBusMethodInfo * const _org_freedesktop_dbus_peer_method_info_pointers[] =
2566 {
2567   &_org_freedesktop_dbus_peer_method_info_ping,
2568   &_org_freedesktop_dbus_peer_method_info_get_machine_id,
2569   NULL
2570 };
2571
2572 static const _ExtendedGDBusInterfaceInfo _org_freedesktop_dbus_peer_interface_info =
2573 {
2574   {
2575     -1,
2576     (gchar *) "org.freedesktop.DBus.Peer",
2577     (GDBusMethodInfo **) &_org_freedesktop_dbus_peer_method_info_pointers,
2578     NULL,
2579     NULL,
2580     NULL
2581   },
2582   "org-freedesktop-dbus-peer",
2583 };
2584
2585
2586 /**
2587  * org_freedesktop_dbus_peer_interface_info:
2588  *
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.
2590  *
2591  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
2592  */
2593 GDBusInterfaceInfo *
2594 org_freedesktop_dbus_peer_interface_info (void)
2595 {
2596   return (GDBusInterfaceInfo *) &_org_freedesktop_dbus_peer_interface_info.parent_struct;
2597 }
2598
2599 /**
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.
2603  *
2604  * Overrides all #GObject properties in the #OrgFreedesktopDBusPeer interface for a concrete class.
2605  * The properties are overridden in the order they are defined.
2606  *
2607  * Returns: The last property id.
2608  */
2609 guint
2610 org_freedesktop_dbus_peer_override_properties (GObjectClass *klass, guint property_id_begin)
2611 {
2612   return property_id_begin - 1;
2613 }
2614
2615
2616
2617 /**
2618  * OrgFreedesktopDBusPeer:
2619  *
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>.
2621  */
2622
2623 /**
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.
2628  *
2629  * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Peer.top_of_page">org.freedesktop.DBus.Peer</link>.
2630  */
2631
2632 typedef OrgFreedesktopDBusPeerIface OrgFreedesktopDBusPeerInterface;
2633 G_DEFINE_INTERFACE (OrgFreedesktopDBusPeer, org_freedesktop_dbus_peer, G_TYPE_OBJECT);
2634
2635 static void
2636 org_freedesktop_dbus_peer_default_init (OrgFreedesktopDBusPeerIface *iface)
2637 {
2638   /* GObject signals for incoming D-Bus method calls: */
2639   /**
2640    * OrgFreedesktopDBusPeer::handle-ping:
2641    * @object: A #OrgFreedesktopDBusPeer.
2642    * @invocation: A #GDBusMethodInvocation.
2643    *
2644    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.Ping">Ping()</link> D-Bus method.
2645    *
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.
2647    *
2648    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
2649    */
2650   g_signal_new ("handle-ping",
2651     G_TYPE_FROM_INTERFACE (iface),
2652     G_SIGNAL_RUN_LAST,
2653     G_STRUCT_OFFSET (OrgFreedesktopDBusPeerIface, handle_ping),
2654     g_signal_accumulator_true_handled,
2655     NULL,
2656     g_cclosure_marshal_generic,
2657     G_TYPE_BOOLEAN,
2658     1,
2659     G_TYPE_DBUS_METHOD_INVOCATION);
2660
2661   /**
2662    * OrgFreedesktopDBusPeer::handle-get-machine-id:
2663    * @object: A #OrgFreedesktopDBusPeer.
2664    * @invocation: A #GDBusMethodInvocation.
2665    *
2666    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.GetMachineId">GetMachineId()</link> D-Bus method.
2667    *
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.
2669    *
2670    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
2671    */
2672   g_signal_new ("handle-get-machine-id",
2673     G_TYPE_FROM_INTERFACE (iface),
2674     G_SIGNAL_RUN_LAST,
2675     G_STRUCT_OFFSET (OrgFreedesktopDBusPeerIface, handle_get_machine_id),
2676     g_signal_accumulator_true_handled,
2677     NULL,
2678     g_cclosure_marshal_generic,
2679     G_TYPE_BOOLEAN,
2680     1,
2681     G_TYPE_DBUS_METHOD_INVOCATION);
2682
2683 }
2684
2685 /**
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.
2691  *
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.
2695  *
2696  * See org_freedesktop_dbus_peer_call_ping_sync() for the synchronous, blocking version of this method.
2697  */
2698 void
2699 org_freedesktop_dbus_peer_call_ping (
2700     OrgFreedesktopDBusPeer *proxy,
2701     GCancellable *cancellable,
2702     GAsyncReadyCallback callback,
2703     gpointer user_data)
2704 {
2705   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2706     "Ping",
2707     g_variant_new ("()"),
2708     G_DBUS_CALL_FLAGS_NONE,
2709     -1,
2710     cancellable,
2711     callback,
2712     user_data);
2713 }
2714
2715 /**
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.
2720  *
2721  * Finishes an operation started with org_freedesktop_dbus_peer_call_ping().
2722  *
2723  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
2724  */
2725 gboolean
2726 org_freedesktop_dbus_peer_call_ping_finish (
2727     OrgFreedesktopDBusPeer *proxy,
2728     GAsyncResult *res,
2729     GError **error)
2730 {
2731   GVariant *_ret;
2732   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2733   if (_ret == NULL)
2734     goto _out;
2735   g_variant_get (_ret,
2736                  "()");
2737   g_variant_unref (_ret);
2738 _out:
2739   return _ret != NULL;
2740 }
2741
2742 /**
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.
2747  *
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.
2749  *
2750  * See org_freedesktop_dbus_peer_call_ping() for the asynchronous version of this method.
2751  *
2752  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
2753  */
2754 gboolean
2755 org_freedesktop_dbus_peer_call_ping_sync (
2756     OrgFreedesktopDBusPeer *proxy,
2757     GCancellable *cancellable,
2758     GError **error)
2759 {
2760   GVariant *_ret;
2761   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2762     "Ping",
2763     g_variant_new ("()"),
2764     G_DBUS_CALL_FLAGS_NONE,
2765     -1,
2766     cancellable,
2767     error);
2768   if (_ret == NULL)
2769     goto _out;
2770   g_variant_get (_ret,
2771                  "()");
2772   g_variant_unref (_ret);
2773 _out:
2774   return _ret != NULL;
2775 }
2776
2777 /**
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.
2783  *
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.
2787  *
2788  * See org_freedesktop_dbus_peer_call_get_machine_id_sync() for the synchronous, blocking version of this method.
2789  */
2790 void
2791 org_freedesktop_dbus_peer_call_get_machine_id (
2792     OrgFreedesktopDBusPeer *proxy,
2793     GCancellable *cancellable,
2794     GAsyncReadyCallback callback,
2795     gpointer user_data)
2796 {
2797   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2798     "GetMachineId",
2799     g_variant_new ("()"),
2800     G_DBUS_CALL_FLAGS_NONE,
2801     -1,
2802     cancellable,
2803     callback,
2804     user_data);
2805 }
2806
2807 /**
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.
2813  *
2814  * Finishes an operation started with org_freedesktop_dbus_peer_call_get_machine_id().
2815  *
2816  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
2817  */
2818 gboolean
2819 org_freedesktop_dbus_peer_call_get_machine_id_finish (
2820     OrgFreedesktopDBusPeer *proxy,
2821     gchar **out_machine_uuid,
2822     GAsyncResult *res,
2823     GError **error)
2824 {
2825   GVariant *_ret;
2826   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2827   if (_ret == NULL)
2828     goto _out;
2829   g_variant_get (_ret,
2830                  "(s)",
2831                  out_machine_uuid);
2832   g_variant_unref (_ret);
2833 _out:
2834   return _ret != NULL;
2835 }
2836
2837 /**
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.
2843  *
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.
2845  *
2846  * See org_freedesktop_dbus_peer_call_get_machine_id() for the asynchronous version of this method.
2847  *
2848  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
2849  */
2850 gboolean
2851 org_freedesktop_dbus_peer_call_get_machine_id_sync (
2852     OrgFreedesktopDBusPeer *proxy,
2853     gchar **out_machine_uuid,
2854     GCancellable *cancellable,
2855     GError **error)
2856 {
2857   GVariant *_ret;
2858   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2859     "GetMachineId",
2860     g_variant_new ("()"),
2861     G_DBUS_CALL_FLAGS_NONE,
2862     -1,
2863     cancellable,
2864     error);
2865   if (_ret == NULL)
2866     goto _out;
2867   g_variant_get (_ret,
2868                  "(s)",
2869                  out_machine_uuid);
2870   g_variant_unref (_ret);
2871 _out:
2872   return _ret != NULL;
2873 }
2874
2875 /**
2876  * org_freedesktop_dbus_peer_complete_ping:
2877  * @object: A #OrgFreedesktopDBusPeer.
2878  * @invocation: (transfer full): A #GDBusMethodInvocation.
2879  *
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.
2881  *
2882  * This method will free @invocation, you cannot use it afterwards.
2883  */
2884 void
2885 org_freedesktop_dbus_peer_complete_ping (
2886     OrgFreedesktopDBusPeer *object,
2887     GDBusMethodInvocation *invocation)
2888 {
2889   g_dbus_method_invocation_return_value (invocation,
2890     g_variant_new ("()"));
2891 }
2892
2893 /**
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.
2898  *
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.
2900  *
2901  * This method will free @invocation, you cannot use it afterwards.
2902  */
2903 void
2904 org_freedesktop_dbus_peer_complete_get_machine_id (
2905     OrgFreedesktopDBusPeer *object,
2906     GDBusMethodInvocation *invocation,
2907     const gchar *machine_uuid)
2908 {
2909   g_dbus_method_invocation_return_value (invocation,
2910     g_variant_new ("(s)",
2911                    machine_uuid));
2912 }
2913
2914 /* ------------------------------------------------------------------------ */
2915
2916 /**
2917  * OrgFreedesktopDBusPeerProxy:
2918  *
2919  * The #OrgFreedesktopDBusPeerProxy structure contains only private data and should only be accessed using the provided API.
2920  */
2921
2922 /**
2923  * OrgFreedesktopDBusPeerProxyClass:
2924  * @parent_class: The parent class.
2925  *
2926  * Class structure for #OrgFreedesktopDBusPeerProxy.
2927  */
2928
2929 struct _OrgFreedesktopDBusPeerProxyPrivate
2930 {
2931   GData *qdata;
2932 };
2933
2934 static void org_freedesktop_dbus_peer_proxy_iface_init (OrgFreedesktopDBusPeerIface *iface);
2935
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));
2940
2941 #else
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));
2944
2945 #endif
2946 static void
2947 org_freedesktop_dbus_peer_proxy_finalize (GObject *object)
2948 {
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);
2952 }
2953
2954 static void
2955 org_freedesktop_dbus_peer_proxy_get_property (GObject      *object,
2956   guint         prop_id,
2957   GValue       *value,
2958   GParamSpec   *pspec G_GNUC_UNUSED)
2959 {
2960 }
2961
2962 static void
2963 org_freedesktop_dbus_peer_proxy_set_property (GObject      *object,
2964   guint         prop_id,
2965   const GValue *value,
2966   GParamSpec   *pspec G_GNUC_UNUSED)
2967 {
2968 }
2969
2970 static void
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)
2975 {
2976   _ExtendedGDBusSignalInfo *info;
2977   GVariantIter iter;
2978   GVariant *child;
2979   GValue *paramv;
2980   gsize num_params;
2981   gsize n;
2982   guint signal_id;
2983   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_peer_interface_info.parent_struct, signal_name);
2984   if (info == NULL)
2985     return;
2986   num_params = g_variant_n_children (parameters);
2987   paramv = g_new0 (GValue, num_params + 1);
2988   g_value_init (&paramv[0], TYPE_ORG_FREEDESKTOP_DBUS_PEER);
2989   g_value_set_object (&paramv[0], proxy);
2990   g_variant_iter_init (&iter, parameters);
2991   n = 1;
2992   while ((child = g_variant_iter_next_value (&iter)) != NULL)
2993     {
2994       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
2995       if (arg_info->use_gvariant)
2996         {
2997           g_value_init (&paramv[n], G_TYPE_VARIANT);
2998           g_value_set_variant (&paramv[n], child);
2999           n++;
3000         }
3001       else
3002         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
3003       g_variant_unref (child);
3004     }
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 (&paramv[n]);
3009   g_free (paramv);
3010 }
3011
3012 static void
3013 org_freedesktop_dbus_peer_proxy_g_properties_changed (GDBusProxy *_proxy,
3014   GVariant *changed_properties,
3015   const gchar *const *invalidated_properties)
3016 {
3017   OrgFreedesktopDBusPeerProxy *proxy = ORG_FREEDESKTOP_DBUS_PEER_PROXY (_proxy);
3018   guint n;
3019   const gchar *key;
3020   GVariantIter *iter;
3021   _ExtendedGDBusPropertyInfo *info;
3022   g_variant_get (changed_properties, "a{sv}", &iter);
3023   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
3024     {
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);
3027       if (info != NULL)
3028         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
3029     }
3030   g_variant_iter_free (iter);
3031   for (n = 0; invalidated_properties[n] != NULL; n++)
3032     {
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]);
3035       if (info != NULL)
3036         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
3037     }
3038 }
3039
3040 static void
3041 org_freedesktop_dbus_peer_proxy_init (OrgFreedesktopDBusPeerProxy *proxy)
3042 {
3043 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3044   proxy->priv = org_freedesktop_dbus_peer_proxy_get_instance_private (proxy);
3045 #else
3046   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_ORG_FREEDESKTOP_DBUS_PEER_PROXY, OrgFreedesktopDBusPeerProxyPrivate);
3047 #endif
3048
3049   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), org_freedesktop_dbus_peer_interface_info ());
3050 }
3051
3052 static void
3053 org_freedesktop_dbus_peer_proxy_class_init (OrgFreedesktopDBusPeerProxyClass *klass)
3054 {
3055   GObjectClass *gobject_class;
3056   GDBusProxyClass *proxy_class;
3057
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;
3062
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;
3066
3067 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
3068   g_type_class_add_private (klass, sizeof (OrgFreedesktopDBusPeerProxyPrivate));
3069 #endif
3070 }
3071
3072 static void
3073 org_freedesktop_dbus_peer_proxy_iface_init (OrgFreedesktopDBusPeerIface *iface)
3074 {
3075 }
3076
3077 /**
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.
3086  *
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.
3088  *
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.
3091  *
3092  * See org_freedesktop_dbus_peer_proxy_new_sync() for the synchronous, blocking version of this constructor.
3093  */
3094 void
3095 org_freedesktop_dbus_peer_proxy_new (
3096     GDBusConnection     *connection,
3097     GDBusProxyFlags      flags,
3098     const gchar         *name,
3099     const gchar         *object_path,
3100     GCancellable        *cancellable,
3101     GAsyncReadyCallback  callback,
3102     gpointer             user_data)
3103 {
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);
3105 }
3106
3107 /**
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
3111  *
3112  * Finishes an operation started with org_freedesktop_dbus_peer_proxy_new().
3113  *
3114  * Returns: (transfer full) (type OrgFreedesktopDBusPeerProxy): The constructed proxy object or %NULL if @error is set.
3115  */
3116 OrgFreedesktopDBusPeer *
3117 org_freedesktop_dbus_peer_proxy_new_finish (
3118     GAsyncResult        *res,
3119     GError             **error)
3120 {
3121   GObject *ret;
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);
3126   if (ret != NULL)
3127     return ORG_FREEDESKTOP_DBUS_PEER (ret);
3128   else
3129     return NULL;
3130 }
3131
3132 /**
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
3140  *
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.
3142  *
3143  * The calling thread is blocked until a reply is received.
3144  *
3145  * See org_freedesktop_dbus_peer_proxy_new() for the asynchronous version of this constructor.
3146  *
3147  * Returns: (transfer full) (type OrgFreedesktopDBusPeerProxy): The constructed proxy object or %NULL if @error is set.
3148  */
3149 OrgFreedesktopDBusPeer *
3150 org_freedesktop_dbus_peer_proxy_new_sync (
3151     GDBusConnection     *connection,
3152     GDBusProxyFlags      flags,
3153     const gchar         *name,
3154     const gchar         *object_path,
3155     GCancellable        *cancellable,
3156     GError             **error)
3157 {
3158   GInitable *ret;
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);
3160   if (ret != NULL)
3161     return ORG_FREEDESKTOP_DBUS_PEER (ret);
3162   else
3163     return NULL;
3164 }
3165
3166
3167 /**
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.
3176  *
3177  * Like org_freedesktop_dbus_peer_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
3178  *
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.
3181  *
3182  * See org_freedesktop_dbus_peer_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
3183  */
3184 void
3185 org_freedesktop_dbus_peer_proxy_new_for_bus (
3186     GBusType             bus_type,
3187     GDBusProxyFlags      flags,
3188     const gchar         *name,
3189     const gchar         *object_path,
3190     GCancellable        *cancellable,
3191     GAsyncReadyCallback  callback,
3192     gpointer             user_data)
3193 {
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);
3195 }
3196
3197 /**
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
3201  *
3202  * Finishes an operation started with org_freedesktop_dbus_peer_proxy_new_for_bus().
3203  *
3204  * Returns: (transfer full) (type OrgFreedesktopDBusPeerProxy): The constructed proxy object or %NULL if @error is set.
3205  */
3206 OrgFreedesktopDBusPeer *
3207 org_freedesktop_dbus_peer_proxy_new_for_bus_finish (
3208     GAsyncResult        *res,
3209     GError             **error)
3210 {
3211   GObject *ret;
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);
3216   if (ret != NULL)
3217     return ORG_FREEDESKTOP_DBUS_PEER (ret);
3218   else
3219     return NULL;
3220 }
3221
3222 /**
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
3230  *
3231  * Like org_freedesktop_dbus_peer_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
3232  *
3233  * The calling thread is blocked until a reply is received.
3234  *
3235  * See org_freedesktop_dbus_peer_proxy_new_for_bus() for the asynchronous version of this constructor.
3236  *
3237  * Returns: (transfer full) (type OrgFreedesktopDBusPeerProxy): The constructed proxy object or %NULL if @error is set.
3238  */
3239 OrgFreedesktopDBusPeer *
3240 org_freedesktop_dbus_peer_proxy_new_for_bus_sync (
3241     GBusType             bus_type,
3242     GDBusProxyFlags      flags,
3243     const gchar         *name,
3244     const gchar         *object_path,
3245     GCancellable        *cancellable,
3246     GError             **error)
3247 {
3248   GInitable *ret;
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);
3250   if (ret != NULL)
3251     return ORG_FREEDESKTOP_DBUS_PEER (ret);
3252   else
3253     return NULL;
3254 }
3255
3256
3257 /* ------------------------------------------------------------------------ */
3258
3259 /**
3260  * OrgFreedesktopDBusPeerSkeleton:
3261  *
3262  * The #OrgFreedesktopDBusPeerSkeleton structure contains only private data and should only be accessed using the provided API.
3263  */
3264
3265 /**
3266  * OrgFreedesktopDBusPeerSkeletonClass:
3267  * @parent_class: The parent class.
3268  *
3269  * Class structure for #OrgFreedesktopDBusPeerSkeleton.
3270  */
3271
3272 struct _OrgFreedesktopDBusPeerSkeletonPrivate
3273 {
3274   GValue *properties;
3275   GList *changed_properties;
3276   GSource *changed_properties_idle_source;
3277   GMainContext *context;
3278   GMutex lock;
3279 };
3280
3281 static void
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,
3290   gpointer user_data)
3291 {
3292   OrgFreedesktopDBusPeerSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PEER_SKELETON (user_data);
3293   _ExtendedGDBusMethodInfo *info;
3294   GVariantIter iter;
3295   GVariant *child;
3296   GValue *paramv;
3297   gsize num_params;
3298   guint num_extra;
3299   gsize n;
3300   guint signal_id;
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);
3306   n = 0;
3307   g_value_init (&paramv[n], TYPE_ORG_FREEDESKTOP_DBUS_PEER);
3308   g_value_set_object (&paramv[n++], skeleton);
3309   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
3310   g_value_set_object (&paramv[n++], invocation);
3311   if (info->pass_fdlist)
3312     {
3313 #ifdef G_OS_UNIX
3314       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
3315       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
3316 #else
3317       g_assert_not_reached ();
3318 #endif
3319     }
3320   g_variant_iter_init (&iter, parameters);
3321   while ((child = g_variant_iter_next_value (&iter)) != NULL)
3322     {
3323       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
3324       if (arg_info->use_gvariant)
3325         {
3326           g_value_init (&paramv[n], G_TYPE_VARIANT);
3327           g_value_set_variant (&paramv[n], child);
3328           n++;
3329         }
3330       else
3331         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
3332       g_variant_unref (child);
3333     }
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 (&paramv[n]);
3342   g_free (paramv);
3343 }
3344
3345 static GVariant *
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,
3352   GError **error,
3353   gpointer user_data)
3354 {
3355   OrgFreedesktopDBusPeerSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PEER_SKELETON (user_data);
3356   GValue value = G_VALUE_INIT;
3357   GParamSpec *pspec;
3358   _ExtendedGDBusPropertyInfo *info;
3359   GVariant *ret;
3360   ret = NULL;
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);
3364   if (pspec == NULL)
3365     {
3366       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
3367     }
3368   else
3369     {
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);
3374     }
3375   return ret;
3376 }
3377
3378 static gboolean
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,
3385   GVariant *variant,
3386   GError **error,
3387   gpointer user_data)
3388 {
3389   OrgFreedesktopDBusPeerSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PEER_SKELETON (user_data);
3390   GValue value = G_VALUE_INIT;
3391   GParamSpec *pspec;
3392   _ExtendedGDBusPropertyInfo *info;
3393   gboolean ret;
3394   ret = FALSE;
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);
3398   if (pspec == NULL)
3399     {
3400       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
3401     }
3402   else
3403     {
3404       if (info->use_gvariant)
3405         g_value_set_variant (&value, variant);
3406       else
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);
3410       ret = TRUE;
3411     }
3412   return ret;
3413 }
3414
3415 static const GDBusInterfaceVTable _org_freedesktop_dbus_peer_skeleton_vtable =
3416 {
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,
3420   {NULL}
3421 };
3422
3423 static GDBusInterfaceInfo *
3424 org_freedesktop_dbus_peer_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
3425 {
3426   return org_freedesktop_dbus_peer_interface_info ();
3427 }
3428
3429 static GDBusInterfaceVTable *
3430 org_freedesktop_dbus_peer_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
3431 {
3432   return (GDBusInterfaceVTable *) &_org_freedesktop_dbus_peer_skeleton_vtable;
3433 }
3434
3435 static GVariant *
3436 org_freedesktop_dbus_peer_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
3437 {
3438   OrgFreedesktopDBusPeerSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PEER_SKELETON (_skeleton);
3439
3440   GVariantBuilder builder;
3441   guint n;
3442   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
3443   if (_org_freedesktop_dbus_peer_interface_info.parent_struct.properties == NULL)
3444     goto out;
3445   for (n = 0; _org_freedesktop_dbus_peer_interface_info.parent_struct.properties[n] != NULL; n++)
3446     {
3447       GDBusPropertyInfo *info = _org_freedesktop_dbus_peer_interface_info.parent_struct.properties[n];
3448       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
3449         {
3450           GVariant *value;
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);
3452           if (value != NULL)
3453             {
3454               g_variant_take_ref (value);
3455               g_variant_builder_add (&builder, "{sv}", info->name, value);
3456               g_variant_unref (value);
3457             }
3458         }
3459     }
3460 out:
3461   return g_variant_builder_end (&builder);
3462 }
3463
3464 static void
3465 org_freedesktop_dbus_peer_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
3466 {
3467 }
3468
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));
3474
3475 #else
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));
3478
3479 #endif
3480 static void
3481 org_freedesktop_dbus_peer_skeleton_finalize (GObject *object)
3482 {
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);
3490 }
3491
3492 static void
3493 org_freedesktop_dbus_peer_skeleton_init (OrgFreedesktopDBusPeerSkeleton *skeleton)
3494 {
3495 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3496   skeleton->priv = org_freedesktop_dbus_peer_skeleton_get_instance_private (skeleton);
3497 #else
3498   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_ORG_FREEDESKTOP_DBUS_PEER_SKELETON, OrgFreedesktopDBusPeerSkeletonPrivate);
3499 #endif
3500
3501   g_mutex_init (&skeleton->priv->lock);
3502   skeleton->priv->context = g_main_context_ref_thread_default ();
3503 }
3504
3505 static void
3506 org_freedesktop_dbus_peer_skeleton_class_init (OrgFreedesktopDBusPeerSkeletonClass *klass)
3507 {
3508   GObjectClass *gobject_class;
3509   GDBusInterfaceSkeletonClass *skeleton_class;
3510
3511   gobject_class = G_OBJECT_CLASS (klass);
3512   gobject_class->finalize = org_freedesktop_dbus_peer_skeleton_finalize;
3513
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;
3519
3520 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
3521   g_type_class_add_private (klass, sizeof (OrgFreedesktopDBusPeerSkeletonPrivate));
3522 #endif
3523 }
3524
3525 static void
3526 org_freedesktop_dbus_peer_skeleton_iface_init (OrgFreedesktopDBusPeerIface *iface)
3527 {
3528 }
3529
3530 /**
3531  * org_freedesktop_dbus_peer_skeleton_new:
3532  *
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>.
3534  *
3535  * Returns: (transfer full) (type OrgFreedesktopDBusPeerSkeleton): The skeleton object.
3536  */
3537 OrgFreedesktopDBusPeer *
3538 org_freedesktop_dbus_peer_skeleton_new (void)
3539 {
3540   return ORG_FREEDESKTOP_DBUS_PEER (g_object_new (TYPE_ORG_FREEDESKTOP_DBUS_PEER_SKELETON, NULL));
3541 }
3542
3543 /* ------------------------------------------------------------------------
3544  * Code for interface org.lightmediascanner.Scanner1
3545  * ------------------------------------------------------------------------
3546  */
3547
3548 /**
3549  * SECTION:Scanner1
3550  * @title: Scanner1
3551  * @short_description: Generated C code for the org.lightmediascanner.Scanner1 D-Bus interface
3552  *
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.
3554  */
3555
3556 /* ---- Introspection data for org.lightmediascanner.Scanner1 ---- */
3557
3558 static const _ExtendedGDBusArgInfo _scanner1_method_info_scan_IN_ARG_specification =
3559 {
3560   {
3561     -1,
3562     (gchar *) "specification",
3563     (gchar *) "a{sv}",
3564     NULL
3565   },
3566   FALSE
3567 };
3568
3569 static const _ExtendedGDBusArgInfo * const _scanner1_method_info_scan_IN_ARG_pointers[] =
3570 {
3571   &_scanner1_method_info_scan_IN_ARG_specification,
3572   NULL
3573 };
3574
3575 static const _ExtendedGDBusMethodInfo _scanner1_method_info_scan =
3576 {
3577   {
3578     -1,
3579     (gchar *) "Scan",
3580     (GDBusArgInfo **) &_scanner1_method_info_scan_IN_ARG_pointers,
3581     NULL,
3582     NULL
3583   },
3584   "handle-scan",
3585   FALSE
3586 };
3587
3588 static const _ExtendedGDBusMethodInfo _scanner1_method_info_stop =
3589 {
3590   {
3591     -1,
3592     (gchar *) "Stop",
3593     NULL,
3594     NULL,
3595     NULL
3596   },
3597   "handle-stop",
3598   FALSE
3599 };
3600
3601 static const _ExtendedGDBusMethodInfo _scanner1_method_info_request_write_lock =
3602 {
3603   {
3604     -1,
3605     (gchar *) "RequestWriteLock",
3606     NULL,
3607     NULL,
3608     NULL
3609   },
3610   "handle-request-write-lock",
3611   FALSE
3612 };
3613
3614 static const _ExtendedGDBusMethodInfo _scanner1_method_info_release_write_lock =
3615 {
3616   {
3617     -1,
3618     (gchar *) "ReleaseWriteLock",
3619     NULL,
3620     NULL,
3621     NULL
3622   },
3623   "handle-release-write-lock",
3624   FALSE
3625 };
3626
3627 static const _ExtendedGDBusMethodInfo * const _scanner1_method_info_pointers[] =
3628 {
3629   &_scanner1_method_info_scan,
3630   &_scanner1_method_info_stop,
3631   &_scanner1_method_info_request_write_lock,
3632   &_scanner1_method_info_release_write_lock,
3633   NULL
3634 };
3635
3636 static const _ExtendedGDBusArgInfo _scanner1_signal_info_scan_progress_ARG_Category =
3637 {
3638   {
3639     -1,
3640     (gchar *) "Category",
3641     (gchar *) "s",
3642     NULL
3643   },
3644   FALSE
3645 };
3646
3647 static const _ExtendedGDBusArgInfo _scanner1_signal_info_scan_progress_ARG_Path =
3648 {
3649   {
3650     -1,
3651     (gchar *) "Path",
3652     (gchar *) "s",
3653     NULL
3654   },
3655   FALSE
3656 };
3657
3658 static const _ExtendedGDBusArgInfo _scanner1_signal_info_scan_progress_ARG_UpToDate =
3659 {
3660   {
3661     -1,
3662     (gchar *) "UpToDate",
3663     (gchar *) "t",
3664     NULL
3665   },
3666   FALSE
3667 };
3668
3669 static const _ExtendedGDBusArgInfo _scanner1_signal_info_scan_progress_ARG_Processed =
3670 {
3671   {
3672     -1,
3673     (gchar *) "Processed",
3674     (gchar *) "t",
3675     NULL
3676   },
3677   FALSE
3678 };
3679
3680 static const _ExtendedGDBusArgInfo _scanner1_signal_info_scan_progress_ARG_Deleted =
3681 {
3682   {
3683     -1,
3684     (gchar *) "Deleted",
3685     (gchar *) "t",
3686     NULL
3687   },
3688   FALSE
3689 };
3690
3691 static const _ExtendedGDBusArgInfo _scanner1_signal_info_scan_progress_ARG_Skipped =
3692 {
3693   {
3694     -1,
3695     (gchar *) "Skipped",
3696     (gchar *) "t",
3697     NULL
3698   },
3699   FALSE
3700 };
3701
3702 static const _ExtendedGDBusArgInfo _scanner1_signal_info_scan_progress_ARG_Errors =
3703 {
3704   {
3705     -1,
3706     (gchar *) "Errors",
3707     (gchar *) "t",
3708     NULL
3709   },
3710   FALSE
3711 };
3712
3713 static const _ExtendedGDBusArgInfo * const _scanner1_signal_info_scan_progress_ARG_pointers[] =
3714 {
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,
3722   NULL
3723 };
3724
3725 static const _ExtendedGDBusSignalInfo _scanner1_signal_info_scan_progress =
3726 {
3727   {
3728     -1,
3729     (gchar *) "ScanProgress",
3730     (GDBusArgInfo **) &_scanner1_signal_info_scan_progress_ARG_pointers,
3731     NULL
3732   },
3733   "scan-progress"
3734 };
3735
3736 static const _ExtendedGDBusSignalInfo * const _scanner1_signal_info_pointers[] =
3737 {
3738   &_scanner1_signal_info_scan_progress,
3739   NULL
3740 };
3741
3742 static const _ExtendedGDBusPropertyInfo _scanner1_property_info_data_base_path =
3743 {
3744   {
3745     -1,
3746     (gchar *) "DataBasePath",
3747     (gchar *) "s",
3748     G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
3749     NULL
3750   },
3751   "data-base-path",
3752   FALSE
3753 };
3754
3755 static const _ExtendedGDBusPropertyInfo _scanner1_property_info_is_scanning =
3756 {
3757   {
3758     -1,
3759     (gchar *) "IsScanning",
3760     (gchar *) "b",
3761     G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
3762     NULL
3763   },
3764   "is-scanning",
3765   FALSE
3766 };
3767
3768 static const _ExtendedGDBusPropertyInfo _scanner1_property_info_write_locked =
3769 {
3770   {
3771     -1,
3772     (gchar *) "WriteLocked",
3773     (gchar *) "b",
3774     G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
3775     NULL
3776   },
3777   "write-locked",
3778   FALSE
3779 };
3780
3781 static const _ExtendedGDBusPropertyInfo _scanner1_property_info_update_id =
3782 {
3783   {
3784     -1,
3785     (gchar *) "UpdateID",
3786     (gchar *) "t",
3787     G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
3788     NULL
3789   },
3790   "update-id",
3791   FALSE
3792 };
3793
3794 static const _ExtendedGDBusPropertyInfo _scanner1_property_info_categories =
3795 {
3796   {
3797     -1,
3798     (gchar *) "Categories",
3799     (gchar *) "a{sv}",
3800     G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
3801     NULL
3802   },
3803   "categories",
3804   FALSE
3805 };
3806
3807 static const _ExtendedGDBusPropertyInfo * const _scanner1_property_info_pointers[] =
3808 {
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,
3814   NULL
3815 };
3816
3817 static const _ExtendedGDBusInterfaceInfo _scanner1_interface_info =
3818 {
3819   {
3820     -1,
3821     (gchar *) "org.lightmediascanner.Scanner1",
3822     (GDBusMethodInfo **) &_scanner1_method_info_pointers,
3823     (GDBusSignalInfo **) &_scanner1_signal_info_pointers,
3824     (GDBusPropertyInfo **) &_scanner1_property_info_pointers,
3825     NULL
3826   },
3827   "scanner1",
3828 };
3829
3830
3831 /**
3832  * scanner1_interface_info:
3833  *
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.
3835  *
3836  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
3837  */
3838 GDBusInterfaceInfo *
3839 scanner1_interface_info (void)
3840 {
3841   return (GDBusInterfaceInfo *) &_scanner1_interface_info.parent_struct;
3842 }
3843
3844 /**
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.
3848  *
3849  * Overrides all #GObject properties in the #Scanner1 interface for a concrete class.
3850  * The properties are overridden in the order they are defined.
3851  *
3852  * Returns: The last property id.
3853  */
3854 guint
3855 scanner1_override_properties (GObjectClass *klass, guint property_id_begin)
3856 {
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;
3863 }
3864
3865
3866
3867 /**
3868  * Scanner1:
3869  *
3870  * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-lightmediascanner-Scanner1.top_of_page">org.lightmediascanner.Scanner1</link>.
3871  */
3872
3873 /**
3874  * Scanner1Iface:
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.
3886  *
3887  * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-lightmediascanner-Scanner1.top_of_page">org.lightmediascanner.Scanner1</link>.
3888  */
3889
3890 typedef Scanner1Iface Scanner1Interface;
3891 G_DEFINE_INTERFACE (Scanner1, scanner1, G_TYPE_OBJECT);
3892
3893 static void
3894 scanner1_default_init (Scanner1Iface *iface)
3895 {
3896   /* GObject signals for incoming D-Bus method calls: */
3897   /**
3898    * Scanner1::handle-scan:
3899    * @object: A #Scanner1.
3900    * @invocation: A #GDBusMethodInvocation.
3901    * @arg_specification: Argument passed by remote caller.
3902    *
3903    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.Scan">Scan()</link> D-Bus method.
3904    *
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.
3906    *
3907    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
3908    */
3909   g_signal_new ("handle-scan",
3910     G_TYPE_FROM_INTERFACE (iface),
3911     G_SIGNAL_RUN_LAST,
3912     G_STRUCT_OFFSET (Scanner1Iface, handle_scan),
3913     g_signal_accumulator_true_handled,
3914     NULL,
3915     g_cclosure_marshal_generic,
3916     G_TYPE_BOOLEAN,
3917     2,
3918     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT);
3919
3920   /**
3921    * Scanner1::handle-stop:
3922    * @object: A #Scanner1.
3923    * @invocation: A #GDBusMethodInvocation.
3924    *
3925    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.Stop">Stop()</link> D-Bus method.
3926    *
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.
3928    *
3929    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
3930    */
3931   g_signal_new ("handle-stop",
3932     G_TYPE_FROM_INTERFACE (iface),
3933     G_SIGNAL_RUN_LAST,
3934     G_STRUCT_OFFSET (Scanner1Iface, handle_stop),
3935     g_signal_accumulator_true_handled,
3936     NULL,
3937     g_cclosure_marshal_generic,
3938     G_TYPE_BOOLEAN,
3939     1,
3940     G_TYPE_DBUS_METHOD_INVOCATION);
3941
3942   /**
3943    * Scanner1::handle-request-write-lock:
3944    * @object: A #Scanner1.
3945    * @invocation: A #GDBusMethodInvocation.
3946    *
3947    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.RequestWriteLock">RequestWriteLock()</link> D-Bus method.
3948    *
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.
3950    *
3951    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
3952    */
3953   g_signal_new ("handle-request-write-lock",
3954     G_TYPE_FROM_INTERFACE (iface),
3955     G_SIGNAL_RUN_LAST,
3956     G_STRUCT_OFFSET (Scanner1Iface, handle_request_write_lock),
3957     g_signal_accumulator_true_handled,
3958     NULL,
3959     g_cclosure_marshal_generic,
3960     G_TYPE_BOOLEAN,
3961     1,
3962     G_TYPE_DBUS_METHOD_INVOCATION);
3963
3964   /**
3965    * Scanner1::handle-release-write-lock:
3966    * @object: A #Scanner1.
3967    * @invocation: A #GDBusMethodInvocation.
3968    *
3969    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-lightmediascanner-Scanner1.ReleaseWriteLock">ReleaseWriteLock()</link> D-Bus method.
3970    *
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.
3972    *
3973    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
3974    */
3975   g_signal_new ("handle-release-write-lock",
3976     G_TYPE_FROM_INTERFACE (iface),
3977     G_SIGNAL_RUN_LAST,
3978     G_STRUCT_OFFSET (Scanner1Iface, handle_release_write_lock),
3979     g_signal_accumulator_true_handled,
3980     NULL,
3981     g_cclosure_marshal_generic,
3982     G_TYPE_BOOLEAN,
3983     1,
3984     G_TYPE_DBUS_METHOD_INVOCATION);
3985
3986   /* GObject signals for received D-Bus signals: */
3987   /**
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.
3997    *
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.
3999    *
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.
4001    */
4002   g_signal_new ("scan-progress",
4003     G_TYPE_FROM_INTERFACE (iface),
4004     G_SIGNAL_RUN_LAST,
4005     G_STRUCT_OFFSET (Scanner1Iface, scan_progress),
4006     NULL,
4007     NULL,
4008     g_cclosure_marshal_generic,
4009     G_TYPE_NONE,
4010     7, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT64, G_TYPE_UINT64, G_TYPE_UINT64, G_TYPE_UINT64, G_TYPE_UINT64);
4011
4012   /* GObject properties for D-Bus properties: */
4013   /**
4014    * Scanner1:data-base-path:
4015    *
4016    * Represents the D-Bus property <link linkend="gdbus-property-org-lightmediascanner-Scanner1.DataBasePath">"DataBasePath"</link>.
4017    *
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.
4019    */
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));
4022   /**
4023    * Scanner1:is-scanning:
4024    *
4025    * Represents the D-Bus property <link linkend="gdbus-property-org-lightmediascanner-Scanner1.IsScanning">"IsScanning"</link>.
4026    *
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.
4028    */
4029   g_object_interface_install_property (iface,
4030     g_param_spec_boolean ("is-scanning", "IsScanning", "IsScanning", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
4031   /**
4032    * Scanner1:write-locked:
4033    *
4034    * Represents the D-Bus property <link linkend="gdbus-property-org-lightmediascanner-Scanner1.WriteLocked">"WriteLocked"</link>.
4035    *
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.
4037    */
4038   g_object_interface_install_property (iface,
4039     g_param_spec_boolean ("write-locked", "WriteLocked", "WriteLocked", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
4040   /**
4041    * Scanner1:update-id:
4042    *
4043    * Represents the D-Bus property <link linkend="gdbus-property-org-lightmediascanner-Scanner1.UpdateID">"UpdateID"</link>.
4044    *
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.
4046    */
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));
4049   /**
4050    * Scanner1:categories:
4051    *
4052    * Represents the D-Bus property <link linkend="gdbus-property-org-lightmediascanner-Scanner1.Categories">"Categories"</link>.
4053    *
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.
4055    */
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));
4058 }
4059
4060 /**
4061  * scanner1_get_data_base_path: (skip)
4062  * @object: A #Scanner1.
4063  *
4064  * Gets the value of the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.DataBasePath">"DataBasePath"</link> D-Bus property.
4065  *
4066  * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4067  *
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>
4069  *
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.
4071  */
4072 const gchar *
4073 scanner1_get_data_base_path (Scanner1 *object)
4074 {
4075   return SCANNER1_GET_IFACE (object)->get_data_base_path (object);
4076 }
4077
4078 /**
4079  * scanner1_dup_data_base_path: (skip)
4080  * @object: A #Scanner1.
4081  *
4082  * Gets a copy of the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.DataBasePath">"DataBasePath"</link> D-Bus property.
4083  *
4084  * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4085  *
4086  * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
4087  */
4088 gchar *
4089 scanner1_dup_data_base_path (Scanner1 *object)
4090 {
4091   gchar *value;
4092   g_object_get (G_OBJECT (object), "data-base-path", &value, NULL);
4093   return value;
4094 }
4095
4096 /**
4097  * scanner1_set_data_base_path: (skip)
4098  * @object: A #Scanner1.
4099  * @value: The value to set.
4100  *
4101  * Sets the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.DataBasePath">"DataBasePath"</link> D-Bus property to @value.
4102  *
4103  * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4104  */
4105 void
4106 scanner1_set_data_base_path (Scanner1 *object, const gchar *value)
4107 {
4108   g_object_set (G_OBJECT (object), "data-base-path", value, NULL);
4109 }
4110
4111 /**
4112  * scanner1_get_is_scanning: (skip)
4113  * @object: A #Scanner1.
4114  *
4115  * Gets the value of the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.IsScanning">"IsScanning"</link> D-Bus property.
4116  *
4117  * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4118  *
4119  * Returns: The property value.
4120  */
4121 gboolean 
4122 scanner1_get_is_scanning (Scanner1 *object)
4123 {
4124   return SCANNER1_GET_IFACE (object)->get_is_scanning (object);
4125 }
4126
4127 /**
4128  * scanner1_set_is_scanning: (skip)
4129  * @object: A #Scanner1.
4130  * @value: The value to set.
4131  *
4132  * Sets the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.IsScanning">"IsScanning"</link> D-Bus property to @value.
4133  *
4134  * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4135  */
4136 void
4137 scanner1_set_is_scanning (Scanner1 *object, gboolean value)
4138 {
4139   g_object_set (G_OBJECT (object), "is-scanning", value, NULL);
4140 }
4141
4142 /**
4143  * scanner1_get_write_locked: (skip)
4144  * @object: A #Scanner1.
4145  *
4146  * Gets the value of the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.WriteLocked">"WriteLocked"</link> D-Bus property.
4147  *
4148  * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4149  *
4150  * Returns: The property value.
4151  */
4152 gboolean 
4153 scanner1_get_write_locked (Scanner1 *object)
4154 {
4155   return SCANNER1_GET_IFACE (object)->get_write_locked (object);
4156 }
4157
4158 /**
4159  * scanner1_set_write_locked: (skip)
4160  * @object: A #Scanner1.
4161  * @value: The value to set.
4162  *
4163  * Sets the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.WriteLocked">"WriteLocked"</link> D-Bus property to @value.
4164  *
4165  * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4166  */
4167 void
4168 scanner1_set_write_locked (Scanner1 *object, gboolean value)
4169 {
4170   g_object_set (G_OBJECT (object), "write-locked", value, NULL);
4171 }
4172
4173 /**
4174  * scanner1_get_update_id: (skip)
4175  * @object: A #Scanner1.
4176  *
4177  * Gets the value of the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.UpdateID">"UpdateID"</link> D-Bus property.
4178  *
4179  * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4180  *
4181  * Returns: The property value.
4182  */
4183 guint64 
4184 scanner1_get_update_id (Scanner1 *object)
4185 {
4186   return SCANNER1_GET_IFACE (object)->get_update_id (object);
4187 }
4188
4189 /**
4190  * scanner1_set_update_id: (skip)
4191  * @object: A #Scanner1.
4192  * @value: The value to set.
4193  *
4194  * Sets the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.UpdateID">"UpdateID"</link> D-Bus property to @value.
4195  *
4196  * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4197  */
4198 void
4199 scanner1_set_update_id (Scanner1 *object, guint64 value)
4200 {
4201   g_object_set (G_OBJECT (object), "update-id", value, NULL);
4202 }
4203
4204 /**
4205  * scanner1_get_categories: (skip)
4206  * @object: A #Scanner1.
4207  *
4208  * Gets the value of the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.Categories">"Categories"</link> D-Bus property.
4209  *
4210  * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4211  *
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>
4213  *
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.
4215  */
4216 GVariant *
4217 scanner1_get_categories (Scanner1 *object)
4218 {
4219   return SCANNER1_GET_IFACE (object)->get_categories (object);
4220 }
4221
4222 /**
4223  * scanner1_dup_categories: (skip)
4224  * @object: A #Scanner1.
4225  *
4226  * Gets a copy of the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.Categories">"Categories"</link> D-Bus property.
4227  *
4228  * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4229  *
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().
4231  */
4232 GVariant *
4233 scanner1_dup_categories (Scanner1 *object)
4234 {
4235   GVariant *value;
4236   g_object_get (G_OBJECT (object), "categories", &value, NULL);
4237   return value;
4238 }
4239
4240 /**
4241  * scanner1_set_categories: (skip)
4242  * @object: A #Scanner1.
4243  * @value: The value to set.
4244  *
4245  * Sets the <link linkend="gdbus-property-org-lightmediascanner-Scanner1.Categories">"Categories"</link> D-Bus property to @value.
4246  *
4247  * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4248  */
4249 void
4250 scanner1_set_categories (Scanner1 *object, GVariant *value)
4251 {
4252   g_object_set (G_OBJECT (object), "categories", value, NULL);
4253 }
4254
4255 /**
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.
4265  *
4266  * Emits the <link linkend="gdbus-signal-org-lightmediascanner-Scanner1.ScanProgress">"ScanProgress"</link> D-Bus signal.
4267  */
4268 void
4269 scanner1_emit_scan_progress (
4270     Scanner1 *object,
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,
4277     guint64 arg_Errors)
4278 {
4279   g_signal_emit_by_name (object, "scan-progress", arg_Category, arg_Path, arg_UpToDate, arg_Processed, arg_Deleted, arg_Skipped, arg_Errors);
4280 }
4281
4282 /**
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.
4289  *
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.
4293  *
4294  * See scanner1_call_scan_sync() for the synchronous, blocking version of this method.
4295  */
4296 void
4297 scanner1_call_scan (
4298     Scanner1 *proxy,
4299     GVariant *arg_specification,
4300     GCancellable *cancellable,
4301     GAsyncReadyCallback callback,
4302     gpointer user_data)
4303 {
4304   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
4305     "Scan",
4306     g_variant_new ("(@a{sv})",
4307                    arg_specification),
4308     G_DBUS_CALL_FLAGS_NONE,
4309     -1,
4310     cancellable,
4311     callback,
4312     user_data);
4313 }
4314
4315 /**
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.
4320  *
4321  * Finishes an operation started with scanner1_call_scan().
4322  *
4323  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4324  */
4325 gboolean
4326 scanner1_call_scan_finish (
4327     Scanner1 *proxy,
4328     GAsyncResult *res,
4329     GError **error)
4330 {
4331   GVariant *_ret;
4332   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
4333   if (_ret == NULL)
4334     goto _out;
4335   g_variant_get (_ret,
4336                  "()");
4337   g_variant_unref (_ret);
4338 _out:
4339   return _ret != NULL;
4340 }
4341
4342 /**
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.
4348  *
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.
4350  *
4351  * See scanner1_call_scan() for the asynchronous version of this method.
4352  *
4353  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4354  */
4355 gboolean
4356 scanner1_call_scan_sync (
4357     Scanner1 *proxy,
4358     GVariant *arg_specification,
4359     GCancellable *cancellable,
4360     GError **error)
4361 {
4362   GVariant *_ret;
4363   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
4364     "Scan",
4365     g_variant_new ("(@a{sv})",
4366                    arg_specification),
4367     G_DBUS_CALL_FLAGS_NONE,
4368     -1,
4369     cancellable,
4370     error);
4371   if (_ret == NULL)
4372     goto _out;
4373   g_variant_get (_ret,
4374                  "()");
4375   g_variant_unref (_ret);
4376 _out:
4377   return _ret != NULL;
4378 }
4379
4380 /**
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.
4386  *
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.
4390  *
4391  * See scanner1_call_stop_sync() for the synchronous, blocking version of this method.
4392  */
4393 void
4394 scanner1_call_stop (
4395     Scanner1 *proxy,
4396     GCancellable *cancellable,
4397     GAsyncReadyCallback callback,
4398     gpointer user_data)
4399 {
4400   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
4401     "Stop",
4402     g_variant_new ("()"),
4403     G_DBUS_CALL_FLAGS_NONE,
4404     -1,
4405     cancellable,
4406     callback,
4407     user_data);
4408 }
4409
4410 /**
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.
4415  *
4416  * Finishes an operation started with scanner1_call_stop().
4417  *
4418  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4419  */
4420 gboolean
4421 scanner1_call_stop_finish (
4422     Scanner1 *proxy,
4423     GAsyncResult *res,
4424     GError **error)
4425 {
4426   GVariant *_ret;
4427   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
4428   if (_ret == NULL)
4429     goto _out;
4430   g_variant_get (_ret,
4431                  "()");
4432   g_variant_unref (_ret);
4433 _out:
4434   return _ret != NULL;
4435 }
4436
4437 /**
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.
4442  *
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.
4444  *
4445  * See scanner1_call_stop() for the asynchronous version of this method.
4446  *
4447  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4448  */
4449 gboolean
4450 scanner1_call_stop_sync (
4451     Scanner1 *proxy,
4452     GCancellable *cancellable,
4453     GError **error)
4454 {
4455   GVariant *_ret;
4456   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
4457     "Stop",
4458     g_variant_new ("()"),
4459     G_DBUS_CALL_FLAGS_NONE,
4460     -1,
4461     cancellable,
4462     error);
4463   if (_ret == NULL)
4464     goto _out;
4465   g_variant_get (_ret,
4466                  "()");
4467   g_variant_unref (_ret);
4468 _out:
4469   return _ret != NULL;
4470 }
4471
4472 /**
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.
4478  *
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.
4482  *
4483  * See scanner1_call_request_write_lock_sync() for the synchronous, blocking version of this method.
4484  */
4485 void
4486 scanner1_call_request_write_lock (
4487     Scanner1 *proxy,
4488     GCancellable *cancellable,
4489     GAsyncReadyCallback callback,
4490     gpointer user_data)
4491 {
4492   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
4493     "RequestWriteLock",
4494     g_variant_new ("()"),
4495     G_DBUS_CALL_FLAGS_NONE,
4496     -1,
4497     cancellable,
4498     callback,
4499     user_data);
4500 }
4501
4502 /**
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.
4507  *
4508  * Finishes an operation started with scanner1_call_request_write_lock().
4509  *
4510  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4511  */
4512 gboolean
4513 scanner1_call_request_write_lock_finish (
4514     Scanner1 *proxy,
4515     GAsyncResult *res,
4516     GError **error)
4517 {
4518   GVariant *_ret;
4519   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
4520   if (_ret == NULL)
4521     goto _out;
4522   g_variant_get (_ret,
4523                  "()");
4524   g_variant_unref (_ret);
4525 _out:
4526   return _ret != NULL;
4527 }
4528
4529 /**
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.
4534  *
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.
4536  *
4537  * See scanner1_call_request_write_lock() for the asynchronous version of this method.
4538  *
4539  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4540  */
4541 gboolean
4542 scanner1_call_request_write_lock_sync (
4543     Scanner1 *proxy,
4544     GCancellable *cancellable,
4545     GError **error)
4546 {
4547   GVariant *_ret;
4548   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
4549     "RequestWriteLock",
4550     g_variant_new ("()"),
4551     G_DBUS_CALL_FLAGS_NONE,
4552     -1,
4553     cancellable,
4554     error);
4555   if (_ret == NULL)
4556     goto _out;
4557   g_variant_get (_ret,
4558                  "()");
4559   g_variant_unref (_ret);
4560 _out:
4561   return _ret != NULL;
4562 }
4563
4564 /**
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.
4570  *
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.
4574  *
4575  * See scanner1_call_release_write_lock_sync() for the synchronous, blocking version of this method.
4576  */
4577 void
4578 scanner1_call_release_write_lock (
4579     Scanner1 *proxy,
4580     GCancellable *cancellable,
4581     GAsyncReadyCallback callback,
4582     gpointer user_data)
4583 {
4584   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
4585     "ReleaseWriteLock",
4586     g_variant_new ("()"),
4587     G_DBUS_CALL_FLAGS_NONE,
4588     -1,
4589     cancellable,
4590     callback,
4591     user_data);
4592 }
4593
4594 /**
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.
4599  *
4600  * Finishes an operation started with scanner1_call_release_write_lock().
4601  *
4602  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4603  */
4604 gboolean
4605 scanner1_call_release_write_lock_finish (
4606     Scanner1 *proxy,
4607     GAsyncResult *res,
4608     GError **error)
4609 {
4610   GVariant *_ret;
4611   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
4612   if (_ret == NULL)
4613     goto _out;
4614   g_variant_get (_ret,
4615                  "()");
4616   g_variant_unref (_ret);
4617 _out:
4618   return _ret != NULL;
4619 }
4620
4621 /**
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.
4626  *
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.
4628  *
4629  * See scanner1_call_release_write_lock() for the asynchronous version of this method.
4630  *
4631  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4632  */
4633 gboolean
4634 scanner1_call_release_write_lock_sync (
4635     Scanner1 *proxy,
4636     GCancellable *cancellable,
4637     GError **error)
4638 {
4639   GVariant *_ret;
4640   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
4641     "ReleaseWriteLock",
4642     g_variant_new ("()"),
4643     G_DBUS_CALL_FLAGS_NONE,
4644     -1,
4645     cancellable,
4646     error);
4647   if (_ret == NULL)
4648     goto _out;
4649   g_variant_get (_ret,
4650                  "()");
4651   g_variant_unref (_ret);
4652 _out:
4653   return _ret != NULL;
4654 }
4655
4656 /**
4657  * scanner1_complete_scan:
4658  * @object: A #Scanner1.
4659  * @invocation: (transfer full): A #GDBusMethodInvocation.
4660  *
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.
4662  *
4663  * This method will free @invocation, you cannot use it afterwards.
4664  */
4665 void
4666 scanner1_complete_scan (
4667     Scanner1 *object,
4668     GDBusMethodInvocation *invocation)
4669 {
4670   g_dbus_method_invocation_return_value (invocation,
4671     g_variant_new ("()"));
4672 }
4673
4674 /**
4675  * scanner1_complete_stop:
4676  * @object: A #Scanner1.
4677  * @invocation: (transfer full): A #GDBusMethodInvocation.
4678  *
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.
4680  *
4681  * This method will free @invocation, you cannot use it afterwards.
4682  */
4683 void
4684 scanner1_complete_stop (
4685     Scanner1 *object,
4686     GDBusMethodInvocation *invocation)
4687 {
4688   g_dbus_method_invocation_return_value (invocation,
4689     g_variant_new ("()"));
4690 }
4691
4692 /**
4693  * scanner1_complete_request_write_lock:
4694  * @object: A #Scanner1.
4695  * @invocation: (transfer full): A #GDBusMethodInvocation.
4696  *
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.
4698  *
4699  * This method will free @invocation, you cannot use it afterwards.
4700  */
4701 void
4702 scanner1_complete_request_write_lock (
4703     Scanner1 *object,
4704     GDBusMethodInvocation *invocation)
4705 {
4706   g_dbus_method_invocation_return_value (invocation,
4707     g_variant_new ("()"));
4708 }
4709
4710 /**
4711  * scanner1_complete_release_write_lock:
4712  * @object: A #Scanner1.
4713  * @invocation: (transfer full): A #GDBusMethodInvocation.
4714  *
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.
4716  *
4717  * This method will free @invocation, you cannot use it afterwards.
4718  */
4719 void
4720 scanner1_complete_release_write_lock (
4721     Scanner1 *object,
4722     GDBusMethodInvocation *invocation)
4723 {
4724   g_dbus_method_invocation_return_value (invocation,
4725     g_variant_new ("()"));
4726 }
4727
4728 /* ------------------------------------------------------------------------ */
4729
4730 /**
4731  * Scanner1Proxy:
4732  *
4733  * The #Scanner1Proxy structure contains only private data and should only be accessed using the provided API.
4734  */
4735
4736 /**
4737  * Scanner1ProxyClass:
4738  * @parent_class: The parent class.
4739  *
4740  * Class structure for #Scanner1Proxy.
4741  */
4742
4743 struct _Scanner1ProxyPrivate
4744 {
4745   GData *qdata;
4746 };
4747
4748 static void scanner1_proxy_iface_init (Scanner1Iface *iface);
4749
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));
4754
4755 #else
4756 G_DEFINE_TYPE_WITH_CODE (Scanner1Proxy, scanner1_proxy, G_TYPE_DBUS_PROXY,
4757                          G_IMPLEMENT_INTERFACE (TYPE_SCANNER1, scanner1_proxy_iface_init));
4758
4759 #endif
4760 static void
4761 scanner1_proxy_finalize (GObject *object)
4762 {
4763   Scanner1Proxy *proxy = SCANNER1_PROXY (object);
4764   g_datalist_clear (&proxy->priv->qdata);
4765   G_OBJECT_CLASS (scanner1_proxy_parent_class)->finalize (object);
4766 }
4767
4768 static void
4769 scanner1_proxy_get_property (GObject      *object,
4770   guint         prop_id,
4771   GValue       *value,
4772   GParamSpec   *pspec G_GNUC_UNUSED)
4773 {
4774   const _ExtendedGDBusPropertyInfo *info;
4775   GVariant *variant;
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)
4780     {
4781       g_value_set_variant (value, variant);
4782     }
4783   else
4784     {
4785       if (variant != NULL)
4786         g_dbus_gvariant_to_gvalue (variant, value);
4787     }
4788   if (variant != NULL)
4789     g_variant_unref (variant);
4790 }
4791
4792 static void
4793 scanner1_proxy_set_property_cb (GDBusProxy *proxy,
4794   GAsyncResult *res,
4795   gpointer      user_data)
4796 {
4797   const _ExtendedGDBusPropertyInfo *info = user_data;
4798   GError *error;
4799   GVariant *_ret;
4800   error = NULL;
4801   _ret = g_dbus_proxy_call_finish (proxy, res, &error);
4802   if (!_ret)
4803     {
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);
4808     }
4809   else
4810     {
4811       g_variant_unref (_ret);
4812     }
4813 }
4814
4815 static void
4816 scanner1_proxy_set_property (GObject      *object,
4817   guint         prop_id,
4818   const GValue *value,
4819   GParamSpec   *pspec G_GNUC_UNUSED)
4820 {
4821   const _ExtendedGDBusPropertyInfo *info;
4822   GVariant *variant;
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,
4830     -1,
4831     NULL, (GAsyncReadyCallback) scanner1_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
4832   g_variant_unref (variant);
4833 }
4834
4835 static void
4836 scanner1_proxy_g_signal (GDBusProxy *proxy,
4837   const gchar *sender_name G_GNUC_UNUSED,
4838   const gchar *signal_name,
4839   GVariant *parameters)
4840 {
4841   _ExtendedGDBusSignalInfo *info;
4842   GVariantIter iter;
4843   GVariant *child;
4844   GValue *paramv;
4845   gsize num_params;
4846   gsize n;
4847   guint signal_id;
4848   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_scanner1_interface_info.parent_struct, signal_name);
4849   if (info == NULL)
4850     return;
4851   num_params = g_variant_n_children (parameters);
4852   paramv = g_new0 (GValue, num_params + 1);
4853   g_value_init (&paramv[0], TYPE_SCANNER1);
4854   g_value_set_object (&paramv[0], proxy);
4855   g_variant_iter_init (&iter, parameters);
4856   n = 1;
4857   while ((child = g_variant_iter_next_value (&iter)) != NULL)
4858     {
4859       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
4860       if (arg_info->use_gvariant)
4861         {
4862           g_value_init (&paramv[n], G_TYPE_VARIANT);
4863           g_value_set_variant (&paramv[n], child);
4864           n++;
4865         }
4866       else
4867         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
4868       g_variant_unref (child);
4869     }
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 (&paramv[n]);
4874   g_free (paramv);
4875 }
4876
4877 static void
4878 scanner1_proxy_g_properties_changed (GDBusProxy *_proxy,
4879   GVariant *changed_properties,
4880   const gchar *const *invalidated_properties)
4881 {
4882   Scanner1Proxy *proxy = SCANNER1_PROXY (_proxy);
4883   guint n;
4884   const gchar *key;
4885   GVariantIter *iter;
4886   _ExtendedGDBusPropertyInfo *info;
4887   g_variant_get (changed_properties, "a{sv}", &iter);
4888   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
4889     {
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);
4892       if (info != NULL)
4893         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
4894     }
4895   g_variant_iter_free (iter);
4896   for (n = 0; invalidated_properties[n] != NULL; n++)
4897     {
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]);
4900       if (info != NULL)
4901         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
4902     }
4903 }
4904
4905 static const gchar *
4906 scanner1_proxy_get_data_base_path (Scanner1 *object)
4907 {
4908   Scanner1Proxy *proxy = SCANNER1_PROXY (object);
4909   GVariant *variant;
4910   const gchar *value = NULL;
4911   variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "DataBasePath");
4912   if (variant != NULL)
4913     {
4914       value = g_variant_get_string (variant, NULL);
4915       g_variant_unref (variant);
4916     }
4917   return value;
4918 }
4919
4920 static gboolean 
4921 scanner1_proxy_get_is_scanning (Scanner1 *object)
4922 {
4923   Scanner1Proxy *proxy = SCANNER1_PROXY (object);
4924   GVariant *variant;
4925   gboolean value = 0;
4926   variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "IsScanning");
4927   if (variant != NULL)
4928     {
4929       value = g_variant_get_boolean (variant);
4930       g_variant_unref (variant);
4931     }
4932   return value;
4933 }
4934
4935 static gboolean 
4936 scanner1_proxy_get_write_locked (Scanner1 *object)
4937 {
4938   Scanner1Proxy *proxy = SCANNER1_PROXY (object);
4939   GVariant *variant;
4940   gboolean value = 0;
4941   variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "WriteLocked");
4942   if (variant != NULL)
4943     {
4944       value = g_variant_get_boolean (variant);
4945       g_variant_unref (variant);
4946     }
4947   return value;
4948 }
4949
4950 static guint64 
4951 scanner1_proxy_get_update_id (Scanner1 *object)
4952 {
4953   Scanner1Proxy *proxy = SCANNER1_PROXY (object);
4954   GVariant *variant;
4955   guint64 value = 0;
4956   variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "UpdateID");
4957   if (variant != NULL)
4958     {
4959       value = g_variant_get_uint64 (variant);
4960       g_variant_unref (variant);
4961     }
4962   return value;
4963 }
4964
4965 static GVariant *
4966 scanner1_proxy_get_categories (Scanner1 *object)
4967 {
4968   Scanner1Proxy *proxy = SCANNER1_PROXY (object);
4969   GVariant *variant;
4970   GVariant *value = NULL;
4971   variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Categories");
4972   value = variant;
4973   if (variant != NULL)
4974     g_variant_unref (variant);
4975   return value;
4976 }
4977
4978 static void
4979 scanner1_proxy_init (Scanner1Proxy *proxy)
4980 {
4981 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
4982   proxy->priv = scanner1_proxy_get_instance_private (proxy);
4983 #else
4984   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_SCANNER1_PROXY, Scanner1ProxyPrivate);
4985 #endif
4986
4987   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), scanner1_interface_info ());
4988 }
4989
4990 static void
4991 scanner1_proxy_class_init (Scanner1ProxyClass *klass)
4992 {
4993   GObjectClass *gobject_class;
4994   GDBusProxyClass *proxy_class;
4995
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;
5000
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;
5004
5005   scanner1_override_properties (gobject_class, 1);
5006
5007 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
5008   g_type_class_add_private (klass, sizeof (Scanner1ProxyPrivate));
5009 #endif
5010 }
5011
5012 static void
5013 scanner1_proxy_iface_init (Scanner1Iface *iface)
5014 {
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;
5020 }
5021
5022 /**
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.
5031  *
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.
5033  *
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.
5036  *
5037  * See scanner1_proxy_new_sync() for the synchronous, blocking version of this constructor.
5038  */
5039 void
5040 scanner1_proxy_new (
5041     GDBusConnection     *connection,
5042     GDBusProxyFlags      flags,
5043     const gchar         *name,
5044     const gchar         *object_path,
5045     GCancellable        *cancellable,
5046     GAsyncReadyCallback  callback,
5047     gpointer             user_data)
5048 {
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);
5050 }
5051
5052 /**
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
5056  *
5057  * Finishes an operation started with scanner1_proxy_new().
5058  *
5059  * Returns: (transfer full) (type Scanner1Proxy): The constructed proxy object or %NULL if @error is set.
5060  */
5061 Scanner1 *
5062 scanner1_proxy_new_finish (
5063     GAsyncResult        *res,
5064     GError             **error)
5065 {
5066   GObject *ret;
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);
5071   if (ret != NULL)
5072     return SCANNER1 (ret);
5073   else
5074     return NULL;
5075 }
5076
5077 /**
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
5085  *
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.
5087  *
5088  * The calling thread is blocked until a reply is received.
5089  *
5090  * See scanner1_proxy_new() for the asynchronous version of this constructor.
5091  *
5092  * Returns: (transfer full) (type Scanner1Proxy): The constructed proxy object or %NULL if @error is set.
5093  */
5094 Scanner1 *
5095 scanner1_proxy_new_sync (
5096     GDBusConnection     *connection,
5097     GDBusProxyFlags      flags,
5098     const gchar         *name,
5099     const gchar         *object_path,
5100     GCancellable        *cancellable,
5101     GError             **error)
5102 {
5103   GInitable *ret;
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);
5105   if (ret != NULL)
5106     return SCANNER1 (ret);
5107   else
5108     return NULL;
5109 }
5110
5111
5112 /**
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.
5121  *
5122  * Like scanner1_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
5123  *
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.
5126  *
5127  * See scanner1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
5128  */
5129 void
5130 scanner1_proxy_new_for_bus (
5131     GBusType             bus_type,
5132     GDBusProxyFlags      flags,
5133     const gchar         *name,
5134     const gchar         *object_path,
5135     GCancellable        *cancellable,
5136     GAsyncReadyCallback  callback,
5137     gpointer             user_data)
5138 {
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);
5140 }
5141
5142 /**
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
5146  *
5147  * Finishes an operation started with scanner1_proxy_new_for_bus().
5148  *
5149  * Returns: (transfer full) (type Scanner1Proxy): The constructed proxy object or %NULL if @error is set.
5150  */
5151 Scanner1 *
5152 scanner1_proxy_new_for_bus_finish (
5153     GAsyncResult        *res,
5154     GError             **error)
5155 {
5156   GObject *ret;
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);
5161   if (ret != NULL)
5162     return SCANNER1 (ret);
5163   else
5164     return NULL;
5165 }
5166
5167 /**
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
5175  *
5176  * Like scanner1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
5177  *
5178  * The calling thread is blocked until a reply is received.
5179  *
5180  * See scanner1_proxy_new_for_bus() for the asynchronous version of this constructor.
5181  *
5182  * Returns: (transfer full) (type Scanner1Proxy): The constructed proxy object or %NULL if @error is set.
5183  */
5184 Scanner1 *
5185 scanner1_proxy_new_for_bus_sync (
5186     GBusType             bus_type,
5187     GDBusProxyFlags      flags,
5188     const gchar         *name,
5189     const gchar         *object_path,
5190     GCancellable        *cancellable,
5191     GError             **error)
5192 {
5193   GInitable *ret;
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);
5195   if (ret != NULL)
5196     return SCANNER1 (ret);
5197   else
5198     return NULL;
5199 }
5200
5201
5202 /* ------------------------------------------------------------------------ */
5203
5204 /**
5205  * Scanner1Skeleton:
5206  *
5207  * The #Scanner1Skeleton structure contains only private data and should only be accessed using the provided API.
5208  */
5209
5210 /**
5211  * Scanner1SkeletonClass:
5212  * @parent_class: The parent class.
5213  *
5214  * Class structure for #Scanner1Skeleton.
5215  */
5216
5217 struct _Scanner1SkeletonPrivate
5218 {
5219   GValue *properties;
5220   GList *changed_properties;
5221   GSource *changed_properties_idle_source;
5222   GMainContext *context;
5223   GMutex lock;
5224 };
5225
5226 static void
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,
5235   gpointer user_data)
5236 {
5237   Scanner1Skeleton *skeleton = SCANNER1_SKELETON (user_data);
5238   _ExtendedGDBusMethodInfo *info;
5239   GVariantIter iter;
5240   GVariant *child;
5241   GValue *paramv;
5242   gsize num_params;
5243   guint num_extra;
5244   gsize n;
5245   guint signal_id;
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);
5251   n = 0;
5252   g_value_init (&paramv[n], TYPE_SCANNER1);
5253   g_value_set_object (&paramv[n++], skeleton);
5254   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
5255   g_value_set_object (&paramv[n++], invocation);
5256   if (info->pass_fdlist)
5257     {
5258 #ifdef G_OS_UNIX
5259       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
5260       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
5261 #else
5262       g_assert_not_reached ();
5263 #endif
5264     }
5265   g_variant_iter_init (&iter, parameters);
5266   while ((child = g_variant_iter_next_value (&iter)) != NULL)
5267     {
5268       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
5269       if (arg_info->use_gvariant)
5270         {
5271           g_value_init (&paramv[n], G_TYPE_VARIANT);
5272           g_value_set_variant (&paramv[n], child);
5273           n++;
5274         }
5275       else
5276         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
5277       g_variant_unref (child);
5278     }
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 (&paramv[n]);
5287   g_free (paramv);
5288 }
5289
5290 static GVariant *
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,
5297   GError **error,
5298   gpointer user_data)
5299 {
5300   Scanner1Skeleton *skeleton = SCANNER1_SKELETON (user_data);
5301   GValue value = G_VALUE_INIT;
5302   GParamSpec *pspec;
5303   _ExtendedGDBusPropertyInfo *info;
5304   GVariant *ret;
5305   ret = NULL;
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);
5309   if (pspec == NULL)
5310     {
5311       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
5312     }
5313   else
5314     {
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);
5319     }
5320   return ret;
5321 }
5322
5323 static gboolean
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,
5330   GVariant *variant,
5331   GError **error,
5332   gpointer user_data)
5333 {
5334   Scanner1Skeleton *skeleton = SCANNER1_SKELETON (user_data);
5335   GValue value = G_VALUE_INIT;
5336   GParamSpec *pspec;
5337   _ExtendedGDBusPropertyInfo *info;
5338   gboolean ret;
5339   ret = FALSE;
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);
5343   if (pspec == NULL)
5344     {
5345       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
5346     }
5347   else
5348     {
5349       if (info->use_gvariant)
5350         g_value_set_variant (&value, variant);
5351       else
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);
5355       ret = TRUE;
5356     }
5357   return ret;
5358 }
5359
5360 static const GDBusInterfaceVTable _scanner1_skeleton_vtable =
5361 {
5362   _scanner1_skeleton_handle_method_call,
5363   _scanner1_skeleton_handle_get_property,
5364   _scanner1_skeleton_handle_set_property,
5365   {NULL}
5366 };
5367
5368 static GDBusInterfaceInfo *
5369 scanner1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
5370 {
5371   return scanner1_interface_info ();
5372 }
5373
5374 static GDBusInterfaceVTable *
5375 scanner1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
5376 {
5377   return (GDBusInterfaceVTable *) &_scanner1_skeleton_vtable;
5378 }
5379
5380 static GVariant *
5381 scanner1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
5382 {
5383   Scanner1Skeleton *skeleton = SCANNER1_SKELETON (_skeleton);
5384
5385   GVariantBuilder builder;
5386   guint n;
5387   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
5388   if (_scanner1_interface_info.parent_struct.properties == NULL)
5389     goto out;
5390   for (n = 0; _scanner1_interface_info.parent_struct.properties[n] != NULL; n++)
5391     {
5392       GDBusPropertyInfo *info = _scanner1_interface_info.parent_struct.properties[n];
5393       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
5394         {
5395           GVariant *value;
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);
5397           if (value != NULL)
5398             {
5399               g_variant_take_ref (value);
5400               g_variant_builder_add (&builder, "{sv}", info->name, value);
5401               g_variant_unref (value);
5402             }
5403         }
5404     }
5405 out:
5406   return g_variant_builder_end (&builder);
5407 }
5408
5409 static gboolean _scanner1_emit_changed (gpointer user_data);
5410
5411 static void
5412 scanner1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
5413 {
5414   Scanner1Skeleton *skeleton = SCANNER1_SKELETON (_skeleton);
5415   gboolean emit_changed = FALSE;
5416
5417   g_mutex_lock (&skeleton->priv->lock);
5418   if (skeleton->priv->changed_properties_idle_source != NULL)
5419     {
5420       g_source_destroy (skeleton->priv->changed_properties_idle_source);
5421       skeleton->priv->changed_properties_idle_source = NULL;
5422       emit_changed = TRUE;
5423     }
5424   g_mutex_unlock (&skeleton->priv->lock);
5425
5426   if (emit_changed)
5427     _scanner1_emit_changed (skeleton);
5428 }
5429
5430 static void
5431 _scanner1_on_signal_scan_progress (
5432     Scanner1 *object,
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,
5439     guint64 arg_Errors)
5440 {
5441   Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5442
5443   GList      *connections, *l;
5444   GVariant   *signal_variant;
5445   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
5446
5447   signal_variant = g_variant_ref_sink (g_variant_new ("(ssttttt)",
5448                    arg_Category,
5449                    arg_Path,
5450                    arg_UpToDate,
5451                    arg_Processed,
5452                    arg_Deleted,
5453                    arg_Skipped,
5454                    arg_Errors));
5455   for (l = connections; l != NULL; l = l->next)
5456     {
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);
5461     }
5462   g_variant_unref (signal_variant);
5463   g_list_free_full (connections, g_object_unref);
5464 }
5465
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));
5471
5472 #else
5473 G_DEFINE_TYPE_WITH_CODE (Scanner1Skeleton, scanner1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
5474                          G_IMPLEMENT_INTERFACE (TYPE_SCANNER1, scanner1_skeleton_iface_init));
5475
5476 #endif
5477 static void
5478 scanner1_skeleton_finalize (GObject *object)
5479 {
5480   Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5481   guint n;
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);
5491 }
5492
5493 static void
5494 scanner1_skeleton_get_property (GObject      *object,
5495   guint         prop_id,
5496   GValue       *value,
5497   GParamSpec   *pspec G_GNUC_UNUSED)
5498 {
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);
5504 }
5505
5506 static gboolean
5507 _scanner1_emit_changed (gpointer user_data)
5508 {
5509   Scanner1Skeleton *skeleton = SCANNER1_SKELETON (user_data);
5510   GList *l;
5511   GVariantBuilder builder;
5512   GVariantBuilder invalidated_builder;
5513   guint num_changes;
5514
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)
5519     {
5520       ChangedProperty *cp = l->data;
5521       GVariant *variant;
5522       const GValue *cur_value;
5523
5524       cur_value = &skeleton->priv->properties[cp->prop_id - 1];
5525       if (!_g_value_equal (cur_value, &cp->orig_value))
5526         {
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);
5530           num_changes++;
5531         }
5532     }
5533   if (num_changes > 0)
5534     {
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)
5541         {
5542           GDBusConnection *connection = ll->data;
5543
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",
5548                                          signal_variant,
5549                                          NULL);
5550         }
5551       g_variant_unref (signal_variant);
5552       g_list_free_full (connections, g_object_unref);
5553     }
5554   else
5555     {
5556       g_variant_builder_clear (&builder);
5557       g_variant_builder_clear (&invalidated_builder);
5558     }
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);
5563   return FALSE;
5564 }
5565
5566 static void
5567 _scanner1_schedule_emit_changed (Scanner1Skeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
5568 {
5569   ChangedProperty *cp;
5570   GList *l;
5571   cp = NULL;
5572   for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
5573     {
5574       ChangedProperty *i_cp = l->data;
5575       if (i_cp->info == info)
5576         {
5577           cp = i_cp;
5578           break;
5579         }
5580     }
5581   if (cp == NULL)
5582     {
5583       cp = g_new0 (ChangedProperty, 1);
5584       cp->prop_id = prop_id;
5585       cp->info = info;
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);
5589     }
5590 }
5591
5592 static void
5593 scanner1_skeleton_notify (GObject      *object,
5594   GParamSpec *pspec G_GNUC_UNUSED)
5595 {
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)
5600     {
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);
5607     }
5608   g_mutex_unlock (&skeleton->priv->lock);
5609 }
5610
5611 static void
5612 scanner1_skeleton_set_property (GObject      *object,
5613   guint         prop_id,
5614   const GValue *value,
5615   GParamSpec   *pspec)
5616 {
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]))
5622     {
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);
5627     }
5628   g_mutex_unlock (&skeleton->priv->lock);
5629   g_object_thaw_notify (object);
5630 }
5631
5632 static void
5633 scanner1_skeleton_init (Scanner1Skeleton *skeleton)
5634 {
5635 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
5636   skeleton->priv = scanner1_skeleton_get_instance_private (skeleton);
5637 #else
5638   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_SCANNER1_SKELETON, Scanner1SkeletonPrivate);
5639 #endif
5640
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);
5649 }
5650
5651 static const gchar *
5652 scanner1_skeleton_get_data_base_path (Scanner1 *object)
5653 {
5654   Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5655   const gchar *value;
5656   g_mutex_lock (&skeleton->priv->lock);
5657   value = g_value_get_string (&(skeleton->priv->properties[0]));
5658   g_mutex_unlock (&skeleton->priv->lock);
5659   return value;
5660 }
5661
5662 static gboolean 
5663 scanner1_skeleton_get_is_scanning (Scanner1 *object)
5664 {
5665   Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5666   gboolean value;
5667   g_mutex_lock (&skeleton->priv->lock);
5668   value = g_value_get_boolean (&(skeleton->priv->properties[1]));
5669   g_mutex_unlock (&skeleton->priv->lock);
5670   return value;
5671 }
5672
5673 static gboolean 
5674 scanner1_skeleton_get_write_locked (Scanner1 *object)
5675 {
5676   Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5677   gboolean value;
5678   g_mutex_lock (&skeleton->priv->lock);
5679   value = g_value_get_boolean (&(skeleton->priv->properties[2]));
5680   g_mutex_unlock (&skeleton->priv->lock);
5681   return value;
5682 }
5683
5684 static guint64 
5685 scanner1_skeleton_get_update_id (Scanner1 *object)
5686 {
5687   Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5688   guint64 value;
5689   g_mutex_lock (&skeleton->priv->lock);
5690   value = g_value_get_uint64 (&(skeleton->priv->properties[3]));
5691   g_mutex_unlock (&skeleton->priv->lock);
5692   return value;
5693 }
5694
5695 static GVariant *
5696 scanner1_skeleton_get_categories (Scanner1 *object)
5697 {
5698   Scanner1Skeleton *skeleton = SCANNER1_SKELETON (object);
5699   GVariant *value;
5700   g_mutex_lock (&skeleton->priv->lock);
5701   value = g_value_get_variant (&(skeleton->priv->properties[4]));
5702   g_mutex_unlock (&skeleton->priv->lock);
5703   return value;
5704 }
5705
5706 static void
5707 scanner1_skeleton_class_init (Scanner1SkeletonClass *klass)
5708 {
5709   GObjectClass *gobject_class;
5710   GDBusInterfaceSkeletonClass *skeleton_class;
5711
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;
5717
5718
5719   scanner1_override_properties (gobject_class, 1);
5720
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;
5726
5727 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
5728   g_type_class_add_private (klass, sizeof (Scanner1SkeletonPrivate));
5729 #endif
5730 }
5731
5732 static void
5733 scanner1_skeleton_iface_init (Scanner1Iface *iface)
5734 {
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;
5741 }
5742
5743 /**
5744  * scanner1_skeleton_new:
5745  *
5746  * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-lightmediascanner-Scanner1.top_of_page">org.lightmediascanner.Scanner1</link>.
5747  *
5748  * Returns: (transfer full) (type Scanner1Skeleton): The skeleton object.
5749  */
5750 Scanner1 *
5751 scanner1_skeleton_new (void)
5752 {
5753   return SCANNER1 (g_object_new (TYPE_SCANNER1_SKELETON, NULL));
5754 }
5755