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 "thunar-dbus-freedesktop-interfaces.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.FileManager1
156  * ------------------------------------------------------------------------
157  */
158 
159 /**
160  * SECTION:ThunarOrgFreedesktopFileManager1
161  * @title: ThunarOrgFreedesktopFileManager1
162  * @short_description: Generated C code for the org.freedesktop.FileManager1 D-Bus interface
163  *
164  * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-FileManager1.top_of_page">org.freedesktop.FileManager1</link> D-Bus interface in C.
165  */
166 
167 /* ---- Introspection data for org.freedesktop.FileManager1 ---- */
168 
169 static const _ExtendedGDBusArgInfo _thunar_org_freedesktop_file_manager1_method_info_show_folders_IN_ARG_URIs =
170 {
171   {
172     -1,
173     (gchar *) "URIs",
174     (gchar *) "as",
175     NULL
176   },
177   FALSE
178 };
179 
180 static const _ExtendedGDBusArgInfo _thunar_org_freedesktop_file_manager1_method_info_show_folders_IN_ARG_StartupId =
181 {
182   {
183     -1,
184     (gchar *) "StartupId",
185     (gchar *) "s",
186     NULL
187   },
188   FALSE
189 };
190 
191 static const GDBusArgInfo * const _thunar_org_freedesktop_file_manager1_method_info_show_folders_IN_ARG_pointers[] =
192 {
193   &_thunar_org_freedesktop_file_manager1_method_info_show_folders_IN_ARG_URIs.parent_struct,
194   &_thunar_org_freedesktop_file_manager1_method_info_show_folders_IN_ARG_StartupId.parent_struct,
195   NULL
196 };
197 
198 static const _ExtendedGDBusMethodInfo _thunar_org_freedesktop_file_manager1_method_info_show_folders =
199 {
200   {
201     -1,
202     (gchar *) "ShowFolders",
203     (GDBusArgInfo **) &_thunar_org_freedesktop_file_manager1_method_info_show_folders_IN_ARG_pointers,
204     NULL,
205     NULL
206   },
207   "handle-show-folders",
208   FALSE
209 };
210 
211 static const _ExtendedGDBusArgInfo _thunar_org_freedesktop_file_manager1_method_info_show_items_IN_ARG_URIs =
212 {
213   {
214     -1,
215     (gchar *) "URIs",
216     (gchar *) "as",
217     NULL
218   },
219   FALSE
220 };
221 
222 static const _ExtendedGDBusArgInfo _thunar_org_freedesktop_file_manager1_method_info_show_items_IN_ARG_StartupId =
223 {
224   {
225     -1,
226     (gchar *) "StartupId",
227     (gchar *) "s",
228     NULL
229   },
230   FALSE
231 };
232 
233 static const GDBusArgInfo * const _thunar_org_freedesktop_file_manager1_method_info_show_items_IN_ARG_pointers[] =
234 {
235   &_thunar_org_freedesktop_file_manager1_method_info_show_items_IN_ARG_URIs.parent_struct,
236   &_thunar_org_freedesktop_file_manager1_method_info_show_items_IN_ARG_StartupId.parent_struct,
237   NULL
238 };
239 
240 static const _ExtendedGDBusMethodInfo _thunar_org_freedesktop_file_manager1_method_info_show_items =
241 {
242   {
243     -1,
244     (gchar *) "ShowItems",
245     (GDBusArgInfo **) &_thunar_org_freedesktop_file_manager1_method_info_show_items_IN_ARG_pointers,
246     NULL,
247     NULL
248   },
249   "handle-show-items",
250   FALSE
251 };
252 
253 static const _ExtendedGDBusArgInfo _thunar_org_freedesktop_file_manager1_method_info_show_item_properties_IN_ARG_URIs =
254 {
255   {
256     -1,
257     (gchar *) "URIs",
258     (gchar *) "as",
259     NULL
260   },
261   FALSE
262 };
263 
264 static const _ExtendedGDBusArgInfo _thunar_org_freedesktop_file_manager1_method_info_show_item_properties_IN_ARG_StartupId =
265 {
266   {
267     -1,
268     (gchar *) "StartupId",
269     (gchar *) "s",
270     NULL
271   },
272   FALSE
273 };
274 
275 static const GDBusArgInfo * const _thunar_org_freedesktop_file_manager1_method_info_show_item_properties_IN_ARG_pointers[] =
276 {
277   &_thunar_org_freedesktop_file_manager1_method_info_show_item_properties_IN_ARG_URIs.parent_struct,
278   &_thunar_org_freedesktop_file_manager1_method_info_show_item_properties_IN_ARG_StartupId.parent_struct,
279   NULL
280 };
281 
282 static const _ExtendedGDBusMethodInfo _thunar_org_freedesktop_file_manager1_method_info_show_item_properties =
283 {
284   {
285     -1,
286     (gchar *) "ShowItemProperties",
287     (GDBusArgInfo **) &_thunar_org_freedesktop_file_manager1_method_info_show_item_properties_IN_ARG_pointers,
288     NULL,
289     NULL
290   },
291   "handle-show-item-properties",
292   FALSE
293 };
294 
295 static const GDBusMethodInfo * const _thunar_org_freedesktop_file_manager1_method_info_pointers[] =
296 {
297   &_thunar_org_freedesktop_file_manager1_method_info_show_folders.parent_struct,
298   &_thunar_org_freedesktop_file_manager1_method_info_show_items.parent_struct,
299   &_thunar_org_freedesktop_file_manager1_method_info_show_item_properties.parent_struct,
300   NULL
301 };
302 
303 static const _ExtendedGDBusInterfaceInfo _thunar_org_freedesktop_file_manager1_interface_info =
304 {
305   {
306     -1,
307     (gchar *) "org.freedesktop.FileManager1",
308     (GDBusMethodInfo **) &_thunar_org_freedesktop_file_manager1_method_info_pointers,
309     NULL,
310     NULL,
311     NULL
312   },
313   "org-freedesktop-file-manager1",
314 };
315 
316 
317 /**
318  * thunar_org_freedesktop_file_manager1_interface_info:
319  *
320  * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-FileManager1.top_of_page">org.freedesktop.FileManager1</link> D-Bus interface.
321  *
322  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
323  */
324 GDBusInterfaceInfo *
thunar_org_freedesktop_file_manager1_interface_info(void)325 thunar_org_freedesktop_file_manager1_interface_info (void)
326 {
327   return (GDBusInterfaceInfo *) &_thunar_org_freedesktop_file_manager1_interface_info.parent_struct;
328 }
329 
330 /**
331  * thunar_org_freedesktop_file_manager1_override_properties:
332  * @klass: The class structure for a #GObject derived class.
333  * @property_id_begin: The property id to assign to the first overridden property.
334  *
335  * Overrides all #GObject properties in the #ThunarOrgFreedesktopFileManager1 interface for a concrete class.
336  * The properties are overridden in the order they are defined.
337  *
338  * Returns: The last property id.
339  */
340 guint
thunar_org_freedesktop_file_manager1_override_properties(GObjectClass * klass,guint property_id_begin)341 thunar_org_freedesktop_file_manager1_override_properties (GObjectClass *klass, guint property_id_begin)
342 {
343   return property_id_begin - 1;
344 }
345 
346 
347 
348 /**
349  * ThunarOrgFreedesktopFileManager1:
350  *
351  * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-FileManager1.top_of_page">org.freedesktop.FileManager1</link>.
352  */
353 
354 /**
355  * ThunarOrgFreedesktopFileManager1Iface:
356  * @parent_iface: The parent interface.
357  * @handle_show_folders: Handler for the #ThunarOrgFreedesktopFileManager1::handle-show-folders signal.
358  * @handle_show_item_properties: Handler for the #ThunarOrgFreedesktopFileManager1::handle-show-item-properties signal.
359  * @handle_show_items: Handler for the #ThunarOrgFreedesktopFileManager1::handle-show-items signal.
360  *
361  * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-FileManager1.top_of_page">org.freedesktop.FileManager1</link>.
362  */
363 
364 typedef ThunarOrgFreedesktopFileManager1Iface ThunarOrgFreedesktopFileManager1Interface;
G_DEFINE_INTERFACE(ThunarOrgFreedesktopFileManager1,thunar_org_freedesktop_file_manager1,G_TYPE_OBJECT)365 G_DEFINE_INTERFACE (ThunarOrgFreedesktopFileManager1, thunar_org_freedesktop_file_manager1, G_TYPE_OBJECT)
366 
367 static void
368 thunar_org_freedesktop_file_manager1_default_init (ThunarOrgFreedesktopFileManager1Iface *iface)
369 {
370   /* GObject signals for incoming D-Bus method calls: */
371   /**
372    * ThunarOrgFreedesktopFileManager1::handle-show-folders:
373    * @object: A #ThunarOrgFreedesktopFileManager1.
374    * @invocation: A #GDBusMethodInvocation.
375    * @arg_URIs: Argument passed by remote caller.
376    * @arg_StartupId: Argument passed by remote caller.
377    *
378    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-FileManager1.ShowFolders">ShowFolders()</link> D-Bus method.
379    *
380    * 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 thunar_org_freedesktop_file_manager1_complete_show_folders() 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.
381    *
382    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
383    */
384   g_signal_new ("handle-show-folders",
385     G_TYPE_FROM_INTERFACE (iface),
386     G_SIGNAL_RUN_LAST,
387     G_STRUCT_OFFSET (ThunarOrgFreedesktopFileManager1Iface, handle_show_folders),
388     g_signal_accumulator_true_handled,
389     NULL,
390     g_cclosure_marshal_generic,
391     G_TYPE_BOOLEAN,
392     3,
393     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRV, G_TYPE_STRING);
394 
395   /**
396    * ThunarOrgFreedesktopFileManager1::handle-show-items:
397    * @object: A #ThunarOrgFreedesktopFileManager1.
398    * @invocation: A #GDBusMethodInvocation.
399    * @arg_URIs: Argument passed by remote caller.
400    * @arg_StartupId: Argument passed by remote caller.
401    *
402    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-FileManager1.ShowItems">ShowItems()</link> D-Bus method.
403    *
404    * 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 thunar_org_freedesktop_file_manager1_complete_show_items() 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.
405    *
406    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
407    */
408   g_signal_new ("handle-show-items",
409     G_TYPE_FROM_INTERFACE (iface),
410     G_SIGNAL_RUN_LAST,
411     G_STRUCT_OFFSET (ThunarOrgFreedesktopFileManager1Iface, handle_show_items),
412     g_signal_accumulator_true_handled,
413     NULL,
414     g_cclosure_marshal_generic,
415     G_TYPE_BOOLEAN,
416     3,
417     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRV, G_TYPE_STRING);
418 
419   /**
420    * ThunarOrgFreedesktopFileManager1::handle-show-item-properties:
421    * @object: A #ThunarOrgFreedesktopFileManager1.
422    * @invocation: A #GDBusMethodInvocation.
423    * @arg_URIs: Argument passed by remote caller.
424    * @arg_StartupId: Argument passed by remote caller.
425    *
426    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-FileManager1.ShowItemProperties">ShowItemProperties()</link> D-Bus method.
427    *
428    * 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 thunar_org_freedesktop_file_manager1_complete_show_item_properties() 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.
429    *
430    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
431    */
432   g_signal_new ("handle-show-item-properties",
433     G_TYPE_FROM_INTERFACE (iface),
434     G_SIGNAL_RUN_LAST,
435     G_STRUCT_OFFSET (ThunarOrgFreedesktopFileManager1Iface, handle_show_item_properties),
436     g_signal_accumulator_true_handled,
437     NULL,
438     g_cclosure_marshal_generic,
439     G_TYPE_BOOLEAN,
440     3,
441     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRV, G_TYPE_STRING);
442 
443 }
444 
445 /**
446  * thunar_org_freedesktop_file_manager1_call_show_folders:
447  * @proxy: A #ThunarOrgFreedesktopFileManager1Proxy.
448  * @arg_URIs: Argument to pass with the method invocation.
449  * @arg_StartupId: Argument to pass with the method invocation.
450  * @cancellable: (nullable): A #GCancellable or %NULL.
451  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
452  * @user_data: User data to pass to @callback.
453  *
454  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-FileManager1.ShowFolders">ShowFolders()</link> D-Bus method on @proxy.
455  * 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()).
456  * You can then call thunar_org_freedesktop_file_manager1_call_show_folders_finish() to get the result of the operation.
457  *
458  * See thunar_org_freedesktop_file_manager1_call_show_folders_sync() for the synchronous, blocking version of this method.
459  */
460 void
thunar_org_freedesktop_file_manager1_call_show_folders(ThunarOrgFreedesktopFileManager1 * proxy,const gchar * const * arg_URIs,const gchar * arg_StartupId,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)461 thunar_org_freedesktop_file_manager1_call_show_folders (
462     ThunarOrgFreedesktopFileManager1 *proxy,
463     const gchar *const *arg_URIs,
464     const gchar *arg_StartupId,
465     GCancellable *cancellable,
466     GAsyncReadyCallback callback,
467     gpointer user_data)
468 {
469   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
470     "ShowFolders",
471     g_variant_new ("(^ass)",
472                    arg_URIs,
473                    arg_StartupId),
474     G_DBUS_CALL_FLAGS_NONE,
475     -1,
476     cancellable,
477     callback,
478     user_data);
479 }
480 
481 /**
482  * thunar_org_freedesktop_file_manager1_call_show_folders_finish:
483  * @proxy: A #ThunarOrgFreedesktopFileManager1Proxy.
484  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to thunar_org_freedesktop_file_manager1_call_show_folders().
485  * @error: Return location for error or %NULL.
486  *
487  * Finishes an operation started with thunar_org_freedesktop_file_manager1_call_show_folders().
488  *
489  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
490  */
491 gboolean
thunar_org_freedesktop_file_manager1_call_show_folders_finish(ThunarOrgFreedesktopFileManager1 * proxy,GAsyncResult * res,GError ** error)492 thunar_org_freedesktop_file_manager1_call_show_folders_finish (
493     ThunarOrgFreedesktopFileManager1 *proxy,
494     GAsyncResult *res,
495     GError **error)
496 {
497   GVariant *_ret;
498   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
499   if (_ret == NULL)
500     goto _out;
501   g_variant_get (_ret,
502                  "()");
503   g_variant_unref (_ret);
504 _out:
505   return _ret != NULL;
506 }
507 
508 /**
509  * thunar_org_freedesktop_file_manager1_call_show_folders_sync:
510  * @proxy: A #ThunarOrgFreedesktopFileManager1Proxy.
511  * @arg_URIs: Argument to pass with the method invocation.
512  * @arg_StartupId: Argument to pass with the method invocation.
513  * @cancellable: (nullable): A #GCancellable or %NULL.
514  * @error: Return location for error or %NULL.
515  *
516  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-FileManager1.ShowFolders">ShowFolders()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
517  *
518  * See thunar_org_freedesktop_file_manager1_call_show_folders() for the asynchronous version of this method.
519  *
520  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
521  */
522 gboolean
thunar_org_freedesktop_file_manager1_call_show_folders_sync(ThunarOrgFreedesktopFileManager1 * proxy,const gchar * const * arg_URIs,const gchar * arg_StartupId,GCancellable * cancellable,GError ** error)523 thunar_org_freedesktop_file_manager1_call_show_folders_sync (
524     ThunarOrgFreedesktopFileManager1 *proxy,
525     const gchar *const *arg_URIs,
526     const gchar *arg_StartupId,
527     GCancellable *cancellable,
528     GError **error)
529 {
530   GVariant *_ret;
531   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
532     "ShowFolders",
533     g_variant_new ("(^ass)",
534                    arg_URIs,
535                    arg_StartupId),
536     G_DBUS_CALL_FLAGS_NONE,
537     -1,
538     cancellable,
539     error);
540   if (_ret == NULL)
541     goto _out;
542   g_variant_get (_ret,
543                  "()");
544   g_variant_unref (_ret);
545 _out:
546   return _ret != NULL;
547 }
548 
549 /**
550  * thunar_org_freedesktop_file_manager1_call_show_items:
551  * @proxy: A #ThunarOrgFreedesktopFileManager1Proxy.
552  * @arg_URIs: Argument to pass with the method invocation.
553  * @arg_StartupId: Argument to pass with the method invocation.
554  * @cancellable: (nullable): A #GCancellable or %NULL.
555  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
556  * @user_data: User data to pass to @callback.
557  *
558  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-FileManager1.ShowItems">ShowItems()</link> D-Bus method on @proxy.
559  * 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()).
560  * You can then call thunar_org_freedesktop_file_manager1_call_show_items_finish() to get the result of the operation.
561  *
562  * See thunar_org_freedesktop_file_manager1_call_show_items_sync() for the synchronous, blocking version of this method.
563  */
564 void
thunar_org_freedesktop_file_manager1_call_show_items(ThunarOrgFreedesktopFileManager1 * proxy,const gchar * const * arg_URIs,const gchar * arg_StartupId,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)565 thunar_org_freedesktop_file_manager1_call_show_items (
566     ThunarOrgFreedesktopFileManager1 *proxy,
567     const gchar *const *arg_URIs,
568     const gchar *arg_StartupId,
569     GCancellable *cancellable,
570     GAsyncReadyCallback callback,
571     gpointer user_data)
572 {
573   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
574     "ShowItems",
575     g_variant_new ("(^ass)",
576                    arg_URIs,
577                    arg_StartupId),
578     G_DBUS_CALL_FLAGS_NONE,
579     -1,
580     cancellable,
581     callback,
582     user_data);
583 }
584 
585 /**
586  * thunar_org_freedesktop_file_manager1_call_show_items_finish:
587  * @proxy: A #ThunarOrgFreedesktopFileManager1Proxy.
588  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to thunar_org_freedesktop_file_manager1_call_show_items().
589  * @error: Return location for error or %NULL.
590  *
591  * Finishes an operation started with thunar_org_freedesktop_file_manager1_call_show_items().
592  *
593  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
594  */
595 gboolean
thunar_org_freedesktop_file_manager1_call_show_items_finish(ThunarOrgFreedesktopFileManager1 * proxy,GAsyncResult * res,GError ** error)596 thunar_org_freedesktop_file_manager1_call_show_items_finish (
597     ThunarOrgFreedesktopFileManager1 *proxy,
598     GAsyncResult *res,
599     GError **error)
600 {
601   GVariant *_ret;
602   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
603   if (_ret == NULL)
604     goto _out;
605   g_variant_get (_ret,
606                  "()");
607   g_variant_unref (_ret);
608 _out:
609   return _ret != NULL;
610 }
611 
612 /**
613  * thunar_org_freedesktop_file_manager1_call_show_items_sync:
614  * @proxy: A #ThunarOrgFreedesktopFileManager1Proxy.
615  * @arg_URIs: Argument to pass with the method invocation.
616  * @arg_StartupId: Argument to pass with the method invocation.
617  * @cancellable: (nullable): A #GCancellable or %NULL.
618  * @error: Return location for error or %NULL.
619  *
620  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-FileManager1.ShowItems">ShowItems()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
621  *
622  * See thunar_org_freedesktop_file_manager1_call_show_items() for the asynchronous version of this method.
623  *
624  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
625  */
626 gboolean
thunar_org_freedesktop_file_manager1_call_show_items_sync(ThunarOrgFreedesktopFileManager1 * proxy,const gchar * const * arg_URIs,const gchar * arg_StartupId,GCancellable * cancellable,GError ** error)627 thunar_org_freedesktop_file_manager1_call_show_items_sync (
628     ThunarOrgFreedesktopFileManager1 *proxy,
629     const gchar *const *arg_URIs,
630     const gchar *arg_StartupId,
631     GCancellable *cancellable,
632     GError **error)
633 {
634   GVariant *_ret;
635   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
636     "ShowItems",
637     g_variant_new ("(^ass)",
638                    arg_URIs,
639                    arg_StartupId),
640     G_DBUS_CALL_FLAGS_NONE,
641     -1,
642     cancellable,
643     error);
644   if (_ret == NULL)
645     goto _out;
646   g_variant_get (_ret,
647                  "()");
648   g_variant_unref (_ret);
649 _out:
650   return _ret != NULL;
651 }
652 
653 /**
654  * thunar_org_freedesktop_file_manager1_call_show_item_properties:
655  * @proxy: A #ThunarOrgFreedesktopFileManager1Proxy.
656  * @arg_URIs: Argument to pass with the method invocation.
657  * @arg_StartupId: Argument to pass with the method invocation.
658  * @cancellable: (nullable): A #GCancellable or %NULL.
659  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
660  * @user_data: User data to pass to @callback.
661  *
662  * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-FileManager1.ShowItemProperties">ShowItemProperties()</link> D-Bus method on @proxy.
663  * 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()).
664  * You can then call thunar_org_freedesktop_file_manager1_call_show_item_properties_finish() to get the result of the operation.
665  *
666  * See thunar_org_freedesktop_file_manager1_call_show_item_properties_sync() for the synchronous, blocking version of this method.
667  */
668 void
thunar_org_freedesktop_file_manager1_call_show_item_properties(ThunarOrgFreedesktopFileManager1 * proxy,const gchar * const * arg_URIs,const gchar * arg_StartupId,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)669 thunar_org_freedesktop_file_manager1_call_show_item_properties (
670     ThunarOrgFreedesktopFileManager1 *proxy,
671     const gchar *const *arg_URIs,
672     const gchar *arg_StartupId,
673     GCancellable *cancellable,
674     GAsyncReadyCallback callback,
675     gpointer user_data)
676 {
677   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
678     "ShowItemProperties",
679     g_variant_new ("(^ass)",
680                    arg_URIs,
681                    arg_StartupId),
682     G_DBUS_CALL_FLAGS_NONE,
683     -1,
684     cancellable,
685     callback,
686     user_data);
687 }
688 
689 /**
690  * thunar_org_freedesktop_file_manager1_call_show_item_properties_finish:
691  * @proxy: A #ThunarOrgFreedesktopFileManager1Proxy.
692  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to thunar_org_freedesktop_file_manager1_call_show_item_properties().
693  * @error: Return location for error or %NULL.
694  *
695  * Finishes an operation started with thunar_org_freedesktop_file_manager1_call_show_item_properties().
696  *
697  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
698  */
699 gboolean
thunar_org_freedesktop_file_manager1_call_show_item_properties_finish(ThunarOrgFreedesktopFileManager1 * proxy,GAsyncResult * res,GError ** error)700 thunar_org_freedesktop_file_manager1_call_show_item_properties_finish (
701     ThunarOrgFreedesktopFileManager1 *proxy,
702     GAsyncResult *res,
703     GError **error)
704 {
705   GVariant *_ret;
706   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
707   if (_ret == NULL)
708     goto _out;
709   g_variant_get (_ret,
710                  "()");
711   g_variant_unref (_ret);
712 _out:
713   return _ret != NULL;
714 }
715 
716 /**
717  * thunar_org_freedesktop_file_manager1_call_show_item_properties_sync:
718  * @proxy: A #ThunarOrgFreedesktopFileManager1Proxy.
719  * @arg_URIs: Argument to pass with the method invocation.
720  * @arg_StartupId: Argument to pass with the method invocation.
721  * @cancellable: (nullable): A #GCancellable or %NULL.
722  * @error: Return location for error or %NULL.
723  *
724  * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-FileManager1.ShowItemProperties">ShowItemProperties()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
725  *
726  * See thunar_org_freedesktop_file_manager1_call_show_item_properties() for the asynchronous version of this method.
727  *
728  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
729  */
730 gboolean
thunar_org_freedesktop_file_manager1_call_show_item_properties_sync(ThunarOrgFreedesktopFileManager1 * proxy,const gchar * const * arg_URIs,const gchar * arg_StartupId,GCancellable * cancellable,GError ** error)731 thunar_org_freedesktop_file_manager1_call_show_item_properties_sync (
732     ThunarOrgFreedesktopFileManager1 *proxy,
733     const gchar *const *arg_URIs,
734     const gchar *arg_StartupId,
735     GCancellable *cancellable,
736     GError **error)
737 {
738   GVariant *_ret;
739   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
740     "ShowItemProperties",
741     g_variant_new ("(^ass)",
742                    arg_URIs,
743                    arg_StartupId),
744     G_DBUS_CALL_FLAGS_NONE,
745     -1,
746     cancellable,
747     error);
748   if (_ret == NULL)
749     goto _out;
750   g_variant_get (_ret,
751                  "()");
752   g_variant_unref (_ret);
753 _out:
754   return _ret != NULL;
755 }
756 
757 /**
758  * thunar_org_freedesktop_file_manager1_complete_show_folders:
759  * @object: A #ThunarOrgFreedesktopFileManager1.
760  * @invocation: (transfer full): A #GDBusMethodInvocation.
761  *
762  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-FileManager1.ShowFolders">ShowFolders()</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.
763  *
764  * This method will free @invocation, you cannot use it afterwards.
765  */
766 void
thunar_org_freedesktop_file_manager1_complete_show_folders(ThunarOrgFreedesktopFileManager1 * object,GDBusMethodInvocation * invocation)767 thunar_org_freedesktop_file_manager1_complete_show_folders (
768     ThunarOrgFreedesktopFileManager1 *object,
769     GDBusMethodInvocation *invocation)
770 {
771   g_dbus_method_invocation_return_value (invocation,
772     g_variant_new ("()"));
773 }
774 
775 /**
776  * thunar_org_freedesktop_file_manager1_complete_show_items:
777  * @object: A #ThunarOrgFreedesktopFileManager1.
778  * @invocation: (transfer full): A #GDBusMethodInvocation.
779  *
780  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-FileManager1.ShowItems">ShowItems()</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.
781  *
782  * This method will free @invocation, you cannot use it afterwards.
783  */
784 void
thunar_org_freedesktop_file_manager1_complete_show_items(ThunarOrgFreedesktopFileManager1 * object,GDBusMethodInvocation * invocation)785 thunar_org_freedesktop_file_manager1_complete_show_items (
786     ThunarOrgFreedesktopFileManager1 *object,
787     GDBusMethodInvocation *invocation)
788 {
789   g_dbus_method_invocation_return_value (invocation,
790     g_variant_new ("()"));
791 }
792 
793 /**
794  * thunar_org_freedesktop_file_manager1_complete_show_item_properties:
795  * @object: A #ThunarOrgFreedesktopFileManager1.
796  * @invocation: (transfer full): A #GDBusMethodInvocation.
797  *
798  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-FileManager1.ShowItemProperties">ShowItemProperties()</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.
799  *
800  * This method will free @invocation, you cannot use it afterwards.
801  */
802 void
thunar_org_freedesktop_file_manager1_complete_show_item_properties(ThunarOrgFreedesktopFileManager1 * object,GDBusMethodInvocation * invocation)803 thunar_org_freedesktop_file_manager1_complete_show_item_properties (
804     ThunarOrgFreedesktopFileManager1 *object,
805     GDBusMethodInvocation *invocation)
806 {
807   g_dbus_method_invocation_return_value (invocation,
808     g_variant_new ("()"));
809 }
810 
811 /* ------------------------------------------------------------------------ */
812 
813 /**
814  * ThunarOrgFreedesktopFileManager1Proxy:
815  *
816  * The #ThunarOrgFreedesktopFileManager1Proxy structure contains only private data and should only be accessed using the provided API.
817  */
818 
819 /**
820  * ThunarOrgFreedesktopFileManager1ProxyClass:
821  * @parent_class: The parent class.
822  *
823  * Class structure for #ThunarOrgFreedesktopFileManager1Proxy.
824  */
825 
826 struct _ThunarOrgFreedesktopFileManager1ProxyPrivate
827 {
828   GData *qdata;
829 };
830 
831 static void thunar_org_freedesktop_file_manager1_proxy_iface_init (ThunarOrgFreedesktopFileManager1Iface *iface);
832 
833 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE(ThunarOrgFreedesktopFileManager1Proxy,thunar_org_freedesktop_file_manager1_proxy,G_TYPE_DBUS_PROXY,G_ADD_PRIVATE (ThunarOrgFreedesktopFileManager1Proxy)G_IMPLEMENT_INTERFACE (THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1,thunar_org_freedesktop_file_manager1_proxy_iface_init))834 G_DEFINE_TYPE_WITH_CODE (ThunarOrgFreedesktopFileManager1Proxy, thunar_org_freedesktop_file_manager1_proxy, G_TYPE_DBUS_PROXY,
835                          G_ADD_PRIVATE (ThunarOrgFreedesktopFileManager1Proxy)
836                          G_IMPLEMENT_INTERFACE (THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1, thunar_org_freedesktop_file_manager1_proxy_iface_init))
837 
838 #else
839 G_DEFINE_TYPE_WITH_CODE (ThunarOrgFreedesktopFileManager1Proxy, thunar_org_freedesktop_file_manager1_proxy, G_TYPE_DBUS_PROXY,
840                          G_IMPLEMENT_INTERFACE (THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1, thunar_org_freedesktop_file_manager1_proxy_iface_init))
841 
842 #endif
843 static void
844 thunar_org_freedesktop_file_manager1_proxy_finalize (GObject *object)
845 {
846   ThunarOrgFreedesktopFileManager1Proxy *proxy = THUNAR_ORG_FREEDESKTOP_FILE_MANAGER1_PROXY (object);
847   g_datalist_clear (&proxy->priv->qdata);
848   G_OBJECT_CLASS (thunar_org_freedesktop_file_manager1_proxy_parent_class)->finalize (object);
849 }
850 
851 static void
thunar_org_freedesktop_file_manager1_proxy_get_property(GObject * object,guint prop_id,GValue * value,GParamSpec * pspec G_GNUC_UNUSED)852 thunar_org_freedesktop_file_manager1_proxy_get_property (GObject      *object,
853   guint         prop_id,
854   GValue       *value,
855   GParamSpec   *pspec G_GNUC_UNUSED)
856 {
857 }
858 
859 static void
thunar_org_freedesktop_file_manager1_proxy_set_property(GObject * object,guint prop_id,const GValue * value,GParamSpec * pspec G_GNUC_UNUSED)860 thunar_org_freedesktop_file_manager1_proxy_set_property (GObject      *object,
861   guint         prop_id,
862   const GValue *value,
863   GParamSpec   *pspec G_GNUC_UNUSED)
864 {
865 }
866 
867 static void
thunar_org_freedesktop_file_manager1_proxy_g_signal(GDBusProxy * proxy,const gchar * sender_name G_GNUC_UNUSED,const gchar * signal_name,GVariant * parameters)868 thunar_org_freedesktop_file_manager1_proxy_g_signal (GDBusProxy *proxy,
869   const gchar *sender_name G_GNUC_UNUSED,
870   const gchar *signal_name,
871   GVariant *parameters)
872 {
873   _ExtendedGDBusSignalInfo *info;
874   GVariantIter iter;
875   GVariant *child;
876   GValue *paramv;
877   gsize num_params;
878   gsize n;
879   guint signal_id;
880   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_thunar_org_freedesktop_file_manager1_interface_info.parent_struct, signal_name);
881   if (info == NULL)
882     return;
883   num_params = g_variant_n_children (parameters);
884   paramv = g_new0 (GValue, num_params + 1);
885   g_value_init (&paramv[0], THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1);
886   g_value_set_object (&paramv[0], proxy);
887   g_variant_iter_init (&iter, parameters);
888   n = 1;
889   while ((child = g_variant_iter_next_value (&iter)) != NULL)
890     {
891       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
892       if (arg_info->use_gvariant)
893         {
894           g_value_init (&paramv[n], G_TYPE_VARIANT);
895           g_value_set_variant (&paramv[n], child);
896           n++;
897         }
898       else
899         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
900       g_variant_unref (child);
901     }
902   signal_id = g_signal_lookup (info->signal_name, THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1);
903   g_signal_emitv (paramv, signal_id, 0, NULL);
904   for (n = 0; n < num_params + 1; n++)
905     g_value_unset (&paramv[n]);
906   g_free (paramv);
907 }
908 
909 static void
thunar_org_freedesktop_file_manager1_proxy_g_properties_changed(GDBusProxy * _proxy,GVariant * changed_properties,const gchar * const * invalidated_properties)910 thunar_org_freedesktop_file_manager1_proxy_g_properties_changed (GDBusProxy *_proxy,
911   GVariant *changed_properties,
912   const gchar *const *invalidated_properties)
913 {
914   ThunarOrgFreedesktopFileManager1Proxy *proxy = THUNAR_ORG_FREEDESKTOP_FILE_MANAGER1_PROXY (_proxy);
915   guint n;
916   const gchar *key;
917   GVariantIter *iter;
918   _ExtendedGDBusPropertyInfo *info;
919   g_variant_get (changed_properties, "a{sv}", &iter);
920   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
921     {
922       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_thunar_org_freedesktop_file_manager1_interface_info.parent_struct, key);
923       g_datalist_remove_data (&proxy->priv->qdata, key);
924       if (info != NULL)
925         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
926     }
927   g_variant_iter_free (iter);
928   for (n = 0; invalidated_properties[n] != NULL; n++)
929     {
930       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_thunar_org_freedesktop_file_manager1_interface_info.parent_struct, invalidated_properties[n]);
931       g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
932       if (info != NULL)
933         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
934     }
935 }
936 
937 static void
thunar_org_freedesktop_file_manager1_proxy_init(ThunarOrgFreedesktopFileManager1Proxy * proxy)938 thunar_org_freedesktop_file_manager1_proxy_init (ThunarOrgFreedesktopFileManager1Proxy *proxy)
939 {
940 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
941   proxy->priv = thunar_org_freedesktop_file_manager1_proxy_get_instance_private (proxy);
942 #else
943   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1_PROXY, ThunarOrgFreedesktopFileManager1ProxyPrivate);
944 #endif
945 
946   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), thunar_org_freedesktop_file_manager1_interface_info ());
947 }
948 
949 static void
thunar_org_freedesktop_file_manager1_proxy_class_init(ThunarOrgFreedesktopFileManager1ProxyClass * klass)950 thunar_org_freedesktop_file_manager1_proxy_class_init (ThunarOrgFreedesktopFileManager1ProxyClass *klass)
951 {
952   GObjectClass *gobject_class;
953   GDBusProxyClass *proxy_class;
954 
955   gobject_class = G_OBJECT_CLASS (klass);
956   gobject_class->finalize     = thunar_org_freedesktop_file_manager1_proxy_finalize;
957   gobject_class->get_property = thunar_org_freedesktop_file_manager1_proxy_get_property;
958   gobject_class->set_property = thunar_org_freedesktop_file_manager1_proxy_set_property;
959 
960   proxy_class = G_DBUS_PROXY_CLASS (klass);
961   proxy_class->g_signal = thunar_org_freedesktop_file_manager1_proxy_g_signal;
962   proxy_class->g_properties_changed = thunar_org_freedesktop_file_manager1_proxy_g_properties_changed;
963 
964 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
965   g_type_class_add_private (klass, sizeof (ThunarOrgFreedesktopFileManager1ProxyPrivate));
966 #endif
967 }
968 
969 static void
thunar_org_freedesktop_file_manager1_proxy_iface_init(ThunarOrgFreedesktopFileManager1Iface * iface)970 thunar_org_freedesktop_file_manager1_proxy_iface_init (ThunarOrgFreedesktopFileManager1Iface *iface)
971 {
972 }
973 
974 /**
975  * thunar_org_freedesktop_file_manager1_proxy_new:
976  * @connection: A #GDBusConnection.
977  * @flags: Flags from the #GDBusProxyFlags enumeration.
978  * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
979  * @object_path: An object path.
980  * @cancellable: (nullable): A #GCancellable or %NULL.
981  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
982  * @user_data: User data to pass to @callback.
983  *
984  * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-FileManager1.top_of_page">org.freedesktop.FileManager1</link>. See g_dbus_proxy_new() for more details.
985  *
986  * 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()).
987  * You can then call thunar_org_freedesktop_file_manager1_proxy_new_finish() to get the result of the operation.
988  *
989  * See thunar_org_freedesktop_file_manager1_proxy_new_sync() for the synchronous, blocking version of this constructor.
990  */
991 void
thunar_org_freedesktop_file_manager1_proxy_new(GDBusConnection * connection,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)992 thunar_org_freedesktop_file_manager1_proxy_new (
993     GDBusConnection     *connection,
994     GDBusProxyFlags      flags,
995     const gchar         *name,
996     const gchar         *object_path,
997     GCancellable        *cancellable,
998     GAsyncReadyCallback  callback,
999     gpointer             user_data)
1000 {
1001   g_async_initable_new_async (THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1_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.FileManager1", NULL);
1002 }
1003 
1004 /**
1005  * thunar_org_freedesktop_file_manager1_proxy_new_finish:
1006  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to thunar_org_freedesktop_file_manager1_proxy_new().
1007  * @error: Return location for error or %NULL
1008  *
1009  * Finishes an operation started with thunar_org_freedesktop_file_manager1_proxy_new().
1010  *
1011  * Returns: (transfer full) (type ThunarOrgFreedesktopFileManager1Proxy): The constructed proxy object or %NULL if @error is set.
1012  */
1013 ThunarOrgFreedesktopFileManager1 *
thunar_org_freedesktop_file_manager1_proxy_new_finish(GAsyncResult * res,GError ** error)1014 thunar_org_freedesktop_file_manager1_proxy_new_finish (
1015     GAsyncResult        *res,
1016     GError             **error)
1017 {
1018   GObject *ret;
1019   GObject *source_object;
1020   source_object = g_async_result_get_source_object (res);
1021   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1022   g_object_unref (source_object);
1023   if (ret != NULL)
1024     return THUNAR_ORG_FREEDESKTOP_FILE_MANAGER1 (ret);
1025   else
1026     return NULL;
1027 }
1028 
1029 /**
1030  * thunar_org_freedesktop_file_manager1_proxy_new_sync:
1031  * @connection: A #GDBusConnection.
1032  * @flags: Flags from the #GDBusProxyFlags enumeration.
1033  * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1034  * @object_path: An object path.
1035  * @cancellable: (nullable): A #GCancellable or %NULL.
1036  * @error: Return location for error or %NULL
1037  *
1038  * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-FileManager1.top_of_page">org.freedesktop.FileManager1</link>. See g_dbus_proxy_new_sync() for more details.
1039  *
1040  * The calling thread is blocked until a reply is received.
1041  *
1042  * See thunar_org_freedesktop_file_manager1_proxy_new() for the asynchronous version of this constructor.
1043  *
1044  * Returns: (transfer full) (type ThunarOrgFreedesktopFileManager1Proxy): The constructed proxy object or %NULL if @error is set.
1045  */
1046 ThunarOrgFreedesktopFileManager1 *
thunar_org_freedesktop_file_manager1_proxy_new_sync(GDBusConnection * connection,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)1047 thunar_org_freedesktop_file_manager1_proxy_new_sync (
1048     GDBusConnection     *connection,
1049     GDBusProxyFlags      flags,
1050     const gchar         *name,
1051     const gchar         *object_path,
1052     GCancellable        *cancellable,
1053     GError             **error)
1054 {
1055   GInitable *ret;
1056   ret = g_initable_new (THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.FileManager1", NULL);
1057   if (ret != NULL)
1058     return THUNAR_ORG_FREEDESKTOP_FILE_MANAGER1 (ret);
1059   else
1060     return NULL;
1061 }
1062 
1063 
1064 /**
1065  * thunar_org_freedesktop_file_manager1_proxy_new_for_bus:
1066  * @bus_type: A #GBusType.
1067  * @flags: Flags from the #GDBusProxyFlags enumeration.
1068  * @name: A bus name (well-known or unique).
1069  * @object_path: An object path.
1070  * @cancellable: (nullable): A #GCancellable or %NULL.
1071  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1072  * @user_data: User data to pass to @callback.
1073  *
1074  * Like thunar_org_freedesktop_file_manager1_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
1075  *
1076  * 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()).
1077  * You can then call thunar_org_freedesktop_file_manager1_proxy_new_for_bus_finish() to get the result of the operation.
1078  *
1079  * See thunar_org_freedesktop_file_manager1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
1080  */
1081 void
thunar_org_freedesktop_file_manager1_proxy_new_for_bus(GBusType bus_type,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)1082 thunar_org_freedesktop_file_manager1_proxy_new_for_bus (
1083     GBusType             bus_type,
1084     GDBusProxyFlags      flags,
1085     const gchar         *name,
1086     const gchar         *object_path,
1087     GCancellable        *cancellable,
1088     GAsyncReadyCallback  callback,
1089     gpointer             user_data)
1090 {
1091   g_async_initable_new_async (THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1_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.FileManager1", NULL);
1092 }
1093 
1094 /**
1095  * thunar_org_freedesktop_file_manager1_proxy_new_for_bus_finish:
1096  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to thunar_org_freedesktop_file_manager1_proxy_new_for_bus().
1097  * @error: Return location for error or %NULL
1098  *
1099  * Finishes an operation started with thunar_org_freedesktop_file_manager1_proxy_new_for_bus().
1100  *
1101  * Returns: (transfer full) (type ThunarOrgFreedesktopFileManager1Proxy): The constructed proxy object or %NULL if @error is set.
1102  */
1103 ThunarOrgFreedesktopFileManager1 *
thunar_org_freedesktop_file_manager1_proxy_new_for_bus_finish(GAsyncResult * res,GError ** error)1104 thunar_org_freedesktop_file_manager1_proxy_new_for_bus_finish (
1105     GAsyncResult        *res,
1106     GError             **error)
1107 {
1108   GObject *ret;
1109   GObject *source_object;
1110   source_object = g_async_result_get_source_object (res);
1111   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1112   g_object_unref (source_object);
1113   if (ret != NULL)
1114     return THUNAR_ORG_FREEDESKTOP_FILE_MANAGER1 (ret);
1115   else
1116     return NULL;
1117 }
1118 
1119 /**
1120  * thunar_org_freedesktop_file_manager1_proxy_new_for_bus_sync:
1121  * @bus_type: A #GBusType.
1122  * @flags: Flags from the #GDBusProxyFlags enumeration.
1123  * @name: A bus name (well-known or unique).
1124  * @object_path: An object path.
1125  * @cancellable: (nullable): A #GCancellable or %NULL.
1126  * @error: Return location for error or %NULL
1127  *
1128  * Like thunar_org_freedesktop_file_manager1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
1129  *
1130  * The calling thread is blocked until a reply is received.
1131  *
1132  * See thunar_org_freedesktop_file_manager1_proxy_new_for_bus() for the asynchronous version of this constructor.
1133  *
1134  * Returns: (transfer full) (type ThunarOrgFreedesktopFileManager1Proxy): The constructed proxy object or %NULL if @error is set.
1135  */
1136 ThunarOrgFreedesktopFileManager1 *
thunar_org_freedesktop_file_manager1_proxy_new_for_bus_sync(GBusType bus_type,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)1137 thunar_org_freedesktop_file_manager1_proxy_new_for_bus_sync (
1138     GBusType             bus_type,
1139     GDBusProxyFlags      flags,
1140     const gchar         *name,
1141     const gchar         *object_path,
1142     GCancellable        *cancellable,
1143     GError             **error)
1144 {
1145   GInitable *ret;
1146   ret = g_initable_new (THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.FileManager1", NULL);
1147   if (ret != NULL)
1148     return THUNAR_ORG_FREEDESKTOP_FILE_MANAGER1 (ret);
1149   else
1150     return NULL;
1151 }
1152 
1153 
1154 /* ------------------------------------------------------------------------ */
1155 
1156 /**
1157  * ThunarOrgFreedesktopFileManager1Skeleton:
1158  *
1159  * The #ThunarOrgFreedesktopFileManager1Skeleton structure contains only private data and should only be accessed using the provided API.
1160  */
1161 
1162 /**
1163  * ThunarOrgFreedesktopFileManager1SkeletonClass:
1164  * @parent_class: The parent class.
1165  *
1166  * Class structure for #ThunarOrgFreedesktopFileManager1Skeleton.
1167  */
1168 
1169 struct _ThunarOrgFreedesktopFileManager1SkeletonPrivate
1170 {
1171   GValue *properties;
1172   GList *changed_properties;
1173   GSource *changed_properties_idle_source;
1174   GMainContext *context;
1175   GMutex lock;
1176 };
1177 
1178 static void
_thunar_org_freedesktop_file_manager1_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)1179 _thunar_org_freedesktop_file_manager1_skeleton_handle_method_call (
1180   GDBusConnection *connection G_GNUC_UNUSED,
1181   const gchar *sender G_GNUC_UNUSED,
1182   const gchar *object_path G_GNUC_UNUSED,
1183   const gchar *interface_name,
1184   const gchar *method_name,
1185   GVariant *parameters,
1186   GDBusMethodInvocation *invocation,
1187   gpointer user_data)
1188 {
1189   ThunarOrgFreedesktopFileManager1Skeleton *skeleton = THUNAR_ORG_FREEDESKTOP_FILE_MANAGER1_SKELETON (user_data);
1190   _ExtendedGDBusMethodInfo *info;
1191   GVariantIter iter;
1192   GVariant *child;
1193   GValue *paramv;
1194   gsize num_params;
1195   guint num_extra;
1196   gsize n;
1197   guint signal_id;
1198   GValue return_value = G_VALUE_INIT;
1199   info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
1200   g_assert (info != NULL);
1201   num_params = g_variant_n_children (parameters);
1202   num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
1203   n = 0;
1204   g_value_init (&paramv[n], THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1);
1205   g_value_set_object (&paramv[n++], skeleton);
1206   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
1207   g_value_set_object (&paramv[n++], invocation);
1208   if (info->pass_fdlist)
1209     {
1210 #ifdef G_OS_UNIX
1211       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
1212       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
1213 #else
1214       g_assert_not_reached ();
1215 #endif
1216     }
1217   g_variant_iter_init (&iter, parameters);
1218   while ((child = g_variant_iter_next_value (&iter)) != NULL)
1219     {
1220       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
1221       if (arg_info->use_gvariant)
1222         {
1223           g_value_init (&paramv[n], G_TYPE_VARIANT);
1224           g_value_set_variant (&paramv[n], child);
1225           n++;
1226         }
1227       else
1228         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
1229       g_variant_unref (child);
1230     }
1231   signal_id = g_signal_lookup (info->signal_name, THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1);
1232   g_value_init (&return_value, G_TYPE_BOOLEAN);
1233   g_signal_emitv (paramv, signal_id, 0, &return_value);
1234   if (!g_value_get_boolean (&return_value))
1235     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);
1236   g_value_unset (&return_value);
1237   for (n = 0; n < num_params + num_extra; n++)
1238     g_value_unset (&paramv[n]);
1239   g_free (paramv);
1240 }
1241 
1242 static GVariant *
_thunar_org_freedesktop_file_manager1_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)1243 _thunar_org_freedesktop_file_manager1_skeleton_handle_get_property (
1244   GDBusConnection *connection G_GNUC_UNUSED,
1245   const gchar *sender G_GNUC_UNUSED,
1246   const gchar *object_path G_GNUC_UNUSED,
1247   const gchar *interface_name G_GNUC_UNUSED,
1248   const gchar *property_name,
1249   GError **error,
1250   gpointer user_data)
1251 {
1252   ThunarOrgFreedesktopFileManager1Skeleton *skeleton = THUNAR_ORG_FREEDESKTOP_FILE_MANAGER1_SKELETON (user_data);
1253   GValue value = G_VALUE_INIT;
1254   GParamSpec *pspec;
1255   _ExtendedGDBusPropertyInfo *info;
1256   GVariant *ret;
1257   ret = NULL;
1258   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_thunar_org_freedesktop_file_manager1_interface_info.parent_struct, property_name);
1259   g_assert (info != NULL);
1260   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1261   if (pspec == NULL)
1262     {
1263       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1264     }
1265   else
1266     {
1267       g_value_init (&value, pspec->value_type);
1268       g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1269       ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
1270       g_value_unset (&value);
1271     }
1272   return ret;
1273 }
1274 
1275 static gboolean
_thunar_org_freedesktop_file_manager1_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)1276 _thunar_org_freedesktop_file_manager1_skeleton_handle_set_property (
1277   GDBusConnection *connection G_GNUC_UNUSED,
1278   const gchar *sender G_GNUC_UNUSED,
1279   const gchar *object_path G_GNUC_UNUSED,
1280   const gchar *interface_name G_GNUC_UNUSED,
1281   const gchar *property_name,
1282   GVariant *variant,
1283   GError **error,
1284   gpointer user_data)
1285 {
1286   ThunarOrgFreedesktopFileManager1Skeleton *skeleton = THUNAR_ORG_FREEDESKTOP_FILE_MANAGER1_SKELETON (user_data);
1287   GValue value = G_VALUE_INIT;
1288   GParamSpec *pspec;
1289   _ExtendedGDBusPropertyInfo *info;
1290   gboolean ret;
1291   ret = FALSE;
1292   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_thunar_org_freedesktop_file_manager1_interface_info.parent_struct, property_name);
1293   g_assert (info != NULL);
1294   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1295   if (pspec == NULL)
1296     {
1297       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1298     }
1299   else
1300     {
1301       if (info->use_gvariant)
1302         g_value_set_variant (&value, variant);
1303       else
1304         g_dbus_gvariant_to_gvalue (variant, &value);
1305       g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1306       g_value_unset (&value);
1307       ret = TRUE;
1308     }
1309   return ret;
1310 }
1311 
1312 static const GDBusInterfaceVTable _thunar_org_freedesktop_file_manager1_skeleton_vtable =
1313 {
1314   _thunar_org_freedesktop_file_manager1_skeleton_handle_method_call,
1315   _thunar_org_freedesktop_file_manager1_skeleton_handle_get_property,
1316   _thunar_org_freedesktop_file_manager1_skeleton_handle_set_property,
1317   {NULL}
1318 };
1319 
1320 static GDBusInterfaceInfo *
thunar_org_freedesktop_file_manager1_skeleton_dbus_interface_get_info(GDBusInterfaceSkeleton * skeleton G_GNUC_UNUSED)1321 thunar_org_freedesktop_file_manager1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1322 {
1323   return thunar_org_freedesktop_file_manager1_interface_info ();
1324 }
1325 
1326 static GDBusInterfaceVTable *
thunar_org_freedesktop_file_manager1_skeleton_dbus_interface_get_vtable(GDBusInterfaceSkeleton * skeleton G_GNUC_UNUSED)1327 thunar_org_freedesktop_file_manager1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1328 {
1329   return (GDBusInterfaceVTable *) &_thunar_org_freedesktop_file_manager1_skeleton_vtable;
1330 }
1331 
1332 static GVariant *
thunar_org_freedesktop_file_manager1_skeleton_dbus_interface_get_properties(GDBusInterfaceSkeleton * _skeleton)1333 thunar_org_freedesktop_file_manager1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
1334 {
1335   ThunarOrgFreedesktopFileManager1Skeleton *skeleton = THUNAR_ORG_FREEDESKTOP_FILE_MANAGER1_SKELETON (_skeleton);
1336 
1337   GVariantBuilder builder;
1338   guint n;
1339   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
1340   if (_thunar_org_freedesktop_file_manager1_interface_info.parent_struct.properties == NULL)
1341     goto out;
1342   for (n = 0; _thunar_org_freedesktop_file_manager1_interface_info.parent_struct.properties[n] != NULL; n++)
1343     {
1344       GDBusPropertyInfo *info = _thunar_org_freedesktop_file_manager1_interface_info.parent_struct.properties[n];
1345       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
1346         {
1347           GVariant *value;
1348           value = _thunar_org_freedesktop_file_manager1_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.FileManager1", info->name, NULL, skeleton);
1349           if (value != NULL)
1350             {
1351               g_variant_take_ref (value);
1352               g_variant_builder_add (&builder, "{sv}", info->name, value);
1353               g_variant_unref (value);
1354             }
1355         }
1356     }
1357 out:
1358   return g_variant_builder_end (&builder);
1359 }
1360 
1361 static void
thunar_org_freedesktop_file_manager1_skeleton_dbus_interface_flush(GDBusInterfaceSkeleton * _skeleton)1362 thunar_org_freedesktop_file_manager1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
1363 {
1364 }
1365 
1366 static void thunar_org_freedesktop_file_manager1_skeleton_iface_init (ThunarOrgFreedesktopFileManager1Iface *iface);
1367 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE(ThunarOrgFreedesktopFileManager1Skeleton,thunar_org_freedesktop_file_manager1_skeleton,G_TYPE_DBUS_INTERFACE_SKELETON,G_ADD_PRIVATE (ThunarOrgFreedesktopFileManager1Skeleton)G_IMPLEMENT_INTERFACE (THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1,thunar_org_freedesktop_file_manager1_skeleton_iface_init))1368 G_DEFINE_TYPE_WITH_CODE (ThunarOrgFreedesktopFileManager1Skeleton, thunar_org_freedesktop_file_manager1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
1369                          G_ADD_PRIVATE (ThunarOrgFreedesktopFileManager1Skeleton)
1370                          G_IMPLEMENT_INTERFACE (THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1, thunar_org_freedesktop_file_manager1_skeleton_iface_init))
1371 
1372 #else
1373 G_DEFINE_TYPE_WITH_CODE (ThunarOrgFreedesktopFileManager1Skeleton, thunar_org_freedesktop_file_manager1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
1374                          G_IMPLEMENT_INTERFACE (THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1, thunar_org_freedesktop_file_manager1_skeleton_iface_init))
1375 
1376 #endif
1377 static void
1378 thunar_org_freedesktop_file_manager1_skeleton_finalize (GObject *object)
1379 {
1380   ThunarOrgFreedesktopFileManager1Skeleton *skeleton = THUNAR_ORG_FREEDESKTOP_FILE_MANAGER1_SKELETON (object);
1381   g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
1382   if (skeleton->priv->changed_properties_idle_source != NULL)
1383     g_source_destroy (skeleton->priv->changed_properties_idle_source);
1384   g_main_context_unref (skeleton->priv->context);
1385   g_mutex_clear (&skeleton->priv->lock);
1386   G_OBJECT_CLASS (thunar_org_freedesktop_file_manager1_skeleton_parent_class)->finalize (object);
1387 }
1388 
1389 static void
thunar_org_freedesktop_file_manager1_skeleton_init(ThunarOrgFreedesktopFileManager1Skeleton * skeleton)1390 thunar_org_freedesktop_file_manager1_skeleton_init (ThunarOrgFreedesktopFileManager1Skeleton *skeleton)
1391 {
1392 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1393   skeleton->priv = thunar_org_freedesktop_file_manager1_skeleton_get_instance_private (skeleton);
1394 #else
1395   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1_SKELETON, ThunarOrgFreedesktopFileManager1SkeletonPrivate);
1396 #endif
1397 
1398   g_mutex_init (&skeleton->priv->lock);
1399   skeleton->priv->context = g_main_context_ref_thread_default ();
1400 }
1401 
1402 static void
thunar_org_freedesktop_file_manager1_skeleton_class_init(ThunarOrgFreedesktopFileManager1SkeletonClass * klass)1403 thunar_org_freedesktop_file_manager1_skeleton_class_init (ThunarOrgFreedesktopFileManager1SkeletonClass *klass)
1404 {
1405   GObjectClass *gobject_class;
1406   GDBusInterfaceSkeletonClass *skeleton_class;
1407 
1408   gobject_class = G_OBJECT_CLASS (klass);
1409   gobject_class->finalize = thunar_org_freedesktop_file_manager1_skeleton_finalize;
1410 
1411   skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
1412   skeleton_class->get_info = thunar_org_freedesktop_file_manager1_skeleton_dbus_interface_get_info;
1413   skeleton_class->get_properties = thunar_org_freedesktop_file_manager1_skeleton_dbus_interface_get_properties;
1414   skeleton_class->flush = thunar_org_freedesktop_file_manager1_skeleton_dbus_interface_flush;
1415   skeleton_class->get_vtable = thunar_org_freedesktop_file_manager1_skeleton_dbus_interface_get_vtable;
1416 
1417 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1418   g_type_class_add_private (klass, sizeof (ThunarOrgFreedesktopFileManager1SkeletonPrivate));
1419 #endif
1420 }
1421 
1422 static void
thunar_org_freedesktop_file_manager1_skeleton_iface_init(ThunarOrgFreedesktopFileManager1Iface * iface)1423 thunar_org_freedesktop_file_manager1_skeleton_iface_init (ThunarOrgFreedesktopFileManager1Iface *iface)
1424 {
1425 }
1426 
1427 /**
1428  * thunar_org_freedesktop_file_manager1_skeleton_new:
1429  *
1430  * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-FileManager1.top_of_page">org.freedesktop.FileManager1</link>.
1431  *
1432  * Returns: (transfer full) (type ThunarOrgFreedesktopFileManager1Skeleton): The skeleton object.
1433  */
1434 ThunarOrgFreedesktopFileManager1 *
thunar_org_freedesktop_file_manager1_skeleton_new(void)1435 thunar_org_freedesktop_file_manager1_skeleton_new (void)
1436 {
1437   return THUNAR_ORG_FREEDESKTOP_FILE_MANAGER1 (g_object_new (THUNAR_TYPE_ORG_FREEDESKTOP_FILE_MANAGER1_SKELETON, NULL));
1438 }
1439 
1440