44e8978943c422f49663f8636848671656dd7ef0
[systembsd.git] / src / interfaces / timedated / timedated-gen.c
1 /*
2 * Generated by gdbus-codegen 2.40.0. DO NOT EDIT.
3 *
4 * The license of this code is the same as for the source it was derived from.
5 */
6
7 #ifdef HAVE_CONFIG_H
8 # include "config.h"
9 #endif
10
11 #include "timedated-gen.h"
12
13 #include <string.h>
14 #ifdef G_OS_UNIX
15 # include <gio/gunixfdlist.h>
16 #endif
17
18 typedef struct
19 {
20 GDBusArgInfo parent_struct;
21 gboolean use_gvariant;
22 } _ExtendedGDBusArgInfo;
23
24 typedef struct
25 {
26 GDBusMethodInfo parent_struct;
27 const gchar *signal_name;
28 gboolean pass_fdlist;
29 } _ExtendedGDBusMethodInfo;
30
31 typedef struct
32 {
33 GDBusSignalInfo parent_struct;
34 const gchar *signal_name;
35 } _ExtendedGDBusSignalInfo;
36
37 typedef struct
38 {
39 GDBusPropertyInfo parent_struct;
40 const gchar *hyphen_name;
41 gboolean use_gvariant;
42 } _ExtendedGDBusPropertyInfo;
43
44 typedef struct
45 {
46 GDBusInterfaceInfo parent_struct;
47 const gchar *hyphen_name;
48 } _ExtendedGDBusInterfaceInfo;
49
50 typedef struct
51 {
52 const _ExtendedGDBusPropertyInfo *info;
53 guint prop_id;
54 GValue orig_value; /* the value before the change */
55 } ChangedProperty;
56
57 static void
58 _changed_property_free (ChangedProperty *data)
59 {
60 g_value_unset (&data->orig_value);
61 g_free (data);
62 }
63
64 static gboolean
65 _g_strv_equal0 (gchar **a, gchar **b)
66 {
67 gboolean ret = FALSE;
68 guint n;
69 if (a == NULL && b == NULL)
70 {
71 ret = TRUE;
72 goto out;
73 }
74 if (a == NULL || b == NULL)
75 goto out;
76 if (g_strv_length (a) != g_strv_length (b))
77 goto out;
78 for (n = 0; a[n] != NULL; n++)
79 if (g_strcmp0 (a[n], b[n]) != 0)
80 goto out;
81 ret = TRUE;
82 out:
83 return ret;
84 }
85
86 static gboolean
87 _g_variant_equal0 (GVariant *a, GVariant *b)
88 {
89 gboolean ret = FALSE;
90 if (a == NULL && b == NULL)
91 {
92 ret = TRUE;
93 goto out;
94 }
95 if (a == NULL || b == NULL)
96 goto out;
97 ret = g_variant_equal (a, b);
98 out:
99 return ret;
100 }
101
102 G_GNUC_UNUSED static gboolean
103 _g_value_equal (const GValue *a, const GValue *b)
104 {
105 gboolean ret = FALSE;
106 g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
107 switch (G_VALUE_TYPE (a))
108 {
109 case G_TYPE_BOOLEAN:
110 ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
111 break;
112 case G_TYPE_UCHAR:
113 ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
114 break;
115 case G_TYPE_INT:
116 ret = (g_value_get_int (a) == g_value_get_int (b));
117 break;
118 case G_TYPE_UINT:
119 ret = (g_value_get_uint (a) == g_value_get_uint (b));
120 break;
121 case G_TYPE_INT64:
122 ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
123 break;
124 case G_TYPE_UINT64:
125 ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
126 break;
127 case G_TYPE_DOUBLE:
128 {
129 /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
130 gdouble da = g_value_get_double (a);
131 gdouble db = g_value_get_double (b);
132 ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
133 }
134 break;
135 case G_TYPE_STRING:
136 ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
137 break;
138 case G_TYPE_VARIANT:
139 ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
140 break;
141 default:
142 if (G_VALUE_TYPE (a) == G_TYPE_STRV)
143 ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
144 else
145 g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
146 break;
147 }
148 return ret;
149 }
150
151 /* ------------------------------------------------------------------------
152 * Code for interface org.freedesktop.timedate1
153 * ------------------------------------------------------------------------
154 */
155
156 /**
157 * SECTION:timedatedTimedate1
158 * @title: timedatedTimedate1
159 * @short_description: Generated C code for the org.freedesktop.timedate1 D-Bus interface
160 *
161 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link> D-Bus interface in C.
162 */
163
164 /* ---- Introspection data for org.freedesktop.timedate1 ---- */
165
166 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_time_IN_ARG_unnamed_arg0 =
167 {
168 {
169 -1,
170 (gchar *) "unnamed_arg0",
171 (gchar *) "x",
172 NULL
173 },
174 FALSE
175 };
176
177 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_time_IN_ARG_unnamed_arg1 =
178 {
179 {
180 -1,
181 (gchar *) "unnamed_arg1",
182 (gchar *) "b",
183 NULL
184 },
185 FALSE
186 };
187
188 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_time_IN_ARG_unnamed_arg2 =
189 {
190 {
191 -1,
192 (gchar *) "unnamed_arg2",
193 (gchar *) "b",
194 NULL
195 },
196 FALSE
197 };
198
199 static const _ExtendedGDBusArgInfo * const _timedated_timedate1_method_info_set_time_IN_ARG_pointers[] =
200 {
201 &_timedated_timedate1_method_info_set_time_IN_ARG_unnamed_arg0,
202 &_timedated_timedate1_method_info_set_time_IN_ARG_unnamed_arg1,
203 &_timedated_timedate1_method_info_set_time_IN_ARG_unnamed_arg2,
204 NULL
205 };
206
207 static const _ExtendedGDBusMethodInfo _timedated_timedate1_method_info_set_time =
208 {
209 {
210 -1,
211 (gchar *) "SetTime",
212 (GDBusArgInfo **) &_timedated_timedate1_method_info_set_time_IN_ARG_pointers,
213 NULL,
214 NULL
215 },
216 "handle-set-time",
217 FALSE
218 };
219
220 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_timezone_IN_ARG_unnamed_arg0 =
221 {
222 {
223 -1,
224 (gchar *) "unnamed_arg0",
225 (gchar *) "s",
226 NULL
227 },
228 FALSE
229 };
230
231 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_timezone_IN_ARG_unnamed_arg1 =
232 {
233 {
234 -1,
235 (gchar *) "unnamed_arg1",
236 (gchar *) "b",
237 NULL
238 },
239 FALSE
240 };
241
242 static const _ExtendedGDBusArgInfo * const _timedated_timedate1_method_info_set_timezone_IN_ARG_pointers[] =
243 {
244 &_timedated_timedate1_method_info_set_timezone_IN_ARG_unnamed_arg0,
245 &_timedated_timedate1_method_info_set_timezone_IN_ARG_unnamed_arg1,
246 NULL
247 };
248
249 static const _ExtendedGDBusMethodInfo _timedated_timedate1_method_info_set_timezone =
250 {
251 {
252 -1,
253 (gchar *) "SetTimezone",
254 (GDBusArgInfo **) &_timedated_timedate1_method_info_set_timezone_IN_ARG_pointers,
255 NULL,
256 NULL
257 },
258 "handle-set-timezone",
259 FALSE
260 };
261
262 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_local_rtc_IN_ARG_unnamed_arg0 =
263 {
264 {
265 -1,
266 (gchar *) "unnamed_arg0",
267 (gchar *) "b",
268 NULL
269 },
270 FALSE
271 };
272
273 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_local_rtc_IN_ARG_unnamed_arg1 =
274 {
275 {
276 -1,
277 (gchar *) "unnamed_arg1",
278 (gchar *) "b",
279 NULL
280 },
281 FALSE
282 };
283
284 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_local_rtc_IN_ARG_unnamed_arg2 =
285 {
286 {
287 -1,
288 (gchar *) "unnamed_arg2",
289 (gchar *) "b",
290 NULL
291 },
292 FALSE
293 };
294
295 static const _ExtendedGDBusArgInfo * const _timedated_timedate1_method_info_set_local_rtc_IN_ARG_pointers[] =
296 {
297 &_timedated_timedate1_method_info_set_local_rtc_IN_ARG_unnamed_arg0,
298 &_timedated_timedate1_method_info_set_local_rtc_IN_ARG_unnamed_arg1,
299 &_timedated_timedate1_method_info_set_local_rtc_IN_ARG_unnamed_arg2,
300 NULL
301 };
302
303 static const _ExtendedGDBusMethodInfo _timedated_timedate1_method_info_set_local_rtc =
304 {
305 {
306 -1,
307 (gchar *) "SetLocalRTC",
308 (GDBusArgInfo **) &_timedated_timedate1_method_info_set_local_rtc_IN_ARG_pointers,
309 NULL,
310 NULL
311 },
312 "handle-set-local-rtc",
313 FALSE
314 };
315
316 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_ntp_IN_ARG_unnamed_arg0 =
317 {
318 {
319 -1,
320 (gchar *) "unnamed_arg0",
321 (gchar *) "b",
322 NULL
323 },
324 FALSE
325 };
326
327 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_ntp_IN_ARG_unnamed_arg1 =
328 {
329 {
330 -1,
331 (gchar *) "unnamed_arg1",
332 (gchar *) "b",
333 NULL
334 },
335 FALSE
336 };
337
338 static const _ExtendedGDBusArgInfo * const _timedated_timedate1_method_info_set_ntp_IN_ARG_pointers[] =
339 {
340 &_timedated_timedate1_method_info_set_ntp_IN_ARG_unnamed_arg0,
341 &_timedated_timedate1_method_info_set_ntp_IN_ARG_unnamed_arg1,
342 NULL
343 };
344
345 static const _ExtendedGDBusMethodInfo _timedated_timedate1_method_info_set_ntp =
346 {
347 {
348 -1,
349 (gchar *) "SetNTP",
350 (GDBusArgInfo **) &_timedated_timedate1_method_info_set_ntp_IN_ARG_pointers,
351 NULL,
352 NULL
353 },
354 "handle-set-ntp",
355 FALSE
356 };
357
358 static const _ExtendedGDBusMethodInfo * const _timedated_timedate1_method_info_pointers[] =
359 {
360 &_timedated_timedate1_method_info_set_time,
361 &_timedated_timedate1_method_info_set_timezone,
362 &_timedated_timedate1_method_info_set_local_rtc,
363 &_timedated_timedate1_method_info_set_ntp,
364 NULL
365 };
366
367 static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_timezone =
368 {
369 {
370 -1,
371 (gchar *) "Timezone",
372 (gchar *) "s",
373 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
374 NULL
375 },
376 "timezone",
377 FALSE
378 };
379
380 static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_local_rtc =
381 {
382 {
383 -1,
384 (gchar *) "LocalRTC",
385 (gchar *) "b",
386 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
387 NULL
388 },
389 "local-rtc",
390 FALSE
391 };
392
393 static const GDBusAnnotationInfo _timedated_timedate1_property_can_ntp_annotation_info_0 =
394 {
395 -1,
396 (gchar *) "org.freedesktop.DBus.Property.EmitsChangedSignal",
397 (gchar *) "false",
398 NULL
399 };
400
401 static const GDBusAnnotationInfo * const _timedated_timedate1_property_can_ntp_annotation_info_pointers[] =
402 {
403 &_timedated_timedate1_property_can_ntp_annotation_info_0,
404 NULL
405 };
406
407 static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_can_ntp =
408 {
409 {
410 -1,
411 (gchar *) "CanNTP",
412 (gchar *) "b",
413 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
414 (GDBusAnnotationInfo **) &_timedated_timedate1_property_can_ntp_annotation_info_pointers
415 },
416 "can-ntp",
417 FALSE
418 };
419
420 static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_ntp =
421 {
422 {
423 -1,
424 (gchar *) "NTP",
425 (gchar *) "b",
426 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
427 NULL
428 },
429 "ntp",
430 FALSE
431 };
432
433 static const GDBusAnnotationInfo _timedated_timedate1_property_ntpsynchronized_annotation_info_0 =
434 {
435 -1,
436 (gchar *) "org.freedesktop.DBus.Property.EmitsChangedSignal",
437 (gchar *) "false",
438 NULL
439 };
440
441 static const GDBusAnnotationInfo * const _timedated_timedate1_property_ntpsynchronized_annotation_info_pointers[] =
442 {
443 &_timedated_timedate1_property_ntpsynchronized_annotation_info_0,
444 NULL
445 };
446
447 static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_ntpsynchronized =
448 {
449 {
450 -1,
451 (gchar *) "NTPSynchronized",
452 (gchar *) "b",
453 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
454 (GDBusAnnotationInfo **) &_timedated_timedate1_property_ntpsynchronized_annotation_info_pointers
455 },
456 "ntpsynchronized",
457 FALSE
458 };
459
460 static const GDBusAnnotationInfo _timedated_timedate1_property_time_usec_annotation_info_0 =
461 {
462 -1,
463 (gchar *) "org.freedesktop.DBus.Property.EmitsChangedSignal",
464 (gchar *) "false",
465 NULL
466 };
467
468 static const GDBusAnnotationInfo * const _timedated_timedate1_property_time_usec_annotation_info_pointers[] =
469 {
470 &_timedated_timedate1_property_time_usec_annotation_info_0,
471 NULL
472 };
473
474 static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_time_usec =
475 {
476 {
477 -1,
478 (gchar *) "TimeUSec",
479 (gchar *) "t",
480 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
481 (GDBusAnnotationInfo **) &_timedated_timedate1_property_time_usec_annotation_info_pointers
482 },
483 "time-usec",
484 FALSE
485 };
486
487 static const GDBusAnnotationInfo _timedated_timedate1_property_rtctime_usec_annotation_info_0 =
488 {
489 -1,
490 (gchar *) "org.freedesktop.DBus.Property.EmitsChangedSignal",
491 (gchar *) "false",
492 NULL
493 };
494
495 static const GDBusAnnotationInfo * const _timedated_timedate1_property_rtctime_usec_annotation_info_pointers[] =
496 {
497 &_timedated_timedate1_property_rtctime_usec_annotation_info_0,
498 NULL
499 };
500
501 static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_rtctime_usec =
502 {
503 {
504 -1,
505 (gchar *) "RTCTimeUSec",
506 (gchar *) "t",
507 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
508 (GDBusAnnotationInfo **) &_timedated_timedate1_property_rtctime_usec_annotation_info_pointers
509 },
510 "rtctime-usec",
511 FALSE
512 };
513
514 static const _ExtendedGDBusPropertyInfo * const _timedated_timedate1_property_info_pointers[] =
515 {
516 &_timedated_timedate1_property_info_timezone,
517 &_timedated_timedate1_property_info_local_rtc,
518 &_timedated_timedate1_property_info_can_ntp,
519 &_timedated_timedate1_property_info_ntp,
520 &_timedated_timedate1_property_info_ntpsynchronized,
521 &_timedated_timedate1_property_info_time_usec,
522 &_timedated_timedate1_property_info_rtctime_usec,
523 NULL
524 };
525
526 static const _ExtendedGDBusInterfaceInfo _timedated_timedate1_interface_info =
527 {
528 {
529 -1,
530 (gchar *) "org.freedesktop.timedate1",
531 (GDBusMethodInfo **) &_timedated_timedate1_method_info_pointers,
532 NULL,
533 (GDBusPropertyInfo **) &_timedated_timedate1_property_info_pointers,
534 NULL
535 },
536 "timedate1",
537 };
538
539
540 /**
541 * timedated_timedate1_interface_info:
542 *
543 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link> D-Bus interface.
544 *
545 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
546 */
547 GDBusInterfaceInfo *
548 timedated_timedate1_interface_info (void)
549 {
550 return (GDBusInterfaceInfo *) &_timedated_timedate1_interface_info.parent_struct;
551 }
552
553 /**
554 * timedated_timedate1_override_properties:
555 * @klass: The class structure for a #GObject<!-- -->-derived class.
556 * @property_id_begin: The property id to assign to the first overridden property.
557 *
558 * Overrides all #GObject properties in the #timedatedTimedate1 interface for a concrete class.
559 * The properties are overridden in the order they are defined.
560 *
561 * Returns: The last property id.
562 */
563 guint
564 timedated_timedate1_override_properties (GObjectClass *klass, guint property_id_begin)
565 {
566 g_object_class_override_property (klass, property_id_begin++, "timezone");
567 g_object_class_override_property (klass, property_id_begin++, "local-rtc");
568 g_object_class_override_property (klass, property_id_begin++, "can-ntp");
569 g_object_class_override_property (klass, property_id_begin++, "ntp");
570 g_object_class_override_property (klass, property_id_begin++, "ntpsynchronized");
571 g_object_class_override_property (klass, property_id_begin++, "time-usec");
572 g_object_class_override_property (klass, property_id_begin++, "rtctime-usec");
573 return property_id_begin - 1;
574 }
575
576
577
578 /**
579 * timedatedTimedate1:
580 *
581 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link>.
582 */
583
584 /**
585 * timedatedTimedate1Iface:
586 * @parent_iface: The parent interface.
587 * @handle_set_local_rtc: Handler for the #timedatedTimedate1::handle-set-local-rtc signal.
588 * @handle_set_ntp: Handler for the #timedatedTimedate1::handle-set-ntp signal.
589 * @handle_set_time: Handler for the #timedatedTimedate1::handle-set-time signal.
590 * @handle_set_timezone: Handler for the #timedatedTimedate1::handle-set-timezone signal.
591 * @get_can_ntp: Getter for the #timedatedTimedate1:can-ntp property.
592 * @get_local_rtc: Getter for the #timedatedTimedate1:local-rtc property.
593 * @get_ntp: Getter for the #timedatedTimedate1:ntp property.
594 * @get_ntpsynchronized: Getter for the #timedatedTimedate1:ntpsynchronized property.
595 * @get_rtctime_usec: Getter for the #timedatedTimedate1:rtctime-usec property.
596 * @get_time_usec: Getter for the #timedatedTimedate1:time-usec property.
597 * @get_timezone: Getter for the #timedatedTimedate1:timezone property.
598 *
599 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link>.
600 */
601
602 typedef timedatedTimedate1Iface timedatedTimedate1Interface;
603 G_DEFINE_INTERFACE (timedatedTimedate1, timedated_timedate1, G_TYPE_OBJECT);
604
605 static void
606 timedated_timedate1_default_init (timedatedTimedate1Iface *iface)
607 {
608 /* GObject signals for incoming D-Bus method calls: */
609 /**
610 * timedatedTimedate1::handle-set-time:
611 * @object: A #timedatedTimedate1.
612 * @invocation: A #GDBusMethodInvocation.
613 * @arg_unnamed_arg0: Argument passed by remote caller.
614 * @arg_unnamed_arg1: Argument passed by remote caller.
615 * @arg_unnamed_arg2: Argument passed by remote caller.
616 *
617 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTime">SetTime()</link> D-Bus method.
618 *
619 * 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 timedated_timedate1_complete_set_time() 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.
620 *
621 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
622 */
623 g_signal_new ("handle-set-time",
624 G_TYPE_FROM_INTERFACE (iface),
625 G_SIGNAL_RUN_LAST,
626 G_STRUCT_OFFSET (timedatedTimedate1Iface, handle_set_time),
627 g_signal_accumulator_true_handled,
628 NULL,
629 g_cclosure_marshal_generic,
630 G_TYPE_BOOLEAN,
631 4,
632 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_INT64, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
633
634 /**
635 * timedatedTimedate1::handle-set-timezone:
636 * @object: A #timedatedTimedate1.
637 * @invocation: A #GDBusMethodInvocation.
638 * @arg_unnamed_arg0: Argument passed by remote caller.
639 * @arg_unnamed_arg1: Argument passed by remote caller.
640 *
641 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTimezone">SetTimezone()</link> D-Bus method.
642 *
643 * 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 timedated_timedate1_complete_set_timezone() 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.
644 *
645 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
646 */
647 g_signal_new ("handle-set-timezone",
648 G_TYPE_FROM_INTERFACE (iface),
649 G_SIGNAL_RUN_LAST,
650 G_STRUCT_OFFSET (timedatedTimedate1Iface, handle_set_timezone),
651 g_signal_accumulator_true_handled,
652 NULL,
653 g_cclosure_marshal_generic,
654 G_TYPE_BOOLEAN,
655 3,
656 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_BOOLEAN);
657
658 /**
659 * timedatedTimedate1::handle-set-local-rtc:
660 * @object: A #timedatedTimedate1.
661 * @invocation: A #GDBusMethodInvocation.
662 * @arg_unnamed_arg0: Argument passed by remote caller.
663 * @arg_unnamed_arg1: Argument passed by remote caller.
664 * @arg_unnamed_arg2: Argument passed by remote caller.
665 *
666 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-timedate1.SetLocalRTC">SetLocalRTC()</link> D-Bus method.
667 *
668 * 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 timedated_timedate1_complete_set_local_rtc() 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.
669 *
670 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
671 */
672 g_signal_new ("handle-set-local-rtc",
673 G_TYPE_FROM_INTERFACE (iface),
674 G_SIGNAL_RUN_LAST,
675 G_STRUCT_OFFSET (timedatedTimedate1Iface, handle_set_local_rtc),
676 g_signal_accumulator_true_handled,
677 NULL,
678 g_cclosure_marshal_generic,
679 G_TYPE_BOOLEAN,
680 4,
681 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
682
683 /**
684 * timedatedTimedate1::handle-set-ntp:
685 * @object: A #timedatedTimedate1.
686 * @invocation: A #GDBusMethodInvocation.
687 * @arg_unnamed_arg0: Argument passed by remote caller.
688 * @arg_unnamed_arg1: Argument passed by remote caller.
689 *
690 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-timedate1.SetNTP">SetNTP()</link> D-Bus method.
691 *
692 * 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 timedated_timedate1_complete_set_ntp() 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.
693 *
694 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
695 */
696 g_signal_new ("handle-set-ntp",
697 G_TYPE_FROM_INTERFACE (iface),
698 G_SIGNAL_RUN_LAST,
699 G_STRUCT_OFFSET (timedatedTimedate1Iface, handle_set_ntp),
700 g_signal_accumulator_true_handled,
701 NULL,
702 g_cclosure_marshal_generic,
703 G_TYPE_BOOLEAN,
704 3,
705 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
706
707 /* GObject properties for D-Bus properties: */
708 /**
709 * timedatedTimedate1:timezone:
710 *
711 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.Timezone">"Timezone"</link>.
712 *
713 * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
714 */
715 g_object_interface_install_property (iface,
716 g_param_spec_string ("timezone", "Timezone", "Timezone", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
717 /**
718 * timedatedTimedate1:local-rtc:
719 *
720 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.LocalRTC">"LocalRTC"</link>.
721 *
722 * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
723 */
724 g_object_interface_install_property (iface,
725 g_param_spec_boolean ("local-rtc", "LocalRTC", "LocalRTC", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
726 /**
727 * timedatedTimedate1:can-ntp:
728 *
729 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.CanNTP">"CanNTP"</link>.
730 *
731 * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
732 */
733 g_object_interface_install_property (iface,
734 g_param_spec_boolean ("can-ntp", "CanNTP", "CanNTP", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
735 /**
736 * timedatedTimedate1:ntp:
737 *
738 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.NTP">"NTP"</link>.
739 *
740 * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
741 */
742 g_object_interface_install_property (iface,
743 g_param_spec_boolean ("ntp", "NTP", "NTP", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
744 /**
745 * timedatedTimedate1:ntpsynchronized:
746 *
747 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.NTPSynchronized">"NTPSynchronized"</link>.
748 *
749 * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
750 */
751 g_object_interface_install_property (iface,
752 g_param_spec_boolean ("ntpsynchronized", "NTPSynchronized", "NTPSynchronized", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
753 /**
754 * timedatedTimedate1:time-usec:
755 *
756 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.TimeUSec">"TimeUSec"</link>.
757 *
758 * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
759 */
760 g_object_interface_install_property (iface,
761 g_param_spec_uint64 ("time-usec", "TimeUSec", "TimeUSec", 0, G_MAXUINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
762 /**
763 * timedatedTimedate1:rtctime-usec:
764 *
765 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.RTCTimeUSec">"RTCTimeUSec"</link>.
766 *
767 * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
768 */
769 g_object_interface_install_property (iface,
770 g_param_spec_uint64 ("rtctime-usec", "RTCTimeUSec", "RTCTimeUSec", 0, G_MAXUINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
771 }
772
773 /**
774 * timedated_timedate1_get_timezone: (skip)
775 * @object: A #timedatedTimedate1.
776 *
777 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.Timezone">"Timezone"</link> D-Bus property.
778 *
779 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
780 *
781 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use timedated_timedate1_dup_timezone() if on another thread.</warning>
782 *
783 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
784 */
785 const gchar *
786 timedated_timedate1_get_timezone (timedatedTimedate1 *object)
787 {
788 return TIMEDATED_TIMEDATE1_GET_IFACE (object)->get_timezone (object);
789 }
790
791 /**
792 * timedated_timedate1_dup_timezone: (skip)
793 * @object: A #timedatedTimedate1.
794 *
795 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-timedate1.Timezone">"Timezone"</link> D-Bus property.
796 *
797 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
798 *
799 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
800 */
801 gchar *
802 timedated_timedate1_dup_timezone (timedatedTimedate1 *object)
803 {
804 gchar *value;
805 g_object_get (G_OBJECT (object), "timezone", &value, NULL);
806 return value;
807 }
808
809 /**
810 * timedated_timedate1_set_timezone: (skip)
811 * @object: A #timedatedTimedate1.
812 * @value: The value to set.
813 *
814 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.Timezone">"Timezone"</link> D-Bus property to @value.
815 *
816 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
817 */
818 void
819 timedated_timedate1_set_timezone (timedatedTimedate1 *object, const gchar *value)
820 {
821 g_object_set (G_OBJECT (object), "timezone", value, NULL);
822 }
823
824 /**
825 * timedated_timedate1_get_local_rtc: (skip)
826 * @object: A #timedatedTimedate1.
827 *
828 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.LocalRTC">"LocalRTC"</link> D-Bus property.
829 *
830 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
831 *
832 * Returns: The property value.
833 */
834 gboolean
835 timedated_timedate1_get_local_rtc (timedatedTimedate1 *object)
836 {
837 return TIMEDATED_TIMEDATE1_GET_IFACE (object)->get_local_rtc (object);
838 }
839
840 /**
841 * timedated_timedate1_set_local_rtc: (skip)
842 * @object: A #timedatedTimedate1.
843 * @value: The value to set.
844 *
845 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.LocalRTC">"LocalRTC"</link> D-Bus property to @value.
846 *
847 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
848 */
849 void
850 timedated_timedate1_set_local_rtc (timedatedTimedate1 *object, gboolean value)
851 {
852 g_object_set (G_OBJECT (object), "local-rtc", value, NULL);
853 }
854
855 /**
856 * timedated_timedate1_get_can_ntp: (skip)
857 * @object: A #timedatedTimedate1.
858 *
859 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.CanNTP">"CanNTP"</link> D-Bus property.
860 *
861 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
862 *
863 * Returns: The property value.
864 */
865 gboolean
866 timedated_timedate1_get_can_ntp (timedatedTimedate1 *object)
867 {
868 return TIMEDATED_TIMEDATE1_GET_IFACE (object)->get_can_ntp (object);
869 }
870
871 /**
872 * timedated_timedate1_set_can_ntp: (skip)
873 * @object: A #timedatedTimedate1.
874 * @value: The value to set.
875 *
876 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.CanNTP">"CanNTP"</link> D-Bus property to @value.
877 *
878 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
879 */
880 void
881 timedated_timedate1_set_can_ntp (timedatedTimedate1 *object, gboolean value)
882 {
883 g_object_set (G_OBJECT (object), "can-ntp", value, NULL);
884 }
885
886 /**
887 * timedated_timedate1_get_ntp: (skip)
888 * @object: A #timedatedTimedate1.
889 *
890 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.NTP">"NTP"</link> D-Bus property.
891 *
892 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
893 *
894 * Returns: The property value.
895 */
896 gboolean
897 timedated_timedate1_get_ntp (timedatedTimedate1 *object)
898 {
899 return TIMEDATED_TIMEDATE1_GET_IFACE (object)->get_ntp (object);
900 }
901
902 /**
903 * timedated_timedate1_set_ntp: (skip)
904 * @object: A #timedatedTimedate1.
905 * @value: The value to set.
906 *
907 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.NTP">"NTP"</link> D-Bus property to @value.
908 *
909 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
910 */
911 void
912 timedated_timedate1_set_ntp (timedatedTimedate1 *object, gboolean value)
913 {
914 g_object_set (G_OBJECT (object), "ntp", value, NULL);
915 }
916
917 /**
918 * timedated_timedate1_get_ntpsynchronized: (skip)
919 * @object: A #timedatedTimedate1.
920 *
921 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.NTPSynchronized">"NTPSynchronized"</link> D-Bus property.
922 *
923 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
924 *
925 * Returns: The property value.
926 */
927 gboolean
928 timedated_timedate1_get_ntpsynchronized (timedatedTimedate1 *object)
929 {
930 return TIMEDATED_TIMEDATE1_GET_IFACE (object)->get_ntpsynchronized (object);
931 }
932
933 /**
934 * timedated_timedate1_set_ntpsynchronized: (skip)
935 * @object: A #timedatedTimedate1.
936 * @value: The value to set.
937 *
938 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.NTPSynchronized">"NTPSynchronized"</link> D-Bus property to @value.
939 *
940 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
941 */
942 void
943 timedated_timedate1_set_ntpsynchronized (timedatedTimedate1 *object, gboolean value)
944 {
945 g_object_set (G_OBJECT (object), "ntpsynchronized", value, NULL);
946 }
947
948 /**
949 * timedated_timedate1_get_time_usec: (skip)
950 * @object: A #timedatedTimedate1.
951 *
952 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.TimeUSec">"TimeUSec"</link> D-Bus property.
953 *
954 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
955 *
956 * Returns: The property value.
957 */
958 guint64
959 timedated_timedate1_get_time_usec (timedatedTimedate1 *object)
960 {
961 return TIMEDATED_TIMEDATE1_GET_IFACE (object)->get_time_usec (object);
962 }
963
964 /**
965 * timedated_timedate1_set_time_usec: (skip)
966 * @object: A #timedatedTimedate1.
967 * @value: The value to set.
968 *
969 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.TimeUSec">"TimeUSec"</link> D-Bus property to @value.
970 *
971 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
972 */
973 void
974 timedated_timedate1_set_time_usec (timedatedTimedate1 *object, guint64 value)
975 {
976 g_object_set (G_OBJECT (object), "time-usec", value, NULL);
977 }
978
979 /**
980 * timedated_timedate1_get_rtctime_usec: (skip)
981 * @object: A #timedatedTimedate1.
982 *
983 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.RTCTimeUSec">"RTCTimeUSec"</link> D-Bus property.
984 *
985 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
986 *
987 * Returns: The property value.
988 */
989 guint64
990 timedated_timedate1_get_rtctime_usec (timedatedTimedate1 *object)
991 {
992 return TIMEDATED_TIMEDATE1_GET_IFACE (object)->get_rtctime_usec (object);
993 }
994
995 /**
996 * timedated_timedate1_set_rtctime_usec: (skip)
997 * @object: A #timedatedTimedate1.
998 * @value: The value to set.
999 *
1000 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.RTCTimeUSec">"RTCTimeUSec"</link> D-Bus property to @value.
1001 *
1002 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1003 */
1004 void
1005 timedated_timedate1_set_rtctime_usec (timedatedTimedate1 *object, guint64 value)
1006 {
1007 g_object_set (G_OBJECT (object), "rtctime-usec", value, NULL);
1008 }
1009
1010 /**
1011 * timedated_timedate1_call_set_time:
1012 * @proxy: A #timedatedTimedate1Proxy.
1013 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1014 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1015 * @arg_unnamed_arg2: Argument to pass with the method invocation.
1016 * @cancellable: (allow-none): A #GCancellable or %NULL.
1017 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1018 * @user_data: User data to pass to @callback.
1019 *
1020 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTime">SetTime()</link> D-Bus method on @proxy.
1021 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1022 * You can then call timedated_timedate1_call_set_time_finish() to get the result of the operation.
1023 *
1024 * See timedated_timedate1_call_set_time_sync() for the synchronous, blocking version of this method.
1025 */
1026 void
1027 timedated_timedate1_call_set_time (
1028 timedatedTimedate1 *proxy,
1029 gint64 arg_unnamed_arg0,
1030 gboolean arg_unnamed_arg1,
1031 gboolean arg_unnamed_arg2,
1032 GCancellable *cancellable,
1033 GAsyncReadyCallback callback,
1034 gpointer user_data)
1035 {
1036 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1037 "SetTime",
1038 g_variant_new ("(xbb)",
1039 arg_unnamed_arg0,
1040 arg_unnamed_arg1,
1041 arg_unnamed_arg2),
1042 G_DBUS_CALL_FLAGS_NONE,
1043 -1,
1044 cancellable,
1045 callback,
1046 user_data);
1047 }
1048
1049 /**
1050 * timedated_timedate1_call_set_time_finish:
1051 * @proxy: A #timedatedTimedate1Proxy.
1052 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_timedate1_call_set_time().
1053 * @error: Return location for error or %NULL.
1054 *
1055 * Finishes an operation started with timedated_timedate1_call_set_time().
1056 *
1057 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1058 */
1059 gboolean
1060 timedated_timedate1_call_set_time_finish (
1061 timedatedTimedate1 *proxy,
1062 GAsyncResult *res,
1063 GError **error)
1064 {
1065 GVariant *_ret;
1066 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1067 if (_ret == NULL)
1068 goto _out;
1069 g_variant_get (_ret,
1070 "()");
1071 g_variant_unref (_ret);
1072 _out:
1073 return _ret != NULL;
1074 }
1075
1076 /**
1077 * timedated_timedate1_call_set_time_sync:
1078 * @proxy: A #timedatedTimedate1Proxy.
1079 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1080 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1081 * @arg_unnamed_arg2: Argument to pass with the method invocation.
1082 * @cancellable: (allow-none): A #GCancellable or %NULL.
1083 * @error: Return location for error or %NULL.
1084 *
1085 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTime">SetTime()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1086 *
1087 * See timedated_timedate1_call_set_time() for the asynchronous version of this method.
1088 *
1089 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1090 */
1091 gboolean
1092 timedated_timedate1_call_set_time_sync (
1093 timedatedTimedate1 *proxy,
1094 gint64 arg_unnamed_arg0,
1095 gboolean arg_unnamed_arg1,
1096 gboolean arg_unnamed_arg2,
1097 GCancellable *cancellable,
1098 GError **error)
1099 {
1100 GVariant *_ret;
1101 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1102 "SetTime",
1103 g_variant_new ("(xbb)",
1104 arg_unnamed_arg0,
1105 arg_unnamed_arg1,
1106 arg_unnamed_arg2),
1107 G_DBUS_CALL_FLAGS_NONE,
1108 -1,
1109 cancellable,
1110 error);
1111 if (_ret == NULL)
1112 goto _out;
1113 g_variant_get (_ret,
1114 "()");
1115 g_variant_unref (_ret);
1116 _out:
1117 return _ret != NULL;
1118 }
1119
1120 /**
1121 * timedated_timedate1_call_set_timezone:
1122 * @proxy: A #timedatedTimedate1Proxy.
1123 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1124 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1125 * @cancellable: (allow-none): A #GCancellable or %NULL.
1126 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1127 * @user_data: User data to pass to @callback.
1128 *
1129 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTimezone">SetTimezone()</link> D-Bus method on @proxy.
1130 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1131 * You can then call timedated_timedate1_call_set_timezone_finish() to get the result of the operation.
1132 *
1133 * See timedated_timedate1_call_set_timezone_sync() for the synchronous, blocking version of this method.
1134 */
1135 void
1136 timedated_timedate1_call_set_timezone (
1137 timedatedTimedate1 *proxy,
1138 const gchar *arg_unnamed_arg0,
1139 gboolean arg_unnamed_arg1,
1140 GCancellable *cancellable,
1141 GAsyncReadyCallback callback,
1142 gpointer user_data)
1143 {
1144 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1145 "SetTimezone",
1146 g_variant_new ("(sb)",
1147 arg_unnamed_arg0,
1148 arg_unnamed_arg1),
1149 G_DBUS_CALL_FLAGS_NONE,
1150 -1,
1151 cancellable,
1152 callback,
1153 user_data);
1154 }
1155
1156 /**
1157 * timedated_timedate1_call_set_timezone_finish:
1158 * @proxy: A #timedatedTimedate1Proxy.
1159 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_timedate1_call_set_timezone().
1160 * @error: Return location for error or %NULL.
1161 *
1162 * Finishes an operation started with timedated_timedate1_call_set_timezone().
1163 *
1164 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1165 */
1166 gboolean
1167 timedated_timedate1_call_set_timezone_finish (
1168 timedatedTimedate1 *proxy,
1169 GAsyncResult *res,
1170 GError **error)
1171 {
1172 GVariant *_ret;
1173 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1174 if (_ret == NULL)
1175 goto _out;
1176 g_variant_get (_ret,
1177 "()");
1178 g_variant_unref (_ret);
1179 _out:
1180 return _ret != NULL;
1181 }
1182
1183 /**
1184 * timedated_timedate1_call_set_timezone_sync:
1185 * @proxy: A #timedatedTimedate1Proxy.
1186 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1187 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1188 * @cancellable: (allow-none): A #GCancellable or %NULL.
1189 * @error: Return location for error or %NULL.
1190 *
1191 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTimezone">SetTimezone()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1192 *
1193 * See timedated_timedate1_call_set_timezone() for the asynchronous version of this method.
1194 *
1195 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1196 */
1197 gboolean
1198 timedated_timedate1_call_set_timezone_sync (
1199 timedatedTimedate1 *proxy,
1200 const gchar *arg_unnamed_arg0,
1201 gboolean arg_unnamed_arg1,
1202 GCancellable *cancellable,
1203 GError **error)
1204 {
1205 GVariant *_ret;
1206 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1207 "SetTimezone",
1208 g_variant_new ("(sb)",
1209 arg_unnamed_arg0,
1210 arg_unnamed_arg1),
1211 G_DBUS_CALL_FLAGS_NONE,
1212 -1,
1213 cancellable,
1214 error);
1215 if (_ret == NULL)
1216 goto _out;
1217 g_variant_get (_ret,
1218 "()");
1219 g_variant_unref (_ret);
1220 _out:
1221 return _ret != NULL;
1222 }
1223
1224 /**
1225 * timedated_timedate1_call_set_local_rtc:
1226 * @proxy: A #timedatedTimedate1Proxy.
1227 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1228 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1229 * @arg_unnamed_arg2: Argument to pass with the method invocation.
1230 * @cancellable: (allow-none): A #GCancellable or %NULL.
1231 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1232 * @user_data: User data to pass to @callback.
1233 *
1234 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetLocalRTC">SetLocalRTC()</link> D-Bus method on @proxy.
1235 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1236 * You can then call timedated_timedate1_call_set_local_rtc_finish() to get the result of the operation.
1237 *
1238 * See timedated_timedate1_call_set_local_rtc_sync() for the synchronous, blocking version of this method.
1239 */
1240 void
1241 timedated_timedate1_call_set_local_rtc (
1242 timedatedTimedate1 *proxy,
1243 gboolean arg_unnamed_arg0,
1244 gboolean arg_unnamed_arg1,
1245 gboolean arg_unnamed_arg2,
1246 GCancellable *cancellable,
1247 GAsyncReadyCallback callback,
1248 gpointer user_data)
1249 {
1250 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1251 "SetLocalRTC",
1252 g_variant_new ("(bbb)",
1253 arg_unnamed_arg0,
1254 arg_unnamed_arg1,
1255 arg_unnamed_arg2),
1256 G_DBUS_CALL_FLAGS_NONE,
1257 -1,
1258 cancellable,
1259 callback,
1260 user_data);
1261 }
1262
1263 /**
1264 * timedated_timedate1_call_set_local_rtc_finish:
1265 * @proxy: A #timedatedTimedate1Proxy.
1266 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_timedate1_call_set_local_rtc().
1267 * @error: Return location for error or %NULL.
1268 *
1269 * Finishes an operation started with timedated_timedate1_call_set_local_rtc().
1270 *
1271 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1272 */
1273 gboolean
1274 timedated_timedate1_call_set_local_rtc_finish (
1275 timedatedTimedate1 *proxy,
1276 GAsyncResult *res,
1277 GError **error)
1278 {
1279 GVariant *_ret;
1280 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1281 if (_ret == NULL)
1282 goto _out;
1283 g_variant_get (_ret,
1284 "()");
1285 g_variant_unref (_ret);
1286 _out:
1287 return _ret != NULL;
1288 }
1289
1290 /**
1291 * timedated_timedate1_call_set_local_rtc_sync:
1292 * @proxy: A #timedatedTimedate1Proxy.
1293 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1294 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1295 * @arg_unnamed_arg2: Argument to pass with the method invocation.
1296 * @cancellable: (allow-none): A #GCancellable or %NULL.
1297 * @error: Return location for error or %NULL.
1298 *
1299 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetLocalRTC">SetLocalRTC()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1300 *
1301 * See timedated_timedate1_call_set_local_rtc() for the asynchronous version of this method.
1302 *
1303 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1304 */
1305 gboolean
1306 timedated_timedate1_call_set_local_rtc_sync (
1307 timedatedTimedate1 *proxy,
1308 gboolean arg_unnamed_arg0,
1309 gboolean arg_unnamed_arg1,
1310 gboolean arg_unnamed_arg2,
1311 GCancellable *cancellable,
1312 GError **error)
1313 {
1314 GVariant *_ret;
1315 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1316 "SetLocalRTC",
1317 g_variant_new ("(bbb)",
1318 arg_unnamed_arg0,
1319 arg_unnamed_arg1,
1320 arg_unnamed_arg2),
1321 G_DBUS_CALL_FLAGS_NONE,
1322 -1,
1323 cancellable,
1324 error);
1325 if (_ret == NULL)
1326 goto _out;
1327 g_variant_get (_ret,
1328 "()");
1329 g_variant_unref (_ret);
1330 _out:
1331 return _ret != NULL;
1332 }
1333
1334 /**
1335 * timedated_timedate1_call_set_ntp:
1336 * @proxy: A #timedatedTimedate1Proxy.
1337 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1338 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1339 * @cancellable: (allow-none): A #GCancellable or %NULL.
1340 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1341 * @user_data: User data to pass to @callback.
1342 *
1343 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetNTP">SetNTP()</link> D-Bus method on @proxy.
1344 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1345 * You can then call timedated_timedate1_call_set_ntp_finish() to get the result of the operation.
1346 *
1347 * See timedated_timedate1_call_set_ntp_sync() for the synchronous, blocking version of this method.
1348 */
1349 void
1350 timedated_timedate1_call_set_ntp (
1351 timedatedTimedate1 *proxy,
1352 gboolean arg_unnamed_arg0,
1353 gboolean arg_unnamed_arg1,
1354 GCancellable *cancellable,
1355 GAsyncReadyCallback callback,
1356 gpointer user_data)
1357 {
1358 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1359 "SetNTP",
1360 g_variant_new ("(bb)",
1361 arg_unnamed_arg0,
1362 arg_unnamed_arg1),
1363 G_DBUS_CALL_FLAGS_NONE,
1364 -1,
1365 cancellable,
1366 callback,
1367 user_data);
1368 }
1369
1370 /**
1371 * timedated_timedate1_call_set_ntp_finish:
1372 * @proxy: A #timedatedTimedate1Proxy.
1373 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_timedate1_call_set_ntp().
1374 * @error: Return location for error or %NULL.
1375 *
1376 * Finishes an operation started with timedated_timedate1_call_set_ntp().
1377 *
1378 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1379 */
1380 gboolean
1381 timedated_timedate1_call_set_ntp_finish (
1382 timedatedTimedate1 *proxy,
1383 GAsyncResult *res,
1384 GError **error)
1385 {
1386 GVariant *_ret;
1387 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1388 if (_ret == NULL)
1389 goto _out;
1390 g_variant_get (_ret,
1391 "()");
1392 g_variant_unref (_ret);
1393 _out:
1394 return _ret != NULL;
1395 }
1396
1397 /**
1398 * timedated_timedate1_call_set_ntp_sync:
1399 * @proxy: A #timedatedTimedate1Proxy.
1400 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1401 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1402 * @cancellable: (allow-none): A #GCancellable or %NULL.
1403 * @error: Return location for error or %NULL.
1404 *
1405 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetNTP">SetNTP()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1406 *
1407 * See timedated_timedate1_call_set_ntp() for the asynchronous version of this method.
1408 *
1409 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1410 */
1411 gboolean
1412 timedated_timedate1_call_set_ntp_sync (
1413 timedatedTimedate1 *proxy,
1414 gboolean arg_unnamed_arg0,
1415 gboolean arg_unnamed_arg1,
1416 GCancellable *cancellable,
1417 GError **error)
1418 {
1419 GVariant *_ret;
1420 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1421 "SetNTP",
1422 g_variant_new ("(bb)",
1423 arg_unnamed_arg0,
1424 arg_unnamed_arg1),
1425 G_DBUS_CALL_FLAGS_NONE,
1426 -1,
1427 cancellable,
1428 error);
1429 if (_ret == NULL)
1430 goto _out;
1431 g_variant_get (_ret,
1432 "()");
1433 g_variant_unref (_ret);
1434 _out:
1435 return _ret != NULL;
1436 }
1437
1438 /**
1439 * timedated_timedate1_complete_set_time:
1440 * @object: A #timedatedTimedate1.
1441 * @invocation: (transfer full): A #GDBusMethodInvocation.
1442 *
1443 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTime">SetTime()</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.
1444 *
1445 * This method will free @invocation, you cannot use it afterwards.
1446 */
1447 void
1448 timedated_timedate1_complete_set_time (
1449 timedatedTimedate1 *object,
1450 GDBusMethodInvocation *invocation)
1451 {
1452 g_dbus_method_invocation_return_value (invocation,
1453 g_variant_new ("()"));
1454 }
1455
1456 /**
1457 * timedated_timedate1_complete_set_timezone:
1458 * @object: A #timedatedTimedate1.
1459 * @invocation: (transfer full): A #GDBusMethodInvocation.
1460 *
1461 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTimezone">SetTimezone()</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.
1462 *
1463 * This method will free @invocation, you cannot use it afterwards.
1464 */
1465 void
1466 timedated_timedate1_complete_set_timezone (
1467 timedatedTimedate1 *object,
1468 GDBusMethodInvocation *invocation)
1469 {
1470 g_dbus_method_invocation_return_value (invocation,
1471 g_variant_new ("()"));
1472 }
1473
1474 /**
1475 * timedated_timedate1_complete_set_local_rtc:
1476 * @object: A #timedatedTimedate1.
1477 * @invocation: (transfer full): A #GDBusMethodInvocation.
1478 *
1479 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-timedate1.SetLocalRTC">SetLocalRTC()</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.
1480 *
1481 * This method will free @invocation, you cannot use it afterwards.
1482 */
1483 void
1484 timedated_timedate1_complete_set_local_rtc (
1485 timedatedTimedate1 *object,
1486 GDBusMethodInvocation *invocation)
1487 {
1488 g_dbus_method_invocation_return_value (invocation,
1489 g_variant_new ("()"));
1490 }
1491
1492 /**
1493 * timedated_timedate1_complete_set_ntp:
1494 * @object: A #timedatedTimedate1.
1495 * @invocation: (transfer full): A #GDBusMethodInvocation.
1496 *
1497 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-timedate1.SetNTP">SetNTP()</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.
1498 *
1499 * This method will free @invocation, you cannot use it afterwards.
1500 */
1501 void
1502 timedated_timedate1_complete_set_ntp (
1503 timedatedTimedate1 *object,
1504 GDBusMethodInvocation *invocation)
1505 {
1506 g_dbus_method_invocation_return_value (invocation,
1507 g_variant_new ("()"));
1508 }
1509
1510 /* ------------------------------------------------------------------------ */
1511
1512 /**
1513 * timedatedTimedate1Proxy:
1514 *
1515 * The #timedatedTimedate1Proxy structure contains only private data and should only be accessed using the provided API.
1516 */
1517
1518 /**
1519 * timedatedTimedate1ProxyClass:
1520 * @parent_class: The parent class.
1521 *
1522 * Class structure for #timedatedTimedate1Proxy.
1523 */
1524
1525 struct _timedatedTimedate1ProxyPrivate
1526 {
1527 GData *qdata;
1528 };
1529
1530 static void timedated_timedate1_proxy_iface_init (timedatedTimedate1Iface *iface);
1531
1532 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1533 G_DEFINE_TYPE_WITH_CODE (timedatedTimedate1Proxy, timedated_timedate1_proxy, G_TYPE_DBUS_PROXY,
1534 G_ADD_PRIVATE (timedatedTimedate1Proxy)
1535 G_IMPLEMENT_INTERFACE (TIMEDATED_TYPE_TIMEDATE1, timedated_timedate1_proxy_iface_init));
1536
1537 #else
1538 G_DEFINE_TYPE_WITH_CODE (timedatedTimedate1Proxy, timedated_timedate1_proxy, G_TYPE_DBUS_PROXY,
1539 G_IMPLEMENT_INTERFACE (TIMEDATED_TYPE_TIMEDATE1, timedated_timedate1_proxy_iface_init));
1540
1541 #endif
1542 static void
1543 timedated_timedate1_proxy_finalize (GObject *object)
1544 {
1545 timedatedTimedate1Proxy *proxy = TIMEDATED_TIMEDATE1_PROXY (object);
1546 g_datalist_clear (&proxy->priv->qdata);
1547 G_OBJECT_CLASS (timedated_timedate1_proxy_parent_class)->finalize (object);
1548 }
1549
1550 static void
1551 timedated_timedate1_proxy_get_property (GObject *object,
1552 guint prop_id,
1553 GValue *value,
1554 GParamSpec *pspec G_GNUC_UNUSED)
1555 {
1556 const _ExtendedGDBusPropertyInfo *info;
1557 GVariant *variant;
1558 g_assert (prop_id != 0 && prop_id - 1 < 7);
1559 info = _timedated_timedate1_property_info_pointers[prop_id - 1];
1560 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
1561 if (info->use_gvariant)
1562 {
1563 g_value_set_variant (value, variant);
1564 }
1565 else
1566 {
1567 if (variant != NULL)
1568 g_dbus_gvariant_to_gvalue (variant, value);
1569 }
1570 if (variant != NULL)
1571 g_variant_unref (variant);
1572 }
1573
1574 static void
1575 timedated_timedate1_proxy_set_property_cb (GDBusProxy *proxy,
1576 GAsyncResult *res,
1577 gpointer user_data)
1578 {
1579 const _ExtendedGDBusPropertyInfo *info = user_data;
1580 GError *error;
1581 GVariant *_ret;
1582 error = NULL;
1583 _ret = g_dbus_proxy_call_finish (proxy, res, &error);
1584 if (!_ret)
1585 {
1586 g_warning ("Error setting property '%s' on interface org.freedesktop.timedate1: %s (%s, %d)",
1587 info->parent_struct.name,
1588 error->message, g_quark_to_string (error->domain), error->code);
1589 g_error_free (error);
1590 }
1591 else
1592 {
1593 g_variant_unref (_ret);
1594 }
1595 }
1596
1597 static void
1598 timedated_timedate1_proxy_set_property (GObject *object,
1599 guint prop_id,
1600 const GValue *value,
1601 GParamSpec *pspec G_GNUC_UNUSED)
1602 {
1603 const _ExtendedGDBusPropertyInfo *info;
1604 GVariant *variant;
1605 g_assert (prop_id != 0 && prop_id - 1 < 7);
1606 info = _timedated_timedate1_property_info_pointers[prop_id - 1];
1607 variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
1608 g_dbus_proxy_call (G_DBUS_PROXY (object),
1609 "org.freedesktop.DBus.Properties.Set",
1610 g_variant_new ("(ssv)", "org.freedesktop.timedate1", info->parent_struct.name, variant),
1611 G_DBUS_CALL_FLAGS_NONE,
1612 -1,
1613 NULL, (GAsyncReadyCallback) timedated_timedate1_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
1614 g_variant_unref (variant);
1615 }
1616
1617 static void
1618 timedated_timedate1_proxy_g_signal (GDBusProxy *proxy,
1619 const gchar *sender_name G_GNUC_UNUSED,
1620 const gchar *signal_name,
1621 GVariant *parameters)
1622 {
1623 _ExtendedGDBusSignalInfo *info;
1624 GVariantIter iter;
1625 GVariant *child;
1626 GValue *paramv;
1627 guint num_params;
1628 guint n;
1629 guint signal_id;
1630 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_timedated_timedate1_interface_info.parent_struct, signal_name);
1631 if (info == NULL)
1632 return;
1633 num_params = g_variant_n_children (parameters);
1634 paramv = g_new0 (GValue, num_params + 1);
1635 g_value_init (&paramv[0], TIMEDATED_TYPE_TIMEDATE1);
1636 g_value_set_object (&paramv[0], proxy);
1637 g_variant_iter_init (&iter, parameters);
1638 n = 1;
1639 while ((child = g_variant_iter_next_value (&iter)) != NULL)
1640 {
1641 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
1642 if (arg_info->use_gvariant)
1643 {
1644 g_value_init (&paramv[n], G_TYPE_VARIANT);
1645 g_value_set_variant (&paramv[n], child);
1646 n++;
1647 }
1648 else
1649 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
1650 g_variant_unref (child);
1651 }
1652 signal_id = g_signal_lookup (info->signal_name, TIMEDATED_TYPE_TIMEDATE1);
1653 g_signal_emitv (paramv, signal_id, 0, NULL);
1654 for (n = 0; n < num_params + 1; n++)
1655 g_value_unset (&paramv[n]);
1656 g_free (paramv);
1657 }
1658
1659 static void
1660 timedated_timedate1_proxy_g_properties_changed (GDBusProxy *_proxy,
1661 GVariant *changed_properties,
1662 const gchar *const *invalidated_properties)
1663 {
1664 timedatedTimedate1Proxy *proxy = TIMEDATED_TIMEDATE1_PROXY (_proxy);
1665 guint n;
1666 const gchar *key;
1667 GVariantIter *iter;
1668 _ExtendedGDBusPropertyInfo *info;
1669 g_variant_get (changed_properties, "a{sv}", &iter);
1670 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
1671 {
1672 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_timedated_timedate1_interface_info.parent_struct, key);
1673 g_datalist_remove_data (&proxy->priv->qdata, key);
1674 if (info != NULL)
1675 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1676 }
1677 g_variant_iter_free (iter);
1678 for (n = 0; invalidated_properties[n] != NULL; n++)
1679 {
1680 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_timedated_timedate1_interface_info.parent_struct, invalidated_properties[n]);
1681 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
1682 if (info != NULL)
1683 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1684 }
1685 }
1686
1687 static const gchar *
1688 timedated_timedate1_proxy_get_timezone (timedatedTimedate1 *object)
1689 {
1690 timedatedTimedate1Proxy *proxy = TIMEDATED_TIMEDATE1_PROXY (object);
1691 GVariant *variant;
1692 const gchar *value = NULL;
1693 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Timezone");
1694 if (variant != NULL)
1695 {
1696 value = g_variant_get_string (variant, NULL);
1697 g_variant_unref (variant);
1698 }
1699 return value;
1700 }
1701
1702 static gboolean
1703 timedated_timedate1_proxy_get_local_rtc (timedatedTimedate1 *object)
1704 {
1705 timedatedTimedate1Proxy *proxy = TIMEDATED_TIMEDATE1_PROXY (object);
1706 GVariant *variant;
1707 gboolean value = 0;
1708 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "LocalRTC");
1709 if (variant != NULL)
1710 {
1711 value = g_variant_get_boolean (variant);
1712 g_variant_unref (variant);
1713 }
1714 return value;
1715 }
1716
1717 static gboolean
1718 timedated_timedate1_proxy_get_can_ntp (timedatedTimedate1 *object)
1719 {
1720 timedatedTimedate1Proxy *proxy = TIMEDATED_TIMEDATE1_PROXY (object);
1721 GVariant *variant;
1722 gboolean value = 0;
1723 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "CanNTP");
1724 if (variant != NULL)
1725 {
1726 value = g_variant_get_boolean (variant);
1727 g_variant_unref (variant);
1728 }
1729 return value;
1730 }
1731
1732 static gboolean
1733 timedated_timedate1_proxy_get_ntp (timedatedTimedate1 *object)
1734 {
1735 timedatedTimedate1Proxy *proxy = TIMEDATED_TIMEDATE1_PROXY (object);
1736 GVariant *variant;
1737 gboolean value = 0;
1738 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "NTP");
1739 if (variant != NULL)
1740 {
1741 value = g_variant_get_boolean (variant);
1742 g_variant_unref (variant);
1743 }
1744 return value;
1745 }
1746
1747 static gboolean
1748 timedated_timedate1_proxy_get_ntpsynchronized (timedatedTimedate1 *object)
1749 {
1750 timedatedTimedate1Proxy *proxy = TIMEDATED_TIMEDATE1_PROXY (object);
1751 GVariant *variant;
1752 gboolean value = 0;
1753 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "NTPSynchronized");
1754 if (variant != NULL)
1755 {
1756 value = g_variant_get_boolean (variant);
1757 g_variant_unref (variant);
1758 }
1759 return value;
1760 }
1761
1762 static guint64
1763 timedated_timedate1_proxy_get_time_usec (timedatedTimedate1 *object)
1764 {
1765 timedatedTimedate1Proxy *proxy = TIMEDATED_TIMEDATE1_PROXY (object);
1766 GVariant *variant;
1767 guint64 value = 0;
1768 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "TimeUSec");
1769 if (variant != NULL)
1770 {
1771 value = g_variant_get_uint64 (variant);
1772 g_variant_unref (variant);
1773 }
1774 return value;
1775 }
1776
1777 static guint64
1778 timedated_timedate1_proxy_get_rtctime_usec (timedatedTimedate1 *object)
1779 {
1780 timedatedTimedate1Proxy *proxy = TIMEDATED_TIMEDATE1_PROXY (object);
1781 GVariant *variant;
1782 guint64 value = 0;
1783 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "RTCTimeUSec");
1784 if (variant != NULL)
1785 {
1786 value = g_variant_get_uint64 (variant);
1787 g_variant_unref (variant);
1788 }
1789 return value;
1790 }
1791
1792 static void
1793 timedated_timedate1_proxy_init (timedatedTimedate1Proxy *proxy)
1794 {
1795 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1796 proxy->priv = timedated_timedate1_proxy_get_instance_private (proxy);
1797 #else
1798 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TIMEDATED_TYPE_TIMEDATE1_PROXY, timedatedTimedate1ProxyPrivate);
1799 #endif
1800
1801 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), timedated_timedate1_interface_info ());
1802 }
1803
1804 static void
1805 timedated_timedate1_proxy_class_init (timedatedTimedate1ProxyClass *klass)
1806 {
1807 GObjectClass *gobject_class;
1808 GDBusProxyClass *proxy_class;
1809
1810 gobject_class = G_OBJECT_CLASS (klass);
1811 gobject_class->finalize = timedated_timedate1_proxy_finalize;
1812 gobject_class->get_property = timedated_timedate1_proxy_get_property;
1813 gobject_class->set_property = timedated_timedate1_proxy_set_property;
1814
1815 proxy_class = G_DBUS_PROXY_CLASS (klass);
1816 proxy_class->g_signal = timedated_timedate1_proxy_g_signal;
1817 proxy_class->g_properties_changed = timedated_timedate1_proxy_g_properties_changed;
1818
1819 timedated_timedate1_override_properties (gobject_class, 1);
1820
1821 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1822 g_type_class_add_private (klass, sizeof (timedatedTimedate1ProxyPrivate));
1823 #endif
1824 }
1825
1826 static void
1827 timedated_timedate1_proxy_iface_init (timedatedTimedate1Iface *iface)
1828 {
1829 iface->get_timezone = timedated_timedate1_proxy_get_timezone;
1830 iface->get_local_rtc = timedated_timedate1_proxy_get_local_rtc;
1831 iface->get_can_ntp = timedated_timedate1_proxy_get_can_ntp;
1832 iface->get_ntp = timedated_timedate1_proxy_get_ntp;
1833 iface->get_ntpsynchronized = timedated_timedate1_proxy_get_ntpsynchronized;
1834 iface->get_time_usec = timedated_timedate1_proxy_get_time_usec;
1835 iface->get_rtctime_usec = timedated_timedate1_proxy_get_rtctime_usec;
1836 }
1837
1838 /**
1839 * timedated_timedate1_proxy_new:
1840 * @connection: A #GDBusConnection.
1841 * @flags: Flags from the #GDBusProxyFlags enumeration.
1842 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1843 * @object_path: An object path.
1844 * @cancellable: (allow-none): A #GCancellable or %NULL.
1845 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1846 * @user_data: User data to pass to @callback.
1847 *
1848 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link>. See g_dbus_proxy_new() for more details.
1849 *
1850 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1851 * You can then call timedated_timedate1_proxy_new_finish() to get the result of the operation.
1852 *
1853 * See timedated_timedate1_proxy_new_sync() for the synchronous, blocking version of this constructor.
1854 */
1855 void
1856 timedated_timedate1_proxy_new (
1857 GDBusConnection *connection,
1858 GDBusProxyFlags flags,
1859 const gchar *name,
1860 const gchar *object_path,
1861 GCancellable *cancellable,
1862 GAsyncReadyCallback callback,
1863 gpointer user_data)
1864 {
1865 g_async_initable_new_async (TIMEDATED_TYPE_TIMEDATE1_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.timedate1", NULL);
1866 }
1867
1868 /**
1869 * timedated_timedate1_proxy_new_finish:
1870 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_timedate1_proxy_new().
1871 * @error: Return location for error or %NULL
1872 *
1873 * Finishes an operation started with timedated_timedate1_proxy_new().
1874 *
1875 * Returns: (transfer full) (type timedatedTimedate1Proxy): The constructed proxy object or %NULL if @error is set.
1876 */
1877 timedatedTimedate1 *
1878 timedated_timedate1_proxy_new_finish (
1879 GAsyncResult *res,
1880 GError **error)
1881 {
1882 GObject *ret;
1883 GObject *source_object;
1884 source_object = g_async_result_get_source_object (res);
1885 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1886 g_object_unref (source_object);
1887 if (ret != NULL)
1888 return TIMEDATED_TIMEDATE1 (ret);
1889 else
1890 return NULL;
1891 }
1892
1893 /**
1894 * timedated_timedate1_proxy_new_sync:
1895 * @connection: A #GDBusConnection.
1896 * @flags: Flags from the #GDBusProxyFlags enumeration.
1897 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1898 * @object_path: An object path.
1899 * @cancellable: (allow-none): A #GCancellable or %NULL.
1900 * @error: Return location for error or %NULL
1901 *
1902 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link>. See g_dbus_proxy_new_sync() for more details.
1903 *
1904 * The calling thread is blocked until a reply is received.
1905 *
1906 * See timedated_timedate1_proxy_new() for the asynchronous version of this constructor.
1907 *
1908 * Returns: (transfer full) (type timedatedTimedate1Proxy): The constructed proxy object or %NULL if @error is set.
1909 */
1910 timedatedTimedate1 *
1911 timedated_timedate1_proxy_new_sync (
1912 GDBusConnection *connection,
1913 GDBusProxyFlags flags,
1914 const gchar *name,
1915 const gchar *object_path,
1916 GCancellable *cancellable,
1917 GError **error)
1918 {
1919 GInitable *ret;
1920 ret = g_initable_new (TIMEDATED_TYPE_TIMEDATE1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.timedate1", NULL);
1921 if (ret != NULL)
1922 return TIMEDATED_TIMEDATE1 (ret);
1923 else
1924 return NULL;
1925 }
1926
1927
1928 /**
1929 * timedated_timedate1_proxy_new_for_bus:
1930 * @bus_type: A #GBusType.
1931 * @flags: Flags from the #GDBusProxyFlags enumeration.
1932 * @name: A bus name (well-known or unique).
1933 * @object_path: An object path.
1934 * @cancellable: (allow-none): A #GCancellable or %NULL.
1935 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1936 * @user_data: User data to pass to @callback.
1937 *
1938 * Like timedated_timedate1_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
1939 *
1940 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1941 * You can then call timedated_timedate1_proxy_new_for_bus_finish() to get the result of the operation.
1942 *
1943 * See timedated_timedate1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
1944 */
1945 void
1946 timedated_timedate1_proxy_new_for_bus (
1947 GBusType bus_type,
1948 GDBusProxyFlags flags,
1949 const gchar *name,
1950 const gchar *object_path,
1951 GCancellable *cancellable,
1952 GAsyncReadyCallback callback,
1953 gpointer user_data)
1954 {
1955 g_async_initable_new_async (TIMEDATED_TYPE_TIMEDATE1_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.timedate1", NULL);
1956 }
1957
1958 /**
1959 * timedated_timedate1_proxy_new_for_bus_finish:
1960 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_timedate1_proxy_new_for_bus().
1961 * @error: Return location for error or %NULL
1962 *
1963 * Finishes an operation started with timedated_timedate1_proxy_new_for_bus().
1964 *
1965 * Returns: (transfer full) (type timedatedTimedate1Proxy): The constructed proxy object or %NULL if @error is set.
1966 */
1967 timedatedTimedate1 *
1968 timedated_timedate1_proxy_new_for_bus_finish (
1969 GAsyncResult *res,
1970 GError **error)
1971 {
1972 GObject *ret;
1973 GObject *source_object;
1974 source_object = g_async_result_get_source_object (res);
1975 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1976 g_object_unref (source_object);
1977 if (ret != NULL)
1978 return TIMEDATED_TIMEDATE1 (ret);
1979 else
1980 return NULL;
1981 }
1982
1983 /**
1984 * timedated_timedate1_proxy_new_for_bus_sync:
1985 * @bus_type: A #GBusType.
1986 * @flags: Flags from the #GDBusProxyFlags enumeration.
1987 * @name: A bus name (well-known or unique).
1988 * @object_path: An object path.
1989 * @cancellable: (allow-none): A #GCancellable or %NULL.
1990 * @error: Return location for error or %NULL
1991 *
1992 * Like timedated_timedate1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
1993 *
1994 * The calling thread is blocked until a reply is received.
1995 *
1996 * See timedated_timedate1_proxy_new_for_bus() for the asynchronous version of this constructor.
1997 *
1998 * Returns: (transfer full) (type timedatedTimedate1Proxy): The constructed proxy object or %NULL if @error is set.
1999 */
2000 timedatedTimedate1 *
2001 timedated_timedate1_proxy_new_for_bus_sync (
2002 GBusType bus_type,
2003 GDBusProxyFlags flags,
2004 const gchar *name,
2005 const gchar *object_path,
2006 GCancellable *cancellable,
2007 GError **error)
2008 {
2009 GInitable *ret;
2010 ret = g_initable_new (TIMEDATED_TYPE_TIMEDATE1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.timedate1", NULL);
2011 if (ret != NULL)
2012 return TIMEDATED_TIMEDATE1 (ret);
2013 else
2014 return NULL;
2015 }
2016
2017
2018 /* ------------------------------------------------------------------------ */
2019
2020 /**
2021 * timedatedTimedate1Skeleton:
2022 *
2023 * The #timedatedTimedate1Skeleton structure contains only private data and should only be accessed using the provided API.
2024 */
2025
2026 /**
2027 * timedatedTimedate1SkeletonClass:
2028 * @parent_class: The parent class.
2029 *
2030 * Class structure for #timedatedTimedate1Skeleton.
2031 */
2032
2033 struct _timedatedTimedate1SkeletonPrivate
2034 {
2035 GValue *properties;
2036 GList *changed_properties;
2037 GSource *changed_properties_idle_source;
2038 GMainContext *context;
2039 GMutex lock;
2040 };
2041
2042 static void
2043 _timedated_timedate1_skeleton_handle_method_call (
2044 GDBusConnection *connection G_GNUC_UNUSED,
2045 const gchar *sender G_GNUC_UNUSED,
2046 const gchar *object_path G_GNUC_UNUSED,
2047 const gchar *interface_name,
2048 const gchar *method_name,
2049 GVariant *parameters,
2050 GDBusMethodInvocation *invocation,
2051 gpointer user_data)
2052 {
2053 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (user_data);
2054 _ExtendedGDBusMethodInfo *info;
2055 GVariantIter iter;
2056 GVariant *child;
2057 GValue *paramv;
2058 guint num_params;
2059 guint num_extra;
2060 guint n;
2061 guint signal_id;
2062 GValue return_value = G_VALUE_INIT;
2063 info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
2064 g_assert (info != NULL);
2065 num_params = g_variant_n_children (parameters);
2066 num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
2067 n = 0;
2068 g_value_init (&paramv[n], TIMEDATED_TYPE_TIMEDATE1);
2069 g_value_set_object (&paramv[n++], skeleton);
2070 g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
2071 g_value_set_object (&paramv[n++], invocation);
2072 if (info->pass_fdlist)
2073 {
2074 #ifdef G_OS_UNIX
2075 g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
2076 g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
2077 #else
2078 g_assert_not_reached ();
2079 #endif
2080 }
2081 g_variant_iter_init (&iter, parameters);
2082 while ((child = g_variant_iter_next_value (&iter)) != NULL)
2083 {
2084 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
2085 if (arg_info->use_gvariant)
2086 {
2087 g_value_init (&paramv[n], G_TYPE_VARIANT);
2088 g_value_set_variant (&paramv[n], child);
2089 n++;
2090 }
2091 else
2092 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
2093 g_variant_unref (child);
2094 }
2095 signal_id = g_signal_lookup (info->signal_name, TIMEDATED_TYPE_TIMEDATE1);
2096 g_value_init (&return_value, G_TYPE_BOOLEAN);
2097 g_signal_emitv (paramv, signal_id, 0, &return_value);
2098 if (!g_value_get_boolean (&return_value))
2099 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);
2100 g_value_unset (&return_value);
2101 for (n = 0; n < num_params + num_extra; n++)
2102 g_value_unset (&paramv[n]);
2103 g_free (paramv);
2104 }
2105
2106 static GVariant *
2107 _timedated_timedate1_skeleton_handle_get_property (
2108 GDBusConnection *connection G_GNUC_UNUSED,
2109 const gchar *sender G_GNUC_UNUSED,
2110 const gchar *object_path G_GNUC_UNUSED,
2111 const gchar *interface_name G_GNUC_UNUSED,
2112 const gchar *property_name,
2113 GError **error,
2114 gpointer user_data)
2115 {
2116 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (user_data);
2117 GValue value = G_VALUE_INIT;
2118 GParamSpec *pspec;
2119 _ExtendedGDBusPropertyInfo *info;
2120 GVariant *ret;
2121 ret = NULL;
2122 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_timedated_timedate1_interface_info.parent_struct, property_name);
2123 g_assert (info != NULL);
2124 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
2125 if (pspec == NULL)
2126 {
2127 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
2128 }
2129 else
2130 {
2131 g_value_init (&value, pspec->value_type);
2132 g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
2133 ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
2134 g_value_unset (&value);
2135 }
2136 return ret;
2137 }
2138
2139 static gboolean
2140 _timedated_timedate1_skeleton_handle_set_property (
2141 GDBusConnection *connection G_GNUC_UNUSED,
2142 const gchar *sender G_GNUC_UNUSED,
2143 const gchar *object_path G_GNUC_UNUSED,
2144 const gchar *interface_name G_GNUC_UNUSED,
2145 const gchar *property_name,
2146 GVariant *variant,
2147 GError **error,
2148 gpointer user_data)
2149 {
2150 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (user_data);
2151 GValue value = G_VALUE_INIT;
2152 GParamSpec *pspec;
2153 _ExtendedGDBusPropertyInfo *info;
2154 gboolean ret;
2155 ret = FALSE;
2156 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_timedated_timedate1_interface_info.parent_struct, property_name);
2157 g_assert (info != NULL);
2158 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
2159 if (pspec == NULL)
2160 {
2161 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
2162 }
2163 else
2164 {
2165 if (info->use_gvariant)
2166 g_value_set_variant (&value, variant);
2167 else
2168 g_dbus_gvariant_to_gvalue (variant, &value);
2169 g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
2170 g_value_unset (&value);
2171 ret = TRUE;
2172 }
2173 return ret;
2174 }
2175
2176 static const GDBusInterfaceVTable _timedated_timedate1_skeleton_vtable =
2177 {
2178 _timedated_timedate1_skeleton_handle_method_call,
2179 _timedated_timedate1_skeleton_handle_get_property,
2180 _timedated_timedate1_skeleton_handle_set_property,
2181 {NULL}
2182 };
2183
2184 static GDBusInterfaceInfo *
2185 timedated_timedate1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
2186 {
2187 return timedated_timedate1_interface_info ();
2188 }
2189
2190 static GDBusInterfaceVTable *
2191 timedated_timedate1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
2192 {
2193 return (GDBusInterfaceVTable *) &_timedated_timedate1_skeleton_vtable;
2194 }
2195
2196 static GVariant *
2197 timedated_timedate1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
2198 {
2199 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (_skeleton);
2200
2201 GVariantBuilder builder;
2202 guint n;
2203 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
2204 if (_timedated_timedate1_interface_info.parent_struct.properties == NULL)
2205 goto out;
2206 for (n = 0; _timedated_timedate1_interface_info.parent_struct.properties[n] != NULL; n++)
2207 {
2208 GDBusPropertyInfo *info = _timedated_timedate1_interface_info.parent_struct.properties[n];
2209 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
2210 {
2211 GVariant *value;
2212 value = _timedated_timedate1_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.timedate1", info->name, NULL, skeleton);
2213 if (value != NULL)
2214 {
2215 g_variant_take_ref (value);
2216 g_variant_builder_add (&builder, "{sv}", info->name, value);
2217 g_variant_unref (value);
2218 }
2219 }
2220 }
2221 out:
2222 return g_variant_builder_end (&builder);
2223 }
2224
2225 static gboolean _timedated_timedate1_emit_changed (gpointer user_data);
2226
2227 static void
2228 timedated_timedate1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
2229 {
2230 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (_skeleton);
2231 gboolean emit_changed = FALSE;
2232
2233 g_mutex_lock (&skeleton->priv->lock);
2234 if (skeleton->priv->changed_properties_idle_source != NULL)
2235 {
2236 g_source_destroy (skeleton->priv->changed_properties_idle_source);
2237 skeleton->priv->changed_properties_idle_source = NULL;
2238 emit_changed = TRUE;
2239 }
2240 g_mutex_unlock (&skeleton->priv->lock);
2241
2242 if (emit_changed)
2243 _timedated_timedate1_emit_changed (skeleton);
2244 }
2245
2246 static void timedated_timedate1_skeleton_iface_init (timedatedTimedate1Iface *iface);
2247 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2248 G_DEFINE_TYPE_WITH_CODE (timedatedTimedate1Skeleton, timedated_timedate1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
2249 G_ADD_PRIVATE (timedatedTimedate1Skeleton)
2250 G_IMPLEMENT_INTERFACE (TIMEDATED_TYPE_TIMEDATE1, timedated_timedate1_skeleton_iface_init));
2251
2252 #else
2253 G_DEFINE_TYPE_WITH_CODE (timedatedTimedate1Skeleton, timedated_timedate1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
2254 G_IMPLEMENT_INTERFACE (TIMEDATED_TYPE_TIMEDATE1, timedated_timedate1_skeleton_iface_init));
2255
2256 #endif
2257 static void
2258 timedated_timedate1_skeleton_finalize (GObject *object)
2259 {
2260 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object);
2261 guint n;
2262 for (n = 0; n < 7; n++)
2263 g_value_unset (&skeleton->priv->properties[n]);
2264 g_free (skeleton->priv->properties);
2265 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
2266 if (skeleton->priv->changed_properties_idle_source != NULL)
2267 g_source_destroy (skeleton->priv->changed_properties_idle_source);
2268 g_main_context_unref (skeleton->priv->context);
2269 g_mutex_clear (&skeleton->priv->lock);
2270 G_OBJECT_CLASS (timedated_timedate1_skeleton_parent_class)->finalize (object);
2271 }
2272
2273 static void
2274 timedated_timedate1_skeleton_get_property (GObject *object,
2275 guint prop_id,
2276 GValue *value,
2277 GParamSpec *pspec G_GNUC_UNUSED)
2278 {
2279 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object);
2280 g_assert (prop_id != 0 && prop_id - 1 < 7);
2281 g_mutex_lock (&skeleton->priv->lock);
2282 g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
2283 g_mutex_unlock (&skeleton->priv->lock);
2284 }
2285
2286 static gboolean
2287 _timedated_timedate1_emit_changed (gpointer user_data)
2288 {
2289 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (user_data);
2290 GList *l;
2291 GVariantBuilder builder;
2292 GVariantBuilder invalidated_builder;
2293 guint num_changes;
2294
2295 g_mutex_lock (&skeleton->priv->lock);
2296 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
2297 g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
2298 for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
2299 {
2300 ChangedProperty *cp = l->data;
2301 GVariant *variant;
2302 const GValue *cur_value;
2303
2304 cur_value = &skeleton->priv->properties[cp->prop_id - 1];
2305 if (!_g_value_equal (cur_value, &cp->orig_value))
2306 {
2307 variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
2308 g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
2309 g_variant_unref (variant);
2310 num_changes++;
2311 }
2312 }
2313 if (num_changes > 0)
2314 {
2315 GList *connections, *ll;
2316 GVariant *signal_variant;
2317 signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.timedate1",
2318 &builder, &invalidated_builder));
2319 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
2320 for (ll = connections; ll != NULL; ll = ll->next)
2321 {
2322 GDBusConnection *connection = ll->data;
2323
2324 g_dbus_connection_emit_signal (connection,
2325 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
2326 "org.freedesktop.DBus.Properties",
2327 "PropertiesChanged",
2328 signal_variant,
2329 NULL);
2330 }
2331 g_variant_unref (signal_variant);
2332 g_list_free_full (connections, g_object_unref);
2333 }
2334 else
2335 {
2336 g_variant_builder_clear (&builder);
2337 g_variant_builder_clear (&invalidated_builder);
2338 }
2339 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
2340 skeleton->priv->changed_properties = NULL;
2341 skeleton->priv->changed_properties_idle_source = NULL;
2342 g_mutex_unlock (&skeleton->priv->lock);
2343 return FALSE;
2344 }
2345
2346 static void
2347 _timedated_timedate1_schedule_emit_changed (timedatedTimedate1Skeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
2348 {
2349 ChangedProperty *cp;
2350 GList *l;
2351 cp = NULL;
2352 for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
2353 {
2354 ChangedProperty *i_cp = l->data;
2355 if (i_cp->info == info)
2356 {
2357 cp = i_cp;
2358 break;
2359 }
2360 }
2361 if (cp == NULL)
2362 {
2363 cp = g_new0 (ChangedProperty, 1);
2364 cp->prop_id = prop_id;
2365 cp->info = info;
2366 skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
2367 g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
2368 g_value_copy (orig_value, &cp->orig_value);
2369 }
2370 }
2371
2372 static void
2373 timedated_timedate1_skeleton_notify (GObject *object,
2374 GParamSpec *pspec G_GNUC_UNUSED)
2375 {
2376 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object);
2377 g_mutex_lock (&skeleton->priv->lock);
2378 if (skeleton->priv->changed_properties != NULL &&
2379 skeleton->priv->changed_properties_idle_source == NULL)
2380 {
2381 skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
2382 g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
2383 g_source_set_callback (skeleton->priv->changed_properties_idle_source, _timedated_timedate1_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
2384 g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
2385 g_source_unref (skeleton->priv->changed_properties_idle_source);
2386 }
2387 g_mutex_unlock (&skeleton->priv->lock);
2388 }
2389
2390 static void
2391 timedated_timedate1_skeleton_set_property (GObject *object,
2392 guint prop_id,
2393 const GValue *value,
2394 GParamSpec *pspec)
2395 {
2396 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object);
2397 g_assert (prop_id != 0 && prop_id - 1 < 7);
2398 g_mutex_lock (&skeleton->priv->lock);
2399 g_object_freeze_notify (object);
2400 if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
2401 {
2402 if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
2403 _timedated_timedate1_schedule_emit_changed (skeleton, _timedated_timedate1_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
2404 g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
2405 g_object_notify_by_pspec (object, pspec);
2406 }
2407 g_mutex_unlock (&skeleton->priv->lock);
2408 g_object_thaw_notify (object);
2409 }
2410
2411 static void
2412 timedated_timedate1_skeleton_init (timedatedTimedate1Skeleton *skeleton)
2413 {
2414 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2415 skeleton->priv = timedated_timedate1_skeleton_get_instance_private (skeleton);
2416 #else
2417 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TIMEDATED_TYPE_TIMEDATE1_SKELETON, timedatedTimedate1SkeletonPrivate);
2418 #endif
2419
2420 g_mutex_init (&skeleton->priv->lock);
2421 skeleton->priv->context = g_main_context_ref_thread_default ();
2422 skeleton->priv->properties = g_new0 (GValue, 7);
2423 g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING);
2424 g_value_init (&skeleton->priv->properties[1], G_TYPE_BOOLEAN);
2425 g_value_init (&skeleton->priv->properties[2], G_TYPE_BOOLEAN);
2426 g_value_init (&skeleton->priv->properties[3], G_TYPE_BOOLEAN);
2427 g_value_init (&skeleton->priv->properties[4], G_TYPE_BOOLEAN);
2428 g_value_init (&skeleton->priv->properties[5], G_TYPE_UINT64);
2429 g_value_init (&skeleton->priv->properties[6], G_TYPE_UINT64);
2430 }
2431
2432 static const gchar *
2433 timedated_timedate1_skeleton_get_timezone (timedatedTimedate1 *object)
2434 {
2435 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object);
2436 const gchar *value;
2437 g_mutex_lock (&skeleton->priv->lock);
2438 value = g_value_get_string (&(skeleton->priv->properties[0]));
2439 g_mutex_unlock (&skeleton->priv->lock);
2440 return value;
2441 }
2442
2443 static gboolean
2444 timedated_timedate1_skeleton_get_local_rtc (timedatedTimedate1 *object)
2445 {
2446 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object);
2447 gboolean value;
2448 g_mutex_lock (&skeleton->priv->lock);
2449 value = g_value_get_boolean (&(skeleton->priv->properties[1]));
2450 g_mutex_unlock (&skeleton->priv->lock);
2451 return value;
2452 }
2453
2454 static gboolean
2455 timedated_timedate1_skeleton_get_can_ntp (timedatedTimedate1 *object)
2456 {
2457 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object);
2458 gboolean value;
2459 g_mutex_lock (&skeleton->priv->lock);
2460 value = g_value_get_boolean (&(skeleton->priv->properties[2]));
2461 g_mutex_unlock (&skeleton->priv->lock);
2462 return value;
2463 }
2464
2465 static gboolean
2466 timedated_timedate1_skeleton_get_ntp (timedatedTimedate1 *object)
2467 {
2468 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object);
2469 gboolean value;
2470 g_mutex_lock (&skeleton->priv->lock);
2471 value = g_value_get_boolean (&(skeleton->priv->properties[3]));
2472 g_mutex_unlock (&skeleton->priv->lock);
2473 return value;
2474 }
2475
2476 static gboolean
2477 timedated_timedate1_skeleton_get_ntpsynchronized (timedatedTimedate1 *object)
2478 {
2479 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object);
2480 gboolean value;
2481 g_mutex_lock (&skeleton->priv->lock);
2482 value = g_value_get_boolean (&(skeleton->priv->properties[4]));
2483 g_mutex_unlock (&skeleton->priv->lock);
2484 return value;
2485 }
2486
2487 static guint64
2488 timedated_timedate1_skeleton_get_time_usec (timedatedTimedate1 *object)
2489 {
2490 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object);
2491 guint64 value;
2492 g_mutex_lock (&skeleton->priv->lock);
2493 value = g_value_get_uint64 (&(skeleton->priv->properties[5]));
2494 g_mutex_unlock (&skeleton->priv->lock);
2495 return value;
2496 }
2497
2498 static guint64
2499 timedated_timedate1_skeleton_get_rtctime_usec (timedatedTimedate1 *object)
2500 {
2501 timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object);
2502 guint64 value;
2503 g_mutex_lock (&skeleton->priv->lock);
2504 value = g_value_get_uint64 (&(skeleton->priv->properties[6]));
2505 g_mutex_unlock (&skeleton->priv->lock);
2506 return value;
2507 }
2508
2509 static void
2510 timedated_timedate1_skeleton_class_init (timedatedTimedate1SkeletonClass *klass)
2511 {
2512 GObjectClass *gobject_class;
2513 GDBusInterfaceSkeletonClass *skeleton_class;
2514
2515 gobject_class = G_OBJECT_CLASS (klass);
2516 gobject_class->finalize = timedated_timedate1_skeleton_finalize;
2517 gobject_class->get_property = timedated_timedate1_skeleton_get_property;
2518 gobject_class->set_property = timedated_timedate1_skeleton_set_property;
2519 gobject_class->notify = timedated_timedate1_skeleton_notify;
2520
2521
2522 timedated_timedate1_override_properties (gobject_class, 1);
2523
2524 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
2525 skeleton_class->get_info = timedated_timedate1_skeleton_dbus_interface_get_info;
2526 skeleton_class->get_properties = timedated_timedate1_skeleton_dbus_interface_get_properties;
2527 skeleton_class->flush = timedated_timedate1_skeleton_dbus_interface_flush;
2528 skeleton_class->get_vtable = timedated_timedate1_skeleton_dbus_interface_get_vtable;
2529
2530 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
2531 g_type_class_add_private (klass, sizeof (timedatedTimedate1SkeletonPrivate));
2532 #endif
2533 }
2534
2535 static void
2536 timedated_timedate1_skeleton_iface_init (timedatedTimedate1Iface *iface)
2537 {
2538 iface->get_timezone = timedated_timedate1_skeleton_get_timezone;
2539 iface->get_local_rtc = timedated_timedate1_skeleton_get_local_rtc;
2540 iface->get_can_ntp = timedated_timedate1_skeleton_get_can_ntp;
2541 iface->get_ntp = timedated_timedate1_skeleton_get_ntp;
2542 iface->get_ntpsynchronized = timedated_timedate1_skeleton_get_ntpsynchronized;
2543 iface->get_time_usec = timedated_timedate1_skeleton_get_time_usec;
2544 iface->get_rtctime_usec = timedated_timedate1_skeleton_get_rtctime_usec;
2545 }
2546
2547 /**
2548 * timedated_timedate1_skeleton_new:
2549 *
2550 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link>.
2551 *
2552 * Returns: (transfer full) (type timedatedTimedate1Skeleton): The skeleton object.
2553 */
2554 timedatedTimedate1 *
2555 timedated_timedate1_skeleton_new (void)
2556 {
2557 return TIMEDATED_TIMEDATE1 (g_object_new (TIMEDATED_TYPE_TIMEDATE1_SKELETON, NULL));
2558 }
2559
2560 /* ------------------------------------------------------------------------
2561 * Code for Object, ObjectProxy and ObjectSkeleton
2562 * ------------------------------------------------------------------------
2563 */
2564
2565 /**
2566 * SECTION:timedatedObject
2567 * @title: timedatedObject
2568 * @short_description: Specialized GDBusObject types
2569 *
2570 * This section contains the #timedatedObject, #timedatedObjectProxy, and #timedatedObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces.
2571 */
2572
2573 /**
2574 * timedatedObject:
2575 *
2576 * The #timedatedObject type is a specialized container of interfaces.
2577 */
2578
2579 /**
2580 * timedatedObjectIface:
2581 * @parent_iface: The parent interface.
2582 *
2583 * Virtual table for the #timedatedObject interface.
2584 */
2585
2586 typedef timedatedObjectIface timedatedObjectInterface;
2587 G_DEFINE_INTERFACE_WITH_CODE (timedatedObject, timedated_object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT));
2588
2589 static void
2590 timedated_object_default_init (timedatedObjectIface *iface)
2591 {
2592 /**
2593 * timedatedObject:timedate1:
2594 *
2595 * The #timedatedTimedate1 instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link>, if any.
2596 *
2597 * Connect to the #GObject::notify signal to get informed of property changes.
2598 */
2599 g_object_interface_install_property (iface, g_param_spec_object ("timedate1", "timedate1", "timedate1", TIMEDATED_TYPE_TIMEDATE1, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
2600
2601 }
2602
2603 /**
2604 * timedated_object_get_timedate1:
2605 * @object: A #timedatedObject.
2606 *
2607 * Gets the #timedatedTimedate1 instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link> on @object, if any.
2608 *
2609 * Returns: (transfer full): A #timedatedTimedate1 that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
2610 */
2611 timedatedTimedate1 *timedated_object_get_timedate1 (timedatedObject *object)
2612 {
2613 GDBusInterface *ret;
2614 ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.timedate1");
2615 if (ret == NULL)
2616 return NULL;
2617 return TIMEDATED_TIMEDATE1 (ret);
2618 }
2619
2620
2621 /**
2622 * timedated_object_peek_timedate1: (skip)
2623 * @object: A #timedatedObject.
2624 *
2625 * Like timedated_object_get_timedate1() but doesn't increase the reference count on the returned object.
2626 *
2627 * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
2628 *
2629 * Returns: (transfer none): A #timedatedTimedate1 or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
2630 */
2631 timedatedTimedate1 *timedated_object_peek_timedate1 (timedatedObject *object)
2632 {
2633 GDBusInterface *ret;
2634 ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.timedate1");
2635 if (ret == NULL)
2636 return NULL;
2637 g_object_unref (ret);
2638 return TIMEDATED_TIMEDATE1 (ret);
2639 }
2640
2641
2642 static void
2643 timedated_object_notify (GDBusObject *object, GDBusInterface *interface)
2644 {
2645 _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface);
2646 /* info can be NULL if the other end is using a D-Bus interface we don't know
2647 * anything about, for example old generated code in this process talking to
2648 * newer generated code in the other process. */
2649 if (info != NULL)
2650 g_object_notify (G_OBJECT (object), info->hyphen_name);
2651 }
2652
2653 /**
2654 * timedatedObjectProxy:
2655 *
2656 * The #timedatedObjectProxy structure contains only private data and should only be accessed using the provided API.
2657 */
2658
2659 /**
2660 * timedatedObjectProxyClass:
2661 * @parent_class: The parent class.
2662 *
2663 * Class structure for #timedatedObjectProxy.
2664 */
2665
2666 static void
2667 timedated_object_proxy__timedated_object_iface_init (timedatedObjectIface *iface G_GNUC_UNUSED)
2668 {
2669 }
2670
2671 static void
2672 timedated_object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)
2673 {
2674 iface->interface_added = timedated_object_notify;
2675 iface->interface_removed = timedated_object_notify;
2676 }
2677
2678
2679 G_DEFINE_TYPE_WITH_CODE (timedatedObjectProxy, timedated_object_proxy, G_TYPE_DBUS_OBJECT_PROXY,
2680 G_IMPLEMENT_INTERFACE (TIMEDATED_TYPE_OBJECT, timedated_object_proxy__timedated_object_iface_init)
2681 G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, timedated_object_proxy__g_dbus_object_iface_init));
2682
2683 static void
2684 timedated_object_proxy_init (timedatedObjectProxy *object G_GNUC_UNUSED)
2685 {
2686 }
2687
2688 static void
2689 timedated_object_proxy_set_property (GObject *gobject,
2690 guint prop_id,
2691 const GValue *value G_GNUC_UNUSED,
2692 GParamSpec *pspec)
2693 {
2694 G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
2695 }
2696
2697 static void
2698 timedated_object_proxy_get_property (GObject *gobject,
2699 guint prop_id,
2700 GValue *value,
2701 GParamSpec *pspec)
2702 {
2703 timedatedObjectProxy *object = TIMEDATED_OBJECT_PROXY (gobject);
2704 GDBusInterface *interface;
2705
2706 switch (prop_id)
2707 {
2708 case 1:
2709 interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.timedate1");
2710 g_value_take_object (value, interface);
2711 break;
2712
2713 default:
2714 G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
2715 break;
2716 }
2717 }
2718
2719 static void
2720 timedated_object_proxy_class_init (timedatedObjectProxyClass *klass)
2721 {
2722 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
2723
2724 gobject_class->set_property = timedated_object_proxy_set_property;
2725 gobject_class->get_property = timedated_object_proxy_get_property;
2726
2727 g_object_class_override_property (gobject_class, 1, "timedate1");
2728 }
2729
2730 /**
2731 * timedated_object_proxy_new:
2732 * @connection: A #GDBusConnection.
2733 * @object_path: An object path.
2734 *
2735 * Creates a new proxy object.
2736 *
2737 * Returns: (transfer full): The proxy object.
2738 */
2739 timedatedObjectProxy *
2740 timedated_object_proxy_new (GDBusConnection *connection,
2741 const gchar *object_path)
2742 {
2743 g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
2744 g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
2745 return TIMEDATED_OBJECT_PROXY (g_object_new (TIMEDATED_TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));
2746 }
2747
2748 /**
2749 * timedatedObjectSkeleton:
2750 *
2751 * The #timedatedObjectSkeleton structure contains only private data and should only be accessed using the provided API.
2752 */
2753
2754 /**
2755 * timedatedObjectSkeletonClass:
2756 * @parent_class: The parent class.
2757 *
2758 * Class structure for #timedatedObjectSkeleton.
2759 */
2760
2761 static void
2762 timedated_object_skeleton__timedated_object_iface_init (timedatedObjectIface *iface G_GNUC_UNUSED)
2763 {
2764 }
2765
2766
2767 static void
2768 timedated_object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)
2769 {
2770 iface->interface_added = timedated_object_notify;
2771 iface->interface_removed = timedated_object_notify;
2772 }
2773
2774 G_DEFINE_TYPE_WITH_CODE (timedatedObjectSkeleton, timedated_object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,
2775 G_IMPLEMENT_INTERFACE (TIMEDATED_TYPE_OBJECT, timedated_object_skeleton__timedated_object_iface_init)
2776 G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, timedated_object_skeleton__g_dbus_object_iface_init));
2777
2778 static void
2779 timedated_object_skeleton_init (timedatedObjectSkeleton *object G_GNUC_UNUSED)
2780 {
2781 }
2782
2783 static void
2784 timedated_object_skeleton_set_property (GObject *gobject,
2785 guint prop_id,
2786 const GValue *value,
2787 GParamSpec *pspec)
2788 {
2789 timedatedObjectSkeleton *object = TIMEDATED_OBJECT_SKELETON (gobject);
2790 GDBusInterfaceSkeleton *interface;
2791
2792 switch (prop_id)
2793 {
2794 case 1:
2795 interface = g_value_get_object (value);
2796 if (interface != NULL)
2797 {
2798 g_warn_if_fail (TIMEDATED_IS_TIMEDATE1 (interface));
2799 g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
2800 }
2801 else
2802 {
2803 g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.freedesktop.timedate1");
2804 }
2805 break;
2806
2807 default:
2808 G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
2809 break;
2810 }
2811 }
2812
2813 static void
2814 timedated_object_skeleton_get_property (GObject *gobject,
2815 guint prop_id,
2816 GValue *value,
2817 GParamSpec *pspec)
2818 {
2819 timedatedObjectSkeleton *object = TIMEDATED_OBJECT_SKELETON (gobject);
2820 GDBusInterface *interface;
2821
2822 switch (prop_id)
2823 {
2824 case 1:
2825 interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.timedate1");
2826 g_value_take_object (value, interface);
2827 break;
2828
2829 default:
2830 G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
2831 break;
2832 }
2833 }
2834
2835 static void
2836 timedated_object_skeleton_class_init (timedatedObjectSkeletonClass *klass)
2837 {
2838 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
2839
2840 gobject_class->set_property = timedated_object_skeleton_set_property;
2841 gobject_class->get_property = timedated_object_skeleton_get_property;
2842
2843 g_object_class_override_property (gobject_class, 1, "timedate1");
2844 }
2845
2846 /**
2847 * timedated_object_skeleton_new:
2848 * @object_path: An object path.
2849 *
2850 * Creates a new skeleton object.
2851 *
2852 * Returns: (transfer full): The skeleton object.
2853 */
2854 timedatedObjectSkeleton *
2855 timedated_object_skeleton_new (const gchar *object_path)
2856 {
2857 g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
2858 return TIMEDATED_OBJECT_SKELETON (g_object_new (TIMEDATED_TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));
2859 }
2860
2861 /**
2862 * timedated_object_skeleton_set_timedate1:
2863 * @object: A #timedatedObjectSkeleton.
2864 * @interface_: (allow-none): A #timedatedTimedate1 or %NULL to clear the interface.
2865 *
2866 * Sets the #timedatedTimedate1 instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link> on @object.
2867 */
2868 void timedated_object_skeleton_set_timedate1 (timedatedObjectSkeleton *object, timedatedTimedate1 *interface_)
2869 {
2870 g_object_set (G_OBJECT (object), "timedate1", interface_, NULL);
2871 }
2872
2873
2874 /* ------------------------------------------------------------------------
2875 * Code for ObjectManager client
2876 * ------------------------------------------------------------------------
2877 */
2878
2879 /**
2880 * SECTION:timedatedObjectManagerClient
2881 * @title: timedatedObjectManagerClient
2882 * @short_description: Generated GDBusObjectManagerClient type
2883 *
2884 * This section contains a #GDBusObjectManagerClient that uses timedated_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc.
2885 */
2886
2887 /**
2888 * timedatedObjectManagerClient:
2889 *
2890 * The #timedatedObjectManagerClient structure contains only private data and should only be accessed using the provided API.
2891 */
2892
2893 /**
2894 * timedatedObjectManagerClientClass:
2895 * @parent_class: The parent class.
2896 *
2897 * Class structure for #timedatedObjectManagerClient.
2898 */
2899
2900 G_DEFINE_TYPE (timedatedObjectManagerClient, timedated_object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT);
2901
2902 static void
2903 timedated_object_manager_client_init (timedatedObjectManagerClient *manager G_GNUC_UNUSED)
2904 {
2905 }
2906
2907 static void
2908 timedated_object_manager_client_class_init (timedatedObjectManagerClientClass *klass G_GNUC_UNUSED)
2909 {
2910 }
2911
2912 /**
2913 * timedated_object_manager_client_get_proxy_type:
2914 * @manager: A #GDBusObjectManagerClient.
2915 * @object_path: The object path of the remote object (unused).
2916 * @interface_name: (allow-none): Interface name of the remote object or %NULL to get the object proxy #GType.
2917 * @user_data: User data (unused).
2918 *
2919 * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy<!-- -->- and #GDBusProxy<!-- -->-derived types.
2920 *
2921 * Returns: A #GDBusProxy<!-- -->-derived #GType if @interface_name is not %NULL, otherwise the #GType for #timedatedObjectProxy.
2922 */
2923 GType
2924 timedated_object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED)
2925 {
2926 static gsize once_init_value = 0;
2927 static GHashTable *lookup_hash;
2928 GType ret;
2929
2930 if (interface_name == NULL)
2931 return TIMEDATED_TYPE_OBJECT_PROXY;
2932 if (g_once_init_enter (&once_init_value))
2933 {
2934 lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
2935 g_hash_table_insert (lookup_hash, (gpointer) "org.freedesktop.timedate1", GSIZE_TO_POINTER (TIMEDATED_TYPE_TIMEDATE1_PROXY));
2936 g_once_init_leave (&once_init_value, 1);
2937 }
2938 ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name));
2939 if (ret == (GType) 0)
2940 ret = G_TYPE_DBUS_PROXY;
2941 return ret;
2942 }
2943
2944 /**
2945 * timedated_object_manager_client_new:
2946 * @connection: A #GDBusConnection.
2947 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
2948 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
2949 * @object_path: An object path.
2950 * @cancellable: (allow-none): A #GCancellable or %NULL.
2951 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
2952 * @user_data: User data to pass to @callback.
2953 *
2954 * Asynchronously creates #GDBusObjectManagerClient using timedated_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details.
2955 *
2956 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
2957 * You can then call timedated_object_manager_client_new_finish() to get the result of the operation.
2958 *
2959 * See timedated_object_manager_client_new_sync() for the synchronous, blocking version of this constructor.
2960 */
2961 void
2962 timedated_object_manager_client_new (
2963 GDBusConnection *connection,
2964 GDBusObjectManagerClientFlags flags,
2965 const gchar *name,
2966 const gchar *object_path,
2967 GCancellable *cancellable,
2968 GAsyncReadyCallback callback,
2969 gpointer user_data)
2970 {
2971 g_async_initable_new_async (TIMEDATED_TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", timedated_object_manager_client_get_proxy_type, NULL);
2972 }
2973
2974 /**
2975 * timedated_object_manager_client_new_finish:
2976 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_object_manager_client_new().
2977 * @error: Return location for error or %NULL
2978 *
2979 * Finishes an operation started with timedated_object_manager_client_new().
2980 *
2981 * Returns: (transfer full) (type timedatedObjectManagerClient): The constructed object manager client or %NULL if @error is set.
2982 */
2983 GDBusObjectManager *
2984 timedated_object_manager_client_new_finish (
2985 GAsyncResult *res,
2986 GError **error)
2987 {
2988 GObject *ret;
2989 GObject *source_object;
2990 source_object = g_async_result_get_source_object (res);
2991 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
2992 g_object_unref (source_object);
2993 if (ret != NULL)
2994 return G_DBUS_OBJECT_MANAGER (ret);
2995 else
2996 return NULL;
2997 }
2998
2999 /**
3000 * timedated_object_manager_client_new_sync:
3001 * @connection: A #GDBusConnection.
3002 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
3003 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
3004 * @object_path: An object path.
3005 * @cancellable: (allow-none): A #GCancellable or %NULL.
3006 * @error: Return location for error or %NULL
3007 *
3008 * Synchronously creates #GDBusObjectManagerClient using timedated_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details.
3009 *
3010 * The calling thread is blocked until a reply is received.
3011 *
3012 * See timedated_object_manager_client_new() for the asynchronous version of this constructor.
3013 *
3014 * Returns: (transfer full) (type timedatedObjectManagerClient): The constructed object manager client or %NULL if @error is set.
3015 */
3016 GDBusObjectManager *
3017 timedated_object_manager_client_new_sync (
3018 GDBusConnection *connection,
3019 GDBusObjectManagerClientFlags flags,
3020 const gchar *name,
3021 const gchar *object_path,
3022 GCancellable *cancellable,
3023 GError **error)
3024 {
3025 GInitable *ret;
3026 ret = g_initable_new (TIMEDATED_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", timedated_object_manager_client_get_proxy_type, NULL);
3027 if (ret != NULL)
3028 return G_DBUS_OBJECT_MANAGER (ret);
3029 else
3030 return NULL;
3031 }
3032
3033
3034 /**
3035 * timedated_object_manager_client_new_for_bus:
3036 * @bus_type: A #GBusType.
3037 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
3038 * @name: A bus name (well-known or unique).
3039 * @object_path: An object path.
3040 * @cancellable: (allow-none): A #GCancellable or %NULL.
3041 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
3042 * @user_data: User data to pass to @callback.
3043 *
3044 * Like timedated_object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection.
3045 *
3046 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
3047 * You can then call timedated_object_manager_client_new_for_bus_finish() to get the result of the operation.
3048 *
3049 * See timedated_object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor.
3050 */
3051 void
3052 timedated_object_manager_client_new_for_bus (
3053 GBusType bus_type,
3054 GDBusObjectManagerClientFlags flags,
3055 const gchar *name,
3056 const gchar *object_path,
3057 GCancellable *cancellable,
3058 GAsyncReadyCallback callback,
3059 gpointer user_data)
3060 {
3061 g_async_initable_new_async (TIMEDATED_TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", timedated_object_manager_client_get_proxy_type, NULL);
3062 }
3063
3064 /**
3065 * timedated_object_manager_client_new_for_bus_finish:
3066 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_object_manager_client_new_for_bus().
3067 * @error: Return location for error or %NULL
3068 *
3069 * Finishes an operation started with timedated_object_manager_client_new_for_bus().
3070 *
3071 * Returns: (transfer full) (type timedatedObjectManagerClient): The constructed object manager client or %NULL if @error is set.
3072 */
3073 GDBusObjectManager *
3074 timedated_object_manager_client_new_for_bus_finish (
3075 GAsyncResult *res,
3076 GError **error)
3077 {
3078 GObject *ret;
3079 GObject *source_object;
3080 source_object = g_async_result_get_source_object (res);
3081 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
3082 g_object_unref (source_object);
3083 if (ret != NULL)
3084 return G_DBUS_OBJECT_MANAGER (ret);
3085 else
3086 return NULL;
3087 }
3088
3089 /**
3090 * timedated_object_manager_client_new_for_bus_sync:
3091 * @bus_type: A #GBusType.
3092 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
3093 * @name: A bus name (well-known or unique).
3094 * @object_path: An object path.
3095 * @cancellable: (allow-none): A #GCancellable or %NULL.
3096 * @error: Return location for error or %NULL
3097 *
3098 * Like timedated_object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection.
3099 *
3100 * The calling thread is blocked until a reply is received.
3101 *
3102 * See timedated_object_manager_client_new_for_bus() for the asynchronous version of this constructor.
3103 *
3104 * Returns: (transfer full) (type timedatedObjectManagerClient): The constructed object manager client or %NULL if @error is set.
3105 */
3106 GDBusObjectManager *
3107 timedated_object_manager_client_new_for_bus_sync (
3108 GBusType bus_type,
3109 GDBusObjectManagerClientFlags flags,
3110 const gchar *name,
3111 const gchar *object_path,
3112 GCancellable *cancellable,
3113 GError **error)
3114 {
3115 GInitable *ret;
3116 ret = g_initable_new (TIMEDATED_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", timedated_object_manager_client_get_proxy_type, NULL);
3117 if (ret != NULL)
3118 return G_DBUS_OBJECT_MANAGER (ret);
3119 else
3120 return NULL;
3121 }
3122
3123