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 "localed-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.locale1
153 * ------------------------------------------------------------------------
159 * @short_description: Generated C code for the org.freedesktop.locale1 D-Bus interface
161 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-locale1.top_of_page">org.freedesktop.locale1</link> D-Bus interface in C.
164 /* ---- Introspection data for org.freedesktop.locale1 ---- */
166 static const _ExtendedGDBusArgInfo _locale1_method_info_set_locale_IN_ARG_unnamed_arg0
=
170 (gchar
*) "unnamed_arg0",
177 static const _ExtendedGDBusArgInfo _locale1_method_info_set_locale_IN_ARG_unnamed_arg1
=
181 (gchar
*) "unnamed_arg1",
188 static const _ExtendedGDBusArgInfo
* const _locale1_method_info_set_locale_IN_ARG_pointers
[] =
190 &_locale1_method_info_set_locale_IN_ARG_unnamed_arg0
,
191 &_locale1_method_info_set_locale_IN_ARG_unnamed_arg1
,
195 static const _ExtendedGDBusMethodInfo _locale1_method_info_set_locale
=
199 (gchar
*) "SetLocale",
200 (GDBusArgInfo
**) &_locale1_method_info_set_locale_IN_ARG_pointers
,
208 static const _ExtendedGDBusArgInfo _locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg0
=
212 (gchar
*) "unnamed_arg0",
219 static const _ExtendedGDBusArgInfo _locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg1
=
223 (gchar
*) "unnamed_arg1",
230 static const _ExtendedGDBusArgInfo _locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg2
=
234 (gchar
*) "unnamed_arg2",
241 static const _ExtendedGDBusArgInfo _locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg3
=
245 (gchar
*) "unnamed_arg3",
252 static const _ExtendedGDBusArgInfo
* const _locale1_method_info_set_vconsole_keyboard_IN_ARG_pointers
[] =
254 &_locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg0
,
255 &_locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg1
,
256 &_locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg2
,
257 &_locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg3
,
261 static const _ExtendedGDBusMethodInfo _locale1_method_info_set_vconsole_keyboard
=
265 (gchar
*) "SetVConsoleKeyboard",
266 (GDBusArgInfo
**) &_locale1_method_info_set_vconsole_keyboard_IN_ARG_pointers
,
270 "handle-set-vconsole-keyboard",
274 static const _ExtendedGDBusArgInfo _locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg0
=
278 (gchar
*) "unnamed_arg0",
285 static const _ExtendedGDBusArgInfo _locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg1
=
289 (gchar
*) "unnamed_arg1",
296 static const _ExtendedGDBusArgInfo _locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg2
=
300 (gchar
*) "unnamed_arg2",
307 static const _ExtendedGDBusArgInfo _locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg3
=
311 (gchar
*) "unnamed_arg3",
318 static const _ExtendedGDBusArgInfo _locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg4
=
322 (gchar
*) "unnamed_arg4",
329 static const _ExtendedGDBusArgInfo _locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg5
=
333 (gchar
*) "unnamed_arg5",
340 static const _ExtendedGDBusArgInfo
* const _locale1_method_info_set_x11_keyboard_IN_ARG_pointers
[] =
342 &_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg0
,
343 &_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg1
,
344 &_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg2
,
345 &_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg3
,
346 &_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg4
,
347 &_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg5
,
351 static const _ExtendedGDBusMethodInfo _locale1_method_info_set_x11_keyboard
=
355 (gchar
*) "SetX11Keyboard",
356 (GDBusArgInfo
**) &_locale1_method_info_set_x11_keyboard_IN_ARG_pointers
,
360 "handle-set-x11-keyboard",
364 static const _ExtendedGDBusMethodInfo
* const _locale1_method_info_pointers
[] =
366 &_locale1_method_info_set_locale
,
367 &_locale1_method_info_set_vconsole_keyboard
,
368 &_locale1_method_info_set_x11_keyboard
,
372 static const _ExtendedGDBusPropertyInfo _locale1_property_info_locale
=
378 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
385 static const _ExtendedGDBusPropertyInfo _locale1_property_info_x11_layout
=
389 (gchar
*) "X11Layout",
391 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
398 static const _ExtendedGDBusPropertyInfo _locale1_property_info_x11_model
=
402 (gchar
*) "X11Model",
404 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
411 static const _ExtendedGDBusPropertyInfo _locale1_property_info_x11_variant
=
415 (gchar
*) "X11Variant",
417 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
424 static const _ExtendedGDBusPropertyInfo _locale1_property_info_x11_options
=
428 (gchar
*) "X11Options",
430 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
437 static const _ExtendedGDBusPropertyInfo _locale1_property_info_vconsole_keymap
=
441 (gchar
*) "VConsoleKeymap",
443 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
450 static const _ExtendedGDBusPropertyInfo _locale1_property_info_vconsole_keymap_toggle
=
454 (gchar
*) "VConsoleKeymapToggle",
456 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
459 "vconsole-keymap-toggle",
463 static const _ExtendedGDBusPropertyInfo
* const _locale1_property_info_pointers
[] =
465 &_locale1_property_info_locale
,
466 &_locale1_property_info_x11_layout
,
467 &_locale1_property_info_x11_model
,
468 &_locale1_property_info_x11_variant
,
469 &_locale1_property_info_x11_options
,
470 &_locale1_property_info_vconsole_keymap
,
471 &_locale1_property_info_vconsole_keymap_toggle
,
475 static const _ExtendedGDBusInterfaceInfo _locale1_interface_info
=
479 (gchar
*) "org.freedesktop.locale1",
480 (GDBusMethodInfo
**) &_locale1_method_info_pointers
,
482 (GDBusPropertyInfo
**) &_locale1_property_info_pointers
,
490 * locale1_interface_info:
492 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-locale1.top_of_page">org.freedesktop.locale1</link> D-Bus interface.
494 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
497 locale1_interface_info (void)
499 return (GDBusInterfaceInfo
*) &_locale1_interface_info
.parent_struct
;
503 * locale1_override_properties:
504 * @klass: The class structure for a #GObject<!-- -->-derived class.
505 * @property_id_begin: The property id to assign to the first overridden property.
507 * Overrides all #GObject properties in the #Locale1 interface for a concrete class.
508 * The properties are overridden in the order they are defined.
510 * Returns: The last property id.
513 locale1_override_properties (GObjectClass
*klass
, guint property_id_begin
)
515 g_object_class_override_property (klass
, property_id_begin
++, "locale");
516 g_object_class_override_property (klass
, property_id_begin
++, "x11-layout");
517 g_object_class_override_property (klass
, property_id_begin
++, "x11-model");
518 g_object_class_override_property (klass
, property_id_begin
++, "x11-variant");
519 g_object_class_override_property (klass
, property_id_begin
++, "x11-options");
520 g_object_class_override_property (klass
, property_id_begin
++, "vconsole-keymap");
521 g_object_class_override_property (klass
, property_id_begin
++, "vconsole-keymap-toggle");
522 return property_id_begin
- 1;
530 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-locale1.top_of_page">org.freedesktop.locale1</link>.
535 * @parent_iface: The parent interface.
536 * @handle_set_locale: Handler for the #Locale1::handle-set-locale signal.
537 * @handle_set_vconsole_keyboard: Handler for the #Locale1::handle-set-vconsole-keyboard signal.
538 * @handle_set_x11_keyboard: Handler for the #Locale1::handle-set-x11-keyboard signal.
539 * @get_locale: Getter for the #Locale1:locale property.
540 * @get_vconsole_keymap: Getter for the #Locale1:vconsole-keymap property.
541 * @get_vconsole_keymap_toggle: Getter for the #Locale1:vconsole-keymap-toggle property.
542 * @get_x11_layout: Getter for the #Locale1:x11-layout property.
543 * @get_x11_model: Getter for the #Locale1:x11-model property.
544 * @get_x11_options: Getter for the #Locale1:x11-options property.
545 * @get_x11_variant: Getter for the #Locale1:x11-variant property.
547 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-locale1.top_of_page">org.freedesktop.locale1</link>.
550 typedef Locale1Iface Locale1Interface
;
551 G_DEFINE_INTERFACE (Locale1
, locale1
, G_TYPE_OBJECT
);
554 locale1_default_init (Locale1Iface
*iface
)
556 /* GObject signals for incoming D-Bus method calls: */
558 * Locale1::handle-set-locale:
559 * @object: A #Locale1.
560 * @invocation: A #GDBusMethodInvocation.
561 * @arg_unnamed_arg0: Argument passed by remote caller.
562 * @arg_unnamed_arg1: Argument passed by remote caller.
564 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-locale1.SetLocale">SetLocale()</link> D-Bus method.
566 * 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 locale1_complete_set_locale() 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.
568 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
570 g_signal_new ("handle-set-locale",
571 G_TYPE_FROM_INTERFACE (iface
),
573 G_STRUCT_OFFSET (Locale1Iface
, handle_set_locale
),
574 g_signal_accumulator_true_handled
,
576 g_cclosure_marshal_generic
,
579 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_STRV
, G_TYPE_BOOLEAN
);
582 * Locale1::handle-set-vconsole-keyboard:
583 * @object: A #Locale1.
584 * @invocation: A #GDBusMethodInvocation.
585 * @arg_unnamed_arg0: Argument passed by remote caller.
586 * @arg_unnamed_arg1: Argument passed by remote caller.
587 * @arg_unnamed_arg2: Argument passed by remote caller.
588 * @arg_unnamed_arg3: Argument passed by remote caller.
590 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-locale1.SetVConsoleKeyboard">SetVConsoleKeyboard()</link> D-Bus method.
592 * 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 locale1_complete_set_vconsole_keyboard() 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.
594 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
596 g_signal_new ("handle-set-vconsole-keyboard",
597 G_TYPE_FROM_INTERFACE (iface
),
599 G_STRUCT_OFFSET (Locale1Iface
, handle_set_vconsole_keyboard
),
600 g_signal_accumulator_true_handled
,
602 g_cclosure_marshal_generic
,
605 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_STRING
, G_TYPE_STRING
, G_TYPE_BOOLEAN
, G_TYPE_BOOLEAN
);
608 * Locale1::handle-set-x11-keyboard:
609 * @object: A #Locale1.
610 * @invocation: A #GDBusMethodInvocation.
611 * @arg_unnamed_arg0: Argument passed by remote caller.
612 * @arg_unnamed_arg1: Argument passed by remote caller.
613 * @arg_unnamed_arg2: Argument passed by remote caller.
614 * @arg_unnamed_arg3: Argument passed by remote caller.
615 * @arg_unnamed_arg4: Argument passed by remote caller.
616 * @arg_unnamed_arg5: Argument passed by remote caller.
618 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-locale1.SetX11Keyboard">SetX11Keyboard()</link> D-Bus method.
620 * 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 locale1_complete_set_x11_keyboard() 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.
622 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
624 g_signal_new ("handle-set-x11-keyboard",
625 G_TYPE_FROM_INTERFACE (iface
),
627 G_STRUCT_OFFSET (Locale1Iface
, handle_set_x11_keyboard
),
628 g_signal_accumulator_true_handled
,
630 g_cclosure_marshal_generic
,
633 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_STRING
, G_TYPE_STRING
, G_TYPE_STRING
, G_TYPE_STRING
, G_TYPE_BOOLEAN
, G_TYPE_BOOLEAN
);
635 /* GObject properties for D-Bus properties: */
639 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.Locale">"Locale"</link>.
641 * 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.
643 g_object_interface_install_property (iface
,
644 g_param_spec_boxed ("locale", "Locale", "Locale", G_TYPE_STRV
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
646 * Locale1:x11-layout:
648 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.X11Layout">"X11Layout"</link>.
650 * 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.
652 g_object_interface_install_property (iface
,
653 g_param_spec_string ("x11-layout", "X11Layout", "X11Layout", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
657 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.X11Model">"X11Model"</link>.
659 * 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.
661 g_object_interface_install_property (iface
,
662 g_param_spec_string ("x11-model", "X11Model", "X11Model", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
664 * Locale1:x11-variant:
666 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.X11Variant">"X11Variant"</link>.
668 * 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.
670 g_object_interface_install_property (iface
,
671 g_param_spec_string ("x11-variant", "X11Variant", "X11Variant", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
673 * Locale1:x11-options:
675 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.X11Options">"X11Options"</link>.
677 * 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.
679 g_object_interface_install_property (iface
,
680 g_param_spec_string ("x11-options", "X11Options", "X11Options", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
682 * Locale1:vconsole-keymap:
684 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymap">"VConsoleKeymap"</link>.
686 * 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.
688 g_object_interface_install_property (iface
,
689 g_param_spec_string ("vconsole-keymap", "VConsoleKeymap", "VConsoleKeymap", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
691 * Locale1:vconsole-keymap-toggle:
693 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymapToggle">"VConsoleKeymapToggle"</link>.
695 * 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.
697 g_object_interface_install_property (iface
,
698 g_param_spec_string ("vconsole-keymap-toggle", "VConsoleKeymapToggle", "VConsoleKeymapToggle", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
702 * locale1_get_locale: (skip)
703 * @object: A #Locale1.
705 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.Locale">"Locale"</link> D-Bus property.
707 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
709 * <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 locale1_dup_locale() if on another thread.</warning>
711 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
714 locale1_get_locale (Locale1
*object
)
716 return LOCALE1_GET_IFACE (object
)->get_locale (object
);
720 * locale1_dup_locale: (skip)
721 * @object: A #Locale1.
723 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.Locale">"Locale"</link> D-Bus property.
725 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
727 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev().
730 locale1_dup_locale (Locale1
*object
)
733 g_object_get (G_OBJECT (object
), "locale", &value
, NULL
);
738 * locale1_set_locale: (skip)
739 * @object: A #Locale1.
740 * @value: The value to set.
742 * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.Locale">"Locale"</link> D-Bus property to @value.
744 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
747 locale1_set_locale (Locale1
*object
, const gchar
*const *value
)
749 g_object_set (G_OBJECT (object
), "locale", value
, NULL
);
753 * locale1_get_x11_layout: (skip)
754 * @object: A #Locale1.
756 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Layout">"X11Layout"</link> D-Bus property.
758 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
760 * <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 locale1_dup_x11_layout() if on another thread.</warning>
762 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
765 locale1_get_x11_layout (Locale1
*object
)
767 return LOCALE1_GET_IFACE (object
)->get_x11_layout (object
);
771 * locale1_dup_x11_layout: (skip)
772 * @object: A #Locale1.
774 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Layout">"X11Layout"</link> D-Bus property.
776 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
778 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
781 locale1_dup_x11_layout (Locale1
*object
)
784 g_object_get (G_OBJECT (object
), "x11-layout", &value
, NULL
);
789 * locale1_set_x11_layout: (skip)
790 * @object: A #Locale1.
791 * @value: The value to set.
793 * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.X11Layout">"X11Layout"</link> D-Bus property to @value.
795 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
798 locale1_set_x11_layout (Locale1
*object
, const gchar
*value
)
800 g_object_set (G_OBJECT (object
), "x11-layout", value
, NULL
);
804 * locale1_get_x11_model: (skip)
805 * @object: A #Locale1.
807 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Model">"X11Model"</link> D-Bus property.
809 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
811 * <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 locale1_dup_x11_model() if on another thread.</warning>
813 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
816 locale1_get_x11_model (Locale1
*object
)
818 return LOCALE1_GET_IFACE (object
)->get_x11_model (object
);
822 * locale1_dup_x11_model: (skip)
823 * @object: A #Locale1.
825 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Model">"X11Model"</link> D-Bus property.
827 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
829 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
832 locale1_dup_x11_model (Locale1
*object
)
835 g_object_get (G_OBJECT (object
), "x11-model", &value
, NULL
);
840 * locale1_set_x11_model: (skip)
841 * @object: A #Locale1.
842 * @value: The value to set.
844 * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.X11Model">"X11Model"</link> D-Bus property to @value.
846 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
849 locale1_set_x11_model (Locale1
*object
, const gchar
*value
)
851 g_object_set (G_OBJECT (object
), "x11-model", value
, NULL
);
855 * locale1_get_x11_variant: (skip)
856 * @object: A #Locale1.
858 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Variant">"X11Variant"</link> D-Bus property.
860 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
862 * <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 locale1_dup_x11_variant() if on another thread.</warning>
864 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
867 locale1_get_x11_variant (Locale1
*object
)
869 return LOCALE1_GET_IFACE (object
)->get_x11_variant (object
);
873 * locale1_dup_x11_variant: (skip)
874 * @object: A #Locale1.
876 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Variant">"X11Variant"</link> D-Bus property.
878 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
880 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
883 locale1_dup_x11_variant (Locale1
*object
)
886 g_object_get (G_OBJECT (object
), "x11-variant", &value
, NULL
);
891 * locale1_set_x11_variant: (skip)
892 * @object: A #Locale1.
893 * @value: The value to set.
895 * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.X11Variant">"X11Variant"</link> D-Bus property to @value.
897 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
900 locale1_set_x11_variant (Locale1
*object
, const gchar
*value
)
902 g_object_set (G_OBJECT (object
), "x11-variant", value
, NULL
);
906 * locale1_get_x11_options: (skip)
907 * @object: A #Locale1.
909 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Options">"X11Options"</link> D-Bus property.
911 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
913 * <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 locale1_dup_x11_options() if on another thread.</warning>
915 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
918 locale1_get_x11_options (Locale1
*object
)
920 return LOCALE1_GET_IFACE (object
)->get_x11_options (object
);
924 * locale1_dup_x11_options: (skip)
925 * @object: A #Locale1.
927 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Options">"X11Options"</link> D-Bus property.
929 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
931 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
934 locale1_dup_x11_options (Locale1
*object
)
937 g_object_get (G_OBJECT (object
), "x11-options", &value
, NULL
);
942 * locale1_set_x11_options: (skip)
943 * @object: A #Locale1.
944 * @value: The value to set.
946 * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.X11Options">"X11Options"</link> D-Bus property to @value.
948 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
951 locale1_set_x11_options (Locale1
*object
, const gchar
*value
)
953 g_object_set (G_OBJECT (object
), "x11-options", value
, NULL
);
957 * locale1_get_vconsole_keymap: (skip)
958 * @object: A #Locale1.
960 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymap">"VConsoleKeymap"</link> D-Bus property.
962 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
964 * <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 locale1_dup_vconsole_keymap() if on another thread.</warning>
966 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
969 locale1_get_vconsole_keymap (Locale1
*object
)
971 return LOCALE1_GET_IFACE (object
)->get_vconsole_keymap (object
);
975 * locale1_dup_vconsole_keymap: (skip)
976 * @object: A #Locale1.
978 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymap">"VConsoleKeymap"</link> D-Bus property.
980 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
982 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
985 locale1_dup_vconsole_keymap (Locale1
*object
)
988 g_object_get (G_OBJECT (object
), "vconsole-keymap", &value
, NULL
);
993 * locale1_set_vconsole_keymap: (skip)
994 * @object: A #Locale1.
995 * @value: The value to set.
997 * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymap">"VConsoleKeymap"</link> D-Bus property to @value.
999 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1002 locale1_set_vconsole_keymap (Locale1
*object
, const gchar
*value
)
1004 g_object_set (G_OBJECT (object
), "vconsole-keymap", value
, NULL
);
1008 * locale1_get_vconsole_keymap_toggle: (skip)
1009 * @object: A #Locale1.
1011 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymapToggle">"VConsoleKeymapToggle"</link> D-Bus property.
1013 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1015 * <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 locale1_dup_vconsole_keymap_toggle() if on another thread.</warning>
1017 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1020 locale1_get_vconsole_keymap_toggle (Locale1
*object
)
1022 return LOCALE1_GET_IFACE (object
)->get_vconsole_keymap_toggle (object
);
1026 * locale1_dup_vconsole_keymap_toggle: (skip)
1027 * @object: A #Locale1.
1029 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymapToggle">"VConsoleKeymapToggle"</link> D-Bus property.
1031 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1033 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1036 locale1_dup_vconsole_keymap_toggle (Locale1
*object
)
1039 g_object_get (G_OBJECT (object
), "vconsole-keymap-toggle", &value
, NULL
);
1044 * locale1_set_vconsole_keymap_toggle: (skip)
1045 * @object: A #Locale1.
1046 * @value: The value to set.
1048 * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymapToggle">"VConsoleKeymapToggle"</link> D-Bus property to @value.
1050 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1053 locale1_set_vconsole_keymap_toggle (Locale1
*object
, const gchar
*value
)
1055 g_object_set (G_OBJECT (object
), "vconsole-keymap-toggle", value
, NULL
);
1059 * locale1_call_set_locale:
1060 * @proxy: A #Locale1Proxy.
1061 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1062 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1063 * @cancellable: (allow-none): A #GCancellable or %NULL.
1064 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1065 * @user_data: User data to pass to @callback.
1067 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-locale1.SetLocale">SetLocale()</link> D-Bus method on @proxy.
1068 * 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.
1069 * You can then call locale1_call_set_locale_finish() to get the result of the operation.
1071 * See locale1_call_set_locale_sync() for the synchronous, blocking version of this method.
1074 locale1_call_set_locale (
1076 const gchar
*const *arg_unnamed_arg0
,
1077 gboolean arg_unnamed_arg1
,
1078 GCancellable
*cancellable
,
1079 GAsyncReadyCallback callback
,
1082 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
1084 g_variant_new ("(^asb)",
1087 G_DBUS_CALL_FLAGS_NONE
,
1095 * locale1_call_set_locale_finish:
1096 * @proxy: A #Locale1Proxy.
1097 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to locale1_call_set_locale().
1098 * @error: Return location for error or %NULL.
1100 * Finishes an operation started with locale1_call_set_locale().
1102 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1105 locale1_call_set_locale_finish (
1111 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
1114 g_variant_get (_ret
,
1116 g_variant_unref (_ret
);
1118 return _ret
!= NULL
;
1122 * locale1_call_set_locale_sync:
1123 * @proxy: A #Locale1Proxy.
1124 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1125 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1126 * @cancellable: (allow-none): A #GCancellable or %NULL.
1127 * @error: Return location for error or %NULL.
1129 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-locale1.SetLocale">SetLocale()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1131 * See locale1_call_set_locale() for the asynchronous version of this method.
1133 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1136 locale1_call_set_locale_sync (
1138 const gchar
*const *arg_unnamed_arg0
,
1139 gboolean arg_unnamed_arg1
,
1140 GCancellable
*cancellable
,
1144 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
1146 g_variant_new ("(^asb)",
1149 G_DBUS_CALL_FLAGS_NONE
,
1155 g_variant_get (_ret
,
1157 g_variant_unref (_ret
);
1159 return _ret
!= NULL
;
1163 * locale1_call_set_vconsole_keyboard:
1164 * @proxy: A #Locale1Proxy.
1165 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1166 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1167 * @arg_unnamed_arg2: Argument to pass with the method invocation.
1168 * @arg_unnamed_arg3: Argument to pass with the method invocation.
1169 * @cancellable: (allow-none): A #GCancellable or %NULL.
1170 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1171 * @user_data: User data to pass to @callback.
1173 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-locale1.SetVConsoleKeyboard">SetVConsoleKeyboard()</link> D-Bus method on @proxy.
1174 * 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.
1175 * You can then call locale1_call_set_vconsole_keyboard_finish() to get the result of the operation.
1177 * See locale1_call_set_vconsole_keyboard_sync() for the synchronous, blocking version of this method.
1180 locale1_call_set_vconsole_keyboard (
1182 const gchar
*arg_unnamed_arg0
,
1183 const gchar
*arg_unnamed_arg1
,
1184 gboolean arg_unnamed_arg2
,
1185 gboolean arg_unnamed_arg3
,
1186 GCancellable
*cancellable
,
1187 GAsyncReadyCallback callback
,
1190 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
1191 "SetVConsoleKeyboard",
1192 g_variant_new ("(ssbb)",
1197 G_DBUS_CALL_FLAGS_NONE
,
1205 * locale1_call_set_vconsole_keyboard_finish:
1206 * @proxy: A #Locale1Proxy.
1207 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to locale1_call_set_vconsole_keyboard().
1208 * @error: Return location for error or %NULL.
1210 * Finishes an operation started with locale1_call_set_vconsole_keyboard().
1212 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1215 locale1_call_set_vconsole_keyboard_finish (
1221 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
1224 g_variant_get (_ret
,
1226 g_variant_unref (_ret
);
1228 return _ret
!= NULL
;
1232 * locale1_call_set_vconsole_keyboard_sync:
1233 * @proxy: A #Locale1Proxy.
1234 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1235 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1236 * @arg_unnamed_arg2: Argument to pass with the method invocation.
1237 * @arg_unnamed_arg3: Argument to pass with the method invocation.
1238 * @cancellable: (allow-none): A #GCancellable or %NULL.
1239 * @error: Return location for error or %NULL.
1241 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-locale1.SetVConsoleKeyboard">SetVConsoleKeyboard()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1243 * See locale1_call_set_vconsole_keyboard() for the asynchronous version of this method.
1245 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1248 locale1_call_set_vconsole_keyboard_sync (
1250 const gchar
*arg_unnamed_arg0
,
1251 const gchar
*arg_unnamed_arg1
,
1252 gboolean arg_unnamed_arg2
,
1253 gboolean arg_unnamed_arg3
,
1254 GCancellable
*cancellable
,
1258 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
1259 "SetVConsoleKeyboard",
1260 g_variant_new ("(ssbb)",
1265 G_DBUS_CALL_FLAGS_NONE
,
1271 g_variant_get (_ret
,
1273 g_variant_unref (_ret
);
1275 return _ret
!= NULL
;
1279 * locale1_call_set_x11_keyboard:
1280 * @proxy: A #Locale1Proxy.
1281 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1282 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1283 * @arg_unnamed_arg2: Argument to pass with the method invocation.
1284 * @arg_unnamed_arg3: Argument to pass with the method invocation.
1285 * @arg_unnamed_arg4: Argument to pass with the method invocation.
1286 * @arg_unnamed_arg5: Argument to pass with the method invocation.
1287 * @cancellable: (allow-none): A #GCancellable or %NULL.
1288 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1289 * @user_data: User data to pass to @callback.
1291 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-locale1.SetX11Keyboard">SetX11Keyboard()</link> D-Bus method on @proxy.
1292 * 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.
1293 * You can then call locale1_call_set_x11_keyboard_finish() to get the result of the operation.
1295 * See locale1_call_set_x11_keyboard_sync() for the synchronous, blocking version of this method.
1298 locale1_call_set_x11_keyboard (
1300 const gchar
*arg_unnamed_arg0
,
1301 const gchar
*arg_unnamed_arg1
,
1302 const gchar
*arg_unnamed_arg2
,
1303 const gchar
*arg_unnamed_arg3
,
1304 gboolean arg_unnamed_arg4
,
1305 gboolean arg_unnamed_arg5
,
1306 GCancellable
*cancellable
,
1307 GAsyncReadyCallback callback
,
1310 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
1312 g_variant_new ("(ssssbb)",
1319 G_DBUS_CALL_FLAGS_NONE
,
1327 * locale1_call_set_x11_keyboard_finish:
1328 * @proxy: A #Locale1Proxy.
1329 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to locale1_call_set_x11_keyboard().
1330 * @error: Return location for error or %NULL.
1332 * Finishes an operation started with locale1_call_set_x11_keyboard().
1334 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1337 locale1_call_set_x11_keyboard_finish (
1343 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
1346 g_variant_get (_ret
,
1348 g_variant_unref (_ret
);
1350 return _ret
!= NULL
;
1354 * locale1_call_set_x11_keyboard_sync:
1355 * @proxy: A #Locale1Proxy.
1356 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1357 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1358 * @arg_unnamed_arg2: Argument to pass with the method invocation.
1359 * @arg_unnamed_arg3: Argument to pass with the method invocation.
1360 * @arg_unnamed_arg4: Argument to pass with the method invocation.
1361 * @arg_unnamed_arg5: Argument to pass with the method invocation.
1362 * @cancellable: (allow-none): A #GCancellable or %NULL.
1363 * @error: Return location for error or %NULL.
1365 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-locale1.SetX11Keyboard">SetX11Keyboard()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1367 * See locale1_call_set_x11_keyboard() for the asynchronous version of this method.
1369 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1372 locale1_call_set_x11_keyboard_sync (
1374 const gchar
*arg_unnamed_arg0
,
1375 const gchar
*arg_unnamed_arg1
,
1376 const gchar
*arg_unnamed_arg2
,
1377 const gchar
*arg_unnamed_arg3
,
1378 gboolean arg_unnamed_arg4
,
1379 gboolean arg_unnamed_arg5
,
1380 GCancellable
*cancellable
,
1384 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
1386 g_variant_new ("(ssssbb)",
1393 G_DBUS_CALL_FLAGS_NONE
,
1399 g_variant_get (_ret
,
1401 g_variant_unref (_ret
);
1403 return _ret
!= NULL
;
1407 * locale1_complete_set_locale:
1408 * @object: A #Locale1.
1409 * @invocation: (transfer full): A #GDBusMethodInvocation.
1411 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-locale1.SetLocale">SetLocale()</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.
1413 * This method will free @invocation, you cannot use it afterwards.
1416 locale1_complete_set_locale (
1418 GDBusMethodInvocation
*invocation
)
1420 g_dbus_method_invocation_return_value (invocation
,
1421 g_variant_new ("()"));
1425 * locale1_complete_set_vconsole_keyboard:
1426 * @object: A #Locale1.
1427 * @invocation: (transfer full): A #GDBusMethodInvocation.
1429 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-locale1.SetVConsoleKeyboard">SetVConsoleKeyboard()</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.
1431 * This method will free @invocation, you cannot use it afterwards.
1434 locale1_complete_set_vconsole_keyboard (
1436 GDBusMethodInvocation
*invocation
)
1438 g_dbus_method_invocation_return_value (invocation
,
1439 g_variant_new ("()"));
1443 * locale1_complete_set_x11_keyboard:
1444 * @object: A #Locale1.
1445 * @invocation: (transfer full): A #GDBusMethodInvocation.
1447 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-locale1.SetX11Keyboard">SetX11Keyboard()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
1449 * This method will free @invocation, you cannot use it afterwards.
1452 locale1_complete_set_x11_keyboard (
1454 GDBusMethodInvocation
*invocation
)
1456 g_dbus_method_invocation_return_value (invocation
,
1457 g_variant_new ("()"));
1460 /* ------------------------------------------------------------------------ */
1465 * The #Locale1Proxy structure contains only private data and should only be accessed using the provided API.
1469 * Locale1ProxyClass:
1470 * @parent_class: The parent class.
1472 * Class structure for #Locale1Proxy.
1475 struct _Locale1ProxyPrivate
1480 static void locale1_proxy_iface_init (Locale1Iface
*iface
);
1482 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1483 G_DEFINE_TYPE_WITH_CODE (Locale1Proxy
, locale1_proxy
, G_TYPE_DBUS_PROXY
,
1484 G_ADD_PRIVATE (Locale1Proxy
)
1485 G_IMPLEMENT_INTERFACE (TYPE_LOCALE1
, locale1_proxy_iface_init
));
1488 G_DEFINE_TYPE_WITH_CODE (Locale1Proxy
, locale1_proxy
, G_TYPE_DBUS_PROXY
,
1489 G_IMPLEMENT_INTERFACE (TYPE_LOCALE1
, locale1_proxy_iface_init
));
1493 locale1_proxy_finalize (GObject
*object
)
1495 Locale1Proxy
*proxy
= LOCALE1_PROXY (object
);
1496 g_datalist_clear (&proxy
->priv
->qdata
);
1497 G_OBJECT_CLASS (locale1_proxy_parent_class
)->finalize (object
);
1501 locale1_proxy_get_property (GObject
*object
,
1504 GParamSpec
*pspec G_GNUC_UNUSED
)
1506 const _ExtendedGDBusPropertyInfo
*info
;
1508 g_assert (prop_id
!= 0 && prop_id
- 1 < 7);
1509 info
= _locale1_property_info_pointers
[prop_id
- 1];
1510 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object
), info
->parent_struct
.name
);
1511 if (info
->use_gvariant
)
1513 g_value_set_variant (value
, variant
);
1517 if (variant
!= NULL
)
1518 g_dbus_gvariant_to_gvalue (variant
, value
);
1520 if (variant
!= NULL
)
1521 g_variant_unref (variant
);
1525 locale1_proxy_set_property_cb (GDBusProxy
*proxy
,
1529 const _ExtendedGDBusPropertyInfo
*info
= user_data
;
1533 _ret
= g_dbus_proxy_call_finish (proxy
, res
, &error
);
1536 g_warning ("Error setting property '%s' on interface org.freedesktop.locale1: %s (%s, %d)",
1537 info
->parent_struct
.name
,
1538 error
->message
, g_quark_to_string (error
->domain
), error
->code
);
1539 g_error_free (error
);
1543 g_variant_unref (_ret
);
1548 locale1_proxy_set_property (GObject
*object
,
1550 const GValue
*value
,
1551 GParamSpec
*pspec G_GNUC_UNUSED
)
1553 const _ExtendedGDBusPropertyInfo
*info
;
1555 g_assert (prop_id
!= 0 && prop_id
- 1 < 7);
1556 info
= _locale1_property_info_pointers
[prop_id
- 1];
1557 variant
= g_dbus_gvalue_to_gvariant (value
, G_VARIANT_TYPE (info
->parent_struct
.signature
));
1558 g_dbus_proxy_call (G_DBUS_PROXY (object
),
1559 "org.freedesktop.DBus.Properties.Set",
1560 g_variant_new ("(ssv)", "org.freedesktop.locale1", info
->parent_struct
.name
, variant
),
1561 G_DBUS_CALL_FLAGS_NONE
,
1563 NULL
, (GAsyncReadyCallback
) locale1_proxy_set_property_cb
, (GDBusPropertyInfo
*) &info
->parent_struct
);
1564 g_variant_unref (variant
);
1568 locale1_proxy_g_signal (GDBusProxy
*proxy
,
1569 const gchar
*sender_name G_GNUC_UNUSED
,
1570 const gchar
*signal_name
,
1571 GVariant
*parameters
)
1573 _ExtendedGDBusSignalInfo
*info
;
1580 info
= (_ExtendedGDBusSignalInfo
*) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo
*) &_locale1_interface_info
.parent_struct
, signal_name
);
1583 num_params
= g_variant_n_children (parameters
);
1584 paramv
= g_new0 (GValue
, num_params
+ 1);
1585 g_value_init (¶mv
[0], TYPE_LOCALE1
);
1586 g_value_set_object (¶mv
[0], proxy
);
1587 g_variant_iter_init (&iter
, parameters
);
1589 while ((child
= g_variant_iter_next_value (&iter
)) != NULL
)
1591 _ExtendedGDBusArgInfo
*arg_info
= (_ExtendedGDBusArgInfo
*) info
->parent_struct
.args
[n
- 1];
1592 if (arg_info
->use_gvariant
)
1594 g_value_init (¶mv
[n
], G_TYPE_VARIANT
);
1595 g_value_set_variant (¶mv
[n
], child
);
1599 g_dbus_gvariant_to_gvalue (child
, ¶mv
[n
++]);
1600 g_variant_unref (child
);
1602 signal_id
= g_signal_lookup (info
->signal_name
, TYPE_LOCALE1
);
1603 g_signal_emitv (paramv
, signal_id
, 0, NULL
);
1604 for (n
= 0; n
< num_params
+ 1; n
++)
1605 g_value_unset (¶mv
[n
]);
1610 locale1_proxy_g_properties_changed (GDBusProxy
*_proxy
,
1611 GVariant
*changed_properties
,
1612 const gchar
*const *invalidated_properties
)
1614 Locale1Proxy
*proxy
= LOCALE1_PROXY (_proxy
);
1618 _ExtendedGDBusPropertyInfo
*info
;
1619 g_variant_get (changed_properties
, "a{sv}", &iter
);
1620 while (g_variant_iter_next (iter
, "{&sv}", &key
, NULL
))
1622 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_locale1_interface_info
.parent_struct
, key
);
1623 g_datalist_remove_data (&proxy
->priv
->qdata
, key
);
1625 g_object_notify (G_OBJECT (proxy
), info
->hyphen_name
);
1627 g_variant_iter_free (iter
);
1628 for (n
= 0; invalidated_properties
[n
] != NULL
; n
++)
1630 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_locale1_interface_info
.parent_struct
, invalidated_properties
[n
]);
1631 g_datalist_remove_data (&proxy
->priv
->qdata
, invalidated_properties
[n
]);
1633 g_object_notify (G_OBJECT (proxy
), info
->hyphen_name
);
1637 static const gchar
*const *
1638 locale1_proxy_get_locale (Locale1
*object
)
1640 Locale1Proxy
*proxy
= LOCALE1_PROXY (object
);
1642 const gchar
*const *value
= NULL
;
1643 value
= g_datalist_get_data (&proxy
->priv
->qdata
, "Locale");
1646 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "Locale");
1647 if (variant
!= NULL
)
1649 value
= g_variant_get_strv (variant
, NULL
);
1650 g_datalist_set_data_full (&proxy
->priv
->qdata
, "Locale", (gpointer
) value
, g_free
);
1651 g_variant_unref (variant
);
1656 static const gchar
*
1657 locale1_proxy_get_x11_layout (Locale1
*object
)
1659 Locale1Proxy
*proxy
= LOCALE1_PROXY (object
);
1661 const gchar
*value
= NULL
;
1662 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "X11Layout");
1663 if (variant
!= NULL
)
1665 value
= g_variant_get_string (variant
, NULL
);
1666 g_variant_unref (variant
);
1671 static const gchar
*
1672 locale1_proxy_get_x11_model (Locale1
*object
)
1674 Locale1Proxy
*proxy
= LOCALE1_PROXY (object
);
1676 const gchar
*value
= NULL
;
1677 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "X11Model");
1678 if (variant
!= NULL
)
1680 value
= g_variant_get_string (variant
, NULL
);
1681 g_variant_unref (variant
);
1686 static const gchar
*
1687 locale1_proxy_get_x11_variant (Locale1
*object
)
1689 Locale1Proxy
*proxy
= LOCALE1_PROXY (object
);
1691 const gchar
*value
= NULL
;
1692 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "X11Variant");
1693 if (variant
!= NULL
)
1695 value
= g_variant_get_string (variant
, NULL
);
1696 g_variant_unref (variant
);
1701 static const gchar
*
1702 locale1_proxy_get_x11_options (Locale1
*object
)
1704 Locale1Proxy
*proxy
= LOCALE1_PROXY (object
);
1706 const gchar
*value
= NULL
;
1707 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "X11Options");
1708 if (variant
!= NULL
)
1710 value
= g_variant_get_string (variant
, NULL
);
1711 g_variant_unref (variant
);
1716 static const gchar
*
1717 locale1_proxy_get_vconsole_keymap (Locale1
*object
)
1719 Locale1Proxy
*proxy
= LOCALE1_PROXY (object
);
1721 const gchar
*value
= NULL
;
1722 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "VConsoleKeymap");
1723 if (variant
!= NULL
)
1725 value
= g_variant_get_string (variant
, NULL
);
1726 g_variant_unref (variant
);
1731 static const gchar
*
1732 locale1_proxy_get_vconsole_keymap_toggle (Locale1
*object
)
1734 Locale1Proxy
*proxy
= LOCALE1_PROXY (object
);
1736 const gchar
*value
= NULL
;
1737 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "VConsoleKeymapToggle");
1738 if (variant
!= NULL
)
1740 value
= g_variant_get_string (variant
, NULL
);
1741 g_variant_unref (variant
);
1747 locale1_proxy_init (Locale1Proxy
*proxy
)
1749 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1750 proxy
->priv
= locale1_proxy_get_instance_private (proxy
);
1752 proxy
->priv
= G_TYPE_INSTANCE_GET_PRIVATE (proxy
, TYPE_LOCALE1_PROXY
, Locale1ProxyPrivate
);
1755 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy
), locale1_interface_info ());
1759 locale1_proxy_class_init (Locale1ProxyClass
*klass
)
1761 GObjectClass
*gobject_class
;
1762 GDBusProxyClass
*proxy_class
;
1764 gobject_class
= G_OBJECT_CLASS (klass
);
1765 gobject_class
->finalize
= locale1_proxy_finalize
;
1766 gobject_class
->get_property
= locale1_proxy_get_property
;
1767 gobject_class
->set_property
= locale1_proxy_set_property
;
1769 proxy_class
= G_DBUS_PROXY_CLASS (klass
);
1770 proxy_class
->g_signal
= locale1_proxy_g_signal
;
1771 proxy_class
->g_properties_changed
= locale1_proxy_g_properties_changed
;
1773 locale1_override_properties (gobject_class
, 1);
1775 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1776 g_type_class_add_private (klass
, sizeof (Locale1ProxyPrivate
));
1781 locale1_proxy_iface_init (Locale1Iface
*iface
)
1783 iface
->get_locale
= locale1_proxy_get_locale
;
1784 iface
->get_x11_layout
= locale1_proxy_get_x11_layout
;
1785 iface
->get_x11_model
= locale1_proxy_get_x11_model
;
1786 iface
->get_x11_variant
= locale1_proxy_get_x11_variant
;
1787 iface
->get_x11_options
= locale1_proxy_get_x11_options
;
1788 iface
->get_vconsole_keymap
= locale1_proxy_get_vconsole_keymap
;
1789 iface
->get_vconsole_keymap_toggle
= locale1_proxy_get_vconsole_keymap_toggle
;
1793 * locale1_proxy_new:
1794 * @connection: A #GDBusConnection.
1795 * @flags: Flags from the #GDBusProxyFlags enumeration.
1796 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1797 * @object_path: An object path.
1798 * @cancellable: (allow-none): A #GCancellable or %NULL.
1799 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1800 * @user_data: User data to pass to @callback.
1802 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-locale1.top_of_page">org.freedesktop.locale1</link>. See g_dbus_proxy_new() for more details.
1804 * 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.
1805 * You can then call locale1_proxy_new_finish() to get the result of the operation.
1807 * See locale1_proxy_new_sync() for the synchronous, blocking version of this constructor.
1811 GDBusConnection
*connection
,
1812 GDBusProxyFlags flags
,
1814 const gchar
*object_path
,
1815 GCancellable
*cancellable
,
1816 GAsyncReadyCallback callback
,
1819 g_async_initable_new_async (TYPE_LOCALE1_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.locale1", NULL
);
1823 * locale1_proxy_new_finish:
1824 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to locale1_proxy_new().
1825 * @error: Return location for error or %NULL
1827 * Finishes an operation started with locale1_proxy_new().
1829 * Returns: (transfer full) (type Locale1Proxy): The constructed proxy object or %NULL if @error is set.
1832 locale1_proxy_new_finish (
1837 GObject
*source_object
;
1838 source_object
= g_async_result_get_source_object (res
);
1839 ret
= g_async_initable_new_finish (G_ASYNC_INITABLE (source_object
), res
, error
);
1840 g_object_unref (source_object
);
1842 return LOCALE1 (ret
);
1848 * locale1_proxy_new_sync:
1849 * @connection: A #GDBusConnection.
1850 * @flags: Flags from the #GDBusProxyFlags enumeration.
1851 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1852 * @object_path: An object path.
1853 * @cancellable: (allow-none): A #GCancellable or %NULL.
1854 * @error: Return location for error or %NULL
1856 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-locale1.top_of_page">org.freedesktop.locale1</link>. See g_dbus_proxy_new_sync() for more details.
1858 * The calling thread is blocked until a reply is received.
1860 * See locale1_proxy_new() for the asynchronous version of this constructor.
1862 * Returns: (transfer full) (type Locale1Proxy): The constructed proxy object or %NULL if @error is set.
1865 locale1_proxy_new_sync (
1866 GDBusConnection
*connection
,
1867 GDBusProxyFlags flags
,
1869 const gchar
*object_path
,
1870 GCancellable
*cancellable
,
1874 ret
= g_initable_new (TYPE_LOCALE1_PROXY
, cancellable
, error
, "g-flags", flags
, "g-name", name
, "g-connection", connection
, "g-object-path", object_path
, "g-interface-name", "org.freedesktop.locale1", NULL
);
1876 return LOCALE1 (ret
);
1883 * locale1_proxy_new_for_bus:
1884 * @bus_type: A #GBusType.
1885 * @flags: Flags from the #GDBusProxyFlags enumeration.
1886 * @name: A bus name (well-known or unique).
1887 * @object_path: An object path.
1888 * @cancellable: (allow-none): A #GCancellable or %NULL.
1889 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1890 * @user_data: User data to pass to @callback.
1892 * Like locale1_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
1894 * 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.
1895 * You can then call locale1_proxy_new_for_bus_finish() to get the result of the operation.
1897 * See locale1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
1900 locale1_proxy_new_for_bus (
1902 GDBusProxyFlags flags
,
1904 const gchar
*object_path
,
1905 GCancellable
*cancellable
,
1906 GAsyncReadyCallback callback
,
1909 g_async_initable_new_async (TYPE_LOCALE1_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.locale1", NULL
);
1913 * locale1_proxy_new_for_bus_finish:
1914 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to locale1_proxy_new_for_bus().
1915 * @error: Return location for error or %NULL
1917 * Finishes an operation started with locale1_proxy_new_for_bus().
1919 * Returns: (transfer full) (type Locale1Proxy): The constructed proxy object or %NULL if @error is set.
1922 locale1_proxy_new_for_bus_finish (
1927 GObject
*source_object
;
1928 source_object
= g_async_result_get_source_object (res
);
1929 ret
= g_async_initable_new_finish (G_ASYNC_INITABLE (source_object
), res
, error
);
1930 g_object_unref (source_object
);
1932 return LOCALE1 (ret
);
1938 * locale1_proxy_new_for_bus_sync:
1939 * @bus_type: A #GBusType.
1940 * @flags: Flags from the #GDBusProxyFlags enumeration.
1941 * @name: A bus name (well-known or unique).
1942 * @object_path: An object path.
1943 * @cancellable: (allow-none): A #GCancellable or %NULL.
1944 * @error: Return location for error or %NULL
1946 * Like locale1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
1948 * The calling thread is blocked until a reply is received.
1950 * See locale1_proxy_new_for_bus() for the asynchronous version of this constructor.
1952 * Returns: (transfer full) (type Locale1Proxy): The constructed proxy object or %NULL if @error is set.
1955 locale1_proxy_new_for_bus_sync (
1957 GDBusProxyFlags flags
,
1959 const gchar
*object_path
,
1960 GCancellable
*cancellable
,
1964 ret
= g_initable_new (TYPE_LOCALE1_PROXY
, cancellable
, error
, "g-flags", flags
, "g-name", name
, "g-bus-type", bus_type
, "g-object-path", object_path
, "g-interface-name", "org.freedesktop.locale1", NULL
);
1966 return LOCALE1 (ret
);
1972 /* ------------------------------------------------------------------------ */
1977 * The #Locale1Skeleton structure contains only private data and should only be accessed using the provided API.
1981 * Locale1SkeletonClass:
1982 * @parent_class: The parent class.
1984 * Class structure for #Locale1Skeleton.
1987 struct _Locale1SkeletonPrivate
1990 GList
*changed_properties
;
1991 GSource
*changed_properties_idle_source
;
1992 GMainContext
*context
;
1997 _locale1_skeleton_handle_method_call (
1998 GDBusConnection
*connection G_GNUC_UNUSED
,
1999 const gchar
*sender G_GNUC_UNUSED
,
2000 const gchar
*object_path G_GNUC_UNUSED
,
2001 const gchar
*interface_name
,
2002 const gchar
*method_name
,
2003 GVariant
*parameters
,
2004 GDBusMethodInvocation
*invocation
,
2007 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (user_data
);
2008 _ExtendedGDBusMethodInfo
*info
;
2016 GValue return_value
= G_VALUE_INIT
;
2017 info
= (_ExtendedGDBusMethodInfo
*) g_dbus_method_invocation_get_method_info (invocation
);
2018 g_assert (info
!= NULL
);
2019 num_params
= g_variant_n_children (parameters
);
2020 num_extra
= info
->pass_fdlist
? 3 : 2; paramv
= g_new0 (GValue
, num_params
+ num_extra
);
2022 g_value_init (¶mv
[n
], TYPE_LOCALE1
);
2023 g_value_set_object (¶mv
[n
++], skeleton
);
2024 g_value_init (¶mv
[n
], G_TYPE_DBUS_METHOD_INVOCATION
);
2025 g_value_set_object (¶mv
[n
++], invocation
);
2026 if (info
->pass_fdlist
)
2029 g_value_init (¶mv
[n
], G_TYPE_UNIX_FD_LIST
);
2030 g_value_set_object (¶mv
[n
++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation
)));
2032 g_assert_not_reached ();
2035 g_variant_iter_init (&iter
, parameters
);
2036 while ((child
= g_variant_iter_next_value (&iter
)) != NULL
)
2038 _ExtendedGDBusArgInfo
*arg_info
= (_ExtendedGDBusArgInfo
*) info
->parent_struct
.in_args
[n
- num_extra
];
2039 if (arg_info
->use_gvariant
)
2041 g_value_init (¶mv
[n
], G_TYPE_VARIANT
);
2042 g_value_set_variant (¶mv
[n
], child
);
2046 g_dbus_gvariant_to_gvalue (child
, ¶mv
[n
++]);
2047 g_variant_unref (child
);
2049 signal_id
= g_signal_lookup (info
->signal_name
, TYPE_LOCALE1
);
2050 g_value_init (&return_value
, G_TYPE_BOOLEAN
);
2051 g_signal_emitv (paramv
, signal_id
, 0, &return_value
);
2052 if (!g_value_get_boolean (&return_value
))
2053 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
);
2054 g_value_unset (&return_value
);
2055 for (n
= 0; n
< num_params
+ num_extra
; n
++)
2056 g_value_unset (¶mv
[n
]);
2061 _locale1_skeleton_handle_get_property (
2062 GDBusConnection
*connection G_GNUC_UNUSED
,
2063 const gchar
*sender G_GNUC_UNUSED
,
2064 const gchar
*object_path G_GNUC_UNUSED
,
2065 const gchar
*interface_name G_GNUC_UNUSED
,
2066 const gchar
*property_name
,
2070 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (user_data
);
2071 GValue value
= G_VALUE_INIT
;
2073 _ExtendedGDBusPropertyInfo
*info
;
2076 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_locale1_interface_info
.parent_struct
, property_name
);
2077 g_assert (info
!= NULL
);
2078 pspec
= g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton
), info
->hyphen_name
);
2081 g_set_error (error
, G_DBUS_ERROR
, G_DBUS_ERROR_INVALID_ARGS
, "No property with name %s", property_name
);
2085 g_value_init (&value
, pspec
->value_type
);
2086 g_object_get_property (G_OBJECT (skeleton
), info
->hyphen_name
, &value
);
2087 ret
= g_dbus_gvalue_to_gvariant (&value
, G_VARIANT_TYPE (info
->parent_struct
.signature
));
2088 g_value_unset (&value
);
2094 _locale1_skeleton_handle_set_property (
2095 GDBusConnection
*connection G_GNUC_UNUSED
,
2096 const gchar
*sender G_GNUC_UNUSED
,
2097 const gchar
*object_path G_GNUC_UNUSED
,
2098 const gchar
*interface_name G_GNUC_UNUSED
,
2099 const gchar
*property_name
,
2104 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (user_data
);
2105 GValue value
= G_VALUE_INIT
;
2107 _ExtendedGDBusPropertyInfo
*info
;
2110 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_locale1_interface_info
.parent_struct
, property_name
);
2111 g_assert (info
!= NULL
);
2112 pspec
= g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton
), info
->hyphen_name
);
2115 g_set_error (error
, G_DBUS_ERROR
, G_DBUS_ERROR_INVALID_ARGS
, "No property with name %s", property_name
);
2119 if (info
->use_gvariant
)
2120 g_value_set_variant (&value
, variant
);
2122 g_dbus_gvariant_to_gvalue (variant
, &value
);
2123 g_object_set_property (G_OBJECT (skeleton
), info
->hyphen_name
, &value
);
2124 g_value_unset (&value
);
2130 static const GDBusInterfaceVTable _locale1_skeleton_vtable
=
2132 _locale1_skeleton_handle_method_call
,
2133 _locale1_skeleton_handle_get_property
,
2134 _locale1_skeleton_handle_set_property
,
2138 static GDBusInterfaceInfo
*
2139 locale1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton
*skeleton G_GNUC_UNUSED
)
2141 return locale1_interface_info ();
2144 static GDBusInterfaceVTable
*
2145 locale1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton
*skeleton G_GNUC_UNUSED
)
2147 return (GDBusInterfaceVTable
*) &_locale1_skeleton_vtable
;
2151 locale1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton
*_skeleton
)
2153 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (_skeleton
);
2155 GVariantBuilder builder
;
2157 g_variant_builder_init (&builder
, G_VARIANT_TYPE ("a{sv}"));
2158 if (_locale1_interface_info
.parent_struct
.properties
== NULL
)
2160 for (n
= 0; _locale1_interface_info
.parent_struct
.properties
[n
] != NULL
; n
++)
2162 GDBusPropertyInfo
*info
= _locale1_interface_info
.parent_struct
.properties
[n
];
2163 if (info
->flags
& G_DBUS_PROPERTY_INFO_FLAGS_READABLE
)
2166 value
= _locale1_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.locale1", info
->name
, NULL
, skeleton
);
2169 g_variant_take_ref (value
);
2170 g_variant_builder_add (&builder
, "{sv}", info
->name
, value
);
2171 g_variant_unref (value
);
2176 return g_variant_builder_end (&builder
);
2179 static gboolean
_locale1_emit_changed (gpointer user_data
);
2182 locale1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton
*_skeleton
)
2184 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (_skeleton
);
2185 gboolean emit_changed
= FALSE
;
2187 g_mutex_lock (&skeleton
->priv
->lock
);
2188 if (skeleton
->priv
->changed_properties_idle_source
!= NULL
)
2190 g_source_destroy (skeleton
->priv
->changed_properties_idle_source
);
2191 skeleton
->priv
->changed_properties_idle_source
= NULL
;
2192 emit_changed
= TRUE
;
2194 g_mutex_unlock (&skeleton
->priv
->lock
);
2197 _locale1_emit_changed (skeleton
);
2200 static void locale1_skeleton_iface_init (Locale1Iface
*iface
);
2201 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2202 G_DEFINE_TYPE_WITH_CODE (Locale1Skeleton
, locale1_skeleton
, G_TYPE_DBUS_INTERFACE_SKELETON
,
2203 G_ADD_PRIVATE (Locale1Skeleton
)
2204 G_IMPLEMENT_INTERFACE (TYPE_LOCALE1
, locale1_skeleton_iface_init
));
2207 G_DEFINE_TYPE_WITH_CODE (Locale1Skeleton
, locale1_skeleton
, G_TYPE_DBUS_INTERFACE_SKELETON
,
2208 G_IMPLEMENT_INTERFACE (TYPE_LOCALE1
, locale1_skeleton_iface_init
));
2212 locale1_skeleton_finalize (GObject
*object
)
2214 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (object
);
2216 for (n
= 0; n
< 7; n
++)
2217 g_value_unset (&skeleton
->priv
->properties
[n
]);
2218 g_free (skeleton
->priv
->properties
);
2219 g_list_free_full (skeleton
->priv
->changed_properties
, (GDestroyNotify
) _changed_property_free
);
2220 if (skeleton
->priv
->changed_properties_idle_source
!= NULL
)
2221 g_source_destroy (skeleton
->priv
->changed_properties_idle_source
);
2222 g_main_context_unref (skeleton
->priv
->context
);
2223 g_mutex_clear (&skeleton
->priv
->lock
);
2224 G_OBJECT_CLASS (locale1_skeleton_parent_class
)->finalize (object
);
2228 locale1_skeleton_get_property (GObject
*object
,
2231 GParamSpec
*pspec G_GNUC_UNUSED
)
2233 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (object
);
2234 g_assert (prop_id
!= 0 && prop_id
- 1 < 7);
2235 g_mutex_lock (&skeleton
->priv
->lock
);
2236 g_value_copy (&skeleton
->priv
->properties
[prop_id
- 1], value
);
2237 g_mutex_unlock (&skeleton
->priv
->lock
);
2241 _locale1_emit_changed (gpointer user_data
)
2243 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (user_data
);
2245 GVariantBuilder builder
;
2246 GVariantBuilder invalidated_builder
;
2249 g_mutex_lock (&skeleton
->priv
->lock
);
2250 g_variant_builder_init (&builder
, G_VARIANT_TYPE ("a{sv}"));
2251 g_variant_builder_init (&invalidated_builder
, G_VARIANT_TYPE ("as"));
2252 for (l
= skeleton
->priv
->changed_properties
, num_changes
= 0; l
!= NULL
; l
= l
->next
)
2254 ChangedProperty
*cp
= l
->data
;
2256 const GValue
*cur_value
;
2258 cur_value
= &skeleton
->priv
->properties
[cp
->prop_id
- 1];
2259 if (!_g_value_equal (cur_value
, &cp
->orig_value
))
2261 variant
= g_dbus_gvalue_to_gvariant (cur_value
, G_VARIANT_TYPE (cp
->info
->parent_struct
.signature
));
2262 g_variant_builder_add (&builder
, "{sv}", cp
->info
->parent_struct
.name
, variant
);
2263 g_variant_unref (variant
);
2267 if (num_changes
> 0)
2269 GList
*connections
, *ll
;
2270 GVariant
*signal_variant
;
2271 signal_variant
= g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.locale1",
2272 &builder
, &invalidated_builder
));
2273 connections
= g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton
));
2274 for (ll
= connections
; ll
!= NULL
; ll
= ll
->next
)
2276 GDBusConnection
*connection
= ll
->data
;
2278 g_dbus_connection_emit_signal (connection
,
2279 NULL
, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton
)),
2280 "org.freedesktop.DBus.Properties",
2281 "PropertiesChanged",
2285 g_variant_unref (signal_variant
);
2286 g_list_free_full (connections
, g_object_unref
);
2290 g_variant_builder_clear (&builder
);
2291 g_variant_builder_clear (&invalidated_builder
);
2293 g_list_free_full (skeleton
->priv
->changed_properties
, (GDestroyNotify
) _changed_property_free
);
2294 skeleton
->priv
->changed_properties
= NULL
;
2295 skeleton
->priv
->changed_properties_idle_source
= NULL
;
2296 g_mutex_unlock (&skeleton
->priv
->lock
);
2301 _locale1_schedule_emit_changed (Locale1Skeleton
*skeleton
, const _ExtendedGDBusPropertyInfo
*info
, guint prop_id
, const GValue
*orig_value
)
2303 ChangedProperty
*cp
;
2306 for (l
= skeleton
->priv
->changed_properties
; l
!= NULL
; l
= l
->next
)
2308 ChangedProperty
*i_cp
= l
->data
;
2309 if (i_cp
->info
== info
)
2317 cp
= g_new0 (ChangedProperty
, 1);
2318 cp
->prop_id
= prop_id
;
2320 skeleton
->priv
->changed_properties
= g_list_prepend (skeleton
->priv
->changed_properties
, cp
);
2321 g_value_init (&cp
->orig_value
, G_VALUE_TYPE (orig_value
));
2322 g_value_copy (orig_value
, &cp
->orig_value
);
2327 locale1_skeleton_notify (GObject
*object
,
2328 GParamSpec
*pspec G_GNUC_UNUSED
)
2330 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (object
);
2331 g_mutex_lock (&skeleton
->priv
->lock
);
2332 if (skeleton
->priv
->changed_properties
!= NULL
&&
2333 skeleton
->priv
->changed_properties_idle_source
== NULL
)
2335 skeleton
->priv
->changed_properties_idle_source
= g_idle_source_new ();
2336 g_source_set_priority (skeleton
->priv
->changed_properties_idle_source
, G_PRIORITY_DEFAULT
);
2337 g_source_set_callback (skeleton
->priv
->changed_properties_idle_source
, _locale1_emit_changed
, g_object_ref (skeleton
), (GDestroyNotify
) g_object_unref
);
2338 g_source_attach (skeleton
->priv
->changed_properties_idle_source
, skeleton
->priv
->context
);
2339 g_source_unref (skeleton
->priv
->changed_properties_idle_source
);
2341 g_mutex_unlock (&skeleton
->priv
->lock
);
2345 locale1_skeleton_set_property (GObject
*object
,
2347 const GValue
*value
,
2350 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (object
);
2351 g_assert (prop_id
!= 0 && prop_id
- 1 < 7);
2352 g_mutex_lock (&skeleton
->priv
->lock
);
2353 g_object_freeze_notify (object
);
2354 if (!_g_value_equal (value
, &skeleton
->priv
->properties
[prop_id
- 1]))
2356 if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton
)) != NULL
)
2357 _locale1_schedule_emit_changed (skeleton
, _locale1_property_info_pointers
[prop_id
- 1], prop_id
, &skeleton
->priv
->properties
[prop_id
- 1]);
2358 g_value_copy (value
, &skeleton
->priv
->properties
[prop_id
- 1]);
2359 g_object_notify_by_pspec (object
, pspec
);
2361 g_mutex_unlock (&skeleton
->priv
->lock
);
2362 g_object_thaw_notify (object
);
2366 locale1_skeleton_init (Locale1Skeleton
*skeleton
)
2368 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2369 skeleton
->priv
= locale1_skeleton_get_instance_private (skeleton
);
2371 skeleton
->priv
= G_TYPE_INSTANCE_GET_PRIVATE (skeleton
, TYPE_LOCALE1_SKELETON
, Locale1SkeletonPrivate
);
2374 g_mutex_init (&skeleton
->priv
->lock
);
2375 skeleton
->priv
->context
= g_main_context_ref_thread_default ();
2376 skeleton
->priv
->properties
= g_new0 (GValue
, 7);
2377 g_value_init (&skeleton
->priv
->properties
[0], G_TYPE_STRV
);
2378 g_value_init (&skeleton
->priv
->properties
[1], G_TYPE_STRING
);
2379 g_value_init (&skeleton
->priv
->properties
[2], G_TYPE_STRING
);
2380 g_value_init (&skeleton
->priv
->properties
[3], G_TYPE_STRING
);
2381 g_value_init (&skeleton
->priv
->properties
[4], G_TYPE_STRING
);
2382 g_value_init (&skeleton
->priv
->properties
[5], G_TYPE_STRING
);
2383 g_value_init (&skeleton
->priv
->properties
[6], G_TYPE_STRING
);
2386 static const gchar
*const *
2387 locale1_skeleton_get_locale (Locale1
*object
)
2389 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (object
);
2390 const gchar
*const *value
;
2391 g_mutex_lock (&skeleton
->priv
->lock
);
2392 value
= g_value_get_boxed (&(skeleton
->priv
->properties
[0]));
2393 g_mutex_unlock (&skeleton
->priv
->lock
);
2397 static const gchar
*
2398 locale1_skeleton_get_x11_layout (Locale1
*object
)
2400 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (object
);
2402 g_mutex_lock (&skeleton
->priv
->lock
);
2403 value
= g_value_get_string (&(skeleton
->priv
->properties
[1]));
2404 g_mutex_unlock (&skeleton
->priv
->lock
);
2408 static const gchar
*
2409 locale1_skeleton_get_x11_model (Locale1
*object
)
2411 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (object
);
2413 g_mutex_lock (&skeleton
->priv
->lock
);
2414 value
= g_value_get_string (&(skeleton
->priv
->properties
[2]));
2415 g_mutex_unlock (&skeleton
->priv
->lock
);
2419 static const gchar
*
2420 locale1_skeleton_get_x11_variant (Locale1
*object
)
2422 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (object
);
2424 g_mutex_lock (&skeleton
->priv
->lock
);
2425 value
= g_value_get_string (&(skeleton
->priv
->properties
[3]));
2426 g_mutex_unlock (&skeleton
->priv
->lock
);
2430 static const gchar
*
2431 locale1_skeleton_get_x11_options (Locale1
*object
)
2433 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (object
);
2435 g_mutex_lock (&skeleton
->priv
->lock
);
2436 value
= g_value_get_string (&(skeleton
->priv
->properties
[4]));
2437 g_mutex_unlock (&skeleton
->priv
->lock
);
2441 static const gchar
*
2442 locale1_skeleton_get_vconsole_keymap (Locale1
*object
)
2444 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (object
);
2446 g_mutex_lock (&skeleton
->priv
->lock
);
2447 value
= g_value_get_string (&(skeleton
->priv
->properties
[5]));
2448 g_mutex_unlock (&skeleton
->priv
->lock
);
2452 static const gchar
*
2453 locale1_skeleton_get_vconsole_keymap_toggle (Locale1
*object
)
2455 Locale1Skeleton
*skeleton
= LOCALE1_SKELETON (object
);
2457 g_mutex_lock (&skeleton
->priv
->lock
);
2458 value
= g_value_get_string (&(skeleton
->priv
->properties
[6]));
2459 g_mutex_unlock (&skeleton
->priv
->lock
);
2464 locale1_skeleton_class_init (Locale1SkeletonClass
*klass
)
2466 GObjectClass
*gobject_class
;
2467 GDBusInterfaceSkeletonClass
*skeleton_class
;
2469 gobject_class
= G_OBJECT_CLASS (klass
);
2470 gobject_class
->finalize
= locale1_skeleton_finalize
;
2471 gobject_class
->get_property
= locale1_skeleton_get_property
;
2472 gobject_class
->set_property
= locale1_skeleton_set_property
;
2473 gobject_class
->notify
= locale1_skeleton_notify
;
2476 locale1_override_properties (gobject_class
, 1);
2478 skeleton_class
= G_DBUS_INTERFACE_SKELETON_CLASS (klass
);
2479 skeleton_class
->get_info
= locale1_skeleton_dbus_interface_get_info
;
2480 skeleton_class
->get_properties
= locale1_skeleton_dbus_interface_get_properties
;
2481 skeleton_class
->flush
= locale1_skeleton_dbus_interface_flush
;
2482 skeleton_class
->get_vtable
= locale1_skeleton_dbus_interface_get_vtable
;
2484 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
2485 g_type_class_add_private (klass
, sizeof (Locale1SkeletonPrivate
));
2490 locale1_skeleton_iface_init (Locale1Iface
*iface
)
2492 iface
->get_locale
= locale1_skeleton_get_locale
;
2493 iface
->get_x11_layout
= locale1_skeleton_get_x11_layout
;
2494 iface
->get_x11_model
= locale1_skeleton_get_x11_model
;
2495 iface
->get_x11_variant
= locale1_skeleton_get_x11_variant
;
2496 iface
->get_x11_options
= locale1_skeleton_get_x11_options
;
2497 iface
->get_vconsole_keymap
= locale1_skeleton_get_vconsole_keymap
;
2498 iface
->get_vconsole_keymap_toggle
= locale1_skeleton_get_vconsole_keymap_toggle
;
2502 * locale1_skeleton_new:
2504 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-locale1.top_of_page">org.freedesktop.locale1</link>.
2506 * Returns: (transfer full) (type Locale1Skeleton): The skeleton object.
2509 locale1_skeleton_new (void)
2511 return LOCALE1 (g_object_new (TYPE_LOCALE1_SKELETON
, NULL
));