2 * Generated by gdbus-codegen 2.40.0. DO NOT EDIT.
4 * The license of this code is the same as for the source it was derived from.
11 #include "timedated-gen.h"
15 # include <gio/gunixfdlist.h>
20 GDBusArgInfo parent_struct
;
21 gboolean use_gvariant
;
22 } _ExtendedGDBusArgInfo
;
26 GDBusMethodInfo parent_struct
;
27 const gchar
*signal_name
;
29 } _ExtendedGDBusMethodInfo
;
33 GDBusSignalInfo parent_struct
;
34 const gchar
*signal_name
;
35 } _ExtendedGDBusSignalInfo
;
39 GDBusPropertyInfo parent_struct
;
40 const gchar
*hyphen_name
;
41 gboolean use_gvariant
;
42 } _ExtendedGDBusPropertyInfo
;
46 GDBusInterfaceInfo parent_struct
;
47 const gchar
*hyphen_name
;
48 } _ExtendedGDBusInterfaceInfo
;
52 const _ExtendedGDBusPropertyInfo
*info
;
54 GValue orig_value
; /* the value before the change */
58 _changed_property_free (ChangedProperty
*data
)
60 g_value_unset (&data
->orig_value
);
65 _g_strv_equal0 (gchar
**a
, gchar
**b
)
69 if (a
== NULL
&& b
== NULL
)
74 if (a
== NULL
|| b
== NULL
)
76 if (g_strv_length (a
) != g_strv_length (b
))
78 for (n
= 0; a
[n
] != NULL
; n
++)
79 if (g_strcmp0 (a
[n
], b
[n
]) != 0)
87 _g_variant_equal0 (GVariant
*a
, GVariant
*b
)
90 if (a
== NULL
&& b
== NULL
)
95 if (a
== NULL
|| b
== NULL
)
97 ret
= g_variant_equal (a
, b
);
102 G_GNUC_UNUSED
static gboolean
103 _g_value_equal (const GValue
*a
, const GValue
*b
)
105 gboolean ret
= FALSE
;
106 g_assert (G_VALUE_TYPE (a
) == G_VALUE_TYPE (b
));
107 switch (G_VALUE_TYPE (a
))
110 ret
= (g_value_get_boolean (a
) == g_value_get_boolean (b
));
113 ret
= (g_value_get_uchar (a
) == g_value_get_uchar (b
));
116 ret
= (g_value_get_int (a
) == g_value_get_int (b
));
119 ret
= (g_value_get_uint (a
) == g_value_get_uint (b
));
122 ret
= (g_value_get_int64 (a
) == g_value_get_int64 (b
));
125 ret
= (g_value_get_uint64 (a
) == g_value_get_uint64 (b
));
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;
136 ret
= (g_strcmp0 (g_value_get_string (a
), g_value_get_string (b
)) == 0);
139 ret
= _g_variant_equal0 (g_value_get_variant (a
), g_value_get_variant (b
));
142 if (G_VALUE_TYPE (a
) == G_TYPE_STRV
)
143 ret
= _g_strv_equal0 (g_value_get_boxed (a
), g_value_get_boxed (b
));
145 g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a
)));
151 /* ------------------------------------------------------------------------
152 * Code for interface org.freedesktop.timedate1
153 * ------------------------------------------------------------------------
157 * SECTION:timedatedTimedate1
158 * @title: timedatedTimedate1
159 * @short_description: Generated C code for the org.freedesktop.timedate1 D-Bus interface
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.
164 /* ---- Introspection data for org.freedesktop.timedate1 ---- */
166 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_time_IN_ARG_unnamed_arg0
=
170 (gchar
*) "unnamed_arg0",
177 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_time_IN_ARG_unnamed_arg1
=
181 (gchar
*) "unnamed_arg1",
188 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_time_IN_ARG_unnamed_arg2
=
192 (gchar
*) "unnamed_arg2",
199 static const _ExtendedGDBusArgInfo
* const _timedated_timedate1_method_info_set_time_IN_ARG_pointers
[] =
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
,
207 static const _ExtendedGDBusMethodInfo _timedated_timedate1_method_info_set_time
=
212 (GDBusArgInfo
**) &_timedated_timedate1_method_info_set_time_IN_ARG_pointers
,
220 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_timezone_IN_ARG_unnamed_arg0
=
224 (gchar
*) "unnamed_arg0",
231 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_timezone_IN_ARG_unnamed_arg1
=
235 (gchar
*) "unnamed_arg1",
242 static const _ExtendedGDBusArgInfo
* const _timedated_timedate1_method_info_set_timezone_IN_ARG_pointers
[] =
244 &_timedated_timedate1_method_info_set_timezone_IN_ARG_unnamed_arg0
,
245 &_timedated_timedate1_method_info_set_timezone_IN_ARG_unnamed_arg1
,
249 static const _ExtendedGDBusMethodInfo _timedated_timedate1_method_info_set_timezone
=
253 (gchar
*) "SetTimezone",
254 (GDBusArgInfo
**) &_timedated_timedate1_method_info_set_timezone_IN_ARG_pointers
,
258 "handle-set-timezone",
262 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_local_rtc_IN_ARG_unnamed_arg0
=
266 (gchar
*) "unnamed_arg0",
273 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_local_rtc_IN_ARG_unnamed_arg1
=
277 (gchar
*) "unnamed_arg1",
284 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_local_rtc_IN_ARG_unnamed_arg2
=
288 (gchar
*) "unnamed_arg2",
295 static const _ExtendedGDBusArgInfo
* const _timedated_timedate1_method_info_set_local_rtc_IN_ARG_pointers
[] =
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
,
303 static const _ExtendedGDBusMethodInfo _timedated_timedate1_method_info_set_local_rtc
=
307 (gchar
*) "SetLocalRTC",
308 (GDBusArgInfo
**) &_timedated_timedate1_method_info_set_local_rtc_IN_ARG_pointers
,
312 "handle-set-local-rtc",
316 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_ntp_IN_ARG_unnamed_arg0
=
320 (gchar
*) "unnamed_arg0",
327 static const _ExtendedGDBusArgInfo _timedated_timedate1_method_info_set_ntp_IN_ARG_unnamed_arg1
=
331 (gchar
*) "unnamed_arg1",
338 static const _ExtendedGDBusArgInfo
* const _timedated_timedate1_method_info_set_ntp_IN_ARG_pointers
[] =
340 &_timedated_timedate1_method_info_set_ntp_IN_ARG_unnamed_arg0
,
341 &_timedated_timedate1_method_info_set_ntp_IN_ARG_unnamed_arg1
,
345 static const _ExtendedGDBusMethodInfo _timedated_timedate1_method_info_set_ntp
=
350 (GDBusArgInfo
**) &_timedated_timedate1_method_info_set_ntp_IN_ARG_pointers
,
358 static const _ExtendedGDBusMethodInfo
* const _timedated_timedate1_method_info_pointers
[] =
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
,
367 static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_timezone
=
371 (gchar
*) "Timezone",
373 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
380 static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_local_rtc
=
384 (gchar
*) "LocalRTC",
386 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
393 static const GDBusAnnotationInfo _timedated_timedate1_property_can_ntp_annotation_info_0
=
396 (gchar
*) "org.freedesktop.DBus.Property.EmitsChangedSignal",
401 static const GDBusAnnotationInfo
* const _timedated_timedate1_property_can_ntp_annotation_info_pointers
[] =
403 &_timedated_timedate1_property_can_ntp_annotation_info_0
,
407 static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_can_ntp
=
413 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
414 (GDBusAnnotationInfo
**) &_timedated_timedate1_property_can_ntp_annotation_info_pointers
420 static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_ntp
=
426 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
433 static const GDBusAnnotationInfo _timedated_timedate1_property_ntpsynchronized_annotation_info_0
=
436 (gchar
*) "org.freedesktop.DBus.Property.EmitsChangedSignal",
441 static const GDBusAnnotationInfo
* const _timedated_timedate1_property_ntpsynchronized_annotation_info_pointers
[] =
443 &_timedated_timedate1_property_ntpsynchronized_annotation_info_0
,
447 static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_ntpsynchronized
=
451 (gchar
*) "NTPSynchronized",
453 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
454 (GDBusAnnotationInfo
**) &_timedated_timedate1_property_ntpsynchronized_annotation_info_pointers
460 static const GDBusAnnotationInfo _timedated_timedate1_property_time_usec_annotation_info_0
=
463 (gchar
*) "org.freedesktop.DBus.Property.EmitsChangedSignal",
468 static const GDBusAnnotationInfo
* const _timedated_timedate1_property_time_usec_annotation_info_pointers
[] =
470 &_timedated_timedate1_property_time_usec_annotation_info_0
,
474 static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_time_usec
=
478 (gchar
*) "TimeUSec",
480 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
481 (GDBusAnnotationInfo
**) &_timedated_timedate1_property_time_usec_annotation_info_pointers
487 static const GDBusAnnotationInfo _timedated_timedate1_property_rtctime_usec_annotation_info_0
=
490 (gchar
*) "org.freedesktop.DBus.Property.EmitsChangedSignal",
495 static const GDBusAnnotationInfo
* const _timedated_timedate1_property_rtctime_usec_annotation_info_pointers
[] =
497 &_timedated_timedate1_property_rtctime_usec_annotation_info_0
,
501 static const _ExtendedGDBusPropertyInfo _timedated_timedate1_property_info_rtctime_usec
=
505 (gchar
*) "RTCTimeUSec",
507 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
508 (GDBusAnnotationInfo
**) &_timedated_timedate1_property_rtctime_usec_annotation_info_pointers
514 static const _ExtendedGDBusPropertyInfo
* const _timedated_timedate1_property_info_pointers
[] =
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
,
526 static const _ExtendedGDBusInterfaceInfo _timedated_timedate1_interface_info
=
530 (gchar
*) "org.freedesktop.timedate1",
531 (GDBusMethodInfo
**) &_timedated_timedate1_method_info_pointers
,
533 (GDBusPropertyInfo
**) &_timedated_timedate1_property_info_pointers
,
541 * timedated_timedate1_interface_info:
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.
545 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
548 timedated_timedate1_interface_info (void)
550 return (GDBusInterfaceInfo
*) &_timedated_timedate1_interface_info
.parent_struct
;
554 * timedated_timedate1_override_properties:
555 * @klass: The class structure for a #GObject<!-- -->-derived class.
556 * @property_id_begin: The property id to assign to the first overridden property.
558 * Overrides all #GObject properties in the #timedatedTimedate1 interface for a concrete class.
559 * The properties are overridden in the order they are defined.
561 * Returns: The last property id.
564 timedated_timedate1_override_properties (GObjectClass
*klass
, guint property_id_begin
)
566 g_object_class_override_property (klass
, property_id_begin
++, "timezone");
567 g_object_class_override_property (klass
, property_id_begin
++, "local-rtc");
568 g_object_class_override_property (klass
, property_id_begin
++, "can-ntp");
569 g_object_class_override_property (klass
, property_id_begin
++, "ntp");
570 g_object_class_override_property (klass
, property_id_begin
++, "ntpsynchronized");
571 g_object_class_override_property (klass
, property_id_begin
++, "time-usec");
572 g_object_class_override_property (klass
, property_id_begin
++, "rtctime-usec");
573 return property_id_begin
- 1;
579 * timedatedTimedate1:
581 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link>.
585 * timedatedTimedate1Iface:
586 * @parent_iface: The parent interface.
587 * @handle_set_local_rtc: Handler for the #timedatedTimedate1::handle-set-local-rtc signal.
588 * @handle_set_ntp: Handler for the #timedatedTimedate1::handle-set-ntp signal.
589 * @handle_set_time: Handler for the #timedatedTimedate1::handle-set-time signal.
590 * @handle_set_timezone: Handler for the #timedatedTimedate1::handle-set-timezone signal.
591 * @get_can_ntp: Getter for the #timedatedTimedate1:can-ntp property.
592 * @get_local_rtc: Getter for the #timedatedTimedate1:local-rtc property.
593 * @get_ntp: Getter for the #timedatedTimedate1:ntp property.
594 * @get_ntpsynchronized: Getter for the #timedatedTimedate1:ntpsynchronized property.
595 * @get_rtctime_usec: Getter for the #timedatedTimedate1:rtctime-usec property.
596 * @get_time_usec: Getter for the #timedatedTimedate1:time-usec property.
597 * @get_timezone: Getter for the #timedatedTimedate1:timezone property.
599 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link>.
602 typedef timedatedTimedate1Iface timedatedTimedate1Interface
;
603 G_DEFINE_INTERFACE (timedatedTimedate1
, timedated_timedate1
, G_TYPE_OBJECT
);
606 timedated_timedate1_default_init (timedatedTimedate1Iface
*iface
)
608 /* GObject signals for incoming D-Bus method calls: */
610 * timedatedTimedate1::handle-set-time:
611 * @object: A #timedatedTimedate1.
612 * @invocation: A #GDBusMethodInvocation.
613 * @arg_unnamed_arg0: Argument passed by remote caller.
614 * @arg_unnamed_arg1: Argument passed by remote caller.
615 * @arg_unnamed_arg2: Argument passed by remote caller.
617 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTime">SetTime()</link> D-Bus method.
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.
621 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
623 g_signal_new ("handle-set-time",
624 G_TYPE_FROM_INTERFACE (iface
),
626 G_STRUCT_OFFSET (timedatedTimedate1Iface
, handle_set_time
),
627 g_signal_accumulator_true_handled
,
629 g_cclosure_marshal_generic
,
632 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_INT64
, G_TYPE_BOOLEAN
, G_TYPE_BOOLEAN
);
635 * timedatedTimedate1::handle-set-timezone:
636 * @object: A #timedatedTimedate1.
637 * @invocation: A #GDBusMethodInvocation.
638 * @arg_unnamed_arg0: Argument passed by remote caller.
639 * @arg_unnamed_arg1: Argument passed by remote caller.
641 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTimezone">SetTimezone()</link> D-Bus method.
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.
645 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
647 g_signal_new ("handle-set-timezone",
648 G_TYPE_FROM_INTERFACE (iface
),
650 G_STRUCT_OFFSET (timedatedTimedate1Iface
, handle_set_timezone
),
651 g_signal_accumulator_true_handled
,
653 g_cclosure_marshal_generic
,
656 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_STRING
, G_TYPE_BOOLEAN
);
659 * timedatedTimedate1::handle-set-local-rtc:
660 * @object: A #timedatedTimedate1.
661 * @invocation: A #GDBusMethodInvocation.
662 * @arg_unnamed_arg0: Argument passed by remote caller.
663 * @arg_unnamed_arg1: Argument passed by remote caller.
664 * @arg_unnamed_arg2: Argument passed by remote caller.
666 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-timedate1.SetLocalRTC">SetLocalRTC()</link> D-Bus method.
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.
670 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
672 g_signal_new ("handle-set-local-rtc",
673 G_TYPE_FROM_INTERFACE (iface
),
675 G_STRUCT_OFFSET (timedatedTimedate1Iface
, handle_set_local_rtc
),
676 g_signal_accumulator_true_handled
,
678 g_cclosure_marshal_generic
,
681 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_BOOLEAN
, G_TYPE_BOOLEAN
, G_TYPE_BOOLEAN
);
684 * timedatedTimedate1::handle-set-ntp:
685 * @object: A #timedatedTimedate1.
686 * @invocation: A #GDBusMethodInvocation.
687 * @arg_unnamed_arg0: Argument passed by remote caller.
688 * @arg_unnamed_arg1: Argument passed by remote caller.
690 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-timedate1.SetNTP">SetNTP()</link> D-Bus method.
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.
694 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
696 g_signal_new ("handle-set-ntp",
697 G_TYPE_FROM_INTERFACE (iface
),
699 G_STRUCT_OFFSET (timedatedTimedate1Iface
, handle_set_ntp
),
700 g_signal_accumulator_true_handled
,
702 g_cclosure_marshal_generic
,
705 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_BOOLEAN
, G_TYPE_BOOLEAN
);
707 /* GObject properties for D-Bus properties: */
709 * timedatedTimedate1:timezone:
711 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.Timezone">"Timezone"</link>.
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.
715 g_object_interface_install_property (iface
,
716 g_param_spec_string ("timezone", "Timezone", "Timezone", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
718 * timedatedTimedate1:local-rtc:
720 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.LocalRTC">"LocalRTC"</link>.
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.
724 g_object_interface_install_property (iface
,
725 g_param_spec_boolean ("local-rtc", "LocalRTC", "LocalRTC", FALSE
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
727 * timedatedTimedate1:can-ntp:
729 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.CanNTP">"CanNTP"</link>.
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.
733 g_object_interface_install_property (iface
,
734 g_param_spec_boolean ("can-ntp", "CanNTP", "CanNTP", FALSE
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
736 * timedatedTimedate1:ntp:
738 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.NTP">"NTP"</link>.
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.
742 g_object_interface_install_property (iface
,
743 g_param_spec_boolean ("ntp", "NTP", "NTP", FALSE
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
745 * timedatedTimedate1:ntpsynchronized:
747 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.NTPSynchronized">"NTPSynchronized"</link>.
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.
751 g_object_interface_install_property (iface
,
752 g_param_spec_boolean ("ntpsynchronized", "NTPSynchronized", "NTPSynchronized", FALSE
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
754 * timedatedTimedate1:time-usec:
756 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.TimeUSec">"TimeUSec"</link>.
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.
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
));
763 * timedatedTimedate1:rtctime-usec:
765 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.RTCTimeUSec">"RTCTimeUSec"</link>.
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.
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
));
774 * timedated_timedate1_get_timezone: (skip)
775 * @object: A #timedatedTimedate1.
777 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.Timezone">"Timezone"</link> D-Bus property.
779 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
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>
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.
786 timedated_timedate1_get_timezone (timedatedTimedate1
*object
)
788 return TIMEDATED_TIMEDATE1_GET_IFACE (object
)->get_timezone (object
);
792 * timedated_timedate1_dup_timezone: (skip)
793 * @object: A #timedatedTimedate1.
795 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-timedate1.Timezone">"Timezone"</link> D-Bus property.
797 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
799 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
802 timedated_timedate1_dup_timezone (timedatedTimedate1
*object
)
805 g_object_get (G_OBJECT (object
), "timezone", &value
, NULL
);
810 * timedated_timedate1_set_timezone: (skip)
811 * @object: A #timedatedTimedate1.
812 * @value: The value to set.
814 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.Timezone">"Timezone"</link> D-Bus property to @value.
816 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
819 timedated_timedate1_set_timezone (timedatedTimedate1
*object
, const gchar
*value
)
821 g_object_set (G_OBJECT (object
), "timezone", value
, NULL
);
825 * timedated_timedate1_get_local_rtc: (skip)
826 * @object: A #timedatedTimedate1.
828 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.LocalRTC">"LocalRTC"</link> D-Bus property.
830 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
832 * Returns: The property value.
835 timedated_timedate1_get_local_rtc (timedatedTimedate1
*object
)
837 return TIMEDATED_TIMEDATE1_GET_IFACE (object
)->get_local_rtc (object
);
841 * timedated_timedate1_set_local_rtc: (skip)
842 * @object: A #timedatedTimedate1.
843 * @value: The value to set.
845 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.LocalRTC">"LocalRTC"</link> D-Bus property to @value.
847 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
850 timedated_timedate1_set_local_rtc (timedatedTimedate1
*object
, gboolean value
)
852 g_object_set (G_OBJECT (object
), "local-rtc", value
, NULL
);
856 * timedated_timedate1_get_can_ntp: (skip)
857 * @object: A #timedatedTimedate1.
859 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.CanNTP">"CanNTP"</link> D-Bus property.
861 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
863 * Returns: The property value.
866 timedated_timedate1_get_can_ntp (timedatedTimedate1
*object
)
868 return TIMEDATED_TIMEDATE1_GET_IFACE (object
)->get_can_ntp (object
);
872 * timedated_timedate1_set_can_ntp: (skip)
873 * @object: A #timedatedTimedate1.
874 * @value: The value to set.
876 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.CanNTP">"CanNTP"</link> D-Bus property to @value.
878 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
881 timedated_timedate1_set_can_ntp (timedatedTimedate1
*object
, gboolean value
)
883 g_object_set (G_OBJECT (object
), "can-ntp", value
, NULL
);
887 * timedated_timedate1_get_ntp: (skip)
888 * @object: A #timedatedTimedate1.
890 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.NTP">"NTP"</link> D-Bus property.
892 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
894 * Returns: The property value.
897 timedated_timedate1_get_ntp (timedatedTimedate1
*object
)
899 return TIMEDATED_TIMEDATE1_GET_IFACE (object
)->get_ntp (object
);
903 * timedated_timedate1_set_ntp: (skip)
904 * @object: A #timedatedTimedate1.
905 * @value: The value to set.
907 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.NTP">"NTP"</link> D-Bus property to @value.
909 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
912 timedated_timedate1_set_ntp (timedatedTimedate1
*object
, gboolean value
)
914 g_object_set (G_OBJECT (object
), "ntp", value
, NULL
);
918 * timedated_timedate1_get_ntpsynchronized: (skip)
919 * @object: A #timedatedTimedate1.
921 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.NTPSynchronized">"NTPSynchronized"</link> D-Bus property.
923 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
925 * Returns: The property value.
928 timedated_timedate1_get_ntpsynchronized (timedatedTimedate1
*object
)
930 return TIMEDATED_TIMEDATE1_GET_IFACE (object
)->get_ntpsynchronized (object
);
934 * timedated_timedate1_set_ntpsynchronized: (skip)
935 * @object: A #timedatedTimedate1.
936 * @value: The value to set.
938 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.NTPSynchronized">"NTPSynchronized"</link> D-Bus property to @value.
940 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
943 timedated_timedate1_set_ntpsynchronized (timedatedTimedate1
*object
, gboolean value
)
945 g_object_set (G_OBJECT (object
), "ntpsynchronized", value
, NULL
);
949 * timedated_timedate1_get_time_usec: (skip)
950 * @object: A #timedatedTimedate1.
952 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.TimeUSec">"TimeUSec"</link> D-Bus property.
954 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
956 * Returns: The property value.
959 timedated_timedate1_get_time_usec (timedatedTimedate1
*object
)
961 return TIMEDATED_TIMEDATE1_GET_IFACE (object
)->get_time_usec (object
);
965 * timedated_timedate1_set_time_usec: (skip)
966 * @object: A #timedatedTimedate1.
967 * @value: The value to set.
969 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.TimeUSec">"TimeUSec"</link> D-Bus property to @value.
971 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
974 timedated_timedate1_set_time_usec (timedatedTimedate1
*object
, guint64 value
)
976 g_object_set (G_OBJECT (object
), "time-usec", value
, NULL
);
980 * timedated_timedate1_get_rtctime_usec: (skip)
981 * @object: A #timedatedTimedate1.
983 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.RTCTimeUSec">"RTCTimeUSec"</link> D-Bus property.
985 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
987 * Returns: The property value.
990 timedated_timedate1_get_rtctime_usec (timedatedTimedate1
*object
)
992 return TIMEDATED_TIMEDATE1_GET_IFACE (object
)->get_rtctime_usec (object
);
996 * timedated_timedate1_set_rtctime_usec: (skip)
997 * @object: A #timedatedTimedate1.
998 * @value: The value to set.
1000 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.RTCTimeUSec">"RTCTimeUSec"</link> D-Bus property to @value.
1002 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1005 timedated_timedate1_set_rtctime_usec (timedatedTimedate1
*object
, guint64 value
)
1007 g_object_set (G_OBJECT (object
), "rtctime-usec", value
, NULL
);
1011 * timedated_timedate1_call_set_time:
1012 * @proxy: A #timedatedTimedate1Proxy.
1013 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1014 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1015 * @arg_unnamed_arg2: Argument to pass with the method invocation.
1016 * @cancellable: (allow-none): A #GCancellable or %NULL.
1017 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1018 * @user_data: User data to pass to @callback.
1020 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTime">SetTime()</link> D-Bus method on @proxy.
1021 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1022 * You can then call timedated_timedate1_call_set_time_finish() to get the result of the operation.
1024 * See timedated_timedate1_call_set_time_sync() for the synchronous, blocking version of this method.
1027 timedated_timedate1_call_set_time (
1028 timedatedTimedate1
*proxy
,
1029 gint64 arg_unnamed_arg0
,
1030 gboolean arg_unnamed_arg1
,
1031 gboolean arg_unnamed_arg2
,
1032 GCancellable
*cancellable
,
1033 GAsyncReadyCallback callback
,
1036 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
1038 g_variant_new ("(xbb)",
1042 G_DBUS_CALL_FLAGS_NONE
,
1050 * timedated_timedate1_call_set_time_finish:
1051 * @proxy: A #timedatedTimedate1Proxy.
1052 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_timedate1_call_set_time().
1053 * @error: Return location for error or %NULL.
1055 * Finishes an operation started with timedated_timedate1_call_set_time().
1057 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1060 timedated_timedate1_call_set_time_finish (
1061 timedatedTimedate1
*proxy
,
1066 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
1069 g_variant_get (_ret
,
1071 g_variant_unref (_ret
);
1073 return _ret
!= NULL
;
1077 * timedated_timedate1_call_set_time_sync:
1078 * @proxy: A #timedatedTimedate1Proxy.
1079 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1080 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1081 * @arg_unnamed_arg2: Argument to pass with the method invocation.
1082 * @cancellable: (allow-none): A #GCancellable or %NULL.
1083 * @error: Return location for error or %NULL.
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.
1087 * See timedated_timedate1_call_set_time() for the asynchronous version of this method.
1089 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1092 timedated_timedate1_call_set_time_sync (
1093 timedatedTimedate1
*proxy
,
1094 gint64 arg_unnamed_arg0
,
1095 gboolean arg_unnamed_arg1
,
1096 gboolean arg_unnamed_arg2
,
1097 GCancellable
*cancellable
,
1101 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
1103 g_variant_new ("(xbb)",
1107 G_DBUS_CALL_FLAGS_NONE
,
1113 g_variant_get (_ret
,
1115 g_variant_unref (_ret
);
1117 return _ret
!= NULL
;
1121 * timedated_timedate1_call_set_timezone:
1122 * @proxy: A #timedatedTimedate1Proxy.
1123 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1124 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1125 * @cancellable: (allow-none): A #GCancellable or %NULL.
1126 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1127 * @user_data: User data to pass to @callback.
1129 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTimezone">SetTimezone()</link> D-Bus method on @proxy.
1130 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1131 * You can then call timedated_timedate1_call_set_timezone_finish() to get the result of the operation.
1133 * See timedated_timedate1_call_set_timezone_sync() for the synchronous, blocking version of this method.
1136 timedated_timedate1_call_set_timezone (
1137 timedatedTimedate1
*proxy
,
1138 const gchar
*arg_unnamed_arg0
,
1139 gboolean arg_unnamed_arg1
,
1140 GCancellable
*cancellable
,
1141 GAsyncReadyCallback callback
,
1144 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
1146 g_variant_new ("(sb)",
1149 G_DBUS_CALL_FLAGS_NONE
,
1157 * timedated_timedate1_call_set_timezone_finish:
1158 * @proxy: A #timedatedTimedate1Proxy.
1159 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_timedate1_call_set_timezone().
1160 * @error: Return location for error or %NULL.
1162 * Finishes an operation started with timedated_timedate1_call_set_timezone().
1164 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1167 timedated_timedate1_call_set_timezone_finish (
1168 timedatedTimedate1
*proxy
,
1173 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
1176 g_variant_get (_ret
,
1178 g_variant_unref (_ret
);
1180 return _ret
!= NULL
;
1184 * timedated_timedate1_call_set_timezone_sync:
1185 * @proxy: A #timedatedTimedate1Proxy.
1186 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1187 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1188 * @cancellable: (allow-none): A #GCancellable or %NULL.
1189 * @error: Return location for error or %NULL.
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.
1193 * See timedated_timedate1_call_set_timezone() for the asynchronous version of this method.
1195 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1198 timedated_timedate1_call_set_timezone_sync (
1199 timedatedTimedate1
*proxy
,
1200 const gchar
*arg_unnamed_arg0
,
1201 gboolean arg_unnamed_arg1
,
1202 GCancellable
*cancellable
,
1206 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
1208 g_variant_new ("(sb)",
1211 G_DBUS_CALL_FLAGS_NONE
,
1217 g_variant_get (_ret
,
1219 g_variant_unref (_ret
);
1221 return _ret
!= NULL
;
1225 * timedated_timedate1_call_set_local_rtc:
1226 * @proxy: A #timedatedTimedate1Proxy.
1227 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1228 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1229 * @arg_unnamed_arg2: Argument to pass with the method invocation.
1230 * @cancellable: (allow-none): A #GCancellable or %NULL.
1231 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1232 * @user_data: User data to pass to @callback.
1234 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetLocalRTC">SetLocalRTC()</link> D-Bus method on @proxy.
1235 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1236 * You can then call timedated_timedate1_call_set_local_rtc_finish() to get the result of the operation.
1238 * See timedated_timedate1_call_set_local_rtc_sync() for the synchronous, blocking version of this method.
1241 timedated_timedate1_call_set_local_rtc (
1242 timedatedTimedate1
*proxy
,
1243 gboolean arg_unnamed_arg0
,
1244 gboolean arg_unnamed_arg1
,
1245 gboolean arg_unnamed_arg2
,
1246 GCancellable
*cancellable
,
1247 GAsyncReadyCallback callback
,
1250 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
1252 g_variant_new ("(bbb)",
1256 G_DBUS_CALL_FLAGS_NONE
,
1264 * timedated_timedate1_call_set_local_rtc_finish:
1265 * @proxy: A #timedatedTimedate1Proxy.
1266 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_timedate1_call_set_local_rtc().
1267 * @error: Return location for error or %NULL.
1269 * Finishes an operation started with timedated_timedate1_call_set_local_rtc().
1271 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1274 timedated_timedate1_call_set_local_rtc_finish (
1275 timedatedTimedate1
*proxy
,
1280 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
1283 g_variant_get (_ret
,
1285 g_variant_unref (_ret
);
1287 return _ret
!= NULL
;
1291 * timedated_timedate1_call_set_local_rtc_sync:
1292 * @proxy: A #timedatedTimedate1Proxy.
1293 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1294 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1295 * @arg_unnamed_arg2: Argument to pass with the method invocation.
1296 * @cancellable: (allow-none): A #GCancellable or %NULL.
1297 * @error: Return location for error or %NULL.
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.
1301 * See timedated_timedate1_call_set_local_rtc() for the asynchronous version of this method.
1303 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1306 timedated_timedate1_call_set_local_rtc_sync (
1307 timedatedTimedate1
*proxy
,
1308 gboolean arg_unnamed_arg0
,
1309 gboolean arg_unnamed_arg1
,
1310 gboolean arg_unnamed_arg2
,
1311 GCancellable
*cancellable
,
1315 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
1317 g_variant_new ("(bbb)",
1321 G_DBUS_CALL_FLAGS_NONE
,
1327 g_variant_get (_ret
,
1329 g_variant_unref (_ret
);
1331 return _ret
!= NULL
;
1335 * timedated_timedate1_call_set_ntp:
1336 * @proxy: A #timedatedTimedate1Proxy.
1337 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1338 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1339 * @cancellable: (allow-none): A #GCancellable or %NULL.
1340 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1341 * @user_data: User data to pass to @callback.
1343 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetNTP">SetNTP()</link> D-Bus method on @proxy.
1344 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1345 * You can then call timedated_timedate1_call_set_ntp_finish() to get the result of the operation.
1347 * See timedated_timedate1_call_set_ntp_sync() for the synchronous, blocking version of this method.
1350 timedated_timedate1_call_set_ntp (
1351 timedatedTimedate1
*proxy
,
1352 gboolean arg_unnamed_arg0
,
1353 gboolean arg_unnamed_arg1
,
1354 GCancellable
*cancellable
,
1355 GAsyncReadyCallback callback
,
1358 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
1360 g_variant_new ("(bb)",
1363 G_DBUS_CALL_FLAGS_NONE
,
1371 * timedated_timedate1_call_set_ntp_finish:
1372 * @proxy: A #timedatedTimedate1Proxy.
1373 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_timedate1_call_set_ntp().
1374 * @error: Return location for error or %NULL.
1376 * Finishes an operation started with timedated_timedate1_call_set_ntp().
1378 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1381 timedated_timedate1_call_set_ntp_finish (
1382 timedatedTimedate1
*proxy
,
1387 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
1390 g_variant_get (_ret
,
1392 g_variant_unref (_ret
);
1394 return _ret
!= NULL
;
1398 * timedated_timedate1_call_set_ntp_sync:
1399 * @proxy: A #timedatedTimedate1Proxy.
1400 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1401 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1402 * @cancellable: (allow-none): A #GCancellable or %NULL.
1403 * @error: Return location for error or %NULL.
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.
1407 * See timedated_timedate1_call_set_ntp() for the asynchronous version of this method.
1409 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1412 timedated_timedate1_call_set_ntp_sync (
1413 timedatedTimedate1
*proxy
,
1414 gboolean arg_unnamed_arg0
,
1415 gboolean arg_unnamed_arg1
,
1416 GCancellable
*cancellable
,
1420 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
1422 g_variant_new ("(bb)",
1425 G_DBUS_CALL_FLAGS_NONE
,
1431 g_variant_get (_ret
,
1433 g_variant_unref (_ret
);
1435 return _ret
!= NULL
;
1439 * timedated_timedate1_complete_set_time:
1440 * @object: A #timedatedTimedate1.
1441 * @invocation: (transfer full): A #GDBusMethodInvocation.
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.
1445 * This method will free @invocation, you cannot use it afterwards.
1448 timedated_timedate1_complete_set_time (
1449 timedatedTimedate1
*object
,
1450 GDBusMethodInvocation
*invocation
)
1452 g_dbus_method_invocation_return_value (invocation
,
1453 g_variant_new ("()"));
1457 * timedated_timedate1_complete_set_timezone:
1458 * @object: A #timedatedTimedate1.
1459 * @invocation: (transfer full): A #GDBusMethodInvocation.
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.
1463 * This method will free @invocation, you cannot use it afterwards.
1466 timedated_timedate1_complete_set_timezone (
1467 timedatedTimedate1
*object
,
1468 GDBusMethodInvocation
*invocation
)
1470 g_dbus_method_invocation_return_value (invocation
,
1471 g_variant_new ("()"));
1475 * timedated_timedate1_complete_set_local_rtc:
1476 * @object: A #timedatedTimedate1.
1477 * @invocation: (transfer full): A #GDBusMethodInvocation.
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.
1481 * This method will free @invocation, you cannot use it afterwards.
1484 timedated_timedate1_complete_set_local_rtc (
1485 timedatedTimedate1
*object
,
1486 GDBusMethodInvocation
*invocation
)
1488 g_dbus_method_invocation_return_value (invocation
,
1489 g_variant_new ("()"));
1493 * timedated_timedate1_complete_set_ntp:
1494 * @object: A #timedatedTimedate1.
1495 * @invocation: (transfer full): A #GDBusMethodInvocation.
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.
1499 * This method will free @invocation, you cannot use it afterwards.
1502 timedated_timedate1_complete_set_ntp (
1503 timedatedTimedate1
*object
,
1504 GDBusMethodInvocation
*invocation
)
1506 g_dbus_method_invocation_return_value (invocation
,
1507 g_variant_new ("()"));
1510 /* ------------------------------------------------------------------------ */
1513 * timedatedTimedate1Proxy:
1515 * The #timedatedTimedate1Proxy structure contains only private data and should only be accessed using the provided API.
1519 * timedatedTimedate1ProxyClass:
1520 * @parent_class: The parent class.
1522 * Class structure for #timedatedTimedate1Proxy.
1525 struct _timedatedTimedate1ProxyPrivate
1530 static void timedated_timedate1_proxy_iface_init (timedatedTimedate1Iface
*iface
);
1532 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1533 G_DEFINE_TYPE_WITH_CODE (timedatedTimedate1Proxy
, timedated_timedate1_proxy
, G_TYPE_DBUS_PROXY
,
1534 G_ADD_PRIVATE (timedatedTimedate1Proxy
)
1535 G_IMPLEMENT_INTERFACE (TIMEDATED_TYPE_TIMEDATE1
, timedated_timedate1_proxy_iface_init
));
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
));
1543 timedated_timedate1_proxy_finalize (GObject
*object
)
1545 timedatedTimedate1Proxy
*proxy
= TIMEDATED_TIMEDATE1_PROXY (object
);
1546 g_datalist_clear (&proxy
->priv
->qdata
);
1547 G_OBJECT_CLASS (timedated_timedate1_proxy_parent_class
)->finalize (object
);
1551 timedated_timedate1_proxy_get_property (GObject
*object
,
1554 GParamSpec
*pspec G_GNUC_UNUSED
)
1556 const _ExtendedGDBusPropertyInfo
*info
;
1558 g_assert (prop_id
!= 0 && prop_id
- 1 < 7);
1559 info
= _timedated_timedate1_property_info_pointers
[prop_id
- 1];
1560 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object
), info
->parent_struct
.name
);
1561 if (info
->use_gvariant
)
1563 g_value_set_variant (value
, variant
);
1567 if (variant
!= NULL
)
1568 g_dbus_gvariant_to_gvalue (variant
, value
);
1570 if (variant
!= NULL
)
1571 g_variant_unref (variant
);
1575 timedated_timedate1_proxy_set_property_cb (GDBusProxy
*proxy
,
1579 const _ExtendedGDBusPropertyInfo
*info
= user_data
;
1583 _ret
= g_dbus_proxy_call_finish (proxy
, res
, &error
);
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
);
1593 g_variant_unref (_ret
);
1598 timedated_timedate1_proxy_set_property (GObject
*object
,
1600 const GValue
*value
,
1601 GParamSpec
*pspec G_GNUC_UNUSED
)
1603 const _ExtendedGDBusPropertyInfo
*info
;
1605 g_assert (prop_id
!= 0 && prop_id
- 1 < 7);
1606 info
= _timedated_timedate1_property_info_pointers
[prop_id
- 1];
1607 variant
= g_dbus_gvalue_to_gvariant (value
, G_VARIANT_TYPE (info
->parent_struct
.signature
));
1608 g_dbus_proxy_call (G_DBUS_PROXY (object
),
1609 "org.freedesktop.DBus.Properties.Set",
1610 g_variant_new ("(ssv)", "org.freedesktop.timedate1", info
->parent_struct
.name
, variant
),
1611 G_DBUS_CALL_FLAGS_NONE
,
1613 NULL
, (GAsyncReadyCallback
) timedated_timedate1_proxy_set_property_cb
, (GDBusPropertyInfo
*) &info
->parent_struct
);
1614 g_variant_unref (variant
);
1618 timedated_timedate1_proxy_g_signal (GDBusProxy
*proxy
,
1619 const gchar
*sender_name G_GNUC_UNUSED
,
1620 const gchar
*signal_name
,
1621 GVariant
*parameters
)
1623 _ExtendedGDBusSignalInfo
*info
;
1630 info
= (_ExtendedGDBusSignalInfo
*) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo
*) &_timedated_timedate1_interface_info
.parent_struct
, signal_name
);
1633 num_params
= g_variant_n_children (parameters
);
1634 paramv
= g_new0 (GValue
, num_params
+ 1);
1635 g_value_init (¶mv
[0], TIMEDATED_TYPE_TIMEDATE1
);
1636 g_value_set_object (¶mv
[0], proxy
);
1637 g_variant_iter_init (&iter
, parameters
);
1639 while ((child
= g_variant_iter_next_value (&iter
)) != NULL
)
1641 _ExtendedGDBusArgInfo
*arg_info
= (_ExtendedGDBusArgInfo
*) info
->parent_struct
.args
[n
- 1];
1642 if (arg_info
->use_gvariant
)
1644 g_value_init (¶mv
[n
], G_TYPE_VARIANT
);
1645 g_value_set_variant (¶mv
[n
], child
);
1649 g_dbus_gvariant_to_gvalue (child
, ¶mv
[n
++]);
1650 g_variant_unref (child
);
1652 signal_id
= g_signal_lookup (info
->signal_name
, TIMEDATED_TYPE_TIMEDATE1
);
1653 g_signal_emitv (paramv
, signal_id
, 0, NULL
);
1654 for (n
= 0; n
< num_params
+ 1; n
++)
1655 g_value_unset (¶mv
[n
]);
1660 timedated_timedate1_proxy_g_properties_changed (GDBusProxy
*_proxy
,
1661 GVariant
*changed_properties
,
1662 const gchar
*const *invalidated_properties
)
1664 timedatedTimedate1Proxy
*proxy
= TIMEDATED_TIMEDATE1_PROXY (_proxy
);
1668 _ExtendedGDBusPropertyInfo
*info
;
1669 g_variant_get (changed_properties
, "a{sv}", &iter
);
1670 while (g_variant_iter_next (iter
, "{&sv}", &key
, NULL
))
1672 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_timedated_timedate1_interface_info
.parent_struct
, key
);
1673 g_datalist_remove_data (&proxy
->priv
->qdata
, key
);
1675 g_object_notify (G_OBJECT (proxy
), info
->hyphen_name
);
1677 g_variant_iter_free (iter
);
1678 for (n
= 0; invalidated_properties
[n
] != NULL
; n
++)
1680 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_timedated_timedate1_interface_info
.parent_struct
, invalidated_properties
[n
]);
1681 g_datalist_remove_data (&proxy
->priv
->qdata
, invalidated_properties
[n
]);
1683 g_object_notify (G_OBJECT (proxy
), info
->hyphen_name
);
1687 static const gchar
*
1688 timedated_timedate1_proxy_get_timezone (timedatedTimedate1
*object
)
1690 timedatedTimedate1Proxy
*proxy
= TIMEDATED_TIMEDATE1_PROXY (object
);
1692 const gchar
*value
= NULL
;
1693 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "Timezone");
1694 if (variant
!= NULL
)
1696 value
= g_variant_get_string (variant
, NULL
);
1697 g_variant_unref (variant
);
1703 timedated_timedate1_proxy_get_local_rtc (timedatedTimedate1
*object
)
1705 timedatedTimedate1Proxy
*proxy
= TIMEDATED_TIMEDATE1_PROXY (object
);
1708 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "LocalRTC");
1709 if (variant
!= NULL
)
1711 value
= g_variant_get_boolean (variant
);
1712 g_variant_unref (variant
);
1718 timedated_timedate1_proxy_get_can_ntp (timedatedTimedate1
*object
)
1720 timedatedTimedate1Proxy
*proxy
= TIMEDATED_TIMEDATE1_PROXY (object
);
1723 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "CanNTP");
1724 if (variant
!= NULL
)
1726 value
= g_variant_get_boolean (variant
);
1727 g_variant_unref (variant
);
1733 timedated_timedate1_proxy_get_ntp (timedatedTimedate1
*object
)
1735 timedatedTimedate1Proxy
*proxy
= TIMEDATED_TIMEDATE1_PROXY (object
);
1738 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "NTP");
1739 if (variant
!= NULL
)
1741 value
= g_variant_get_boolean (variant
);
1742 g_variant_unref (variant
);
1748 timedated_timedate1_proxy_get_ntpsynchronized (timedatedTimedate1
*object
)
1750 timedatedTimedate1Proxy
*proxy
= TIMEDATED_TIMEDATE1_PROXY (object
);
1753 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "NTPSynchronized");
1754 if (variant
!= NULL
)
1756 value
= g_variant_get_boolean (variant
);
1757 g_variant_unref (variant
);
1763 timedated_timedate1_proxy_get_time_usec (timedatedTimedate1
*object
)
1765 timedatedTimedate1Proxy
*proxy
= TIMEDATED_TIMEDATE1_PROXY (object
);
1768 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "TimeUSec");
1769 if (variant
!= NULL
)
1771 value
= g_variant_get_uint64 (variant
);
1772 g_variant_unref (variant
);
1778 timedated_timedate1_proxy_get_rtctime_usec (timedatedTimedate1
*object
)
1780 timedatedTimedate1Proxy
*proxy
= TIMEDATED_TIMEDATE1_PROXY (object
);
1783 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "RTCTimeUSec");
1784 if (variant
!= NULL
)
1786 value
= g_variant_get_uint64 (variant
);
1787 g_variant_unref (variant
);
1793 timedated_timedate1_proxy_init (timedatedTimedate1Proxy
*proxy
)
1795 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1796 proxy
->priv
= timedated_timedate1_proxy_get_instance_private (proxy
);
1798 proxy
->priv
= G_TYPE_INSTANCE_GET_PRIVATE (proxy
, TIMEDATED_TYPE_TIMEDATE1_PROXY
, timedatedTimedate1ProxyPrivate
);
1801 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy
), timedated_timedate1_interface_info ());
1805 timedated_timedate1_proxy_class_init (timedatedTimedate1ProxyClass
*klass
)
1807 GObjectClass
*gobject_class
;
1808 GDBusProxyClass
*proxy_class
;
1810 gobject_class
= G_OBJECT_CLASS (klass
);
1811 gobject_class
->finalize
= timedated_timedate1_proxy_finalize
;
1812 gobject_class
->get_property
= timedated_timedate1_proxy_get_property
;
1813 gobject_class
->set_property
= timedated_timedate1_proxy_set_property
;
1815 proxy_class
= G_DBUS_PROXY_CLASS (klass
);
1816 proxy_class
->g_signal
= timedated_timedate1_proxy_g_signal
;
1817 proxy_class
->g_properties_changed
= timedated_timedate1_proxy_g_properties_changed
;
1819 timedated_timedate1_override_properties (gobject_class
, 1);
1821 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1822 g_type_class_add_private (klass
, sizeof (timedatedTimedate1ProxyPrivate
));
1827 timedated_timedate1_proxy_iface_init (timedatedTimedate1Iface
*iface
)
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
;
1839 * timedated_timedate1_proxy_new:
1840 * @connection: A #GDBusConnection.
1841 * @flags: Flags from the #GDBusProxyFlags enumeration.
1842 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1843 * @object_path: An object path.
1844 * @cancellable: (allow-none): A #GCancellable or %NULL.
1845 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1846 * @user_data: User data to pass to @callback.
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.
1850 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1851 * You can then call timedated_timedate1_proxy_new_finish() to get the result of the operation.
1853 * See timedated_timedate1_proxy_new_sync() for the synchronous, blocking version of this constructor.
1856 timedated_timedate1_proxy_new (
1857 GDBusConnection
*connection
,
1858 GDBusProxyFlags flags
,
1860 const gchar
*object_path
,
1861 GCancellable
*cancellable
,
1862 GAsyncReadyCallback callback
,
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
);
1869 * timedated_timedate1_proxy_new_finish:
1870 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_timedate1_proxy_new().
1871 * @error: Return location for error or %NULL
1873 * Finishes an operation started with timedated_timedate1_proxy_new().
1875 * Returns: (transfer full) (type timedatedTimedate1Proxy): The constructed proxy object or %NULL if @error is set.
1877 timedatedTimedate1
*
1878 timedated_timedate1_proxy_new_finish (
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
);
1888 return TIMEDATED_TIMEDATE1 (ret
);
1894 * timedated_timedate1_proxy_new_sync:
1895 * @connection: A #GDBusConnection.
1896 * @flags: Flags from the #GDBusProxyFlags enumeration.
1897 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1898 * @object_path: An object path.
1899 * @cancellable: (allow-none): A #GCancellable or %NULL.
1900 * @error: Return location for error or %NULL
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.
1904 * The calling thread is blocked until a reply is received.
1906 * See timedated_timedate1_proxy_new() for the asynchronous version of this constructor.
1908 * Returns: (transfer full) (type timedatedTimedate1Proxy): The constructed proxy object or %NULL if @error is set.
1910 timedatedTimedate1
*
1911 timedated_timedate1_proxy_new_sync (
1912 GDBusConnection
*connection
,
1913 GDBusProxyFlags flags
,
1915 const gchar
*object_path
,
1916 GCancellable
*cancellable
,
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
);
1922 return TIMEDATED_TIMEDATE1 (ret
);
1929 * timedated_timedate1_proxy_new_for_bus:
1930 * @bus_type: A #GBusType.
1931 * @flags: Flags from the #GDBusProxyFlags enumeration.
1932 * @name: A bus name (well-known or unique).
1933 * @object_path: An object path.
1934 * @cancellable: (allow-none): A #GCancellable or %NULL.
1935 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1936 * @user_data: User data to pass to @callback.
1938 * Like timedated_timedate1_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
1940 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1941 * You can then call timedated_timedate1_proxy_new_for_bus_finish() to get the result of the operation.
1943 * See timedated_timedate1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
1946 timedated_timedate1_proxy_new_for_bus (
1948 GDBusProxyFlags flags
,
1950 const gchar
*object_path
,
1951 GCancellable
*cancellable
,
1952 GAsyncReadyCallback callback
,
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
);
1959 * timedated_timedate1_proxy_new_for_bus_finish:
1960 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedated_timedate1_proxy_new_for_bus().
1961 * @error: Return location for error or %NULL
1963 * Finishes an operation started with timedated_timedate1_proxy_new_for_bus().
1965 * Returns: (transfer full) (type timedatedTimedate1Proxy): The constructed proxy object or %NULL if @error is set.
1967 timedatedTimedate1
*
1968 timedated_timedate1_proxy_new_for_bus_finish (
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
);
1978 return TIMEDATED_TIMEDATE1 (ret
);
1984 * timedated_timedate1_proxy_new_for_bus_sync:
1985 * @bus_type: A #GBusType.
1986 * @flags: Flags from the #GDBusProxyFlags enumeration.
1987 * @name: A bus name (well-known or unique).
1988 * @object_path: An object path.
1989 * @cancellable: (allow-none): A #GCancellable or %NULL.
1990 * @error: Return location for error or %NULL
1992 * Like timedated_timedate1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
1994 * The calling thread is blocked until a reply is received.
1996 * See timedated_timedate1_proxy_new_for_bus() for the asynchronous version of this constructor.
1998 * Returns: (transfer full) (type timedatedTimedate1Proxy): The constructed proxy object or %NULL if @error is set.
2000 timedatedTimedate1
*
2001 timedated_timedate1_proxy_new_for_bus_sync (
2003 GDBusProxyFlags flags
,
2005 const gchar
*object_path
,
2006 GCancellable
*cancellable
,
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
);
2012 return TIMEDATED_TIMEDATE1 (ret
);
2018 /* ------------------------------------------------------------------------ */
2021 * timedatedTimedate1Skeleton:
2023 * The #timedatedTimedate1Skeleton structure contains only private data and should only be accessed using the provided API.
2027 * timedatedTimedate1SkeletonClass:
2028 * @parent_class: The parent class.
2030 * Class structure for #timedatedTimedate1Skeleton.
2033 struct _timedatedTimedate1SkeletonPrivate
2036 GList
*changed_properties
;
2037 GSource
*changed_properties_idle_source
;
2038 GMainContext
*context
;
2043 _timedated_timedate1_skeleton_handle_method_call (
2044 GDBusConnection
*connection G_GNUC_UNUSED
,
2045 const gchar
*sender G_GNUC_UNUSED
,
2046 const gchar
*object_path G_GNUC_UNUSED
,
2047 const gchar
*interface_name
,
2048 const gchar
*method_name
,
2049 GVariant
*parameters
,
2050 GDBusMethodInvocation
*invocation
,
2053 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (user_data
);
2054 _ExtendedGDBusMethodInfo
*info
;
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
);
2068 g_value_init (¶mv
[n
], TIMEDATED_TYPE_TIMEDATE1
);
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
)
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
)));
2078 g_assert_not_reached ();
2081 g_variant_iter_init (&iter
, parameters
);
2082 while ((child
= g_variant_iter_next_value (&iter
)) != NULL
)
2084 _ExtendedGDBusArgInfo
*arg_info
= (_ExtendedGDBusArgInfo
*) info
->parent_struct
.in_args
[n
- num_extra
];
2085 if (arg_info
->use_gvariant
)
2087 g_value_init (¶mv
[n
], G_TYPE_VARIANT
);
2088 g_value_set_variant (¶mv
[n
], child
);
2092 g_dbus_gvariant_to_gvalue (child
, ¶mv
[n
++]);
2093 g_variant_unref (child
);
2095 signal_id
= g_signal_lookup (info
->signal_name
, TIMEDATED_TYPE_TIMEDATE1
);
2096 g_value_init (&return_value
, G_TYPE_BOOLEAN
);
2097 g_signal_emitv (paramv
, signal_id
, 0, &return_value
);
2098 if (!g_value_get_boolean (&return_value
))
2099 g_dbus_method_invocation_return_error (invocation
, G_DBUS_ERROR
, G_DBUS_ERROR_UNKNOWN_METHOD
, "Method %s is not implemented on interface %s", method_name
, interface_name
);
2100 g_value_unset (&return_value
);
2101 for (n
= 0; n
< num_params
+ num_extra
; n
++)
2102 g_value_unset (¶mv
[n
]);
2107 _timedated_timedate1_skeleton_handle_get_property (
2108 GDBusConnection
*connection G_GNUC_UNUSED
,
2109 const gchar
*sender G_GNUC_UNUSED
,
2110 const gchar
*object_path G_GNUC_UNUSED
,
2111 const gchar
*interface_name G_GNUC_UNUSED
,
2112 const gchar
*property_name
,
2116 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (user_data
);
2117 GValue value
= G_VALUE_INIT
;
2119 _ExtendedGDBusPropertyInfo
*info
;
2122 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_timedated_timedate1_interface_info
.parent_struct
, property_name
);
2123 g_assert (info
!= NULL
);
2124 pspec
= g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton
), info
->hyphen_name
);
2127 g_set_error (error
, G_DBUS_ERROR
, G_DBUS_ERROR_INVALID_ARGS
, "No property with name %s", property_name
);
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
);
2140 _timedated_timedate1_skeleton_handle_set_property (
2141 GDBusConnection
*connection G_GNUC_UNUSED
,
2142 const gchar
*sender G_GNUC_UNUSED
,
2143 const gchar
*object_path G_GNUC_UNUSED
,
2144 const gchar
*interface_name G_GNUC_UNUSED
,
2145 const gchar
*property_name
,
2150 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (user_data
);
2151 GValue value
= G_VALUE_INIT
;
2153 _ExtendedGDBusPropertyInfo
*info
;
2156 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_timedated_timedate1_interface_info
.parent_struct
, property_name
);
2157 g_assert (info
!= NULL
);
2158 pspec
= g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton
), info
->hyphen_name
);
2161 g_set_error (error
, G_DBUS_ERROR
, G_DBUS_ERROR_INVALID_ARGS
, "No property with name %s", property_name
);
2165 if (info
->use_gvariant
)
2166 g_value_set_variant (&value
, variant
);
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
);
2176 static const GDBusInterfaceVTable _timedated_timedate1_skeleton_vtable
=
2178 _timedated_timedate1_skeleton_handle_method_call
,
2179 _timedated_timedate1_skeleton_handle_get_property
,
2180 _timedated_timedate1_skeleton_handle_set_property
,
2184 static GDBusInterfaceInfo
*
2185 timedated_timedate1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton
*skeleton G_GNUC_UNUSED
)
2187 return timedated_timedate1_interface_info ();
2190 static GDBusInterfaceVTable
*
2191 timedated_timedate1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton
*skeleton G_GNUC_UNUSED
)
2193 return (GDBusInterfaceVTable
*) &_timedated_timedate1_skeleton_vtable
;
2197 timedated_timedate1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton
*_skeleton
)
2199 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (_skeleton
);
2201 GVariantBuilder builder
;
2203 g_variant_builder_init (&builder
, G_VARIANT_TYPE ("a{sv}"));
2204 if (_timedated_timedate1_interface_info
.parent_struct
.properties
== NULL
)
2206 for (n
= 0; _timedated_timedate1_interface_info
.parent_struct
.properties
[n
] != NULL
; n
++)
2208 GDBusPropertyInfo
*info
= _timedated_timedate1_interface_info
.parent_struct
.properties
[n
];
2209 if (info
->flags
& G_DBUS_PROPERTY_INFO_FLAGS_READABLE
)
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
);
2215 g_variant_take_ref (value
);
2216 g_variant_builder_add (&builder
, "{sv}", info
->name
, value
);
2217 g_variant_unref (value
);
2222 return g_variant_builder_end (&builder
);
2225 static gboolean
_timedated_timedate1_emit_changed (gpointer user_data
);
2228 timedated_timedate1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton
*_skeleton
)
2230 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (_skeleton
);
2231 gboolean emit_changed
= FALSE
;
2233 g_mutex_lock (&skeleton
->priv
->lock
);
2234 if (skeleton
->priv
->changed_properties_idle_source
!= NULL
)
2236 g_source_destroy (skeleton
->priv
->changed_properties_idle_source
);
2237 skeleton
->priv
->changed_properties_idle_source
= NULL
;
2238 emit_changed
= TRUE
;
2240 g_mutex_unlock (&skeleton
->priv
->lock
);
2243 _timedated_timedate1_emit_changed (skeleton
);
2246 static void timedated_timedate1_skeleton_iface_init (timedatedTimedate1Iface
*iface
);
2247 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2248 G_DEFINE_TYPE_WITH_CODE (timedatedTimedate1Skeleton
, timedated_timedate1_skeleton
, G_TYPE_DBUS_INTERFACE_SKELETON
,
2249 G_ADD_PRIVATE (timedatedTimedate1Skeleton
)
2250 G_IMPLEMENT_INTERFACE (TIMEDATED_TYPE_TIMEDATE1
, timedated_timedate1_skeleton_iface_init
));
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
));
2258 timedated_timedate1_skeleton_finalize (GObject
*object
)
2260 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (object
);
2262 for (n
= 0; n
< 7; n
++)
2263 g_value_unset (&skeleton
->priv
->properties
[n
]);
2264 g_free (skeleton
->priv
->properties
);
2265 g_list_free_full (skeleton
->priv
->changed_properties
, (GDestroyNotify
) _changed_property_free
);
2266 if (skeleton
->priv
->changed_properties_idle_source
!= NULL
)
2267 g_source_destroy (skeleton
->priv
->changed_properties_idle_source
);
2268 g_main_context_unref (skeleton
->priv
->context
);
2269 g_mutex_clear (&skeleton
->priv
->lock
);
2270 G_OBJECT_CLASS (timedated_timedate1_skeleton_parent_class
)->finalize (object
);
2274 timedated_timedate1_skeleton_get_property (GObject
*object
,
2277 GParamSpec
*pspec G_GNUC_UNUSED
)
2279 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (object
);
2280 g_assert (prop_id
!= 0 && prop_id
- 1 < 7);
2281 g_mutex_lock (&skeleton
->priv
->lock
);
2282 g_value_copy (&skeleton
->priv
->properties
[prop_id
- 1], value
);
2283 g_mutex_unlock (&skeleton
->priv
->lock
);
2287 _timedated_timedate1_emit_changed (gpointer user_data
)
2289 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (user_data
);
2291 GVariantBuilder builder
;
2292 GVariantBuilder invalidated_builder
;
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
)
2300 ChangedProperty
*cp
= l
->data
;
2302 const GValue
*cur_value
;
2304 cur_value
= &skeleton
->priv
->properties
[cp
->prop_id
- 1];
2305 if (!_g_value_equal (cur_value
, &cp
->orig_value
))
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
);
2313 if (num_changes
> 0)
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
)
2322 GDBusConnection
*connection
= ll
->data
;
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",
2331 g_variant_unref (signal_variant
);
2332 g_list_free_full (connections
, g_object_unref
);
2336 g_variant_builder_clear (&builder
);
2337 g_variant_builder_clear (&invalidated_builder
);
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
);
2347 _timedated_timedate1_schedule_emit_changed (timedatedTimedate1Skeleton
*skeleton
, const _ExtendedGDBusPropertyInfo
*info
, guint prop_id
, const GValue
*orig_value
)
2349 ChangedProperty
*cp
;
2352 for (l
= skeleton
->priv
->changed_properties
; l
!= NULL
; l
= l
->next
)
2354 ChangedProperty
*i_cp
= l
->data
;
2355 if (i_cp
->info
== info
)
2363 cp
= g_new0 (ChangedProperty
, 1);
2364 cp
->prop_id
= prop_id
;
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
);
2373 timedated_timedate1_skeleton_notify (GObject
*object
,
2374 GParamSpec
*pspec G_GNUC_UNUSED
)
2376 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (object
);
2377 g_mutex_lock (&skeleton
->priv
->lock
);
2378 if (skeleton
->priv
->changed_properties
!= NULL
&&
2379 skeleton
->priv
->changed_properties_idle_source
== NULL
)
2381 skeleton
->priv
->changed_properties_idle_source
= g_idle_source_new ();
2382 g_source_set_priority (skeleton
->priv
->changed_properties_idle_source
, G_PRIORITY_DEFAULT
);
2383 g_source_set_callback (skeleton
->priv
->changed_properties_idle_source
, _timedated_timedate1_emit_changed
, g_object_ref (skeleton
), (GDestroyNotify
) g_object_unref
);
2384 g_source_attach (skeleton
->priv
->changed_properties_idle_source
, skeleton
->priv
->context
);
2385 g_source_unref (skeleton
->priv
->changed_properties_idle_source
);
2387 g_mutex_unlock (&skeleton
->priv
->lock
);
2391 timedated_timedate1_skeleton_set_property (GObject
*object
,
2393 const GValue
*value
,
2396 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (object
);
2397 g_assert (prop_id
!= 0 && prop_id
- 1 < 7);
2398 g_mutex_lock (&skeleton
->priv
->lock
);
2399 g_object_freeze_notify (object
);
2400 if (!_g_value_equal (value
, &skeleton
->priv
->properties
[prop_id
- 1]))
2402 if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton
)) != NULL
)
2403 _timedated_timedate1_schedule_emit_changed (skeleton
, _timedated_timedate1_property_info_pointers
[prop_id
- 1], prop_id
, &skeleton
->priv
->properties
[prop_id
- 1]);
2404 g_value_copy (value
, &skeleton
->priv
->properties
[prop_id
- 1]);
2405 g_object_notify_by_pspec (object
, pspec
);
2407 g_mutex_unlock (&skeleton
->priv
->lock
);
2408 g_object_thaw_notify (object
);
2412 timedated_timedate1_skeleton_init (timedatedTimedate1Skeleton
*skeleton
)
2414 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2415 skeleton
->priv
= timedated_timedate1_skeleton_get_instance_private (skeleton
);
2417 skeleton
->priv
= G_TYPE_INSTANCE_GET_PRIVATE (skeleton
, TIMEDATED_TYPE_TIMEDATE1_SKELETON
, timedatedTimedate1SkeletonPrivate
);
2420 g_mutex_init (&skeleton
->priv
->lock
);
2421 skeleton
->priv
->context
= g_main_context_ref_thread_default ();
2422 skeleton
->priv
->properties
= g_new0 (GValue
, 7);
2423 g_value_init (&skeleton
->priv
->properties
[0], G_TYPE_STRING
);
2424 g_value_init (&skeleton
->priv
->properties
[1], G_TYPE_BOOLEAN
);
2425 g_value_init (&skeleton
->priv
->properties
[2], G_TYPE_BOOLEAN
);
2426 g_value_init (&skeleton
->priv
->properties
[3], G_TYPE_BOOLEAN
);
2427 g_value_init (&skeleton
->priv
->properties
[4], G_TYPE_BOOLEAN
);
2428 g_value_init (&skeleton
->priv
->properties
[5], G_TYPE_UINT64
);
2429 g_value_init (&skeleton
->priv
->properties
[6], G_TYPE_UINT64
);
2432 static const gchar
*
2433 timedated_timedate1_skeleton_get_timezone (timedatedTimedate1
*object
)
2435 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (object
);
2437 g_mutex_lock (&skeleton
->priv
->lock
);
2438 value
= g_value_get_string (&(skeleton
->priv
->properties
[0]));
2439 g_mutex_unlock (&skeleton
->priv
->lock
);
2444 timedated_timedate1_skeleton_get_local_rtc (timedatedTimedate1
*object
)
2446 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (object
);
2448 g_mutex_lock (&skeleton
->priv
->lock
);
2449 value
= g_value_get_boolean (&(skeleton
->priv
->properties
[1]));
2450 g_mutex_unlock (&skeleton
->priv
->lock
);
2455 timedated_timedate1_skeleton_get_can_ntp (timedatedTimedate1
*object
)
2457 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (object
);
2459 g_mutex_lock (&skeleton
->priv
->lock
);
2460 value
= g_value_get_boolean (&(skeleton
->priv
->properties
[2]));
2461 g_mutex_unlock (&skeleton
->priv
->lock
);
2466 timedated_timedate1_skeleton_get_ntp (timedatedTimedate1
*object
)
2468 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (object
);
2470 g_mutex_lock (&skeleton
->priv
->lock
);
2471 value
= g_value_get_boolean (&(skeleton
->priv
->properties
[3]));
2472 g_mutex_unlock (&skeleton
->priv
->lock
);
2477 timedated_timedate1_skeleton_get_ntpsynchronized (timedatedTimedate1
*object
)
2479 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (object
);
2481 g_mutex_lock (&skeleton
->priv
->lock
);
2482 value
= g_value_get_boolean (&(skeleton
->priv
->properties
[4]));
2483 g_mutex_unlock (&skeleton
->priv
->lock
);
2488 timedated_timedate1_skeleton_get_time_usec (timedatedTimedate1
*object
)
2490 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (object
);
2492 g_mutex_lock (&skeleton
->priv
->lock
);
2493 value
= g_value_get_uint64 (&(skeleton
->priv
->properties
[5]));
2494 g_mutex_unlock (&skeleton
->priv
->lock
);
2499 timedated_timedate1_skeleton_get_rtctime_usec (timedatedTimedate1
*object
)
2501 timedatedTimedate1Skeleton
*skeleton
= TIMEDATED_TIMEDATE1_SKELETON (object
);
2503 g_mutex_lock (&skeleton
->priv
->lock
);
2504 value
= g_value_get_uint64 (&(skeleton
->priv
->properties
[6]));
2505 g_mutex_unlock (&skeleton
->priv
->lock
);
2510 timedated_timedate1_skeleton_class_init (timedatedTimedate1SkeletonClass
*klass
)
2512 GObjectClass
*gobject_class
;
2513 GDBusInterfaceSkeletonClass
*skeleton_class
;
2515 gobject_class
= G_OBJECT_CLASS (klass
);
2516 gobject_class
->finalize
= timedated_timedate1_skeleton_finalize
;
2517 gobject_class
->get_property
= timedated_timedate1_skeleton_get_property
;
2518 gobject_class
->set_property
= timedated_timedate1_skeleton_set_property
;
2519 gobject_class
->notify
= timedated_timedate1_skeleton_notify
;
2522 timedated_timedate1_override_properties (gobject_class
, 1);
2524 skeleton_class
= G_DBUS_INTERFACE_SKELETON_CLASS (klass
);
2525 skeleton_class
->get_info
= timedated_timedate1_skeleton_dbus_interface_get_info
;
2526 skeleton_class
->get_properties
= timedated_timedate1_skeleton_dbus_interface_get_properties
;
2527 skeleton_class
->flush
= timedated_timedate1_skeleton_dbus_interface_flush
;
2528 skeleton_class
->get_vtable
= timedated_timedate1_skeleton_dbus_interface_get_vtable
;
2530 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
2531 g_type_class_add_private (klass
, sizeof (timedatedTimedate1SkeletonPrivate
));
2536 timedated_timedate1_skeleton_iface_init (timedatedTimedate1Iface
*iface
)
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
;
2548 * timedated_timedate1_skeleton_new:
2550 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link>.
2552 * Returns: (transfer full) (type timedatedTimedate1Skeleton): The skeleton object.
2554 timedatedTimedate1
*
2555 timedated_timedate1_skeleton_new (void)
2557 return TIMEDATED_TIMEDATE1 (g_object_new (TIMEDATED_TYPE_TIMEDATE1_SKELETON
, NULL
));