86cb7727 |
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 | |
ae3d717a |
11 | #include "timedated-gen.h" |
86cb7727 |
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 | /** |
ae3d717a |
157 | * SECTION:timedatedTimedate1 |
158 | * @title: timedatedTimedate1 |
86cb7727 |
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 | |
ae3d717a |
166 | static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_time_IN_ARG_unnamed_arg0 = |
86cb7727 |
167 | { |
168 | { |
169 | -1, |
ae3d717a |
170 | (gchar *) "unnamed_arg0", |
86cb7727 |
171 | (gchar *) "x", |
172 | NULL |
173 | }, |
174 | FALSE |
175 | }; |
176 | |
ae3d717a |
177 | static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_time_IN_ARG_unnamed_arg1 = |
86cb7727 |
178 | { |
179 | { |
180 | -1, |
ae3d717a |
181 | (gchar *) "unnamed_arg1", |
86cb7727 |
182 | (gchar *) "b", |
183 | NULL |
184 | }, |
185 | FALSE |
186 | }; |
187 | |
ae3d717a |
188 | static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_time_IN_ARG_unnamed_arg2 = |
86cb7727 |
189 | { |
190 | { |
191 | -1, |
ae3d717a |
192 | (gchar *) "unnamed_arg2", |
86cb7727 |
193 | (gchar *) "b", |
194 | NULL |
195 | }, |
196 | FALSE |
197 | }; |
198 | |
ae3d717a |
199 | static const _ExtendedGDBusArgInfo * const _timedated_timedate1_method_info_set_time_IN_ARG_pointers[] = |
86cb7727 |
200 | { |
ae3d717a |
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, |
86cb7727 |
204 | NULL |
205 | }; |
206 | |
ae3d717a |
207 | static const _ExtendedGDBusMethodInfo _timedated_timedate1_method_info_set_time = |
86cb7727 |
208 | { |
209 | { |
210 | -1, |
211 | (gchar *) "SetTime", |
ae3d717a |
212 | (GDBusArgInfo **) &_timedated_timedate1_method_info_set_time_IN_ARG_pointers, |
86cb7727 |
213 | NULL, |
214 | NULL |
215 | }, |
216 | "handle-set-time", |
217 | FALSE |
218 | }; |
219 | |
ae3d717a |
220 | static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_timezone_IN_ARG_unnamed_arg0 = |
86cb7727 |
221 | { |
222 | { |
223 | -1, |
ae3d717a |
224 | (gchar *) "unnamed_arg0", |
86cb7727 |
225 | (gchar *) "s", |
226 | NULL |
227 | }, |
228 | FALSE |
229 | }; |
230 | |
ae3d717a |
231 | static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_timezone_IN_ARG_unnamed_arg1 = |
86cb7727 |
232 | { |
233 | { |
234 | -1, |
ae3d717a |
235 | (gchar *) "unnamed_arg1", |
86cb7727 |
236 | (gchar *) "b", |
237 | NULL |
238 | }, |
239 | FALSE |
240 | }; |
241 | |
ae3d717a |
242 | static const _ExtendedGDBusArgInfo * const _timedated_timedate1_method_info_set_timezone_IN_ARG_pointers[] = |
86cb7727 |
243 | { |
ae3d717a |
244 | &_timedated_timedate1_method_info_set_timezone_IN_ARG_unnamed_arg0, |
245 | &_timedated_timedate1_method_info_set_timezone_IN_ARG_unnamed_arg1, |
86cb7727 |
246 | NULL |
247 | }; |
248 | |
ae3d717a |
249 | static const _ExtendedGDBusMethodInfo _timedated_timedate1_method_info_set_timezone = |
86cb7727 |
250 | { |
251 | { |
252 | -1, |
253 | (gchar *) "SetTimezone", |
ae3d717a |
254 | (GDBusArgInfo **) &_timedated_timedate1_method_info_set_timezone_IN_ARG_pointers, |
86cb7727 |
255 | NULL, |
256 | NULL |
257 | }, |
258 | "handle-set-timezone", |
259 | FALSE |
260 | }; |
261 | |
ae3d717a |
262 | static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_local_rtc_IN_ARG_unnamed_arg0 = |
86cb7727 |
263 | { |
264 | { |
265 | -1, |
ae3d717a |
266 | (gchar *) "unnamed_arg0", |
86cb7727 |
267 | (gchar *) "b", |
268 | NULL |
269 | }, |
270 | FALSE |
271 | }; |
272 | |
ae3d717a |
273 | static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_local_rtc_IN_ARG_unnamed_arg1 = |
86cb7727 |
274 | { |
275 | { |
276 | -1, |
ae3d717a |
277 | (gchar *) "unnamed_arg1", |
86cb7727 |
278 | (gchar *) "b", |
279 | NULL |
280 | }, |
281 | FALSE |
282 | }; |
283 | |
ae3d717a |
284 | static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_local_rtc_IN_ARG_unnamed_arg2 = |
86cb7727 |
285 | { |
286 | { |
287 | -1, |
ae3d717a |
288 | (gchar *) "unnamed_arg2", |
86cb7727 |
289 | (gchar *) "b", |
290 | NULL |
291 | }, |
292 | FALSE |
293 | }; |
294 | |
ae3d717a |
295 | static const _ExtendedGDBusArgInfo * const _timedated_timedate1_method_info_set_local_rtc_IN_ARG_pointers[] = |
86cb7727 |
296 | { |
ae3d717a |
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, |
86cb7727 |
300 | NULL |
301 | }; |
302 | |
ae3d717a |
303 | static const _ExtendedGDBusMethodInfo _timedated_timedate1_method_info_set_local_rtc = |
86cb7727 |
304 | { |
305 | { |
306 | -1, |
307 | (gchar *) "SetLocalRTC", |
ae3d717a |
308 | (GDBusArgInfo **) &_timedated_timedate1_method_info_set_local_rtc_IN_ARG_pointers, |
86cb7727 |
309 | NULL, |
310 | NULL |
311 | }, |
312 | "handle-set-local-rtc", |
313 | FALSE |
314 | }; |
315 | |
ae3d717a |
316 | static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_ntp_IN_ARG_unnamed_arg0 = |
86cb7727 |
317 | { |
318 | { |
319 | -1, |
ae3d717a |
320 | (gchar *) "unnamed_arg0", |
86cb7727 |
321 | (gchar *) "b", |
322 | NULL |
323 | }, |
324 | FALSE |
325 | }; |
326 | |
ae3d717a |
327 | static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_ntp_IN_ARG_unnamed_arg1 = |
86cb7727 |
328 | { |
329 | { |
330 | -1, |
ae3d717a |
331 | (gchar *) "unnamed_arg1", |
86cb7727 |
332 | (gchar *) "b", |
333 | NULL |
334 | }, |
335 | FALSE |
336 | }; |
337 | |
ae3d717a |
338 | static const _ExtendedGDBusArgInfo * const _timedated_timedate1_method_info_set_ntp_IN_ARG_pointers[] = |
86cb7727 |
339 | { |
ae3d717a |
340 | &_timedated_timedate1_method_info_set_ntp_IN_ARG_unnamed_arg0, |
341 | &_timedated_timedate1_method_info_set_ntp_IN_ARG_unnamed_arg1, |
86cb7727 |
342 | NULL |
343 | }; |
344 | |
ae3d717a |
345 | static const _ExtendedGDBusMethodInfo _timedated_timedate1_method_info_set_ntp = |
86cb7727 |
346 | { |
347 | { |
348 | -1, |
349 | (gchar *) "SetNTP", |
ae3d717a |
350 | (GDBusArgInfo **) &_timedated_timedate1_method_info_set_ntp_IN_ARG_pointers, |
86cb7727 |
351 | NULL, |
352 | NULL |
353 | }, |
354 | "handle-set-ntp", |
355 | FALSE |
356 | }; |
357 | |
ae3d717a |
358 | static const _ExtendedGDBusMethodInfo * const _timedated_timedate1_method_info_pointers[] = |
86cb7727 |
359 | { |
ae3d717a |
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, |
86cb7727 |
364 | NULL |
365 | }; |
366 | |
ae3d717a |
367 | static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_timezone = |
86cb7727 |
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 | |
ae3d717a |
380 | static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_local_rtc = |
86cb7727 |
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 | |
ae3d717a |
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 = |
86cb7727 |
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 | |
ae3d717a |
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[] = |
86cb7727 |
515 | { |
ae3d717a |
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, |
86cb7727 |
523 | NULL |
524 | }; |
525 | |
ae3d717a |
526 | static const _ExtendedGDBusInterfaceInfo _timedated_timedate1_interface_info = |
86cb7727 |
527 | { |
528 | { |
529 | -1, |
530 | (gchar *) "org.freedesktop.timedate1", |
ae3d717a |
531 | (GDBusMethodInfo **) &_timedated_timedate1_method_info_pointers, |
86cb7727 |
532 | NULL, |
ae3d717a |
533 | (GDBusPropertyInfo **) &_timedated_timedate1_property_info_pointers, |
86cb7727 |
534 | NULL |
535 | }, |
536 | "timedate1", |
537 | }; |
538 | |
539 | |
540 | /** |
ae3d717a |
541 | * timedated_timedate1_interface_info: |
86cb7727 |
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 * |
ae3d717a |
548 | timedated_timedate1_interface_info (void) |
86cb7727 |
549 | { |
ae3d717a |
550 | return (GDBusInterfaceInfo *) &_timedated_timedate1_interface_info.parent_struct; |
86cb7727 |
551 | } |
552 | |
553 | /** |
ae3d717a |
554 | * timedated_timedate1_override_properties: |
86cb7727 |
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 | * |
ae3d717a |
558 | * Overrides all #GObject properties in the #timedatedTimedate1 interface for a concrete class. |
86cb7727 |
559 | * The properties are overridden in the order they are defined. |
560 | * |
561 | * Returns: The last property id. |
562 | */ |
563 | guint |
ae3d717a |
564 | timedated_timedate1_override_properties (GObjectClass *klass, guint property_id_begin) |
86cb7727 |
565 | { |
566 | g_object_class_override_property (klass, property_id_begin++, "timezone"); |
567 | g_object_class_override_property (klass, property_id_begin++, "local-rtc"); |
ae3d717a |
568 | g_object_class_override_property (klass, property_id_begin++, "can-ntp"); |
86cb7727 |
569 | g_object_class_override_property (klass, property_id_begin++, "ntp"); |
ae3d717a |
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"); |
86cb7727 |
573 | return property_id_begin - 1; |
574 | } |
575 | |
576 | |
577 | |
578 | /** |
ae3d717a |
579 | * timedatedTimedate1: |
86cb7727 |
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 | /** |
ae3d717a |
585 | * timedatedTimedate1Iface: |
86cb7727 |
586 | * @parent_iface: The parent interface. |
ae3d717a |
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. |
86cb7727 |
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 | |
ae3d717a |
602 | typedef timedatedTimedate1Iface timedatedTimedate1Interface; |
603 | G_DEFINE_INTERFACE (timedatedTimedate1, timedated_timedate1, G_TYPE_OBJECT); |
86cb7727 |
604 | |
605 | static void |
ae3d717a |
606 | timedated_timedate1_default_init (timedatedTimedate1Iface *iface) |
86cb7727 |
607 | { |
608 | /* GObject signals for incoming D-Bus method calls: */ |
609 | /** |
ae3d717a |
610 | * timedatedTimedate1::handle-set-time: |
611 | * @object: A #timedatedTimedate1. |
86cb7727 |
612 | * @invocation: A #GDBusMethodInvocation. |
ae3d717a |
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. |
86cb7727 |
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 | * |
ae3d717a |
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. |
86cb7727 |
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, |
ae3d717a |
626 | G_STRUCT_OFFSET (timedatedTimedate1Iface, handle_set_time), |
86cb7727 |
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 | /** |
ae3d717a |
635 | * timedatedTimedate1::handle-set-timezone: |
636 | * @object: A #timedatedTimedate1. |
86cb7727 |
637 | * @invocation: A #GDBusMethodInvocation. |
ae3d717a |
638 | * @arg_unnamed_arg0: Argument passed by remote caller. |
639 | * @arg_unnamed_arg1: Argument passed by remote caller. |
86cb7727 |
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 | * |
ae3d717a |
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. |
86cb7727 |
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, |
ae3d717a |
650 | G_STRUCT_OFFSET (timedatedTimedate1Iface, handle_set_timezone), |
86cb7727 |
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 | /** |
ae3d717a |
659 | * timedatedTimedate1::handle-set-local-rtc: |
660 | * @object: A #timedatedTimedate1. |
86cb7727 |
661 | * @invocation: A #GDBusMethodInvocation. |
ae3d717a |
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. |
86cb7727 |
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 | * |
ae3d717a |
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. |
86cb7727 |
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, |
ae3d717a |
675 | G_STRUCT_OFFSET (timedatedTimedate1Iface, handle_set_local_rtc), |
86cb7727 |
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 | /** |
ae3d717a |
684 | * timedatedTimedate1::handle-set-ntp: |
685 | * @object: A #timedatedTimedate1. |
86cb7727 |
686 | * @invocation: A #GDBusMethodInvocation. |
ae3d717a |
687 | * @arg_unnamed_arg0: Argument passed by remote caller. |
688 | * @arg_unnamed_arg1: Argument passed by remote caller. |
86cb7727 |
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 | * |
ae3d717a |
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. |
86cb7727 |
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, |
ae3d717a |
699 | G_STRUCT_OFFSET (timedatedTimedate1Iface, handle_set_ntp), |
86cb7727 |
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 | /** |
ae3d717a |
709 | * timedatedTimedate1:timezone: |
86cb7727 |
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 | /** |
ae3d717a |
718 | * timedatedTimedate1:local-rtc: |
86cb7727 |
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 | /** |
ae3d717a |
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: |
86cb7727 |
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)); |
ae3d717a |
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)); |
86cb7727 |
771 | } |
772 | |
773 | /** |
ae3d717a |
774 | * timedated_timedate1_get_timezone: (skip) |
775 | * @object: A #timedatedTimedate1. |
86cb7727 |
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 | * |
ae3d717a |
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> |
86cb7727 |
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 * |
ae3d717a |
786 | timedated_timedate1_get_timezone (timedatedTimedate1 *object) |
86cb7727 |
787 | { |
ae3d717a |
788 | return TIMEDATED_TIMEDATE1_GET_IFACE (object)->get_timezone (object); |
86cb7727 |
789 | } |
790 | |
791 | /** |
ae3d717a |
792 | * timedated_timedate1_dup_timezone: (skip) |
793 | * @object: A #timedatedTimedate1. |
86cb7727 |
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 * |
ae3d717a |
802 | timedated_timedate1_dup_timezone (timedatedTimedate1 *object) |
86cb7727 |
803 | { |
804 | gchar *value; |
805 | g_object_get (G_OBJECT (object), "timezone", &value, NULL); |
806 | return value; |
807 | } |
808 | |
809 | /** |
ae3d717a |
810 | * timedated_timedate1_set_timezone: (skip) |
811 | * @object: A #timedatedTimedate1. |
86cb7727 |
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 |
ae3d717a |
819 | timedated_timedate1_set_timezone (timedatedTimedate1 *object, const gchar *value) |
86cb7727 |
820 | { |
821 | g_object_set (G_OBJECT (object), "timezone", value, NULL); |
822 | } |
823 | |
824 | /** |
ae3d717a |
825 | * timedated_timedate1_get_local_rtc: (skip) |
826 | * @object: A #timedatedTimedate1. |
86cb7727 |
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 |
ae3d717a |
835 | timedated_timedate1_get_local_rtc (timedatedTimedate1 *object) |
86cb7727 |
836 | { |
ae3d717a |
837 | return TIMEDATED_TIMEDATE1_GET_IFACE (object)->get_local_rtc (object); |
86cb7727 |
838 | } |
839 | |
840 | /** |
ae3d717a |
841 | * timedated_timedate1_set_local_rtc: (skip) |
842 | * @object: A #timedatedTimedate1. |
86cb7727 |
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 |
ae3d717a |
850 | timedated_timedate1_set_local_rtc (timedatedTimedate1 *object, gboolean value) |
86cb7727 |
851 | { |
852 | g_object_set (G_OBJECT (object), "local-rtc", value, NULL); |
853 | } |
854 | |
855 | /** |
ae3d717a |
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. |
86cb7727 |
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 |
ae3d717a |
897 | timedated_timedate1_get_ntp (timedatedTimedate1 *object) |
86cb7727 |
898 | { |
ae3d717a |
899 | return TIMEDATED_TIMEDATE1_GET_IFACE (object)->get_ntp (object); |
86cb7727 |
900 | } |
901 | |
902 | /** |
ae3d717a |
903 | * timedated_timedate1_set_ntp: (skip) |
904 | * @object: A #timedatedTimedate1. |
86cb7727 |
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 |
ae3d717a |
912 | timedated_timedate1_set_ntp (timedatedTimedate1 *object, gboolean value) |
86cb7727 |
913 | { |
914 | g_object_set (G_OBJECT (object), "ntp", value, NULL); |
915 | } |
916 | |
917 | /** |
ae3d717a |
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. |
86cb7727 |
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. |
ae3d717a |
1022 | * You can then call timedated_timedate1_call_set_time_finish() to get the result of the operation. |
86cb7727 |
1023 | * |
ae3d717a |
1024 | * See timedated_timedate1_call_set_time_sync() for the synchronous, blocking version of this method. |
86cb7727 |
1025 | */ |
1026 | void |
ae3d717a |
1027 | timedated_timedate1_call_set_time ( |
1028 | timedatedTimedate1 *proxy, |
1029 | gint64 arg_unnamed_arg0, |
1030 | gboolean arg_unnamed_arg1, |
1031 | gboolean arg_unnamed_arg2, |
86cb7727 |
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)", |
ae3d717a |
1039 | arg_unnamed_arg0, |
1040 | arg_unnamed_arg1, |
1041 | arg_unnamed_arg2), |
86cb7727 |
1042 | G_DBUS_CALL_FLAGS_NONE, |
1043 | -1, |
1044 | cancellable, |
1045 | callback, |
1046 | user_data); |
1047 | } |
1048 | |
1049 | /** |
ae3d717a |
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(). |
86cb7727 |
1053 | * @error: Return location for error or %NULL. |
1054 | * |
ae3d717a |
1055 | * Finishes an operation started with timedated_timedate1_call_set_time(). |
86cb7727 |
1056 | * |
1057 | * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. |
1058 | */ |
1059 | gboolean |
ae3d717a |
1060 | timedated_timedate1_call_set_time_finish ( |
1061 | timedatedTimedate1 *proxy, |
86cb7727 |
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 | /** |
ae3d717a |
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. |
86cb7727 |
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 | * |
ae3d717a |
1087 | * See timedated_timedate1_call_set_time() for the asynchronous version of this method. |
86cb7727 |
1088 | * |
1089 | * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. |
1090 | */ |
1091 | gboolean |
ae3d717a |
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, |
86cb7727 |
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)", |
ae3d717a |
1104 | arg_unnamed_arg0, |
1105 | arg_unnamed_arg1, |
1106 | arg_unnamed_arg2), |
86cb7727 |
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 | /** |
ae3d717a |
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. |
86cb7727 |
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. |
ae3d717a |
1131 | * You can then call timedated_timedate1_call_set_timezone_finish() to get the result of the operation. |
86cb7727 |
1132 | * |
ae3d717a |
1133 | * See timedated_timedate1_call_set_timezone_sync() for the synchronous, blocking version of this method. |
86cb7727 |
1134 | */ |
1135 | void |
ae3d717a |
1136 | timedated_timedate1_call_set_timezone ( |
1137 | timedatedTimedate1 *proxy, |
1138 | const gchar *arg_unnamed_arg0, |
1139 | gboolean arg_unnamed_arg1, |
86cb7727 |
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)", |
ae3d717a |
1147 | arg_unnamed_arg0, |
1148 | arg_unnamed_arg1), |
86cb7727 |
1149 | G_DBUS_CALL_FLAGS_NONE, |
1150 | -1, |
1151 | cancellable, |
1152 | callback, |
1153 | user_data); |
1154 | } |
1155 | |
1156 | /** |
ae3d717a |
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(). |
86cb7727 |
1160 | * @error: Return location for error or %NULL. |
1161 | * |
ae3d717a |
1162 | * Finishes an operation started with timedated_timedate1_call_set_timezone(). |
86cb7727 |
1163 | * |
1164 | * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. |
1165 | */ |
1166 | gboolean |
ae3d717a |
1167 | timedated_timedate1_call_set_timezone_finish ( |
1168 | timedatedTimedate1 *proxy, |
86cb7727 |
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 | /** |
ae3d717a |
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. |
86cb7727 |
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 | * |
ae3d717a |
1193 | * See timedated_timedate1_call_set_timezone() for the asynchronous version of this method. |
86cb7727 |
1194 | * |
1195 | * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. |
1196 | */ |
1197 | gboolean |
ae3d717a |
1198 | timedated_timedate1_call_set_timezone_sync ( |
1199 | timedatedTimedate1 *proxy, |
1200 | const gchar *arg_unnamed_arg0, |
1201 | gboolean arg_unnamed_arg1, |
86cb7727 |
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)", |
ae3d717a |
1209 | arg_unnamed_arg0, |
1210 | arg_unnamed_arg1), |
86cb7727 |
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 | /** |
ae3d717a |
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. |
86cb7727 |
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. |
ae3d717a |
1236 | * You can then call timedated_timedate1_call_set_local_rtc_finish() to get the result of the operation. |
86cb7727 |
1237 | * |
ae3d717a |
1238 | * See timedated_timedate1_call_set_local_rtc_sync() for the synchronous, blocking version of this method. |
86cb7727 |
1239 | */ |
1240 | void |
ae3d717a |
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, |
86cb7727 |
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)", |
ae3d717a |
1253 | arg_unnamed_arg0, |
1254 | arg_unnamed_arg1, |
1255 | arg_unnamed_arg2), |
86cb7727 |
1256 | G_DBUS_CALL_FLAGS_NONE, |
1257 | -1, |
1258 | cancellable, |
1259 | callback, |
1260 | user_data); |
1261 | } |
1262 | |
1263 | /** |
ae3d717a |
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(). |
86cb7727 |
1267 | * @error: Return location for error or %NULL. |
1268 | * |
ae3d717a |
1269 | * Finishes an operation started with timedated_timedate1_call_set_local_rtc(). |
86cb7727 |
1270 | * |
1271 | * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. |
1272 | */ |
1273 | gboolean |
ae3d717a |
1274 | timedated_timedate1_call_set_local_rtc_finish ( |
1275 | timedatedTimedate1 *proxy, |
86cb7727 |
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 | /** |
ae3d717a |
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. |
86cb7727 |
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 | * |
ae3d717a |
1301 | * See timedated_timedate1_call_set_local_rtc() for the asynchronous version of this method. |
86cb7727 |
1302 | * |
1303 | * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. |
1304 | */ |
1305 | gboolean |
ae3d717a |
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, |
86cb7727 |
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)", |
ae3d717a |
1318 | arg_unnamed_arg0, |
1319 | arg_unnamed_arg1, |
1320 | arg_unnamed_arg2), |
86cb7727 |
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 | /** |
ae3d717a |
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. |
86cb7727 |
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. |
ae3d717a |
1345 | * You can then call timedated_timedate1_call_set_ntp_finish() to get the result of the operation. |
86cb7727 |
1346 | * |
ae3d717a |
1347 | * See timedated_timedate1_call_set_ntp_sync() for the synchronous, blocking version of this method. |
86cb7727 |
1348 | */ |
1349 | void |
ae3d717a |
1350 | timedated_timedate1_call_set_ntp ( |
1351 | timedatedTimedate1 *proxy, |
1352 | gboolean arg_unnamed_arg0, |
1353 | gboolean arg_unnamed_arg1, |
86cb7727 |
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)", |
ae3d717a |
1361 | arg_unnamed_arg0, |
1362 | arg_unnamed_arg1), |
86cb7727 |
1363 | G_DBUS_CALL_FLAGS_NONE, |
1364 | -1, |
1365 | cancellable, |
1366 | callback, |
1367 | user_data); |
1368 | } |
1369 | |
1370 | /** |
ae3d717a |
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(). |
86cb7727 |
1374 | * @error: Return location for error or %NULL. |
1375 | * |
ae3d717a |
1376 | * Finishes an operation started with timedated_timedate1_call_set_ntp(). |
86cb7727 |
1377 | * |
1378 | * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. |
1379 | */ |
1380 | gboolean |
ae3d717a |
1381 | timedated_timedate1_call_set_ntp_finish ( |
1382 | timedatedTimedate1 *proxy, |
86cb7727 |
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 | /** |
ae3d717a |
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. |
86cb7727 |
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 | * |
ae3d717a |
1407 | * See timedated_timedate1_call_set_ntp() for the asynchronous version of this method. |
86cb7727 |
1408 | * |
1409 | * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. |
1410 | */ |
1411 | gboolean |
ae3d717a |
1412 | timedated_timedate1_call_set_ntp_sync ( |
1413 | timedatedTimedate1 *proxy, |
1414 | gboolean arg_unnamed_arg0, |
1415 | gboolean arg_unnamed_arg1, |
86cb7727 |
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)", |
ae3d717a |
1423 | arg_unnamed_arg0, |
1424 | arg_unnamed_arg1), |
86cb7727 |
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 | /** |
ae3d717a |
1439 | * timedated_timedate1_complete_set_time: |
1440 | * @object: A #timedatedTimedate1. |
86cb7727 |
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 |
ae3d717a |
1448 | timedated_timedate1_complete_set_time ( |
1449 | timedatedTimedate1 *object, |
86cb7727 |
1450 | GDBusMethodInvocation *invocation) |
1451 | { |
1452 | g_dbus_method_invocation_return_value (invocation, |
1453 | g_variant_new ("()")); |
1454 | } |
1455 | |
1456 | /** |
ae3d717a |
1457 | * timedated_timedate1_complete_set_timezone: |
1458 | * @object: A #timedatedTimedate1. |
86cb7727 |
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 |
ae3d717a |
1466 | timedated_timedate1_complete_set_timezone ( |
1467 | timedatedTimedate1 *object, |
86cb7727 |
1468 | GDBusMethodInvocation *invocation) |
1469 | { |
1470 | g_dbus_method_invocation_return_value (invocation, |
1471 | g_variant_new ("()")); |
1472 | } |
1473 | |
1474 | /** |
ae3d717a |
1475 | * timedated_timedate1_complete_set_local_rtc: |
1476 | * @object: A #timedatedTimedate1. |
86cb7727 |
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 |
ae3d717a |
1484 | timedated_timedate1_complete_set_local_rtc ( |
1485 | timedatedTimedate1 *object, |
86cb7727 |
1486 | GDBusMethodInvocation *invocation) |
1487 | { |
1488 | g_dbus_method_invocation_return_value (invocation, |
1489 | g_variant_new ("()")); |
1490 | } |
1491 | |
1492 | /** |
ae3d717a |
1493 | * timedated_timedate1_complete_set_ntp: |
1494 | * @object: A #timedatedTimedate1. |
86cb7727 |
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 |
ae3d717a |
1502 | timedated_timedate1_complete_set_ntp ( |
1503 | timedatedTimedate1 *object, |
86cb7727 |
1504 | GDBusMethodInvocation *invocation) |
1505 | { |
1506 | g_dbus_method_invocation_return_value (invocation, |
1507 | g_variant_new ("()")); |
1508 | } |
1509 | |
1510 | /* ------------------------------------------------------------------------ */ |
1511 | |
1512 | /** |
ae3d717a |
1513 | * timedatedTimedate1Proxy: |
86cb7727 |
1514 | * |
ae3d717a |
1515 | * The #timedatedTimedate1Proxy structure contains only private data and should only be accessed using the provided API. |
86cb7727 |
1516 | */ |
1517 | |
1518 | /** |
ae3d717a |
1519 | * timedatedTimedate1ProxyClass: |
86cb7727 |
1520 | * @parent_class: The parent class. |
1521 | * |
ae3d717a |
1522 | * Class structure for #timedatedTimedate1Proxy. |
86cb7727 |
1523 | */ |
1524 | |
ae3d717a |
1525 | struct _timedatedTimedate1ProxyPrivate |
86cb7727 |
1526 | { |
1527 | GData *qdata; |
1528 | }; |
1529 | |
ae3d717a |
1530 | static void timedated_timedate1_proxy_iface_init (timedatedTimedate1Iface *iface); |
86cb7727 |
1531 | |
1532 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
ae3d717a |
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)); |
86cb7727 |
1536 | |
1537 | #else |
ae3d717a |
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)); |
86cb7727 |
1540 | |
1541 | #endif |
1542 | static void |
ae3d717a |
1543 | timedated_timedate1_proxy_finalize (GObject *object) |
86cb7727 |
1544 | { |
ae3d717a |
1545 | timedatedTimedate1Proxy *proxy = TIMEDATED_TIMEDATE1_PROXY (object); |
86cb7727 |
1546 | g_datalist_clear (&proxy->priv->qdata); |
ae3d717a |
1547 | G_OBJECT_CLASS (timedated_timedate1_proxy_parent_class)->finalize (object); |
86cb7727 |
1548 | } |
1549 | |
1550 | static void |
ae3d717a |
1551 | timedated_timedate1_proxy_get_property (GObject *object, |
86cb7727 |
1552 | guint prop_id, |
1553 | GValue *value, |
1554 | GParamSpec *pspec G_GNUC_UNUSED) |
1555 | { |
1556 | const _ExtendedGDBusPropertyInfo *info; |
1557 | GVariant *variant; |
ae3d717a |
1558 | g_assert (prop_id != 0 && prop_id - 1 < 7); |
1559 | info = _timedated_timedate1_property_info_pointers[prop_id - 1]; |
86cb7727 |
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 |
ae3d717a |
1575 | timedated_timedate1_proxy_set_property_cb (GDBusProxy *proxy, |
86cb7727 |
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 |
ae3d717a |
1598 | timedated_timedate1_proxy_set_property (GObject *object, |
86cb7727 |
1599 | guint prop_id, |
1600 | const GValue *value, |
1601 | GParamSpec *pspec G_GNUC_UNUSED) |
1602 | { |
1603 | const _ExtendedGDBusPropertyInfo *info; |
1604 | GVariant *variant; |
ae3d717a |
1605 | g_assert (prop_id != 0 && prop_id - 1 < 7); |
1606 | info = _timedated_timedate1_property_info_pointers[prop_id - 1]; |
86cb7727 |
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, |
ae3d717a |
1613 | NULL, (GAsyncReadyCallback) timedated_timedate1_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); |
86cb7727 |
1614 | g_variant_unref (variant); |
1615 | } |
1616 | |
1617 | static void |
ae3d717a |
1618 | timedated_timedate1_proxy_g_signal (GDBusProxy *proxy, |
86cb7727 |
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; |
ae3d717a |
1630 | info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_timedated_timedate1_interface_info.parent_struct, signal_name); |
86cb7727 |
1631 | if (info == NULL) |
1632 | return; |
1633 | num_params = g_variant_n_children (parameters); |
1634 | paramv = g_new0 (GValue, num_params + 1); |
ae3d717a |
1635 | g_value_init (¶mv[0], TIMEDATED_TYPE_TIMEDATE1); |
86cb7727 |
1636 | g_value_set_object (¶mv[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 (¶mv[n], G_TYPE_VARIANT); |
1645 | g_value_set_variant (¶mv[n], child); |
1646 | n++; |
1647 | } |
1648 | else |
1649 | g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); |
1650 | g_variant_unref (child); |
1651 | } |
ae3d717a |
1652 | signal_id = g_signal_lookup (info->signal_name, TIMEDATED_TYPE_TIMEDATE1); |
86cb7727 |
1653 | g_signal_emitv (paramv, signal_id, 0, NULL); |
1654 | for (n = 0; n < num_params + 1; n++) |
1655 | g_value_unset (¶mv[n]); |
1656 | g_free (paramv); |
1657 | } |
1658 | |
1659 | static void |
ae3d717a |
1660 | timedated_timedate1_proxy_g_properties_changed (GDBusProxy *_proxy, |
86cb7727 |
1661 | GVariant *changed_properties, |
1662 | const gchar *const *invalidated_properties) |
1663 | { |
ae3d717a |
1664 | timedatedTimedate1Proxy *proxy = TIMEDATED_TIMEDATE1_PROXY (_proxy); |
86cb7727 |
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 | { |
ae3d717a |
1672 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_timedated_timedate1_interface_info.parent_struct, key); |
86cb7727 |
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 | { |
ae3d717a |
1680 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_timedated_timedate1_interface_info.parent_struct, invalidated_properties[n]); |
86cb7727 |
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 * |
ae3d717a |
1688 | timedated_timedate1_proxy_get_timezone (timedatedTimedate1 *object) |
86cb7727 |
1689 | { |
ae3d717a |
1690 | timedatedTimedate1Proxy *proxy = TIMEDATED_TIMEDATE1_PROXY (object); |
86cb7727 |
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 |
ae3d717a |
1703 | timedated_timedate1_proxy_get_local_rtc (timedatedTimedate1 *object) |
86cb7727 |
1704 | { |
ae3d717a |
1705 | timedatedTimedate1Proxy *proxy = TIMEDATED_TIMEDATE1_PROXY (object); |
86cb7727 |
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 |
ae3d717a |
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) |
86cb7727 |
1734 | { |
ae3d717a |
1735 | timedatedTimedate1Proxy *proxy = TIMEDATED_TIMEDATE1_PROXY (object); |
86cb7727 |
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 | |
ae3d717a |
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 | |
86cb7727 |
1792 | static void |
ae3d717a |
1793 | timedated_timedate1_proxy_init (timedatedTimedate1Proxy *proxy) |
86cb7727 |
1794 | { |
1795 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
ae3d717a |
1796 | proxy->priv = timedated_timedate1_proxy_get_instance_private (proxy); |
86cb7727 |
1797 | #else |
ae3d717a |
1798 | proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TIMEDATED_TYPE_TIMEDATE1_PROXY, timedatedTimedate1ProxyPrivate); |
86cb7727 |
1799 | #endif |
1800 | |
ae3d717a |
1801 | g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), timedated_timedate1_interface_info ()); |
86cb7727 |
1802 | } |
1803 | |
1804 | static void |
ae3d717a |
1805 | timedated_timedate1_proxy_class_init (timedatedTimedate1ProxyClass *klass) |
86cb7727 |
1806 | { |
1807 | GObjectClass *gobject_class; |
1808 | GDBusProxyClass *proxy_class; |
1809 | |
1810 | gobject_class = G_OBJECT_CLASS (klass); |
ae3d717a |
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; |
86cb7727 |
1814 | |
1815 | proxy_class = G_DBUS_PROXY_CLASS (klass); |
ae3d717a |
1816 | proxy_class->g_signal = timedated_timedate1_proxy_g_signal; |
1817 | proxy_class->g_properties_changed = timedated_timedate1_proxy_g_properties_changed; |
86cb7727 |
1818 | |
ae3d717a |
1819 | timedated_timedate1_override_properties (gobject_class, 1); |
86cb7727 |
1820 | |
1821 | #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 |
ae3d717a |
1822 | g_type_class_add_private (klass, sizeof (timedatedTimedate1ProxyPrivate)); |
86cb7727 |
1823 | #endif |
1824 | } |
1825 | |
1826 | static void |
ae3d717a |
1827 | timedated_timedate1_proxy_iface_init (timedatedTimedate1Iface *iface) |
86cb7727 |
1828 | { |
ae3d717a |
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; |
86cb7727 |
1836 | } |
1837 | |
1838 | /** |
ae3d717a |
1839 | * timedated_timedate1_proxy_new: |
86cb7727 |
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. |
ae3d717a |
1851 | * You can then call timedated_timedate1_proxy_new_finish() to get the result of the operation. |
86cb7727 |
1852 | * |
ae3d717a |
1853 | * See timedated_timedate1_proxy_new_sync() for the synchronous, blocking version of this constructor. |
86cb7727 |
1854 | */ |
1855 | void |
ae3d717a |
1856 | timedated_timedate1_proxy_new ( |
86cb7727 |
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 | { |
ae3d717a |
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); |
86cb7727 |
1866 | } |
1867 | |
1868 | /** |
ae3d717a |
1869 | * timedated_timedate1_proxy_new_finish: |
1870 | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_timedate1_proxy_new(). |
86cb7727 |
1871 | * @error: Return location for error or %NULL |
1872 | * |
ae3d717a |
1873 | * Finishes an operation started with timedated_timedate1_proxy_new(). |
86cb7727 |
1874 | * |
ae3d717a |
1875 | * Returns: (transfer full) (type timedatedTimedate1Proxy): The constructed proxy object or %NULL if @error is set. |
86cb7727 |
1876 | */ |
ae3d717a |
1877 | timedatedTimedate1 * |
1878 | timedated_timedate1_proxy_new_finish ( |
86cb7727 |
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) |
ae3d717a |
1888 | return TIMEDATED_TIMEDATE1 (ret); |
86cb7727 |
1889 | else |
1890 | return NULL; |
1891 | } |
1892 | |
1893 | /** |
ae3d717a |
1894 | * timedated_timedate1_proxy_new_sync: |
86cb7727 |
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 | * |
ae3d717a |
1906 | * See timedated_timedate1_proxy_new() for the asynchronous version of this constructor. |
86cb7727 |
1907 | * |
ae3d717a |
1908 | * Returns: (transfer full) (type timedatedTimedate1Proxy): The constructed proxy object or %NULL if @error is set. |
86cb7727 |
1909 | */ |
ae3d717a |
1910 | timedatedTimedate1 * |
1911 | timedated_timedate1_proxy_new_sync ( |
86cb7727 |
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; |
ae3d717a |
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); |
86cb7727 |
1921 | if (ret != NULL) |
ae3d717a |
1922 | return TIMEDATED_TIMEDATE1 (ret); |
86cb7727 |
1923 | else |
1924 | return NULL; |
1925 | } |
1926 | |
1927 | |
1928 | /** |
ae3d717a |
1929 | * timedated_timedate1_proxy_new_for_bus: |
86cb7727 |
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 | * |
ae3d717a |
1938 | * Like timedated_timedate1_proxy_new() but takes a #GBusType instead of a #GDBusConnection. |
86cb7727 |
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. |
ae3d717a |
1941 | * You can then call timedated_timedate1_proxy_new_for_bus_finish() to get the result of the operation. |
86cb7727 |
1942 | * |
ae3d717a |
1943 | * See timedated_timedate1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. |
86cb7727 |
1944 | */ |
1945 | void |
ae3d717a |
1946 | timedated_timedate1_proxy_new_for_bus ( |
86cb7727 |
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 | { |
ae3d717a |
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); |
86cb7727 |
1956 | } |
1957 | |
1958 | /** |
ae3d717a |
1959 | * timedated_timedate1_proxy_new_for_bus_finish: |
1960 | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_timedate1_proxy_new_for_bus(). |
86cb7727 |
1961 | * @error: Return location for error or %NULL |
1962 | * |
ae3d717a |
1963 | * Finishes an operation started with timedated_timedate1_proxy_new_for_bus(). |
86cb7727 |
1964 | * |
ae3d717a |
1965 | * Returns: (transfer full) (type timedatedTimedate1Proxy): The constructed proxy object or %NULL if @error is set. |
86cb7727 |
1966 | */ |
ae3d717a |
1967 | timedatedTimedate1 * |
1968 | timedated_timedate1_proxy_new_for_bus_finish ( |
86cb7727 |
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) |
ae3d717a |
1978 | return TIMEDATED_TIMEDATE1 (ret); |
86cb7727 |
1979 | else |
1980 | return NULL; |
1981 | } |
1982 | |
1983 | /** |
ae3d717a |
1984 | * timedated_timedate1_proxy_new_for_bus_sync: |
86cb7727 |
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 | * |
ae3d717a |
1992 | * Like timedated_timedate1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. |
86cb7727 |
1993 | * |
1994 | * The calling thread is blocked until a reply is received. |
1995 | * |
ae3d717a |
1996 | * See timedated_timedate1_proxy_new_for_bus() for the asynchronous version of this constructor. |
86cb7727 |
1997 | * |
ae3d717a |
1998 | * Returns: (transfer full) (type timedatedTimedate1Proxy): The constructed proxy object or %NULL if @error is set. |
86cb7727 |
1999 | */ |
ae3d717a |
2000 | timedatedTimedate1 * |
2001 | timedated_timedate1_proxy_new_for_bus_sync ( |
86cb7727 |
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; |
ae3d717a |
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); |
86cb7727 |
2011 | if (ret != NULL) |
ae3d717a |
2012 | return TIMEDATED_TIMEDATE1 (ret); |
86cb7727 |
2013 | else |
2014 | return NULL; |
2015 | } |
2016 | |
2017 | |
2018 | /* ------------------------------------------------------------------------ */ |
2019 | |
2020 | /** |
ae3d717a |
2021 | * timedatedTimedate1Skeleton: |
86cb7727 |
2022 | * |
ae3d717a |
2023 | * The #timedatedTimedate1Skeleton structure contains only private data and should only be accessed using the provided API. |
86cb7727 |
2024 | */ |
2025 | |
2026 | /** |
ae3d717a |
2027 | * timedatedTimedate1SkeletonClass: |
86cb7727 |
2028 | * @parent_class: The parent class. |
2029 | * |
ae3d717a |
2030 | * Class structure for #timedatedTimedate1Skeleton. |
86cb7727 |
2031 | */ |
2032 | |
ae3d717a |
2033 | struct _timedatedTimedate1SkeletonPrivate |
86cb7727 |
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 |
ae3d717a |
2043 | _timedated_timedate1_skeleton_handle_method_call ( |
86cb7727 |
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 | { |
ae3d717a |
2053 | timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (user_data); |
86cb7727 |
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; |
ae3d717a |
2068 | g_value_init (¶mv[n], TIMEDATED_TYPE_TIMEDATE1); |
86cb7727 |
2069 | g_value_set_object (¶mv[n++], skeleton); |
2070 | g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); |
2071 | g_value_set_object (¶mv[n++], invocation); |
2072 | if (info->pass_fdlist) |
2073 | { |
2074 | #ifdef G_OS_UNIX |
2075 | g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); |
2076 | g_value_set_object (¶mv[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 (¶mv[n], G_TYPE_VARIANT); |
2088 | g_value_set_variant (¶mv[n], child); |
2089 | n++; |
2090 | } |
2091 | else |
2092 | g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); |
2093 | g_variant_unref (child); |
2094 | } |
ae3d717a |
2095 | signal_id = g_signal_lookup (info->signal_name, TIMEDATED_TYPE_TIMEDATE1); |
86cb7727 |
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 (¶mv[n]); |
2103 | g_free (paramv); |
2104 | } |
2105 | |
2106 | static GVariant * |
ae3d717a |
2107 | _timedated_timedate1_skeleton_handle_get_property ( |
86cb7727 |
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 | { |
ae3d717a |
2116 | timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (user_data); |
86cb7727 |
2117 | GValue value = G_VALUE_INIT; |
2118 | GParamSpec *pspec; |
2119 | _ExtendedGDBusPropertyInfo *info; |
2120 | GVariant *ret; |
2121 | ret = NULL; |
ae3d717a |
2122 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_timedated_timedate1_interface_info.parent_struct, property_name); |
86cb7727 |
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 |
ae3d717a |
2140 | _timedated_timedate1_skeleton_handle_set_property ( |
86cb7727 |
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 | { |
ae3d717a |
2150 | timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (user_data); |
86cb7727 |
2151 | GValue value = G_VALUE_INIT; |
2152 | GParamSpec *pspec; |
2153 | _ExtendedGDBusPropertyInfo *info; |
2154 | gboolean ret; |
2155 | ret = FALSE; |
ae3d717a |
2156 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_timedated_timedate1_interface_info.parent_struct, property_name); |
86cb7727 |
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 | |
ae3d717a |
2176 | static const GDBusInterfaceVTable _timedated_timedate1_skeleton_vtable = |
86cb7727 |
2177 | { |
ae3d717a |
2178 | _timedated_timedate1_skeleton_handle_method_call, |
2179 | _timedated_timedate1_skeleton_handle_get_property, |
2180 | _timedated_timedate1_skeleton_handle_set_property, |
86cb7727 |
2181 | {NULL} |
2182 | }; |
2183 | |
2184 | static GDBusInterfaceInfo * |
ae3d717a |
2185 | timedated_timedate1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) |
86cb7727 |
2186 | { |
ae3d717a |
2187 | return timedated_timedate1_interface_info (); |
86cb7727 |
2188 | } |
2189 | |
2190 | static GDBusInterfaceVTable * |
ae3d717a |
2191 | timedated_timedate1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) |
86cb7727 |
2192 | { |
ae3d717a |
2193 | return (GDBusInterfaceVTable *) &_timedated_timedate1_skeleton_vtable; |
86cb7727 |
2194 | } |
2195 | |
2196 | static GVariant * |
ae3d717a |
2197 | timedated_timedate1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) |
86cb7727 |
2198 | { |
ae3d717a |
2199 | timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (_skeleton); |
86cb7727 |
2200 | |
2201 | GVariantBuilder builder; |
2202 | guint n; |
2203 | g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); |
ae3d717a |
2204 | if (_timedated_timedate1_interface_info.parent_struct.properties == NULL) |
86cb7727 |
2205 | goto out; |
ae3d717a |
2206 | for (n = 0; _timedated_timedate1_interface_info.parent_struct.properties[n] != NULL; n++) |
86cb7727 |
2207 | { |
ae3d717a |
2208 | GDBusPropertyInfo *info = _timedated_timedate1_interface_info.parent_struct.properties[n]; |
86cb7727 |
2209 | if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) |
2210 | { |
2211 | GVariant *value; |
ae3d717a |
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); |
86cb7727 |
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 | |
ae3d717a |
2225 | static gboolean _timedated_timedate1_emit_changed (gpointer user_data); |
86cb7727 |
2226 | |
2227 | static void |
ae3d717a |
2228 | timedated_timedate1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) |
86cb7727 |
2229 | { |
ae3d717a |
2230 | timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (_skeleton); |
86cb7727 |
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) |
ae3d717a |
2243 | _timedated_timedate1_emit_changed (skeleton); |
86cb7727 |
2244 | } |
2245 | |
ae3d717a |
2246 | static void timedated_timedate1_skeleton_iface_init (timedatedTimedate1Iface *iface); |
86cb7727 |
2247 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
ae3d717a |
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)); |
86cb7727 |
2251 | |
2252 | #else |
ae3d717a |
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)); |
86cb7727 |
2255 | |
2256 | #endif |
2257 | static void |
ae3d717a |
2258 | timedated_timedate1_skeleton_finalize (GObject *object) |
86cb7727 |
2259 | { |
ae3d717a |
2260 | timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object); |
86cb7727 |
2261 | guint n; |
ae3d717a |
2262 | for (n = 0; n < 7; n++) |
86cb7727 |
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); |
ae3d717a |
2270 | G_OBJECT_CLASS (timedated_timedate1_skeleton_parent_class)->finalize (object); |
86cb7727 |
2271 | } |
2272 | |
2273 | static void |
ae3d717a |
2274 | timedated_timedate1_skeleton_get_property (GObject *object, |
86cb7727 |
2275 | guint prop_id, |
2276 | GValue *value, |
2277 | GParamSpec *pspec G_GNUC_UNUSED) |
2278 | { |
ae3d717a |
2279 | timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object); |
2280 | g_assert (prop_id != 0 && prop_id - 1 < 7); |
86cb7727 |
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 |
ae3d717a |
2287 | _timedated_timedate1_emit_changed (gpointer user_data) |
86cb7727 |
2288 | { |
ae3d717a |
2289 | timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (user_data); |
86cb7727 |
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 |
ae3d717a |
2347 | _timedated_timedate1_schedule_emit_changed (timedatedTimedate1Skeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) |
86cb7727 |
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 |
ae3d717a |
2373 | timedated_timedate1_skeleton_notify (GObject *object, |
86cb7727 |
2374 | GParamSpec *pspec G_GNUC_UNUSED) |
2375 | { |
ae3d717a |
2376 | timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object); |
86cb7727 |
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); |
ae3d717a |
2383 | g_source_set_callback (skeleton->priv->changed_properties_idle_source, _timedated_timedate1_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); |
86cb7727 |
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 |
ae3d717a |
2391 | timedated_timedate1_skeleton_set_property (GObject *object, |
86cb7727 |
2392 | guint prop_id, |
2393 | const GValue *value, |
2394 | GParamSpec *pspec) |
2395 | { |
ae3d717a |
2396 | timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object); |
2397 | g_assert (prop_id != 0 && prop_id - 1 < 7); |
86cb7727 |
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) |
ae3d717a |
2403 | _timedated_timedate1_schedule_emit_changed (skeleton, _timedated_timedate1_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]); |
86cb7727 |
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 |
ae3d717a |
2412 | timedated_timedate1_skeleton_init (timedatedTimedate1Skeleton *skeleton) |
86cb7727 |
2413 | { |
2414 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
ae3d717a |
2415 | skeleton->priv = timedated_timedate1_skeleton_get_instance_private (skeleton); |
86cb7727 |
2416 | #else |
ae3d717a |
2417 | skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TIMEDATED_TYPE_TIMEDATE1_SKELETON, timedatedTimedate1SkeletonPrivate); |
86cb7727 |
2418 | #endif |
2419 | |
2420 | g_mutex_init (&skeleton->priv->lock); |
2421 | skeleton->priv->context = g_main_context_ref_thread_default (); |
ae3d717a |
2422 | skeleton->priv->properties = g_new0 (GValue, 7); |
86cb7727 |
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); |
ae3d717a |
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); |
86cb7727 |
2430 | } |
2431 | |
2432 | static const gchar * |
ae3d717a |
2433 | timedated_timedate1_skeleton_get_timezone (timedatedTimedate1 *object) |
86cb7727 |
2434 | { |
ae3d717a |
2435 | timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object); |
86cb7727 |
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 |
ae3d717a |
2444 | timedated_timedate1_skeleton_get_local_rtc (timedatedTimedate1 *object) |
86cb7727 |
2445 | { |
ae3d717a |
2446 | timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object); |
86cb7727 |
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 |
ae3d717a |
2455 | timedated_timedate1_skeleton_get_can_ntp (timedatedTimedate1 *object) |
86cb7727 |
2456 | { |
ae3d717a |
2457 | timedatedTimedate1Skeleton *skeleton = TIMEDATED_TIMEDATE1_SKELETON (object); |
86cb7727 |
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 | |
ae3d717a |
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 | |
86cb7727 |
2509 | static void |
ae3d717a |
2510 | timedated_timedate1_skeleton_class_init (timedatedTimedate1SkeletonClass *klass) |
86cb7727 |
2511 | { |
2512 | GObjectClass *gobject_class; |
2513 | GDBusInterfaceSkeletonClass *skeleton_class; |
2514 | |
2515 | gobject_class = G_OBJECT_CLASS (klass); |
ae3d717a |
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; |
86cb7727 |
2520 | |
2521 | |
ae3d717a |
2522 | timedated_timedate1_override_properties (gobject_class, 1); |
86cb7727 |
2523 | |
2524 | skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); |
ae3d717a |
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; |
86cb7727 |
2529 | |
2530 | #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 |
ae3d717a |
2531 | g_type_class_add_private (klass, sizeof (timedatedTimedate1SkeletonPrivate)); |
86cb7727 |
2532 | #endif |
2533 | } |
2534 | |
2535 | static void |
ae3d717a |
2536 | timedated_timedate1_skeleton_iface_init (timedatedTimedate1Iface *iface) |
86cb7727 |
2537 | { |
ae3d717a |
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; |
86cb7727 |
2545 | } |
2546 | |
2547 | /** |
ae3d717a |
2548 | * timedated_timedate1_skeleton_new: |
86cb7727 |
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 | * |
ae3d717a |
2552 | * Returns: (transfer full) (type timedatedTimedate1Skeleton): The skeleton object. |
86cb7727 |
2553 | */ |
ae3d717a |
2554 | timedatedTimedate1 * |
2555 | timedated_timedate1_skeleton_new (void) |
86cb7727 |
2556 | { |
ae3d717a |
2557 | return TIMEDATED_TIMEDATE1 (g_object_new (TIMEDATED_TYPE_TIMEDATE1_SKELETON, NULL)); |
86cb7727 |
2558 | } |
2559 | |