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 "src/interfaces/timedated/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 * ------------------------------------------------------------------------
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 _timedate1_method_info_set_time_IN_ARG_usec_utc
=
170 (gchar
*) "usec_utc",
177 static const _ExtendedGDBusArgInfo _timedate1_method_info_set_time_IN_ARG_relative
=
181 (gchar
*) "relative",
188 static const _ExtendedGDBusArgInfo _timedate1_method_info_set_time_IN_ARG_user_interaction
=
192 (gchar
*) "user_interaction",
199 static const _ExtendedGDBusArgInfo
* const _timedate1_method_info_set_time_IN_ARG_pointers
[] =
201 &_timedate1_method_info_set_time_IN_ARG_usec_utc
,
202 &_timedate1_method_info_set_time_IN_ARG_relative
,
203 &_timedate1_method_info_set_time_IN_ARG_user_interaction
,
207 static const _ExtendedGDBusMethodInfo _timedate1_method_info_set_time
=
212 (GDBusArgInfo
**) &_timedate1_method_info_set_time_IN_ARG_pointers
,
220 static const _ExtendedGDBusArgInfo _timedate1_method_info_set_timezone_IN_ARG_timezone
=
224 (gchar
*) "timezone",
231 static const _ExtendedGDBusArgInfo _timedate1_method_info_set_timezone_IN_ARG_user_interaction
=
235 (gchar
*) "user_interaction",
242 static const _ExtendedGDBusArgInfo
* const _timedate1_method_info_set_timezone_IN_ARG_pointers
[] =
244 &_timedate1_method_info_set_timezone_IN_ARG_timezone
,
245 &_timedate1_method_info_set_timezone_IN_ARG_user_interaction
,
249 static const _ExtendedGDBusMethodInfo _timedate1_method_info_set_timezone
=
253 (gchar
*) "SetTimezone",
254 (GDBusArgInfo
**) &_timedate1_method_info_set_timezone_IN_ARG_pointers
,
258 "handle-set-timezone",
262 static const _ExtendedGDBusArgInfo _timedate1_method_info_set_local_rtc_IN_ARG_local_rtc
=
266 (gchar
*) "local_rtc",
273 static const _ExtendedGDBusArgInfo _timedate1_method_info_set_local_rtc_IN_ARG_fix_system
=
277 (gchar
*) "fix_system",
284 static const _ExtendedGDBusArgInfo _timedate1_method_info_set_local_rtc_IN_ARG_user_interaction
=
288 (gchar
*) "user_interaction",
295 static const _ExtendedGDBusArgInfo
* const _timedate1_method_info_set_local_rtc_IN_ARG_pointers
[] =
297 &_timedate1_method_info_set_local_rtc_IN_ARG_local_rtc
,
298 &_timedate1_method_info_set_local_rtc_IN_ARG_fix_system
,
299 &_timedate1_method_info_set_local_rtc_IN_ARG_user_interaction
,
303 static const _ExtendedGDBusMethodInfo _timedate1_method_info_set_local_rtc
=
307 (gchar
*) "SetLocalRTC",
308 (GDBusArgInfo
**) &_timedate1_method_info_set_local_rtc_IN_ARG_pointers
,
312 "handle-set-local-rtc",
316 static const _ExtendedGDBusArgInfo _timedate1_method_info_set_ntp_IN_ARG_use_ntp
=
327 static const _ExtendedGDBusArgInfo _timedate1_method_info_set_ntp_IN_ARG_user_interaction
=
331 (gchar
*) "user_interaction",
338 static const _ExtendedGDBusArgInfo
* const _timedate1_method_info_set_ntp_IN_ARG_pointers
[] =
340 &_timedate1_method_info_set_ntp_IN_ARG_use_ntp
,
341 &_timedate1_method_info_set_ntp_IN_ARG_user_interaction
,
345 static const _ExtendedGDBusMethodInfo _timedate1_method_info_set_ntp
=
350 (GDBusArgInfo
**) &_timedate1_method_info_set_ntp_IN_ARG_pointers
,
358 static const _ExtendedGDBusMethodInfo
* const _timedate1_method_info_pointers
[] =
360 &_timedate1_method_info_set_time
,
361 &_timedate1_method_info_set_timezone
,
362 &_timedate1_method_info_set_local_rtc
,
363 &_timedate1_method_info_set_ntp
,
367 static const _ExtendedGDBusPropertyInfo _timedate1_property_info_timezone
=
371 (gchar
*) "Timezone",
373 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
380 static const _ExtendedGDBusPropertyInfo _timedate1_property_info_local_rtc
=
384 (gchar
*) "LocalRTC",
386 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
393 static const _ExtendedGDBusPropertyInfo _timedate1_property_info_ntp
=
399 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
406 static const _ExtendedGDBusPropertyInfo
* const _timedate1_property_info_pointers
[] =
408 &_timedate1_property_info_timezone
,
409 &_timedate1_property_info_local_rtc
,
410 &_timedate1_property_info_ntp
,
414 static const _ExtendedGDBusInterfaceInfo _timedate1_interface_info
=
418 (gchar
*) "org.freedesktop.timedate1",
419 (GDBusMethodInfo
**) &_timedate1_method_info_pointers
,
421 (GDBusPropertyInfo
**) &_timedate1_property_info_pointers
,
429 * timedate1_interface_info:
431 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link> D-Bus interface.
433 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
436 timedate1_interface_info (void)
438 return (GDBusInterfaceInfo
*) &_timedate1_interface_info
.parent_struct
;
442 * timedate1_override_properties:
443 * @klass: The class structure for a #GObject<!-- -->-derived class.
444 * @property_id_begin: The property id to assign to the first overridden property.
446 * Overrides all #GObject properties in the #Timedate1 interface for a concrete class.
447 * The properties are overridden in the order they are defined.
449 * Returns: The last property id.
452 timedate1_override_properties (GObjectClass
*klass
, guint property_id_begin
)
454 g_object_class_override_property (klass
, property_id_begin
++, "timezone");
455 g_object_class_override_property (klass
, property_id_begin
++, "local-rtc");
456 g_object_class_override_property (klass
, property_id_begin
++, "ntp");
457 return property_id_begin
- 1;
465 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link>.
470 * @parent_iface: The parent interface.
471 * @handle_set_local_rtc: Handler for the #Timedate1::handle-set-local-rtc signal.
472 * @handle_set_ntp: Handler for the #Timedate1::handle-set-ntp signal.
473 * @handle_set_time: Handler for the #Timedate1::handle-set-time signal.
474 * @handle_set_timezone: Handler for the #Timedate1::handle-set-timezone signal.
475 * @get_local_rtc: Getter for the #Timedate1:local-rtc property.
476 * @get_ntp: Getter for the #Timedate1:ntp property.
477 * @get_timezone: Getter for the #Timedate1:timezone property.
479 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link>.
482 typedef Timedate1Iface Timedate1Interface
;
483 G_DEFINE_INTERFACE (Timedate1
, timedate1
, G_TYPE_OBJECT
);
486 timedate1_default_init (Timedate1Iface
*iface
)
488 /* GObject signals for incoming D-Bus method calls: */
490 * Timedate1::handle-set-time:
491 * @object: A #Timedate1.
492 * @invocation: A #GDBusMethodInvocation.
493 * @arg_usec_utc: Argument passed by remote caller.
494 * @arg_relative: Argument passed by remote caller.
495 * @arg_user_interaction: Argument passed by remote caller.
497 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTime">SetTime()</link> D-Bus method.
499 * 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 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.
501 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
503 g_signal_new ("handle-set-time",
504 G_TYPE_FROM_INTERFACE (iface
),
506 G_STRUCT_OFFSET (Timedate1Iface
, handle_set_time
),
507 g_signal_accumulator_true_handled
,
509 g_cclosure_marshal_generic
,
512 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_INT64
, G_TYPE_BOOLEAN
, G_TYPE_BOOLEAN
);
515 * Timedate1::handle-set-timezone:
516 * @object: A #Timedate1.
517 * @invocation: A #GDBusMethodInvocation.
518 * @arg_timezone: Argument passed by remote caller.
519 * @arg_user_interaction: Argument passed by remote caller.
521 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTimezone">SetTimezone()</link> D-Bus method.
523 * 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 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.
525 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
527 g_signal_new ("handle-set-timezone",
528 G_TYPE_FROM_INTERFACE (iface
),
530 G_STRUCT_OFFSET (Timedate1Iface
, handle_set_timezone
),
531 g_signal_accumulator_true_handled
,
533 g_cclosure_marshal_generic
,
536 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_STRING
, G_TYPE_BOOLEAN
);
539 * Timedate1::handle-set-local-rtc:
540 * @object: A #Timedate1.
541 * @invocation: A #GDBusMethodInvocation.
542 * @arg_local_rtc: Argument passed by remote caller.
543 * @arg_fix_system: Argument passed by remote caller.
544 * @arg_user_interaction: Argument passed by remote caller.
546 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-timedate1.SetLocalRTC">SetLocalRTC()</link> D-Bus method.
548 * 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 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.
550 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
552 g_signal_new ("handle-set-local-rtc",
553 G_TYPE_FROM_INTERFACE (iface
),
555 G_STRUCT_OFFSET (Timedate1Iface
, handle_set_local_rtc
),
556 g_signal_accumulator_true_handled
,
558 g_cclosure_marshal_generic
,
561 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_BOOLEAN
, G_TYPE_BOOLEAN
, G_TYPE_BOOLEAN
);
564 * Timedate1::handle-set-ntp:
565 * @object: A #Timedate1.
566 * @invocation: A #GDBusMethodInvocation.
567 * @arg_use_ntp: Argument passed by remote caller.
568 * @arg_user_interaction: Argument passed by remote caller.
570 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-timedate1.SetNTP">SetNTP()</link> D-Bus method.
572 * 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 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.
574 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
576 g_signal_new ("handle-set-ntp",
577 G_TYPE_FROM_INTERFACE (iface
),
579 G_STRUCT_OFFSET (Timedate1Iface
, handle_set_ntp
),
580 g_signal_accumulator_true_handled
,
582 g_cclosure_marshal_generic
,
585 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_BOOLEAN
, G_TYPE_BOOLEAN
);
587 /* GObject properties for D-Bus properties: */
589 * Timedate1:timezone:
591 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.Timezone">"Timezone"</link>.
593 * 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.
595 g_object_interface_install_property (iface
,
596 g_param_spec_string ("timezone", "Timezone", "Timezone", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
598 * Timedate1:local-rtc:
600 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.LocalRTC">"LocalRTC"</link>.
602 * 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.
604 g_object_interface_install_property (iface
,
605 g_param_spec_boolean ("local-rtc", "LocalRTC", "LocalRTC", FALSE
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
609 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-timedate1.NTP">"NTP"</link>.
611 * 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.
613 g_object_interface_install_property (iface
,
614 g_param_spec_boolean ("ntp", "NTP", "NTP", FALSE
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
618 * timedate1_get_timezone: (skip)
619 * @object: A #Timedate1.
621 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.Timezone">"Timezone"</link> D-Bus property.
623 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
625 * <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 timedate1_dup_timezone() if on another thread.</warning>
627 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
630 timedate1_get_timezone (Timedate1
*object
)
632 return TIMEDATE1_GET_IFACE (object
)->get_timezone (object
);
636 * timedate1_dup_timezone: (skip)
637 * @object: A #Timedate1.
639 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-timedate1.Timezone">"Timezone"</link> D-Bus property.
641 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
643 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
646 timedate1_dup_timezone (Timedate1
*object
)
649 g_object_get (G_OBJECT (object
), "timezone", &value
, NULL
);
654 * timedate1_set_timezone: (skip)
655 * @object: A #Timedate1.
656 * @value: The value to set.
658 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.Timezone">"Timezone"</link> D-Bus property to @value.
660 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
663 timedate1_set_timezone (Timedate1
*object
, const gchar
*value
)
665 g_object_set (G_OBJECT (object
), "timezone", value
, NULL
);
669 * timedate1_get_local_rtc: (skip)
670 * @object: A #Timedate1.
672 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.LocalRTC">"LocalRTC"</link> D-Bus property.
674 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
676 * Returns: The property value.
679 timedate1_get_local_rtc (Timedate1
*object
)
681 return TIMEDATE1_GET_IFACE (object
)->get_local_rtc (object
);
685 * timedate1_set_local_rtc: (skip)
686 * @object: A #Timedate1.
687 * @value: The value to set.
689 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.LocalRTC">"LocalRTC"</link> D-Bus property to @value.
691 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
694 timedate1_set_local_rtc (Timedate1
*object
, gboolean value
)
696 g_object_set (G_OBJECT (object
), "local-rtc", value
, NULL
);
700 * timedate1_get_ntp: (skip)
701 * @object: A #Timedate1.
703 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-timedate1.NTP">"NTP"</link> D-Bus property.
705 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
707 * Returns: The property value.
710 timedate1_get_ntp (Timedate1
*object
)
712 return TIMEDATE1_GET_IFACE (object
)->get_ntp (object
);
716 * timedate1_set_ntp: (skip)
717 * @object: A #Timedate1.
718 * @value: The value to set.
720 * Sets the <link linkend="gdbus-property-org-freedesktop-timedate1.NTP">"NTP"</link> D-Bus property to @value.
722 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
725 timedate1_set_ntp (Timedate1
*object
, gboolean value
)
727 g_object_set (G_OBJECT (object
), "ntp", value
, NULL
);
731 * timedate1_call_set_time:
732 * @proxy: A #Timedate1Proxy.
733 * @arg_usec_utc: Argument to pass with the method invocation.
734 * @arg_relative: Argument to pass with the method invocation.
735 * @arg_user_interaction: Argument to pass with the method invocation.
736 * @cancellable: (allow-none): A #GCancellable or %NULL.
737 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
738 * @user_data: User data to pass to @callback.
740 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTime">SetTime()</link> D-Bus method on @proxy.
741 * 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.
742 * You can then call timedate1_call_set_time_finish() to get the result of the operation.
744 * See timedate1_call_set_time_sync() for the synchronous, blocking version of this method.
747 timedate1_call_set_time (
750 gboolean arg_relative
,
751 gboolean arg_user_interaction
,
752 GCancellable
*cancellable
,
753 GAsyncReadyCallback callback
,
756 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
758 g_variant_new ("(xbb)",
761 arg_user_interaction
),
762 G_DBUS_CALL_FLAGS_NONE
,
770 * timedate1_call_set_time_finish:
771 * @proxy: A #Timedate1Proxy.
772 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedate1_call_set_time().
773 * @error: Return location for error or %NULL.
775 * Finishes an operation started with timedate1_call_set_time().
777 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
780 timedate1_call_set_time_finish (
786 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
791 g_variant_unref (_ret
);
797 * timedate1_call_set_time_sync:
798 * @proxy: A #Timedate1Proxy.
799 * @arg_usec_utc: Argument to pass with the method invocation.
800 * @arg_relative: Argument to pass with the method invocation.
801 * @arg_user_interaction: Argument to pass with the method invocation.
802 * @cancellable: (allow-none): A #GCancellable or %NULL.
803 * @error: Return location for error or %NULL.
805 * 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.
807 * See timedate1_call_set_time() for the asynchronous version of this method.
809 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
812 timedate1_call_set_time_sync (
815 gboolean arg_relative
,
816 gboolean arg_user_interaction
,
817 GCancellable
*cancellable
,
821 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
823 g_variant_new ("(xbb)",
826 arg_user_interaction
),
827 G_DBUS_CALL_FLAGS_NONE
,
835 g_variant_unref (_ret
);
841 * timedate1_call_set_timezone:
842 * @proxy: A #Timedate1Proxy.
843 * @arg_timezone: Argument to pass with the method invocation.
844 * @arg_user_interaction: Argument to pass with the method invocation.
845 * @cancellable: (allow-none): A #GCancellable or %NULL.
846 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
847 * @user_data: User data to pass to @callback.
849 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetTimezone">SetTimezone()</link> D-Bus method on @proxy.
850 * 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.
851 * You can then call timedate1_call_set_timezone_finish() to get the result of the operation.
853 * See timedate1_call_set_timezone_sync() for the synchronous, blocking version of this method.
856 timedate1_call_set_timezone (
858 const gchar
*arg_timezone
,
859 gboolean arg_user_interaction
,
860 GCancellable
*cancellable
,
861 GAsyncReadyCallback callback
,
864 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
866 g_variant_new ("(sb)",
868 arg_user_interaction
),
869 G_DBUS_CALL_FLAGS_NONE
,
877 * timedate1_call_set_timezone_finish:
878 * @proxy: A #Timedate1Proxy.
879 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedate1_call_set_timezone().
880 * @error: Return location for error or %NULL.
882 * Finishes an operation started with timedate1_call_set_timezone().
884 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
887 timedate1_call_set_timezone_finish (
893 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
898 g_variant_unref (_ret
);
904 * timedate1_call_set_timezone_sync:
905 * @proxy: A #Timedate1Proxy.
906 * @arg_timezone: Argument to pass with the method invocation.
907 * @arg_user_interaction: Argument to pass with the method invocation.
908 * @cancellable: (allow-none): A #GCancellable or %NULL.
909 * @error: Return location for error or %NULL.
911 * 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.
913 * See timedate1_call_set_timezone() for the asynchronous version of this method.
915 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
918 timedate1_call_set_timezone_sync (
920 const gchar
*arg_timezone
,
921 gboolean arg_user_interaction
,
922 GCancellable
*cancellable
,
926 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
928 g_variant_new ("(sb)",
930 arg_user_interaction
),
931 G_DBUS_CALL_FLAGS_NONE
,
939 g_variant_unref (_ret
);
945 * timedate1_call_set_local_rtc:
946 * @proxy: A #Timedate1Proxy.
947 * @arg_local_rtc: Argument to pass with the method invocation.
948 * @arg_fix_system: Argument to pass with the method invocation.
949 * @arg_user_interaction: Argument to pass with the method invocation.
950 * @cancellable: (allow-none): A #GCancellable or %NULL.
951 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
952 * @user_data: User data to pass to @callback.
954 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetLocalRTC">SetLocalRTC()</link> D-Bus method on @proxy.
955 * 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.
956 * You can then call timedate1_call_set_local_rtc_finish() to get the result of the operation.
958 * See timedate1_call_set_local_rtc_sync() for the synchronous, blocking version of this method.
961 timedate1_call_set_local_rtc (
963 gboolean arg_local_rtc
,
964 gboolean arg_fix_system
,
965 gboolean arg_user_interaction
,
966 GCancellable
*cancellable
,
967 GAsyncReadyCallback callback
,
970 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
972 g_variant_new ("(bbb)",
975 arg_user_interaction
),
976 G_DBUS_CALL_FLAGS_NONE
,
984 * timedate1_call_set_local_rtc_finish:
985 * @proxy: A #Timedate1Proxy.
986 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedate1_call_set_local_rtc().
987 * @error: Return location for error or %NULL.
989 * Finishes an operation started with timedate1_call_set_local_rtc().
991 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
994 timedate1_call_set_local_rtc_finish (
1000 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
1003 g_variant_get (_ret
,
1005 g_variant_unref (_ret
);
1007 return _ret
!= NULL
;
1011 * timedate1_call_set_local_rtc_sync:
1012 * @proxy: A #Timedate1Proxy.
1013 * @arg_local_rtc: Argument to pass with the method invocation.
1014 * @arg_fix_system: Argument to pass with the method invocation.
1015 * @arg_user_interaction: Argument to pass with the method invocation.
1016 * @cancellable: (allow-none): A #GCancellable or %NULL.
1017 * @error: Return location for error or %NULL.
1019 * 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.
1021 * See timedate1_call_set_local_rtc() for the asynchronous version of this method.
1023 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1026 timedate1_call_set_local_rtc_sync (
1028 gboolean arg_local_rtc
,
1029 gboolean arg_fix_system
,
1030 gboolean arg_user_interaction
,
1031 GCancellable
*cancellable
,
1035 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
1037 g_variant_new ("(bbb)",
1040 arg_user_interaction
),
1041 G_DBUS_CALL_FLAGS_NONE
,
1047 g_variant_get (_ret
,
1049 g_variant_unref (_ret
);
1051 return _ret
!= NULL
;
1055 * timedate1_call_set_ntp:
1056 * @proxy: A #Timedate1Proxy.
1057 * @arg_use_ntp: Argument to pass with the method invocation.
1058 * @arg_user_interaction: Argument to pass with the method invocation.
1059 * @cancellable: (allow-none): A #GCancellable or %NULL.
1060 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1061 * @user_data: User data to pass to @callback.
1063 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-timedate1.SetNTP">SetNTP()</link> D-Bus method on @proxy.
1064 * 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.
1065 * You can then call timedate1_call_set_ntp_finish() to get the result of the operation.
1067 * See timedate1_call_set_ntp_sync() for the synchronous, blocking version of this method.
1070 timedate1_call_set_ntp (
1072 gboolean arg_use_ntp
,
1073 gboolean arg_user_interaction
,
1074 GCancellable
*cancellable
,
1075 GAsyncReadyCallback callback
,
1078 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
1080 g_variant_new ("(bb)",
1082 arg_user_interaction
),
1083 G_DBUS_CALL_FLAGS_NONE
,
1091 * timedate1_call_set_ntp_finish:
1092 * @proxy: A #Timedate1Proxy.
1093 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedate1_call_set_ntp().
1094 * @error: Return location for error or %NULL.
1096 * Finishes an operation started with timedate1_call_set_ntp().
1098 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1101 timedate1_call_set_ntp_finish (
1107 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
1110 g_variant_get (_ret
,
1112 g_variant_unref (_ret
);
1114 return _ret
!= NULL
;
1118 * timedate1_call_set_ntp_sync:
1119 * @proxy: A #Timedate1Proxy.
1120 * @arg_use_ntp: Argument to pass with the method invocation.
1121 * @arg_user_interaction: Argument to pass with the method invocation.
1122 * @cancellable: (allow-none): A #GCancellable or %NULL.
1123 * @error: Return location for error or %NULL.
1125 * 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.
1127 * See timedate1_call_set_ntp() for the asynchronous version of this method.
1129 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1132 timedate1_call_set_ntp_sync (
1134 gboolean arg_use_ntp
,
1135 gboolean arg_user_interaction
,
1136 GCancellable
*cancellable
,
1140 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
1142 g_variant_new ("(bb)",
1144 arg_user_interaction
),
1145 G_DBUS_CALL_FLAGS_NONE
,
1151 g_variant_get (_ret
,
1153 g_variant_unref (_ret
);
1155 return _ret
!= NULL
;
1159 * timedate1_complete_set_time:
1160 * @object: A #Timedate1.
1161 * @invocation: (transfer full): A #GDBusMethodInvocation.
1163 * 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.
1165 * This method will free @invocation, you cannot use it afterwards.
1168 timedate1_complete_set_time (
1170 GDBusMethodInvocation
*invocation
)
1172 g_dbus_method_invocation_return_value (invocation
,
1173 g_variant_new ("()"));
1177 * timedate1_complete_set_timezone:
1178 * @object: A #Timedate1.
1179 * @invocation: (transfer full): A #GDBusMethodInvocation.
1181 * 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.
1183 * This method will free @invocation, you cannot use it afterwards.
1186 timedate1_complete_set_timezone (
1188 GDBusMethodInvocation
*invocation
)
1190 g_dbus_method_invocation_return_value (invocation
,
1191 g_variant_new ("()"));
1195 * timedate1_complete_set_local_rtc:
1196 * @object: A #Timedate1.
1197 * @invocation: (transfer full): A #GDBusMethodInvocation.
1199 * 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.
1201 * This method will free @invocation, you cannot use it afterwards.
1204 timedate1_complete_set_local_rtc (
1206 GDBusMethodInvocation
*invocation
)
1208 g_dbus_method_invocation_return_value (invocation
,
1209 g_variant_new ("()"));
1213 * timedate1_complete_set_ntp:
1214 * @object: A #Timedate1.
1215 * @invocation: (transfer full): A #GDBusMethodInvocation.
1217 * 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.
1219 * This method will free @invocation, you cannot use it afterwards.
1222 timedate1_complete_set_ntp (
1224 GDBusMethodInvocation
*invocation
)
1226 g_dbus_method_invocation_return_value (invocation
,
1227 g_variant_new ("()"));
1230 /* ------------------------------------------------------------------------ */
1235 * The #Timedate1Proxy structure contains only private data and should only be accessed using the provided API.
1239 * Timedate1ProxyClass:
1240 * @parent_class: The parent class.
1242 * Class structure for #Timedate1Proxy.
1245 struct _Timedate1ProxyPrivate
1250 static void timedate1_proxy_iface_init (Timedate1Iface
*iface
);
1252 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1253 G_DEFINE_TYPE_WITH_CODE (Timedate1Proxy
, timedate1_proxy
, G_TYPE_DBUS_PROXY
,
1254 G_ADD_PRIVATE (Timedate1Proxy
)
1255 G_IMPLEMENT_INTERFACE (TYPE_TIMEDATE1
, timedate1_proxy_iface_init
));
1258 G_DEFINE_TYPE_WITH_CODE (Timedate1Proxy
, timedate1_proxy
, G_TYPE_DBUS_PROXY
,
1259 G_IMPLEMENT_INTERFACE (TYPE_TIMEDATE1
, timedate1_proxy_iface_init
));
1263 timedate1_proxy_finalize (GObject
*object
)
1265 Timedate1Proxy
*proxy
= TIMEDATE1_PROXY (object
);
1266 g_datalist_clear (&proxy
->priv
->qdata
);
1267 G_OBJECT_CLASS (timedate1_proxy_parent_class
)->finalize (object
);
1271 timedate1_proxy_get_property (GObject
*object
,
1274 GParamSpec
*pspec G_GNUC_UNUSED
)
1276 const _ExtendedGDBusPropertyInfo
*info
;
1278 g_assert (prop_id
!= 0 && prop_id
- 1 < 3);
1279 info
= _timedate1_property_info_pointers
[prop_id
- 1];
1280 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object
), info
->parent_struct
.name
);
1281 if (info
->use_gvariant
)
1283 g_value_set_variant (value
, variant
);
1287 if (variant
!= NULL
)
1288 g_dbus_gvariant_to_gvalue (variant
, value
);
1290 if (variant
!= NULL
)
1291 g_variant_unref (variant
);
1295 timedate1_proxy_set_property_cb (GDBusProxy
*proxy
,
1299 const _ExtendedGDBusPropertyInfo
*info
= user_data
;
1303 _ret
= g_dbus_proxy_call_finish (proxy
, res
, &error
);
1306 g_warning ("Error setting property '%s' on interface org.freedesktop.timedate1: %s (%s, %d)",
1307 info
->parent_struct
.name
,
1308 error
->message
, g_quark_to_string (error
->domain
), error
->code
);
1309 g_error_free (error
);
1313 g_variant_unref (_ret
);
1318 timedate1_proxy_set_property (GObject
*object
,
1320 const GValue
*value
,
1321 GParamSpec
*pspec G_GNUC_UNUSED
)
1323 const _ExtendedGDBusPropertyInfo
*info
;
1325 g_assert (prop_id
!= 0 && prop_id
- 1 < 3);
1326 info
= _timedate1_property_info_pointers
[prop_id
- 1];
1327 variant
= g_dbus_gvalue_to_gvariant (value
, G_VARIANT_TYPE (info
->parent_struct
.signature
));
1328 g_dbus_proxy_call (G_DBUS_PROXY (object
),
1329 "org.freedesktop.DBus.Properties.Set",
1330 g_variant_new ("(ssv)", "org.freedesktop.timedate1", info
->parent_struct
.name
, variant
),
1331 G_DBUS_CALL_FLAGS_NONE
,
1333 NULL
, (GAsyncReadyCallback
) timedate1_proxy_set_property_cb
, (GDBusPropertyInfo
*) &info
->parent_struct
);
1334 g_variant_unref (variant
);
1338 timedate1_proxy_g_signal (GDBusProxy
*proxy
,
1339 const gchar
*sender_name G_GNUC_UNUSED
,
1340 const gchar
*signal_name
,
1341 GVariant
*parameters
)
1343 _ExtendedGDBusSignalInfo
*info
;
1350 info
= (_ExtendedGDBusSignalInfo
*) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo
*) &_timedate1_interface_info
.parent_struct
, signal_name
);
1353 num_params
= g_variant_n_children (parameters
);
1354 paramv
= g_new0 (GValue
, num_params
+ 1);
1355 g_value_init (¶mv
[0], TYPE_TIMEDATE1
);
1356 g_value_set_object (¶mv
[0], proxy
);
1357 g_variant_iter_init (&iter
, parameters
);
1359 while ((child
= g_variant_iter_next_value (&iter
)) != NULL
)
1361 _ExtendedGDBusArgInfo
*arg_info
= (_ExtendedGDBusArgInfo
*) info
->parent_struct
.args
[n
- 1];
1362 if (arg_info
->use_gvariant
)
1364 g_value_init (¶mv
[n
], G_TYPE_VARIANT
);
1365 g_value_set_variant (¶mv
[n
], child
);
1369 g_dbus_gvariant_to_gvalue (child
, ¶mv
[n
++]);
1370 g_variant_unref (child
);
1372 signal_id
= g_signal_lookup (info
->signal_name
, TYPE_TIMEDATE1
);
1373 g_signal_emitv (paramv
, signal_id
, 0, NULL
);
1374 for (n
= 0; n
< num_params
+ 1; n
++)
1375 g_value_unset (¶mv
[n
]);
1380 timedate1_proxy_g_properties_changed (GDBusProxy
*_proxy
,
1381 GVariant
*changed_properties
,
1382 const gchar
*const *invalidated_properties
)
1384 Timedate1Proxy
*proxy
= TIMEDATE1_PROXY (_proxy
);
1388 _ExtendedGDBusPropertyInfo
*info
;
1389 g_variant_get (changed_properties
, "a{sv}", &iter
);
1390 while (g_variant_iter_next (iter
, "{&sv}", &key
, NULL
))
1392 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_timedate1_interface_info
.parent_struct
, key
);
1393 g_datalist_remove_data (&proxy
->priv
->qdata
, key
);
1395 g_object_notify (G_OBJECT (proxy
), info
->hyphen_name
);
1397 g_variant_iter_free (iter
);
1398 for (n
= 0; invalidated_properties
[n
] != NULL
; n
++)
1400 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_timedate1_interface_info
.parent_struct
, invalidated_properties
[n
]);
1401 g_datalist_remove_data (&proxy
->priv
->qdata
, invalidated_properties
[n
]);
1403 g_object_notify (G_OBJECT (proxy
), info
->hyphen_name
);
1407 static const gchar
*
1408 timedate1_proxy_get_timezone (Timedate1
*object
)
1410 Timedate1Proxy
*proxy
= TIMEDATE1_PROXY (object
);
1412 const gchar
*value
= NULL
;
1413 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "Timezone");
1414 if (variant
!= NULL
)
1416 value
= g_variant_get_string (variant
, NULL
);
1417 g_variant_unref (variant
);
1423 timedate1_proxy_get_local_rtc (Timedate1
*object
)
1425 Timedate1Proxy
*proxy
= TIMEDATE1_PROXY (object
);
1428 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "LocalRTC");
1429 if (variant
!= NULL
)
1431 value
= g_variant_get_boolean (variant
);
1432 g_variant_unref (variant
);
1438 timedate1_proxy_get_ntp (Timedate1
*object
)
1440 Timedate1Proxy
*proxy
= TIMEDATE1_PROXY (object
);
1443 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "NTP");
1444 if (variant
!= NULL
)
1446 value
= g_variant_get_boolean (variant
);
1447 g_variant_unref (variant
);
1453 timedate1_proxy_init (Timedate1Proxy
*proxy
)
1455 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1456 proxy
->priv
= timedate1_proxy_get_instance_private (proxy
);
1458 proxy
->priv
= G_TYPE_INSTANCE_GET_PRIVATE (proxy
, TYPE_TIMEDATE1_PROXY
, Timedate1ProxyPrivate
);
1461 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy
), timedate1_interface_info ());
1465 timedate1_proxy_class_init (Timedate1ProxyClass
*klass
)
1467 GObjectClass
*gobject_class
;
1468 GDBusProxyClass
*proxy_class
;
1470 gobject_class
= G_OBJECT_CLASS (klass
);
1471 gobject_class
->finalize
= timedate1_proxy_finalize
;
1472 gobject_class
->get_property
= timedate1_proxy_get_property
;
1473 gobject_class
->set_property
= timedate1_proxy_set_property
;
1475 proxy_class
= G_DBUS_PROXY_CLASS (klass
);
1476 proxy_class
->g_signal
= timedate1_proxy_g_signal
;
1477 proxy_class
->g_properties_changed
= timedate1_proxy_g_properties_changed
;
1479 timedate1_override_properties (gobject_class
, 1);
1481 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1482 g_type_class_add_private (klass
, sizeof (Timedate1ProxyPrivate
));
1487 timedate1_proxy_iface_init (Timedate1Iface
*iface
)
1489 iface
->get_timezone
= timedate1_proxy_get_timezone
;
1490 iface
->get_local_rtc
= timedate1_proxy_get_local_rtc
;
1491 iface
->get_ntp
= timedate1_proxy_get_ntp
;
1495 * timedate1_proxy_new:
1496 * @connection: A #GDBusConnection.
1497 * @flags: Flags from the #GDBusProxyFlags enumeration.
1498 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1499 * @object_path: An object path.
1500 * @cancellable: (allow-none): A #GCancellable or %NULL.
1501 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1502 * @user_data: User data to pass to @callback.
1504 * 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.
1506 * 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.
1507 * You can then call timedate1_proxy_new_finish() to get the result of the operation.
1509 * See timedate1_proxy_new_sync() for the synchronous, blocking version of this constructor.
1512 timedate1_proxy_new (
1513 GDBusConnection
*connection
,
1514 GDBusProxyFlags flags
,
1516 const gchar
*object_path
,
1517 GCancellable
*cancellable
,
1518 GAsyncReadyCallback callback
,
1521 g_async_initable_new_async (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
);
1525 * timedate1_proxy_new_finish:
1526 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedate1_proxy_new().
1527 * @error: Return location for error or %NULL
1529 * Finishes an operation started with timedate1_proxy_new().
1531 * Returns: (transfer full) (type Timedate1Proxy): The constructed proxy object or %NULL if @error is set.
1534 timedate1_proxy_new_finish (
1539 GObject
*source_object
;
1540 source_object
= g_async_result_get_source_object (res
);
1541 ret
= g_async_initable_new_finish (G_ASYNC_INITABLE (source_object
), res
, error
);
1542 g_object_unref (source_object
);
1544 return TIMEDATE1 (ret
);
1550 * timedate1_proxy_new_sync:
1551 * @connection: A #GDBusConnection.
1552 * @flags: Flags from the #GDBusProxyFlags enumeration.
1553 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1554 * @object_path: An object path.
1555 * @cancellable: (allow-none): A #GCancellable or %NULL.
1556 * @error: Return location for error or %NULL
1558 * 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.
1560 * The calling thread is blocked until a reply is received.
1562 * See timedate1_proxy_new() for the asynchronous version of this constructor.
1564 * Returns: (transfer full) (type Timedate1Proxy): The constructed proxy object or %NULL if @error is set.
1567 timedate1_proxy_new_sync (
1568 GDBusConnection
*connection
,
1569 GDBusProxyFlags flags
,
1571 const gchar
*object_path
,
1572 GCancellable
*cancellable
,
1576 ret
= g_initable_new (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
);
1578 return TIMEDATE1 (ret
);
1585 * timedate1_proxy_new_for_bus:
1586 * @bus_type: A #GBusType.
1587 * @flags: Flags from the #GDBusProxyFlags enumeration.
1588 * @name: A bus name (well-known or unique).
1589 * @object_path: An object path.
1590 * @cancellable: (allow-none): A #GCancellable or %NULL.
1591 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1592 * @user_data: User data to pass to @callback.
1594 * Like timedate1_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
1596 * 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.
1597 * You can then call timedate1_proxy_new_for_bus_finish() to get the result of the operation.
1599 * See timedate1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
1602 timedate1_proxy_new_for_bus (
1604 GDBusProxyFlags flags
,
1606 const gchar
*object_path
,
1607 GCancellable
*cancellable
,
1608 GAsyncReadyCallback callback
,
1611 g_async_initable_new_async (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
);
1615 * timedate1_proxy_new_for_bus_finish:
1616 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to timedate1_proxy_new_for_bus().
1617 * @error: Return location for error or %NULL
1619 * Finishes an operation started with timedate1_proxy_new_for_bus().
1621 * Returns: (transfer full) (type Timedate1Proxy): The constructed proxy object or %NULL if @error is set.
1624 timedate1_proxy_new_for_bus_finish (
1629 GObject
*source_object
;
1630 source_object
= g_async_result_get_source_object (res
);
1631 ret
= g_async_initable_new_finish (G_ASYNC_INITABLE (source_object
), res
, error
);
1632 g_object_unref (source_object
);
1634 return TIMEDATE1 (ret
);
1640 * timedate1_proxy_new_for_bus_sync:
1641 * @bus_type: A #GBusType.
1642 * @flags: Flags from the #GDBusProxyFlags enumeration.
1643 * @name: A bus name (well-known or unique).
1644 * @object_path: An object path.
1645 * @cancellable: (allow-none): A #GCancellable or %NULL.
1646 * @error: Return location for error or %NULL
1648 * Like timedate1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
1650 * The calling thread is blocked until a reply is received.
1652 * See timedate1_proxy_new_for_bus() for the asynchronous version of this constructor.
1654 * Returns: (transfer full) (type Timedate1Proxy): The constructed proxy object or %NULL if @error is set.
1657 timedate1_proxy_new_for_bus_sync (
1659 GDBusProxyFlags flags
,
1661 const gchar
*object_path
,
1662 GCancellable
*cancellable
,
1666 ret
= g_initable_new (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
);
1668 return TIMEDATE1 (ret
);
1674 /* ------------------------------------------------------------------------ */
1677 * Timedate1Skeleton:
1679 * The #Timedate1Skeleton structure contains only private data and should only be accessed using the provided API.
1683 * Timedate1SkeletonClass:
1684 * @parent_class: The parent class.
1686 * Class structure for #Timedate1Skeleton.
1689 struct _Timedate1SkeletonPrivate
1692 GList
*changed_properties
;
1693 GSource
*changed_properties_idle_source
;
1694 GMainContext
*context
;
1699 _timedate1_skeleton_handle_method_call (
1700 GDBusConnection
*connection G_GNUC_UNUSED
,
1701 const gchar
*sender G_GNUC_UNUSED
,
1702 const gchar
*object_path G_GNUC_UNUSED
,
1703 const gchar
*interface_name
,
1704 const gchar
*method_name
,
1705 GVariant
*parameters
,
1706 GDBusMethodInvocation
*invocation
,
1709 Timedate1Skeleton
*skeleton
= TIMEDATE1_SKELETON (user_data
);
1710 _ExtendedGDBusMethodInfo
*info
;
1718 GValue return_value
= G_VALUE_INIT
;
1719 info
= (_ExtendedGDBusMethodInfo
*) g_dbus_method_invocation_get_method_info (invocation
);
1720 g_assert (info
!= NULL
);
1721 num_params
= g_variant_n_children (parameters
);
1722 num_extra
= info
->pass_fdlist
? 3 : 2; paramv
= g_new0 (GValue
, num_params
+ num_extra
);
1724 g_value_init (¶mv
[n
], TYPE_TIMEDATE1
);
1725 g_value_set_object (¶mv
[n
++], skeleton
);
1726 g_value_init (¶mv
[n
], G_TYPE_DBUS_METHOD_INVOCATION
);
1727 g_value_set_object (¶mv
[n
++], invocation
);
1728 if (info
->pass_fdlist
)
1731 g_value_init (¶mv
[n
], G_TYPE_UNIX_FD_LIST
);
1732 g_value_set_object (¶mv
[n
++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation
)));
1734 g_assert_not_reached ();
1737 g_variant_iter_init (&iter
, parameters
);
1738 while ((child
= g_variant_iter_next_value (&iter
)) != NULL
)
1740 _ExtendedGDBusArgInfo
*arg_info
= (_ExtendedGDBusArgInfo
*) info
->parent_struct
.in_args
[n
- num_extra
];
1741 if (arg_info
->use_gvariant
)
1743 g_value_init (¶mv
[n
], G_TYPE_VARIANT
);
1744 g_value_set_variant (¶mv
[n
], child
);
1748 g_dbus_gvariant_to_gvalue (child
, ¶mv
[n
++]);
1749 g_variant_unref (child
);
1751 signal_id
= g_signal_lookup (info
->signal_name
, TYPE_TIMEDATE1
);
1752 g_value_init (&return_value
, G_TYPE_BOOLEAN
);
1753 g_signal_emitv (paramv
, signal_id
, 0, &return_value
);
1754 if (!g_value_get_boolean (&return_value
))
1755 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
);
1756 g_value_unset (&return_value
);
1757 for (n
= 0; n
< num_params
+ num_extra
; n
++)
1758 g_value_unset (¶mv
[n
]);
1763 _timedate1_skeleton_handle_get_property (
1764 GDBusConnection
*connection G_GNUC_UNUSED
,
1765 const gchar
*sender G_GNUC_UNUSED
,
1766 const gchar
*object_path G_GNUC_UNUSED
,
1767 const gchar
*interface_name G_GNUC_UNUSED
,
1768 const gchar
*property_name
,
1772 Timedate1Skeleton
*skeleton
= TIMEDATE1_SKELETON (user_data
);
1773 GValue value
= G_VALUE_INIT
;
1775 _ExtendedGDBusPropertyInfo
*info
;
1778 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_timedate1_interface_info
.parent_struct
, property_name
);
1779 g_assert (info
!= NULL
);
1780 pspec
= g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton
), info
->hyphen_name
);
1783 g_set_error (error
, G_DBUS_ERROR
, G_DBUS_ERROR_INVALID_ARGS
, "No property with name %s", property_name
);
1787 g_value_init (&value
, pspec
->value_type
);
1788 g_object_get_property (G_OBJECT (skeleton
), info
->hyphen_name
, &value
);
1789 ret
= g_dbus_gvalue_to_gvariant (&value
, G_VARIANT_TYPE (info
->parent_struct
.signature
));
1790 g_value_unset (&value
);
1796 _timedate1_skeleton_handle_set_property (
1797 GDBusConnection
*connection G_GNUC_UNUSED
,
1798 const gchar
*sender G_GNUC_UNUSED
,
1799 const gchar
*object_path G_GNUC_UNUSED
,
1800 const gchar
*interface_name G_GNUC_UNUSED
,
1801 const gchar
*property_name
,
1806 Timedate1Skeleton
*skeleton
= TIMEDATE1_SKELETON (user_data
);
1807 GValue value
= G_VALUE_INIT
;
1809 _ExtendedGDBusPropertyInfo
*info
;
1812 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_timedate1_interface_info
.parent_struct
, property_name
);
1813 g_assert (info
!= NULL
);
1814 pspec
= g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton
), info
->hyphen_name
);
1817 g_set_error (error
, G_DBUS_ERROR
, G_DBUS_ERROR_INVALID_ARGS
, "No property with name %s", property_name
);
1821 if (info
->use_gvariant
)
1822 g_value_set_variant (&value
, variant
);
1824 g_dbus_gvariant_to_gvalue (variant
, &value
);
1825 g_object_set_property (G_OBJECT (skeleton
), info
->hyphen_name
, &value
);
1826 g_value_unset (&value
);
1832 static const GDBusInterfaceVTable _timedate1_skeleton_vtable
=
1834 _timedate1_skeleton_handle_method_call
,
1835 _timedate1_skeleton_handle_get_property
,
1836 _timedate1_skeleton_handle_set_property
,
1840 static GDBusInterfaceInfo
*
1841 timedate1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton
*skeleton G_GNUC_UNUSED
)
1843 return timedate1_interface_info ();
1846 static GDBusInterfaceVTable
*
1847 timedate1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton
*skeleton G_GNUC_UNUSED
)
1849 return (GDBusInterfaceVTable
*) &_timedate1_skeleton_vtable
;
1853 timedate1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton
*_skeleton
)
1855 Timedate1Skeleton
*skeleton
= TIMEDATE1_SKELETON (_skeleton
);
1857 GVariantBuilder builder
;
1859 g_variant_builder_init (&builder
, G_VARIANT_TYPE ("a{sv}"));
1860 if (_timedate1_interface_info
.parent_struct
.properties
== NULL
)
1862 for (n
= 0; _timedate1_interface_info
.parent_struct
.properties
[n
] != NULL
; n
++)
1864 GDBusPropertyInfo
*info
= _timedate1_interface_info
.parent_struct
.properties
[n
];
1865 if (info
->flags
& G_DBUS_PROPERTY_INFO_FLAGS_READABLE
)
1868 value
= _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
);
1871 g_variant_take_ref (value
);
1872 g_variant_builder_add (&builder
, "{sv}", info
->name
, value
);
1873 g_variant_unref (value
);
1878 return g_variant_builder_end (&builder
);
1881 static gboolean
_timedate1_emit_changed (gpointer user_data
);
1884 timedate1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton
*_skeleton
)
1886 Timedate1Skeleton
*skeleton
= TIMEDATE1_SKELETON (_skeleton
);
1887 gboolean emit_changed
= FALSE
;
1889 g_mutex_lock (&skeleton
->priv
->lock
);
1890 if (skeleton
->priv
->changed_properties_idle_source
!= NULL
)
1892 g_source_destroy (skeleton
->priv
->changed_properties_idle_source
);
1893 skeleton
->priv
->changed_properties_idle_source
= NULL
;
1894 emit_changed
= TRUE
;
1896 g_mutex_unlock (&skeleton
->priv
->lock
);
1899 _timedate1_emit_changed (skeleton
);
1902 static void timedate1_skeleton_iface_init (Timedate1Iface
*iface
);
1903 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1904 G_DEFINE_TYPE_WITH_CODE (Timedate1Skeleton
, timedate1_skeleton
, G_TYPE_DBUS_INTERFACE_SKELETON
,
1905 G_ADD_PRIVATE (Timedate1Skeleton
)
1906 G_IMPLEMENT_INTERFACE (TYPE_TIMEDATE1
, timedate1_skeleton_iface_init
));
1909 G_DEFINE_TYPE_WITH_CODE (Timedate1Skeleton
, timedate1_skeleton
, G_TYPE_DBUS_INTERFACE_SKELETON
,
1910 G_IMPLEMENT_INTERFACE (TYPE_TIMEDATE1
, timedate1_skeleton_iface_init
));
1914 timedate1_skeleton_finalize (GObject
*object
)
1916 Timedate1Skeleton
*skeleton
= TIMEDATE1_SKELETON (object
);
1918 for (n
= 0; n
< 3; n
++)
1919 g_value_unset (&skeleton
->priv
->properties
[n
]);
1920 g_free (skeleton
->priv
->properties
);
1921 g_list_free_full (skeleton
->priv
->changed_properties
, (GDestroyNotify
) _changed_property_free
);
1922 if (skeleton
->priv
->changed_properties_idle_source
!= NULL
)
1923 g_source_destroy (skeleton
->priv
->changed_properties_idle_source
);
1924 g_main_context_unref (skeleton
->priv
->context
);
1925 g_mutex_clear (&skeleton
->priv
->lock
);
1926 G_OBJECT_CLASS (timedate1_skeleton_parent_class
)->finalize (object
);
1930 timedate1_skeleton_get_property (GObject
*object
,
1933 GParamSpec
*pspec G_GNUC_UNUSED
)
1935 Timedate1Skeleton
*skeleton
= TIMEDATE1_SKELETON (object
);
1936 g_assert (prop_id
!= 0 && prop_id
- 1 < 3);
1937 g_mutex_lock (&skeleton
->priv
->lock
);
1938 g_value_copy (&skeleton
->priv
->properties
[prop_id
- 1], value
);
1939 g_mutex_unlock (&skeleton
->priv
->lock
);
1943 _timedate1_emit_changed (gpointer user_data
)
1945 Timedate1Skeleton
*skeleton
= TIMEDATE1_SKELETON (user_data
);
1947 GVariantBuilder builder
;
1948 GVariantBuilder invalidated_builder
;
1951 g_mutex_lock (&skeleton
->priv
->lock
);
1952 g_variant_builder_init (&builder
, G_VARIANT_TYPE ("a{sv}"));
1953 g_variant_builder_init (&invalidated_builder
, G_VARIANT_TYPE ("as"));
1954 for (l
= skeleton
->priv
->changed_properties
, num_changes
= 0; l
!= NULL
; l
= l
->next
)
1956 ChangedProperty
*cp
= l
->data
;
1958 const GValue
*cur_value
;
1960 cur_value
= &skeleton
->priv
->properties
[cp
->prop_id
- 1];
1961 if (!_g_value_equal (cur_value
, &cp
->orig_value
))
1963 variant
= g_dbus_gvalue_to_gvariant (cur_value
, G_VARIANT_TYPE (cp
->info
->parent_struct
.signature
));
1964 g_variant_builder_add (&builder
, "{sv}", cp
->info
->parent_struct
.name
, variant
);
1965 g_variant_unref (variant
);
1969 if (num_changes
> 0)
1971 GList
*connections
, *ll
;
1972 GVariant
*signal_variant
;
1973 signal_variant
= g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.timedate1",
1974 &builder
, &invalidated_builder
));
1975 connections
= g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton
));
1976 for (ll
= connections
; ll
!= NULL
; ll
= ll
->next
)
1978 GDBusConnection
*connection
= ll
->data
;
1980 g_dbus_connection_emit_signal (connection
,
1981 NULL
, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton
)),
1982 "org.freedesktop.DBus.Properties",
1983 "PropertiesChanged",
1987 g_variant_unref (signal_variant
);
1988 g_list_free_full (connections
, g_object_unref
);
1992 g_variant_builder_clear (&builder
);
1993 g_variant_builder_clear (&invalidated_builder
);
1995 g_list_free_full (skeleton
->priv
->changed_properties
, (GDestroyNotify
) _changed_property_free
);
1996 skeleton
->priv
->changed_properties
= NULL
;
1997 skeleton
->priv
->changed_properties_idle_source
= NULL
;
1998 g_mutex_unlock (&skeleton
->priv
->lock
);
2003 _timedate1_schedule_emit_changed (Timedate1Skeleton
*skeleton
, const _ExtendedGDBusPropertyInfo
*info
, guint prop_id
, const GValue
*orig_value
)
2005 ChangedProperty
*cp
;
2008 for (l
= skeleton
->priv
->changed_properties
; l
!= NULL
; l
= l
->next
)
2010 ChangedProperty
*i_cp
= l
->data
;
2011 if (i_cp
->info
== info
)
2019 cp
= g_new0 (ChangedProperty
, 1);
2020 cp
->prop_id
= prop_id
;
2022 skeleton
->priv
->changed_properties
= g_list_prepend (skeleton
->priv
->changed_properties
, cp
);
2023 g_value_init (&cp
->orig_value
, G_VALUE_TYPE (orig_value
));
2024 g_value_copy (orig_value
, &cp
->orig_value
);
2029 timedate1_skeleton_notify (GObject
*object
,
2030 GParamSpec
*pspec G_GNUC_UNUSED
)
2032 Timedate1Skeleton
*skeleton
= TIMEDATE1_SKELETON (object
);
2033 g_mutex_lock (&skeleton
->priv
->lock
);
2034 if (skeleton
->priv
->changed_properties
!= NULL
&&
2035 skeleton
->priv
->changed_properties_idle_source
== NULL
)
2037 skeleton
->priv
->changed_properties_idle_source
= g_idle_source_new ();
2038 g_source_set_priority (skeleton
->priv
->changed_properties_idle_source
, G_PRIORITY_DEFAULT
);
2039 g_source_set_callback (skeleton
->priv
->changed_properties_idle_source
, _timedate1_emit_changed
, g_object_ref (skeleton
), (GDestroyNotify
) g_object_unref
);
2040 g_source_attach (skeleton
->priv
->changed_properties_idle_source
, skeleton
->priv
->context
);
2041 g_source_unref (skeleton
->priv
->changed_properties_idle_source
);
2043 g_mutex_unlock (&skeleton
->priv
->lock
);
2047 timedate1_skeleton_set_property (GObject
*object
,
2049 const GValue
*value
,
2052 Timedate1Skeleton
*skeleton
= TIMEDATE1_SKELETON (object
);
2053 g_assert (prop_id
!= 0 && prop_id
- 1 < 3);
2054 g_mutex_lock (&skeleton
->priv
->lock
);
2055 g_object_freeze_notify (object
);
2056 if (!_g_value_equal (value
, &skeleton
->priv
->properties
[prop_id
- 1]))
2058 if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton
)) != NULL
)
2059 _timedate1_schedule_emit_changed (skeleton
, _timedate1_property_info_pointers
[prop_id
- 1], prop_id
, &skeleton
->priv
->properties
[prop_id
- 1]);
2060 g_value_copy (value
, &skeleton
->priv
->properties
[prop_id
- 1]);
2061 g_object_notify_by_pspec (object
, pspec
);
2063 g_mutex_unlock (&skeleton
->priv
->lock
);
2064 g_object_thaw_notify (object
);
2068 timedate1_skeleton_init (Timedate1Skeleton
*skeleton
)
2070 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2071 skeleton
->priv
= timedate1_skeleton_get_instance_private (skeleton
);
2073 skeleton
->priv
= G_TYPE_INSTANCE_GET_PRIVATE (skeleton
, TYPE_TIMEDATE1_SKELETON
, Timedate1SkeletonPrivate
);
2076 g_mutex_init (&skeleton
->priv
->lock
);
2077 skeleton
->priv
->context
= g_main_context_ref_thread_default ();
2078 skeleton
->priv
->properties
= g_new0 (GValue
, 3);
2079 g_value_init (&skeleton
->priv
->properties
[0], G_TYPE_STRING
);
2080 g_value_init (&skeleton
->priv
->properties
[1], G_TYPE_BOOLEAN
);
2081 g_value_init (&skeleton
->priv
->properties
[2], G_TYPE_BOOLEAN
);
2084 static const gchar
*
2085 timedate1_skeleton_get_timezone (Timedate1
*object
)
2087 Timedate1Skeleton
*skeleton
= TIMEDATE1_SKELETON (object
);
2089 g_mutex_lock (&skeleton
->priv
->lock
);
2090 value
= g_value_get_string (&(skeleton
->priv
->properties
[0]));
2091 g_mutex_unlock (&skeleton
->priv
->lock
);
2096 timedate1_skeleton_get_local_rtc (Timedate1
*object
)
2098 Timedate1Skeleton
*skeleton
= TIMEDATE1_SKELETON (object
);
2100 g_mutex_lock (&skeleton
->priv
->lock
);
2101 value
= g_value_get_boolean (&(skeleton
->priv
->properties
[1]));
2102 g_mutex_unlock (&skeleton
->priv
->lock
);
2107 timedate1_skeleton_get_ntp (Timedate1
*object
)
2109 Timedate1Skeleton
*skeleton
= TIMEDATE1_SKELETON (object
);
2111 g_mutex_lock (&skeleton
->priv
->lock
);
2112 value
= g_value_get_boolean (&(skeleton
->priv
->properties
[2]));
2113 g_mutex_unlock (&skeleton
->priv
->lock
);
2118 timedate1_skeleton_class_init (Timedate1SkeletonClass
*klass
)
2120 GObjectClass
*gobject_class
;
2121 GDBusInterfaceSkeletonClass
*skeleton_class
;
2123 gobject_class
= G_OBJECT_CLASS (klass
);
2124 gobject_class
->finalize
= timedate1_skeleton_finalize
;
2125 gobject_class
->get_property
= timedate1_skeleton_get_property
;
2126 gobject_class
->set_property
= timedate1_skeleton_set_property
;
2127 gobject_class
->notify
= timedate1_skeleton_notify
;
2130 timedate1_override_properties (gobject_class
, 1);
2132 skeleton_class
= G_DBUS_INTERFACE_SKELETON_CLASS (klass
);
2133 skeleton_class
->get_info
= timedate1_skeleton_dbus_interface_get_info
;
2134 skeleton_class
->get_properties
= timedate1_skeleton_dbus_interface_get_properties
;
2135 skeleton_class
->flush
= timedate1_skeleton_dbus_interface_flush
;
2136 skeleton_class
->get_vtable
= timedate1_skeleton_dbus_interface_get_vtable
;
2138 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
2139 g_type_class_add_private (klass
, sizeof (Timedate1SkeletonPrivate
));
2144 timedate1_skeleton_iface_init (Timedate1Iface
*iface
)
2146 iface
->get_timezone
= timedate1_skeleton_get_timezone
;
2147 iface
->get_local_rtc
= timedate1_skeleton_get_local_rtc
;
2148 iface
->get_ntp
= timedate1_skeleton_get_ntp
;
2152 * timedate1_skeleton_new:
2154 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-timedate1.top_of_page">org.freedesktop.timedate1</link>.
2156 * Returns: (transfer full) (type Timedate1Skeleton): The skeleton object.
2159 timedate1_skeleton_new (void)
2161 return TIMEDATE1 (g_object_new (TYPE_TIMEDATE1_SKELETON
, NULL
));