refactor makefile with env variables
[systembsd.git] / src / interfaces / localed / localed-gen.c
CommitLineData
5047f6bf 1/*
2 * Generated by gdbus-codegen 2.40.0. DO NOT EDIT.
3 *
4 * The license of this code is the same as for the source it was derived from.
5 */
6
7#ifdef HAVE_CONFIG_H
8# include "config.h"
9#endif
10
1aa981f7 11#include "localed-gen.h"
5047f6bf 12
13#include <string.h>
14#ifdef G_OS_UNIX
15# include <gio/gunixfdlist.h>
16#endif
17
8751decb 18typedef struct
19{
20 GDBusArgInfo parent_struct;
21 gboolean use_gvariant;
22} _ExtendedGDBusArgInfo;
23
24typedef struct
25{
26 GDBusMethodInfo parent_struct;
27 const gchar *signal_name;
28 gboolean pass_fdlist;
29} _ExtendedGDBusMethodInfo;
30
31typedef struct
32{
33 GDBusSignalInfo parent_struct;
34 const gchar *signal_name;
35} _ExtendedGDBusSignalInfo;
36
37typedef struct
38{
39 GDBusPropertyInfo parent_struct;
40 const gchar *hyphen_name;
41 gboolean use_gvariant;
42} _ExtendedGDBusPropertyInfo;
43
44typedef struct
45{
46 GDBusInterfaceInfo parent_struct;
47 const gchar *hyphen_name;
48} _ExtendedGDBusInterfaceInfo;
49
50typedef struct
51{
52 const _ExtendedGDBusPropertyInfo *info;
53 guint prop_id;
54 GValue orig_value; /* the value before the change */
55} ChangedProperty;
56
57static void
58_changed_property_free (ChangedProperty *data)
59{
60 g_value_unset (&data->orig_value);
61 g_free (data);
62}
63
64static gboolean
65_g_strv_equal0 (gchar **a, gchar **b)
66{
67 gboolean ret = FALSE;
68 guint n;
69 if (a == NULL && b == NULL)
70 {
71 ret = TRUE;
72 goto out;
73 }
74 if (a == NULL || b == NULL)
75 goto out;
76 if (g_strv_length (a) != g_strv_length (b))
77 goto out;
78 for (n = 0; a[n] != NULL; n++)
79 if (g_strcmp0 (a[n], b[n]) != 0)
80 goto out;
81 ret = TRUE;
82out:
83 return ret;
84}
85
86static gboolean
87_g_variant_equal0 (GVariant *a, GVariant *b)
88{
89 gboolean ret = FALSE;
90 if (a == NULL && b == NULL)
91 {
92 ret = TRUE;
93 goto out;
94 }
95 if (a == NULL || b == NULL)
96 goto out;
97 ret = g_variant_equal (a, b);
98out:
99 return ret;
100}
101
102G_GNUC_UNUSED static gboolean
103_g_value_equal (const GValue *a, const GValue *b)
104{
105 gboolean ret = FALSE;
106 g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
107 switch (G_VALUE_TYPE (a))
108 {
109 case G_TYPE_BOOLEAN:
110 ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
111 break;
112 case G_TYPE_UCHAR:
113 ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
114 break;
115 case G_TYPE_INT:
116 ret = (g_value_get_int (a) == g_value_get_int (b));
117 break;
118 case G_TYPE_UINT:
119 ret = (g_value_get_uint (a) == g_value_get_uint (b));
120 break;
121 case G_TYPE_INT64:
122 ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
123 break;
124 case G_TYPE_UINT64:
125 ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
126 break;
127 case G_TYPE_DOUBLE:
128 {
129 /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
130 gdouble da = g_value_get_double (a);
131 gdouble db = g_value_get_double (b);
132 ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
133 }
134 break;
135 case G_TYPE_STRING:
136 ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
137 break;
138 case G_TYPE_VARIANT:
139 ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
140 break;
141 default:
142 if (G_VALUE_TYPE (a) == G_TYPE_STRV)
143 ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
144 else
145 g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
146 break;
147 }
148 return ret;
149}
150
5047f6bf 151/* ------------------------------------------------------------------------
152 * Code for interface org.freedesktop.locale1
153 * ------------------------------------------------------------------------
154 */
155
156/**
7539ecc4 157 * SECTION:Locale1
158 * @title: Locale1
5047f6bf 159 * @short_description: Generated C code for the org.freedesktop.locale1 D-Bus interface
160 *
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.
162 */
163
164/* ---- Introspection data for org.freedesktop.locale1 ---- */
165
7539ecc4 166static const _ExtendedGDBusArgInfo _locale1_method_info_set_locale_IN_ARG_unnamed_arg0 =
5047f6bf 167{
168 {
169 -1,
1aa981f7 170 (gchar *) "unnamed_arg0",
5047f6bf 171 (gchar *) "as",
172 NULL
173 },
174 FALSE
175};
176
7539ecc4 177static const _ExtendedGDBusArgInfo _locale1_method_info_set_locale_IN_ARG_unnamed_arg1 =
5047f6bf 178{
179 {
180 -1,
1aa981f7 181 (gchar *) "unnamed_arg1",
5047f6bf 182 (gchar *) "b",
183 NULL
184 },
185 FALSE
186};
187
7539ecc4 188static const _ExtendedGDBusArgInfo * const _locale1_method_info_set_locale_IN_ARG_pointers[] =
5047f6bf 189{
7539ecc4 190 &_locale1_method_info_set_locale_IN_ARG_unnamed_arg0,
191 &_locale1_method_info_set_locale_IN_ARG_unnamed_arg1,
5047f6bf 192 NULL
193};
194
7539ecc4 195static const _ExtendedGDBusMethodInfo _locale1_method_info_set_locale =
5047f6bf 196{
197 {
198 -1,
199 (gchar *) "SetLocale",
7539ecc4 200 (GDBusArgInfo **) &_locale1_method_info_set_locale_IN_ARG_pointers,
5047f6bf 201 NULL,
202 NULL
203 },
204 "handle-set-locale",
205 FALSE
206};
207
7539ecc4 208static const _ExtendedGDBusArgInfo _locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg0 =
5047f6bf 209{
210 {
211 -1,
1aa981f7 212 (gchar *) "unnamed_arg0",
5047f6bf 213 (gchar *) "s",
214 NULL
215 },
216 FALSE
217};
218
7539ecc4 219static const _ExtendedGDBusArgInfo _locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg1 =
5047f6bf 220{
221 {
222 -1,
1aa981f7 223 (gchar *) "unnamed_arg1",
5047f6bf 224 (gchar *) "s",
225 NULL
226 },
227 FALSE
228};
229
7539ecc4 230static const _ExtendedGDBusArgInfo _locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg2 =
5047f6bf 231{
232 {
233 -1,
1aa981f7 234 (gchar *) "unnamed_arg2",
5047f6bf 235 (gchar *) "b",
236 NULL
237 },
238 FALSE
239};
240
7539ecc4 241static const _ExtendedGDBusArgInfo _locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg3 =
5047f6bf 242{
243 {
244 -1,
1aa981f7 245 (gchar *) "unnamed_arg3",
5047f6bf 246 (gchar *) "b",
247 NULL
248 },
249 FALSE
250};
251
7539ecc4 252static const _ExtendedGDBusArgInfo * const _locale1_method_info_set_vconsole_keyboard_IN_ARG_pointers[] =
5047f6bf 253{
7539ecc4 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,
5047f6bf 258 NULL
259};
260
7539ecc4 261static const _ExtendedGDBusMethodInfo _locale1_method_info_set_vconsole_keyboard =
5047f6bf 262{
263 {
264 -1,
265 (gchar *) "SetVConsoleKeyboard",
7539ecc4 266 (GDBusArgInfo **) &_locale1_method_info_set_vconsole_keyboard_IN_ARG_pointers,
5047f6bf 267 NULL,
268 NULL
269 },
270 "handle-set-vconsole-keyboard",
271 FALSE
272};
273
7539ecc4 274static const _ExtendedGDBusArgInfo _locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg0 =
5047f6bf 275{
276 {
277 -1,
1aa981f7 278 (gchar *) "unnamed_arg0",
5047f6bf 279 (gchar *) "s",
280 NULL
281 },
282 FALSE
283};
284
7539ecc4 285static const _ExtendedGDBusArgInfo _locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg1 =
5047f6bf 286{
287 {
288 -1,
1aa981f7 289 (gchar *) "unnamed_arg1",
5047f6bf 290 (gchar *) "s",
291 NULL
292 },
293 FALSE
294};
295
7539ecc4 296static const _ExtendedGDBusArgInfo _locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg2 =
5047f6bf 297{
298 {
299 -1,
1aa981f7 300 (gchar *) "unnamed_arg2",
5047f6bf 301 (gchar *) "s",
302 NULL
303 },
304 FALSE
305};
306
7539ecc4 307static const _ExtendedGDBusArgInfo _locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg3 =
5047f6bf 308{
309 {
310 -1,
1aa981f7 311 (gchar *) "unnamed_arg3",
5047f6bf 312 (gchar *) "s",
313 NULL
314 },
315 FALSE
316};
317
7539ecc4 318static const _ExtendedGDBusArgInfo _locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg4 =
5047f6bf 319{
320 {
321 -1,
1aa981f7 322 (gchar *) "unnamed_arg4",
5047f6bf 323 (gchar *) "b",
324 NULL
325 },
326 FALSE
327};
328
7539ecc4 329static const _ExtendedGDBusArgInfo _locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg5 =
5047f6bf 330{
331 {
332 -1,
1aa981f7 333 (gchar *) "unnamed_arg5",
5047f6bf 334 (gchar *) "b",
335 NULL
336 },
337 FALSE
338};
339
7539ecc4 340static const _ExtendedGDBusArgInfo * const _locale1_method_info_set_x11_keyboard_IN_ARG_pointers[] =
5047f6bf 341{
7539ecc4 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,
5047f6bf 348 NULL
349};
350
7539ecc4 351static const _ExtendedGDBusMethodInfo _locale1_method_info_set_x11_keyboard =
5047f6bf 352{
353 {
354 -1,
355 (gchar *) "SetX11Keyboard",
7539ecc4 356 (GDBusArgInfo **) &_locale1_method_info_set_x11_keyboard_IN_ARG_pointers,
5047f6bf 357 NULL,
358 NULL
359 },
360 "handle-set-x11-keyboard",
361 FALSE
362};
363
7539ecc4 364static const _ExtendedGDBusMethodInfo * const _locale1_method_info_pointers[] =
5047f6bf 365{
7539ecc4 366 &_locale1_method_info_set_locale,
367 &_locale1_method_info_set_vconsole_keyboard,
368 &_locale1_method_info_set_x11_keyboard,
5047f6bf 369 NULL
370};
371
7539ecc4 372static const _ExtendedGDBusPropertyInfo _locale1_property_info_locale =
5047f6bf 373{
374 {
375 -1,
376 (gchar *) "Locale",
377 (gchar *) "as",
378 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
379 NULL
380 },
381 "locale",
382 FALSE
383};
384
7539ecc4 385static const _ExtendedGDBusPropertyInfo _locale1_property_info_x11_layout =
5047f6bf 386{
387 {
388 -1,
1aa981f7 389 (gchar *) "X11Layout",
5047f6bf 390 (gchar *) "s",
391 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
392 NULL
393 },
1aa981f7 394 "x11-layout",
5047f6bf 395 FALSE
396};
397
7539ecc4 398static const _ExtendedGDBusPropertyInfo _locale1_property_info_x11_model =
5047f6bf 399{
400 {
401 -1,
1aa981f7 402 (gchar *) "X11Model",
5047f6bf 403 (gchar *) "s",
404 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
405 NULL
406 },
1aa981f7 407 "x11-model",
5047f6bf 408 FALSE
409};
410
7539ecc4 411static const _ExtendedGDBusPropertyInfo _locale1_property_info_x11_variant =
5047f6bf 412{
413 {
414 -1,
1aa981f7 415 (gchar *) "X11Variant",
5047f6bf 416 (gchar *) "s",
417 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
418 NULL
419 },
1aa981f7 420 "x11-variant",
5047f6bf 421 FALSE
422};
423
7539ecc4 424static const _ExtendedGDBusPropertyInfo _locale1_property_info_x11_options =
5047f6bf 425{
426 {
427 -1,
1aa981f7 428 (gchar *) "X11Options",
5047f6bf 429 (gchar *) "s",
430 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
431 NULL
432 },
1aa981f7 433 "x11-options",
5047f6bf 434 FALSE
435};
436
7539ecc4 437static const _ExtendedGDBusPropertyInfo _locale1_property_info_vconsole_keymap =
5047f6bf 438{
439 {
440 -1,
1aa981f7 441 (gchar *) "VConsoleKeymap",
5047f6bf 442 (gchar *) "s",
443 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
444 NULL
445 },
1aa981f7 446 "vconsole-keymap",
5047f6bf 447 FALSE
448};
449
7539ecc4 450static const _ExtendedGDBusPropertyInfo _locale1_property_info_vconsole_keymap_toggle =
5047f6bf 451{
452 {
453 -1,
1aa981f7 454 (gchar *) "VConsoleKeymapToggle",
5047f6bf 455 (gchar *) "s",
456 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
457 NULL
458 },
1aa981f7 459 "vconsole-keymap-toggle",
5047f6bf 460 FALSE
461};
462
7539ecc4 463static const _ExtendedGDBusPropertyInfo * const _locale1_property_info_pointers[] =
5047f6bf 464{
7539ecc4 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,
5047f6bf 472 NULL
473};
474
7539ecc4 475static const _ExtendedGDBusInterfaceInfo _locale1_interface_info =
5047f6bf 476{
477 {
478 -1,
479 (gchar *) "org.freedesktop.locale1",
7539ecc4 480 (GDBusMethodInfo **) &_locale1_method_info_pointers,
5047f6bf 481 NULL,
7539ecc4 482 (GDBusPropertyInfo **) &_locale1_property_info_pointers,
5047f6bf 483 NULL
484 },
485 "locale1",
486};
487
488
489/**
7539ecc4 490 * locale1_interface_info:
5047f6bf 491 *
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.
493 *
494 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
495 */
496GDBusInterfaceInfo *
7539ecc4 497locale1_interface_info (void)
5047f6bf 498{
7539ecc4 499 return (GDBusInterfaceInfo *) &_locale1_interface_info.parent_struct;
5047f6bf 500}
501
502/**
7539ecc4 503 * locale1_override_properties:
5047f6bf 504 * @klass: The class structure for a #GObject<!-- -->-derived class.
505 * @property_id_begin: The property id to assign to the first overridden property.
506 *
7539ecc4 507 * Overrides all #GObject properties in the #Locale1 interface for a concrete class.
5047f6bf 508 * The properties are overridden in the order they are defined.
509 *
510 * Returns: The last property id.
511 */
512guint
7539ecc4 513locale1_override_properties (GObjectClass *klass, guint property_id_begin)
5047f6bf 514{
515 g_object_class_override_property (klass, property_id_begin++, "locale");
5047f6bf 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");
1aa981f7 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");
5047f6bf 522 return property_id_begin - 1;
523}
524
525
526
527/**
7539ecc4 528 * Locale1:
5047f6bf 529 *
530 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-locale1.top_of_page">org.freedesktop.locale1</link>.
531 */
532
533/**
7539ecc4 534 * Locale1Iface:
5047f6bf 535 * @parent_iface: The parent interface.
7539ecc4 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.
5047f6bf 546 *
547 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-locale1.top_of_page">org.freedesktop.locale1</link>.
548 */
549
7539ecc4 550typedef Locale1Iface Locale1Interface;
551G_DEFINE_INTERFACE (Locale1, locale1, G_TYPE_OBJECT);
5047f6bf 552
553static void
7539ecc4 554locale1_default_init (Locale1Iface *iface)
5047f6bf 555{
556 /* GObject signals for incoming D-Bus method calls: */
557 /**
7539ecc4 558 * Locale1::handle-set-locale:
559 * @object: A #Locale1.
5047f6bf 560 * @invocation: A #GDBusMethodInvocation.
1aa981f7 561 * @arg_unnamed_arg0: Argument passed by remote caller.
562 * @arg_unnamed_arg1: Argument passed by remote caller.
5047f6bf 563 *
564 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-locale1.SetLocale">SetLocale()</link> D-Bus method.
565 *
7539ecc4 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.
5047f6bf 567 *
568 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
569 */
570 g_signal_new ("handle-set-locale",
571 G_TYPE_FROM_INTERFACE (iface),
572 G_SIGNAL_RUN_LAST,
7539ecc4 573 G_STRUCT_OFFSET (Locale1Iface, handle_set_locale),
5047f6bf 574 g_signal_accumulator_true_handled,
575 NULL,
576 g_cclosure_marshal_generic,
577 G_TYPE_BOOLEAN,
578 3,
579 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRV, G_TYPE_BOOLEAN);
580
581 /**
7539ecc4 582 * Locale1::handle-set-vconsole-keyboard:
583 * @object: A #Locale1.
5047f6bf 584 * @invocation: A #GDBusMethodInvocation.
1aa981f7 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.
5047f6bf 589 *
590 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-locale1.SetVConsoleKeyboard">SetVConsoleKeyboard()</link> D-Bus method.
591 *
7539ecc4 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.
5047f6bf 593 *
594 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
595 */
596 g_signal_new ("handle-set-vconsole-keyboard",
597 G_TYPE_FROM_INTERFACE (iface),
598 G_SIGNAL_RUN_LAST,
7539ecc4 599 G_STRUCT_OFFSET (Locale1Iface, handle_set_vconsole_keyboard),
5047f6bf 600 g_signal_accumulator_true_handled,
601 NULL,
602 g_cclosure_marshal_generic,
603 G_TYPE_BOOLEAN,
604 5,
605 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
606
607 /**
7539ecc4 608 * Locale1::handle-set-x11-keyboard:
609 * @object: A #Locale1.
5047f6bf 610 * @invocation: A #GDBusMethodInvocation.
1aa981f7 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.
5047f6bf 617 *
618 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-locale1.SetX11Keyboard">SetX11Keyboard()</link> D-Bus method.
619 *
7539ecc4 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.
5047f6bf 621 *
622 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
623 */
624 g_signal_new ("handle-set-x11-keyboard",
625 G_TYPE_FROM_INTERFACE (iface),
626 G_SIGNAL_RUN_LAST,
7539ecc4 627 G_STRUCT_OFFSET (Locale1Iface, handle_set_x11_keyboard),
5047f6bf 628 g_signal_accumulator_true_handled,
629 NULL,
630 g_cclosure_marshal_generic,
631 G_TYPE_BOOLEAN,
632 7,
633 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
634
635 /* GObject properties for D-Bus properties: */
636 /**
7539ecc4 637 * Locale1:locale:
5047f6bf 638 *
639 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.Locale">"Locale"</link>.
640 *
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.
642 */
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));
645 /**
7539ecc4 646 * Locale1:x11-layout:
5047f6bf 647 *
1aa981f7 648 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.X11Layout">"X11Layout"</link>.
5047f6bf 649 *
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.
651 */
652 g_object_interface_install_property (iface,
1aa981f7 653 g_param_spec_string ("x11-layout", "X11Layout", "X11Layout", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
5047f6bf 654 /**
7539ecc4 655 * Locale1:x11-model:
5047f6bf 656 *
1aa981f7 657 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.X11Model">"X11Model"</link>.
5047f6bf 658 *
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.
660 */
661 g_object_interface_install_property (iface,
1aa981f7 662 g_param_spec_string ("x11-model", "X11Model", "X11Model", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
5047f6bf 663 /**
7539ecc4 664 * Locale1:x11-variant:
5047f6bf 665 *
1aa981f7 666 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.X11Variant">"X11Variant"</link>.
5047f6bf 667 *
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.
669 */
670 g_object_interface_install_property (iface,
1aa981f7 671 g_param_spec_string ("x11-variant", "X11Variant", "X11Variant", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
5047f6bf 672 /**
7539ecc4 673 * Locale1:x11-options:
5047f6bf 674 *
1aa981f7 675 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.X11Options">"X11Options"</link>.
5047f6bf 676 *
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.
678 */
679 g_object_interface_install_property (iface,
1aa981f7 680 g_param_spec_string ("x11-options", "X11Options", "X11Options", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
5047f6bf 681 /**
7539ecc4 682 * Locale1:vconsole-keymap:
5047f6bf 683 *
1aa981f7 684 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymap">"VConsoleKeymap"</link>.
5047f6bf 685 *
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.
687 */
688 g_object_interface_install_property (iface,
1aa981f7 689 g_param_spec_string ("vconsole-keymap", "VConsoleKeymap", "VConsoleKeymap", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
5047f6bf 690 /**
7539ecc4 691 * Locale1:vconsole-keymap-toggle:
5047f6bf 692 *
1aa981f7 693 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymapToggle">"VConsoleKeymapToggle"</link>.
5047f6bf 694 *
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.
696 */
697 g_object_interface_install_property (iface,
1aa981f7 698 g_param_spec_string ("vconsole-keymap-toggle", "VConsoleKeymapToggle", "VConsoleKeymapToggle", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
5047f6bf 699}
700
701/**
7539ecc4 702 * locale1_get_locale: (skip)
703 * @object: A #Locale1.
5047f6bf 704 *
705 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.Locale">"Locale"</link> D-Bus property.
706 *
707 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
708 *
7539ecc4 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>
5047f6bf 710 *
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.
712 */
713const gchar *const *
7539ecc4 714locale1_get_locale (Locale1 *object)
5047f6bf 715{
7539ecc4 716 return LOCALE1_GET_IFACE (object)->get_locale (object);
5047f6bf 717}
718
719/**
7539ecc4 720 * locale1_dup_locale: (skip)
721 * @object: A #Locale1.
5047f6bf 722 *
723 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.Locale">"Locale"</link> D-Bus property.
724 *
725 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
726 *
727 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev().
728 */
729gchar **
7539ecc4 730locale1_dup_locale (Locale1 *object)
5047f6bf 731{
732 gchar **value;
733 g_object_get (G_OBJECT (object), "locale", &value, NULL);
734 return value;
735}
736
737/**
7539ecc4 738 * locale1_set_locale: (skip)
739 * @object: A #Locale1.
5047f6bf 740 * @value: The value to set.
741 *
742 * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.Locale">"Locale"</link> D-Bus property to @value.
743 *
744 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
745 */
746void
7539ecc4 747locale1_set_locale (Locale1 *object, const gchar *const *value)
5047f6bf 748{
749 g_object_set (G_OBJECT (object), "locale", value, NULL);
750}
751
752/**
7539ecc4 753 * locale1_get_x11_layout: (skip)
754 * @object: A #Locale1.
5047f6bf 755 *
1aa981f7 756 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Layout">"X11Layout"</link> D-Bus property.
5047f6bf 757 *
758 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
759 *
7539ecc4 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>
5047f6bf 761 *
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.
763 */
764const gchar *
7539ecc4 765locale1_get_x11_layout (Locale1 *object)
5047f6bf 766{
7539ecc4 767 return LOCALE1_GET_IFACE (object)->get_x11_layout (object);
5047f6bf 768}
769
770/**
7539ecc4 771 * locale1_dup_x11_layout: (skip)
772 * @object: A #Locale1.
5047f6bf 773 *
1aa981f7 774 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Layout">"X11Layout"</link> D-Bus property.
5047f6bf 775 *
776 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
777 *
778 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
779 */
780gchar *
7539ecc4 781locale1_dup_x11_layout (Locale1 *object)
5047f6bf 782{
783 gchar *value;
1aa981f7 784 g_object_get (G_OBJECT (object), "x11-layout", &value, NULL);
5047f6bf 785 return value;
786}
787
788/**
7539ecc4 789 * locale1_set_x11_layout: (skip)
790 * @object: A #Locale1.
5047f6bf 791 * @value: The value to set.
792 *
1aa981f7 793 * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.X11Layout">"X11Layout"</link> D-Bus property to @value.
5047f6bf 794 *
795 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
796 */
797void
7539ecc4 798locale1_set_x11_layout (Locale1 *object, const gchar *value)
5047f6bf 799{
1aa981f7 800 g_object_set (G_OBJECT (object), "x11-layout", value, NULL);
5047f6bf 801}
802
803/**
7539ecc4 804 * locale1_get_x11_model: (skip)
805 * @object: A #Locale1.
5047f6bf 806 *
1aa981f7 807 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Model">"X11Model"</link> D-Bus property.
5047f6bf 808 *
809 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
810 *
7539ecc4 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>
5047f6bf 812 *
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.
814 */
815const gchar *
7539ecc4 816locale1_get_x11_model (Locale1 *object)
5047f6bf 817{
7539ecc4 818 return LOCALE1_GET_IFACE (object)->get_x11_model (object);
5047f6bf 819}
820
821/**
7539ecc4 822 * locale1_dup_x11_model: (skip)
823 * @object: A #Locale1.
5047f6bf 824 *
1aa981f7 825 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Model">"X11Model"</link> D-Bus property.
5047f6bf 826 *
827 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
828 *
829 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
830 */
831gchar *
7539ecc4 832locale1_dup_x11_model (Locale1 *object)
5047f6bf 833{
834 gchar *value;
1aa981f7 835 g_object_get (G_OBJECT (object), "x11-model", &value, NULL);
5047f6bf 836 return value;
837}
838
839/**
7539ecc4 840 * locale1_set_x11_model: (skip)
841 * @object: A #Locale1.
5047f6bf 842 * @value: The value to set.
843 *
1aa981f7 844 * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.X11Model">"X11Model"</link> D-Bus property to @value.
5047f6bf 845 *
846 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
847 */
848void
7539ecc4 849locale1_set_x11_model (Locale1 *object, const gchar *value)
5047f6bf 850{
1aa981f7 851 g_object_set (G_OBJECT (object), "x11-model", value, NULL);
5047f6bf 852}
853
854/**
7539ecc4 855 * locale1_get_x11_variant: (skip)
856 * @object: A #Locale1.
5047f6bf 857 *
1aa981f7 858 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Variant">"X11Variant"</link> D-Bus property.
5047f6bf 859 *
860 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
861 *
7539ecc4 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>
5047f6bf 863 *
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.
865 */
866const gchar *
7539ecc4 867locale1_get_x11_variant (Locale1 *object)
5047f6bf 868{
7539ecc4 869 return LOCALE1_GET_IFACE (object)->get_x11_variant (object);
5047f6bf 870}
871
872/**
7539ecc4 873 * locale1_dup_x11_variant: (skip)
874 * @object: A #Locale1.
5047f6bf 875 *
1aa981f7 876 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Variant">"X11Variant"</link> D-Bus property.
5047f6bf 877 *
878 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
879 *
880 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
881 */
882gchar *
7539ecc4 883locale1_dup_x11_variant (Locale1 *object)
5047f6bf 884{
885 gchar *value;
1aa981f7 886 g_object_get (G_OBJECT (object), "x11-variant", &value, NULL);
5047f6bf 887 return value;
888}
889
890/**
7539ecc4 891 * locale1_set_x11_variant: (skip)
892 * @object: A #Locale1.
5047f6bf 893 * @value: The value to set.
894 *
1aa981f7 895 * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.X11Variant">"X11Variant"</link> D-Bus property to @value.
5047f6bf 896 *
897 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
898 */
899void
7539ecc4 900locale1_set_x11_variant (Locale1 *object, const gchar *value)
5047f6bf 901{
1aa981f7 902 g_object_set (G_OBJECT (object), "x11-variant", value, NULL);
5047f6bf 903}
904
905/**
7539ecc4 906 * locale1_get_x11_options: (skip)
907 * @object: A #Locale1.
5047f6bf 908 *
1aa981f7 909 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Options">"X11Options"</link> D-Bus property.
5047f6bf 910 *
911 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
912 *
7539ecc4 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>
5047f6bf 914 *
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.
916 */
917const gchar *
7539ecc4 918locale1_get_x11_options (Locale1 *object)
5047f6bf 919{
7539ecc4 920 return LOCALE1_GET_IFACE (object)->get_x11_options (object);
5047f6bf 921}
922
923/**
7539ecc4 924 * locale1_dup_x11_options: (skip)
925 * @object: A #Locale1.
5047f6bf 926 *
1aa981f7 927 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Options">"X11Options"</link> D-Bus property.
5047f6bf 928 *
929 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
930 *
931 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
932 */
933gchar *
7539ecc4 934locale1_dup_x11_options (Locale1 *object)
5047f6bf 935{
936 gchar *value;
1aa981f7 937 g_object_get (G_OBJECT (object), "x11-options", &value, NULL);
5047f6bf 938 return value;
939}
940
941/**
7539ecc4 942 * locale1_set_x11_options: (skip)
943 * @object: A #Locale1.
5047f6bf 944 * @value: The value to set.
945 *
1aa981f7 946 * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.X11Options">"X11Options"</link> D-Bus property to @value.
5047f6bf 947 *
948 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
949 */
950void
7539ecc4 951locale1_set_x11_options (Locale1 *object, const gchar *value)
5047f6bf 952{
1aa981f7 953 g_object_set (G_OBJECT (object), "x11-options", value, NULL);
5047f6bf 954}
955
956/**
7539ecc4 957 * locale1_get_vconsole_keymap: (skip)
958 * @object: A #Locale1.
5047f6bf 959 *
1aa981f7 960 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymap">"VConsoleKeymap"</link> D-Bus property.
5047f6bf 961 *
962 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
963 *
7539ecc4 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>
5047f6bf 965 *
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.
967 */
968const gchar *
7539ecc4 969locale1_get_vconsole_keymap (Locale1 *object)
5047f6bf 970{
7539ecc4 971 return LOCALE1_GET_IFACE (object)->get_vconsole_keymap (object);
5047f6bf 972}
973
974/**
7539ecc4 975 * locale1_dup_vconsole_keymap: (skip)
976 * @object: A #Locale1.
5047f6bf 977 *
1aa981f7 978 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymap">"VConsoleKeymap"</link> D-Bus property.
5047f6bf 979 *
980 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
981 *
982 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
983 */
984gchar *
7539ecc4 985locale1_dup_vconsole_keymap (Locale1 *object)
5047f6bf 986{
987 gchar *value;
1aa981f7 988 g_object_get (G_OBJECT (object), "vconsole-keymap", &value, NULL);
5047f6bf 989 return value;
990}
991
992/**
7539ecc4 993 * locale1_set_vconsole_keymap: (skip)
994 * @object: A #Locale1.
5047f6bf 995 * @value: The value to set.
996 *
1aa981f7 997 * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymap">"VConsoleKeymap"</link> D-Bus property to @value.
5047f6bf 998 *
999 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1000 */
1001void
7539ecc4 1002locale1_set_vconsole_keymap (Locale1 *object, const gchar *value)
5047f6bf 1003{
1aa981f7 1004 g_object_set (G_OBJECT (object), "vconsole-keymap", value, NULL);
5047f6bf 1005}
1006
1007/**
7539ecc4 1008 * locale1_get_vconsole_keymap_toggle: (skip)
1009 * @object: A #Locale1.
5047f6bf 1010 *
1aa981f7 1011 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymapToggle">"VConsoleKeymapToggle"</link> D-Bus property.
5047f6bf 1012 *
1013 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1014 *
7539ecc4 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>
5047f6bf 1016 *
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.
1018 */
1019const gchar *
7539ecc4 1020locale1_get_vconsole_keymap_toggle (Locale1 *object)
5047f6bf 1021{
7539ecc4 1022 return LOCALE1_GET_IFACE (object)->get_vconsole_keymap_toggle (object);
5047f6bf 1023}
1024
1025/**
7539ecc4 1026 * locale1_dup_vconsole_keymap_toggle: (skip)
1027 * @object: A #Locale1.
5047f6bf 1028 *
1aa981f7 1029 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymapToggle">"VConsoleKeymapToggle"</link> D-Bus property.
5047f6bf 1030 *
1031 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1032 *
1033 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1034 */
1035gchar *
7539ecc4 1036locale1_dup_vconsole_keymap_toggle (Locale1 *object)
5047f6bf 1037{
1038 gchar *value;
1aa981f7 1039 g_object_get (G_OBJECT (object), "vconsole-keymap-toggle", &value, NULL);
5047f6bf 1040 return value;
1041}
1042
1043/**
7539ecc4 1044 * locale1_set_vconsole_keymap_toggle: (skip)
1045 * @object: A #Locale1.
5047f6bf 1046 * @value: The value to set.
1047 *
1aa981f7 1048 * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymapToggle">"VConsoleKeymapToggle"</link> D-Bus property to @value.
5047f6bf 1049 *
1050 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1051 */
1052void
7539ecc4 1053locale1_set_vconsole_keymap_toggle (Locale1 *object, const gchar *value)
5047f6bf 1054{
1aa981f7 1055 g_object_set (G_OBJECT (object), "vconsole-keymap-toggle", value, NULL);
5047f6bf 1056}
1057
1058/**
7539ecc4 1059 * locale1_call_set_locale:
1060 * @proxy: A #Locale1Proxy.
1aa981f7 1061 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1062 * @arg_unnamed_arg1: Argument to pass with the method invocation.
5047f6bf 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.
1066 *
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.
7539ecc4 1069 * You can then call locale1_call_set_locale_finish() to get the result of the operation.
5047f6bf 1070 *
7539ecc4 1071 * See locale1_call_set_locale_sync() for the synchronous, blocking version of this method.
5047f6bf 1072 */
1073void
7539ecc4 1074locale1_call_set_locale (
1075 Locale1 *proxy,
1aa981f7 1076 const gchar *const *arg_unnamed_arg0,
1077 gboolean arg_unnamed_arg1,
5047f6bf 1078 GCancellable *cancellable,
1079 GAsyncReadyCallback callback,
1080 gpointer user_data)
1081{
1082 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1083 "SetLocale",
1084 g_variant_new ("(^asb)",
1aa981f7 1085 arg_unnamed_arg0,
1086 arg_unnamed_arg1),
5047f6bf 1087 G_DBUS_CALL_FLAGS_NONE,
1088 -1,
1089 cancellable,
1090 callback,
1091 user_data);
1092}
1093
1094/**
7539ecc4 1095 * locale1_call_set_locale_finish:
1096 * @proxy: A #Locale1Proxy.
1097 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to locale1_call_set_locale().
5047f6bf 1098 * @error: Return location for error or %NULL.
1099 *
7539ecc4 1100 * Finishes an operation started with locale1_call_set_locale().
5047f6bf 1101 *
1102 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1103 */
1104gboolean
7539ecc4 1105locale1_call_set_locale_finish (
1106 Locale1 *proxy,
5047f6bf 1107 GAsyncResult *res,
1108 GError **error)
1109{
1110 GVariant *_ret;
1111 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1112 if (_ret == NULL)
1113 goto _out;
1114 g_variant_get (_ret,
1115 "()");
1116 g_variant_unref (_ret);
1117_out:
1118 return _ret != NULL;
1119}
1120
1121/**
7539ecc4 1122 * locale1_call_set_locale_sync:
1123 * @proxy: A #Locale1Proxy.
1aa981f7 1124 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1125 * @arg_unnamed_arg1: Argument to pass with the method invocation.
5047f6bf 1126 * @cancellable: (allow-none): A #GCancellable or %NULL.
1127 * @error: Return location for error or %NULL.
1128 *
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.
1130 *
7539ecc4 1131 * See locale1_call_set_locale() for the asynchronous version of this method.
5047f6bf 1132 *
1133 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1134 */
1135gboolean
7539ecc4 1136locale1_call_set_locale_sync (
1137 Locale1 *proxy,
1aa981f7 1138 const gchar *const *arg_unnamed_arg0,
1139 gboolean arg_unnamed_arg1,
5047f6bf 1140 GCancellable *cancellable,
1141 GError **error)
1142{
1143 GVariant *_ret;
1144 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1145 "SetLocale",
1146 g_variant_new ("(^asb)",
1aa981f7 1147 arg_unnamed_arg0,
1148 arg_unnamed_arg1),
5047f6bf 1149 G_DBUS_CALL_FLAGS_NONE,
1150 -1,
1151 cancellable,
1152 error);
1153 if (_ret == NULL)
1154 goto _out;
1155 g_variant_get (_ret,
1156 "()");
1157 g_variant_unref (_ret);
1158_out:
1159 return _ret != NULL;
1160}
1161
1162/**
7539ecc4 1163 * locale1_call_set_vconsole_keyboard:
1164 * @proxy: A #Locale1Proxy.
1aa981f7 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.
5047f6bf 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.
1172 *
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.
7539ecc4 1175 * You can then call locale1_call_set_vconsole_keyboard_finish() to get the result of the operation.
5047f6bf 1176 *
7539ecc4 1177 * See locale1_call_set_vconsole_keyboard_sync() for the synchronous, blocking version of this method.
5047f6bf 1178 */
1179void
7539ecc4 1180locale1_call_set_vconsole_keyboard (
1181 Locale1 *proxy,
1aa981f7 1182 const gchar *arg_unnamed_arg0,
1183 const gchar *arg_unnamed_arg1,
1184 gboolean arg_unnamed_arg2,
1185 gboolean arg_unnamed_arg3,
5047f6bf 1186 GCancellable *cancellable,
1187 GAsyncReadyCallback callback,
1188 gpointer user_data)
1189{
1190 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1191 "SetVConsoleKeyboard",
1192 g_variant_new ("(ssbb)",
1aa981f7 1193 arg_unnamed_arg0,
1194 arg_unnamed_arg1,
1195 arg_unnamed_arg2,
1196 arg_unnamed_arg3),
5047f6bf 1197 G_DBUS_CALL_FLAGS_NONE,
1198 -1,
1199 cancellable,
1200 callback,
1201 user_data);
1202}
1203
1204/**
7539ecc4 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().
5047f6bf 1208 * @error: Return location for error or %NULL.
1209 *
7539ecc4 1210 * Finishes an operation started with locale1_call_set_vconsole_keyboard().
5047f6bf 1211 *
1212 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1213 */
1214gboolean
7539ecc4 1215locale1_call_set_vconsole_keyboard_finish (
1216 Locale1 *proxy,
5047f6bf 1217 GAsyncResult *res,
1218 GError **error)
1219{
1220 GVariant *_ret;
1221 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1222 if (_ret == NULL)
1223 goto _out;
1224 g_variant_get (_ret,
1225 "()");
1226 g_variant_unref (_ret);
1227_out:
1228 return _ret != NULL;
1229}
1230
1231/**
7539ecc4 1232 * locale1_call_set_vconsole_keyboard_sync:
1233 * @proxy: A #Locale1Proxy.
1aa981f7 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.
5047f6bf 1238 * @cancellable: (allow-none): A #GCancellable or %NULL.
1239 * @error: Return location for error or %NULL.
1240 *
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.
1242 *
7539ecc4 1243 * See locale1_call_set_vconsole_keyboard() for the asynchronous version of this method.
5047f6bf 1244 *
1245 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1246 */
1247gboolean
7539ecc4 1248locale1_call_set_vconsole_keyboard_sync (
1249 Locale1 *proxy,
1aa981f7 1250 const gchar *arg_unnamed_arg0,
1251 const gchar *arg_unnamed_arg1,
1252 gboolean arg_unnamed_arg2,
1253 gboolean arg_unnamed_arg3,
5047f6bf 1254 GCancellable *cancellable,
1255 GError **error)
1256{
1257 GVariant *_ret;
1258 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1259 "SetVConsoleKeyboard",
1260 g_variant_new ("(ssbb)",
1aa981f7 1261 arg_unnamed_arg0,
1262 arg_unnamed_arg1,
1263 arg_unnamed_arg2,
1264 arg_unnamed_arg3),
5047f6bf 1265 G_DBUS_CALL_FLAGS_NONE,
1266 -1,
1267 cancellable,
1268 error);
1269 if (_ret == NULL)
1270 goto _out;
1271 g_variant_get (_ret,
1272 "()");
1273 g_variant_unref (_ret);
1274_out:
1275 return _ret != NULL;
1276}
1277
1278/**
7539ecc4 1279 * locale1_call_set_x11_keyboard:
1280 * @proxy: A #Locale1Proxy.
1aa981f7 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.
5047f6bf 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.
1290 *
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.
7539ecc4 1293 * You can then call locale1_call_set_x11_keyboard_finish() to get the result of the operation.
5047f6bf 1294 *
7539ecc4 1295 * See locale1_call_set_x11_keyboard_sync() for the synchronous, blocking version of this method.
5047f6bf 1296 */
1297void
7539ecc4 1298locale1_call_set_x11_keyboard (
1299 Locale1 *proxy,
1aa981f7 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,
5047f6bf 1306 GCancellable *cancellable,
1307 GAsyncReadyCallback callback,
1308 gpointer user_data)
1309{
1310 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1311 "SetX11Keyboard",
1312 g_variant_new ("(ssssbb)",
1aa981f7 1313 arg_unnamed_arg0,
1314 arg_unnamed_arg1,
1315 arg_unnamed_arg2,
1316 arg_unnamed_arg3,
1317 arg_unnamed_arg4,
1318 arg_unnamed_arg5),
5047f6bf 1319 G_DBUS_CALL_FLAGS_NONE,
1320 -1,
1321 cancellable,
1322 callback,
1323 user_data);
1324}
1325
1326/**
7539ecc4 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().
5047f6bf 1330 * @error: Return location for error or %NULL.
1331 *
7539ecc4 1332 * Finishes an operation started with locale1_call_set_x11_keyboard().
5047f6bf 1333 *
1334 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1335 */
1336gboolean
7539ecc4 1337locale1_call_set_x11_keyboard_finish (
1338 Locale1 *proxy,
5047f6bf 1339 GAsyncResult *res,
1340 GError **error)
1341{
1342 GVariant *_ret;
1343 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1344 if (_ret == NULL)
1345 goto _out;
1346 g_variant_get (_ret,
1347 "()");
1348 g_variant_unref (_ret);
1349_out:
1350 return _ret != NULL;
1351}
1352
1353/**
7539ecc4 1354 * locale1_call_set_x11_keyboard_sync:
1355 * @proxy: A #Locale1Proxy.
1aa981f7 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.
5047f6bf 1362 * @cancellable: (allow-none): A #GCancellable or %NULL.
1363 * @error: Return location for error or %NULL.
1364 *
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.
1366 *
7539ecc4 1367 * See locale1_call_set_x11_keyboard() for the asynchronous version of this method.
5047f6bf 1368 *
1369 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1370 */
1371gboolean
7539ecc4 1372locale1_call_set_x11_keyboard_sync (
1373 Locale1 *proxy,
1aa981f7 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,
5047f6bf 1380 GCancellable *cancellable,
1381 GError **error)
1382{
1383 GVariant *_ret;
1384 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1385 "SetX11Keyboard",
1386 g_variant_new ("(ssssbb)",
1aa981f7 1387 arg_unnamed_arg0,
1388 arg_unnamed_arg1,
1389 arg_unnamed_arg2,
1390 arg_unnamed_arg3,
1391 arg_unnamed_arg4,
1392 arg_unnamed_arg5),
5047f6bf 1393 G_DBUS_CALL_FLAGS_NONE,
1394 -1,
1395 cancellable,
1396 error);
1397 if (_ret == NULL)
1398 goto _out;
1399 g_variant_get (_ret,
1400 "()");
1401 g_variant_unref (_ret);
1402_out:
1403 return _ret != NULL;
1404}
1405
1406/**
7539ecc4 1407 * locale1_complete_set_locale:
1408 * @object: A #Locale1.
5047f6bf 1409 * @invocation: (transfer full): A #GDBusMethodInvocation.
1410 *
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.
1412 *
1413 * This method will free @invocation, you cannot use it afterwards.
1414 */
1415void
7539ecc4 1416locale1_complete_set_locale (
1417 Locale1 *object,
5047f6bf 1418 GDBusMethodInvocation *invocation)
1419{
1420 g_dbus_method_invocation_return_value (invocation,
1421 g_variant_new ("()"));
1422}
1423
1424/**
7539ecc4 1425 * locale1_complete_set_vconsole_keyboard:
1426 * @object: A #Locale1.
5047f6bf 1427 * @invocation: (transfer full): A #GDBusMethodInvocation.
1428 *
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.
1430 *
1431 * This method will free @invocation, you cannot use it afterwards.
1432 */
1433void
7539ecc4 1434locale1_complete_set_vconsole_keyboard (
1435 Locale1 *object,
5047f6bf 1436 GDBusMethodInvocation *invocation)
1437{
1438 g_dbus_method_invocation_return_value (invocation,
1439 g_variant_new ("()"));
1440}
1441
1442/**
7539ecc4 1443 * locale1_complete_set_x11_keyboard:
1444 * @object: A #Locale1.
5047f6bf 1445 * @invocation: (transfer full): A #GDBusMethodInvocation.
1446 *
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.
1448 *
1449 * This method will free @invocation, you cannot use it afterwards.
1450 */
1451void
7539ecc4 1452locale1_complete_set_x11_keyboard (
1453 Locale1 *object,
5047f6bf 1454 GDBusMethodInvocation *invocation)
1455{
1456 g_dbus_method_invocation_return_value (invocation,
1457 g_variant_new ("()"));
1458}
1459
1460/* ------------------------------------------------------------------------ */
1461
1462/**
7539ecc4 1463 * Locale1Proxy:
5047f6bf 1464 *
7539ecc4 1465 * The #Locale1Proxy structure contains only private data and should only be accessed using the provided API.
5047f6bf 1466 */
1467
1468/**
7539ecc4 1469 * Locale1ProxyClass:
5047f6bf 1470 * @parent_class: The parent class.
1471 *
7539ecc4 1472 * Class structure for #Locale1Proxy.
5047f6bf 1473 */
1474
7539ecc4 1475struct _Locale1ProxyPrivate
5047f6bf 1476{
1477 GData *qdata;
1478};
1479
7539ecc4 1480static void locale1_proxy_iface_init (Locale1Iface *iface);
5047f6bf 1481
1482#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
7539ecc4 1483G_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));
5047f6bf 1486
1487#else
7539ecc4 1488G_DEFINE_TYPE_WITH_CODE (Locale1Proxy, locale1_proxy, G_TYPE_DBUS_PROXY,
1489 G_IMPLEMENT_INTERFACE (TYPE_LOCALE1, locale1_proxy_iface_init));
5047f6bf 1490
1491#endif
1492static void
7539ecc4 1493locale1_proxy_finalize (GObject *object)
5047f6bf 1494{
7539ecc4 1495 Locale1Proxy *proxy = LOCALE1_PROXY (object);
5047f6bf 1496 g_datalist_clear (&proxy->priv->qdata);
7539ecc4 1497 G_OBJECT_CLASS (locale1_proxy_parent_class)->finalize (object);
5047f6bf 1498}
1499
1500static void
7539ecc4 1501locale1_proxy_get_property (GObject *object,
5047f6bf 1502 guint prop_id,
1503 GValue *value,
1504 GParamSpec *pspec G_GNUC_UNUSED)
1505{
1506 const _ExtendedGDBusPropertyInfo *info;
1507 GVariant *variant;
1508 g_assert (prop_id != 0 && prop_id - 1 < 7);
7539ecc4 1509 info = _locale1_property_info_pointers[prop_id - 1];
5047f6bf 1510 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
1511 if (info->use_gvariant)
1512 {
1513 g_value_set_variant (value, variant);
1514 }
1515 else
1516 {
1517 if (variant != NULL)
1518 g_dbus_gvariant_to_gvalue (variant, value);
1519 }
1520 if (variant != NULL)
1521 g_variant_unref (variant);
1522}
1523
1524static void
7539ecc4 1525locale1_proxy_set_property_cb (GDBusProxy *proxy,
5047f6bf 1526 GAsyncResult *res,
1527 gpointer user_data)
1528{
1529 const _ExtendedGDBusPropertyInfo *info = user_data;
1530 GError *error;
1531 GVariant *_ret;
1532 error = NULL;
1533 _ret = g_dbus_proxy_call_finish (proxy, res, &error);
1534 if (!_ret)
1535 {
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);
1540 }
1541 else
1542 {
1543 g_variant_unref (_ret);
1544 }
1545}
1546
1547static void
7539ecc4 1548locale1_proxy_set_property (GObject *object,
5047f6bf 1549 guint prop_id,
1550 const GValue *value,
1551 GParamSpec *pspec G_GNUC_UNUSED)
1552{
1553 const _ExtendedGDBusPropertyInfo *info;
1554 GVariant *variant;
1555 g_assert (prop_id != 0 && prop_id - 1 < 7);
7539ecc4 1556 info = _locale1_property_info_pointers[prop_id - 1];
5047f6bf 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,
1562 -1,
7539ecc4 1563 NULL, (GAsyncReadyCallback) locale1_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
5047f6bf 1564 g_variant_unref (variant);
1565}
1566
1567static void
7539ecc4 1568locale1_proxy_g_signal (GDBusProxy *proxy,
5047f6bf 1569 const gchar *sender_name G_GNUC_UNUSED,
1570 const gchar *signal_name,
1571 GVariant *parameters)
1572{
1573 _ExtendedGDBusSignalInfo *info;
1574 GVariantIter iter;
1575 GVariant *child;
1576 GValue *paramv;
1577 guint num_params;
1578 guint n;
1579 guint signal_id;
7539ecc4 1580 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_locale1_interface_info.parent_struct, signal_name);
5047f6bf 1581 if (info == NULL)
1582 return;
1583 num_params = g_variant_n_children (parameters);
1584 paramv = g_new0 (GValue, num_params + 1);
7539ecc4 1585 g_value_init (&paramv[0], TYPE_LOCALE1);
5047f6bf 1586 g_value_set_object (&paramv[0], proxy);
1587 g_variant_iter_init (&iter, parameters);
1588 n = 1;
1589 while ((child = g_variant_iter_next_value (&iter)) != NULL)
1590 {
1591 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
1592 if (arg_info->use_gvariant)
1593 {
1594 g_value_init (&paramv[n], G_TYPE_VARIANT);
1595 g_value_set_variant (&paramv[n], child);
1596 n++;
1597 }
1598 else
1599 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
1600 g_variant_unref (child);
1601 }
7539ecc4 1602 signal_id = g_signal_lookup (info->signal_name, TYPE_LOCALE1);
5047f6bf 1603 g_signal_emitv (paramv, signal_id, 0, NULL);
1604 for (n = 0; n < num_params + 1; n++)
1605 g_value_unset (&paramv[n]);
1606 g_free (paramv);
1607}
1608
1609static void
7539ecc4 1610locale1_proxy_g_properties_changed (GDBusProxy *_proxy,
5047f6bf 1611 GVariant *changed_properties,
1612 const gchar *const *invalidated_properties)
1613{
7539ecc4 1614 Locale1Proxy *proxy = LOCALE1_PROXY (_proxy);
5047f6bf 1615 guint n;
1616 const gchar *key;
1617 GVariantIter *iter;
1618 _ExtendedGDBusPropertyInfo *info;
1619 g_variant_get (changed_properties, "a{sv}", &iter);
1620 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
1621 {
7539ecc4 1622 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_locale1_interface_info.parent_struct, key);
5047f6bf 1623 g_datalist_remove_data (&proxy->priv->qdata, key);
1624 if (info != NULL)
1625 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1626 }
1627 g_variant_iter_free (iter);
1628 for (n = 0; invalidated_properties[n] != NULL; n++)
1629 {
7539ecc4 1630 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_locale1_interface_info.parent_struct, invalidated_properties[n]);
5047f6bf 1631 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
1632 if (info != NULL)
1633 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1634 }
1635}
1636
1637static const gchar *const *
7539ecc4 1638locale1_proxy_get_locale (Locale1 *object)
5047f6bf 1639{
7539ecc4 1640 Locale1Proxy *proxy = LOCALE1_PROXY (object);
5047f6bf 1641 GVariant *variant;
1642 const gchar *const *value = NULL;
1643 value = g_datalist_get_data (&proxy->priv->qdata, "Locale");
1644 if (value != NULL)
1645 return value;
1646 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Locale");
1647 if (variant != NULL)
1648 {
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);
1652 }
1653 return value;
1654}
1655
1656static const gchar *
7539ecc4 1657locale1_proxy_get_x11_layout (Locale1 *object)
5047f6bf 1658{
7539ecc4 1659 Locale1Proxy *proxy = LOCALE1_PROXY (object);
5047f6bf 1660 GVariant *variant;
1661 const gchar *value = NULL;
1aa981f7 1662 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "X11Layout");
5047f6bf 1663 if (variant != NULL)
1664 {
1665 value = g_variant_get_string (variant, NULL);
1666 g_variant_unref (variant);
1667 }
1668 return value;
1669}
1670
1671static const gchar *
7539ecc4 1672locale1_proxy_get_x11_model (Locale1 *object)
5047f6bf 1673{
7539ecc4 1674 Locale1Proxy *proxy = LOCALE1_PROXY (object);
5047f6bf 1675 GVariant *variant;
1676 const gchar *value = NULL;
1aa981f7 1677 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "X11Model");
5047f6bf 1678 if (variant != NULL)
1679 {
1680 value = g_variant_get_string (variant, NULL);
1681 g_variant_unref (variant);
1682 }
1683 return value;
1684}
1685
1686static const gchar *
7539ecc4 1687locale1_proxy_get_x11_variant (Locale1 *object)
5047f6bf 1688{
7539ecc4 1689 Locale1Proxy *proxy = LOCALE1_PROXY (object);
5047f6bf 1690 GVariant *variant;
1691 const gchar *value = NULL;
1aa981f7 1692 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "X11Variant");
5047f6bf 1693 if (variant != NULL)
1694 {
1695 value = g_variant_get_string (variant, NULL);
1696 g_variant_unref (variant);
1697 }
1698 return value;
1699}
1700
1701static const gchar *
7539ecc4 1702locale1_proxy_get_x11_options (Locale1 *object)
5047f6bf 1703{
7539ecc4 1704 Locale1Proxy *proxy = LOCALE1_PROXY (object);
5047f6bf 1705 GVariant *variant;
1706 const gchar *value = NULL;
1aa981f7 1707 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "X11Options");
5047f6bf 1708 if (variant != NULL)
1709 {
1710 value = g_variant_get_string (variant, NULL);
1711 g_variant_unref (variant);
1712 }
1713 return value;
1714}
1715
1716static const gchar *
7539ecc4 1717locale1_proxy_get_vconsole_keymap (Locale1 *object)
5047f6bf 1718{
7539ecc4 1719 Locale1Proxy *proxy = LOCALE1_PROXY (object);
5047f6bf 1720 GVariant *variant;
1721 const gchar *value = NULL;
1aa981f7 1722 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "VConsoleKeymap");
5047f6bf 1723 if (variant != NULL)
1724 {
1725 value = g_variant_get_string (variant, NULL);
1726 g_variant_unref (variant);
1727 }
1728 return value;
1729}
1730
1731static const gchar *
7539ecc4 1732locale1_proxy_get_vconsole_keymap_toggle (Locale1 *object)
5047f6bf 1733{
7539ecc4 1734 Locale1Proxy *proxy = LOCALE1_PROXY (object);
5047f6bf 1735 GVariant *variant;
1736 const gchar *value = NULL;
1aa981f7 1737 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "VConsoleKeymapToggle");
5047f6bf 1738 if (variant != NULL)
1739 {
1740 value = g_variant_get_string (variant, NULL);
1741 g_variant_unref (variant);
1742 }
1743 return value;
1744}
1745
1746static void
7539ecc4 1747locale1_proxy_init (Locale1Proxy *proxy)
5047f6bf 1748{
1749#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
7539ecc4 1750 proxy->priv = locale1_proxy_get_instance_private (proxy);
5047f6bf 1751#else
7539ecc4 1752 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_LOCALE1_PROXY, Locale1ProxyPrivate);
5047f6bf 1753#endif
1754
7539ecc4 1755 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), locale1_interface_info ());
5047f6bf 1756}
1757
1758static void
7539ecc4 1759locale1_proxy_class_init (Locale1ProxyClass *klass)
5047f6bf 1760{
1761 GObjectClass *gobject_class;
1762 GDBusProxyClass *proxy_class;
1763
1764 gobject_class = G_OBJECT_CLASS (klass);
7539ecc4 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;
5047f6bf 1768
1769 proxy_class = G_DBUS_PROXY_CLASS (klass);
7539ecc4 1770 proxy_class->g_signal = locale1_proxy_g_signal;
1771 proxy_class->g_properties_changed = locale1_proxy_g_properties_changed;
5047f6bf 1772
7539ecc4 1773 locale1_override_properties (gobject_class, 1);
5047f6bf 1774
1775#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
7539ecc4 1776 g_type_class_add_private (klass, sizeof (Locale1ProxyPrivate));
5047f6bf 1777#endif
1778}
1779
1780static void
7539ecc4 1781locale1_proxy_iface_init (Locale1Iface *iface)
5047f6bf 1782{
7539ecc4 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;
5047f6bf 1790}
1791
1792/**
7539ecc4 1793 * locale1_proxy_new:
5047f6bf 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.
1801 *
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.
1803 *
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.
7539ecc4 1805 * You can then call locale1_proxy_new_finish() to get the result of the operation.
5047f6bf 1806 *
7539ecc4 1807 * See locale1_proxy_new_sync() for the synchronous, blocking version of this constructor.
5047f6bf 1808 */
1809void
7539ecc4 1810locale1_proxy_new (
5047f6bf 1811 GDBusConnection *connection,
1812 GDBusProxyFlags flags,
1813 const gchar *name,
1814 const gchar *object_path,
1815 GCancellable *cancellable,
1816 GAsyncReadyCallback callback,
1817 gpointer user_data)
1818{
7539ecc4 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);
5047f6bf 1820}
1821
1822/**
7539ecc4 1823 * locale1_proxy_new_finish:
1824 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to locale1_proxy_new().
5047f6bf 1825 * @error: Return location for error or %NULL
1826 *
7539ecc4 1827 * Finishes an operation started with locale1_proxy_new().
5047f6bf 1828 *
7539ecc4 1829 * Returns: (transfer full) (type Locale1Proxy): The constructed proxy object or %NULL if @error is set.
5047f6bf 1830 */
7539ecc4 1831Locale1 *
1832locale1_proxy_new_finish (
5047f6bf 1833 GAsyncResult *res,
1834 GError **error)
1835{
1836 GObject *ret;
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);
1841 if (ret != NULL)
7539ecc4 1842 return LOCALE1 (ret);
5047f6bf 1843 else
1844 return NULL;
1845}
1846
1847/**
7539ecc4 1848 * locale1_proxy_new_sync:
5047f6bf 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
1855 *
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.
1857 *
1858 * The calling thread is blocked until a reply is received.
1859 *
7539ecc4 1860 * See locale1_proxy_new() for the asynchronous version of this constructor.
5047f6bf 1861 *
7539ecc4 1862 * Returns: (transfer full) (type Locale1Proxy): The constructed proxy object or %NULL if @error is set.
5047f6bf 1863 */
7539ecc4 1864Locale1 *
1865locale1_proxy_new_sync (
5047f6bf 1866 GDBusConnection *connection,
1867 GDBusProxyFlags flags,
1868 const gchar *name,
1869 const gchar *object_path,
1870 GCancellable *cancellable,
1871 GError **error)
1872{
1873 GInitable *ret;
7539ecc4 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);
5047f6bf 1875 if (ret != NULL)
7539ecc4 1876 return LOCALE1 (ret);
5047f6bf 1877 else
1878 return NULL;
1879}
1880
1881
1882/**
7539ecc4 1883 * locale1_proxy_new_for_bus:
5047f6bf 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.
1891 *
7539ecc4 1892 * Like locale1_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
5047f6bf 1893 *
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.
7539ecc4 1895 * You can then call locale1_proxy_new_for_bus_finish() to get the result of the operation.
5047f6bf 1896 *
7539ecc4 1897 * See locale1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
5047f6bf 1898 */
1899void
7539ecc4 1900locale1_proxy_new_for_bus (
5047f6bf 1901 GBusType bus_type,
1902 GDBusProxyFlags flags,
1903 const gchar *name,
1904 const gchar *object_path,
1905 GCancellable *cancellable,
1906 GAsyncReadyCallback callback,
1907 gpointer user_data)
1908{
7539ecc4 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);
5047f6bf 1910}
1911
1912/**
7539ecc4 1913 * locale1_proxy_new_for_bus_finish:
1914 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to locale1_proxy_new_for_bus().
5047f6bf 1915 * @error: Return location for error or %NULL
1916 *
7539ecc4 1917 * Finishes an operation started with locale1_proxy_new_for_bus().
5047f6bf 1918 *
7539ecc4 1919 * Returns: (transfer full) (type Locale1Proxy): The constructed proxy object or %NULL if @error is set.
5047f6bf 1920 */
7539ecc4 1921Locale1 *
1922locale1_proxy_new_for_bus_finish (
5047f6bf 1923 GAsyncResult *res,
1924 GError **error)
1925{
1926 GObject *ret;
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);
1931 if (ret != NULL)
7539ecc4 1932 return LOCALE1 (ret);
5047f6bf 1933 else
1934 return NULL;
1935}
1936
1937/**
7539ecc4 1938 * locale1_proxy_new_for_bus_sync:
5047f6bf 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
1945 *
7539ecc4 1946 * Like locale1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
5047f6bf 1947 *
1948 * The calling thread is blocked until a reply is received.
1949 *
7539ecc4 1950 * See locale1_proxy_new_for_bus() for the asynchronous version of this constructor.
5047f6bf 1951 *
7539ecc4 1952 * Returns: (transfer full) (type Locale1Proxy): The constructed proxy object or %NULL if @error is set.
5047f6bf 1953 */
7539ecc4 1954Locale1 *
1955locale1_proxy_new_for_bus_sync (
5047f6bf 1956 GBusType bus_type,
1957 GDBusProxyFlags flags,
1958 const gchar *name,
1959 const gchar *object_path,
1960 GCancellable *cancellable,
1961 GError **error)
1962{
1963 GInitable *ret;
7539ecc4 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);
5047f6bf 1965 if (ret != NULL)
7539ecc4 1966 return LOCALE1 (ret);
5047f6bf 1967 else
1968 return NULL;
1969}
1970
1971
1972/* ------------------------------------------------------------------------ */
1973
1974/**
7539ecc4 1975 * Locale1Skeleton:
5047f6bf 1976 *
7539ecc4 1977 * The #Locale1Skeleton structure contains only private data and should only be accessed using the provided API.
5047f6bf 1978 */
1979
1980/**
7539ecc4 1981 * Locale1SkeletonClass:
5047f6bf 1982 * @parent_class: The parent class.
1983 *
7539ecc4 1984 * Class structure for #Locale1Skeleton.
5047f6bf 1985 */
1986
7539ecc4 1987struct _Locale1SkeletonPrivate
5047f6bf 1988{
1989 GValue *properties;
1990 GList *changed_properties;
1991 GSource *changed_properties_idle_source;
1992 GMainContext *context;
1993 GMutex lock;
1994};
1995
1996static void
7539ecc4 1997_locale1_skeleton_handle_method_call (
5047f6bf 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,
2005 gpointer user_data)
2006{
7539ecc4 2007 Locale1Skeleton *skeleton = LOCALE1_SKELETON (user_data);
5047f6bf 2008 _ExtendedGDBusMethodInfo *info;
2009 GVariantIter iter;
2010 GVariant *child;
2011 GValue *paramv;
2012 guint num_params;
2013 guint num_extra;
2014 guint n;
2015 guint signal_id;
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);
2021 n = 0;
7539ecc4 2022 g_value_init (&paramv[n], TYPE_LOCALE1);
5047f6bf 2023 g_value_set_object (&paramv[n++], skeleton);
2024 g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
2025 g_value_set_object (&paramv[n++], invocation);
2026 if (info->pass_fdlist)
2027 {
2028#ifdef G_OS_UNIX
2029 g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
2030 g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
2031#else
2032 g_assert_not_reached ();
2033#endif
2034 }
2035 g_variant_iter_init (&iter, parameters);
2036 while ((child = g_variant_iter_next_value (&iter)) != NULL)
2037 {
2038 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
2039 if (arg_info->use_gvariant)
2040 {
2041 g_value_init (&paramv[n], G_TYPE_VARIANT);
2042 g_value_set_variant (&paramv[n], child);
2043 n++;
2044 }
2045 else
2046 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
2047 g_variant_unref (child);
2048 }
7539ecc4 2049 signal_id = g_signal_lookup (info->signal_name, TYPE_LOCALE1);
5047f6bf 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 (&paramv[n]);
2057 g_free (paramv);
2058}
2059
2060static GVariant *
7539ecc4 2061_locale1_skeleton_handle_get_property (
5047f6bf 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,
2067 GError **error,
2068 gpointer user_data)
2069{
7539ecc4 2070 Locale1Skeleton *skeleton = LOCALE1_SKELETON (user_data);
5047f6bf 2071 GValue value = G_VALUE_INIT;
2072 GParamSpec *pspec;
2073 _ExtendedGDBusPropertyInfo *info;
2074 GVariant *ret;
2075 ret = NULL;
7539ecc4 2076 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_locale1_interface_info.parent_struct, property_name);
5047f6bf 2077 g_assert (info != NULL);
2078 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
2079 if (pspec == NULL)
2080 {
2081 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
2082 }
2083 else
2084 {
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);
2089 }
2090 return ret;
2091}
2092
2093static gboolean
7539ecc4 2094_locale1_skeleton_handle_set_property (
5047f6bf 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,
2100 GVariant *variant,
2101 GError **error,
2102 gpointer user_data)
2103{
7539ecc4 2104 Locale1Skeleton *skeleton = LOCALE1_SKELETON (user_data);
5047f6bf 2105 GValue value = G_VALUE_INIT;
2106 GParamSpec *pspec;
2107 _ExtendedGDBusPropertyInfo *info;
2108 gboolean ret;
2109 ret = FALSE;
7539ecc4 2110 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_locale1_interface_info.parent_struct, property_name);
5047f6bf 2111 g_assert (info != NULL);
2112 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
2113 if (pspec == NULL)
2114 {
2115 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
2116 }
2117 else
2118 {
2119 if (info->use_gvariant)
2120 g_value_set_variant (&value, variant);
2121 else
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);
2125 ret = TRUE;
2126 }
2127 return ret;
2128}
2129
7539ecc4 2130static const GDBusInterfaceVTable _locale1_skeleton_vtable =
5047f6bf 2131{
7539ecc4 2132 _locale1_skeleton_handle_method_call,
2133 _locale1_skeleton_handle_get_property,
2134 _locale1_skeleton_handle_set_property,
5047f6bf 2135 {NULL}
2136};
2137
2138static GDBusInterfaceInfo *
7539ecc4 2139locale1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
5047f6bf 2140{
7539ecc4 2141 return locale1_interface_info ();
5047f6bf 2142}
2143
2144static GDBusInterfaceVTable *
7539ecc4 2145locale1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
5047f6bf 2146{
7539ecc4 2147 return (GDBusInterfaceVTable *) &_locale1_skeleton_vtable;
5047f6bf 2148}
2149
2150static GVariant *
7539ecc4 2151locale1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
5047f6bf 2152{
7539ecc4 2153 Locale1Skeleton *skeleton = LOCALE1_SKELETON (_skeleton);
5047f6bf 2154
2155 GVariantBuilder builder;
2156 guint n;
2157 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
7539ecc4 2158 if (_locale1_interface_info.parent_struct.properties == NULL)
5047f6bf 2159 goto out;
7539ecc4 2160 for (n = 0; _locale1_interface_info.parent_struct.properties[n] != NULL; n++)
5047f6bf 2161 {
7539ecc4 2162 GDBusPropertyInfo *info = _locale1_interface_info.parent_struct.properties[n];
5047f6bf 2163 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
2164 {
2165 GVariant *value;
7539ecc4 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);
5047f6bf 2167 if (value != NULL)
2168 {
2169 g_variant_take_ref (value);
2170 g_variant_builder_add (&builder, "{sv}", info->name, value);
2171 g_variant_unref (value);
2172 }
2173 }
2174 }
2175out:
2176 return g_variant_builder_end (&builder);
2177}
2178
7539ecc4 2179static gboolean _locale1_emit_changed (gpointer user_data);
5047f6bf 2180
2181static void
7539ecc4 2182locale1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
5047f6bf 2183{
7539ecc4 2184 Locale1Skeleton *skeleton = LOCALE1_SKELETON (_skeleton);
5047f6bf 2185 gboolean emit_changed = FALSE;
2186
2187 g_mutex_lock (&skeleton->priv->lock);
2188 if (skeleton->priv->changed_properties_idle_source != NULL)
2189 {
2190 g_source_destroy (skeleton->priv->changed_properties_idle_source);
2191 skeleton->priv->changed_properties_idle_source = NULL;
2192 emit_changed = TRUE;
2193 }
2194 g_mutex_unlock (&skeleton->priv->lock);
2195
2196 if (emit_changed)
7539ecc4 2197 _locale1_emit_changed (skeleton);
5047f6bf 2198}
2199
7539ecc4 2200static void locale1_skeleton_iface_init (Locale1Iface *iface);
5047f6bf 2201#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
7539ecc4 2202G_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));
5047f6bf 2205
2206#else
7539ecc4 2207G_DEFINE_TYPE_WITH_CODE (Locale1Skeleton, locale1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
2208 G_IMPLEMENT_INTERFACE (TYPE_LOCALE1, locale1_skeleton_iface_init));
5047f6bf 2209
2210#endif
2211static void
7539ecc4 2212locale1_skeleton_finalize (GObject *object)
5047f6bf 2213{
7539ecc4 2214 Locale1Skeleton *skeleton = LOCALE1_SKELETON (object);
5047f6bf 2215 guint n;
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);
7539ecc4 2224 G_OBJECT_CLASS (locale1_skeleton_parent_class)->finalize (object);
5047f6bf 2225}
2226
2227static void
7539ecc4 2228locale1_skeleton_get_property (GObject *object,
5047f6bf 2229 guint prop_id,
2230 GValue *value,
2231 GParamSpec *pspec G_GNUC_UNUSED)
2232{
7539ecc4 2233 Locale1Skeleton *skeleton = LOCALE1_SKELETON (object);
5047f6bf 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);
2238}
2239
2240static gboolean
7539ecc4 2241_locale1_emit_changed (gpointer user_data)
5047f6bf 2242{
7539ecc4 2243 Locale1Skeleton *skeleton = LOCALE1_SKELETON (user_data);
5047f6bf 2244 GList *l;
2245 GVariantBuilder builder;
2246 GVariantBuilder invalidated_builder;
2247 guint num_changes;
2248
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)
2253 {
2254 ChangedProperty *cp = l->data;
2255 GVariant *variant;
2256 const GValue *cur_value;
2257
2258 cur_value = &skeleton->priv->properties[cp->prop_id - 1];
2259 if (!_g_value_equal (cur_value, &cp->orig_value))
2260 {
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);
2264 num_changes++;
2265 }
2266 }
2267 if (num_changes > 0)
2268 {
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)
2275 {
2276 GDBusConnection *connection = ll->data;
2277
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",
2282 signal_variant,
2283 NULL);
2284 }
2285 g_variant_unref (signal_variant);
2286 g_list_free_full (connections, g_object_unref);
2287 }
2288 else
2289 {
2290 g_variant_builder_clear (&builder);
2291 g_variant_builder_clear (&invalidated_builder);
2292 }
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);
2297 return FALSE;
2298}
2299
2300static void
7539ecc4 2301_locale1_schedule_emit_changed (Locale1Skeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
5047f6bf 2302{
2303 ChangedProperty *cp;
2304 GList *l;
2305 cp = NULL;
2306 for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
2307 {
2308 ChangedProperty *i_cp = l->data;
2309 if (i_cp->info == info)
2310 {
2311 cp = i_cp;
2312 break;
2313 }
2314 }
2315 if (cp == NULL)
2316 {
2317 cp = g_new0 (ChangedProperty, 1);
2318 cp->prop_id = prop_id;
2319 cp->info = info;
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);
2323 }
2324}
2325
2326static void
7539ecc4 2327locale1_skeleton_notify (GObject *object,
5047f6bf 2328 GParamSpec *pspec G_GNUC_UNUSED)
2329{
7539ecc4 2330 Locale1Skeleton *skeleton = LOCALE1_SKELETON (object);
5047f6bf 2331 g_mutex_lock (&skeleton->priv->lock);
2332 if (skeleton->priv->changed_properties != NULL &&
2333 skeleton->priv->changed_properties_idle_source == NULL)
2334 {
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);
7539ecc4 2337 g_source_set_callback (skeleton->priv->changed_properties_idle_source, _locale1_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
5047f6bf 2338 g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
2339 g_source_unref (skeleton->priv->changed_properties_idle_source);
2340 }
2341 g_mutex_unlock (&skeleton->priv->lock);
2342}
2343
2344static void
7539ecc4 2345locale1_skeleton_set_property (GObject *object,
5047f6bf 2346 guint prop_id,
2347 const GValue *value,
2348 GParamSpec *pspec)
2349{
7539ecc4 2350 Locale1Skeleton *skeleton = LOCALE1_SKELETON (object);
5047f6bf 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]))
2355 {
2356 if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
7539ecc4 2357 _locale1_schedule_emit_changed (skeleton, _locale1_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
5047f6bf 2358 g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
2359 g_object_notify_by_pspec (object, pspec);
2360 }
2361 g_mutex_unlock (&skeleton->priv->lock);
2362 g_object_thaw_notify (object);
2363}
2364
2365static void
7539ecc4 2366locale1_skeleton_init (Locale1Skeleton *skeleton)
5047f6bf 2367{
2368#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
7539ecc4 2369 skeleton->priv = locale1_skeleton_get_instance_private (skeleton);
5047f6bf 2370#else
7539ecc4 2371 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_LOCALE1_SKELETON, Locale1SkeletonPrivate);
5047f6bf 2372#endif
2373
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);
2384}
2385
2386static const gchar *const *
7539ecc4 2387locale1_skeleton_get_locale (Locale1 *object)
5047f6bf 2388{
7539ecc4 2389 Locale1Skeleton *skeleton = LOCALE1_SKELETON (object);
5047f6bf 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);
2394 return value;
2395}
2396
2397static const gchar *
7539ecc4 2398locale1_skeleton_get_x11_layout (Locale1 *object)
5047f6bf 2399{
7539ecc4 2400 Locale1Skeleton *skeleton = LOCALE1_SKELETON (object);
5047f6bf 2401 const gchar *value;
2402 g_mutex_lock (&skeleton->priv->lock);
2403 value = g_value_get_string (&(skeleton->priv->properties[1]));
2404 g_mutex_unlock (&skeleton->priv->lock);
2405 return value;
2406}
2407
2408static const gchar *
7539ecc4 2409locale1_skeleton_get_x11_model (Locale1 *object)
5047f6bf 2410{
7539ecc4 2411 Locale1Skeleton *skeleton = LOCALE1_SKELETON (object);
5047f6bf 2412 const gchar *value;
2413 g_mutex_lock (&skeleton->priv->lock);
2414 value = g_value_get_string (&(skeleton->priv->properties[2]));
2415 g_mutex_unlock (&skeleton->priv->lock);
2416 return value;
2417}
2418
2419static const gchar *
7539ecc4 2420locale1_skeleton_get_x11_variant (Locale1 *object)
5047f6bf 2421{
7539ecc4 2422 Locale1Skeleton *skeleton = LOCALE1_SKELETON (object);
5047f6bf 2423 const gchar *value;
2424 g_mutex_lock (&skeleton->priv->lock);
2425 value = g_value_get_string (&(skeleton->priv->properties[3]));
2426 g_mutex_unlock (&skeleton->priv->lock);
2427 return value;
2428}
2429
2430static const gchar *
7539ecc4 2431locale1_skeleton_get_x11_options (Locale1 *object)
5047f6bf 2432{
7539ecc4 2433 Locale1Skeleton *skeleton = LOCALE1_SKELETON (object);
5047f6bf 2434 const gchar *value;
2435 g_mutex_lock (&skeleton->priv->lock);
2436 value = g_value_get_string (&(skeleton->priv->properties[4]));
2437 g_mutex_unlock (&skeleton->priv->lock);
2438 return value;
2439}
2440
2441static const gchar *
7539ecc4 2442locale1_skeleton_get_vconsole_keymap (Locale1 *object)
5047f6bf 2443{
7539ecc4 2444 Locale1Skeleton *skeleton = LOCALE1_SKELETON (object);
5047f6bf 2445 const gchar *value;
2446 g_mutex_lock (&skeleton->priv->lock);
2447 value = g_value_get_string (&(skeleton->priv->properties[5]));
2448 g_mutex_unlock (&skeleton->priv->lock);
2449 return value;
2450}
2451
2452static const gchar *
7539ecc4 2453locale1_skeleton_get_vconsole_keymap_toggle (Locale1 *object)
5047f6bf 2454{
7539ecc4 2455 Locale1Skeleton *skeleton = LOCALE1_SKELETON (object);
5047f6bf 2456 const gchar *value;
2457 g_mutex_lock (&skeleton->priv->lock);
2458 value = g_value_get_string (&(skeleton->priv->properties[6]));
2459 g_mutex_unlock (&skeleton->priv->lock);
2460 return value;
2461}
2462
2463static void
7539ecc4 2464locale1_skeleton_class_init (Locale1SkeletonClass *klass)
5047f6bf 2465{
2466 GObjectClass *gobject_class;
2467 GDBusInterfaceSkeletonClass *skeleton_class;
2468
2469 gobject_class = G_OBJECT_CLASS (klass);
7539ecc4 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;
5047f6bf 2474
2475
7539ecc4 2476 locale1_override_properties (gobject_class, 1);
5047f6bf 2477
2478 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
7539ecc4 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;
5047f6bf 2483
2484#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
7539ecc4 2485 g_type_class_add_private (klass, sizeof (Locale1SkeletonPrivate));
5047f6bf 2486#endif
2487}
2488
2489static void
7539ecc4 2490locale1_skeleton_iface_init (Locale1Iface *iface)
5047f6bf 2491{
7539ecc4 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;
5047f6bf 2499}
2500
2501/**
7539ecc4 2502 * locale1_skeleton_new:
5047f6bf 2503 *
2504 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-locale1.top_of_page">org.freedesktop.locale1</link>.
2505 *
7539ecc4 2506 * Returns: (transfer full) (type Locale1Skeleton): The skeleton object.
1aa981f7 2507 */
7539ecc4 2508Locale1 *
2509locale1_skeleton_new (void)
1aa981f7 2510{
7539ecc4 2511 return LOCALE1 (g_object_new (TYPE_LOCALE1_SKELETON, NULL));
1aa981f7 2512}
2513