1 /*
2  * This file is generated by gdbus-codegen, do not modify it.
3  *
4  * The license of this code is the same as for the D-Bus interface description
5  * it was derived from. Note that it links to GLib, so must comply with the
6  * LGPL linking clauses.
7  */
8 
9 #ifdef HAVE_CONFIG_H
10 #  include "config.h"
11 #endif
12 
13 #include "tumbler-manager-gdbus.h"
14 
15 #include <string.h>
16 #ifdef G_OS_UNIX
17 #  include <gio/gunixfdlist.h>
18 #endif
19 
20 typedef struct
21 {
22   GDBusArgInfo parent_struct;
23   gboolean use_gvariant;
24 } _ExtendedGDBusArgInfo;
25 
26 typedef struct
27 {
28   GDBusMethodInfo parent_struct;
29   const gchar *signal_name;
30   gboolean pass_fdlist;
31 } _ExtendedGDBusMethodInfo;
32 
33 typedef struct
34 {
35   GDBusSignalInfo parent_struct;
36   const gchar *signal_name;
37 } _ExtendedGDBusSignalInfo;
38 
39 typedef struct
40 {
41   GDBusPropertyInfo parent_struct;
42   const gchar *hyphen_name;
43   guint use_gvariant : 1;
44   guint emits_changed_signal : 1;
45 } _ExtendedGDBusPropertyInfo;
46 
47 typedef struct
48 {
49   GDBusInterfaceInfo parent_struct;
50   const gchar *hyphen_name;
51 } _ExtendedGDBusInterfaceInfo;
52 
53 typedef struct
54 {
55   const _ExtendedGDBusPropertyInfo *info;
56   guint prop_id;
57   GValue orig_value; /* the value before the change */
58 } ChangedProperty;
59 
60 static void
_changed_property_free(ChangedProperty * data)61 _changed_property_free (ChangedProperty *data)
62 {
63   g_value_unset (&data->orig_value);
64   g_free (data);
65 }
66 
67 static gboolean
_g_strv_equal0(gchar ** a,gchar ** b)68 _g_strv_equal0 (gchar **a, gchar **b)
69 {
70   gboolean ret = FALSE;
71   guint n;
72   if (a == NULL && b == NULL)
73     {
74       ret = TRUE;
75       goto out;
76     }
77   if (a == NULL || b == NULL)
78     goto out;
79   if (g_strv_length (a) != g_strv_length (b))
80     goto out;
81   for (n = 0; a[n] != NULL; n++)
82     if (g_strcmp0 (a[n], b[n]) != 0)
83       goto out;
84   ret = TRUE;
85 out:
86   return ret;
87 }
88 
89 static gboolean
_g_variant_equal0(GVariant * a,GVariant * b)90 _g_variant_equal0 (GVariant *a, GVariant *b)
91 {
92   gboolean ret = FALSE;
93   if (a == NULL && b == NULL)
94     {
95       ret = TRUE;
96       goto out;
97     }
98   if (a == NULL || b == NULL)
99     goto out;
100   ret = g_variant_equal (a, b);
101 out:
102   return ret;
103 }
104 
105 G_GNUC_UNUSED static gboolean
_g_value_equal(const GValue * a,const GValue * b)106 _g_value_equal (const GValue *a, const GValue *b)
107 {
108   gboolean ret = FALSE;
109   g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
110   switch (G_VALUE_TYPE (a))
111     {
112       case G_TYPE_BOOLEAN:
113         ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
114         break;
115       case G_TYPE_UCHAR:
116         ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
117         break;
118       case G_TYPE_INT:
119         ret = (g_value_get_int (a) == g_value_get_int (b));
120         break;
121       case G_TYPE_UINT:
122         ret = (g_value_get_uint (a) == g_value_get_uint (b));
123         break;
124       case G_TYPE_INT64:
125         ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
126         break;
127       case G_TYPE_UINT64:
128         ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
129         break;
130       case G_TYPE_DOUBLE:
131         {
132           /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
133           gdouble da = g_value_get_double (a);
134           gdouble db = g_value_get_double (b);
135           ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
136         }
137         break;
138       case G_TYPE_STRING:
139         ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
140         break;
141       case G_TYPE_VARIANT:
142         ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
143         break;
144       default:
145         if (G_VALUE_TYPE (a) == G_TYPE_STRV)
146           ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
147         else
148           g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
149         break;
150     }
151   return ret;
152 }
153 
154 /* ------------------------------------------------------------------------
155  * Code for interface org.freedesktop.thumbnails.Manager1
156  * ------------------------------------------------------------------------
157  */
158 
159 /**
160  * SECTION:TumblerExportedManager
161  * @title: TumblerExportedManager
162  * @short_description: Generated C code for the org.freedesktop.thumbnails.Manager1 D-Bus interface
163  *
164  * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-thumbnails-Manager1.top_of_page">org.freedesktop.thumbnails.Manager1</link> D-Bus interface in C.
165  */
166 
167 /* ---- Introspection data for org.freedesktop.thumbnails.Manager1 ---- */
168 
169 static const _ExtendedGDBusArgInfo _tumbler_exported_manager_method_info_register_IN_ARG_uri_scheme =
170 {
171   {
172     -1,
173     (gchar *) "uri_scheme",
174     (gchar *) "s",
175     NULL
176   },
177   FALSE
178 };
179 
180 static const _ExtendedGDBusArgInfo _tumbler_exported_manager_method_info_register_IN_ARG_mime_type =
181 {
182   {
183     -1,
184     (gchar *) "mime_type",
185     (gchar *) "s",
186     NULL
187   },
188   FALSE
189 };
190 
191 static const GDBusArgInfo * const _tumbler_exported_manager_method_info_register_IN_ARG_pointers[] =
192 {
193   &_tumbler_exported_manager_method_info_register_IN_ARG_uri_scheme.parent_struct,
194   &_tumbler_exported_manager_method_info_register_IN_ARG_mime_type.parent_struct,
195   NULL
196 };
197 
198 static const _ExtendedGDBusMethodInfo _tumbler_exported_manager_method_info_register =
199 {
200   {
201     -1,
202     (gchar *) "Register",
203     (GDBusArgInfo **) &_tumbler_exported_manager_method_info_register_IN_ARG_pointers,
204     NULL,
205     NULL
206   },
207   "handle-register",
208   FALSE
209 };
210 
211 static const GDBusMethodInfo * const _tumbler_exported_manager_method_info_pointers[] =
212 {
213   &_tumbler_exported_manager_method_info_register.parent_struct,
214   NULL
215 };
216 
217 static const _ExtendedGDBusInterfaceInfo _tumbler_exported_manager_interface_info =
218 {
219   {
220     -1,
221     (gchar *) "org.freedesktop.thumbnails.Manager1",
222     (GDBusMethodInfo **) &_tumbler_exported_manager_method_info_pointers,
223     NULL,
224     NULL,
225     NULL
226   },
227   "exported-manager",
228 };
229 
230 
231 /**
232  * tumbler_exported_manager_interface_info:
233  *
234  * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-thumbnails-Manager1.top_of_page">org.freedesktop.thumbnails.Manager1</link> D-Bus interface.
235  *
236  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
237  */
238 GDBusInterfaceInfo *
tumbler_exported_manager_interface_info(void)239 tumbler_exported_manager_interface_info (void)
240 {
241   return (GDBusInterfaceInfo *) &_tumbler_exported_manager_interface_info.parent_struct;
242 }
243 
244 /**
245  * tumbler_exported_manager_override_properties:
246  * @klass: The class structure for a #GObject derived class.
247  * @property_id_begin: The property id to assign to the first overridden property.
248  *
249  * Overrides all #GObject properties in the #TumblerExportedManager interface for a concrete class.
250  * The properties are overridden in the order they are defined.
251  *
252  * Returns: The last property id.
253  */
254 guint
tumbler_exported_manager_override_properties(GObjectClass * klass,guint property_id_begin)255 tumbler_exported_manager_override_properties (GObjectClass *klass, guint property_id_begin)
256 {
257   return property_id_begin - 1;
258 }
259 
260 
261 
262 /**
263  * TumblerExportedManager:
264  *
265  * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-thumbnails-Manager1.top_of_page">org.freedesktop.thumbnails.Manager1</link>.
266  */
267 
268 /**
269  * TumblerExportedManagerIface:
270  * @parent_iface: The parent interface.
271  * @handle_register: Handler for the #TumblerExportedManager::handle-register signal.
272  *
273  * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-thumbnails-Manager1.top_of_page">org.freedesktop.thumbnails.Manager1</link>.
274  */
275 
276 typedef TumblerExportedManagerIface TumblerExportedManagerInterface;
G_DEFINE_INTERFACE(TumblerExportedManager,tumbler_exported_manager,G_TYPE_OBJECT)277 G_DEFINE_INTERFACE (TumblerExportedManager, tumbler_exported_manager, G_TYPE_OBJECT)
278 
279 static void
280 tumbler_exported_manager_default_init (TumblerExportedManagerIface *iface)
281 {
282   /* GObject signals for incoming D-Bus method calls: */
283   /**
284    * TumblerExportedManager::handle-register:
285    * @object: A #TumblerExportedManager.
286    * @invocation: A #GDBusMethodInvocation.
287    * @arg_uri_scheme: Argument passed by remote caller.
288    * @arg_mime_type: Argument passed by remote caller.
289    *
290    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-thumbnails-Manager1.Register">Register()</link> D-Bus method.
291    *
292    * 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 tumbler_exported_manager_complete_register() 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.
293    *
294    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
295    */
296   g_signal_new ("handle-register",
297     G_TYPE_FROM_INTERFACE (iface),
298     G_SIGNAL_RUN_LAST,
299     G_STRUCT_OFFSET (TumblerExportedManagerIface, handle_register),
300     g_signal_accumulator_true_handled,
301     NULL,
302     g_cclosure_marshal_generic,
303     G_TYPE_BOOLEAN,
304     3,
305     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING);
306 
307 }
308 
309 /**
310  * tumbler_exported_manager_call_register:
311  * @proxy: A #TumblerExportedManagerProxy.
312  * @arg_uri_scheme: Argument to pass with the method invocation.
313  * @arg_mime_type: Argument to pass with the method invocation.
314  * @cancellable: (nullable): A #GCancellable or %NULL.
315  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
316  * @user_data: User data to pass to @callback.
317  *
318  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-thumbnails-Manager1.Register">Register()</link> D-Bus method on @proxy.
319  * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
320  * You can then call tumbler_exported_manager_call_register_finish() to get the result of the operation.
321  *
322  * See tumbler_exported_manager_call_register_sync() for the synchronous, blocking version of this method.
323  */
324 void
tumbler_exported_manager_call_register(TumblerExportedManager * proxy,const gchar * arg_uri_scheme,const gchar * arg_mime_type,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)325 tumbler_exported_manager_call_register (
326     TumblerExportedManager *proxy,
327     const gchar *arg_uri_scheme,
328     const gchar *arg_mime_type,
329     GCancellable *cancellable,
330     GAsyncReadyCallback callback,
331     gpointer user_data)
332 {
333   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
334     "Register",
335     g_variant_new ("(ss)",
336                    arg_uri_scheme,
337                    arg_mime_type),
338     G_DBUS_CALL_FLAGS_NONE,
339     -1,
340     cancellable,
341     callback,
342     user_data);
343 }
344 
345 /**
346  * tumbler_exported_manager_call_register_finish:
347  * @proxy: A #TumblerExportedManagerProxy.
348  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to tumbler_exported_manager_call_register().
349  * @error: Return location for error or %NULL.
350  *
351  * Finishes an operation started with tumbler_exported_manager_call_register().
352  *
353  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
354  */
355 gboolean
tumbler_exported_manager_call_register_finish(TumblerExportedManager * proxy,GAsyncResult * res,GError ** error)356 tumbler_exported_manager_call_register_finish (
357     TumblerExportedManager *proxy,
358     GAsyncResult *res,
359     GError **error)
360 {
361   GVariant *_ret;
362   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
363   if (_ret == NULL)
364     goto _out;
365   g_variant_get (_ret,
366                  "()");
367   g_variant_unref (_ret);
368 _out:
369   return _ret != NULL;
370 }
371 
372 /**
373  * tumbler_exported_manager_call_register_sync:
374  * @proxy: A #TumblerExportedManagerProxy.
375  * @arg_uri_scheme: Argument to pass with the method invocation.
376  * @arg_mime_type: Argument to pass with the method invocation.
377  * @cancellable: (nullable): A #GCancellable or %NULL.
378  * @error: Return location for error or %NULL.
379  *
380  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-thumbnails-Manager1.Register">Register()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
381  *
382  * See tumbler_exported_manager_call_register() for the asynchronous version of this method.
383  *
384  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
385  */
386 gboolean
tumbler_exported_manager_call_register_sync(TumblerExportedManager * proxy,const gchar * arg_uri_scheme,const gchar * arg_mime_type,GCancellable * cancellable,GError ** error)387 tumbler_exported_manager_call_register_sync (
388     TumblerExportedManager *proxy,
389     const gchar *arg_uri_scheme,
390     const gchar *arg_mime_type,
391     GCancellable *cancellable,
392     GError **error)
393 {
394   GVariant *_ret;
395   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
396     "Register",
397     g_variant_new ("(ss)",
398                    arg_uri_scheme,
399                    arg_mime_type),
400     G_DBUS_CALL_FLAGS_NONE,
401     -1,
402     cancellable,
403     error);
404   if (_ret == NULL)
405     goto _out;
406   g_variant_get (_ret,
407                  "()");
408   g_variant_unref (_ret);
409 _out:
410   return _ret != NULL;
411 }
412 
413 /**
414  * tumbler_exported_manager_complete_register:
415  * @object: A #TumblerExportedManager.
416  * @invocation: (transfer full): A #GDBusMethodInvocation.
417  *
418  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-thumbnails-Manager1.Register">Register()</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.
419  *
420  * This method will free @invocation, you cannot use it afterwards.
421  */
422 void
tumbler_exported_manager_complete_register(TumblerExportedManager * object,GDBusMethodInvocation * invocation)423 tumbler_exported_manager_complete_register (
424     TumblerExportedManager *object,
425     GDBusMethodInvocation *invocation)
426 {
427   g_dbus_method_invocation_return_value (invocation,
428     g_variant_new ("()"));
429 }
430 
431 /* ------------------------------------------------------------------------ */
432 
433 /**
434  * TumblerExportedManagerProxy:
435  *
436  * The #TumblerExportedManagerProxy structure contains only private data and should only be accessed using the provided API.
437  */
438 
439 /**
440  * TumblerExportedManagerProxyClass:
441  * @parent_class: The parent class.
442  *
443  * Class structure for #TumblerExportedManagerProxy.
444  */
445 
446 struct _TumblerExportedManagerProxyPrivate
447 {
448   GData *qdata;
449 };
450 
451 static void tumbler_exported_manager_proxy_iface_init (TumblerExportedManagerIface *iface);
452 
453 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE(TumblerExportedManagerProxy,tumbler_exported_manager_proxy,G_TYPE_DBUS_PROXY,G_ADD_PRIVATE (TumblerExportedManagerProxy)G_IMPLEMENT_INTERFACE (TUMBLER_TYPE_EXPORTED_MANAGER,tumbler_exported_manager_proxy_iface_init))454 G_DEFINE_TYPE_WITH_CODE (TumblerExportedManagerProxy, tumbler_exported_manager_proxy, G_TYPE_DBUS_PROXY,
455                          G_ADD_PRIVATE (TumblerExportedManagerProxy)
456                          G_IMPLEMENT_INTERFACE (TUMBLER_TYPE_EXPORTED_MANAGER, tumbler_exported_manager_proxy_iface_init))
457 
458 #else
459 G_DEFINE_TYPE_WITH_CODE (TumblerExportedManagerProxy, tumbler_exported_manager_proxy, G_TYPE_DBUS_PROXY,
460                          G_IMPLEMENT_INTERFACE (TUMBLER_TYPE_EXPORTED_MANAGER, tumbler_exported_manager_proxy_iface_init))
461 
462 #endif
463 static void
464 tumbler_exported_manager_proxy_finalize (GObject *object)
465 {
466   TumblerExportedManagerProxy *proxy = TUMBLER_EXPORTED_MANAGER_PROXY (object);
467   g_datalist_clear (&proxy->priv->qdata);
468   G_OBJECT_CLASS (tumbler_exported_manager_proxy_parent_class)->finalize (object);
469 }
470 
471 static void
tumbler_exported_manager_proxy_get_property(GObject * object,guint prop_id,GValue * value,GParamSpec * pspec G_GNUC_UNUSED)472 tumbler_exported_manager_proxy_get_property (GObject      *object,
473   guint         prop_id,
474   GValue       *value,
475   GParamSpec   *pspec G_GNUC_UNUSED)
476 {
477 }
478 
479 static void
tumbler_exported_manager_proxy_set_property(GObject * object,guint prop_id,const GValue * value,GParamSpec * pspec G_GNUC_UNUSED)480 tumbler_exported_manager_proxy_set_property (GObject      *object,
481   guint         prop_id,
482   const GValue *value,
483   GParamSpec   *pspec G_GNUC_UNUSED)
484 {
485 }
486 
487 static void
tumbler_exported_manager_proxy_g_signal(GDBusProxy * proxy,const gchar * sender_name G_GNUC_UNUSED,const gchar * signal_name,GVariant * parameters)488 tumbler_exported_manager_proxy_g_signal (GDBusProxy *proxy,
489   const gchar *sender_name G_GNUC_UNUSED,
490   const gchar *signal_name,
491   GVariant *parameters)
492 {
493   _ExtendedGDBusSignalInfo *info;
494   GVariantIter iter;
495   GVariant *child;
496   GValue *paramv;
497   gsize num_params;
498   gsize n;
499   guint signal_id;
500   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_tumbler_exported_manager_interface_info.parent_struct, signal_name);
501   if (info == NULL)
502     return;
503   num_params = g_variant_n_children (parameters);
504   paramv = g_new0 (GValue, num_params + 1);
505   g_value_init (&paramv[0], TUMBLER_TYPE_EXPORTED_MANAGER);
506   g_value_set_object (&paramv[0], proxy);
507   g_variant_iter_init (&iter, parameters);
508   n = 1;
509   while ((child = g_variant_iter_next_value (&iter)) != NULL)
510     {
511       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
512       if (arg_info->use_gvariant)
513         {
514           g_value_init (&paramv[n], G_TYPE_VARIANT);
515           g_value_set_variant (&paramv[n], child);
516           n++;
517         }
518       else
519         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
520       g_variant_unref (child);
521     }
522   signal_id = g_signal_lookup (info->signal_name, TUMBLER_TYPE_EXPORTED_MANAGER);
523   g_signal_emitv (paramv, signal_id, 0, NULL);
524   for (n = 0; n < num_params + 1; n++)
525     g_value_unset (&paramv[n]);
526   g_free (paramv);
527 }
528 
529 static void
tumbler_exported_manager_proxy_g_properties_changed(GDBusProxy * _proxy,GVariant * changed_properties,const gchar * const * invalidated_properties)530 tumbler_exported_manager_proxy_g_properties_changed (GDBusProxy *_proxy,
531   GVariant *changed_properties,
532   const gchar *const *invalidated_properties)
533 {
534   TumblerExportedManagerProxy *proxy = TUMBLER_EXPORTED_MANAGER_PROXY (_proxy);
535   guint n;
536   const gchar *key;
537   GVariantIter *iter;
538   _ExtendedGDBusPropertyInfo *info;
539   g_variant_get (changed_properties, "a{sv}", &iter);
540   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
541     {
542       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_tumbler_exported_manager_interface_info.parent_struct, key);
543       g_datalist_remove_data (&proxy->priv->qdata, key);
544       if (info != NULL)
545         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
546     }
547   g_variant_iter_free (iter);
548   for (n = 0; invalidated_properties[n] != NULL; n++)
549     {
550       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_tumbler_exported_manager_interface_info.parent_struct, invalidated_properties[n]);
551       g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
552       if (info != NULL)
553         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
554     }
555 }
556 
557 static void
tumbler_exported_manager_proxy_init(TumblerExportedManagerProxy * proxy)558 tumbler_exported_manager_proxy_init (TumblerExportedManagerProxy *proxy)
559 {
560 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
561   proxy->priv = tumbler_exported_manager_proxy_get_instance_private (proxy);
562 #else
563   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TUMBLER_TYPE_EXPORTED_MANAGER_PROXY, TumblerExportedManagerProxyPrivate);
564 #endif
565 
566   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), tumbler_exported_manager_interface_info ());
567 }
568 
569 static void
tumbler_exported_manager_proxy_class_init(TumblerExportedManagerProxyClass * klass)570 tumbler_exported_manager_proxy_class_init (TumblerExportedManagerProxyClass *klass)
571 {
572   GObjectClass *gobject_class;
573   GDBusProxyClass *proxy_class;
574 
575   gobject_class = G_OBJECT_CLASS (klass);
576   gobject_class->finalize     = tumbler_exported_manager_proxy_finalize;
577   gobject_class->get_property = tumbler_exported_manager_proxy_get_property;
578   gobject_class->set_property = tumbler_exported_manager_proxy_set_property;
579 
580   proxy_class = G_DBUS_PROXY_CLASS (klass);
581   proxy_class->g_signal = tumbler_exported_manager_proxy_g_signal;
582   proxy_class->g_properties_changed = tumbler_exported_manager_proxy_g_properties_changed;
583 
584 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
585   g_type_class_add_private (klass, sizeof (TumblerExportedManagerProxyPrivate));
586 #endif
587 }
588 
589 static void
tumbler_exported_manager_proxy_iface_init(TumblerExportedManagerIface * iface)590 tumbler_exported_manager_proxy_iface_init (TumblerExportedManagerIface *iface)
591 {
592 }
593 
594 /**
595  * tumbler_exported_manager_proxy_new:
596  * @connection: A #GDBusConnection.
597  * @flags: Flags from the #GDBusProxyFlags enumeration.
598  * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
599  * @object_path: An object path.
600  * @cancellable: (nullable): A #GCancellable or %NULL.
601  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
602  * @user_data: User data to pass to @callback.
603  *
604  * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-thumbnails-Manager1.top_of_page">org.freedesktop.thumbnails.Manager1</link>. See g_dbus_proxy_new() for more details.
605  *
606  * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
607  * You can then call tumbler_exported_manager_proxy_new_finish() to get the result of the operation.
608  *
609  * See tumbler_exported_manager_proxy_new_sync() for the synchronous, blocking version of this constructor.
610  */
611 void
tumbler_exported_manager_proxy_new(GDBusConnection * connection,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)612 tumbler_exported_manager_proxy_new (
613     GDBusConnection     *connection,
614     GDBusProxyFlags      flags,
615     const gchar         *name,
616     const gchar         *object_path,
617     GCancellable        *cancellable,
618     GAsyncReadyCallback  callback,
619     gpointer             user_data)
620 {
621   g_async_initable_new_async (TUMBLER_TYPE_EXPORTED_MANAGER_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.thumbnails.Manager1", NULL);
622 }
623 
624 /**
625  * tumbler_exported_manager_proxy_new_finish:
626  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to tumbler_exported_manager_proxy_new().
627  * @error: Return location for error or %NULL
628  *
629  * Finishes an operation started with tumbler_exported_manager_proxy_new().
630  *
631  * Returns: (transfer full) (type TumblerExportedManagerProxy): The constructed proxy object or %NULL if @error is set.
632  */
633 TumblerExportedManager *
tumbler_exported_manager_proxy_new_finish(GAsyncResult * res,GError ** error)634 tumbler_exported_manager_proxy_new_finish (
635     GAsyncResult        *res,
636     GError             **error)
637 {
638   GObject *ret;
639   GObject *source_object;
640   source_object = g_async_result_get_source_object (res);
641   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
642   g_object_unref (source_object);
643   if (ret != NULL)
644     return TUMBLER_EXPORTED_MANAGER (ret);
645   else
646     return NULL;
647 }
648 
649 /**
650  * tumbler_exported_manager_proxy_new_sync:
651  * @connection: A #GDBusConnection.
652  * @flags: Flags from the #GDBusProxyFlags enumeration.
653  * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
654  * @object_path: An object path.
655  * @cancellable: (nullable): A #GCancellable or %NULL.
656  * @error: Return location for error or %NULL
657  *
658  * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-thumbnails-Manager1.top_of_page">org.freedesktop.thumbnails.Manager1</link>. See g_dbus_proxy_new_sync() for more details.
659  *
660  * The calling thread is blocked until a reply is received.
661  *
662  * See tumbler_exported_manager_proxy_new() for the asynchronous version of this constructor.
663  *
664  * Returns: (transfer full) (type TumblerExportedManagerProxy): The constructed proxy object or %NULL if @error is set.
665  */
666 TumblerExportedManager *
tumbler_exported_manager_proxy_new_sync(GDBusConnection * connection,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)667 tumbler_exported_manager_proxy_new_sync (
668     GDBusConnection     *connection,
669     GDBusProxyFlags      flags,
670     const gchar         *name,
671     const gchar         *object_path,
672     GCancellable        *cancellable,
673     GError             **error)
674 {
675   GInitable *ret;
676   ret = g_initable_new (TUMBLER_TYPE_EXPORTED_MANAGER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.thumbnails.Manager1", NULL);
677   if (ret != NULL)
678     return TUMBLER_EXPORTED_MANAGER (ret);
679   else
680     return NULL;
681 }
682 
683 
684 /**
685  * tumbler_exported_manager_proxy_new_for_bus:
686  * @bus_type: A #GBusType.
687  * @flags: Flags from the #GDBusProxyFlags enumeration.
688  * @name: A bus name (well-known or unique).
689  * @object_path: An object path.
690  * @cancellable: (nullable): A #GCancellable or %NULL.
691  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
692  * @user_data: User data to pass to @callback.
693  *
694  * Like tumbler_exported_manager_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
695  *
696  * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
697  * You can then call tumbler_exported_manager_proxy_new_for_bus_finish() to get the result of the operation.
698  *
699  * See tumbler_exported_manager_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
700  */
701 void
tumbler_exported_manager_proxy_new_for_bus(GBusType bus_type,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)702 tumbler_exported_manager_proxy_new_for_bus (
703     GBusType             bus_type,
704     GDBusProxyFlags      flags,
705     const gchar         *name,
706     const gchar         *object_path,
707     GCancellable        *cancellable,
708     GAsyncReadyCallback  callback,
709     gpointer             user_data)
710 {
711   g_async_initable_new_async (TUMBLER_TYPE_EXPORTED_MANAGER_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.thumbnails.Manager1", NULL);
712 }
713 
714 /**
715  * tumbler_exported_manager_proxy_new_for_bus_finish:
716  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to tumbler_exported_manager_proxy_new_for_bus().
717  * @error: Return location for error or %NULL
718  *
719  * Finishes an operation started with tumbler_exported_manager_proxy_new_for_bus().
720  *
721  * Returns: (transfer full) (type TumblerExportedManagerProxy): The constructed proxy object or %NULL if @error is set.
722  */
723 TumblerExportedManager *
tumbler_exported_manager_proxy_new_for_bus_finish(GAsyncResult * res,GError ** error)724 tumbler_exported_manager_proxy_new_for_bus_finish (
725     GAsyncResult        *res,
726     GError             **error)
727 {
728   GObject *ret;
729   GObject *source_object;
730   source_object = g_async_result_get_source_object (res);
731   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
732   g_object_unref (source_object);
733   if (ret != NULL)
734     return TUMBLER_EXPORTED_MANAGER (ret);
735   else
736     return NULL;
737 }
738 
739 /**
740  * tumbler_exported_manager_proxy_new_for_bus_sync:
741  * @bus_type: A #GBusType.
742  * @flags: Flags from the #GDBusProxyFlags enumeration.
743  * @name: A bus name (well-known or unique).
744  * @object_path: An object path.
745  * @cancellable: (nullable): A #GCancellable or %NULL.
746  * @error: Return location for error or %NULL
747  *
748  * Like tumbler_exported_manager_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
749  *
750  * The calling thread is blocked until a reply is received.
751  *
752  * See tumbler_exported_manager_proxy_new_for_bus() for the asynchronous version of this constructor.
753  *
754  * Returns: (transfer full) (type TumblerExportedManagerProxy): The constructed proxy object or %NULL if @error is set.
755  */
756 TumblerExportedManager *
tumbler_exported_manager_proxy_new_for_bus_sync(GBusType bus_type,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)757 tumbler_exported_manager_proxy_new_for_bus_sync (
758     GBusType             bus_type,
759     GDBusProxyFlags      flags,
760     const gchar         *name,
761     const gchar         *object_path,
762     GCancellable        *cancellable,
763     GError             **error)
764 {
765   GInitable *ret;
766   ret = g_initable_new (TUMBLER_TYPE_EXPORTED_MANAGER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.thumbnails.Manager1", NULL);
767   if (ret != NULL)
768     return TUMBLER_EXPORTED_MANAGER (ret);
769   else
770     return NULL;
771 }
772 
773 
774 /* ------------------------------------------------------------------------ */
775 
776 /**
777  * TumblerExportedManagerSkeleton:
778  *
779  * The #TumblerExportedManagerSkeleton structure contains only private data and should only be accessed using the provided API.
780  */
781 
782 /**
783  * TumblerExportedManagerSkeletonClass:
784  * @parent_class: The parent class.
785  *
786  * Class structure for #TumblerExportedManagerSkeleton.
787  */
788 
789 struct _TumblerExportedManagerSkeletonPrivate
790 {
791   GValue *properties;
792   GList *changed_properties;
793   GSource *changed_properties_idle_source;
794   GMainContext *context;
795   GMutex lock;
796 };
797 
798 static void
_tumbler_exported_manager_skeleton_handle_method_call(GDBusConnection * connection G_GNUC_UNUSED,const gchar * sender G_GNUC_UNUSED,const gchar * object_path G_GNUC_UNUSED,const gchar * interface_name,const gchar * method_name,GVariant * parameters,GDBusMethodInvocation * invocation,gpointer user_data)799 _tumbler_exported_manager_skeleton_handle_method_call (
800   GDBusConnection *connection G_GNUC_UNUSED,
801   const gchar *sender G_GNUC_UNUSED,
802   const gchar *object_path G_GNUC_UNUSED,
803   const gchar *interface_name,
804   const gchar *method_name,
805   GVariant *parameters,
806   GDBusMethodInvocation *invocation,
807   gpointer user_data)
808 {
809   TumblerExportedManagerSkeleton *skeleton = TUMBLER_EXPORTED_MANAGER_SKELETON (user_data);
810   _ExtendedGDBusMethodInfo *info;
811   GVariantIter iter;
812   GVariant *child;
813   GValue *paramv;
814   gsize num_params;
815   guint num_extra;
816   gsize n;
817   guint signal_id;
818   GValue return_value = G_VALUE_INIT;
819   info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
820   g_assert (info != NULL);
821   num_params = g_variant_n_children (parameters);
822   num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
823   n = 0;
824   g_value_init (&paramv[n], TUMBLER_TYPE_EXPORTED_MANAGER);
825   g_value_set_object (&paramv[n++], skeleton);
826   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
827   g_value_set_object (&paramv[n++], invocation);
828   if (info->pass_fdlist)
829     {
830 #ifdef G_OS_UNIX
831       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
832       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
833 #else
834       g_assert_not_reached ();
835 #endif
836     }
837   g_variant_iter_init (&iter, parameters);
838   while ((child = g_variant_iter_next_value (&iter)) != NULL)
839     {
840       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
841       if (arg_info->use_gvariant)
842         {
843           g_value_init (&paramv[n], G_TYPE_VARIANT);
844           g_value_set_variant (&paramv[n], child);
845           n++;
846         }
847       else
848         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
849       g_variant_unref (child);
850     }
851   signal_id = g_signal_lookup (info->signal_name, TUMBLER_TYPE_EXPORTED_MANAGER);
852   g_value_init (&return_value, G_TYPE_BOOLEAN);
853   g_signal_emitv (paramv, signal_id, 0, &return_value);
854   if (!g_value_get_boolean (&return_value))
855     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);
856   g_value_unset (&return_value);
857   for (n = 0; n < num_params + num_extra; n++)
858     g_value_unset (&paramv[n]);
859   g_free (paramv);
860 }
861 
862 static GVariant *
_tumbler_exported_manager_skeleton_handle_get_property(GDBusConnection * connection G_GNUC_UNUSED,const gchar * sender G_GNUC_UNUSED,const gchar * object_path G_GNUC_UNUSED,const gchar * interface_name G_GNUC_UNUSED,const gchar * property_name,GError ** error,gpointer user_data)863 _tumbler_exported_manager_skeleton_handle_get_property (
864   GDBusConnection *connection G_GNUC_UNUSED,
865   const gchar *sender G_GNUC_UNUSED,
866   const gchar *object_path G_GNUC_UNUSED,
867   const gchar *interface_name G_GNUC_UNUSED,
868   const gchar *property_name,
869   GError **error,
870   gpointer user_data)
871 {
872   TumblerExportedManagerSkeleton *skeleton = TUMBLER_EXPORTED_MANAGER_SKELETON (user_data);
873   GValue value = G_VALUE_INIT;
874   GParamSpec *pspec;
875   _ExtendedGDBusPropertyInfo *info;
876   GVariant *ret;
877   ret = NULL;
878   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_tumbler_exported_manager_interface_info.parent_struct, property_name);
879   g_assert (info != NULL);
880   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
881   if (pspec == NULL)
882     {
883       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
884     }
885   else
886     {
887       g_value_init (&value, pspec->value_type);
888       g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
889       ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
890       g_value_unset (&value);
891     }
892   return ret;
893 }
894 
895 static gboolean
_tumbler_exported_manager_skeleton_handle_set_property(GDBusConnection * connection G_GNUC_UNUSED,const gchar * sender G_GNUC_UNUSED,const gchar * object_path G_GNUC_UNUSED,const gchar * interface_name G_GNUC_UNUSED,const gchar * property_name,GVariant * variant,GError ** error,gpointer user_data)896 _tumbler_exported_manager_skeleton_handle_set_property (
897   GDBusConnection *connection G_GNUC_UNUSED,
898   const gchar *sender G_GNUC_UNUSED,
899   const gchar *object_path G_GNUC_UNUSED,
900   const gchar *interface_name G_GNUC_UNUSED,
901   const gchar *property_name,
902   GVariant *variant,
903   GError **error,
904   gpointer user_data)
905 {
906   TumblerExportedManagerSkeleton *skeleton = TUMBLER_EXPORTED_MANAGER_SKELETON (user_data);
907   GValue value = G_VALUE_INIT;
908   GParamSpec *pspec;
909   _ExtendedGDBusPropertyInfo *info;
910   gboolean ret;
911   ret = FALSE;
912   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_tumbler_exported_manager_interface_info.parent_struct, property_name);
913   g_assert (info != NULL);
914   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
915   if (pspec == NULL)
916     {
917       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
918     }
919   else
920     {
921       if (info->use_gvariant)
922         g_value_set_variant (&value, variant);
923       else
924         g_dbus_gvariant_to_gvalue (variant, &value);
925       g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
926       g_value_unset (&value);
927       ret = TRUE;
928     }
929   return ret;
930 }
931 
932 static const GDBusInterfaceVTable _tumbler_exported_manager_skeleton_vtable =
933 {
934   _tumbler_exported_manager_skeleton_handle_method_call,
935   _tumbler_exported_manager_skeleton_handle_get_property,
936   _tumbler_exported_manager_skeleton_handle_set_property,
937   {NULL}
938 };
939 
940 static GDBusInterfaceInfo *
tumbler_exported_manager_skeleton_dbus_interface_get_info(GDBusInterfaceSkeleton * skeleton G_GNUC_UNUSED)941 tumbler_exported_manager_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
942 {
943   return tumbler_exported_manager_interface_info ();
944 }
945 
946 static GDBusInterfaceVTable *
tumbler_exported_manager_skeleton_dbus_interface_get_vtable(GDBusInterfaceSkeleton * skeleton G_GNUC_UNUSED)947 tumbler_exported_manager_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
948 {
949   return (GDBusInterfaceVTable *) &_tumbler_exported_manager_skeleton_vtable;
950 }
951 
952 static GVariant *
tumbler_exported_manager_skeleton_dbus_interface_get_properties(GDBusInterfaceSkeleton * _skeleton)953 tumbler_exported_manager_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
954 {
955   TumblerExportedManagerSkeleton *skeleton = TUMBLER_EXPORTED_MANAGER_SKELETON (_skeleton);
956 
957   GVariantBuilder builder;
958   guint n;
959   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
960   if (_tumbler_exported_manager_interface_info.parent_struct.properties == NULL)
961     goto out;
962   for (n = 0; _tumbler_exported_manager_interface_info.parent_struct.properties[n] != NULL; n++)
963     {
964       GDBusPropertyInfo *info = _tumbler_exported_manager_interface_info.parent_struct.properties[n];
965       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
966         {
967           GVariant *value;
968           value = _tumbler_exported_manager_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.thumbnails.Manager1", info->name, NULL, skeleton);
969           if (value != NULL)
970             {
971               g_variant_take_ref (value);
972               g_variant_builder_add (&builder, "{sv}", info->name, value);
973               g_variant_unref (value);
974             }
975         }
976     }
977 out:
978   return g_variant_builder_end (&builder);
979 }
980 
981 static void
tumbler_exported_manager_skeleton_dbus_interface_flush(GDBusInterfaceSkeleton * _skeleton)982 tumbler_exported_manager_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
983 {
984 }
985 
986 static void tumbler_exported_manager_skeleton_iface_init (TumblerExportedManagerIface *iface);
987 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE(TumblerExportedManagerSkeleton,tumbler_exported_manager_skeleton,G_TYPE_DBUS_INTERFACE_SKELETON,G_ADD_PRIVATE (TumblerExportedManagerSkeleton)G_IMPLEMENT_INTERFACE (TUMBLER_TYPE_EXPORTED_MANAGER,tumbler_exported_manager_skeleton_iface_init))988 G_DEFINE_TYPE_WITH_CODE (TumblerExportedManagerSkeleton, tumbler_exported_manager_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
989                          G_ADD_PRIVATE (TumblerExportedManagerSkeleton)
990                          G_IMPLEMENT_INTERFACE (TUMBLER_TYPE_EXPORTED_MANAGER, tumbler_exported_manager_skeleton_iface_init))
991 
992 #else
993 G_DEFINE_TYPE_WITH_CODE (TumblerExportedManagerSkeleton, tumbler_exported_manager_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
994                          G_IMPLEMENT_INTERFACE (TUMBLER_TYPE_EXPORTED_MANAGER, tumbler_exported_manager_skeleton_iface_init))
995 
996 #endif
997 static void
998 tumbler_exported_manager_skeleton_finalize (GObject *object)
999 {
1000   TumblerExportedManagerSkeleton *skeleton = TUMBLER_EXPORTED_MANAGER_SKELETON (object);
1001   g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
1002   if (skeleton->priv->changed_properties_idle_source != NULL)
1003     g_source_destroy (skeleton->priv->changed_properties_idle_source);
1004   g_main_context_unref (skeleton->priv->context);
1005   g_mutex_clear (&skeleton->priv->lock);
1006   G_OBJECT_CLASS (tumbler_exported_manager_skeleton_parent_class)->finalize (object);
1007 }
1008 
1009 static void
tumbler_exported_manager_skeleton_init(TumblerExportedManagerSkeleton * skeleton)1010 tumbler_exported_manager_skeleton_init (TumblerExportedManagerSkeleton *skeleton)
1011 {
1012 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1013   skeleton->priv = tumbler_exported_manager_skeleton_get_instance_private (skeleton);
1014 #else
1015   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TUMBLER_TYPE_EXPORTED_MANAGER_SKELETON, TumblerExportedManagerSkeletonPrivate);
1016 #endif
1017 
1018   g_mutex_init (&skeleton->priv->lock);
1019   skeleton->priv->context = g_main_context_ref_thread_default ();
1020 }
1021 
1022 static void
tumbler_exported_manager_skeleton_class_init(TumblerExportedManagerSkeletonClass * klass)1023 tumbler_exported_manager_skeleton_class_init (TumblerExportedManagerSkeletonClass *klass)
1024 {
1025   GObjectClass *gobject_class;
1026   GDBusInterfaceSkeletonClass *skeleton_class;
1027 
1028   gobject_class = G_OBJECT_CLASS (klass);
1029   gobject_class->finalize = tumbler_exported_manager_skeleton_finalize;
1030 
1031   skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
1032   skeleton_class->get_info = tumbler_exported_manager_skeleton_dbus_interface_get_info;
1033   skeleton_class->get_properties = tumbler_exported_manager_skeleton_dbus_interface_get_properties;
1034   skeleton_class->flush = tumbler_exported_manager_skeleton_dbus_interface_flush;
1035   skeleton_class->get_vtable = tumbler_exported_manager_skeleton_dbus_interface_get_vtable;
1036 
1037 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1038   g_type_class_add_private (klass, sizeof (TumblerExportedManagerSkeletonPrivate));
1039 #endif
1040 }
1041 
1042 static void
tumbler_exported_manager_skeleton_iface_init(TumblerExportedManagerIface * iface)1043 tumbler_exported_manager_skeleton_iface_init (TumblerExportedManagerIface *iface)
1044 {
1045 }
1046 
1047 /**
1048  * tumbler_exported_manager_skeleton_new:
1049  *
1050  * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-thumbnails-Manager1.top_of_page">org.freedesktop.thumbnails.Manager1</link>.
1051  *
1052  * Returns: (transfer full) (type TumblerExportedManagerSkeleton): The skeleton object.
1053  */
1054 TumblerExportedManager *
tumbler_exported_manager_skeleton_new(void)1055 tumbler_exported_manager_skeleton_new (void)
1056 {
1057   return TUMBLER_EXPORTED_MANAGER (g_object_new (TUMBLER_TYPE_EXPORTED_MANAGER_SKELETON, NULL));
1058 }
1059 
1060