86cb7727 |
1 | /* |
2 | * Generated by gdbus-codegen 2.40.0. DO NOT EDIT. |
3 | * |
4 | * The license of this code is the same as for the source it was derived from. |
5 | */ |
6 | |
7 | #ifdef HAVE_CONFIG_H |
8 | # include "config.h" |
9 | #endif |
10 | |
ae3d717a |
11 | #include "localed-gen.h" |
86cb7727 |
12 | |
13 | #include <string.h> |
14 | #ifdef G_OS_UNIX |
15 | # include <gio/gunixfdlist.h> |
16 | #endif |
17 | |
86cb7727 |
18 | /* ------------------------------------------------------------------------ |
19 | * Code for interface org.freedesktop.locale1 |
20 | * ------------------------------------------------------------------------ |
21 | */ |
22 | |
23 | /** |
ae3d717a |
24 | * SECTION:localedLocale1 |
25 | * @title: localedLocale1 |
86cb7727 |
26 | * @short_description: Generated C code for the org.freedesktop.locale1 D-Bus interface |
27 | * |
28 | * 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. |
29 | */ |
30 | |
31 | /* ---- Introspection data for org.freedesktop.locale1 ---- */ |
32 | |
ae3d717a |
33 | static const _ExtendedGDBusArgInfo _localed_locale1_method_info_set_locale_IN_ARG_unnamed_arg0 = |
86cb7727 |
34 | { |
35 | { |
36 | -1, |
ae3d717a |
37 | (gchar *) "unnamed_arg0", |
86cb7727 |
38 | (gchar *) "as", |
39 | NULL |
40 | }, |
41 | FALSE |
42 | }; |
43 | |
ae3d717a |
44 | static const _ExtendedGDBusArgInfo _localed_locale1_method_info_set_locale_IN_ARG_unnamed_arg1 = |
86cb7727 |
45 | { |
46 | { |
47 | -1, |
ae3d717a |
48 | (gchar *) "unnamed_arg1", |
86cb7727 |
49 | (gchar *) "b", |
50 | NULL |
51 | }, |
52 | FALSE |
53 | }; |
54 | |
ae3d717a |
55 | static const _ExtendedGDBusArgInfo * const _localed_locale1_method_info_set_locale_IN_ARG_pointers[] = |
86cb7727 |
56 | { |
ae3d717a |
57 | &_localed_locale1_method_info_set_locale_IN_ARG_unnamed_arg0, |
58 | &_localed_locale1_method_info_set_locale_IN_ARG_unnamed_arg1, |
86cb7727 |
59 | NULL |
60 | }; |
61 | |
ae3d717a |
62 | static const _ExtendedGDBusMethodInfo _localed_locale1_method_info_set_locale = |
86cb7727 |
63 | { |
64 | { |
65 | -1, |
66 | (gchar *) "SetLocale", |
ae3d717a |
67 | (GDBusArgInfo **) &_localed_locale1_method_info_set_locale_IN_ARG_pointers, |
86cb7727 |
68 | NULL, |
69 | NULL |
70 | }, |
71 | "handle-set-locale", |
72 | FALSE |
73 | }; |
74 | |
ae3d717a |
75 | static const _ExtendedGDBusArgInfo _localed_locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg0 = |
86cb7727 |
76 | { |
77 | { |
78 | -1, |
ae3d717a |
79 | (gchar *) "unnamed_arg0", |
86cb7727 |
80 | (gchar *) "s", |
81 | NULL |
82 | }, |
83 | FALSE |
84 | }; |
85 | |
ae3d717a |
86 | static const _ExtendedGDBusArgInfo _localed_locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg1 = |
86cb7727 |
87 | { |
88 | { |
89 | -1, |
ae3d717a |
90 | (gchar *) "unnamed_arg1", |
86cb7727 |
91 | (gchar *) "s", |
92 | NULL |
93 | }, |
94 | FALSE |
95 | }; |
96 | |
ae3d717a |
97 | static const _ExtendedGDBusArgInfo _localed_locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg2 = |
86cb7727 |
98 | { |
99 | { |
100 | -1, |
ae3d717a |
101 | (gchar *) "unnamed_arg2", |
86cb7727 |
102 | (gchar *) "b", |
103 | NULL |
104 | }, |
105 | FALSE |
106 | }; |
107 | |
ae3d717a |
108 | static const _ExtendedGDBusArgInfo _localed_locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg3 = |
86cb7727 |
109 | { |
110 | { |
111 | -1, |
ae3d717a |
112 | (gchar *) "unnamed_arg3", |
86cb7727 |
113 | (gchar *) "b", |
114 | NULL |
115 | }, |
116 | FALSE |
117 | }; |
118 | |
ae3d717a |
119 | static const _ExtendedGDBusArgInfo * const _localed_locale1_method_info_set_vconsole_keyboard_IN_ARG_pointers[] = |
86cb7727 |
120 | { |
ae3d717a |
121 | &_localed_locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg0, |
122 | &_localed_locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg1, |
123 | &_localed_locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg2, |
124 | &_localed_locale1_method_info_set_vconsole_keyboard_IN_ARG_unnamed_arg3, |
86cb7727 |
125 | NULL |
126 | }; |
127 | |
ae3d717a |
128 | static const _ExtendedGDBusMethodInfo _localed_locale1_method_info_set_vconsole_keyboard = |
86cb7727 |
129 | { |
130 | { |
131 | -1, |
132 | (gchar *) "SetVConsoleKeyboard", |
ae3d717a |
133 | (GDBusArgInfo **) &_localed_locale1_method_info_set_vconsole_keyboard_IN_ARG_pointers, |
86cb7727 |
134 | NULL, |
135 | NULL |
136 | }, |
137 | "handle-set-vconsole-keyboard", |
138 | FALSE |
139 | }; |
140 | |
ae3d717a |
141 | static const _ExtendedGDBusArgInfo _localed_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg0 = |
86cb7727 |
142 | { |
143 | { |
144 | -1, |
ae3d717a |
145 | (gchar *) "unnamed_arg0", |
86cb7727 |
146 | (gchar *) "s", |
147 | NULL |
148 | }, |
149 | FALSE |
150 | }; |
151 | |
ae3d717a |
152 | static const _ExtendedGDBusArgInfo _localed_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg1 = |
86cb7727 |
153 | { |
154 | { |
155 | -1, |
ae3d717a |
156 | (gchar *) "unnamed_arg1", |
86cb7727 |
157 | (gchar *) "s", |
158 | NULL |
159 | }, |
160 | FALSE |
161 | }; |
162 | |
ae3d717a |
163 | static const _ExtendedGDBusArgInfo _localed_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg2 = |
86cb7727 |
164 | { |
165 | { |
166 | -1, |
ae3d717a |
167 | (gchar *) "unnamed_arg2", |
86cb7727 |
168 | (gchar *) "s", |
169 | NULL |
170 | }, |
171 | FALSE |
172 | }; |
173 | |
ae3d717a |
174 | static const _ExtendedGDBusArgInfo _localed_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg3 = |
86cb7727 |
175 | { |
176 | { |
177 | -1, |
ae3d717a |
178 | (gchar *) "unnamed_arg3", |
86cb7727 |
179 | (gchar *) "s", |
180 | NULL |
181 | }, |
182 | FALSE |
183 | }; |
184 | |
ae3d717a |
185 | static const _ExtendedGDBusArgInfo _localed_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg4 = |
86cb7727 |
186 | { |
187 | { |
188 | -1, |
ae3d717a |
189 | (gchar *) "unnamed_arg4", |
86cb7727 |
190 | (gchar *) "b", |
191 | NULL |
192 | }, |
193 | FALSE |
194 | }; |
195 | |
ae3d717a |
196 | static const _ExtendedGDBusArgInfo _localed_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg5 = |
86cb7727 |
197 | { |
198 | { |
199 | -1, |
ae3d717a |
200 | (gchar *) "unnamed_arg5", |
86cb7727 |
201 | (gchar *) "b", |
202 | NULL |
203 | }, |
204 | FALSE |
205 | }; |
206 | |
ae3d717a |
207 | static const _ExtendedGDBusArgInfo * const _localed_locale1_method_info_set_x11_keyboard_IN_ARG_pointers[] = |
86cb7727 |
208 | { |
ae3d717a |
209 | &_localed_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg0, |
210 | &_localed_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg1, |
211 | &_localed_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg2, |
212 | &_localed_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg3, |
213 | &_localed_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg4, |
214 | &_localed_locale1_method_info_set_x11_keyboard_IN_ARG_unnamed_arg5, |
86cb7727 |
215 | NULL |
216 | }; |
217 | |
ae3d717a |
218 | static const _ExtendedGDBusMethodInfo _localed_locale1_method_info_set_x11_keyboard = |
86cb7727 |
219 | { |
220 | { |
221 | -1, |
222 | (gchar *) "SetX11Keyboard", |
ae3d717a |
223 | (GDBusArgInfo **) &_localed_locale1_method_info_set_x11_keyboard_IN_ARG_pointers, |
86cb7727 |
224 | NULL, |
225 | NULL |
226 | }, |
227 | "handle-set-x11-keyboard", |
228 | FALSE |
229 | }; |
230 | |
ae3d717a |
231 | static const _ExtendedGDBusMethodInfo * const _localed_locale1_method_info_pointers[] = |
86cb7727 |
232 | { |
ae3d717a |
233 | &_localed_locale1_method_info_set_locale, |
234 | &_localed_locale1_method_info_set_vconsole_keyboard, |
235 | &_localed_locale1_method_info_set_x11_keyboard, |
86cb7727 |
236 | NULL |
237 | }; |
238 | |
ae3d717a |
239 | static const _ExtendedGDBusPropertyInfo _localed_locale1_property_info_locale = |
86cb7727 |
240 | { |
241 | { |
242 | -1, |
243 | (gchar *) "Locale", |
244 | (gchar *) "as", |
245 | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
246 | NULL |
247 | }, |
248 | "locale", |
249 | FALSE |
250 | }; |
251 | |
ae3d717a |
252 | static const _ExtendedGDBusPropertyInfo _localed_locale1_property_info_x11_layout = |
86cb7727 |
253 | { |
254 | { |
255 | -1, |
ae3d717a |
256 | (gchar *) "X11Layout", |
86cb7727 |
257 | (gchar *) "s", |
258 | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
259 | NULL |
260 | }, |
ae3d717a |
261 | "x11-layout", |
86cb7727 |
262 | FALSE |
263 | }; |
264 | |
ae3d717a |
265 | static const _ExtendedGDBusPropertyInfo _localed_locale1_property_info_x11_model = |
86cb7727 |
266 | { |
267 | { |
268 | -1, |
ae3d717a |
269 | (gchar *) "X11Model", |
86cb7727 |
270 | (gchar *) "s", |
271 | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
272 | NULL |
273 | }, |
ae3d717a |
274 | "x11-model", |
86cb7727 |
275 | FALSE |
276 | }; |
277 | |
ae3d717a |
278 | static const _ExtendedGDBusPropertyInfo _localed_locale1_property_info_x11_variant = |
86cb7727 |
279 | { |
280 | { |
281 | -1, |
ae3d717a |
282 | (gchar *) "X11Variant", |
86cb7727 |
283 | (gchar *) "s", |
284 | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
285 | NULL |
286 | }, |
ae3d717a |
287 | "x11-variant", |
86cb7727 |
288 | FALSE |
289 | }; |
290 | |
ae3d717a |
291 | static const _ExtendedGDBusPropertyInfo _localed_locale1_property_info_x11_options = |
86cb7727 |
292 | { |
293 | { |
294 | -1, |
ae3d717a |
295 | (gchar *) "X11Options", |
86cb7727 |
296 | (gchar *) "s", |
297 | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
298 | NULL |
299 | }, |
ae3d717a |
300 | "x11-options", |
86cb7727 |
301 | FALSE |
302 | }; |
303 | |
ae3d717a |
304 | static const _ExtendedGDBusPropertyInfo _localed_locale1_property_info_vconsole_keymap = |
86cb7727 |
305 | { |
306 | { |
307 | -1, |
ae3d717a |
308 | (gchar *) "VConsoleKeymap", |
86cb7727 |
309 | (gchar *) "s", |
310 | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
311 | NULL |
312 | }, |
ae3d717a |
313 | "vconsole-keymap", |
86cb7727 |
314 | FALSE |
315 | }; |
316 | |
ae3d717a |
317 | static const _ExtendedGDBusPropertyInfo _localed_locale1_property_info_vconsole_keymap_toggle = |
86cb7727 |
318 | { |
319 | { |
320 | -1, |
ae3d717a |
321 | (gchar *) "VConsoleKeymapToggle", |
86cb7727 |
322 | (gchar *) "s", |
323 | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
324 | NULL |
325 | }, |
ae3d717a |
326 | "vconsole-keymap-toggle", |
86cb7727 |
327 | FALSE |
328 | }; |
329 | |
ae3d717a |
330 | static const _ExtendedGDBusPropertyInfo * const _localed_locale1_property_info_pointers[] = |
86cb7727 |
331 | { |
ae3d717a |
332 | &_localed_locale1_property_info_locale, |
333 | &_localed_locale1_property_info_x11_layout, |
334 | &_localed_locale1_property_info_x11_model, |
335 | &_localed_locale1_property_info_x11_variant, |
336 | &_localed_locale1_property_info_x11_options, |
337 | &_localed_locale1_property_info_vconsole_keymap, |
338 | &_localed_locale1_property_info_vconsole_keymap_toggle, |
86cb7727 |
339 | NULL |
340 | }; |
341 | |
ae3d717a |
342 | static const _ExtendedGDBusInterfaceInfo _localed_locale1_interface_info = |
86cb7727 |
343 | { |
344 | { |
345 | -1, |
346 | (gchar *) "org.freedesktop.locale1", |
ae3d717a |
347 | (GDBusMethodInfo **) &_localed_locale1_method_info_pointers, |
86cb7727 |
348 | NULL, |
ae3d717a |
349 | (GDBusPropertyInfo **) &_localed_locale1_property_info_pointers, |
86cb7727 |
350 | NULL |
351 | }, |
352 | "locale1", |
353 | }; |
354 | |
355 | |
356 | /** |
ae3d717a |
357 | * localed_locale1_interface_info: |
86cb7727 |
358 | * |
359 | * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-locale1.top_of_page">org.freedesktop.locale1</link> D-Bus interface. |
360 | * |
361 | * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. |
362 | */ |
363 | GDBusInterfaceInfo * |
ae3d717a |
364 | localed_locale1_interface_info (void) |
86cb7727 |
365 | { |
ae3d717a |
366 | return (GDBusInterfaceInfo *) &_localed_locale1_interface_info.parent_struct; |
86cb7727 |
367 | } |
368 | |
369 | /** |
ae3d717a |
370 | * localed_locale1_override_properties: |
86cb7727 |
371 | * @klass: The class structure for a #GObject<!-- -->-derived class. |
372 | * @property_id_begin: The property id to assign to the first overridden property. |
373 | * |
ae3d717a |
374 | * Overrides all #GObject properties in the #localedLocale1 interface for a concrete class. |
86cb7727 |
375 | * The properties are overridden in the order they are defined. |
376 | * |
377 | * Returns: The last property id. |
378 | */ |
379 | guint |
ae3d717a |
380 | localed_locale1_override_properties (GObjectClass *klass, guint property_id_begin) |
86cb7727 |
381 | { |
382 | g_object_class_override_property (klass, property_id_begin++, "locale"); |
86cb7727 |
383 | g_object_class_override_property (klass, property_id_begin++, "x11-layout"); |
384 | g_object_class_override_property (klass, property_id_begin++, "x11-model"); |
385 | g_object_class_override_property (klass, property_id_begin++, "x11-variant"); |
386 | g_object_class_override_property (klass, property_id_begin++, "x11-options"); |
ae3d717a |
387 | g_object_class_override_property (klass, property_id_begin++, "vconsole-keymap"); |
388 | g_object_class_override_property (klass, property_id_begin++, "vconsole-keymap-toggle"); |
86cb7727 |
389 | return property_id_begin - 1; |
390 | } |
391 | |
392 | |
393 | |
394 | /** |
ae3d717a |
395 | * localedLocale1: |
86cb7727 |
396 | * |
397 | * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-locale1.top_of_page">org.freedesktop.locale1</link>. |
398 | */ |
399 | |
400 | /** |
ae3d717a |
401 | * localedLocale1Iface: |
86cb7727 |
402 | * @parent_iface: The parent interface. |
ae3d717a |
403 | * @handle_set_locale: Handler for the #localedLocale1::handle-set-locale signal. |
404 | * @handle_set_vconsole_keyboard: Handler for the #localedLocale1::handle-set-vconsole-keyboard signal. |
405 | * @handle_set_x11_keyboard: Handler for the #localedLocale1::handle-set-x11-keyboard signal. |
406 | * @get_locale: Getter for the #localedLocale1:locale property. |
407 | * @get_vconsole_keymap: Getter for the #localedLocale1:vconsole-keymap property. |
408 | * @get_vconsole_keymap_toggle: Getter for the #localedLocale1:vconsole-keymap-toggle property. |
409 | * @get_x11_layout: Getter for the #localedLocale1:x11-layout property. |
410 | * @get_x11_model: Getter for the #localedLocale1:x11-model property. |
411 | * @get_x11_options: Getter for the #localedLocale1:x11-options property. |
412 | * @get_x11_variant: Getter for the #localedLocale1:x11-variant property. |
86cb7727 |
413 | * |
414 | * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-locale1.top_of_page">org.freedesktop.locale1</link>. |
415 | */ |
416 | |
ae3d717a |
417 | typedef localedLocale1Iface localedLocale1Interface; |
418 | G_DEFINE_INTERFACE (localedLocale1, localed_locale1, G_TYPE_OBJECT); |
86cb7727 |
419 | |
420 | static void |
ae3d717a |
421 | localed_locale1_default_init (localedLocale1Iface *iface) |
86cb7727 |
422 | { |
423 | /* GObject signals for incoming D-Bus method calls: */ |
424 | /** |
ae3d717a |
425 | * localedLocale1::handle-set-locale: |
426 | * @object: A #localedLocale1. |
86cb7727 |
427 | * @invocation: A #GDBusMethodInvocation. |
ae3d717a |
428 | * @arg_unnamed_arg0: Argument passed by remote caller. |
429 | * @arg_unnamed_arg1: Argument passed by remote caller. |
86cb7727 |
430 | * |
431 | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-locale1.SetLocale">SetLocale()</link> D-Bus method. |
432 | * |
ae3d717a |
433 | * 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 localed_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. |
86cb7727 |
434 | * |
435 | * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. |
436 | */ |
437 | g_signal_new ("handle-set-locale", |
438 | G_TYPE_FROM_INTERFACE (iface), |
439 | G_SIGNAL_RUN_LAST, |
ae3d717a |
440 | G_STRUCT_OFFSET (localedLocale1Iface, handle_set_locale), |
86cb7727 |
441 | g_signal_accumulator_true_handled, |
442 | NULL, |
443 | g_cclosure_marshal_generic, |
444 | G_TYPE_BOOLEAN, |
445 | 3, |
446 | G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRV, G_TYPE_BOOLEAN); |
447 | |
448 | /** |
ae3d717a |
449 | * localedLocale1::handle-set-vconsole-keyboard: |
450 | * @object: A #localedLocale1. |
86cb7727 |
451 | * @invocation: A #GDBusMethodInvocation. |
ae3d717a |
452 | * @arg_unnamed_arg0: Argument passed by remote caller. |
453 | * @arg_unnamed_arg1: Argument passed by remote caller. |
454 | * @arg_unnamed_arg2: Argument passed by remote caller. |
455 | * @arg_unnamed_arg3: Argument passed by remote caller. |
86cb7727 |
456 | * |
457 | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-locale1.SetVConsoleKeyboard">SetVConsoleKeyboard()</link> D-Bus method. |
458 | * |
ae3d717a |
459 | * 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 localed_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. |
86cb7727 |
460 | * |
461 | * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. |
462 | */ |
463 | g_signal_new ("handle-set-vconsole-keyboard", |
464 | G_TYPE_FROM_INTERFACE (iface), |
465 | G_SIGNAL_RUN_LAST, |
ae3d717a |
466 | G_STRUCT_OFFSET (localedLocale1Iface, handle_set_vconsole_keyboard), |
86cb7727 |
467 | g_signal_accumulator_true_handled, |
468 | NULL, |
469 | g_cclosure_marshal_generic, |
470 | G_TYPE_BOOLEAN, |
471 | 5, |
472 | G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); |
473 | |
474 | /** |
ae3d717a |
475 | * localedLocale1::handle-set-x11-keyboard: |
476 | * @object: A #localedLocale1. |
86cb7727 |
477 | * @invocation: A #GDBusMethodInvocation. |
ae3d717a |
478 | * @arg_unnamed_arg0: Argument passed by remote caller. |
479 | * @arg_unnamed_arg1: Argument passed by remote caller. |
480 | * @arg_unnamed_arg2: Argument passed by remote caller. |
481 | * @arg_unnamed_arg3: Argument passed by remote caller. |
482 | * @arg_unnamed_arg4: Argument passed by remote caller. |
483 | * @arg_unnamed_arg5: Argument passed by remote caller. |
86cb7727 |
484 | * |
485 | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-locale1.SetX11Keyboard">SetX11Keyboard()</link> D-Bus method. |
486 | * |
ae3d717a |
487 | * 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 localed_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. |
86cb7727 |
488 | * |
489 | * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. |
490 | */ |
491 | g_signal_new ("handle-set-x11-keyboard", |
492 | G_TYPE_FROM_INTERFACE (iface), |
493 | G_SIGNAL_RUN_LAST, |
ae3d717a |
494 | G_STRUCT_OFFSET (localedLocale1Iface, handle_set_x11_keyboard), |
86cb7727 |
495 | g_signal_accumulator_true_handled, |
496 | NULL, |
497 | g_cclosure_marshal_generic, |
498 | G_TYPE_BOOLEAN, |
499 | 7, |
500 | G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); |
501 | |
502 | /* GObject properties for D-Bus properties: */ |
503 | /** |
ae3d717a |
504 | * localedLocale1:locale: |
86cb7727 |
505 | * |
506 | * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.Locale">"Locale"</link>. |
507 | * |
508 | * 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. |
509 | */ |
510 | g_object_interface_install_property (iface, |
511 | g_param_spec_boxed ("locale", "Locale", "Locale", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
512 | /** |
ae3d717a |
513 | * localedLocale1:x11-layout: |
86cb7727 |
514 | * |
ae3d717a |
515 | * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.X11Layout">"X11Layout"</link>. |
86cb7727 |
516 | * |
517 | * 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. |
518 | */ |
519 | g_object_interface_install_property (iface, |
ae3d717a |
520 | g_param_spec_string ("x11-layout", "X11Layout", "X11Layout", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
86cb7727 |
521 | /** |
ae3d717a |
522 | * localedLocale1:x11-model: |
86cb7727 |
523 | * |
ae3d717a |
524 | * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.X11Model">"X11Model"</link>. |
86cb7727 |
525 | * |
526 | * 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. |
527 | */ |
528 | g_object_interface_install_property (iface, |
ae3d717a |
529 | g_param_spec_string ("x11-model", "X11Model", "X11Model", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
86cb7727 |
530 | /** |
ae3d717a |
531 | * localedLocale1:x11-variant: |
86cb7727 |
532 | * |
ae3d717a |
533 | * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.X11Variant">"X11Variant"</link>. |
86cb7727 |
534 | * |
535 | * 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. |
536 | */ |
537 | g_object_interface_install_property (iface, |
ae3d717a |
538 | g_param_spec_string ("x11-variant", "X11Variant", "X11Variant", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
86cb7727 |
539 | /** |
ae3d717a |
540 | * localedLocale1:x11-options: |
86cb7727 |
541 | * |
ae3d717a |
542 | * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.X11Options">"X11Options"</link>. |
86cb7727 |
543 | * |
544 | * 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. |
545 | */ |
546 | g_object_interface_install_property (iface, |
ae3d717a |
547 | g_param_spec_string ("x11-options", "X11Options", "X11Options", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
86cb7727 |
548 | /** |
ae3d717a |
549 | * localedLocale1:vconsole-keymap: |
86cb7727 |
550 | * |
ae3d717a |
551 | * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymap">"VConsoleKeymap"</link>. |
86cb7727 |
552 | * |
553 | * 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. |
554 | */ |
555 | g_object_interface_install_property (iface, |
ae3d717a |
556 | g_param_spec_string ("vconsole-keymap", "VConsoleKeymap", "VConsoleKeymap", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
86cb7727 |
557 | /** |
ae3d717a |
558 | * localedLocale1:vconsole-keymap-toggle: |
86cb7727 |
559 | * |
ae3d717a |
560 | * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymapToggle">"VConsoleKeymapToggle"</link>. |
86cb7727 |
561 | * |
562 | * 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. |
563 | */ |
564 | g_object_interface_install_property (iface, |
ae3d717a |
565 | g_param_spec_string ("vconsole-keymap-toggle", "VConsoleKeymapToggle", "VConsoleKeymapToggle", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
86cb7727 |
566 | } |
567 | |
568 | /** |
ae3d717a |
569 | * localed_locale1_get_locale: (skip) |
570 | * @object: A #localedLocale1. |
86cb7727 |
571 | * |
572 | * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.Locale">"Locale"</link> D-Bus property. |
573 | * |
574 | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
575 | * |
ae3d717a |
576 | * <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 localed_locale1_dup_locale() if on another thread.</warning> |
86cb7727 |
577 | * |
578 | * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. |
579 | */ |
580 | const gchar *const * |
ae3d717a |
581 | localed_locale1_get_locale (localedLocale1 *object) |
86cb7727 |
582 | { |
ae3d717a |
583 | return LOCALED_LOCALE1_GET_IFACE (object)->get_locale (object); |
86cb7727 |
584 | } |
585 | |
586 | /** |
ae3d717a |
587 | * localed_locale1_dup_locale: (skip) |
588 | * @object: A #localedLocale1. |
86cb7727 |
589 | * |
590 | * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.Locale">"Locale"</link> D-Bus property. |
591 | * |
592 | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
593 | * |
594 | * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev(). |
595 | */ |
596 | gchar ** |
ae3d717a |
597 | localed_locale1_dup_locale (localedLocale1 *object) |
86cb7727 |
598 | { |
599 | gchar **value; |
600 | g_object_get (G_OBJECT (object), "locale", &value, NULL); |
601 | return value; |
602 | } |
603 | |
604 | /** |
ae3d717a |
605 | * localed_locale1_set_locale: (skip) |
606 | * @object: A #localedLocale1. |
86cb7727 |
607 | * @value: The value to set. |
608 | * |
609 | * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.Locale">"Locale"</link> D-Bus property to @value. |
610 | * |
611 | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
612 | */ |
613 | void |
ae3d717a |
614 | localed_locale1_set_locale (localedLocale1 *object, const gchar *const *value) |
86cb7727 |
615 | { |
616 | g_object_set (G_OBJECT (object), "locale", value, NULL); |
617 | } |
618 | |
619 | /** |
ae3d717a |
620 | * localed_locale1_get_x11_layout: (skip) |
621 | * @object: A #localedLocale1. |
86cb7727 |
622 | * |
ae3d717a |
623 | * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Layout">"X11Layout"</link> D-Bus property. |
86cb7727 |
624 | * |
625 | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
626 | * |
ae3d717a |
627 | * <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 localed_locale1_dup_x11_layout() if on another thread.</warning> |
86cb7727 |
628 | * |
629 | * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. |
630 | */ |
631 | const gchar * |
ae3d717a |
632 | localed_locale1_get_x11_layout (localedLocale1 *object) |
86cb7727 |
633 | { |
ae3d717a |
634 | return LOCALED_LOCALE1_GET_IFACE (object)->get_x11_layout (object); |
86cb7727 |
635 | } |
636 | |
637 | /** |
ae3d717a |
638 | * localed_locale1_dup_x11_layout: (skip) |
639 | * @object: A #localedLocale1. |
86cb7727 |
640 | * |
ae3d717a |
641 | * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Layout">"X11Layout"</link> D-Bus property. |
86cb7727 |
642 | * |
643 | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
644 | * |
645 | * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). |
646 | */ |
647 | gchar * |
ae3d717a |
648 | localed_locale1_dup_x11_layout (localedLocale1 *object) |
86cb7727 |
649 | { |
650 | gchar *value; |
ae3d717a |
651 | g_object_get (G_OBJECT (object), "x11-layout", &value, NULL); |
86cb7727 |
652 | return value; |
653 | } |
654 | |
655 | /** |
ae3d717a |
656 | * localed_locale1_set_x11_layout: (skip) |
657 | * @object: A #localedLocale1. |
86cb7727 |
658 | * @value: The value to set. |
659 | * |
ae3d717a |
660 | * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.X11Layout">"X11Layout"</link> D-Bus property to @value. |
86cb7727 |
661 | * |
662 | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
663 | */ |
664 | void |
ae3d717a |
665 | localed_locale1_set_x11_layout (localedLocale1 *object, const gchar *value) |
86cb7727 |
666 | { |
ae3d717a |
667 | g_object_set (G_OBJECT (object), "x11-layout", value, NULL); |
86cb7727 |
668 | } |
669 | |
670 | /** |
ae3d717a |
671 | * localed_locale1_get_x11_model: (skip) |
672 | * @object: A #localedLocale1. |
86cb7727 |
673 | * |
ae3d717a |
674 | * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Model">"X11Model"</link> D-Bus property. |
86cb7727 |
675 | * |
676 | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
677 | * |
ae3d717a |
678 | * <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 localed_locale1_dup_x11_model() if on another thread.</warning> |
86cb7727 |
679 | * |
680 | * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. |
681 | */ |
682 | const gchar * |
ae3d717a |
683 | localed_locale1_get_x11_model (localedLocale1 *object) |
86cb7727 |
684 | { |
ae3d717a |
685 | return LOCALED_LOCALE1_GET_IFACE (object)->get_x11_model (object); |
86cb7727 |
686 | } |
687 | |
688 | /** |
ae3d717a |
689 | * localed_locale1_dup_x11_model: (skip) |
690 | * @object: A #localedLocale1. |
86cb7727 |
691 | * |
ae3d717a |
692 | * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Model">"X11Model"</link> D-Bus property. |
86cb7727 |
693 | * |
694 | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
695 | * |
696 | * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). |
697 | */ |
698 | gchar * |
ae3d717a |
699 | localed_locale1_dup_x11_model (localedLocale1 *object) |
86cb7727 |
700 | { |
701 | gchar *value; |
ae3d717a |
702 | g_object_get (G_OBJECT (object), "x11-model", &value, NULL); |
86cb7727 |
703 | return value; |
704 | } |
705 | |
706 | /** |
ae3d717a |
707 | * localed_locale1_set_x11_model: (skip) |
708 | * @object: A #localedLocale1. |
86cb7727 |
709 | * @value: The value to set. |
710 | * |
ae3d717a |
711 | * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.X11Model">"X11Model"</link> D-Bus property to @value. |
86cb7727 |
712 | * |
713 | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
714 | */ |
715 | void |
ae3d717a |
716 | localed_locale1_set_x11_model (localedLocale1 *object, const gchar *value) |
86cb7727 |
717 | { |
ae3d717a |
718 | g_object_set (G_OBJECT (object), "x11-model", value, NULL); |
86cb7727 |
719 | } |
720 | |
721 | /** |
ae3d717a |
722 | * localed_locale1_get_x11_variant: (skip) |
723 | * @object: A #localedLocale1. |
86cb7727 |
724 | * |
ae3d717a |
725 | * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Variant">"X11Variant"</link> D-Bus property. |
86cb7727 |
726 | * |
727 | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
728 | * |
ae3d717a |
729 | * <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 localed_locale1_dup_x11_variant() if on another thread.</warning> |
86cb7727 |
730 | * |
731 | * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. |
732 | */ |
733 | const gchar * |
ae3d717a |
734 | localed_locale1_get_x11_variant (localedLocale1 *object) |
86cb7727 |
735 | { |
ae3d717a |
736 | return LOCALED_LOCALE1_GET_IFACE (object)->get_x11_variant (object); |
86cb7727 |
737 | } |
738 | |
739 | /** |
ae3d717a |
740 | * localed_locale1_dup_x11_variant: (skip) |
741 | * @object: A #localedLocale1. |
86cb7727 |
742 | * |
ae3d717a |
743 | * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Variant">"X11Variant"</link> D-Bus property. |
86cb7727 |
744 | * |
745 | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
746 | * |
747 | * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). |
748 | */ |
749 | gchar * |
ae3d717a |
750 | localed_locale1_dup_x11_variant (localedLocale1 *object) |
86cb7727 |
751 | { |
752 | gchar *value; |
ae3d717a |
753 | g_object_get (G_OBJECT (object), "x11-variant", &value, NULL); |
86cb7727 |
754 | return value; |
755 | } |
756 | |
757 | /** |
ae3d717a |
758 | * localed_locale1_set_x11_variant: (skip) |
759 | * @object: A #localedLocale1. |
86cb7727 |
760 | * @value: The value to set. |
761 | * |
ae3d717a |
762 | * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.X11Variant">"X11Variant"</link> D-Bus property to @value. |
86cb7727 |
763 | * |
764 | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
765 | */ |
766 | void |
ae3d717a |
767 | localed_locale1_set_x11_variant (localedLocale1 *object, const gchar *value) |
86cb7727 |
768 | { |
ae3d717a |
769 | g_object_set (G_OBJECT (object), "x11-variant", value, NULL); |
86cb7727 |
770 | } |
771 | |
772 | /** |
ae3d717a |
773 | * localed_locale1_get_x11_options: (skip) |
774 | * @object: A #localedLocale1. |
86cb7727 |
775 | * |
ae3d717a |
776 | * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Options">"X11Options"</link> D-Bus property. |
86cb7727 |
777 | * |
778 | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
779 | * |
ae3d717a |
780 | * <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 localed_locale1_dup_x11_options() if on another thread.</warning> |
86cb7727 |
781 | * |
782 | * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. |
783 | */ |
784 | const gchar * |
ae3d717a |
785 | localed_locale1_get_x11_options (localedLocale1 *object) |
86cb7727 |
786 | { |
ae3d717a |
787 | return LOCALED_LOCALE1_GET_IFACE (object)->get_x11_options (object); |
86cb7727 |
788 | } |
789 | |
790 | /** |
ae3d717a |
791 | * localed_locale1_dup_x11_options: (skip) |
792 | * @object: A #localedLocale1. |
86cb7727 |
793 | * |
ae3d717a |
794 | * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.X11Options">"X11Options"</link> D-Bus property. |
86cb7727 |
795 | * |
796 | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
797 | * |
798 | * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). |
799 | */ |
800 | gchar * |
ae3d717a |
801 | localed_locale1_dup_x11_options (localedLocale1 *object) |
86cb7727 |
802 | { |
803 | gchar *value; |
ae3d717a |
804 | g_object_get (G_OBJECT (object), "x11-options", &value, NULL); |
86cb7727 |
805 | return value; |
806 | } |
807 | |
808 | /** |
ae3d717a |
809 | * localed_locale1_set_x11_options: (skip) |
810 | * @object: A #localedLocale1. |
86cb7727 |
811 | * @value: The value to set. |
812 | * |
ae3d717a |
813 | * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.X11Options">"X11Options"</link> D-Bus property to @value. |
86cb7727 |
814 | * |
815 | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
816 | */ |
817 | void |
ae3d717a |
818 | localed_locale1_set_x11_options (localedLocale1 *object, const gchar *value) |
86cb7727 |
819 | { |
ae3d717a |
820 | g_object_set (G_OBJECT (object), "x11-options", value, NULL); |
86cb7727 |
821 | } |
822 | |
823 | /** |
ae3d717a |
824 | * localed_locale1_get_vconsole_keymap: (skip) |
825 | * @object: A #localedLocale1. |
86cb7727 |
826 | * |
ae3d717a |
827 | * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymap">"VConsoleKeymap"</link> D-Bus property. |
86cb7727 |
828 | * |
829 | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
830 | * |
ae3d717a |
831 | * <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 localed_locale1_dup_vconsole_keymap() if on another thread.</warning> |
86cb7727 |
832 | * |
833 | * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. |
834 | */ |
835 | const gchar * |
ae3d717a |
836 | localed_locale1_get_vconsole_keymap (localedLocale1 *object) |
86cb7727 |
837 | { |
ae3d717a |
838 | return LOCALED_LOCALE1_GET_IFACE (object)->get_vconsole_keymap (object); |
86cb7727 |
839 | } |
840 | |
841 | /** |
ae3d717a |
842 | * localed_locale1_dup_vconsole_keymap: (skip) |
843 | * @object: A #localedLocale1. |
86cb7727 |
844 | * |
ae3d717a |
845 | * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymap">"VConsoleKeymap"</link> D-Bus property. |
86cb7727 |
846 | * |
847 | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
848 | * |
849 | * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). |
850 | */ |
851 | gchar * |
ae3d717a |
852 | localed_locale1_dup_vconsole_keymap (localedLocale1 *object) |
86cb7727 |
853 | { |
854 | gchar *value; |
ae3d717a |
855 | g_object_get (G_OBJECT (object), "vconsole-keymap", &value, NULL); |
86cb7727 |
856 | return value; |
857 | } |
858 | |
859 | /** |
ae3d717a |
860 | * localed_locale1_set_vconsole_keymap: (skip) |
861 | * @object: A #localedLocale1. |
86cb7727 |
862 | * @value: The value to set. |
863 | * |
ae3d717a |
864 | * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymap">"VConsoleKeymap"</link> D-Bus property to @value. |
86cb7727 |
865 | * |
866 | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
867 | */ |
868 | void |
ae3d717a |
869 | localed_locale1_set_vconsole_keymap (localedLocale1 *object, const gchar *value) |
86cb7727 |
870 | { |
ae3d717a |
871 | g_object_set (G_OBJECT (object), "vconsole-keymap", value, NULL); |
86cb7727 |
872 | } |
873 | |
874 | /** |
ae3d717a |
875 | * localed_locale1_get_vconsole_keymap_toggle: (skip) |
876 | * @object: A #localedLocale1. |
86cb7727 |
877 | * |
ae3d717a |
878 | * Gets the value of the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymapToggle">"VConsoleKeymapToggle"</link> D-Bus property. |
86cb7727 |
879 | * |
880 | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
881 | * |
ae3d717a |
882 | * <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 localed_locale1_dup_vconsole_keymap_toggle() if on another thread.</warning> |
86cb7727 |
883 | * |
884 | * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. |
885 | */ |
886 | const gchar * |
ae3d717a |
887 | localed_locale1_get_vconsole_keymap_toggle (localedLocale1 *object) |
86cb7727 |
888 | { |
ae3d717a |
889 | return LOCALED_LOCALE1_GET_IFACE (object)->get_vconsole_keymap_toggle (object); |
86cb7727 |
890 | } |
891 | |
892 | /** |
ae3d717a |
893 | * localed_locale1_dup_vconsole_keymap_toggle: (skip) |
894 | * @object: A #localedLocale1. |
86cb7727 |
895 | * |
ae3d717a |
896 | * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymapToggle">"VConsoleKeymapToggle"</link> D-Bus property. |
86cb7727 |
897 | * |
898 | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
899 | * |
900 | * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). |
901 | */ |
902 | gchar * |
ae3d717a |
903 | localed_locale1_dup_vconsole_keymap_toggle (localedLocale1 *object) |
86cb7727 |
904 | { |
905 | gchar *value; |
ae3d717a |
906 | g_object_get (G_OBJECT (object), "vconsole-keymap-toggle", &value, NULL); |
86cb7727 |
907 | return value; |
908 | } |
909 | |
910 | /** |
ae3d717a |
911 | * localed_locale1_set_vconsole_keymap_toggle: (skip) |
912 | * @object: A #localedLocale1. |
86cb7727 |
913 | * @value: The value to set. |
914 | * |
ae3d717a |
915 | * Sets the <link linkend="gdbus-property-org-freedesktop-locale1.VConsoleKeymapToggle">"VConsoleKeymapToggle"</link> D-Bus property to @value. |
86cb7727 |
916 | * |
917 | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
918 | */ |
919 | void |
ae3d717a |
920 | localed_locale1_set_vconsole_keymap_toggle (localedLocale1 *object, const gchar *value) |
86cb7727 |
921 | { |
ae3d717a |
922 | g_object_set (G_OBJECT (object), "vconsole-keymap-toggle", value, NULL); |
86cb7727 |
923 | } |
924 | |
925 | /** |
ae3d717a |
926 | * localed_locale1_call_set_locale: |
927 | * @proxy: A #localedLocale1Proxy. |
928 | * @arg_unnamed_arg0: Argument to pass with the method invocation. |
929 | * @arg_unnamed_arg1: Argument to pass with the method invocation. |
86cb7727 |
930 | * @cancellable: (allow-none): A #GCancellable or %NULL. |
931 | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
932 | * @user_data: User data to pass to @callback. |
933 | * |
934 | * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-locale1.SetLocale">SetLocale()</link> D-Bus method on @proxy. |
935 | * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. |
ae3d717a |
936 | * You can then call localed_locale1_call_set_locale_finish() to get the result of the operation. |
86cb7727 |
937 | * |
ae3d717a |
938 | * See localed_locale1_call_set_locale_sync() for the synchronous, blocking version of this method. |
86cb7727 |
939 | */ |
940 | void |
ae3d717a |
941 | localed_locale1_call_set_locale ( |
942 | localedLocale1 *proxy, |
943 | const gchar *const *arg_unnamed_arg0, |
944 | gboolean arg_unnamed_arg1, |
86cb7727 |
945 | GCancellable *cancellable, |
946 | GAsyncReadyCallback callback, |
947 | gpointer user_data) |
948 | { |
949 | g_dbus_proxy_call (G_DBUS_PROXY (proxy), |
950 | "SetLocale", |
951 | g_variant_new ("(^asb)", |
ae3d717a |
952 | arg_unnamed_arg0, |
953 | arg_unnamed_arg1), |
86cb7727 |
954 | G_DBUS_CALL_FLAGS_NONE, |
955 | -1, |
956 | cancellable, |
957 | callback, |
958 | user_data); |
959 | } |
960 | |
961 | /** |
ae3d717a |
962 | * localed_locale1_call_set_locale_finish: |
963 | * @proxy: A #localedLocale1Proxy. |
964 | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to localed_locale1_call_set_locale(). |
86cb7727 |
965 | * @error: Return location for error or %NULL. |
966 | * |
ae3d717a |
967 | * Finishes an operation started with localed_locale1_call_set_locale(). |
86cb7727 |
968 | * |
969 | * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. |
970 | */ |
971 | gboolean |
ae3d717a |
972 | localed_locale1_call_set_locale_finish ( |
973 | localedLocale1 *proxy, |
86cb7727 |
974 | GAsyncResult *res, |
975 | GError **error) |
976 | { |
977 | GVariant *_ret; |
978 | _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); |
979 | if (_ret == NULL) |
980 | goto _out; |
981 | g_variant_get (_ret, |
982 | "()"); |
983 | g_variant_unref (_ret); |
984 | _out: |
985 | return _ret != NULL; |
986 | } |
987 | |
988 | /** |
ae3d717a |
989 | * localed_locale1_call_set_locale_sync: |
990 | * @proxy: A #localedLocale1Proxy. |
991 | * @arg_unnamed_arg0: Argument to pass with the method invocation. |
992 | * @arg_unnamed_arg1: Argument to pass with the method invocation. |
86cb7727 |
993 | * @cancellable: (allow-none): A #GCancellable or %NULL. |
994 | * @error: Return location for error or %NULL. |
995 | * |
996 | * 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. |
997 | * |
ae3d717a |
998 | * See localed_locale1_call_set_locale() for the asynchronous version of this method. |
86cb7727 |
999 | * |
1000 | * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. |
1001 | */ |
1002 | gboolean |
ae3d717a |
1003 | localed_locale1_call_set_locale_sync ( |
1004 | localedLocale1 *proxy, |
1005 | const gchar *const *arg_unnamed_arg0, |
1006 | gboolean arg_unnamed_arg1, |
86cb7727 |
1007 | GCancellable *cancellable, |
1008 | GError **error) |
1009 | { |
1010 | GVariant *_ret; |
1011 | _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), |
1012 | "SetLocale", |
1013 | g_variant_new ("(^asb)", |
ae3d717a |
1014 | arg_unnamed_arg0, |
1015 | arg_unnamed_arg1), |
86cb7727 |
1016 | G_DBUS_CALL_FLAGS_NONE, |
1017 | -1, |
1018 | cancellable, |
1019 | error); |
1020 | if (_ret == NULL) |
1021 | goto _out; |
1022 | g_variant_get (_ret, |
1023 | "()"); |
1024 | g_variant_unref (_ret); |
1025 | _out: |
1026 | return _ret != NULL; |
1027 | } |
1028 | |
1029 | /** |
ae3d717a |
1030 | * localed_locale1_call_set_vconsole_keyboard: |
1031 | * @proxy: A #localedLocale1Proxy. |
1032 | * @arg_unnamed_arg0: Argument to pass with the method invocation. |
1033 | * @arg_unnamed_arg1: Argument to pass with the method invocation. |
1034 | * @arg_unnamed_arg2: Argument to pass with the method invocation. |
1035 | * @arg_unnamed_arg3: Argument to pass with the method invocation. |
86cb7727 |
1036 | * @cancellable: (allow-none): A #GCancellable or %NULL. |
1037 | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
1038 | * @user_data: User data to pass to @callback. |
1039 | * |
1040 | * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-locale1.SetVConsoleKeyboard">SetVConsoleKeyboard()</link> D-Bus method on @proxy. |
1041 | * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. |
ae3d717a |
1042 | * You can then call localed_locale1_call_set_vconsole_keyboard_finish() to get the result of the operation. |
86cb7727 |
1043 | * |
ae3d717a |
1044 | * See localed_locale1_call_set_vconsole_keyboard_sync() for the synchronous, blocking version of this method. |
86cb7727 |
1045 | */ |
1046 | void |
ae3d717a |
1047 | localed_locale1_call_set_vconsole_keyboard ( |
1048 | localedLocale1 *proxy, |
1049 | const gchar *arg_unnamed_arg0, |
1050 | const gchar *arg_unnamed_arg1, |
1051 | gboolean arg_unnamed_arg2, |
1052 | gboolean arg_unnamed_arg3, |
86cb7727 |
1053 | GCancellable *cancellable, |
1054 | GAsyncReadyCallback callback, |
1055 | gpointer user_data) |
1056 | { |
1057 | g_dbus_proxy_call (G_DBUS_PROXY (proxy), |
1058 | "SetVConsoleKeyboard", |
1059 | g_variant_new ("(ssbb)", |
ae3d717a |
1060 | arg_unnamed_arg0, |
1061 | arg_unnamed_arg1, |
1062 | arg_unnamed_arg2, |
1063 | arg_unnamed_arg3), |
86cb7727 |
1064 | G_DBUS_CALL_FLAGS_NONE, |
1065 | -1, |
1066 | cancellable, |
1067 | callback, |
1068 | user_data); |
1069 | } |
1070 | |
1071 | /** |
ae3d717a |
1072 | * localed_locale1_call_set_vconsole_keyboard_finish: |
1073 | * @proxy: A #localedLocale1Proxy. |
1074 | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to localed_locale1_call_set_vconsole_keyboard(). |
86cb7727 |
1075 | * @error: Return location for error or %NULL. |
1076 | * |
ae3d717a |
1077 | * Finishes an operation started with localed_locale1_call_set_vconsole_keyboard(). |
86cb7727 |
1078 | * |
1079 | * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. |
1080 | */ |
1081 | gboolean |
ae3d717a |
1082 | localed_locale1_call_set_vconsole_keyboard_finish ( |
1083 | localedLocale1 *proxy, |
86cb7727 |
1084 | GAsyncResult *res, |
1085 | GError **error) |
1086 | { |
1087 | GVariant *_ret; |
1088 | _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); |
1089 | if (_ret == NULL) |
1090 | goto _out; |
1091 | g_variant_get (_ret, |
1092 | "()"); |
1093 | g_variant_unref (_ret); |
1094 | _out: |
1095 | return _ret != NULL; |
1096 | } |
1097 | |
1098 | /** |
ae3d717a |
1099 | * localed_locale1_call_set_vconsole_keyboard_sync: |
1100 | * @proxy: A #localedLocale1Proxy. |
1101 | * @arg_unnamed_arg0: Argument to pass with the method invocation. |
1102 | * @arg_unnamed_arg1: Argument to pass with the method invocation. |
1103 | * @arg_unnamed_arg2: Argument to pass with the method invocation. |
1104 | * @arg_unnamed_arg3: Argument to pass with the method invocation. |
86cb7727 |
1105 | * @cancellable: (allow-none): A #GCancellable or %NULL. |
1106 | * @error: Return location for error or %NULL. |
1107 | * |
1108 | * 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. |
1109 | * |
ae3d717a |
1110 | * See localed_locale1_call_set_vconsole_keyboard() for the asynchronous version of this method. |
86cb7727 |
1111 | * |
1112 | * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. |
1113 | */ |
1114 | gboolean |
ae3d717a |
1115 | localed_locale1_call_set_vconsole_keyboard_sync ( |
1116 | localedLocale1 *proxy, |
1117 | const gchar *arg_unnamed_arg0, |
1118 | const gchar *arg_unnamed_arg1, |
1119 | gboolean arg_unnamed_arg2, |
1120 | gboolean arg_unnamed_arg3, |
86cb7727 |
1121 | GCancellable *cancellable, |
1122 | GError **error) |
1123 | { |
1124 | GVariant *_ret; |
1125 | _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), |
1126 | "SetVConsoleKeyboard", |
1127 | g_variant_new ("(ssbb)", |
ae3d717a |
1128 | arg_unnamed_arg0, |
1129 | arg_unnamed_arg1, |
1130 | arg_unnamed_arg2, |
1131 | arg_unnamed_arg3), |
86cb7727 |
1132 | G_DBUS_CALL_FLAGS_NONE, |
1133 | -1, |
1134 | cancellable, |
1135 | error); |
1136 | if (_ret == NULL) |
1137 | goto _out; |
1138 | g_variant_get (_ret, |
1139 | "()"); |
1140 | g_variant_unref (_ret); |
1141 | _out: |
1142 | return _ret != NULL; |
1143 | } |
1144 | |
1145 | /** |
ae3d717a |
1146 | * localed_locale1_call_set_x11_keyboard: |
1147 | * @proxy: A #localedLocale1Proxy. |
1148 | * @arg_unnamed_arg0: Argument to pass with the method invocation. |
1149 | * @arg_unnamed_arg1: Argument to pass with the method invocation. |
1150 | * @arg_unnamed_arg2: Argument to pass with the method invocation. |
1151 | * @arg_unnamed_arg3: Argument to pass with the method invocation. |
1152 | * @arg_unnamed_arg4: Argument to pass with the method invocation. |
1153 | * @arg_unnamed_arg5: Argument to pass with the method invocation. |
86cb7727 |
1154 | * @cancellable: (allow-none): A #GCancellable or %NULL. |
1155 | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
1156 | * @user_data: User data to pass to @callback. |
1157 | * |
1158 | * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-locale1.SetX11Keyboard">SetX11Keyboard()</link> D-Bus method on @proxy. |
1159 | * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. |
ae3d717a |
1160 | * You can then call localed_locale1_call_set_x11_keyboard_finish() to get the result of the operation. |
86cb7727 |
1161 | * |
ae3d717a |
1162 | * See localed_locale1_call_set_x11_keyboard_sync() for the synchronous, blocking version of this method. |
86cb7727 |
1163 | */ |
1164 | void |
ae3d717a |
1165 | localed_locale1_call_set_x11_keyboard ( |
1166 | localedLocale1 *proxy, |
1167 | const gchar *arg_unnamed_arg0, |
1168 | const gchar *arg_unnamed_arg1, |
1169 | const gchar *arg_unnamed_arg2, |
1170 | const gchar *arg_unnamed_arg3, |
1171 | gboolean arg_unnamed_arg4, |
1172 | gboolean arg_unnamed_arg5, |
86cb7727 |
1173 | GCancellable *cancellable, |
1174 | GAsyncReadyCallback callback, |
1175 | gpointer user_data) |
1176 | { |
1177 | g_dbus_proxy_call (G_DBUS_PROXY (proxy), |
1178 | "SetX11Keyboard", |
1179 | g_variant_new ("(ssssbb)", |
ae3d717a |
1180 | arg_unnamed_arg0, |
1181 | arg_unnamed_arg1, |
1182 | arg_unnamed_arg2, |
1183 | arg_unnamed_arg3, |
1184 | arg_unnamed_arg4, |
1185 | arg_unnamed_arg5), |
86cb7727 |
1186 | G_DBUS_CALL_FLAGS_NONE, |
1187 | -1, |
1188 | cancellable, |
1189 | callback, |
1190 | user_data); |
1191 | } |
1192 | |
1193 | /** |
ae3d717a |
1194 | * localed_locale1_call_set_x11_keyboard_finish: |
1195 | * @proxy: A #localedLocale1Proxy. |
1196 | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to localed_locale1_call_set_x11_keyboard(). |
86cb7727 |
1197 | * @error: Return location for error or %NULL. |
1198 | * |
ae3d717a |
1199 | * Finishes an operation started with localed_locale1_call_set_x11_keyboard(). |
86cb7727 |
1200 | * |
1201 | * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. |
1202 | */ |
1203 | gboolean |
ae3d717a |
1204 | localed_locale1_call_set_x11_keyboard_finish ( |
1205 | localedLocale1 *proxy, |
86cb7727 |
1206 | GAsyncResult *res, |
1207 | GError **error) |
1208 | { |
1209 | GVariant *_ret; |
1210 | _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); |
1211 | if (_ret == NULL) |
1212 | goto _out; |
1213 | g_variant_get (_ret, |
1214 | "()"); |
1215 | g_variant_unref (_ret); |
1216 | _out: |
1217 | return _ret != NULL; |
1218 | } |
1219 | |
1220 | /** |
ae3d717a |
1221 | * localed_locale1_call_set_x11_keyboard_sync: |
1222 | * @proxy: A #localedLocale1Proxy. |
1223 | * @arg_unnamed_arg0: Argument to pass with the method invocation. |
1224 | * @arg_unnamed_arg1: Argument to pass with the method invocation. |
1225 | * @arg_unnamed_arg2: Argument to pass with the method invocation. |
1226 | * @arg_unnamed_arg3: Argument to pass with the method invocation. |
1227 | * @arg_unnamed_arg4: Argument to pass with the method invocation. |
1228 | * @arg_unnamed_arg5: Argument to pass with the method invocation. |
86cb7727 |
1229 | * @cancellable: (allow-none): A #GCancellable or %NULL. |
1230 | * @error: Return location for error or %NULL. |
1231 | * |
1232 | * 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. |
1233 | * |
ae3d717a |
1234 | * See localed_locale1_call_set_x11_keyboard() for the asynchronous version of this method. |
86cb7727 |
1235 | * |
1236 | * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. |
1237 | */ |
1238 | gboolean |
ae3d717a |
1239 | localed_locale1_call_set_x11_keyboard_sync ( |
1240 | localedLocale1 *proxy, |
1241 | const gchar *arg_unnamed_arg0, |
1242 | const gchar *arg_unnamed_arg1, |
1243 | const gchar *arg_unnamed_arg2, |
1244 | const gchar *arg_unnamed_arg3, |
1245 | gboolean arg_unnamed_arg4, |
1246 | gboolean arg_unnamed_arg5, |
86cb7727 |
1247 | GCancellable *cancellable, |
1248 | GError **error) |
1249 | { |
1250 | GVariant *_ret; |
1251 | _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), |
1252 | "SetX11Keyboard", |
1253 | g_variant_new ("(ssssbb)", |
ae3d717a |
1254 | arg_unnamed_arg0, |
1255 | arg_unnamed_arg1, |
1256 | arg_unnamed_arg2, |
1257 | arg_unnamed_arg3, |
1258 | arg_unnamed_arg4, |
1259 | arg_unnamed_arg5), |
86cb7727 |
1260 | G_DBUS_CALL_FLAGS_NONE, |
1261 | -1, |
1262 | cancellable, |
1263 | error); |
1264 | if (_ret == NULL) |
1265 | goto _out; |
1266 | g_variant_get (_ret, |
1267 | "()"); |
1268 | g_variant_unref (_ret); |
1269 | _out: |
1270 | return _ret != NULL; |
1271 | } |
1272 | |
1273 | /** |
ae3d717a |
1274 | * localed_locale1_complete_set_locale: |
1275 | * @object: A #localedLocale1. |
86cb7727 |
1276 | * @invocation: (transfer full): A #GDBusMethodInvocation. |
1277 | * |
1278 | * 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. |
1279 | * |
1280 | * This method will free @invocation, you cannot use it afterwards. |
1281 | */ |
1282 | void |
ae3d717a |
1283 | localed_locale1_complete_set_locale ( |
1284 | localedLocale1 *object, |
86cb7727 |
1285 | GDBusMethodInvocation *invocation) |
1286 | { |
1287 | g_dbus_method_invocation_return_value (invocation, |
1288 | g_variant_new ("()")); |
1289 | } |
1290 | |
1291 | /** |
ae3d717a |
1292 | * localed_locale1_complete_set_vconsole_keyboard: |
1293 | * @object: A #localedLocale1. |
86cb7727 |
1294 | * @invocation: (transfer full): A #GDBusMethodInvocation. |
1295 | * |
1296 | * 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. |
1297 | * |
1298 | * This method will free @invocation, you cannot use it afterwards. |
1299 | */ |
1300 | void |
ae3d717a |
1301 | localed_locale1_complete_set_vconsole_keyboard ( |
1302 | localedLocale1 *object, |
86cb7727 |
1303 | GDBusMethodInvocation *invocation) |
1304 | { |
1305 | g_dbus_method_invocation_return_value (invocation, |
1306 | g_variant_new ("()")); |
1307 | } |
1308 | |
1309 | /** |
ae3d717a |
1310 | * localed_locale1_complete_set_x11_keyboard: |
1311 | * @object: A #localedLocale1. |
86cb7727 |
1312 | * @invocation: (transfer full): A #GDBusMethodInvocation. |
1313 | * |
1314 | * 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. |
1315 | * |
1316 | * This method will free @invocation, you cannot use it afterwards. |
1317 | */ |
1318 | void |
ae3d717a |
1319 | localed_locale1_complete_set_x11_keyboard ( |
1320 | localedLocale1 *object, |
86cb7727 |
1321 | GDBusMethodInvocation *invocation) |
1322 | { |
1323 | g_dbus_method_invocation_return_value (invocation, |
1324 | g_variant_new ("()")); |
1325 | } |
1326 | |
1327 | /* ------------------------------------------------------------------------ */ |
1328 | |
1329 | /** |
ae3d717a |
1330 | * localedLocale1Proxy: |
86cb7727 |
1331 | * |
ae3d717a |
1332 | * The #localedLocale1Proxy structure contains only private data and should only be accessed using the provided API. |
86cb7727 |
1333 | */ |
1334 | |
1335 | /** |
ae3d717a |
1336 | * localedLocale1ProxyClass: |
86cb7727 |
1337 | * @parent_class: The parent class. |
1338 | * |
ae3d717a |
1339 | * Class structure for #localedLocale1Proxy. |
86cb7727 |
1340 | */ |
1341 | |
ae3d717a |
1342 | struct _localedLocale1ProxyPrivate |
86cb7727 |
1343 | { |
1344 | GData *qdata; |
1345 | }; |
1346 | |
ae3d717a |
1347 | static void localed_locale1_proxy_iface_init (localedLocale1Iface *iface); |
86cb7727 |
1348 | |
1349 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
ae3d717a |
1350 | G_DEFINE_TYPE_WITH_CODE (localedLocale1Proxy, localed_locale1_proxy, G_TYPE_DBUS_PROXY, |
1351 | G_ADD_PRIVATE (localedLocale1Proxy) |
1352 | G_IMPLEMENT_INTERFACE (LOCALED_TYPE_LOCALE1, localed_locale1_proxy_iface_init)); |
86cb7727 |
1353 | |
1354 | #else |
ae3d717a |
1355 | G_DEFINE_TYPE_WITH_CODE (localedLocale1Proxy, localed_locale1_proxy, G_TYPE_DBUS_PROXY, |
1356 | G_IMPLEMENT_INTERFACE (LOCALED_TYPE_LOCALE1, localed_locale1_proxy_iface_init)); |
86cb7727 |
1357 | |
1358 | #endif |
1359 | static void |
ae3d717a |
1360 | localed_locale1_proxy_finalize (GObject *object) |
86cb7727 |
1361 | { |
ae3d717a |
1362 | localedLocale1Proxy *proxy = LOCALED_LOCALE1_PROXY (object); |
86cb7727 |
1363 | g_datalist_clear (&proxy->priv->qdata); |
ae3d717a |
1364 | G_OBJECT_CLASS (localed_locale1_proxy_parent_class)->finalize (object); |
86cb7727 |
1365 | } |
1366 | |
1367 | static void |
ae3d717a |
1368 | localed_locale1_proxy_get_property (GObject *object, |
86cb7727 |
1369 | guint prop_id, |
1370 | GValue *value, |
1371 | GParamSpec *pspec G_GNUC_UNUSED) |
1372 | { |
1373 | const _ExtendedGDBusPropertyInfo *info; |
1374 | GVariant *variant; |
1375 | g_assert (prop_id != 0 && prop_id - 1 < 7); |
ae3d717a |
1376 | info = _localed_locale1_property_info_pointers[prop_id - 1]; |
86cb7727 |
1377 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); |
1378 | if (info->use_gvariant) |
1379 | { |
1380 | g_value_set_variant (value, variant); |
1381 | } |
1382 | else |
1383 | { |
1384 | if (variant != NULL) |
1385 | g_dbus_gvariant_to_gvalue (variant, value); |
1386 | } |
1387 | if (variant != NULL) |
1388 | g_variant_unref (variant); |
1389 | } |
1390 | |
1391 | static void |
ae3d717a |
1392 | localed_locale1_proxy_set_property_cb (GDBusProxy *proxy, |
86cb7727 |
1393 | GAsyncResult *res, |
1394 | gpointer user_data) |
1395 | { |
1396 | const _ExtendedGDBusPropertyInfo *info = user_data; |
1397 | GError *error; |
1398 | GVariant *_ret; |
1399 | error = NULL; |
1400 | _ret = g_dbus_proxy_call_finish (proxy, res, &error); |
1401 | if (!_ret) |
1402 | { |
1403 | g_warning ("Error setting property '%s' on interface org.freedesktop.locale1: %s (%s, %d)", |
1404 | info->parent_struct.name, |
1405 | error->message, g_quark_to_string (error->domain), error->code); |
1406 | g_error_free (error); |
1407 | } |
1408 | else |
1409 | { |
1410 | g_variant_unref (_ret); |
1411 | } |
1412 | } |
1413 | |
1414 | static void |
ae3d717a |
1415 | localed_locale1_proxy_set_property (GObject *object, |
86cb7727 |
1416 | guint prop_id, |
1417 | const GValue *value, |
1418 | GParamSpec *pspec G_GNUC_UNUSED) |
1419 | { |
1420 | const _ExtendedGDBusPropertyInfo *info; |
1421 | GVariant *variant; |
1422 | g_assert (prop_id != 0 && prop_id - 1 < 7); |
ae3d717a |
1423 | info = _localed_locale1_property_info_pointers[prop_id - 1]; |
86cb7727 |
1424 | variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); |
1425 | g_dbus_proxy_call (G_DBUS_PROXY (object), |
1426 | "org.freedesktop.DBus.Properties.Set", |
1427 | g_variant_new ("(ssv)", "org.freedesktop.locale1", info->parent_struct.name, variant), |
1428 | G_DBUS_CALL_FLAGS_NONE, |
1429 | -1, |
ae3d717a |
1430 | NULL, (GAsyncReadyCallback) localed_locale1_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); |
86cb7727 |
1431 | g_variant_unref (variant); |
1432 | } |
1433 | |
1434 | static void |
ae3d717a |
1435 | localed_locale1_proxy_g_signal (GDBusProxy *proxy, |
86cb7727 |
1436 | const gchar *sender_name G_GNUC_UNUSED, |
1437 | const gchar *signal_name, |
1438 | GVariant *parameters) |
1439 | { |
1440 | _ExtendedGDBusSignalInfo *info; |
1441 | GVariantIter iter; |
1442 | GVariant *child; |
1443 | GValue *paramv; |
1444 | guint num_params; |
1445 | guint n; |
1446 | guint signal_id; |
ae3d717a |
1447 | info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_localed_locale1_interface_info.parent_struct, signal_name); |
86cb7727 |
1448 | if (info == NULL) |
1449 | return; |
1450 | num_params = g_variant_n_children (parameters); |
1451 | paramv = g_new0 (GValue, num_params + 1); |
ae3d717a |
1452 | g_value_init (¶mv[0], LOCALED_TYPE_LOCALE1); |
86cb7727 |
1453 | g_value_set_object (¶mv[0], proxy); |
1454 | g_variant_iter_init (&iter, parameters); |
1455 | n = 1; |
1456 | while ((child = g_variant_iter_next_value (&iter)) != NULL) |
1457 | { |
1458 | _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; |
1459 | if (arg_info->use_gvariant) |
1460 | { |
1461 | g_value_init (¶mv[n], G_TYPE_VARIANT); |
1462 | g_value_set_variant (¶mv[n], child); |
1463 | n++; |
1464 | } |
1465 | else |
1466 | g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); |
1467 | g_variant_unref (child); |
1468 | } |
ae3d717a |
1469 | signal_id = g_signal_lookup (info->signal_name, LOCALED_TYPE_LOCALE1); |
86cb7727 |
1470 | g_signal_emitv (paramv, signal_id, 0, NULL); |
1471 | for (n = 0; n < num_params + 1; n++) |
1472 | g_value_unset (¶mv[n]); |
1473 | g_free (paramv); |
1474 | } |
1475 | |
1476 | static void |
ae3d717a |
1477 | localed_locale1_proxy_g_properties_changed (GDBusProxy *_proxy, |
86cb7727 |
1478 | GVariant *changed_properties, |
1479 | const gchar *const *invalidated_properties) |
1480 | { |
ae3d717a |
1481 | localedLocale1Proxy *proxy = LOCALED_LOCALE1_PROXY (_proxy); |
86cb7727 |
1482 | guint n; |
1483 | const gchar *key; |
1484 | GVariantIter *iter; |
1485 | _ExtendedGDBusPropertyInfo *info; |
1486 | g_variant_get (changed_properties, "a{sv}", &iter); |
1487 | while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) |
1488 | { |
ae3d717a |
1489 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_localed_locale1_interface_info.parent_struct, key); |
86cb7727 |
1490 | g_datalist_remove_data (&proxy->priv->qdata, key); |
1491 | if (info != NULL) |
1492 | g_object_notify (G_OBJECT (proxy), info->hyphen_name); |
1493 | } |
1494 | g_variant_iter_free (iter); |
1495 | for (n = 0; invalidated_properties[n] != NULL; n++) |
1496 | { |
ae3d717a |
1497 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_localed_locale1_interface_info.parent_struct, invalidated_properties[n]); |
86cb7727 |
1498 | g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); |
1499 | if (info != NULL) |
1500 | g_object_notify (G_OBJECT (proxy), info->hyphen_name); |
1501 | } |
1502 | } |
1503 | |
1504 | static const gchar *const * |
ae3d717a |
1505 | localed_locale1_proxy_get_locale (localedLocale1 *object) |
86cb7727 |
1506 | { |
ae3d717a |
1507 | localedLocale1Proxy *proxy = LOCALED_LOCALE1_PROXY (object); |
86cb7727 |
1508 | GVariant *variant; |
1509 | const gchar *const *value = NULL; |
1510 | value = g_datalist_get_data (&proxy->priv->qdata, "Locale"); |
1511 | if (value != NULL) |
1512 | return value; |
1513 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Locale"); |
1514 | if (variant != NULL) |
1515 | { |
1516 | value = g_variant_get_strv (variant, NULL); |
1517 | g_datalist_set_data_full (&proxy->priv->qdata, "Locale", (gpointer) value, g_free); |
1518 | g_variant_unref (variant); |
1519 | } |
1520 | return value; |
1521 | } |
1522 | |
1523 | static const gchar * |
ae3d717a |
1524 | localed_locale1_proxy_get_x11_layout (localedLocale1 *object) |
86cb7727 |
1525 | { |
ae3d717a |
1526 | localedLocale1Proxy *proxy = LOCALED_LOCALE1_PROXY (object); |
86cb7727 |
1527 | GVariant *variant; |
1528 | const gchar *value = NULL; |
ae3d717a |
1529 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "X11Layout"); |
86cb7727 |
1530 | if (variant != NULL) |
1531 | { |
1532 | value = g_variant_get_string (variant, NULL); |
1533 | g_variant_unref (variant); |
1534 | } |
1535 | return value; |
1536 | } |
1537 | |
1538 | static const gchar * |
ae3d717a |
1539 | localed_locale1_proxy_get_x11_model (localedLocale1 *object) |
86cb7727 |
1540 | { |
ae3d717a |
1541 | localedLocale1Proxy *proxy = LOCALED_LOCALE1_PROXY (object); |
86cb7727 |
1542 | GVariant *variant; |
1543 | const gchar *value = NULL; |
ae3d717a |
1544 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "X11Model"); |
86cb7727 |
1545 | if (variant != NULL) |
1546 | { |
1547 | value = g_variant_get_string (variant, NULL); |
1548 | g_variant_unref (variant); |
1549 | } |
1550 | return value; |
1551 | } |
1552 | |
1553 | static const gchar * |
ae3d717a |
1554 | localed_locale1_proxy_get_x11_variant (localedLocale1 *object) |
86cb7727 |
1555 | { |
ae3d717a |
1556 | localedLocale1Proxy *proxy = LOCALED_LOCALE1_PROXY (object); |
86cb7727 |
1557 | GVariant *variant; |
1558 | const gchar *value = NULL; |
ae3d717a |
1559 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "X11Variant"); |
86cb7727 |
1560 | if (variant != NULL) |
1561 | { |
1562 | value = g_variant_get_string (variant, NULL); |
1563 | g_variant_unref (variant); |
1564 | } |
1565 | return value; |
1566 | } |
1567 | |
1568 | static const gchar * |
ae3d717a |
1569 | localed_locale1_proxy_get_x11_options (localedLocale1 *object) |
86cb7727 |
1570 | { |
ae3d717a |
1571 | localedLocale1Proxy *proxy = LOCALED_LOCALE1_PROXY (object); |
86cb7727 |
1572 | GVariant *variant; |
1573 | const gchar *value = NULL; |
ae3d717a |
1574 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "X11Options"); |
86cb7727 |
1575 | if (variant != NULL) |
1576 | { |
1577 | value = g_variant_get_string (variant, NULL); |
1578 | g_variant_unref (variant); |
1579 | } |
1580 | return value; |
1581 | } |
1582 | |
1583 | static const gchar * |
ae3d717a |
1584 | localed_locale1_proxy_get_vconsole_keymap (localedLocale1 *object) |
86cb7727 |
1585 | { |
ae3d717a |
1586 | localedLocale1Proxy *proxy = LOCALED_LOCALE1_PROXY (object); |
86cb7727 |
1587 | GVariant *variant; |
1588 | const gchar *value = NULL; |
ae3d717a |
1589 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "VConsoleKeymap"); |
86cb7727 |
1590 | if (variant != NULL) |
1591 | { |
1592 | value = g_variant_get_string (variant, NULL); |
1593 | g_variant_unref (variant); |
1594 | } |
1595 | return value; |
1596 | } |
1597 | |
1598 | static const gchar * |
ae3d717a |
1599 | localed_locale1_proxy_get_vconsole_keymap_toggle (localedLocale1 *object) |
86cb7727 |
1600 | { |
ae3d717a |
1601 | localedLocale1Proxy *proxy = LOCALED_LOCALE1_PROXY (object); |
86cb7727 |
1602 | GVariant *variant; |
1603 | const gchar *value = NULL; |
ae3d717a |
1604 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "VConsoleKeymapToggle"); |
86cb7727 |
1605 | if (variant != NULL) |
1606 | { |
1607 | value = g_variant_get_string (variant, NULL); |
1608 | g_variant_unref (variant); |
1609 | } |
1610 | return value; |
1611 | } |
1612 | |
1613 | static void |
ae3d717a |
1614 | localed_locale1_proxy_init (localedLocale1Proxy *proxy) |
86cb7727 |
1615 | { |
1616 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
ae3d717a |
1617 | proxy->priv = localed_locale1_proxy_get_instance_private (proxy); |
86cb7727 |
1618 | #else |
ae3d717a |
1619 | proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, LOCALED_TYPE_LOCALE1_PROXY, localedLocale1ProxyPrivate); |
86cb7727 |
1620 | #endif |
1621 | |
ae3d717a |
1622 | g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), localed_locale1_interface_info ()); |
86cb7727 |
1623 | } |
1624 | |
1625 | static void |
ae3d717a |
1626 | localed_locale1_proxy_class_init (localedLocale1ProxyClass *klass) |
86cb7727 |
1627 | { |
1628 | GObjectClass *gobject_class; |
1629 | GDBusProxyClass *proxy_class; |
1630 | |
1631 | gobject_class = G_OBJECT_CLASS (klass); |
ae3d717a |
1632 | gobject_class->finalize = localed_locale1_proxy_finalize; |
1633 | gobject_class->get_property = localed_locale1_proxy_get_property; |
1634 | gobject_class->set_property = localed_locale1_proxy_set_property; |
86cb7727 |
1635 | |
1636 | proxy_class = G_DBUS_PROXY_CLASS (klass); |
ae3d717a |
1637 | proxy_class->g_signal = localed_locale1_proxy_g_signal; |
1638 | proxy_class->g_properties_changed = localed_locale1_proxy_g_properties_changed; |
86cb7727 |
1639 | |
ae3d717a |
1640 | localed_locale1_override_properties (gobject_class, 1); |
86cb7727 |
1641 | |
1642 | #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 |
ae3d717a |
1643 | g_type_class_add_private (klass, sizeof (localedLocale1ProxyPrivate)); |
86cb7727 |
1644 | #endif |
1645 | } |
1646 | |
1647 | static void |
ae3d717a |
1648 | localed_locale1_proxy_iface_init (localedLocale1Iface *iface) |
86cb7727 |
1649 | { |
ae3d717a |
1650 | iface->get_locale = localed_locale1_proxy_get_locale; |
1651 | iface->get_x11_layout = localed_locale1_proxy_get_x11_layout; |
1652 | iface->get_x11_model = localed_locale1_proxy_get_x11_model; |
1653 | iface->get_x11_variant = localed_locale1_proxy_get_x11_variant; |
1654 | iface->get_x11_options = localed_locale1_proxy_get_x11_options; |
1655 | iface->get_vconsole_keymap = localed_locale1_proxy_get_vconsole_keymap; |
1656 | iface->get_vconsole_keymap_toggle = localed_locale1_proxy_get_vconsole_keymap_toggle; |
86cb7727 |
1657 | } |
1658 | |
1659 | /** |
ae3d717a |
1660 | * localed_locale1_proxy_new: |
86cb7727 |
1661 | * @connection: A #GDBusConnection. |
1662 | * @flags: Flags from the #GDBusProxyFlags enumeration. |
1663 | * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. |
1664 | * @object_path: An object path. |
1665 | * @cancellable: (allow-none): A #GCancellable or %NULL. |
1666 | * @callback: A #GAsyncReadyCallback to call when the request is satisfied. |
1667 | * @user_data: User data to pass to @callback. |
1668 | * |
1669 | * 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. |
1670 | * |
1671 | * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. |
ae3d717a |
1672 | * You can then call localed_locale1_proxy_new_finish() to get the result of the operation. |
86cb7727 |
1673 | * |
ae3d717a |
1674 | * See localed_locale1_proxy_new_sync() for the synchronous, blocking version of this constructor. |
86cb7727 |
1675 | */ |
1676 | void |
ae3d717a |
1677 | localed_locale1_proxy_new ( |
86cb7727 |
1678 | GDBusConnection *connection, |
1679 | GDBusProxyFlags flags, |
1680 | const gchar *name, |
1681 | const gchar *object_path, |
1682 | GCancellable *cancellable, |
1683 | GAsyncReadyCallback callback, |
1684 | gpointer user_data) |
1685 | { |
ae3d717a |
1686 | g_async_initable_new_async (LOCALED_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); |
86cb7727 |
1687 | } |
1688 | |
1689 | /** |
ae3d717a |
1690 | * localed_locale1_proxy_new_finish: |
1691 | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to localed_locale1_proxy_new(). |
86cb7727 |
1692 | * @error: Return location for error or %NULL |
1693 | * |
ae3d717a |
1694 | * Finishes an operation started with localed_locale1_proxy_new(). |
86cb7727 |
1695 | * |
ae3d717a |
1696 | * Returns: (transfer full) (type localedLocale1Proxy): The constructed proxy object or %NULL if @error is set. |
86cb7727 |
1697 | */ |
ae3d717a |
1698 | localedLocale1 * |
1699 | localed_locale1_proxy_new_finish ( |
86cb7727 |
1700 | GAsyncResult *res, |
1701 | GError **error) |
1702 | { |
1703 | GObject *ret; |
1704 | GObject *source_object; |
1705 | source_object = g_async_result_get_source_object (res); |
1706 | ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); |
1707 | g_object_unref (source_object); |
1708 | if (ret != NULL) |
ae3d717a |
1709 | return LOCALED_LOCALE1 (ret); |
86cb7727 |
1710 | else |
1711 | return NULL; |
1712 | } |
1713 | |
1714 | /** |
ae3d717a |
1715 | * localed_locale1_proxy_new_sync: |
86cb7727 |
1716 | * @connection: A #GDBusConnection. |
1717 | * @flags: Flags from the #GDBusProxyFlags enumeration. |
1718 | * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. |
1719 | * @object_path: An object path. |
1720 | * @cancellable: (allow-none): A #GCancellable or %NULL. |
1721 | * @error: Return location for error or %NULL |
1722 | * |
1723 | * 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. |
1724 | * |
1725 | * The calling thread is blocked until a reply is received. |
1726 | * |
ae3d717a |
1727 | * See localed_locale1_proxy_new() for the asynchronous version of this constructor. |
86cb7727 |
1728 | * |
ae3d717a |
1729 | * Returns: (transfer full) (type localedLocale1Proxy): The constructed proxy object or %NULL if @error is set. |
86cb7727 |
1730 | */ |
ae3d717a |
1731 | localedLocale1 * |
1732 | localed_locale1_proxy_new_sync ( |
86cb7727 |
1733 | GDBusConnection *connection, |
1734 | GDBusProxyFlags flags, |
1735 | const gchar *name, |
1736 | const gchar *object_path, |
1737 | GCancellable *cancellable, |
1738 | GError **error) |
1739 | { |
1740 | GInitable *ret; |
ae3d717a |
1741 | ret = g_initable_new (LOCALED_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); |
86cb7727 |
1742 | if (ret != NULL) |
ae3d717a |
1743 | return LOCALED_LOCALE1 (ret); |
86cb7727 |
1744 | else |
1745 | return NULL; |
1746 | } |
1747 | |
1748 | |
1749 | /** |
ae3d717a |
1750 | * localed_locale1_proxy_new_for_bus: |
86cb7727 |
1751 | * @bus_type: A #GBusType. |
1752 | * @flags: Flags from the #GDBusProxyFlags enumeration. |
1753 | * @name: A bus name (well-known or unique). |
1754 | * @object_path: An object path. |
1755 | * @cancellable: (allow-none): A #GCancellable or %NULL. |
1756 | * @callback: A #GAsyncReadyCallback to call when the request is satisfied. |
1757 | * @user_data: User data to pass to @callback. |
1758 | * |
ae3d717a |
1759 | * Like localed_locale1_proxy_new() but takes a #GBusType instead of a #GDBusConnection. |
86cb7727 |
1760 | * |
1761 | * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. |
ae3d717a |
1762 | * You can then call localed_locale1_proxy_new_for_bus_finish() to get the result of the operation. |
86cb7727 |
1763 | * |
ae3d717a |
1764 | * See localed_locale1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. |
86cb7727 |
1765 | */ |
1766 | void |
ae3d717a |
1767 | localed_locale1_proxy_new_for_bus ( |
86cb7727 |
1768 | GBusType bus_type, |
1769 | GDBusProxyFlags flags, |
1770 | const gchar *name, |
1771 | const gchar *object_path, |
1772 | GCancellable *cancellable, |
1773 | GAsyncReadyCallback callback, |
1774 | gpointer user_data) |
1775 | { |
ae3d717a |
1776 | g_async_initable_new_async (LOCALED_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); |
86cb7727 |
1777 | } |
1778 | |
1779 | /** |
ae3d717a |
1780 | * localed_locale1_proxy_new_for_bus_finish: |
1781 | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to localed_locale1_proxy_new_for_bus(). |
86cb7727 |
1782 | * @error: Return location for error or %NULL |
1783 | * |
ae3d717a |
1784 | * Finishes an operation started with localed_locale1_proxy_new_for_bus(). |
86cb7727 |
1785 | * |
ae3d717a |
1786 | * Returns: (transfer full) (type localedLocale1Proxy): The constructed proxy object or %NULL if @error is set. |
86cb7727 |
1787 | */ |
ae3d717a |
1788 | localedLocale1 * |
1789 | localed_locale1_proxy_new_for_bus_finish ( |
86cb7727 |
1790 | GAsyncResult *res, |
1791 | GError **error) |
1792 | { |
1793 | GObject *ret; |
1794 | GObject *source_object; |
1795 | source_object = g_async_result_get_source_object (res); |
1796 | ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); |
1797 | g_object_unref (source_object); |
1798 | if (ret != NULL) |
ae3d717a |
1799 | return LOCALED_LOCALE1 (ret); |
86cb7727 |
1800 | else |
1801 | return NULL; |
1802 | } |
1803 | |
1804 | /** |
ae3d717a |
1805 | * localed_locale1_proxy_new_for_bus_sync: |
86cb7727 |
1806 | * @bus_type: A #GBusType. |
1807 | * @flags: Flags from the #GDBusProxyFlags enumeration. |
1808 | * @name: A bus name (well-known or unique). |
1809 | * @object_path: An object path. |
1810 | * @cancellable: (allow-none): A #GCancellable or %NULL. |
1811 | * @error: Return location for error or %NULL |
1812 | * |
ae3d717a |
1813 | * Like localed_locale1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. |
86cb7727 |
1814 | * |
1815 | * The calling thread is blocked until a reply is received. |
1816 | * |
ae3d717a |
1817 | * See localed_locale1_proxy_new_for_bus() for the asynchronous version of this constructor. |
86cb7727 |
1818 | * |
ae3d717a |
1819 | * Returns: (transfer full) (type localedLocale1Proxy): The constructed proxy object or %NULL if @error is set. |
86cb7727 |
1820 | */ |
ae3d717a |
1821 | localedLocale1 * |
1822 | localed_locale1_proxy_new_for_bus_sync ( |
86cb7727 |
1823 | GBusType bus_type, |
1824 | GDBusProxyFlags flags, |
1825 | const gchar *name, |
1826 | const gchar *object_path, |
1827 | GCancellable *cancellable, |
1828 | GError **error) |
1829 | { |
1830 | GInitable *ret; |
ae3d717a |
1831 | ret = g_initable_new (LOCALED_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); |
86cb7727 |
1832 | if (ret != NULL) |
ae3d717a |
1833 | return LOCALED_LOCALE1 (ret); |
86cb7727 |
1834 | else |
1835 | return NULL; |
1836 | } |
1837 | |
1838 | |
1839 | /* ------------------------------------------------------------------------ */ |
1840 | |
1841 | /** |
ae3d717a |
1842 | * localedLocale1Skeleton: |
86cb7727 |
1843 | * |
ae3d717a |
1844 | * The #localedLocale1Skeleton structure contains only private data and should only be accessed using the provided API. |
86cb7727 |
1845 | */ |
1846 | |
1847 | /** |
ae3d717a |
1848 | * localedLocale1SkeletonClass: |
86cb7727 |
1849 | * @parent_class: The parent class. |
1850 | * |
ae3d717a |
1851 | * Class structure for #localedLocale1Skeleton. |
86cb7727 |
1852 | */ |
1853 | |
ae3d717a |
1854 | struct _localedLocale1SkeletonPrivate |
86cb7727 |
1855 | { |
1856 | GValue *properties; |
1857 | GList *changed_properties; |
1858 | GSource *changed_properties_idle_source; |
1859 | GMainContext *context; |
1860 | GMutex lock; |
1861 | }; |
1862 | |
1863 | static void |
ae3d717a |
1864 | _localed_locale1_skeleton_handle_method_call ( |
86cb7727 |
1865 | GDBusConnection *connection G_GNUC_UNUSED, |
1866 | const gchar *sender G_GNUC_UNUSED, |
1867 | const gchar *object_path G_GNUC_UNUSED, |
1868 | const gchar *interface_name, |
1869 | const gchar *method_name, |
1870 | GVariant *parameters, |
1871 | GDBusMethodInvocation *invocation, |
1872 | gpointer user_data) |
1873 | { |
ae3d717a |
1874 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (user_data); |
86cb7727 |
1875 | _ExtendedGDBusMethodInfo *info; |
1876 | GVariantIter iter; |
1877 | GVariant *child; |
1878 | GValue *paramv; |
1879 | guint num_params; |
1880 | guint num_extra; |
1881 | guint n; |
1882 | guint signal_id; |
1883 | GValue return_value = G_VALUE_INIT; |
1884 | info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); |
1885 | g_assert (info != NULL); |
1886 | num_params = g_variant_n_children (parameters); |
1887 | num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); |
1888 | n = 0; |
ae3d717a |
1889 | g_value_init (¶mv[n], LOCALED_TYPE_LOCALE1); |
86cb7727 |
1890 | g_value_set_object (¶mv[n++], skeleton); |
1891 | g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); |
1892 | g_value_set_object (¶mv[n++], invocation); |
1893 | if (info->pass_fdlist) |
1894 | { |
1895 | #ifdef G_OS_UNIX |
1896 | g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); |
1897 | g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); |
1898 | #else |
1899 | g_assert_not_reached (); |
1900 | #endif |
1901 | } |
1902 | g_variant_iter_init (&iter, parameters); |
1903 | while ((child = g_variant_iter_next_value (&iter)) != NULL) |
1904 | { |
1905 | _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; |
1906 | if (arg_info->use_gvariant) |
1907 | { |
1908 | g_value_init (¶mv[n], G_TYPE_VARIANT); |
1909 | g_value_set_variant (¶mv[n], child); |
1910 | n++; |
1911 | } |
1912 | else |
1913 | g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); |
1914 | g_variant_unref (child); |
1915 | } |
ae3d717a |
1916 | signal_id = g_signal_lookup (info->signal_name, LOCALED_TYPE_LOCALE1); |
86cb7727 |
1917 | g_value_init (&return_value, G_TYPE_BOOLEAN); |
1918 | g_signal_emitv (paramv, signal_id, 0, &return_value); |
1919 | if (!g_value_get_boolean (&return_value)) |
1920 | 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); |
1921 | g_value_unset (&return_value); |
1922 | for (n = 0; n < num_params + num_extra; n++) |
1923 | g_value_unset (¶mv[n]); |
1924 | g_free (paramv); |
1925 | } |
1926 | |
1927 | static GVariant * |
ae3d717a |
1928 | _localed_locale1_skeleton_handle_get_property ( |
86cb7727 |
1929 | GDBusConnection *connection G_GNUC_UNUSED, |
1930 | const gchar *sender G_GNUC_UNUSED, |
1931 | const gchar *object_path G_GNUC_UNUSED, |
1932 | const gchar *interface_name G_GNUC_UNUSED, |
1933 | const gchar *property_name, |
1934 | GError **error, |
1935 | gpointer user_data) |
1936 | { |
ae3d717a |
1937 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (user_data); |
86cb7727 |
1938 | GValue value = G_VALUE_INIT; |
1939 | GParamSpec *pspec; |
1940 | _ExtendedGDBusPropertyInfo *info; |
1941 | GVariant *ret; |
1942 | ret = NULL; |
ae3d717a |
1943 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_localed_locale1_interface_info.parent_struct, property_name); |
86cb7727 |
1944 | g_assert (info != NULL); |
1945 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); |
1946 | if (pspec == NULL) |
1947 | { |
1948 | g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); |
1949 | } |
1950 | else |
1951 | { |
1952 | g_value_init (&value, pspec->value_type); |
1953 | g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); |
1954 | ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); |
1955 | g_value_unset (&value); |
1956 | } |
1957 | return ret; |
1958 | } |
1959 | |
1960 | static gboolean |
ae3d717a |
1961 | _localed_locale1_skeleton_handle_set_property ( |
86cb7727 |
1962 | GDBusConnection *connection G_GNUC_UNUSED, |
1963 | const gchar *sender G_GNUC_UNUSED, |
1964 | const gchar *object_path G_GNUC_UNUSED, |
1965 | const gchar *interface_name G_GNUC_UNUSED, |
1966 | const gchar *property_name, |
1967 | GVariant *variant, |
1968 | GError **error, |
1969 | gpointer user_data) |
1970 | { |
ae3d717a |
1971 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (user_data); |
86cb7727 |
1972 | GValue value = G_VALUE_INIT; |
1973 | GParamSpec *pspec; |
1974 | _ExtendedGDBusPropertyInfo *info; |
1975 | gboolean ret; |
1976 | ret = FALSE; |
ae3d717a |
1977 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_localed_locale1_interface_info.parent_struct, property_name); |
86cb7727 |
1978 | g_assert (info != NULL); |
1979 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); |
1980 | if (pspec == NULL) |
1981 | { |
1982 | g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); |
1983 | } |
1984 | else |
1985 | { |
1986 | if (info->use_gvariant) |
1987 | g_value_set_variant (&value, variant); |
1988 | else |
1989 | g_dbus_gvariant_to_gvalue (variant, &value); |
1990 | g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); |
1991 | g_value_unset (&value); |
1992 | ret = TRUE; |
1993 | } |
1994 | return ret; |
1995 | } |
1996 | |
ae3d717a |
1997 | static const GDBusInterfaceVTable _localed_locale1_skeleton_vtable = |
86cb7727 |
1998 | { |
ae3d717a |
1999 | _localed_locale1_skeleton_handle_method_call, |
2000 | _localed_locale1_skeleton_handle_get_property, |
2001 | _localed_locale1_skeleton_handle_set_property, |
86cb7727 |
2002 | {NULL} |
2003 | }; |
2004 | |
2005 | static GDBusInterfaceInfo * |
ae3d717a |
2006 | localed_locale1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) |
86cb7727 |
2007 | { |
ae3d717a |
2008 | return localed_locale1_interface_info (); |
86cb7727 |
2009 | } |
2010 | |
2011 | static GDBusInterfaceVTable * |
ae3d717a |
2012 | localed_locale1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) |
86cb7727 |
2013 | { |
ae3d717a |
2014 | return (GDBusInterfaceVTable *) &_localed_locale1_skeleton_vtable; |
86cb7727 |
2015 | } |
2016 | |
2017 | static GVariant * |
ae3d717a |
2018 | localed_locale1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) |
86cb7727 |
2019 | { |
ae3d717a |
2020 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (_skeleton); |
86cb7727 |
2021 | |
2022 | GVariantBuilder builder; |
2023 | guint n; |
2024 | g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); |
ae3d717a |
2025 | if (_localed_locale1_interface_info.parent_struct.properties == NULL) |
86cb7727 |
2026 | goto out; |
ae3d717a |
2027 | for (n = 0; _localed_locale1_interface_info.parent_struct.properties[n] != NULL; n++) |
86cb7727 |
2028 | { |
ae3d717a |
2029 | GDBusPropertyInfo *info = _localed_locale1_interface_info.parent_struct.properties[n]; |
86cb7727 |
2030 | if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) |
2031 | { |
2032 | GVariant *value; |
ae3d717a |
2033 | value = _localed_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); |
86cb7727 |
2034 | if (value != NULL) |
2035 | { |
2036 | g_variant_take_ref (value); |
2037 | g_variant_builder_add (&builder, "{sv}", info->name, value); |
2038 | g_variant_unref (value); |
2039 | } |
2040 | } |
2041 | } |
2042 | out: |
2043 | return g_variant_builder_end (&builder); |
2044 | } |
2045 | |
ae3d717a |
2046 | static gboolean _localed_locale1_emit_changed (gpointer user_data); |
86cb7727 |
2047 | |
2048 | static void |
ae3d717a |
2049 | localed_locale1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) |
86cb7727 |
2050 | { |
ae3d717a |
2051 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (_skeleton); |
86cb7727 |
2052 | gboolean emit_changed = FALSE; |
2053 | |
2054 | g_mutex_lock (&skeleton->priv->lock); |
2055 | if (skeleton->priv->changed_properties_idle_source != NULL) |
2056 | { |
2057 | g_source_destroy (skeleton->priv->changed_properties_idle_source); |
2058 | skeleton->priv->changed_properties_idle_source = NULL; |
2059 | emit_changed = TRUE; |
2060 | } |
2061 | g_mutex_unlock (&skeleton->priv->lock); |
2062 | |
2063 | if (emit_changed) |
ae3d717a |
2064 | _localed_locale1_emit_changed (skeleton); |
86cb7727 |
2065 | } |
2066 | |
ae3d717a |
2067 | static void localed_locale1_skeleton_iface_init (localedLocale1Iface *iface); |
86cb7727 |
2068 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
ae3d717a |
2069 | G_DEFINE_TYPE_WITH_CODE (localedLocale1Skeleton, localed_locale1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, |
2070 | G_ADD_PRIVATE (localedLocale1Skeleton) |
2071 | G_IMPLEMENT_INTERFACE (LOCALED_TYPE_LOCALE1, localed_locale1_skeleton_iface_init)); |
86cb7727 |
2072 | |
2073 | #else |
ae3d717a |
2074 | G_DEFINE_TYPE_WITH_CODE (localedLocale1Skeleton, localed_locale1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, |
2075 | G_IMPLEMENT_INTERFACE (LOCALED_TYPE_LOCALE1, localed_locale1_skeleton_iface_init)); |
86cb7727 |
2076 | |
2077 | #endif |
2078 | static void |
ae3d717a |
2079 | localed_locale1_skeleton_finalize (GObject *object) |
86cb7727 |
2080 | { |
ae3d717a |
2081 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (object); |
86cb7727 |
2082 | guint n; |
2083 | for (n = 0; n < 7; n++) |
2084 | g_value_unset (&skeleton->priv->properties[n]); |
2085 | g_free (skeleton->priv->properties); |
2086 | g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); |
2087 | if (skeleton->priv->changed_properties_idle_source != NULL) |
2088 | g_source_destroy (skeleton->priv->changed_properties_idle_source); |
2089 | g_main_context_unref (skeleton->priv->context); |
2090 | g_mutex_clear (&skeleton->priv->lock); |
ae3d717a |
2091 | G_OBJECT_CLASS (localed_locale1_skeleton_parent_class)->finalize (object); |
86cb7727 |
2092 | } |
2093 | |
2094 | static void |
ae3d717a |
2095 | localed_locale1_skeleton_get_property (GObject *object, |
86cb7727 |
2096 | guint prop_id, |
2097 | GValue *value, |
2098 | GParamSpec *pspec G_GNUC_UNUSED) |
2099 | { |
ae3d717a |
2100 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (object); |
86cb7727 |
2101 | g_assert (prop_id != 0 && prop_id - 1 < 7); |
2102 | g_mutex_lock (&skeleton->priv->lock); |
2103 | g_value_copy (&skeleton->priv->properties[prop_id - 1], value); |
2104 | g_mutex_unlock (&skeleton->priv->lock); |
2105 | } |
2106 | |
2107 | static gboolean |
ae3d717a |
2108 | _localed_locale1_emit_changed (gpointer user_data) |
86cb7727 |
2109 | { |
ae3d717a |
2110 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (user_data); |
86cb7727 |
2111 | GList *l; |
2112 | GVariantBuilder builder; |
2113 | GVariantBuilder invalidated_builder; |
2114 | guint num_changes; |
2115 | |
2116 | g_mutex_lock (&skeleton->priv->lock); |
2117 | g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); |
2118 | g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); |
2119 | for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) |
2120 | { |
2121 | ChangedProperty *cp = l->data; |
2122 | GVariant *variant; |
2123 | const GValue *cur_value; |
2124 | |
2125 | cur_value = &skeleton->priv->properties[cp->prop_id - 1]; |
2126 | if (!_g_value_equal (cur_value, &cp->orig_value)) |
2127 | { |
2128 | variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); |
2129 | g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); |
2130 | g_variant_unref (variant); |
2131 | num_changes++; |
2132 | } |
2133 | } |
2134 | if (num_changes > 0) |
2135 | { |
2136 | GList *connections, *ll; |
2137 | GVariant *signal_variant; |
2138 | signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.locale1", |
2139 | &builder, &invalidated_builder)); |
2140 | connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); |
2141 | for (ll = connections; ll != NULL; ll = ll->next) |
2142 | { |
2143 | GDBusConnection *connection = ll->data; |
2144 | |
2145 | g_dbus_connection_emit_signal (connection, |
2146 | NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), |
2147 | "org.freedesktop.DBus.Properties", |
2148 | "PropertiesChanged", |
2149 | signal_variant, |
2150 | NULL); |
2151 | } |
2152 | g_variant_unref (signal_variant); |
2153 | g_list_free_full (connections, g_object_unref); |
2154 | } |
2155 | else |
2156 | { |
2157 | g_variant_builder_clear (&builder); |
2158 | g_variant_builder_clear (&invalidated_builder); |
2159 | } |
2160 | g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); |
2161 | skeleton->priv->changed_properties = NULL; |
2162 | skeleton->priv->changed_properties_idle_source = NULL; |
2163 | g_mutex_unlock (&skeleton->priv->lock); |
2164 | return FALSE; |
2165 | } |
2166 | |
2167 | static void |
ae3d717a |
2168 | _localed_locale1_schedule_emit_changed (localedLocale1Skeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) |
86cb7727 |
2169 | { |
2170 | ChangedProperty *cp; |
2171 | GList *l; |
2172 | cp = NULL; |
2173 | for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) |
2174 | { |
2175 | ChangedProperty *i_cp = l->data; |
2176 | if (i_cp->info == info) |
2177 | { |
2178 | cp = i_cp; |
2179 | break; |
2180 | } |
2181 | } |
2182 | if (cp == NULL) |
2183 | { |
2184 | cp = g_new0 (ChangedProperty, 1); |
2185 | cp->prop_id = prop_id; |
2186 | cp->info = info; |
2187 | skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); |
2188 | g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); |
2189 | g_value_copy (orig_value, &cp->orig_value); |
2190 | } |
2191 | } |
2192 | |
2193 | static void |
ae3d717a |
2194 | localed_locale1_skeleton_notify (GObject *object, |
86cb7727 |
2195 | GParamSpec *pspec G_GNUC_UNUSED) |
2196 | { |
ae3d717a |
2197 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (object); |
86cb7727 |
2198 | g_mutex_lock (&skeleton->priv->lock); |
2199 | if (skeleton->priv->changed_properties != NULL && |
2200 | skeleton->priv->changed_properties_idle_source == NULL) |
2201 | { |
2202 | skeleton->priv->changed_properties_idle_source = g_idle_source_new (); |
2203 | g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); |
ae3d717a |
2204 | g_source_set_callback (skeleton->priv->changed_properties_idle_source, _localed_locale1_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); |
86cb7727 |
2205 | g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); |
2206 | g_source_unref (skeleton->priv->changed_properties_idle_source); |
2207 | } |
2208 | g_mutex_unlock (&skeleton->priv->lock); |
2209 | } |
2210 | |
2211 | static void |
ae3d717a |
2212 | localed_locale1_skeleton_set_property (GObject *object, |
86cb7727 |
2213 | guint prop_id, |
2214 | const GValue *value, |
2215 | GParamSpec *pspec) |
2216 | { |
ae3d717a |
2217 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (object); |
86cb7727 |
2218 | g_assert (prop_id != 0 && prop_id - 1 < 7); |
2219 | g_mutex_lock (&skeleton->priv->lock); |
2220 | g_object_freeze_notify (object); |
2221 | if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) |
2222 | { |
2223 | if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL) |
ae3d717a |
2224 | _localed_locale1_schedule_emit_changed (skeleton, _localed_locale1_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]); |
86cb7727 |
2225 | g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); |
2226 | g_object_notify_by_pspec (object, pspec); |
2227 | } |
2228 | g_mutex_unlock (&skeleton->priv->lock); |
2229 | g_object_thaw_notify (object); |
2230 | } |
2231 | |
2232 | static void |
ae3d717a |
2233 | localed_locale1_skeleton_init (localedLocale1Skeleton *skeleton) |
86cb7727 |
2234 | { |
2235 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
ae3d717a |
2236 | skeleton->priv = localed_locale1_skeleton_get_instance_private (skeleton); |
86cb7727 |
2237 | #else |
ae3d717a |
2238 | skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, LOCALED_TYPE_LOCALE1_SKELETON, localedLocale1SkeletonPrivate); |
86cb7727 |
2239 | #endif |
2240 | |
2241 | g_mutex_init (&skeleton->priv->lock); |
2242 | skeleton->priv->context = g_main_context_ref_thread_default (); |
2243 | skeleton->priv->properties = g_new0 (GValue, 7); |
2244 | g_value_init (&skeleton->priv->properties[0], G_TYPE_STRV); |
2245 | g_value_init (&skeleton->priv->properties[1], G_TYPE_STRING); |
2246 | g_value_init (&skeleton->priv->properties[2], G_TYPE_STRING); |
2247 | g_value_init (&skeleton->priv->properties[3], G_TYPE_STRING); |
2248 | g_value_init (&skeleton->priv->properties[4], G_TYPE_STRING); |
2249 | g_value_init (&skeleton->priv->properties[5], G_TYPE_STRING); |
2250 | g_value_init (&skeleton->priv->properties[6], G_TYPE_STRING); |
2251 | } |
2252 | |
2253 | static const gchar *const * |
ae3d717a |
2254 | localed_locale1_skeleton_get_locale (localedLocale1 *object) |
86cb7727 |
2255 | { |
ae3d717a |
2256 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (object); |
86cb7727 |
2257 | const gchar *const *value; |
2258 | g_mutex_lock (&skeleton->priv->lock); |
2259 | value = g_value_get_boxed (&(skeleton->priv->properties[0])); |
2260 | g_mutex_unlock (&skeleton->priv->lock); |
2261 | return value; |
2262 | } |
2263 | |
2264 | static const gchar * |
ae3d717a |
2265 | localed_locale1_skeleton_get_x11_layout (localedLocale1 *object) |
86cb7727 |
2266 | { |
ae3d717a |
2267 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (object); |
86cb7727 |
2268 | const gchar *value; |
2269 | g_mutex_lock (&skeleton->priv->lock); |
2270 | value = g_value_get_string (&(skeleton->priv->properties[1])); |
2271 | g_mutex_unlock (&skeleton->priv->lock); |
2272 | return value; |
2273 | } |
2274 | |
2275 | static const gchar * |
ae3d717a |
2276 | localed_locale1_skeleton_get_x11_model (localedLocale1 *object) |
86cb7727 |
2277 | { |
ae3d717a |
2278 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (object); |
86cb7727 |
2279 | const gchar *value; |
2280 | g_mutex_lock (&skeleton->priv->lock); |
2281 | value = g_value_get_string (&(skeleton->priv->properties[2])); |
2282 | g_mutex_unlock (&skeleton->priv->lock); |
2283 | return value; |
2284 | } |
2285 | |
2286 | static const gchar * |
ae3d717a |
2287 | localed_locale1_skeleton_get_x11_variant (localedLocale1 *object) |
86cb7727 |
2288 | { |
ae3d717a |
2289 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (object); |
86cb7727 |
2290 | const gchar *value; |
2291 | g_mutex_lock (&skeleton->priv->lock); |
2292 | value = g_value_get_string (&(skeleton->priv->properties[3])); |
2293 | g_mutex_unlock (&skeleton->priv->lock); |
2294 | return value; |
2295 | } |
2296 | |
2297 | static const gchar * |
ae3d717a |
2298 | localed_locale1_skeleton_get_x11_options (localedLocale1 *object) |
86cb7727 |
2299 | { |
ae3d717a |
2300 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (object); |
86cb7727 |
2301 | const gchar *value; |
2302 | g_mutex_lock (&skeleton->priv->lock); |
2303 | value = g_value_get_string (&(skeleton->priv->properties[4])); |
2304 | g_mutex_unlock (&skeleton->priv->lock); |
2305 | return value; |
2306 | } |
2307 | |
2308 | static const gchar * |
ae3d717a |
2309 | localed_locale1_skeleton_get_vconsole_keymap (localedLocale1 *object) |
86cb7727 |
2310 | { |
ae3d717a |
2311 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (object); |
86cb7727 |
2312 | const gchar *value; |
2313 | g_mutex_lock (&skeleton->priv->lock); |
2314 | value = g_value_get_string (&(skeleton->priv->properties[5])); |
2315 | g_mutex_unlock (&skeleton->priv->lock); |
2316 | return value; |
2317 | } |
2318 | |
2319 | static const gchar * |
ae3d717a |
2320 | localed_locale1_skeleton_get_vconsole_keymap_toggle (localedLocale1 *object) |
86cb7727 |
2321 | { |
ae3d717a |
2322 | localedLocale1Skeleton *skeleton = LOCALED_LOCALE1_SKELETON (object); |
86cb7727 |
2323 | const gchar *value; |
2324 | g_mutex_lock (&skeleton->priv->lock); |
2325 | value = g_value_get_string (&(skeleton->priv->properties[6])); |
2326 | g_mutex_unlock (&skeleton->priv->lock); |
2327 | return value; |
2328 | } |
2329 | |
2330 | static void |
ae3d717a |
2331 | localed_locale1_skeleton_class_init (localedLocale1SkeletonClass *klass) |
86cb7727 |
2332 | { |
2333 | GObjectClass *gobject_class; |
2334 | GDBusInterfaceSkeletonClass *skeleton_class; |
2335 | |
2336 | gobject_class = G_OBJECT_CLASS (klass); |
ae3d717a |
2337 | gobject_class->finalize = localed_locale1_skeleton_finalize; |
2338 | gobject_class->get_property = localed_locale1_skeleton_get_property; |
2339 | gobject_class->set_property = localed_locale1_skeleton_set_property; |
2340 | gobject_class->notify = localed_locale1_skeleton_notify; |
86cb7727 |
2341 | |
2342 | |
ae3d717a |
2343 | localed_locale1_override_properties (gobject_class, 1); |
86cb7727 |
2344 | |
2345 | skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); |
ae3d717a |
2346 | skeleton_class->get_info = localed_locale1_skeleton_dbus_interface_get_info; |
2347 | skeleton_class->get_properties = localed_locale1_skeleton_dbus_interface_get_properties; |
2348 | skeleton_class->flush = localed_locale1_skeleton_dbus_interface_flush; |
2349 | skeleton_class->get_vtable = localed_locale1_skeleton_dbus_interface_get_vtable; |
86cb7727 |
2350 | |
2351 | #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 |
ae3d717a |
2352 | g_type_class_add_private (klass, sizeof (localedLocale1SkeletonPrivate)); |
86cb7727 |
2353 | #endif |
2354 | } |
2355 | |
2356 | static void |
ae3d717a |
2357 | localed_locale1_skeleton_iface_init (localedLocale1Iface *iface) |
86cb7727 |
2358 | { |
ae3d717a |
2359 | iface->get_locale = localed_locale1_skeleton_get_locale; |
2360 | iface->get_x11_layout = localed_locale1_skeleton_get_x11_layout; |
2361 | iface->get_x11_model = localed_locale1_skeleton_get_x11_model; |
2362 | iface->get_x11_variant = localed_locale1_skeleton_get_x11_variant; |
2363 | iface->get_x11_options = localed_locale1_skeleton_get_x11_options; |
2364 | iface->get_vconsole_keymap = localed_locale1_skeleton_get_vconsole_keymap; |
2365 | iface->get_vconsole_keymap_toggle = localed_locale1_skeleton_get_vconsole_keymap_toggle; |
86cb7727 |
2366 | } |
2367 | |
2368 | /** |
ae3d717a |
2369 | * localed_locale1_skeleton_new: |
86cb7727 |
2370 | * |
2371 | * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-locale1.top_of_page">org.freedesktop.locale1</link>. |
2372 | * |
ae3d717a |
2373 | * Returns: (transfer full) (type localedLocale1Skeleton): The skeleton object. |
2374 | */ |
2375 | localedLocale1 * |
2376 | localed_locale1_skeleton_new (void) |
2377 | { |
2378 | return LOCALED_LOCALE1 (g_object_new (LOCALED_TYPE_LOCALE1_SKELETON, NULL)); |
2379 | } |
2380 | |