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-service-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.Thumbnailer1
156 * ------------------------------------------------------------------------
157 */
158
159 /**
160 * SECTION:TumblerExportedService
161 * @title: TumblerExportedService
162 * @short_description: Generated C code for the org.freedesktop.thumbnails.Thumbnailer1 D-Bus interface
163 *
164 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-thumbnails-Thumbnailer1.top_of_page">org.freedesktop.thumbnails.Thumbnailer1</link> D-Bus interface in C.
165 */
166
167 /* ---- Introspection data for org.freedesktop.thumbnails.Thumbnailer1 ---- */
168
169 static const _ExtendedGDBusArgInfo _tumbler_exported_service_method_info_queue_IN_ARG_uris =
170 {
171 {
172 -1,
173 (gchar *) "uris",
174 (gchar *) "as",
175 NULL
176 },
177 FALSE
178 };
179
180 static const _ExtendedGDBusArgInfo _tumbler_exported_service_method_info_queue_IN_ARG_mime_types =
181 {
182 {
183 -1,
184 (gchar *) "mime_types",
185 (gchar *) "as",
186 NULL
187 },
188 FALSE
189 };
190
191 static const _ExtendedGDBusArgInfo _tumbler_exported_service_method_info_queue_IN_ARG_flavor =
192 {
193 {
194 -1,
195 (gchar *) "flavor",
196 (gchar *) "s",
197 NULL
198 },
199 FALSE
200 };
201
202 static const _ExtendedGDBusArgInfo _tumbler_exported_service_method_info_queue_IN_ARG_scheduler =
203 {
204 {
205 -1,
206 (gchar *) "scheduler",
207 (gchar *) "s",
208 NULL
209 },
210 FALSE
211 };
212
213 static const _ExtendedGDBusArgInfo _tumbler_exported_service_method_info_queue_IN_ARG_handle_to_unqueue =
214 {
215 {
216 -1,
217 (gchar *) "handle_to_unqueue",
218 (gchar *) "u",
219 NULL
220 },
221 FALSE
222 };
223
224 static const GDBusArgInfo * const _tumbler_exported_service_method_info_queue_IN_ARG_pointers[] =
225 {
226 &_tumbler_exported_service_method_info_queue_IN_ARG_uris.parent_struct,
227 &_tumbler_exported_service_method_info_queue_IN_ARG_mime_types.parent_struct,
228 &_tumbler_exported_service_method_info_queue_IN_ARG_flavor.parent_struct,
229 &_tumbler_exported_service_method_info_queue_IN_ARG_scheduler.parent_struct,
230 &_tumbler_exported_service_method_info_queue_IN_ARG_handle_to_unqueue.parent_struct,
231 NULL
232 };
233
234 static const _ExtendedGDBusArgInfo _tumbler_exported_service_method_info_queue_OUT_ARG_handle =
235 {
236 {
237 -1,
238 (gchar *) "handle",
239 (gchar *) "u",
240 NULL
241 },
242 FALSE
243 };
244
245 static const GDBusArgInfo * const _tumbler_exported_service_method_info_queue_OUT_ARG_pointers[] =
246 {
247 &_tumbler_exported_service_method_info_queue_OUT_ARG_handle.parent_struct,
248 NULL
249 };
250
251 static const _ExtendedGDBusMethodInfo _tumbler_exported_service_method_info_queue =
252 {
253 {
254 -1,
255 (gchar *) "Queue",
256 (GDBusArgInfo **) &_tumbler_exported_service_method_info_queue_IN_ARG_pointers,
257 (GDBusArgInfo **) &_tumbler_exported_service_method_info_queue_OUT_ARG_pointers,
258 NULL
259 },
260 "handle-queue",
261 FALSE
262 };
263
264 static const _ExtendedGDBusArgInfo _tumbler_exported_service_method_info_dequeue_IN_ARG_handle =
265 {
266 {
267 -1,
268 (gchar *) "handle",
269 (gchar *) "u",
270 NULL
271 },
272 FALSE
273 };
274
275 static const GDBusArgInfo * const _tumbler_exported_service_method_info_dequeue_IN_ARG_pointers[] =
276 {
277 &_tumbler_exported_service_method_info_dequeue_IN_ARG_handle.parent_struct,
278 NULL
279 };
280
281 static const _ExtendedGDBusMethodInfo _tumbler_exported_service_method_info_dequeue =
282 {
283 {
284 -1,
285 (gchar *) "Dequeue",
286 (GDBusArgInfo **) &_tumbler_exported_service_method_info_dequeue_IN_ARG_pointers,
287 NULL,
288 NULL
289 },
290 "handle-dequeue",
291 FALSE
292 };
293
294 static const _ExtendedGDBusArgInfo _tumbler_exported_service_method_info_get_supported_OUT_ARG_uri_schemes =
295 {
296 {
297 -1,
298 (gchar *) "uri_schemes",
299 (gchar *) "as",
300 NULL
301 },
302 FALSE
303 };
304
305 static const _ExtendedGDBusArgInfo _tumbler_exported_service_method_info_get_supported_OUT_ARG_mime_types =
306 {
307 {
308 -1,
309 (gchar *) "mime_types",
310 (gchar *) "as",
311 NULL
312 },
313 FALSE
314 };
315
316 static const GDBusArgInfo * const _tumbler_exported_service_method_info_get_supported_OUT_ARG_pointers[] =
317 {
318 &_tumbler_exported_service_method_info_get_supported_OUT_ARG_uri_schemes.parent_struct,
319 &_tumbler_exported_service_method_info_get_supported_OUT_ARG_mime_types.parent_struct,
320 NULL
321 };
322
323 static const _ExtendedGDBusMethodInfo _tumbler_exported_service_method_info_get_supported =
324 {
325 {
326 -1,
327 (gchar *) "GetSupported",
328 NULL,
329 (GDBusArgInfo **) &_tumbler_exported_service_method_info_get_supported_OUT_ARG_pointers,
330 NULL
331 },
332 "handle-get-supported",
333 FALSE
334 };
335
336 static const _ExtendedGDBusArgInfo _tumbler_exported_service_method_info_get_schedulers_OUT_ARG_schedulers =
337 {
338 {
339 -1,
340 (gchar *) "schedulers",
341 (gchar *) "as",
342 NULL
343 },
344 FALSE
345 };
346
347 static const GDBusArgInfo * const _tumbler_exported_service_method_info_get_schedulers_OUT_ARG_pointers[] =
348 {
349 &_tumbler_exported_service_method_info_get_schedulers_OUT_ARG_schedulers.parent_struct,
350 NULL
351 };
352
353 static const _ExtendedGDBusMethodInfo _tumbler_exported_service_method_info_get_schedulers =
354 {
355 {
356 -1,
357 (gchar *) "GetSchedulers",
358 NULL,
359 (GDBusArgInfo **) &_tumbler_exported_service_method_info_get_schedulers_OUT_ARG_pointers,
360 NULL
361 },
362 "handle-get-schedulers",
363 FALSE
364 };
365
366 static const _ExtendedGDBusArgInfo _tumbler_exported_service_method_info_get_flavors_OUT_ARG_flavors =
367 {
368 {
369 -1,
370 (gchar *) "flavors",
371 (gchar *) "as",
372 NULL
373 },
374 FALSE
375 };
376
377 static const GDBusArgInfo * const _tumbler_exported_service_method_info_get_flavors_OUT_ARG_pointers[] =
378 {
379 &_tumbler_exported_service_method_info_get_flavors_OUT_ARG_flavors.parent_struct,
380 NULL
381 };
382
383 static const _ExtendedGDBusMethodInfo _tumbler_exported_service_method_info_get_flavors =
384 {
385 {
386 -1,
387 (gchar *) "GetFlavors",
388 NULL,
389 (GDBusArgInfo **) &_tumbler_exported_service_method_info_get_flavors_OUT_ARG_pointers,
390 NULL
391 },
392 "handle-get-flavors",
393 FALSE
394 };
395
396 static const GDBusMethodInfo * const _tumbler_exported_service_method_info_pointers[] =
397 {
398 &_tumbler_exported_service_method_info_queue.parent_struct,
399 &_tumbler_exported_service_method_info_dequeue.parent_struct,
400 &_tumbler_exported_service_method_info_get_supported.parent_struct,
401 &_tumbler_exported_service_method_info_get_schedulers.parent_struct,
402 &_tumbler_exported_service_method_info_get_flavors.parent_struct,
403 NULL
404 };
405
406 static const _ExtendedGDBusArgInfo _tumbler_exported_service_signal_info_started_ARG_handle =
407 {
408 {
409 -1,
410 (gchar *) "handle",
411 (gchar *) "u",
412 NULL
413 },
414 FALSE
415 };
416
417 static const GDBusArgInfo * const _tumbler_exported_service_signal_info_started_ARG_pointers[] =
418 {
419 &_tumbler_exported_service_signal_info_started_ARG_handle.parent_struct,
420 NULL
421 };
422
423 static const _ExtendedGDBusSignalInfo _tumbler_exported_service_signal_info_started =
424 {
425 {
426 -1,
427 (gchar *) "Started",
428 (GDBusArgInfo **) &_tumbler_exported_service_signal_info_started_ARG_pointers,
429 NULL
430 },
431 "started"
432 };
433
434 static const _ExtendedGDBusArgInfo _tumbler_exported_service_signal_info_finished_ARG_handle =
435 {
436 {
437 -1,
438 (gchar *) "handle",
439 (gchar *) "u",
440 NULL
441 },
442 FALSE
443 };
444
445 static const GDBusArgInfo * const _tumbler_exported_service_signal_info_finished_ARG_pointers[] =
446 {
447 &_tumbler_exported_service_signal_info_finished_ARG_handle.parent_struct,
448 NULL
449 };
450
451 static const _ExtendedGDBusSignalInfo _tumbler_exported_service_signal_info_finished =
452 {
453 {
454 -1,
455 (gchar *) "Finished",
456 (GDBusArgInfo **) &_tumbler_exported_service_signal_info_finished_ARG_pointers,
457 NULL
458 },
459 "finished"
460 };
461
462 static const _ExtendedGDBusArgInfo _tumbler_exported_service_signal_info_ready_ARG_handle =
463 {
464 {
465 -1,
466 (gchar *) "handle",
467 (gchar *) "u",
468 NULL
469 },
470 FALSE
471 };
472
473 static const _ExtendedGDBusArgInfo _tumbler_exported_service_signal_info_ready_ARG_uris =
474 {
475 {
476 -1,
477 (gchar *) "uris",
478 (gchar *) "as",
479 NULL
480 },
481 FALSE
482 };
483
484 static const GDBusArgInfo * const _tumbler_exported_service_signal_info_ready_ARG_pointers[] =
485 {
486 &_tumbler_exported_service_signal_info_ready_ARG_handle.parent_struct,
487 &_tumbler_exported_service_signal_info_ready_ARG_uris.parent_struct,
488 NULL
489 };
490
491 static const _ExtendedGDBusSignalInfo _tumbler_exported_service_signal_info_ready =
492 {
493 {
494 -1,
495 (gchar *) "Ready",
496 (GDBusArgInfo **) &_tumbler_exported_service_signal_info_ready_ARG_pointers,
497 NULL
498 },
499 "ready"
500 };
501
502 static const _ExtendedGDBusArgInfo _tumbler_exported_service_signal_info_error_ARG_handle =
503 {
504 {
505 -1,
506 (gchar *) "handle",
507 (gchar *) "u",
508 NULL
509 },
510 FALSE
511 };
512
513 static const _ExtendedGDBusArgInfo _tumbler_exported_service_signal_info_error_ARG_failed_uris =
514 {
515 {
516 -1,
517 (gchar *) "failed_uris",
518 (gchar *) "as",
519 NULL
520 },
521 FALSE
522 };
523
524 static const _ExtendedGDBusArgInfo _tumbler_exported_service_signal_info_error_ARG_error_code =
525 {
526 {
527 -1,
528 (gchar *) "error_code",
529 (gchar *) "i",
530 NULL
531 },
532 FALSE
533 };
534
535 static const _ExtendedGDBusArgInfo _tumbler_exported_service_signal_info_error_ARG_message =
536 {
537 {
538 -1,
539 (gchar *) "message",
540 (gchar *) "s",
541 NULL
542 },
543 FALSE
544 };
545
546 static const GDBusArgInfo * const _tumbler_exported_service_signal_info_error_ARG_pointers[] =
547 {
548 &_tumbler_exported_service_signal_info_error_ARG_handle.parent_struct,
549 &_tumbler_exported_service_signal_info_error_ARG_failed_uris.parent_struct,
550 &_tumbler_exported_service_signal_info_error_ARG_error_code.parent_struct,
551 &_tumbler_exported_service_signal_info_error_ARG_message.parent_struct,
552 NULL
553 };
554
555 static const _ExtendedGDBusSignalInfo _tumbler_exported_service_signal_info_error =
556 {
557 {
558 -1,
559 (gchar *) "Error",
560 (GDBusArgInfo **) &_tumbler_exported_service_signal_info_error_ARG_pointers,
561 NULL
562 },
563 "error"
564 };
565
566 static const GDBusSignalInfo * const _tumbler_exported_service_signal_info_pointers[] =
567 {
568 &_tumbler_exported_service_signal_info_started.parent_struct,
569 &_tumbler_exported_service_signal_info_finished.parent_struct,
570 &_tumbler_exported_service_signal_info_ready.parent_struct,
571 &_tumbler_exported_service_signal_info_error.parent_struct,
572 NULL
573 };
574
575 static const _ExtendedGDBusInterfaceInfo _tumbler_exported_service_interface_info =
576 {
577 {
578 -1,
579 (gchar *) "org.freedesktop.thumbnails.Thumbnailer1",
580 (GDBusMethodInfo **) &_tumbler_exported_service_method_info_pointers,
581 (GDBusSignalInfo **) &_tumbler_exported_service_signal_info_pointers,
582 NULL,
583 NULL
584 },
585 "exported-service",
586 };
587
588
589 /**
590 * tumbler_exported_service_interface_info:
591 *
592 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-thumbnails-Thumbnailer1.top_of_page">org.freedesktop.thumbnails.Thumbnailer1</link> D-Bus interface.
593 *
594 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
595 */
596 GDBusInterfaceInfo *
tumbler_exported_service_interface_info(void)597 tumbler_exported_service_interface_info (void)
598 {
599 return (GDBusInterfaceInfo *) &_tumbler_exported_service_interface_info.parent_struct;
600 }
601
602 /**
603 * tumbler_exported_service_override_properties:
604 * @klass: The class structure for a #GObject derived class.
605 * @property_id_begin: The property id to assign to the first overridden property.
606 *
607 * Overrides all #GObject properties in the #TumblerExportedService interface for a concrete class.
608 * The properties are overridden in the order they are defined.
609 *
610 * Returns: The last property id.
611 */
612 guint
tumbler_exported_service_override_properties(GObjectClass * klass,guint property_id_begin)613 tumbler_exported_service_override_properties (GObjectClass *klass, guint property_id_begin)
614 {
615 return property_id_begin - 1;
616 }
617
618
619
620 /**
621 * TumblerExportedService:
622 *
623 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-thumbnails-Thumbnailer1.top_of_page">org.freedesktop.thumbnails.Thumbnailer1</link>.
624 */
625
626 /**
627 * TumblerExportedServiceIface:
628 * @parent_iface: The parent interface.
629 * @handle_dequeue: Handler for the #TumblerExportedService::handle-dequeue signal.
630 * @handle_get_flavors: Handler for the #TumblerExportedService::handle-get-flavors signal.
631 * @handle_get_schedulers: Handler for the #TumblerExportedService::handle-get-schedulers signal.
632 * @handle_get_supported: Handler for the #TumblerExportedService::handle-get-supported signal.
633 * @handle_queue: Handler for the #TumblerExportedService::handle-queue signal.
634 * @error: Handler for the #TumblerExportedService::error signal.
635 * @finished: Handler for the #TumblerExportedService::finished signal.
636 * @ready: Handler for the #TumblerExportedService::ready signal.
637 * @started: Handler for the #TumblerExportedService::started signal.
638 *
639 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-thumbnails-Thumbnailer1.top_of_page">org.freedesktop.thumbnails.Thumbnailer1</link>.
640 */
641
642 typedef TumblerExportedServiceIface TumblerExportedServiceInterface;
G_DEFINE_INTERFACE(TumblerExportedService,tumbler_exported_service,G_TYPE_OBJECT)643 G_DEFINE_INTERFACE (TumblerExportedService, tumbler_exported_service, G_TYPE_OBJECT)
644
645 static void
646 tumbler_exported_service_default_init (TumblerExportedServiceIface *iface)
647 {
648 /* GObject signals for incoming D-Bus method calls: */
649 /**
650 * TumblerExportedService::handle-queue:
651 * @object: A #TumblerExportedService.
652 * @invocation: A #GDBusMethodInvocation.
653 * @arg_uris: Argument passed by remote caller.
654 * @arg_mime_types: Argument passed by remote caller.
655 * @arg_flavor: Argument passed by remote caller.
656 * @arg_scheduler: Argument passed by remote caller.
657 * @arg_handle_to_unqueue: Argument passed by remote caller.
658 *
659 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.Queue">Queue()</link> D-Bus method.
660 *
661 * 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_service_complete_queue() 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.
662 *
663 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
664 */
665 g_signal_new ("handle-queue",
666 G_TYPE_FROM_INTERFACE (iface),
667 G_SIGNAL_RUN_LAST,
668 G_STRUCT_OFFSET (TumblerExportedServiceIface, handle_queue),
669 g_signal_accumulator_true_handled,
670 NULL,
671 g_cclosure_marshal_generic,
672 G_TYPE_BOOLEAN,
673 6,
674 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRV, G_TYPE_STRV, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT);
675
676 /**
677 * TumblerExportedService::handle-dequeue:
678 * @object: A #TumblerExportedService.
679 * @invocation: A #GDBusMethodInvocation.
680 * @arg_handle: Argument passed by remote caller.
681 *
682 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.Dequeue">Dequeue()</link> D-Bus method.
683 *
684 * 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_service_complete_dequeue() 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.
685 *
686 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
687 */
688 g_signal_new ("handle-dequeue",
689 G_TYPE_FROM_INTERFACE (iface),
690 G_SIGNAL_RUN_LAST,
691 G_STRUCT_OFFSET (TumblerExportedServiceIface, handle_dequeue),
692 g_signal_accumulator_true_handled,
693 NULL,
694 g_cclosure_marshal_generic,
695 G_TYPE_BOOLEAN,
696 2,
697 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT);
698
699 /**
700 * TumblerExportedService::handle-get-supported:
701 * @object: A #TumblerExportedService.
702 * @invocation: A #GDBusMethodInvocation.
703 *
704 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.GetSupported">GetSupported()</link> D-Bus method.
705 *
706 * 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_service_complete_get_supported() 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.
707 *
708 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
709 */
710 g_signal_new ("handle-get-supported",
711 G_TYPE_FROM_INTERFACE (iface),
712 G_SIGNAL_RUN_LAST,
713 G_STRUCT_OFFSET (TumblerExportedServiceIface, handle_get_supported),
714 g_signal_accumulator_true_handled,
715 NULL,
716 g_cclosure_marshal_generic,
717 G_TYPE_BOOLEAN,
718 1,
719 G_TYPE_DBUS_METHOD_INVOCATION);
720
721 /**
722 * TumblerExportedService::handle-get-schedulers:
723 * @object: A #TumblerExportedService.
724 * @invocation: A #GDBusMethodInvocation.
725 *
726 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.GetSchedulers">GetSchedulers()</link> D-Bus method.
727 *
728 * 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_service_complete_get_schedulers() 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.
729 *
730 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
731 */
732 g_signal_new ("handle-get-schedulers",
733 G_TYPE_FROM_INTERFACE (iface),
734 G_SIGNAL_RUN_LAST,
735 G_STRUCT_OFFSET (TumblerExportedServiceIface, handle_get_schedulers),
736 g_signal_accumulator_true_handled,
737 NULL,
738 g_cclosure_marshal_generic,
739 G_TYPE_BOOLEAN,
740 1,
741 G_TYPE_DBUS_METHOD_INVOCATION);
742
743 /**
744 * TumblerExportedService::handle-get-flavors:
745 * @object: A #TumblerExportedService.
746 * @invocation: A #GDBusMethodInvocation.
747 *
748 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.GetFlavors">GetFlavors()</link> D-Bus method.
749 *
750 * 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_service_complete_get_flavors() 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.
751 *
752 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
753 */
754 g_signal_new ("handle-get-flavors",
755 G_TYPE_FROM_INTERFACE (iface),
756 G_SIGNAL_RUN_LAST,
757 G_STRUCT_OFFSET (TumblerExportedServiceIface, handle_get_flavors),
758 g_signal_accumulator_true_handled,
759 NULL,
760 g_cclosure_marshal_generic,
761 G_TYPE_BOOLEAN,
762 1,
763 G_TYPE_DBUS_METHOD_INVOCATION);
764
765 /* GObject signals for received D-Bus signals: */
766 /**
767 * TumblerExportedService::started:
768 * @object: A #TumblerExportedService.
769 * @arg_handle: Argument.
770 *
771 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-thumbnails-Thumbnailer1.Started">"Started"</link> is received.
772 *
773 * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
774 */
775 g_signal_new ("started",
776 G_TYPE_FROM_INTERFACE (iface),
777 G_SIGNAL_RUN_LAST,
778 G_STRUCT_OFFSET (TumblerExportedServiceIface, started),
779 NULL,
780 NULL,
781 g_cclosure_marshal_generic,
782 G_TYPE_NONE,
783 1, G_TYPE_UINT);
784
785 /**
786 * TumblerExportedService::finished:
787 * @object: A #TumblerExportedService.
788 * @arg_handle: Argument.
789 *
790 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-thumbnails-Thumbnailer1.Finished">"Finished"</link> is received.
791 *
792 * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
793 */
794 g_signal_new ("finished",
795 G_TYPE_FROM_INTERFACE (iface),
796 G_SIGNAL_RUN_LAST,
797 G_STRUCT_OFFSET (TumblerExportedServiceIface, finished),
798 NULL,
799 NULL,
800 g_cclosure_marshal_generic,
801 G_TYPE_NONE,
802 1, G_TYPE_UINT);
803
804 /**
805 * TumblerExportedService::ready:
806 * @object: A #TumblerExportedService.
807 * @arg_handle: Argument.
808 * @arg_uris: Argument.
809 *
810 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-thumbnails-Thumbnailer1.Ready">"Ready"</link> is received.
811 *
812 * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
813 */
814 g_signal_new ("ready",
815 G_TYPE_FROM_INTERFACE (iface),
816 G_SIGNAL_RUN_LAST,
817 G_STRUCT_OFFSET (TumblerExportedServiceIface, ready),
818 NULL,
819 NULL,
820 g_cclosure_marshal_generic,
821 G_TYPE_NONE,
822 2, G_TYPE_UINT, G_TYPE_STRV);
823
824 /**
825 * TumblerExportedService::error:
826 * @object: A #TumblerExportedService.
827 * @arg_handle: Argument.
828 * @arg_failed_uris: Argument.
829 * @arg_error_code: Argument.
830 * @arg_message: Argument.
831 *
832 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-thumbnails-Thumbnailer1.Error">"Error"</link> is received.
833 *
834 * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
835 */
836 g_signal_new ("error",
837 G_TYPE_FROM_INTERFACE (iface),
838 G_SIGNAL_RUN_LAST,
839 G_STRUCT_OFFSET (TumblerExportedServiceIface, error),
840 NULL,
841 NULL,
842 g_cclosure_marshal_generic,
843 G_TYPE_NONE,
844 4, G_TYPE_UINT, G_TYPE_STRV, G_TYPE_INT, G_TYPE_STRING);
845
846 }
847
848 /**
849 * tumbler_exported_service_emit_started:
850 * @object: A #TumblerExportedService.
851 * @arg_handle: Argument to pass with the signal.
852 *
853 * Emits the <link linkend="gdbus-signal-org-freedesktop-thumbnails-Thumbnailer1.Started">"Started"</link> D-Bus signal.
854 */
855 void
tumbler_exported_service_emit_started(TumblerExportedService * object,guint arg_handle)856 tumbler_exported_service_emit_started (
857 TumblerExportedService *object,
858 guint arg_handle)
859 {
860 g_signal_emit_by_name (object, "started", arg_handle);
861 }
862
863 /**
864 * tumbler_exported_service_emit_finished:
865 * @object: A #TumblerExportedService.
866 * @arg_handle: Argument to pass with the signal.
867 *
868 * Emits the <link linkend="gdbus-signal-org-freedesktop-thumbnails-Thumbnailer1.Finished">"Finished"</link> D-Bus signal.
869 */
870 void
tumbler_exported_service_emit_finished(TumblerExportedService * object,guint arg_handle)871 tumbler_exported_service_emit_finished (
872 TumblerExportedService *object,
873 guint arg_handle)
874 {
875 g_signal_emit_by_name (object, "finished", arg_handle);
876 }
877
878 /**
879 * tumbler_exported_service_emit_ready:
880 * @object: A #TumblerExportedService.
881 * @arg_handle: Argument to pass with the signal.
882 * @arg_uris: Argument to pass with the signal.
883 *
884 * Emits the <link linkend="gdbus-signal-org-freedesktop-thumbnails-Thumbnailer1.Ready">"Ready"</link> D-Bus signal.
885 */
886 void
tumbler_exported_service_emit_ready(TumblerExportedService * object,guint arg_handle,const gchar * const * arg_uris)887 tumbler_exported_service_emit_ready (
888 TumblerExportedService *object,
889 guint arg_handle,
890 const gchar *const *arg_uris)
891 {
892 g_signal_emit_by_name (object, "ready", arg_handle, arg_uris);
893 }
894
895 /**
896 * tumbler_exported_service_emit_error:
897 * @object: A #TumblerExportedService.
898 * @arg_handle: Argument to pass with the signal.
899 * @arg_failed_uris: Argument to pass with the signal.
900 * @arg_error_code: Argument to pass with the signal.
901 * @arg_message: Argument to pass with the signal.
902 *
903 * Emits the <link linkend="gdbus-signal-org-freedesktop-thumbnails-Thumbnailer1.Error">"Error"</link> D-Bus signal.
904 */
905 void
tumbler_exported_service_emit_error(TumblerExportedService * object,guint arg_handle,const gchar * const * arg_failed_uris,gint arg_error_code,const gchar * arg_message)906 tumbler_exported_service_emit_error (
907 TumblerExportedService *object,
908 guint arg_handle,
909 const gchar *const *arg_failed_uris,
910 gint arg_error_code,
911 const gchar *arg_message)
912 {
913 g_signal_emit_by_name (object, "error", arg_handle, arg_failed_uris, arg_error_code, arg_message);
914 }
915
916 /**
917 * tumbler_exported_service_call_queue:
918 * @proxy: A #TumblerExportedServiceProxy.
919 * @arg_uris: Argument to pass with the method invocation.
920 * @arg_mime_types: Argument to pass with the method invocation.
921 * @arg_flavor: Argument to pass with the method invocation.
922 * @arg_scheduler: Argument to pass with the method invocation.
923 * @arg_handle_to_unqueue: Argument to pass with the method invocation.
924 * @cancellable: (nullable): A #GCancellable or %NULL.
925 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
926 * @user_data: User data to pass to @callback.
927 *
928 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.Queue">Queue()</link> D-Bus method on @proxy.
929 * 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()).
930 * You can then call tumbler_exported_service_call_queue_finish() to get the result of the operation.
931 *
932 * See tumbler_exported_service_call_queue_sync() for the synchronous, blocking version of this method.
933 */
934 void
tumbler_exported_service_call_queue(TumblerExportedService * proxy,const gchar * const * arg_uris,const gchar * const * arg_mime_types,const gchar * arg_flavor,const gchar * arg_scheduler,guint arg_handle_to_unqueue,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)935 tumbler_exported_service_call_queue (
936 TumblerExportedService *proxy,
937 const gchar *const *arg_uris,
938 const gchar *const *arg_mime_types,
939 const gchar *arg_flavor,
940 const gchar *arg_scheduler,
941 guint arg_handle_to_unqueue,
942 GCancellable *cancellable,
943 GAsyncReadyCallback callback,
944 gpointer user_data)
945 {
946 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
947 "Queue",
948 g_variant_new ("(^as^asssu)",
949 arg_uris,
950 arg_mime_types,
951 arg_flavor,
952 arg_scheduler,
953 arg_handle_to_unqueue),
954 G_DBUS_CALL_FLAGS_NONE,
955 -1,
956 cancellable,
957 callback,
958 user_data);
959 }
960
961 /**
962 * tumbler_exported_service_call_queue_finish:
963 * @proxy: A #TumblerExportedServiceProxy.
964 * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore.
965 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to tumbler_exported_service_call_queue().
966 * @error: Return location for error or %NULL.
967 *
968 * Finishes an operation started with tumbler_exported_service_call_queue().
969 *
970 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
971 */
972 gboolean
tumbler_exported_service_call_queue_finish(TumblerExportedService * proxy,guint * out_handle,GAsyncResult * res,GError ** error)973 tumbler_exported_service_call_queue_finish (
974 TumblerExportedService *proxy,
975 guint *out_handle,
976 GAsyncResult *res,
977 GError **error)
978 {
979 GVariant *_ret;
980 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
981 if (_ret == NULL)
982 goto _out;
983 g_variant_get (_ret,
984 "(u)",
985 out_handle);
986 g_variant_unref (_ret);
987 _out:
988 return _ret != NULL;
989 }
990
991 /**
992 * tumbler_exported_service_call_queue_sync:
993 * @proxy: A #TumblerExportedServiceProxy.
994 * @arg_uris: Argument to pass with the method invocation.
995 * @arg_mime_types: Argument to pass with the method invocation.
996 * @arg_flavor: Argument to pass with the method invocation.
997 * @arg_scheduler: Argument to pass with the method invocation.
998 * @arg_handle_to_unqueue: Argument to pass with the method invocation.
999 * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore.
1000 * @cancellable: (nullable): A #GCancellable or %NULL.
1001 * @error: Return location for error or %NULL.
1002 *
1003 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.Queue">Queue()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1004 *
1005 * See tumbler_exported_service_call_queue() for the asynchronous version of this method.
1006 *
1007 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1008 */
1009 gboolean
tumbler_exported_service_call_queue_sync(TumblerExportedService * proxy,const gchar * const * arg_uris,const gchar * const * arg_mime_types,const gchar * arg_flavor,const gchar * arg_scheduler,guint arg_handle_to_unqueue,guint * out_handle,GCancellable * cancellable,GError ** error)1010 tumbler_exported_service_call_queue_sync (
1011 TumblerExportedService *proxy,
1012 const gchar *const *arg_uris,
1013 const gchar *const *arg_mime_types,
1014 const gchar *arg_flavor,
1015 const gchar *arg_scheduler,
1016 guint arg_handle_to_unqueue,
1017 guint *out_handle,
1018 GCancellable *cancellable,
1019 GError **error)
1020 {
1021 GVariant *_ret;
1022 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1023 "Queue",
1024 g_variant_new ("(^as^asssu)",
1025 arg_uris,
1026 arg_mime_types,
1027 arg_flavor,
1028 arg_scheduler,
1029 arg_handle_to_unqueue),
1030 G_DBUS_CALL_FLAGS_NONE,
1031 -1,
1032 cancellable,
1033 error);
1034 if (_ret == NULL)
1035 goto _out;
1036 g_variant_get (_ret,
1037 "(u)",
1038 out_handle);
1039 g_variant_unref (_ret);
1040 _out:
1041 return _ret != NULL;
1042 }
1043
1044 /**
1045 * tumbler_exported_service_call_dequeue:
1046 * @proxy: A #TumblerExportedServiceProxy.
1047 * @arg_handle: Argument to pass with the method invocation.
1048 * @cancellable: (nullable): A #GCancellable or %NULL.
1049 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1050 * @user_data: User data to pass to @callback.
1051 *
1052 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.Dequeue">Dequeue()</link> D-Bus method on @proxy.
1053 * 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()).
1054 * You can then call tumbler_exported_service_call_dequeue_finish() to get the result of the operation.
1055 *
1056 * See tumbler_exported_service_call_dequeue_sync() for the synchronous, blocking version of this method.
1057 */
1058 void
tumbler_exported_service_call_dequeue(TumblerExportedService * proxy,guint arg_handle,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)1059 tumbler_exported_service_call_dequeue (
1060 TumblerExportedService *proxy,
1061 guint arg_handle,
1062 GCancellable *cancellable,
1063 GAsyncReadyCallback callback,
1064 gpointer user_data)
1065 {
1066 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1067 "Dequeue",
1068 g_variant_new ("(u)",
1069 arg_handle),
1070 G_DBUS_CALL_FLAGS_NONE,
1071 -1,
1072 cancellable,
1073 callback,
1074 user_data);
1075 }
1076
1077 /**
1078 * tumbler_exported_service_call_dequeue_finish:
1079 * @proxy: A #TumblerExportedServiceProxy.
1080 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to tumbler_exported_service_call_dequeue().
1081 * @error: Return location for error or %NULL.
1082 *
1083 * Finishes an operation started with tumbler_exported_service_call_dequeue().
1084 *
1085 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1086 */
1087 gboolean
tumbler_exported_service_call_dequeue_finish(TumblerExportedService * proxy,GAsyncResult * res,GError ** error)1088 tumbler_exported_service_call_dequeue_finish (
1089 TumblerExportedService *proxy,
1090 GAsyncResult *res,
1091 GError **error)
1092 {
1093 GVariant *_ret;
1094 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1095 if (_ret == NULL)
1096 goto _out;
1097 g_variant_get (_ret,
1098 "()");
1099 g_variant_unref (_ret);
1100 _out:
1101 return _ret != NULL;
1102 }
1103
1104 /**
1105 * tumbler_exported_service_call_dequeue_sync:
1106 * @proxy: A #TumblerExportedServiceProxy.
1107 * @arg_handle: Argument to pass with the method invocation.
1108 * @cancellable: (nullable): A #GCancellable or %NULL.
1109 * @error: Return location for error or %NULL.
1110 *
1111 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.Dequeue">Dequeue()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1112 *
1113 * See tumbler_exported_service_call_dequeue() for the asynchronous version of this method.
1114 *
1115 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1116 */
1117 gboolean
tumbler_exported_service_call_dequeue_sync(TumblerExportedService * proxy,guint arg_handle,GCancellable * cancellable,GError ** error)1118 tumbler_exported_service_call_dequeue_sync (
1119 TumblerExportedService *proxy,
1120 guint arg_handle,
1121 GCancellable *cancellable,
1122 GError **error)
1123 {
1124 GVariant *_ret;
1125 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1126 "Dequeue",
1127 g_variant_new ("(u)",
1128 arg_handle),
1129 G_DBUS_CALL_FLAGS_NONE,
1130 -1,
1131 cancellable,
1132 error);
1133 if (_ret == NULL)
1134 goto _out;
1135 g_variant_get (_ret,
1136 "()");
1137 g_variant_unref (_ret);
1138 _out:
1139 return _ret != NULL;
1140 }
1141
1142 /**
1143 * tumbler_exported_service_call_get_supported:
1144 * @proxy: A #TumblerExportedServiceProxy.
1145 * @cancellable: (nullable): A #GCancellable or %NULL.
1146 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1147 * @user_data: User data to pass to @callback.
1148 *
1149 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.GetSupported">GetSupported()</link> D-Bus method on @proxy.
1150 * 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()).
1151 * You can then call tumbler_exported_service_call_get_supported_finish() to get the result of the operation.
1152 *
1153 * See tumbler_exported_service_call_get_supported_sync() for the synchronous, blocking version of this method.
1154 */
1155 void
tumbler_exported_service_call_get_supported(TumblerExportedService * proxy,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)1156 tumbler_exported_service_call_get_supported (
1157 TumblerExportedService *proxy,
1158 GCancellable *cancellable,
1159 GAsyncReadyCallback callback,
1160 gpointer user_data)
1161 {
1162 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1163 "GetSupported",
1164 g_variant_new ("()"),
1165 G_DBUS_CALL_FLAGS_NONE,
1166 -1,
1167 cancellable,
1168 callback,
1169 user_data);
1170 }
1171
1172 /**
1173 * tumbler_exported_service_call_get_supported_finish:
1174 * @proxy: A #TumblerExportedServiceProxy.
1175 * @out_uri_schemes: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore.
1176 * @out_mime_types: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore.
1177 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to tumbler_exported_service_call_get_supported().
1178 * @error: Return location for error or %NULL.
1179 *
1180 * Finishes an operation started with tumbler_exported_service_call_get_supported().
1181 *
1182 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1183 */
1184 gboolean
tumbler_exported_service_call_get_supported_finish(TumblerExportedService * proxy,gchar *** out_uri_schemes,gchar *** out_mime_types,GAsyncResult * res,GError ** error)1185 tumbler_exported_service_call_get_supported_finish (
1186 TumblerExportedService *proxy,
1187 gchar ***out_uri_schemes,
1188 gchar ***out_mime_types,
1189 GAsyncResult *res,
1190 GError **error)
1191 {
1192 GVariant *_ret;
1193 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1194 if (_ret == NULL)
1195 goto _out;
1196 g_variant_get (_ret,
1197 "(^as^as)",
1198 out_uri_schemes,
1199 out_mime_types);
1200 g_variant_unref (_ret);
1201 _out:
1202 return _ret != NULL;
1203 }
1204
1205 /**
1206 * tumbler_exported_service_call_get_supported_sync:
1207 * @proxy: A #TumblerExportedServiceProxy.
1208 * @out_uri_schemes: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore.
1209 * @out_mime_types: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore.
1210 * @cancellable: (nullable): A #GCancellable or %NULL.
1211 * @error: Return location for error or %NULL.
1212 *
1213 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.GetSupported">GetSupported()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1214 *
1215 * See tumbler_exported_service_call_get_supported() for the asynchronous version of this method.
1216 *
1217 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1218 */
1219 gboolean
tumbler_exported_service_call_get_supported_sync(TumblerExportedService * proxy,gchar *** out_uri_schemes,gchar *** out_mime_types,GCancellable * cancellable,GError ** error)1220 tumbler_exported_service_call_get_supported_sync (
1221 TumblerExportedService *proxy,
1222 gchar ***out_uri_schemes,
1223 gchar ***out_mime_types,
1224 GCancellable *cancellable,
1225 GError **error)
1226 {
1227 GVariant *_ret;
1228 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1229 "GetSupported",
1230 g_variant_new ("()"),
1231 G_DBUS_CALL_FLAGS_NONE,
1232 -1,
1233 cancellable,
1234 error);
1235 if (_ret == NULL)
1236 goto _out;
1237 g_variant_get (_ret,
1238 "(^as^as)",
1239 out_uri_schemes,
1240 out_mime_types);
1241 g_variant_unref (_ret);
1242 _out:
1243 return _ret != NULL;
1244 }
1245
1246 /**
1247 * tumbler_exported_service_call_get_schedulers:
1248 * @proxy: A #TumblerExportedServiceProxy.
1249 * @cancellable: (nullable): A #GCancellable or %NULL.
1250 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1251 * @user_data: User data to pass to @callback.
1252 *
1253 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.GetSchedulers">GetSchedulers()</link> D-Bus method on @proxy.
1254 * 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()).
1255 * You can then call tumbler_exported_service_call_get_schedulers_finish() to get the result of the operation.
1256 *
1257 * See tumbler_exported_service_call_get_schedulers_sync() for the synchronous, blocking version of this method.
1258 */
1259 void
tumbler_exported_service_call_get_schedulers(TumblerExportedService * proxy,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)1260 tumbler_exported_service_call_get_schedulers (
1261 TumblerExportedService *proxy,
1262 GCancellable *cancellable,
1263 GAsyncReadyCallback callback,
1264 gpointer user_data)
1265 {
1266 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1267 "GetSchedulers",
1268 g_variant_new ("()"),
1269 G_DBUS_CALL_FLAGS_NONE,
1270 -1,
1271 cancellable,
1272 callback,
1273 user_data);
1274 }
1275
1276 /**
1277 * tumbler_exported_service_call_get_schedulers_finish:
1278 * @proxy: A #TumblerExportedServiceProxy.
1279 * @out_schedulers: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore.
1280 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to tumbler_exported_service_call_get_schedulers().
1281 * @error: Return location for error or %NULL.
1282 *
1283 * Finishes an operation started with tumbler_exported_service_call_get_schedulers().
1284 *
1285 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1286 */
1287 gboolean
tumbler_exported_service_call_get_schedulers_finish(TumblerExportedService * proxy,gchar *** out_schedulers,GAsyncResult * res,GError ** error)1288 tumbler_exported_service_call_get_schedulers_finish (
1289 TumblerExportedService *proxy,
1290 gchar ***out_schedulers,
1291 GAsyncResult *res,
1292 GError **error)
1293 {
1294 GVariant *_ret;
1295 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1296 if (_ret == NULL)
1297 goto _out;
1298 g_variant_get (_ret,
1299 "(^as)",
1300 out_schedulers);
1301 g_variant_unref (_ret);
1302 _out:
1303 return _ret != NULL;
1304 }
1305
1306 /**
1307 * tumbler_exported_service_call_get_schedulers_sync:
1308 * @proxy: A #TumblerExportedServiceProxy.
1309 * @out_schedulers: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore.
1310 * @cancellable: (nullable): A #GCancellable or %NULL.
1311 * @error: Return location for error or %NULL.
1312 *
1313 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.GetSchedulers">GetSchedulers()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1314 *
1315 * See tumbler_exported_service_call_get_schedulers() for the asynchronous version of this method.
1316 *
1317 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1318 */
1319 gboolean
tumbler_exported_service_call_get_schedulers_sync(TumblerExportedService * proxy,gchar *** out_schedulers,GCancellable * cancellable,GError ** error)1320 tumbler_exported_service_call_get_schedulers_sync (
1321 TumblerExportedService *proxy,
1322 gchar ***out_schedulers,
1323 GCancellable *cancellable,
1324 GError **error)
1325 {
1326 GVariant *_ret;
1327 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1328 "GetSchedulers",
1329 g_variant_new ("()"),
1330 G_DBUS_CALL_FLAGS_NONE,
1331 -1,
1332 cancellable,
1333 error);
1334 if (_ret == NULL)
1335 goto _out;
1336 g_variant_get (_ret,
1337 "(^as)",
1338 out_schedulers);
1339 g_variant_unref (_ret);
1340 _out:
1341 return _ret != NULL;
1342 }
1343
1344 /**
1345 * tumbler_exported_service_call_get_flavors:
1346 * @proxy: A #TumblerExportedServiceProxy.
1347 * @cancellable: (nullable): A #GCancellable or %NULL.
1348 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1349 * @user_data: User data to pass to @callback.
1350 *
1351 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.GetFlavors">GetFlavors()</link> D-Bus method on @proxy.
1352 * 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()).
1353 * You can then call tumbler_exported_service_call_get_flavors_finish() to get the result of the operation.
1354 *
1355 * See tumbler_exported_service_call_get_flavors_sync() for the synchronous, blocking version of this method.
1356 */
1357 void
tumbler_exported_service_call_get_flavors(TumblerExportedService * proxy,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)1358 tumbler_exported_service_call_get_flavors (
1359 TumblerExportedService *proxy,
1360 GCancellable *cancellable,
1361 GAsyncReadyCallback callback,
1362 gpointer user_data)
1363 {
1364 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1365 "GetFlavors",
1366 g_variant_new ("()"),
1367 G_DBUS_CALL_FLAGS_NONE,
1368 -1,
1369 cancellable,
1370 callback,
1371 user_data);
1372 }
1373
1374 /**
1375 * tumbler_exported_service_call_get_flavors_finish:
1376 * @proxy: A #TumblerExportedServiceProxy.
1377 * @out_flavors: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore.
1378 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to tumbler_exported_service_call_get_flavors().
1379 * @error: Return location for error or %NULL.
1380 *
1381 * Finishes an operation started with tumbler_exported_service_call_get_flavors().
1382 *
1383 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1384 */
1385 gboolean
tumbler_exported_service_call_get_flavors_finish(TumblerExportedService * proxy,gchar *** out_flavors,GAsyncResult * res,GError ** error)1386 tumbler_exported_service_call_get_flavors_finish (
1387 TumblerExportedService *proxy,
1388 gchar ***out_flavors,
1389 GAsyncResult *res,
1390 GError **error)
1391 {
1392 GVariant *_ret;
1393 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1394 if (_ret == NULL)
1395 goto _out;
1396 g_variant_get (_ret,
1397 "(^as)",
1398 out_flavors);
1399 g_variant_unref (_ret);
1400 _out:
1401 return _ret != NULL;
1402 }
1403
1404 /**
1405 * tumbler_exported_service_call_get_flavors_sync:
1406 * @proxy: A #TumblerExportedServiceProxy.
1407 * @out_flavors: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore.
1408 * @cancellable: (nullable): A #GCancellable or %NULL.
1409 * @error: Return location for error or %NULL.
1410 *
1411 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.GetFlavors">GetFlavors()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1412 *
1413 * See tumbler_exported_service_call_get_flavors() for the asynchronous version of this method.
1414 *
1415 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1416 */
1417 gboolean
tumbler_exported_service_call_get_flavors_sync(TumblerExportedService * proxy,gchar *** out_flavors,GCancellable * cancellable,GError ** error)1418 tumbler_exported_service_call_get_flavors_sync (
1419 TumblerExportedService *proxy,
1420 gchar ***out_flavors,
1421 GCancellable *cancellable,
1422 GError **error)
1423 {
1424 GVariant *_ret;
1425 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1426 "GetFlavors",
1427 g_variant_new ("()"),
1428 G_DBUS_CALL_FLAGS_NONE,
1429 -1,
1430 cancellable,
1431 error);
1432 if (_ret == NULL)
1433 goto _out;
1434 g_variant_get (_ret,
1435 "(^as)",
1436 out_flavors);
1437 g_variant_unref (_ret);
1438 _out:
1439 return _ret != NULL;
1440 }
1441
1442 /**
1443 * tumbler_exported_service_complete_queue:
1444 * @object: A #TumblerExportedService.
1445 * @invocation: (transfer full): A #GDBusMethodInvocation.
1446 * @handle: Parameter to return.
1447 *
1448 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.Queue">Queue()</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.
1449 *
1450 * This method will free @invocation, you cannot use it afterwards.
1451 */
1452 void
tumbler_exported_service_complete_queue(TumblerExportedService * object,GDBusMethodInvocation * invocation,guint handle)1453 tumbler_exported_service_complete_queue (
1454 TumblerExportedService *object,
1455 GDBusMethodInvocation *invocation,
1456 guint handle)
1457 {
1458 g_dbus_method_invocation_return_value (invocation,
1459 g_variant_new ("(u)",
1460 handle));
1461 }
1462
1463 /**
1464 * tumbler_exported_service_complete_dequeue:
1465 * @object: A #TumblerExportedService.
1466 * @invocation: (transfer full): A #GDBusMethodInvocation.
1467 *
1468 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.Dequeue">Dequeue()</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.
1469 *
1470 * This method will free @invocation, you cannot use it afterwards.
1471 */
1472 void
tumbler_exported_service_complete_dequeue(TumblerExportedService * object,GDBusMethodInvocation * invocation)1473 tumbler_exported_service_complete_dequeue (
1474 TumblerExportedService *object,
1475 GDBusMethodInvocation *invocation)
1476 {
1477 g_dbus_method_invocation_return_value (invocation,
1478 g_variant_new ("()"));
1479 }
1480
1481 /**
1482 * tumbler_exported_service_complete_get_supported:
1483 * @object: A #TumblerExportedService.
1484 * @invocation: (transfer full): A #GDBusMethodInvocation.
1485 * @uri_schemes: Parameter to return.
1486 * @mime_types: Parameter to return.
1487 *
1488 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.GetSupported">GetSupported()</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.
1489 *
1490 * This method will free @invocation, you cannot use it afterwards.
1491 */
1492 void
tumbler_exported_service_complete_get_supported(TumblerExportedService * object,GDBusMethodInvocation * invocation,const gchar * const * uri_schemes,const gchar * const * mime_types)1493 tumbler_exported_service_complete_get_supported (
1494 TumblerExportedService *object,
1495 GDBusMethodInvocation *invocation,
1496 const gchar *const *uri_schemes,
1497 const gchar *const *mime_types)
1498 {
1499 g_dbus_method_invocation_return_value (invocation,
1500 g_variant_new ("(^as^as)",
1501 uri_schemes,
1502 mime_types));
1503 }
1504
1505 /**
1506 * tumbler_exported_service_complete_get_schedulers:
1507 * @object: A #TumblerExportedService.
1508 * @invocation: (transfer full): A #GDBusMethodInvocation.
1509 * @schedulers: Parameter to return.
1510 *
1511 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.GetSchedulers">GetSchedulers()</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.
1512 *
1513 * This method will free @invocation, you cannot use it afterwards.
1514 */
1515 void
tumbler_exported_service_complete_get_schedulers(TumblerExportedService * object,GDBusMethodInvocation * invocation,const gchar * const * schedulers)1516 tumbler_exported_service_complete_get_schedulers (
1517 TumblerExportedService *object,
1518 GDBusMethodInvocation *invocation,
1519 const gchar *const *schedulers)
1520 {
1521 g_dbus_method_invocation_return_value (invocation,
1522 g_variant_new ("(^as)",
1523 schedulers));
1524 }
1525
1526 /**
1527 * tumbler_exported_service_complete_get_flavors:
1528 * @object: A #TumblerExportedService.
1529 * @invocation: (transfer full): A #GDBusMethodInvocation.
1530 * @flavors: Parameter to return.
1531 *
1532 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-thumbnails-Thumbnailer1.GetFlavors">GetFlavors()</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.
1533 *
1534 * This method will free @invocation, you cannot use it afterwards.
1535 */
1536 void
tumbler_exported_service_complete_get_flavors(TumblerExportedService * object,GDBusMethodInvocation * invocation,const gchar * const * flavors)1537 tumbler_exported_service_complete_get_flavors (
1538 TumblerExportedService *object,
1539 GDBusMethodInvocation *invocation,
1540 const gchar *const *flavors)
1541 {
1542 g_dbus_method_invocation_return_value (invocation,
1543 g_variant_new ("(^as)",
1544 flavors));
1545 }
1546
1547 /* ------------------------------------------------------------------------ */
1548
1549 /**
1550 * TumblerExportedServiceProxy:
1551 *
1552 * The #TumblerExportedServiceProxy structure contains only private data and should only be accessed using the provided API.
1553 */
1554
1555 /**
1556 * TumblerExportedServiceProxyClass:
1557 * @parent_class: The parent class.
1558 *
1559 * Class structure for #TumblerExportedServiceProxy.
1560 */
1561
1562 struct _TumblerExportedServiceProxyPrivate
1563 {
1564 GData *qdata;
1565 };
1566
1567 static void tumbler_exported_service_proxy_iface_init (TumblerExportedServiceIface *iface);
1568
1569 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE(TumblerExportedServiceProxy,tumbler_exported_service_proxy,G_TYPE_DBUS_PROXY,G_ADD_PRIVATE (TumblerExportedServiceProxy)G_IMPLEMENT_INTERFACE (TUMBLER_TYPE_EXPORTED_SERVICE,tumbler_exported_service_proxy_iface_init))1570 G_DEFINE_TYPE_WITH_CODE (TumblerExportedServiceProxy, tumbler_exported_service_proxy, G_TYPE_DBUS_PROXY,
1571 G_ADD_PRIVATE (TumblerExportedServiceProxy)
1572 G_IMPLEMENT_INTERFACE (TUMBLER_TYPE_EXPORTED_SERVICE, tumbler_exported_service_proxy_iface_init))
1573
1574 #else
1575 G_DEFINE_TYPE_WITH_CODE (TumblerExportedServiceProxy, tumbler_exported_service_proxy, G_TYPE_DBUS_PROXY,
1576 G_IMPLEMENT_INTERFACE (TUMBLER_TYPE_EXPORTED_SERVICE, tumbler_exported_service_proxy_iface_init))
1577
1578 #endif
1579 static void
1580 tumbler_exported_service_proxy_finalize (GObject *object)
1581 {
1582 TumblerExportedServiceProxy *proxy = TUMBLER_EXPORTED_SERVICE_PROXY (object);
1583 g_datalist_clear (&proxy->priv->qdata);
1584 G_OBJECT_CLASS (tumbler_exported_service_proxy_parent_class)->finalize (object);
1585 }
1586
1587 static void
tumbler_exported_service_proxy_get_property(GObject * object,guint prop_id,GValue * value,GParamSpec * pspec G_GNUC_UNUSED)1588 tumbler_exported_service_proxy_get_property (GObject *object,
1589 guint prop_id,
1590 GValue *value,
1591 GParamSpec *pspec G_GNUC_UNUSED)
1592 {
1593 }
1594
1595 static void
tumbler_exported_service_proxy_set_property(GObject * object,guint prop_id,const GValue * value,GParamSpec * pspec G_GNUC_UNUSED)1596 tumbler_exported_service_proxy_set_property (GObject *object,
1597 guint prop_id,
1598 const GValue *value,
1599 GParamSpec *pspec G_GNUC_UNUSED)
1600 {
1601 }
1602
1603 static void
tumbler_exported_service_proxy_g_signal(GDBusProxy * proxy,const gchar * sender_name G_GNUC_UNUSED,const gchar * signal_name,GVariant * parameters)1604 tumbler_exported_service_proxy_g_signal (GDBusProxy *proxy,
1605 const gchar *sender_name G_GNUC_UNUSED,
1606 const gchar *signal_name,
1607 GVariant *parameters)
1608 {
1609 _ExtendedGDBusSignalInfo *info;
1610 GVariantIter iter;
1611 GVariant *child;
1612 GValue *paramv;
1613 gsize num_params;
1614 gsize n;
1615 guint signal_id;
1616 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_tumbler_exported_service_interface_info.parent_struct, signal_name);
1617 if (info == NULL)
1618 return;
1619 num_params = g_variant_n_children (parameters);
1620 paramv = g_new0 (GValue, num_params + 1);
1621 g_value_init (¶mv[0], TUMBLER_TYPE_EXPORTED_SERVICE);
1622 g_value_set_object (¶mv[0], proxy);
1623 g_variant_iter_init (&iter, parameters);
1624 n = 1;
1625 while ((child = g_variant_iter_next_value (&iter)) != NULL)
1626 {
1627 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
1628 if (arg_info->use_gvariant)
1629 {
1630 g_value_init (¶mv[n], G_TYPE_VARIANT);
1631 g_value_set_variant (¶mv[n], child);
1632 n++;
1633 }
1634 else
1635 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
1636 g_variant_unref (child);
1637 }
1638 signal_id = g_signal_lookup (info->signal_name, TUMBLER_TYPE_EXPORTED_SERVICE);
1639 g_signal_emitv (paramv, signal_id, 0, NULL);
1640 for (n = 0; n < num_params + 1; n++)
1641 g_value_unset (¶mv[n]);
1642 g_free (paramv);
1643 }
1644
1645 static void
tumbler_exported_service_proxy_g_properties_changed(GDBusProxy * _proxy,GVariant * changed_properties,const gchar * const * invalidated_properties)1646 tumbler_exported_service_proxy_g_properties_changed (GDBusProxy *_proxy,
1647 GVariant *changed_properties,
1648 const gchar *const *invalidated_properties)
1649 {
1650 TumblerExportedServiceProxy *proxy = TUMBLER_EXPORTED_SERVICE_PROXY (_proxy);
1651 guint n;
1652 const gchar *key;
1653 GVariantIter *iter;
1654 _ExtendedGDBusPropertyInfo *info;
1655 g_variant_get (changed_properties, "a{sv}", &iter);
1656 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
1657 {
1658 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_tumbler_exported_service_interface_info.parent_struct, key);
1659 g_datalist_remove_data (&proxy->priv->qdata, key);
1660 if (info != NULL)
1661 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1662 }
1663 g_variant_iter_free (iter);
1664 for (n = 0; invalidated_properties[n] != NULL; n++)
1665 {
1666 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_tumbler_exported_service_interface_info.parent_struct, invalidated_properties[n]);
1667 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
1668 if (info != NULL)
1669 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1670 }
1671 }
1672
1673 static void
tumbler_exported_service_proxy_init(TumblerExportedServiceProxy * proxy)1674 tumbler_exported_service_proxy_init (TumblerExportedServiceProxy *proxy)
1675 {
1676 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1677 proxy->priv = tumbler_exported_service_proxy_get_instance_private (proxy);
1678 #else
1679 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TUMBLER_TYPE_EXPORTED_SERVICE_PROXY, TumblerExportedServiceProxyPrivate);
1680 #endif
1681
1682 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), tumbler_exported_service_interface_info ());
1683 }
1684
1685 static void
tumbler_exported_service_proxy_class_init(TumblerExportedServiceProxyClass * klass)1686 tumbler_exported_service_proxy_class_init (TumblerExportedServiceProxyClass *klass)
1687 {
1688 GObjectClass *gobject_class;
1689 GDBusProxyClass *proxy_class;
1690
1691 gobject_class = G_OBJECT_CLASS (klass);
1692 gobject_class->finalize = tumbler_exported_service_proxy_finalize;
1693 gobject_class->get_property = tumbler_exported_service_proxy_get_property;
1694 gobject_class->set_property = tumbler_exported_service_proxy_set_property;
1695
1696 proxy_class = G_DBUS_PROXY_CLASS (klass);
1697 proxy_class->g_signal = tumbler_exported_service_proxy_g_signal;
1698 proxy_class->g_properties_changed = tumbler_exported_service_proxy_g_properties_changed;
1699
1700 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1701 g_type_class_add_private (klass, sizeof (TumblerExportedServiceProxyPrivate));
1702 #endif
1703 }
1704
1705 static void
tumbler_exported_service_proxy_iface_init(TumblerExportedServiceIface * iface)1706 tumbler_exported_service_proxy_iface_init (TumblerExportedServiceIface *iface)
1707 {
1708 }
1709
1710 /**
1711 * tumbler_exported_service_proxy_new:
1712 * @connection: A #GDBusConnection.
1713 * @flags: Flags from the #GDBusProxyFlags enumeration.
1714 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1715 * @object_path: An object path.
1716 * @cancellable: (nullable): A #GCancellable or %NULL.
1717 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1718 * @user_data: User data to pass to @callback.
1719 *
1720 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-thumbnails-Thumbnailer1.top_of_page">org.freedesktop.thumbnails.Thumbnailer1</link>. See g_dbus_proxy_new() for more details.
1721 *
1722 * 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()).
1723 * You can then call tumbler_exported_service_proxy_new_finish() to get the result of the operation.
1724 *
1725 * See tumbler_exported_service_proxy_new_sync() for the synchronous, blocking version of this constructor.
1726 */
1727 void
tumbler_exported_service_proxy_new(GDBusConnection * connection,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)1728 tumbler_exported_service_proxy_new (
1729 GDBusConnection *connection,
1730 GDBusProxyFlags flags,
1731 const gchar *name,
1732 const gchar *object_path,
1733 GCancellable *cancellable,
1734 GAsyncReadyCallback callback,
1735 gpointer user_data)
1736 {
1737 g_async_initable_new_async (TUMBLER_TYPE_EXPORTED_SERVICE_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.Thumbnailer1", NULL);
1738 }
1739
1740 /**
1741 * tumbler_exported_service_proxy_new_finish:
1742 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to tumbler_exported_service_proxy_new().
1743 * @error: Return location for error or %NULL
1744 *
1745 * Finishes an operation started with tumbler_exported_service_proxy_new().
1746 *
1747 * Returns: (transfer full) (type TumblerExportedServiceProxy): The constructed proxy object or %NULL if @error is set.
1748 */
1749 TumblerExportedService *
tumbler_exported_service_proxy_new_finish(GAsyncResult * res,GError ** error)1750 tumbler_exported_service_proxy_new_finish (
1751 GAsyncResult *res,
1752 GError **error)
1753 {
1754 GObject *ret;
1755 GObject *source_object;
1756 source_object = g_async_result_get_source_object (res);
1757 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1758 g_object_unref (source_object);
1759 if (ret != NULL)
1760 return TUMBLER_EXPORTED_SERVICE (ret);
1761 else
1762 return NULL;
1763 }
1764
1765 /**
1766 * tumbler_exported_service_proxy_new_sync:
1767 * @connection: A #GDBusConnection.
1768 * @flags: Flags from the #GDBusProxyFlags enumeration.
1769 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1770 * @object_path: An object path.
1771 * @cancellable: (nullable): A #GCancellable or %NULL.
1772 * @error: Return location for error or %NULL
1773 *
1774 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-thumbnails-Thumbnailer1.top_of_page">org.freedesktop.thumbnails.Thumbnailer1</link>. See g_dbus_proxy_new_sync() for more details.
1775 *
1776 * The calling thread is blocked until a reply is received.
1777 *
1778 * See tumbler_exported_service_proxy_new() for the asynchronous version of this constructor.
1779 *
1780 * Returns: (transfer full) (type TumblerExportedServiceProxy): The constructed proxy object or %NULL if @error is set.
1781 */
1782 TumblerExportedService *
tumbler_exported_service_proxy_new_sync(GDBusConnection * connection,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)1783 tumbler_exported_service_proxy_new_sync (
1784 GDBusConnection *connection,
1785 GDBusProxyFlags flags,
1786 const gchar *name,
1787 const gchar *object_path,
1788 GCancellable *cancellable,
1789 GError **error)
1790 {
1791 GInitable *ret;
1792 ret = g_initable_new (TUMBLER_TYPE_EXPORTED_SERVICE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.thumbnails.Thumbnailer1", NULL);
1793 if (ret != NULL)
1794 return TUMBLER_EXPORTED_SERVICE (ret);
1795 else
1796 return NULL;
1797 }
1798
1799
1800 /**
1801 * tumbler_exported_service_proxy_new_for_bus:
1802 * @bus_type: A #GBusType.
1803 * @flags: Flags from the #GDBusProxyFlags enumeration.
1804 * @name: A bus name (well-known or unique).
1805 * @object_path: An object path.
1806 * @cancellable: (nullable): A #GCancellable or %NULL.
1807 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1808 * @user_data: User data to pass to @callback.
1809 *
1810 * Like tumbler_exported_service_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
1811 *
1812 * 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()).
1813 * You can then call tumbler_exported_service_proxy_new_for_bus_finish() to get the result of the operation.
1814 *
1815 * See tumbler_exported_service_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
1816 */
1817 void
tumbler_exported_service_proxy_new_for_bus(GBusType bus_type,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)1818 tumbler_exported_service_proxy_new_for_bus (
1819 GBusType bus_type,
1820 GDBusProxyFlags flags,
1821 const gchar *name,
1822 const gchar *object_path,
1823 GCancellable *cancellable,
1824 GAsyncReadyCallback callback,
1825 gpointer user_data)
1826 {
1827 g_async_initable_new_async (TUMBLER_TYPE_EXPORTED_SERVICE_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.Thumbnailer1", NULL);
1828 }
1829
1830 /**
1831 * tumbler_exported_service_proxy_new_for_bus_finish:
1832 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to tumbler_exported_service_proxy_new_for_bus().
1833 * @error: Return location for error or %NULL
1834 *
1835 * Finishes an operation started with tumbler_exported_service_proxy_new_for_bus().
1836 *
1837 * Returns: (transfer full) (type TumblerExportedServiceProxy): The constructed proxy object or %NULL if @error is set.
1838 */
1839 TumblerExportedService *
tumbler_exported_service_proxy_new_for_bus_finish(GAsyncResult * res,GError ** error)1840 tumbler_exported_service_proxy_new_for_bus_finish (
1841 GAsyncResult *res,
1842 GError **error)
1843 {
1844 GObject *ret;
1845 GObject *source_object;
1846 source_object = g_async_result_get_source_object (res);
1847 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1848 g_object_unref (source_object);
1849 if (ret != NULL)
1850 return TUMBLER_EXPORTED_SERVICE (ret);
1851 else
1852 return NULL;
1853 }
1854
1855 /**
1856 * tumbler_exported_service_proxy_new_for_bus_sync:
1857 * @bus_type: A #GBusType.
1858 * @flags: Flags from the #GDBusProxyFlags enumeration.
1859 * @name: A bus name (well-known or unique).
1860 * @object_path: An object path.
1861 * @cancellable: (nullable): A #GCancellable or %NULL.
1862 * @error: Return location for error or %NULL
1863 *
1864 * Like tumbler_exported_service_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
1865 *
1866 * The calling thread is blocked until a reply is received.
1867 *
1868 * See tumbler_exported_service_proxy_new_for_bus() for the asynchronous version of this constructor.
1869 *
1870 * Returns: (transfer full) (type TumblerExportedServiceProxy): The constructed proxy object or %NULL if @error is set.
1871 */
1872 TumblerExportedService *
tumbler_exported_service_proxy_new_for_bus_sync(GBusType bus_type,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)1873 tumbler_exported_service_proxy_new_for_bus_sync (
1874 GBusType bus_type,
1875 GDBusProxyFlags flags,
1876 const gchar *name,
1877 const gchar *object_path,
1878 GCancellable *cancellable,
1879 GError **error)
1880 {
1881 GInitable *ret;
1882 ret = g_initable_new (TUMBLER_TYPE_EXPORTED_SERVICE_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.Thumbnailer1", NULL);
1883 if (ret != NULL)
1884 return TUMBLER_EXPORTED_SERVICE (ret);
1885 else
1886 return NULL;
1887 }
1888
1889
1890 /* ------------------------------------------------------------------------ */
1891
1892 /**
1893 * TumblerExportedServiceSkeleton:
1894 *
1895 * The #TumblerExportedServiceSkeleton structure contains only private data and should only be accessed using the provided API.
1896 */
1897
1898 /**
1899 * TumblerExportedServiceSkeletonClass:
1900 * @parent_class: The parent class.
1901 *
1902 * Class structure for #TumblerExportedServiceSkeleton.
1903 */
1904
1905 struct _TumblerExportedServiceSkeletonPrivate
1906 {
1907 GValue *properties;
1908 GList *changed_properties;
1909 GSource *changed_properties_idle_source;
1910 GMainContext *context;
1911 GMutex lock;
1912 };
1913
1914 static void
_tumbler_exported_service_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)1915 _tumbler_exported_service_skeleton_handle_method_call (
1916 GDBusConnection *connection G_GNUC_UNUSED,
1917 const gchar *sender G_GNUC_UNUSED,
1918 const gchar *object_path G_GNUC_UNUSED,
1919 const gchar *interface_name,
1920 const gchar *method_name,
1921 GVariant *parameters,
1922 GDBusMethodInvocation *invocation,
1923 gpointer user_data)
1924 {
1925 TumblerExportedServiceSkeleton *skeleton = TUMBLER_EXPORTED_SERVICE_SKELETON (user_data);
1926 _ExtendedGDBusMethodInfo *info;
1927 GVariantIter iter;
1928 GVariant *child;
1929 GValue *paramv;
1930 gsize num_params;
1931 guint num_extra;
1932 gsize n;
1933 guint signal_id;
1934 GValue return_value = G_VALUE_INIT;
1935 info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
1936 g_assert (info != NULL);
1937 num_params = g_variant_n_children (parameters);
1938 num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
1939 n = 0;
1940 g_value_init (¶mv[n], TUMBLER_TYPE_EXPORTED_SERVICE);
1941 g_value_set_object (¶mv[n++], skeleton);
1942 g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
1943 g_value_set_object (¶mv[n++], invocation);
1944 if (info->pass_fdlist)
1945 {
1946 #ifdef G_OS_UNIX
1947 g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
1948 g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
1949 #else
1950 g_assert_not_reached ();
1951 #endif
1952 }
1953 g_variant_iter_init (&iter, parameters);
1954 while ((child = g_variant_iter_next_value (&iter)) != NULL)
1955 {
1956 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
1957 if (arg_info->use_gvariant)
1958 {
1959 g_value_init (¶mv[n], G_TYPE_VARIANT);
1960 g_value_set_variant (¶mv[n], child);
1961 n++;
1962 }
1963 else
1964 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
1965 g_variant_unref (child);
1966 }
1967 signal_id = g_signal_lookup (info->signal_name, TUMBLER_TYPE_EXPORTED_SERVICE);
1968 g_value_init (&return_value, G_TYPE_BOOLEAN);
1969 g_signal_emitv (paramv, signal_id, 0, &return_value);
1970 if (!g_value_get_boolean (&return_value))
1971 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);
1972 g_value_unset (&return_value);
1973 for (n = 0; n < num_params + num_extra; n++)
1974 g_value_unset (¶mv[n]);
1975 g_free (paramv);
1976 }
1977
1978 static GVariant *
_tumbler_exported_service_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)1979 _tumbler_exported_service_skeleton_handle_get_property (
1980 GDBusConnection *connection G_GNUC_UNUSED,
1981 const gchar *sender G_GNUC_UNUSED,
1982 const gchar *object_path G_GNUC_UNUSED,
1983 const gchar *interface_name G_GNUC_UNUSED,
1984 const gchar *property_name,
1985 GError **error,
1986 gpointer user_data)
1987 {
1988 TumblerExportedServiceSkeleton *skeleton = TUMBLER_EXPORTED_SERVICE_SKELETON (user_data);
1989 GValue value = G_VALUE_INIT;
1990 GParamSpec *pspec;
1991 _ExtendedGDBusPropertyInfo *info;
1992 GVariant *ret;
1993 ret = NULL;
1994 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_tumbler_exported_service_interface_info.parent_struct, property_name);
1995 g_assert (info != NULL);
1996 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1997 if (pspec == NULL)
1998 {
1999 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
2000 }
2001 else
2002 {
2003 g_value_init (&value, pspec->value_type);
2004 g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
2005 ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
2006 g_value_unset (&value);
2007 }
2008 return ret;
2009 }
2010
2011 static gboolean
_tumbler_exported_service_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)2012 _tumbler_exported_service_skeleton_handle_set_property (
2013 GDBusConnection *connection G_GNUC_UNUSED,
2014 const gchar *sender G_GNUC_UNUSED,
2015 const gchar *object_path G_GNUC_UNUSED,
2016 const gchar *interface_name G_GNUC_UNUSED,
2017 const gchar *property_name,
2018 GVariant *variant,
2019 GError **error,
2020 gpointer user_data)
2021 {
2022 TumblerExportedServiceSkeleton *skeleton = TUMBLER_EXPORTED_SERVICE_SKELETON (user_data);
2023 GValue value = G_VALUE_INIT;
2024 GParamSpec *pspec;
2025 _ExtendedGDBusPropertyInfo *info;
2026 gboolean ret;
2027 ret = FALSE;
2028 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_tumbler_exported_service_interface_info.parent_struct, property_name);
2029 g_assert (info != NULL);
2030 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
2031 if (pspec == NULL)
2032 {
2033 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
2034 }
2035 else
2036 {
2037 if (info->use_gvariant)
2038 g_value_set_variant (&value, variant);
2039 else
2040 g_dbus_gvariant_to_gvalue (variant, &value);
2041 g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
2042 g_value_unset (&value);
2043 ret = TRUE;
2044 }
2045 return ret;
2046 }
2047
2048 static const GDBusInterfaceVTable _tumbler_exported_service_skeleton_vtable =
2049 {
2050 _tumbler_exported_service_skeleton_handle_method_call,
2051 _tumbler_exported_service_skeleton_handle_get_property,
2052 _tumbler_exported_service_skeleton_handle_set_property,
2053 {NULL}
2054 };
2055
2056 static GDBusInterfaceInfo *
tumbler_exported_service_skeleton_dbus_interface_get_info(GDBusInterfaceSkeleton * skeleton G_GNUC_UNUSED)2057 tumbler_exported_service_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
2058 {
2059 return tumbler_exported_service_interface_info ();
2060 }
2061
2062 static GDBusInterfaceVTable *
tumbler_exported_service_skeleton_dbus_interface_get_vtable(GDBusInterfaceSkeleton * skeleton G_GNUC_UNUSED)2063 tumbler_exported_service_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
2064 {
2065 return (GDBusInterfaceVTable *) &_tumbler_exported_service_skeleton_vtable;
2066 }
2067
2068 static GVariant *
tumbler_exported_service_skeleton_dbus_interface_get_properties(GDBusInterfaceSkeleton * _skeleton)2069 tumbler_exported_service_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
2070 {
2071 TumblerExportedServiceSkeleton *skeleton = TUMBLER_EXPORTED_SERVICE_SKELETON (_skeleton);
2072
2073 GVariantBuilder builder;
2074 guint n;
2075 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
2076 if (_tumbler_exported_service_interface_info.parent_struct.properties == NULL)
2077 goto out;
2078 for (n = 0; _tumbler_exported_service_interface_info.parent_struct.properties[n] != NULL; n++)
2079 {
2080 GDBusPropertyInfo *info = _tumbler_exported_service_interface_info.parent_struct.properties[n];
2081 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
2082 {
2083 GVariant *value;
2084 value = _tumbler_exported_service_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.Thumbnailer1", info->name, NULL, skeleton);
2085 if (value != NULL)
2086 {
2087 g_variant_take_ref (value);
2088 g_variant_builder_add (&builder, "{sv}", info->name, value);
2089 g_variant_unref (value);
2090 }
2091 }
2092 }
2093 out:
2094 return g_variant_builder_end (&builder);
2095 }
2096
2097 static void
tumbler_exported_service_skeleton_dbus_interface_flush(GDBusInterfaceSkeleton * _skeleton)2098 tumbler_exported_service_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
2099 {
2100 }
2101
2102 static void
_tumbler_exported_service_on_signal_started(TumblerExportedService * object,guint arg_handle)2103 _tumbler_exported_service_on_signal_started (
2104 TumblerExportedService *object,
2105 guint arg_handle)
2106 {
2107 TumblerExportedServiceSkeleton *skeleton = TUMBLER_EXPORTED_SERVICE_SKELETON (object);
2108
2109 GList *connections, *l;
2110 GVariant *signal_variant;
2111 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
2112
2113 signal_variant = g_variant_ref_sink (g_variant_new ("(u)",
2114 arg_handle));
2115 for (l = connections; l != NULL; l = l->next)
2116 {
2117 GDBusConnection *connection = l->data;
2118 g_dbus_connection_emit_signal (connection,
2119 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.thumbnails.Thumbnailer1", "Started",
2120 signal_variant, NULL);
2121 }
2122 g_variant_unref (signal_variant);
2123 g_list_free_full (connections, g_object_unref);
2124 }
2125
2126 static void
_tumbler_exported_service_on_signal_finished(TumblerExportedService * object,guint arg_handle)2127 _tumbler_exported_service_on_signal_finished (
2128 TumblerExportedService *object,
2129 guint arg_handle)
2130 {
2131 TumblerExportedServiceSkeleton *skeleton = TUMBLER_EXPORTED_SERVICE_SKELETON (object);
2132
2133 GList *connections, *l;
2134 GVariant *signal_variant;
2135 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
2136
2137 signal_variant = g_variant_ref_sink (g_variant_new ("(u)",
2138 arg_handle));
2139 for (l = connections; l != NULL; l = l->next)
2140 {
2141 GDBusConnection *connection = l->data;
2142 g_dbus_connection_emit_signal (connection,
2143 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.thumbnails.Thumbnailer1", "Finished",
2144 signal_variant, NULL);
2145 }
2146 g_variant_unref (signal_variant);
2147 g_list_free_full (connections, g_object_unref);
2148 }
2149
2150 static void
_tumbler_exported_service_on_signal_ready(TumblerExportedService * object,guint arg_handle,const gchar * const * arg_uris)2151 _tumbler_exported_service_on_signal_ready (
2152 TumblerExportedService *object,
2153 guint arg_handle,
2154 const gchar *const *arg_uris)
2155 {
2156 TumblerExportedServiceSkeleton *skeleton = TUMBLER_EXPORTED_SERVICE_SKELETON (object);
2157
2158 GList *connections, *l;
2159 GVariant *signal_variant;
2160 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
2161
2162 signal_variant = g_variant_ref_sink (g_variant_new ("(u^as)",
2163 arg_handle,
2164 arg_uris));
2165 for (l = connections; l != NULL; l = l->next)
2166 {
2167 GDBusConnection *connection = l->data;
2168 g_dbus_connection_emit_signal (connection,
2169 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.thumbnails.Thumbnailer1", "Ready",
2170 signal_variant, NULL);
2171 }
2172 g_variant_unref (signal_variant);
2173 g_list_free_full (connections, g_object_unref);
2174 }
2175
2176 static void
_tumbler_exported_service_on_signal_error(TumblerExportedService * object,guint arg_handle,const gchar * const * arg_failed_uris,gint arg_error_code,const gchar * arg_message)2177 _tumbler_exported_service_on_signal_error (
2178 TumblerExportedService *object,
2179 guint arg_handle,
2180 const gchar *const *arg_failed_uris,
2181 gint arg_error_code,
2182 const gchar *arg_message)
2183 {
2184 TumblerExportedServiceSkeleton *skeleton = TUMBLER_EXPORTED_SERVICE_SKELETON (object);
2185
2186 GList *connections, *l;
2187 GVariant *signal_variant;
2188 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
2189
2190 signal_variant = g_variant_ref_sink (g_variant_new ("(u^asis)",
2191 arg_handle,
2192 arg_failed_uris,
2193 arg_error_code,
2194 arg_message));
2195 for (l = connections; l != NULL; l = l->next)
2196 {
2197 GDBusConnection *connection = l->data;
2198 g_dbus_connection_emit_signal (connection,
2199 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.thumbnails.Thumbnailer1", "Error",
2200 signal_variant, NULL);
2201 }
2202 g_variant_unref (signal_variant);
2203 g_list_free_full (connections, g_object_unref);
2204 }
2205
2206 static void tumbler_exported_service_skeleton_iface_init (TumblerExportedServiceIface *iface);
2207 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE(TumblerExportedServiceSkeleton,tumbler_exported_service_skeleton,G_TYPE_DBUS_INTERFACE_SKELETON,G_ADD_PRIVATE (TumblerExportedServiceSkeleton)G_IMPLEMENT_INTERFACE (TUMBLER_TYPE_EXPORTED_SERVICE,tumbler_exported_service_skeleton_iface_init))2208 G_DEFINE_TYPE_WITH_CODE (TumblerExportedServiceSkeleton, tumbler_exported_service_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
2209 G_ADD_PRIVATE (TumblerExportedServiceSkeleton)
2210 G_IMPLEMENT_INTERFACE (TUMBLER_TYPE_EXPORTED_SERVICE, tumbler_exported_service_skeleton_iface_init))
2211
2212 #else
2213 G_DEFINE_TYPE_WITH_CODE (TumblerExportedServiceSkeleton, tumbler_exported_service_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
2214 G_IMPLEMENT_INTERFACE (TUMBLER_TYPE_EXPORTED_SERVICE, tumbler_exported_service_skeleton_iface_init))
2215
2216 #endif
2217 static void
2218 tumbler_exported_service_skeleton_finalize (GObject *object)
2219 {
2220 TumblerExportedServiceSkeleton *skeleton = TUMBLER_EXPORTED_SERVICE_SKELETON (object);
2221 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
2222 if (skeleton->priv->changed_properties_idle_source != NULL)
2223 g_source_destroy (skeleton->priv->changed_properties_idle_source);
2224 g_main_context_unref (skeleton->priv->context);
2225 g_mutex_clear (&skeleton->priv->lock);
2226 G_OBJECT_CLASS (tumbler_exported_service_skeleton_parent_class)->finalize (object);
2227 }
2228
2229 static void
tumbler_exported_service_skeleton_init(TumblerExportedServiceSkeleton * skeleton)2230 tumbler_exported_service_skeleton_init (TumblerExportedServiceSkeleton *skeleton)
2231 {
2232 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2233 skeleton->priv = tumbler_exported_service_skeleton_get_instance_private (skeleton);
2234 #else
2235 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TUMBLER_TYPE_EXPORTED_SERVICE_SKELETON, TumblerExportedServiceSkeletonPrivate);
2236 #endif
2237
2238 g_mutex_init (&skeleton->priv->lock);
2239 skeleton->priv->context = g_main_context_ref_thread_default ();
2240 }
2241
2242 static void
tumbler_exported_service_skeleton_class_init(TumblerExportedServiceSkeletonClass * klass)2243 tumbler_exported_service_skeleton_class_init (TumblerExportedServiceSkeletonClass *klass)
2244 {
2245 GObjectClass *gobject_class;
2246 GDBusInterfaceSkeletonClass *skeleton_class;
2247
2248 gobject_class = G_OBJECT_CLASS (klass);
2249 gobject_class->finalize = tumbler_exported_service_skeleton_finalize;
2250
2251 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
2252 skeleton_class->get_info = tumbler_exported_service_skeleton_dbus_interface_get_info;
2253 skeleton_class->get_properties = tumbler_exported_service_skeleton_dbus_interface_get_properties;
2254 skeleton_class->flush = tumbler_exported_service_skeleton_dbus_interface_flush;
2255 skeleton_class->get_vtable = tumbler_exported_service_skeleton_dbus_interface_get_vtable;
2256
2257 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
2258 g_type_class_add_private (klass, sizeof (TumblerExportedServiceSkeletonPrivate));
2259 #endif
2260 }
2261
2262 static void
tumbler_exported_service_skeleton_iface_init(TumblerExportedServiceIface * iface)2263 tumbler_exported_service_skeleton_iface_init (TumblerExportedServiceIface *iface)
2264 {
2265 iface->started = _tumbler_exported_service_on_signal_started;
2266 iface->finished = _tumbler_exported_service_on_signal_finished;
2267 iface->ready = _tumbler_exported_service_on_signal_ready;
2268 iface->error = _tumbler_exported_service_on_signal_error;
2269 }
2270
2271 /**
2272 * tumbler_exported_service_skeleton_new:
2273 *
2274 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-thumbnails-Thumbnailer1.top_of_page">org.freedesktop.thumbnails.Thumbnailer1</link>.
2275 *
2276 * Returns: (transfer full) (type TumblerExportedServiceSkeleton): The skeleton object.
2277 */
2278 TumblerExportedService *
tumbler_exported_service_skeleton_new(void)2279 tumbler_exported_service_skeleton_new (void)
2280 {
2281 return TUMBLER_EXPORTED_SERVICE (g_object_new (TUMBLER_TYPE_EXPORTED_SERVICE_SKELETON, NULL));
2282 }
2283
2284