fix previous commit (forgot to escape newline), regenerate hostnamed with proper...
[systembsd.git] / src / interfaces / hostnamed / hostnamed-gen.c
CommitLineData
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
ed99526e 11#include "hostnamed-gen.h"
86cb7727 12
13#include <string.h>
14#ifdef G_OS_UNIX
15# include <gio/gunixfdlist.h>
16#endif
17
18typedef struct
19{
20 GDBusArgInfo parent_struct;
21 gboolean use_gvariant;
22} _ExtendedGDBusArgInfo;
23
24typedef struct
25{
26 GDBusMethodInfo parent_struct;
27 const gchar *signal_name;
28 gboolean pass_fdlist;
29} _ExtendedGDBusMethodInfo;
30
31typedef struct
32{
33 GDBusSignalInfo parent_struct;
34 const gchar *signal_name;
35} _ExtendedGDBusSignalInfo;
36
37typedef struct
38{
39 GDBusPropertyInfo parent_struct;
40 const gchar *hyphen_name;
41 gboolean use_gvariant;
42} _ExtendedGDBusPropertyInfo;
43
44typedef struct
45{
46 GDBusInterfaceInfo parent_struct;
47 const gchar *hyphen_name;
48} _ExtendedGDBusInterfaceInfo;
49
50typedef struct
51{
52 const _ExtendedGDBusPropertyInfo *info;
53 guint prop_id;
54 GValue orig_value; /* the value before the change */
55} ChangedProperty;
56
57static void
58_changed_property_free (ChangedProperty *data)
59{
60 g_value_unset (&data->orig_value);
61 g_free (data);
62}
63
64static gboolean
65_g_strv_equal0 (gchar **a, gchar **b)
66{
67 gboolean ret = FALSE;
68 guint n;
69 if (a == NULL && b == NULL)
70 {
71 ret = TRUE;
72 goto out;
73 }
74 if (a == NULL || b == NULL)
75 goto out;
76 if (g_strv_length (a) != g_strv_length (b))
77 goto out;
78 for (n = 0; a[n] != NULL; n++)
79 if (g_strcmp0 (a[n], b[n]) != 0)
80 goto out;
81 ret = TRUE;
82out:
83 return ret;
84}
85
86static gboolean
87_g_variant_equal0 (GVariant *a, GVariant *b)
88{
89 gboolean ret = FALSE;
90 if (a == NULL && b == NULL)
91 {
92 ret = TRUE;
93 goto out;
94 }
95 if (a == NULL || b == NULL)
96 goto out;
97 ret = g_variant_equal (a, b);
98out:
99 return ret;
100}
101
102G_GNUC_UNUSED static gboolean
103_g_value_equal (const GValue *a, const GValue *b)
104{
105 gboolean ret = FALSE;
106 g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
107 switch (G_VALUE_TYPE (a))
108 {
109 case G_TYPE_BOOLEAN:
110 ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
111 break;
112 case G_TYPE_UCHAR:
113 ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
114 break;
115 case G_TYPE_INT:
116 ret = (g_value_get_int (a) == g_value_get_int (b));
117 break;
118 case G_TYPE_UINT:
119 ret = (g_value_get_uint (a) == g_value_get_uint (b));
120 break;
121 case G_TYPE_INT64:
122 ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
123 break;
124 case G_TYPE_UINT64:
125 ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
126 break;
127 case G_TYPE_DOUBLE:
128 {
129 /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
130 gdouble da = g_value_get_double (a);
131 gdouble db = g_value_get_double (b);
132 ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
133 }
134 break;
135 case G_TYPE_STRING:
136 ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
137 break;
138 case G_TYPE_VARIANT:
139 ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
140 break;
141 default:
142 if (G_VALUE_TYPE (a) == G_TYPE_STRV)
143 ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
144 else
145 g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
146 break;
147 }
148 return ret;
149}
150
151/* ------------------------------------------------------------------------
355f60ae 152 * Code for interface org.freedesktop.hostname1
86cb7727 153 * ------------------------------------------------------------------------
154 */
155
156/**
68fde492 157 * SECTION:hostnamedHostname1
158 * @title: hostnamedHostname1
355f60ae 159 * @short_description: Generated C code for the org.freedesktop.hostname1 D-Bus interface
86cb7727 160 *
355f60ae 161 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-hostname1.top_of_page">org.freedesktop.hostname1</link> D-Bus interface in C.
86cb7727 162 */
163
355f60ae 164/* ---- Introspection data for org.freedesktop.hostname1 ---- */
86cb7727 165
68fde492 166static const _ExtendedGDBusArgInfo _hostnamed_hostname1_method_info_set_hostname_IN_ARG_unnamed_arg0 =
86cb7727 167{
168 {
169 -1,
355f60ae 170 (gchar *) "unnamed_arg0",
171 (gchar *) "s",
86cb7727 172 NULL
173 },
86cb7727 174 FALSE
175};
176
68fde492 177static const _ExtendedGDBusArgInfo _hostnamed_hostname1_method_info_set_hostname_IN_ARG_unnamed_arg1 =
86cb7727 178{
179 {
180 -1,
355f60ae 181 (gchar *) "unnamed_arg1",
182 (gchar *) "b",
86cb7727 183 NULL
184 },
185 FALSE
186};
187
68fde492 188static const _ExtendedGDBusArgInfo * const _hostnamed_hostname1_method_info_set_hostname_IN_ARG_pointers[] =
86cb7727 189{
68fde492 190 &_hostnamed_hostname1_method_info_set_hostname_IN_ARG_unnamed_arg0,
191 &_hostnamed_hostname1_method_info_set_hostname_IN_ARG_unnamed_arg1,
86cb7727 192 NULL
193};
194
68fde492 195static const _ExtendedGDBusMethodInfo _hostnamed_hostname1_method_info_set_hostname =
86cb7727 196{
197 {
198 -1,
355f60ae 199 (gchar *) "SetHostname",
68fde492 200 (GDBusArgInfo **) &_hostnamed_hostname1_method_info_set_hostname_IN_ARG_pointers,
86cb7727 201 NULL,
202 NULL
203 },
355f60ae 204 "handle-set-hostname",
86cb7727 205 FALSE
206};
207
68fde492 208static const _ExtendedGDBusArgInfo _hostnamed_hostname1_method_info_set_static_hostname_IN_ARG_unnamed_arg0 =
86cb7727 209{
355f60ae 210 {
211 -1,
212 (gchar *) "unnamed_arg0",
213 (gchar *) "s",
214 NULL
215 },
216 FALSE
86cb7727 217};
218
68fde492 219static const _ExtendedGDBusArgInfo _hostnamed_hostname1_method_info_set_static_hostname_IN_ARG_unnamed_arg1 =
86cb7727 220{
221 {
222 -1,
355f60ae 223 (gchar *) "unnamed_arg1",
224 (gchar *) "b",
86cb7727 225 NULL
226 },
355f60ae 227 FALSE
86cb7727 228};
229
68fde492 230static const _ExtendedGDBusArgInfo * const _hostnamed_hostname1_method_info_set_static_hostname_IN_ARG_pointers[] =
355f60ae 231{
68fde492 232 &_hostnamed_hostname1_method_info_set_static_hostname_IN_ARG_unnamed_arg0,
233 &_hostnamed_hostname1_method_info_set_static_hostname_IN_ARG_unnamed_arg1,
355f60ae 234 NULL
235};
86cb7727 236
68fde492 237static const _ExtendedGDBusMethodInfo _hostnamed_hostname1_method_info_set_static_hostname =
86cb7727 238{
355f60ae 239 {
240 -1,
241 (gchar *) "SetStaticHostname",
68fde492 242 (GDBusArgInfo **) &_hostnamed_hostname1_method_info_set_static_hostname_IN_ARG_pointers,
355f60ae 243 NULL,
244 NULL
245 },
246 "handle-set-static-hostname",
247 FALSE
248};
86cb7727 249
68fde492 250static const _ExtendedGDBusArgInfo _hostnamed_hostname1_method_info_set_pretty_hostname_IN_ARG_unnamed_arg0 =
86cb7727 251{
355f60ae 252 {
253 -1,
254 (gchar *) "unnamed_arg0",
255 (gchar *) "s",
256 NULL
257 },
258 FALSE
259};
86cb7727 260
68fde492 261static const _ExtendedGDBusArgInfo _hostnamed_hostname1_method_info_set_pretty_hostname_IN_ARG_unnamed_arg1 =
355f60ae 262{
263 {
264 -1,
265 (gchar *) "unnamed_arg1",
266 (gchar *) "b",
267 NULL
268 },
269 FALSE
270};
86cb7727 271
68fde492 272static const _ExtendedGDBusArgInfo * const _hostnamed_hostname1_method_info_set_pretty_hostname_IN_ARG_pointers[] =
355f60ae 273{
68fde492 274 &_hostnamed_hostname1_method_info_set_pretty_hostname_IN_ARG_unnamed_arg0,
275 &_hostnamed_hostname1_method_info_set_pretty_hostname_IN_ARG_unnamed_arg1,
355f60ae 276 NULL
277};
86cb7727 278
68fde492 279static const _ExtendedGDBusMethodInfo _hostnamed_hostname1_method_info_set_pretty_hostname =
355f60ae 280{
281 {
282 -1,
283 (gchar *) "SetPrettyHostname",
68fde492 284 (GDBusArgInfo **) &_hostnamed_hostname1_method_info_set_pretty_hostname_IN_ARG_pointers,
355f60ae 285 NULL,
286 NULL
287 },
288 "handle-set-pretty-hostname",
289 FALSE
290};
86cb7727 291
68fde492 292static const _ExtendedGDBusArgInfo _hostnamed_hostname1_method_info_set_icon_name_IN_ARG_unnamed_arg0 =
355f60ae 293{
294 {
295 -1,
296 (gchar *) "unnamed_arg0",
297 (gchar *) "s",
298 NULL
299 },
300 FALSE
301};
86cb7727 302
68fde492 303static const _ExtendedGDBusArgInfo _hostnamed_hostname1_method_info_set_icon_name_IN_ARG_unnamed_arg1 =
355f60ae 304{
305 {
306 -1,
307 (gchar *) "unnamed_arg1",
308 (gchar *) "b",
309 NULL
310 },
311 FALSE
312};
86cb7727 313
68fde492 314static const _ExtendedGDBusArgInfo * const _hostnamed_hostname1_method_info_set_icon_name_IN_ARG_pointers[] =
86cb7727 315{
68fde492 316 &_hostnamed_hostname1_method_info_set_icon_name_IN_ARG_unnamed_arg0,
317 &_hostnamed_hostname1_method_info_set_icon_name_IN_ARG_unnamed_arg1,
355f60ae 318 NULL
319};
86cb7727 320
68fde492 321static const _ExtendedGDBusMethodInfo _hostnamed_hostname1_method_info_set_icon_name =
355f60ae 322{
323 {
324 -1,
325 (gchar *) "SetIconName",
68fde492 326 (GDBusArgInfo **) &_hostnamed_hostname1_method_info_set_icon_name_IN_ARG_pointers,
86cb7727 327 NULL,
355f60ae 328 NULL
329 },
330 "handle-set-icon-name",
331 FALSE
332};
86cb7727 333
68fde492 334static const _ExtendedGDBusArgInfo _hostnamed_hostname1_method_info_set_chassis_IN_ARG_unnamed_arg0 =
355f60ae 335{
336 {
337 -1,
338 (gchar *) "unnamed_arg0",
339 (gchar *) "s",
340 NULL
341 },
342 FALSE
343};
86cb7727 344
68fde492 345static const _ExtendedGDBusArgInfo _hostnamed_hostname1_method_info_set_chassis_IN_ARG_unnamed_arg1 =
7ce16a35 346{
355f60ae 347 {
7ce16a35 348 -1,
355f60ae 349 (gchar *) "unnamed_arg1",
350 (gchar *) "b",
351 NULL
352 },
353 FALSE
354};
7ce16a35 355
68fde492 356static const _ExtendedGDBusArgInfo * const _hostnamed_hostname1_method_info_set_chassis_IN_ARG_pointers[] =
7ce16a35 357{
68fde492 358 &_hostnamed_hostname1_method_info_set_chassis_IN_ARG_unnamed_arg0,
359 &_hostnamed_hostname1_method_info_set_chassis_IN_ARG_unnamed_arg1,
355f60ae 360 NULL
361};
7ce16a35 362
68fde492 363static const _ExtendedGDBusMethodInfo _hostnamed_hostname1_method_info_set_chassis =
7ce16a35 364{
355f60ae 365 {
7ce16a35 366 -1,
355f60ae 367 (gchar *) "SetChassis",
68fde492 368 (GDBusArgInfo **) &_hostnamed_hostname1_method_info_set_chassis_IN_ARG_pointers,
355f60ae 369 NULL,
370 NULL
371 },
372 "handle-set-chassis",
373 FALSE
374};
7ce16a35 375
68fde492 376static const _ExtendedGDBusMethodInfo * const _hostnamed_hostname1_method_info_pointers[] =
7ce16a35 377{
68fde492 378 &_hostnamed_hostname1_method_info_set_hostname,
379 &_hostnamed_hostname1_method_info_set_static_hostname,
380 &_hostnamed_hostname1_method_info_set_pretty_hostname,
381 &_hostnamed_hostname1_method_info_set_icon_name,
382 &_hostnamed_hostname1_method_info_set_chassis,
355f60ae 383 NULL
384};
7ce16a35 385
68fde492 386static const GDBusAnnotationInfo _hostnamed_hostname1_property_hostname_annotation_info_0 =
7ce16a35 387{
355f60ae 388 -1,
389 (gchar *) "org.freedesktop.DBus.Property.EmitsChangedSignal",
390 (gchar *) "false",
391 NULL
392};
7ce16a35 393
68fde492 394static const GDBusAnnotationInfo * const _hostnamed_hostname1_property_hostname_annotation_info_pointers[] =
7ce16a35 395{
68fde492 396 &_hostnamed_hostname1_property_hostname_annotation_info_0,
355f60ae 397 NULL
398};
7ce16a35 399
68fde492 400static const _ExtendedGDBusPropertyInfo _hostnamed_hostname1_property_info_hostname =
7ce16a35 401{
355f60ae 402 {
403 -1,
404 (gchar *) "Hostname",
405 (gchar *) "s",
406 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
68fde492 407 (GDBusAnnotationInfo **) &_hostnamed_hostname1_property_hostname_annotation_info_pointers
355f60ae 408 },
409 "hostname",
410 FALSE
411};
7ce16a35 412
68fde492 413static const _ExtendedGDBusPropertyInfo _hostnamed_hostname1_property_info_static_hostname =
7ce16a35 414{
355f60ae 415 {
416 -1,
417 (gchar *) "StaticHostname",
418 (gchar *) "s",
419 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
420 NULL
421 },
422 "static-hostname",
423 FALSE
424};
7ce16a35 425
68fde492 426static const _ExtendedGDBusPropertyInfo _hostnamed_hostname1_property_info_pretty_hostname =
355f60ae 427{
428 {
429 -1,
430 (gchar *) "PrettyHostname",
431 (gchar *) "s",
432 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
433 NULL
434 },
435 "pretty-hostname",
436 FALSE
437};
7ce16a35 438
68fde492 439static const _ExtendedGDBusPropertyInfo _hostnamed_hostname1_property_info_icon_name =
355f60ae 440{
441 {
442 -1,
443 (gchar *) "IconName",
444 (gchar *) "s",
445 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
446 NULL
447 },
448 "icon-name",
449 FALSE
450};
7ce16a35 451
68fde492 452static const _ExtendedGDBusPropertyInfo _hostnamed_hostname1_property_info_chassis =
355f60ae 453{
454 {
455 -1,
456 (gchar *) "Chassis",
457 (gchar *) "s",
458 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
459 NULL
460 },
461 "chassis",
462 FALSE
463};
7ce16a35 464
68fde492 465static const GDBusAnnotationInfo _hostnamed_hostname1_property_kernel_name_annotation_info_0 =
7ce16a35 466{
355f60ae 467 -1,
468 (gchar *) "org.freedesktop.DBus.Property.EmitsChangedSignal",
469 (gchar *) "const",
470 NULL
7ce16a35 471};
472
68fde492 473static const GDBusAnnotationInfo * const _hostnamed_hostname1_property_kernel_name_annotation_info_pointers[] =
355f60ae 474{
68fde492 475 &_hostnamed_hostname1_property_kernel_name_annotation_info_0,
355f60ae 476 NULL
477};
7ce16a35 478
68fde492 479static const _ExtendedGDBusPropertyInfo _hostnamed_hostname1_property_info_kernel_name =
355f60ae 480{
481 {
482 -1,
483 (gchar *) "KernelName",
484 (gchar *) "s",
485 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
68fde492 486 (GDBusAnnotationInfo **) &_hostnamed_hostname1_property_kernel_name_annotation_info_pointers
355f60ae 487 },
488 "kernel-name",
489 FALSE
490};
7ce16a35 491
68fde492 492static const GDBusAnnotationInfo _hostnamed_hostname1_property_kernel_release_annotation_info_0 =
355f60ae 493{
494 -1,
495 (gchar *) "org.freedesktop.DBus.Property.EmitsChangedSignal",
496 (gchar *) "const",
497 NULL
498};
7ce16a35 499
68fde492 500static const GDBusAnnotationInfo * const _hostnamed_hostname1_property_kernel_release_annotation_info_pointers[] =
7ce16a35 501{
68fde492 502 &_hostnamed_hostname1_property_kernel_release_annotation_info_0,
355f60ae 503 NULL
504};
7ce16a35 505
68fde492 506static const _ExtendedGDBusPropertyInfo _hostnamed_hostname1_property_info_kernel_release =
7ce16a35 507{
355f60ae 508 {
509 -1,
510 (gchar *) "KernelRelease",
511 (gchar *) "s",
512 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
68fde492 513 (GDBusAnnotationInfo **) &_hostnamed_hostname1_property_kernel_release_annotation_info_pointers
355f60ae 514 },
515 "kernel-release",
516 FALSE
517};
7ce16a35 518
68fde492 519static const GDBusAnnotationInfo _hostnamed_hostname1_property_kernel_version_annotation_info_0 =
7ce16a35 520{
355f60ae 521 -1,
522 (gchar *) "org.freedesktop.DBus.Property.EmitsChangedSignal",
523 (gchar *) "const",
524 NULL
525};
7ce16a35 526
68fde492 527static const GDBusAnnotationInfo * const _hostnamed_hostname1_property_kernel_version_annotation_info_pointers[] =
7ce16a35 528{
68fde492 529 &_hostnamed_hostname1_property_kernel_version_annotation_info_0,
355f60ae 530 NULL
531};
7ce16a35 532
68fde492 533static const _ExtendedGDBusPropertyInfo _hostnamed_hostname1_property_info_kernel_version =
7ce16a35 534{
355f60ae 535 {
536 -1,
537 (gchar *) "KernelVersion",
538 (gchar *) "s",
539 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
68fde492 540 (GDBusAnnotationInfo **) &_hostnamed_hostname1_property_kernel_version_annotation_info_pointers
355f60ae 541 },
542 "kernel-version",
543 FALSE
544};
7ce16a35 545
68fde492 546static const GDBusAnnotationInfo _hostnamed_hostname1_property_operating_system_pretty_name_annotation_info_0 =
7ce16a35 547{
355f60ae 548 -1,
549 (gchar *) "org.freedesktop.DBus.Property.EmitsChangedSignal",
550 (gchar *) "const",
551 NULL
552};
7ce16a35 553
68fde492 554static const GDBusAnnotationInfo * const _hostnamed_hostname1_property_operating_system_pretty_name_annotation_info_pointers[] =
355f60ae 555{
68fde492 556 &_hostnamed_hostname1_property_operating_system_pretty_name_annotation_info_0,
355f60ae 557 NULL
558};
7ce16a35 559
68fde492 560static const _ExtendedGDBusPropertyInfo _hostnamed_hostname1_property_info_operating_system_pretty_name =
7ce16a35 561{
355f60ae 562 {
563 -1,
564 (gchar *) "OperatingSystemPrettyName",
565 (gchar *) "s",
566 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
68fde492 567 (GDBusAnnotationInfo **) &_hostnamed_hostname1_property_operating_system_pretty_name_annotation_info_pointers
355f60ae 568 },
569 "operating-system-pretty-name",
570 FALSE
571};
7ce16a35 572
68fde492 573static const GDBusAnnotationInfo _hostnamed_hostname1_property_operating_system_cpename_annotation_info_0 =
355f60ae 574{
575 -1,
576 (gchar *) "org.freedesktop.DBus.Property.EmitsChangedSignal",
577 (gchar *) "const",
578 NULL
579};
7ce16a35 580
68fde492 581static const GDBusAnnotationInfo * const _hostnamed_hostname1_property_operating_system_cpename_annotation_info_pointers[] =
355f60ae 582{
68fde492 583 &_hostnamed_hostname1_property_operating_system_cpename_annotation_info_0,
355f60ae 584 NULL
585};
7ce16a35 586
68fde492 587static const _ExtendedGDBusPropertyInfo _hostnamed_hostname1_property_info_operating_system_cpename =
355f60ae 588{
589 {
590 -1,
591 (gchar *) "OperatingSystemCPEName",
592 (gchar *) "s",
593 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
68fde492 594 (GDBusAnnotationInfo **) &_hostnamed_hostname1_property_operating_system_cpename_annotation_info_pointers
355f60ae 595 },
596 "operating-system-cpename",
597 FALSE
598};
7ce16a35 599
68fde492 600static const _ExtendedGDBusPropertyInfo * const _hostnamed_hostname1_property_info_pointers[] =
601{
602 &_hostnamed_hostname1_property_info_hostname,
603 &_hostnamed_hostname1_property_info_static_hostname,
604 &_hostnamed_hostname1_property_info_pretty_hostname,
605 &_hostnamed_hostname1_property_info_icon_name,
606 &_hostnamed_hostname1_property_info_chassis,
607 &_hostnamed_hostname1_property_info_kernel_name,
608 &_hostnamed_hostname1_property_info_kernel_release,
609 &_hostnamed_hostname1_property_info_kernel_version,
610 &_hostnamed_hostname1_property_info_operating_system_pretty_name,
611 &_hostnamed_hostname1_property_info_operating_system_cpename,
355f60ae 612 NULL
613};
7ce16a35 614
68fde492 615static const _ExtendedGDBusInterfaceInfo _hostnamed_hostname1_interface_info =
7ce16a35 616{
355f60ae 617 {
618 -1,
619 (gchar *) "org.freedesktop.hostname1",
68fde492 620 (GDBusMethodInfo **) &_hostnamed_hostname1_method_info_pointers,
355f60ae 621 NULL,
68fde492 622 (GDBusPropertyInfo **) &_hostnamed_hostname1_property_info_pointers,
355f60ae 623 NULL
624 },
625 "hostname1",
626};
627
7ce16a35 628
629/**
68fde492 630 * hostnamed_hostname1_interface_info:
7ce16a35 631 *
355f60ae 632 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-hostname1.top_of_page">org.freedesktop.hostname1</link> D-Bus interface.
7ce16a35 633 *
355f60ae 634 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
7ce16a35 635 */
355f60ae 636GDBusInterfaceInfo *
68fde492 637hostnamed_hostname1_interface_info (void)
7ce16a35 638{
68fde492 639 return (GDBusInterfaceInfo *) &_hostnamed_hostname1_interface_info.parent_struct;
7ce16a35 640}
641
642/**
68fde492 643 * hostnamed_hostname1_override_properties:
355f60ae 644 * @klass: The class structure for a #GObject<!-- -->-derived class.
645 * @property_id_begin: The property id to assign to the first overridden property.
7ce16a35 646 *
68fde492 647 * Overrides all #GObject properties in the #hostnamedHostname1 interface for a concrete class.
355f60ae 648 * The properties are overridden in the order they are defined.
7ce16a35 649 *
355f60ae 650 * Returns: The last property id.
7ce16a35 651 */
355f60ae 652guint
68fde492 653hostnamed_hostname1_override_properties (GObjectClass *klass, guint property_id_begin)
7ce16a35 654{
355f60ae 655 g_object_class_override_property (klass, property_id_begin++, "hostname");
656 g_object_class_override_property (klass, property_id_begin++, "static-hostname");
657 g_object_class_override_property (klass, property_id_begin++, "pretty-hostname");
658 g_object_class_override_property (klass, property_id_begin++, "icon-name");
659 g_object_class_override_property (klass, property_id_begin++, "chassis");
660 g_object_class_override_property (klass, property_id_begin++, "kernel-name");
661 g_object_class_override_property (klass, property_id_begin++, "kernel-release");
662 g_object_class_override_property (klass, property_id_begin++, "kernel-version");
663 g_object_class_override_property (klass, property_id_begin++, "operating-system-pretty-name");
664 g_object_class_override_property (klass, property_id_begin++, "operating-system-cpename");
665 return property_id_begin - 1;
7ce16a35 666}
667
668
355f60ae 669
7ce16a35 670/**
68fde492 671 * hostnamedHostname1:
7ce16a35 672 *
355f60ae 673 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-hostname1.top_of_page">org.freedesktop.hostname1</link>.
7ce16a35 674 */
675
676/**
68fde492 677 * hostnamedHostname1Iface:
7ce16a35 678 * @parent_iface: The parent interface.
68fde492 679 * @handle_set_chassis: Handler for the #hostnamedHostname1::handle-set-chassis signal.
680 * @handle_set_hostname: Handler for the #hostnamedHostname1::handle-set-hostname signal.
681 * @handle_set_icon_name: Handler for the #hostnamedHostname1::handle-set-icon-name signal.
682 * @handle_set_pretty_hostname: Handler for the #hostnamedHostname1::handle-set-pretty-hostname signal.
683 * @handle_set_static_hostname: Handler for the #hostnamedHostname1::handle-set-static-hostname signal.
684 * @get_chassis: Getter for the #hostnamedHostname1:chassis property.
685 * @get_hostname: Getter for the #hostnamedHostname1:hostname property.
686 * @get_icon_name: Getter for the #hostnamedHostname1:icon-name property.
687 * @get_kernel_name: Getter for the #hostnamedHostname1:kernel-name property.
688 * @get_kernel_release: Getter for the #hostnamedHostname1:kernel-release property.
689 * @get_kernel_version: Getter for the #hostnamedHostname1:kernel-version property.
690 * @get_operating_system_cpename: Getter for the #hostnamedHostname1:operating-system-cpename property.
691 * @get_operating_system_pretty_name: Getter for the #hostnamedHostname1:operating-system-pretty-name property.
692 * @get_pretty_hostname: Getter for the #hostnamedHostname1:pretty-hostname property.
693 * @get_static_hostname: Getter for the #hostnamedHostname1:static-hostname property.
7ce16a35 694 *
695 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-hostname1.top_of_page">org.freedesktop.hostname1</link>.
696 */
697
68fde492 698typedef hostnamedHostname1Iface hostnamedHostname1Interface;
699G_DEFINE_INTERFACE (hostnamedHostname1, hostnamed_hostname1, G_TYPE_OBJECT);
7ce16a35 700
701static void
68fde492 702hostnamed_hostname1_default_init (hostnamedHostname1Iface *iface)
7ce16a35 703{
704 /* GObject signals for incoming D-Bus method calls: */
705 /**
68fde492 706 * hostnamedHostname1::handle-set-hostname:
707 * @object: A #hostnamedHostname1.
7ce16a35 708 * @invocation: A #GDBusMethodInvocation.
709 * @arg_unnamed_arg0: Argument passed by remote caller.
710 * @arg_unnamed_arg1: Argument passed by remote caller.
711 *
712 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-hostname1.SetHostname">SetHostname()</link> D-Bus method.
713 *
68fde492 714 * 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 hostnamed_hostname1_complete_set_hostname() 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.
7ce16a35 715 *
716 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
717 */
718 g_signal_new ("handle-set-hostname",
719 G_TYPE_FROM_INTERFACE (iface),
720 G_SIGNAL_RUN_LAST,
68fde492 721 G_STRUCT_OFFSET (hostnamedHostname1Iface, handle_set_hostname),
7ce16a35 722 g_signal_accumulator_true_handled,
723 NULL,
724 g_cclosure_marshal_generic,
725 G_TYPE_BOOLEAN,
726 3,
727 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_BOOLEAN);
728
729 /**
68fde492 730 * hostnamedHostname1::handle-set-static-hostname:
731 * @object: A #hostnamedHostname1.
7ce16a35 732 * @invocation: A #GDBusMethodInvocation.
733 * @arg_unnamed_arg0: Argument passed by remote caller.
734 * @arg_unnamed_arg1: Argument passed by remote caller.
735 *
736 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-hostname1.SetStaticHostname">SetStaticHostname()</link> D-Bus method.
737 *
68fde492 738 * 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 hostnamed_hostname1_complete_set_static_hostname() 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.
7ce16a35 739 *
740 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
741 */
742 g_signal_new ("handle-set-static-hostname",
743 G_TYPE_FROM_INTERFACE (iface),
744 G_SIGNAL_RUN_LAST,
68fde492 745 G_STRUCT_OFFSET (hostnamedHostname1Iface, handle_set_static_hostname),
7ce16a35 746 g_signal_accumulator_true_handled,
747 NULL,
748 g_cclosure_marshal_generic,
749 G_TYPE_BOOLEAN,
750 3,
751 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_BOOLEAN);
752
753 /**
68fde492 754 * hostnamedHostname1::handle-set-pretty-hostname:
755 * @object: A #hostnamedHostname1.
7ce16a35 756 * @invocation: A #GDBusMethodInvocation.
757 * @arg_unnamed_arg0: Argument passed by remote caller.
758 * @arg_unnamed_arg1: Argument passed by remote caller.
759 *
760 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-hostname1.SetPrettyHostname">SetPrettyHostname()</link> D-Bus method.
761 *
68fde492 762 * 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 hostnamed_hostname1_complete_set_pretty_hostname() 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.
7ce16a35 763 *
764 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
765 */
766 g_signal_new ("handle-set-pretty-hostname",
767 G_TYPE_FROM_INTERFACE (iface),
768 G_SIGNAL_RUN_LAST,
68fde492 769 G_STRUCT_OFFSET (hostnamedHostname1Iface, handle_set_pretty_hostname),
7ce16a35 770 g_signal_accumulator_true_handled,
771 NULL,
772 g_cclosure_marshal_generic,
773 G_TYPE_BOOLEAN,
774 3,
775 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_BOOLEAN);
776
777 /**
68fde492 778 * hostnamedHostname1::handle-set-icon-name:
779 * @object: A #hostnamedHostname1.
7ce16a35 780 * @invocation: A #GDBusMethodInvocation.
781 * @arg_unnamed_arg0: Argument passed by remote caller.
782 * @arg_unnamed_arg1: Argument passed by remote caller.
86cb7727 783 *
784 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-hostname1.SetIconName">SetIconName()</link> D-Bus method.
785 *
68fde492 786 * 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 hostnamed_hostname1_complete_set_icon_name() 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 787 *
788 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
789 */
790 g_signal_new ("handle-set-icon-name",
791 G_TYPE_FROM_INTERFACE (iface),
792 G_SIGNAL_RUN_LAST,
68fde492 793 G_STRUCT_OFFSET (hostnamedHostname1Iface, handle_set_icon_name),
86cb7727 794 g_signal_accumulator_true_handled,
795 NULL,
796 g_cclosure_marshal_generic,
797 G_TYPE_BOOLEAN,
798 3,
799 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_BOOLEAN);
800
7ce16a35 801 /**
68fde492 802 * hostnamedHostname1::handle-set-chassis:
803 * @object: A #hostnamedHostname1.
7ce16a35 804 * @invocation: A #GDBusMethodInvocation.
805 * @arg_unnamed_arg0: Argument passed by remote caller.
806 * @arg_unnamed_arg1: Argument passed by remote caller.
807 *
808 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-hostname1.SetChassis">SetChassis()</link> D-Bus method.
809 *
68fde492 810 * 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 hostnamed_hostname1_complete_set_chassis() 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.
7ce16a35 811 *
812 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
813 */
814 g_signal_new ("handle-set-chassis",
815 G_TYPE_FROM_INTERFACE (iface),
816 G_SIGNAL_RUN_LAST,
68fde492 817 G_STRUCT_OFFSET (hostnamedHostname1Iface, handle_set_chassis),
7ce16a35 818 g_signal_accumulator_true_handled,
819 NULL,
820 g_cclosure_marshal_generic,
821 G_TYPE_BOOLEAN,
822 3,
823 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_BOOLEAN);
824
825 /* GObject properties for D-Bus properties: */
826 /**
68fde492 827 * hostnamedHostname1:hostname:
7ce16a35 828 *
829 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.Hostname">"Hostname"</link>.
830 *
831 * 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.
832 */
833 g_object_interface_install_property (iface,
834 g_param_spec_string ("hostname", "Hostname", "Hostname", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
835 /**
68fde492 836 * hostnamedHostname1:static-hostname:
7ce16a35 837 *
838 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.StaticHostname">"StaticHostname"</link>.
839 *
840 * 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.
841 */
842 g_object_interface_install_property (iface,
843 g_param_spec_string ("static-hostname", "StaticHostname", "StaticHostname", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
844 /**
68fde492 845 * hostnamedHostname1:pretty-hostname:
7ce16a35 846 *
847 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.PrettyHostname">"PrettyHostname"</link>.
848 *
849 * 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.
850 */
851 g_object_interface_install_property (iface,
852 g_param_spec_string ("pretty-hostname", "PrettyHostname", "PrettyHostname", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
853 /**
68fde492 854 * hostnamedHostname1:icon-name:
7ce16a35 855 *
856 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.IconName">"IconName"</link>.
857 *
858 * 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.
859 */
860 g_object_interface_install_property (iface,
861 g_param_spec_string ("icon-name", "IconName", "IconName", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
862 /**
68fde492 863 * hostnamedHostname1:chassis:
7ce16a35 864 *
865 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.Chassis">"Chassis"</link>.
866 *
867 * 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.
868 */
869 g_object_interface_install_property (iface,
870 g_param_spec_string ("chassis", "Chassis", "Chassis", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
871 /**
68fde492 872 * hostnamedHostname1:kernel-name:
7ce16a35 873 *
874 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.KernelName">"KernelName"</link>.
875 *
876 * 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.
877 */
878 g_object_interface_install_property (iface,
879 g_param_spec_string ("kernel-name", "KernelName", "KernelName", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
880 /**
68fde492 881 * hostnamedHostname1:kernel-release:
7ce16a35 882 *
883 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.KernelRelease">"KernelRelease"</link>.
884 *
885 * 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.
886 */
887 g_object_interface_install_property (iface,
888 g_param_spec_string ("kernel-release", "KernelRelease", "KernelRelease", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
889 /**
68fde492 890 * hostnamedHostname1:kernel-version:
7ce16a35 891 *
892 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.KernelVersion">"KernelVersion"</link>.
893 *
894 * 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.
895 */
896 g_object_interface_install_property (iface,
897 g_param_spec_string ("kernel-version", "KernelVersion", "KernelVersion", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
898 /**
68fde492 899 * hostnamedHostname1:operating-system-pretty-name:
7ce16a35 900 *
901 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemPrettyName">"OperatingSystemPrettyName"</link>.
902 *
903 * 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.
904 */
905 g_object_interface_install_property (iface,
906 g_param_spec_string ("operating-system-pretty-name", "OperatingSystemPrettyName", "OperatingSystemPrettyName", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
907 /**
68fde492 908 * hostnamedHostname1:operating-system-cpename:
7ce16a35 909 *
910 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemCPEName">"OperatingSystemCPEName"</link>.
911 *
912 * 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.
913 */
914 g_object_interface_install_property (iface,
915 g_param_spec_string ("operating-system-cpename", "OperatingSystemCPEName", "OperatingSystemCPEName", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
916}
917
918/**
68fde492 919 * hostnamed_hostname1_get_hostname: (skip)
920 * @object: A #hostnamedHostname1.
355f60ae 921 *
922 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.Hostname">"Hostname"</link> D-Bus property.
923 *
924 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
925 *
68fde492 926 * <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 hostnamed_hostname1_dup_hostname() if on another thread.</warning>
355f60ae 927 *
928 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
929 */
930const gchar *
68fde492 931hostnamed_hostname1_get_hostname (hostnamedHostname1 *object)
355f60ae 932{
68fde492 933 return HOSTNAMED_HOSTNAME1_GET_IFACE (object)->get_hostname (object);
355f60ae 934}
935
936/**
68fde492 937 * hostnamed_hostname1_dup_hostname: (skip)
938 * @object: A #hostnamedHostname1.
355f60ae 939 *
940 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.Hostname">"Hostname"</link> D-Bus property.
941 *
942 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
943 *
944 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
945 */
946gchar *
68fde492 947hostnamed_hostname1_dup_hostname (hostnamedHostname1 *object)
355f60ae 948{
949 gchar *value;
950 g_object_get (G_OBJECT (object), "hostname", &value, NULL);
951 return value;
952}
953
954/**
68fde492 955 * hostnamed_hostname1_set_hostname: (skip)
956 * @object: A #hostnamedHostname1.
355f60ae 957 * @value: The value to set.
958 *
959 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.Hostname">"Hostname"</link> D-Bus property to @value.
960 *
961 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
962 */
963void
68fde492 964hostnamed_hostname1_set_hostname (hostnamedHostname1 *object, const gchar *value)
355f60ae 965{
966 g_object_set (G_OBJECT (object), "hostname", value, NULL);
967}
968
969/**
68fde492 970 * hostnamed_hostname1_get_static_hostname: (skip)
971 * @object: A #hostnamedHostname1.
355f60ae 972 *
973 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.StaticHostname">"StaticHostname"</link> D-Bus property.
974 *
975 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
976 *
68fde492 977 * <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 hostnamed_hostname1_dup_static_hostname() if on another thread.</warning>
355f60ae 978 *
979 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
980 */
981const gchar *
68fde492 982hostnamed_hostname1_get_static_hostname (hostnamedHostname1 *object)
355f60ae 983{
68fde492 984 return HOSTNAMED_HOSTNAME1_GET_IFACE (object)->get_static_hostname (object);
355f60ae 985}
986
987/**
68fde492 988 * hostnamed_hostname1_dup_static_hostname: (skip)
989 * @object: A #hostnamedHostname1.
355f60ae 990 *
991 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.StaticHostname">"StaticHostname"</link> D-Bus property.
992 *
993 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
994 *
995 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
996 */
997gchar *
68fde492 998hostnamed_hostname1_dup_static_hostname (hostnamedHostname1 *object)
355f60ae 999{
1000 gchar *value;
1001 g_object_get (G_OBJECT (object), "static-hostname", &value, NULL);
1002 return value;
1003}
1004
1005/**
68fde492 1006 * hostnamed_hostname1_set_static_hostname: (skip)
1007 * @object: A #hostnamedHostname1.
355f60ae 1008 * @value: The value to set.
1009 *
1010 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.StaticHostname">"StaticHostname"</link> D-Bus property to @value.
1011 *
1012 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1013 */
1014void
68fde492 1015hostnamed_hostname1_set_static_hostname (hostnamedHostname1 *object, const gchar *value)
355f60ae 1016{
1017 g_object_set (G_OBJECT (object), "static-hostname", value, NULL);
1018}
1019
1020/**
68fde492 1021 * hostnamed_hostname1_get_pretty_hostname: (skip)
1022 * @object: A #hostnamedHostname1.
355f60ae 1023 *
1024 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.PrettyHostname">"PrettyHostname"</link> D-Bus property.
1025 *
1026 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1027 *
68fde492 1028 * <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 hostnamed_hostname1_dup_pretty_hostname() if on another thread.</warning>
355f60ae 1029 *
1030 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1031 */
1032const gchar *
68fde492 1033hostnamed_hostname1_get_pretty_hostname (hostnamedHostname1 *object)
355f60ae 1034{
68fde492 1035 return HOSTNAMED_HOSTNAME1_GET_IFACE (object)->get_pretty_hostname (object);
355f60ae 1036}
1037
1038/**
68fde492 1039 * hostnamed_hostname1_dup_pretty_hostname: (skip)
1040 * @object: A #hostnamedHostname1.
355f60ae 1041 *
1042 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.PrettyHostname">"PrettyHostname"</link> D-Bus property.
1043 *
1044 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1045 *
1046 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1047 */
1048gchar *
68fde492 1049hostnamed_hostname1_dup_pretty_hostname (hostnamedHostname1 *object)
355f60ae 1050{
1051 gchar *value;
1052 g_object_get (G_OBJECT (object), "pretty-hostname", &value, NULL);
1053 return value;
1054}
1055
1056/**
68fde492 1057 * hostnamed_hostname1_set_pretty_hostname: (skip)
1058 * @object: A #hostnamedHostname1.
355f60ae 1059 * @value: The value to set.
1060 *
1061 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.PrettyHostname">"PrettyHostname"</link> D-Bus property to @value.
1062 *
1063 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1064 */
1065void
68fde492 1066hostnamed_hostname1_set_pretty_hostname (hostnamedHostname1 *object, const gchar *value)
355f60ae 1067{
1068 g_object_set (G_OBJECT (object), "pretty-hostname", value, NULL);
1069}
1070
1071/**
68fde492 1072 * hostnamed_hostname1_get_icon_name: (skip)
1073 * @object: A #hostnamedHostname1.
355f60ae 1074 *
1075 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.IconName">"IconName"</link> D-Bus property.
1076 *
1077 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1078 *
68fde492 1079 * <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 hostnamed_hostname1_dup_icon_name() if on another thread.</warning>
355f60ae 1080 *
1081 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1082 */
1083const gchar *
68fde492 1084hostnamed_hostname1_get_icon_name (hostnamedHostname1 *object)
355f60ae 1085{
68fde492 1086 return HOSTNAMED_HOSTNAME1_GET_IFACE (object)->get_icon_name (object);
355f60ae 1087}
1088
1089/**
68fde492 1090 * hostnamed_hostname1_dup_icon_name: (skip)
1091 * @object: A #hostnamedHostname1.
355f60ae 1092 *
1093 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.IconName">"IconName"</link> D-Bus property.
1094 *
1095 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1096 *
1097 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1098 */
1099gchar *
68fde492 1100hostnamed_hostname1_dup_icon_name (hostnamedHostname1 *object)
355f60ae 1101{
1102 gchar *value;
1103 g_object_get (G_OBJECT (object), "icon-name", &value, NULL);
1104 return value;
1105}
1106
1107/**
68fde492 1108 * hostnamed_hostname1_set_icon_name: (skip)
1109 * @object: A #hostnamedHostname1.
355f60ae 1110 * @value: The value to set.
1111 *
1112 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.IconName">"IconName"</link> D-Bus property to @value.
1113 *
1114 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1115 */
1116void
68fde492 1117hostnamed_hostname1_set_icon_name (hostnamedHostname1 *object, const gchar *value)
355f60ae 1118{
1119 g_object_set (G_OBJECT (object), "icon-name", value, NULL);
1120}
1121
1122/**
68fde492 1123 * hostnamed_hostname1_get_chassis: (skip)
1124 * @object: A #hostnamedHostname1.
355f60ae 1125 *
1126 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.Chassis">"Chassis"</link> D-Bus property.
1127 *
1128 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1129 *
68fde492 1130 * <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 hostnamed_hostname1_dup_chassis() if on another thread.</warning>
355f60ae 1131 *
1132 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1133 */
1134const gchar *
68fde492 1135hostnamed_hostname1_get_chassis (hostnamedHostname1 *object)
355f60ae 1136{
68fde492 1137 return HOSTNAMED_HOSTNAME1_GET_IFACE (object)->get_chassis (object);
355f60ae 1138}
1139
1140/**
68fde492 1141 * hostnamed_hostname1_dup_chassis: (skip)
1142 * @object: A #hostnamedHostname1.
355f60ae 1143 *
1144 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.Chassis">"Chassis"</link> D-Bus property.
1145 *
1146 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1147 *
1148 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1149 */
1150gchar *
68fde492 1151hostnamed_hostname1_dup_chassis (hostnamedHostname1 *object)
355f60ae 1152{
1153 gchar *value;
1154 g_object_get (G_OBJECT (object), "chassis", &value, NULL);
1155 return value;
1156}
1157
1158/**
68fde492 1159 * hostnamed_hostname1_set_chassis: (skip)
1160 * @object: A #hostnamedHostname1.
355f60ae 1161 * @value: The value to set.
7ce16a35 1162 *
355f60ae 1163 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.Chassis">"Chassis"</link> D-Bus property to @value.
1164 *
1165 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1166 */
1167void
68fde492 1168hostnamed_hostname1_set_chassis (hostnamedHostname1 *object, const gchar *value)
355f60ae 1169{
1170 g_object_set (G_OBJECT (object), "chassis", value, NULL);
1171}
1172
1173/**
68fde492 1174 * hostnamed_hostname1_get_kernel_name: (skip)
1175 * @object: A #hostnamedHostname1.
355f60ae 1176 *
1177 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelName">"KernelName"</link> D-Bus property.
7ce16a35 1178 *
1179 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1180 *
68fde492 1181 * <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 hostnamed_hostname1_dup_kernel_name() if on another thread.</warning>
7ce16a35 1182 *
1183 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1184 */
1185const gchar *
68fde492 1186hostnamed_hostname1_get_kernel_name (hostnamedHostname1 *object)
7ce16a35 1187{
68fde492 1188 return HOSTNAMED_HOSTNAME1_GET_IFACE (object)->get_kernel_name (object);
7ce16a35 1189}
1190
1191/**
68fde492 1192 * hostnamed_hostname1_dup_kernel_name: (skip)
1193 * @object: A #hostnamedHostname1.
7ce16a35 1194 *
355f60ae 1195 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelName">"KernelName"</link> D-Bus property.
7ce16a35 1196 *
1197 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1198 *
1199 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1200 */
1201gchar *
68fde492 1202hostnamed_hostname1_dup_kernel_name (hostnamedHostname1 *object)
7ce16a35 1203{
1204 gchar *value;
355f60ae 1205 g_object_get (G_OBJECT (object), "kernel-name", &value, NULL);
7ce16a35 1206 return value;
1207}
1208
1209/**
68fde492 1210 * hostnamed_hostname1_set_kernel_name: (skip)
1211 * @object: A #hostnamedHostname1.
7ce16a35 1212 * @value: The value to set.
1213 *
355f60ae 1214 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelName">"KernelName"</link> D-Bus property to @value.
7ce16a35 1215 *
1216 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1217 */
1218void
68fde492 1219hostnamed_hostname1_set_kernel_name (hostnamedHostname1 *object, const gchar *value)
7ce16a35 1220{
355f60ae 1221 g_object_set (G_OBJECT (object), "kernel-name", value, NULL);
7ce16a35 1222}
1223
1224/**
68fde492 1225 * hostnamed_hostname1_get_kernel_release: (skip)
1226 * @object: A #hostnamedHostname1.
7ce16a35 1227 *
355f60ae 1228 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelRelease">"KernelRelease"</link> D-Bus property.
7ce16a35 1229 *
1230 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1231 *
68fde492 1232 * <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 hostnamed_hostname1_dup_kernel_release() if on another thread.</warning>
7ce16a35 1233 *
1234 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1235 */
1236const gchar *
68fde492 1237hostnamed_hostname1_get_kernel_release (hostnamedHostname1 *object)
7ce16a35 1238{
68fde492 1239 return HOSTNAMED_HOSTNAME1_GET_IFACE (object)->get_kernel_release (object);
7ce16a35 1240}
1241
1242/**
68fde492 1243 * hostnamed_hostname1_dup_kernel_release: (skip)
1244 * @object: A #hostnamedHostname1.
7ce16a35 1245 *
355f60ae 1246 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelRelease">"KernelRelease"</link> D-Bus property.
7ce16a35 1247 *
1248 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1249 *
1250 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1251 */
1252gchar *
68fde492 1253hostnamed_hostname1_dup_kernel_release (hostnamedHostname1 *object)
7ce16a35 1254{
1255 gchar *value;
355f60ae 1256 g_object_get (G_OBJECT (object), "kernel-release", &value, NULL);
7ce16a35 1257 return value;
1258}
1259
1260/**
68fde492 1261 * hostnamed_hostname1_set_kernel_release: (skip)
1262 * @object: A #hostnamedHostname1.
7ce16a35 1263 * @value: The value to set.
1264 *
355f60ae 1265 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelRelease">"KernelRelease"</link> D-Bus property to @value.
7ce16a35 1266 *
1267 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1268 */
1269void
68fde492 1270hostnamed_hostname1_set_kernel_release (hostnamedHostname1 *object, const gchar *value)
7ce16a35 1271{
355f60ae 1272 g_object_set (G_OBJECT (object), "kernel-release", value, NULL);
86cb7727 1273}
1274
1275/**
68fde492 1276 * hostnamed_hostname1_get_kernel_version: (skip)
1277 * @object: A #hostnamedHostname1.
86cb7727 1278 *
355f60ae 1279 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelVersion">"KernelVersion"</link> D-Bus property.
86cb7727 1280 *
1281 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1282 *
68fde492 1283 * <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 hostnamed_hostname1_dup_kernel_version() if on another thread.</warning>
86cb7727 1284 *
1285 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1286 */
1287const gchar *
68fde492 1288hostnamed_hostname1_get_kernel_version (hostnamedHostname1 *object)
86cb7727 1289{
68fde492 1290 return HOSTNAMED_HOSTNAME1_GET_IFACE (object)->get_kernel_version (object);
86cb7727 1291}
1292
1293/**
68fde492 1294 * hostnamed_hostname1_dup_kernel_version: (skip)
1295 * @object: A #hostnamedHostname1.
86cb7727 1296 *
355f60ae 1297 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelVersion">"KernelVersion"</link> D-Bus property.
86cb7727 1298 *
1299 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1300 *
1301 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1302 */
1303gchar *
68fde492 1304hostnamed_hostname1_dup_kernel_version (hostnamedHostname1 *object)
86cb7727 1305{
1306 gchar *value;
355f60ae 1307 g_object_get (G_OBJECT (object), "kernel-version", &value, NULL);
86cb7727 1308 return value;
1309}
1310
1311/**
68fde492 1312 * hostnamed_hostname1_set_kernel_version: (skip)
1313 * @object: A #hostnamedHostname1.
86cb7727 1314 * @value: The value to set.
1315 *
355f60ae 1316 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelVersion">"KernelVersion"</link> D-Bus property to @value.
86cb7727 1317 *
1318 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1319 */
1320void
68fde492 1321hostnamed_hostname1_set_kernel_version (hostnamedHostname1 *object, const gchar *value)
86cb7727 1322{
355f60ae 1323 g_object_set (G_OBJECT (object), "kernel-version", value, NULL);
86cb7727 1324}
1325
1326/**
68fde492 1327 * hostnamed_hostname1_get_operating_system_pretty_name: (skip)
1328 * @object: A #hostnamedHostname1.
86cb7727 1329 *
355f60ae 1330 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemPrettyName">"OperatingSystemPrettyName"</link> D-Bus property.
86cb7727 1331 *
1332 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1333 *
68fde492 1334 * <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 hostnamed_hostname1_dup_operating_system_pretty_name() if on another thread.</warning>
86cb7727 1335 *
1336 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1337 */
1338const gchar *
68fde492 1339hostnamed_hostname1_get_operating_system_pretty_name (hostnamedHostname1 *object)
86cb7727 1340{
68fde492 1341 return HOSTNAMED_HOSTNAME1_GET_IFACE (object)->get_operating_system_pretty_name (object);
86cb7727 1342}
1343
1344/**
68fde492 1345 * hostnamed_hostname1_dup_operating_system_pretty_name: (skip)
1346 * @object: A #hostnamedHostname1.
86cb7727 1347 *
355f60ae 1348 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemPrettyName">"OperatingSystemPrettyName"</link> D-Bus property.
7ce16a35 1349 *
1350 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1351 *
1352 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1353 */
1354gchar *
68fde492 1355hostnamed_hostname1_dup_operating_system_pretty_name (hostnamedHostname1 *object)
7ce16a35 1356{
1357 gchar *value;
355f60ae 1358 g_object_get (G_OBJECT (object), "operating-system-pretty-name", &value, NULL);
7ce16a35 1359 return value;
1360}
1361
1362/**
68fde492 1363 * hostnamed_hostname1_set_operating_system_pretty_name: (skip)
1364 * @object: A #hostnamedHostname1.
7ce16a35 1365 * @value: The value to set.
1366 *
355f60ae 1367 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemPrettyName">"OperatingSystemPrettyName"</link> D-Bus property to @value.
7ce16a35 1368 *
1369 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1370 */
1371void
68fde492 1372hostnamed_hostname1_set_operating_system_pretty_name (hostnamedHostname1 *object, const gchar *value)
7ce16a35 1373{
355f60ae 1374 g_object_set (G_OBJECT (object), "operating-system-pretty-name", value, NULL);
7ce16a35 1375}
1376
1377/**
68fde492 1378 * hostnamed_hostname1_get_operating_system_cpename: (skip)
1379 * @object: A #hostnamedHostname1.
7ce16a35 1380 *
355f60ae 1381 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemCPEName">"OperatingSystemCPEName"</link> D-Bus property.
7ce16a35 1382 *
1383 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1384 *
68fde492 1385 * <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 hostnamed_hostname1_dup_operating_system_cpename() if on another thread.</warning>
7ce16a35 1386 *
1387 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
1388 */
1389const gchar *
68fde492 1390hostnamed_hostname1_get_operating_system_cpename (hostnamedHostname1 *object)
7ce16a35 1391{
68fde492 1392 return HOSTNAMED_HOSTNAME1_GET_IFACE (object)->get_operating_system_cpename (object);
7ce16a35 1393}
1394
1395/**
68fde492 1396 * hostnamed_hostname1_dup_operating_system_cpename: (skip)
1397 * @object: A #hostnamedHostname1.
7ce16a35 1398 *
355f60ae 1399 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemCPEName">"OperatingSystemCPEName"</link> D-Bus property.
7ce16a35 1400 *
1401 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1402 *
1403 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1404 */
1405gchar *
68fde492 1406hostnamed_hostname1_dup_operating_system_cpename (hostnamedHostname1 *object)
7ce16a35 1407{
1408 gchar *value;
355f60ae 1409 g_object_get (G_OBJECT (object), "operating-system-cpename", &value, NULL);
7ce16a35 1410 return value;
1411}
1412
1413/**
68fde492 1414 * hostnamed_hostname1_set_operating_system_cpename: (skip)
1415 * @object: A #hostnamedHostname1.
7ce16a35 1416 * @value: The value to set.
1417 *
355f60ae 1418 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemCPEName">"OperatingSystemCPEName"</link> D-Bus property to @value.
7ce16a35 1419 *
1420 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1421 */
1422void
68fde492 1423hostnamed_hostname1_set_operating_system_cpename (hostnamedHostname1 *object, const gchar *value)
7ce16a35 1424{
355f60ae 1425 g_object_set (G_OBJECT (object), "operating-system-cpename", value, NULL);
7ce16a35 1426}
1427
1428/**
68fde492 1429 * hostnamed_hostname1_call_set_hostname:
1430 * @proxy: A #hostnamedHostname1Proxy.
355f60ae 1431 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1432 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1433 * @cancellable: (allow-none): A #GCancellable or %NULL.
1434 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1435 * @user_data: User data to pass to @callback.
7ce16a35 1436 *
355f60ae 1437 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-hostname1.SetHostname">SetHostname()</link> D-Bus method on @proxy.
1438 * 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.
68fde492 1439 * You can then call hostnamed_hostname1_call_set_hostname_finish() to get the result of the operation.
7ce16a35 1440 *
68fde492 1441 * See hostnamed_hostname1_call_set_hostname_sync() for the synchronous, blocking version of this method.
355f60ae 1442 */
1443void
68fde492 1444hostnamed_hostname1_call_set_hostname (
1445 hostnamedHostname1 *proxy,
355f60ae 1446 const gchar *arg_unnamed_arg0,
1447 gboolean arg_unnamed_arg1,
1448 GCancellable *cancellable,
1449 GAsyncReadyCallback callback,
1450 gpointer user_data)
1451{
1452 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1453 "SetHostname",
1454 g_variant_new ("(sb)",
1455 arg_unnamed_arg0,
1456 arg_unnamed_arg1),
1457 G_DBUS_CALL_FLAGS_NONE,
1458 -1,
1459 cancellable,
1460 callback,
1461 user_data);
1462}
1463
1464/**
68fde492 1465 * hostnamed_hostname1_call_set_hostname_finish:
1466 * @proxy: A #hostnamedHostname1Proxy.
1467 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostnamed_hostname1_call_set_hostname().
355f60ae 1468 * @error: Return location for error or %NULL.
7ce16a35 1469 *
68fde492 1470 * Finishes an operation started with hostnamed_hostname1_call_set_hostname().
7ce16a35 1471 *
355f60ae 1472 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7ce16a35 1473 */
355f60ae 1474gboolean
68fde492 1475hostnamed_hostname1_call_set_hostname_finish (
1476 hostnamedHostname1 *proxy,
355f60ae 1477 GAsyncResult *res,
1478 GError **error)
7ce16a35 1479{
355f60ae 1480 GVariant *_ret;
1481 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1482 if (_ret == NULL)
1483 goto _out;
1484 g_variant_get (_ret,
1485 "()");
1486 g_variant_unref (_ret);
1487_out:
1488 return _ret != NULL;
7ce16a35 1489}
1490
1491/**
68fde492 1492 * hostnamed_hostname1_call_set_hostname_sync:
1493 * @proxy: A #hostnamedHostname1Proxy.
355f60ae 1494 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1495 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1496 * @cancellable: (allow-none): A #GCancellable or %NULL.
1497 * @error: Return location for error or %NULL.
7ce16a35 1498 *
355f60ae 1499 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-hostname1.SetHostname">SetHostname()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1500 *
68fde492 1501 * See hostnamed_hostname1_call_set_hostname() for the asynchronous version of this method.
355f60ae 1502 *
1503 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1504 */
1505gboolean
68fde492 1506hostnamed_hostname1_call_set_hostname_sync (
1507 hostnamedHostname1 *proxy,
355f60ae 1508 const gchar *arg_unnamed_arg0,
1509 gboolean arg_unnamed_arg1,
1510 GCancellable *cancellable,
1511 GError **error)
1512{
1513 GVariant *_ret;
1514 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1515 "SetHostname",
1516 g_variant_new ("(sb)",
1517 arg_unnamed_arg0,
1518 arg_unnamed_arg1),
1519 G_DBUS_CALL_FLAGS_NONE,
1520 -1,
1521 cancellable,
1522 error);
1523 if (_ret == NULL)
1524 goto _out;
1525 g_variant_get (_ret,
1526 "()");
1527 g_variant_unref (_ret);
1528_out:
1529 return _ret != NULL;
1530}
1531
1532/**
68fde492 1533 * hostnamed_hostname1_call_set_static_hostname:
1534 * @proxy: A #hostnamedHostname1Proxy.
355f60ae 1535 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1536 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1537 * @cancellable: (allow-none): A #GCancellable or %NULL.
1538 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1539 * @user_data: User data to pass to @callback.
7ce16a35 1540 *
355f60ae 1541 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-hostname1.SetStaticHostname">SetStaticHostname()</link> D-Bus method on @proxy.
1542 * 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.
68fde492 1543 * You can then call hostnamed_hostname1_call_set_static_hostname_finish() to get the result of the operation.
7ce16a35 1544 *
68fde492 1545 * See hostnamed_hostname1_call_set_static_hostname_sync() for the synchronous, blocking version of this method.
7ce16a35 1546 */
355f60ae 1547void
68fde492 1548hostnamed_hostname1_call_set_static_hostname (
1549 hostnamedHostname1 *proxy,
355f60ae 1550 const gchar *arg_unnamed_arg0,
1551 gboolean arg_unnamed_arg1,
1552 GCancellable *cancellable,
1553 GAsyncReadyCallback callback,
1554 gpointer user_data)
7ce16a35 1555{
355f60ae 1556 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1557 "SetStaticHostname",
1558 g_variant_new ("(sb)",
1559 arg_unnamed_arg0,
1560 arg_unnamed_arg1),
1561 G_DBUS_CALL_FLAGS_NONE,
1562 -1,
1563 cancellable,
1564 callback,
1565 user_data);
7ce16a35 1566}
1567
1568/**
68fde492 1569 * hostnamed_hostname1_call_set_static_hostname_finish:
1570 * @proxy: A #hostnamedHostname1Proxy.
1571 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostnamed_hostname1_call_set_static_hostname().
355f60ae 1572 * @error: Return location for error or %NULL.
7ce16a35 1573 *
68fde492 1574 * Finishes an operation started with hostnamed_hostname1_call_set_static_hostname().
7ce16a35 1575 *
355f60ae 1576 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7ce16a35 1577 */
355f60ae 1578gboolean
68fde492 1579hostnamed_hostname1_call_set_static_hostname_finish (
1580 hostnamedHostname1 *proxy,
355f60ae 1581 GAsyncResult *res,
1582 GError **error)
7ce16a35 1583{
355f60ae 1584 GVariant *_ret;
1585 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1586 if (_ret == NULL)
1587 goto _out;
1588 g_variant_get (_ret,
1589 "()");
1590 g_variant_unref (_ret);
1591_out:
1592 return _ret != NULL;
7ce16a35 1593}
1594
1595/**
68fde492 1596 * hostnamed_hostname1_call_set_static_hostname_sync:
1597 * @proxy: A #hostnamedHostname1Proxy.
355f60ae 1598 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1599 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1600 * @cancellable: (allow-none): A #GCancellable or %NULL.
1601 * @error: Return location for error or %NULL.
7ce16a35 1602 *
355f60ae 1603 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-hostname1.SetStaticHostname">SetStaticHostname()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7ce16a35 1604 *
68fde492 1605 * See hostnamed_hostname1_call_set_static_hostname() for the asynchronous version of this method.
7ce16a35 1606 *
355f60ae 1607 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7ce16a35 1608 */
355f60ae 1609gboolean
68fde492 1610hostnamed_hostname1_call_set_static_hostname_sync (
1611 hostnamedHostname1 *proxy,
355f60ae 1612 const gchar *arg_unnamed_arg0,
1613 gboolean arg_unnamed_arg1,
1614 GCancellable *cancellable,
1615 GError **error)
7ce16a35 1616{
355f60ae 1617 GVariant *_ret;
1618 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1619 "SetStaticHostname",
1620 g_variant_new ("(sb)",
1621 arg_unnamed_arg0,
1622 arg_unnamed_arg1),
1623 G_DBUS_CALL_FLAGS_NONE,
1624 -1,
1625 cancellable,
1626 error);
1627 if (_ret == NULL)
1628 goto _out;
1629 g_variant_get (_ret,
1630 "()");
1631 g_variant_unref (_ret);
1632_out:
1633 return _ret != NULL;
7ce16a35 1634}
1635
1636/**
68fde492 1637 * hostnamed_hostname1_call_set_pretty_hostname:
1638 * @proxy: A #hostnamedHostname1Proxy.
355f60ae 1639 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1640 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1641 * @cancellable: (allow-none): A #GCancellable or %NULL.
1642 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1643 * @user_data: User data to pass to @callback.
7ce16a35 1644 *
355f60ae 1645 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-hostname1.SetPrettyHostname">SetPrettyHostname()</link> D-Bus method on @proxy.
1646 * 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.
68fde492 1647 * You can then call hostnamed_hostname1_call_set_pretty_hostname_finish() to get the result of the operation.
7ce16a35 1648 *
68fde492 1649 * See hostnamed_hostname1_call_set_pretty_hostname_sync() for the synchronous, blocking version of this method.
7ce16a35 1650 */
355f60ae 1651void
68fde492 1652hostnamed_hostname1_call_set_pretty_hostname (
1653 hostnamedHostname1 *proxy,
355f60ae 1654 const gchar *arg_unnamed_arg0,
1655 gboolean arg_unnamed_arg1,
1656 GCancellable *cancellable,
1657 GAsyncReadyCallback callback,
1658 gpointer user_data)
7ce16a35 1659{
355f60ae 1660 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1661 "SetPrettyHostname",
1662 g_variant_new ("(sb)",
1663 arg_unnamed_arg0,
1664 arg_unnamed_arg1),
1665 G_DBUS_CALL_FLAGS_NONE,
1666 -1,
1667 cancellable,
1668 callback,
1669 user_data);
7ce16a35 1670}
1671
1672/**
68fde492 1673 * hostnamed_hostname1_call_set_pretty_hostname_finish:
1674 * @proxy: A #hostnamedHostname1Proxy.
1675 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostnamed_hostname1_call_set_pretty_hostname().
355f60ae 1676 * @error: Return location for error or %NULL.
7ce16a35 1677 *
68fde492 1678 * Finishes an operation started with hostnamed_hostname1_call_set_pretty_hostname().
7ce16a35 1679 *
355f60ae 1680 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7ce16a35 1681 */
355f60ae 1682gboolean
68fde492 1683hostnamed_hostname1_call_set_pretty_hostname_finish (
1684 hostnamedHostname1 *proxy,
355f60ae 1685 GAsyncResult *res,
1686 GError **error)
7ce16a35 1687{
355f60ae 1688 GVariant *_ret;
1689 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1690 if (_ret == NULL)
1691 goto _out;
1692 g_variant_get (_ret,
1693 "()");
1694 g_variant_unref (_ret);
1695_out:
1696 return _ret != NULL;
7ce16a35 1697}
1698
1699/**
68fde492 1700 * hostnamed_hostname1_call_set_pretty_hostname_sync:
1701 * @proxy: A #hostnamedHostname1Proxy.
355f60ae 1702 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1703 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1704 * @cancellable: (allow-none): A #GCancellable or %NULL.
1705 * @error: Return location for error or %NULL.
7ce16a35 1706 *
355f60ae 1707 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-hostname1.SetPrettyHostname">SetPrettyHostname()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7ce16a35 1708 *
68fde492 1709 * See hostnamed_hostname1_call_set_pretty_hostname() for the asynchronous version of this method.
7ce16a35 1710 *
355f60ae 1711 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7ce16a35 1712 */
355f60ae 1713gboolean
68fde492 1714hostnamed_hostname1_call_set_pretty_hostname_sync (
1715 hostnamedHostname1 *proxy,
355f60ae 1716 const gchar *arg_unnamed_arg0,
1717 gboolean arg_unnamed_arg1,
1718 GCancellable *cancellable,
1719 GError **error)
7ce16a35 1720{
355f60ae 1721 GVariant *_ret;
1722 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1723 "SetPrettyHostname",
1724 g_variant_new ("(sb)",
1725 arg_unnamed_arg0,
1726 arg_unnamed_arg1),
1727 G_DBUS_CALL_FLAGS_NONE,
1728 -1,
1729 cancellable,
1730 error);
1731 if (_ret == NULL)
1732 goto _out;
1733 g_variant_get (_ret,
1734 "()");
1735 g_variant_unref (_ret);
1736_out:
1737 return _ret != NULL;
7ce16a35 1738}
1739
1740/**
68fde492 1741 * hostnamed_hostname1_call_set_icon_name:
1742 * @proxy: A #hostnamedHostname1Proxy.
355f60ae 1743 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1744 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1745 * @cancellable: (allow-none): A #GCancellable or %NULL.
1746 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1747 * @user_data: User data to pass to @callback.
86cb7727 1748 *
355f60ae 1749 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-hostname1.SetIconName">SetIconName()</link> D-Bus method on @proxy.
1750 * 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.
68fde492 1751 * You can then call hostnamed_hostname1_call_set_icon_name_finish() to get the result of the operation.
86cb7727 1752 *
68fde492 1753 * See hostnamed_hostname1_call_set_icon_name_sync() for the synchronous, blocking version of this method.
86cb7727 1754 */
355f60ae 1755void
68fde492 1756hostnamed_hostname1_call_set_icon_name (
1757 hostnamedHostname1 *proxy,
355f60ae 1758 const gchar *arg_unnamed_arg0,
1759 gboolean arg_unnamed_arg1,
1760 GCancellable *cancellable,
1761 GAsyncReadyCallback callback,
1762 gpointer user_data)
86cb7727 1763{
355f60ae 1764 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1765 "SetIconName",
1766 g_variant_new ("(sb)",
1767 arg_unnamed_arg0,
1768 arg_unnamed_arg1),
1769 G_DBUS_CALL_FLAGS_NONE,
1770 -1,
1771 cancellable,
1772 callback,
1773 user_data);
86cb7727 1774}
1775
1776/**
68fde492 1777 * hostnamed_hostname1_call_set_icon_name_finish:
1778 * @proxy: A #hostnamedHostname1Proxy.
1779 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostnamed_hostname1_call_set_icon_name().
355f60ae 1780 * @error: Return location for error or %NULL.
86cb7727 1781 *
68fde492 1782 * Finishes an operation started with hostnamed_hostname1_call_set_icon_name().
86cb7727 1783 *
355f60ae 1784 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
86cb7727 1785 */
355f60ae 1786gboolean
68fde492 1787hostnamed_hostname1_call_set_icon_name_finish (
1788 hostnamedHostname1 *proxy,
355f60ae 1789 GAsyncResult *res,
1790 GError **error)
86cb7727 1791{
355f60ae 1792 GVariant *_ret;
1793 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1794 if (_ret == NULL)
1795 goto _out;
1796 g_variant_get (_ret,
1797 "()");
1798 g_variant_unref (_ret);
1799_out:
1800 return _ret != NULL;
86cb7727 1801}
1802
1803/**
68fde492 1804 * hostnamed_hostname1_call_set_icon_name_sync:
1805 * @proxy: A #hostnamedHostname1Proxy.
355f60ae 1806 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1807 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1808 * @cancellable: (allow-none): A #GCancellable or %NULL.
1809 * @error: Return location for error or %NULL.
86cb7727 1810 *
355f60ae 1811 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-hostname1.SetIconName">SetIconName()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
86cb7727 1812 *
68fde492 1813 * See hostnamed_hostname1_call_set_icon_name() for the asynchronous version of this method.
86cb7727 1814 *
355f60ae 1815 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
86cb7727 1816 */
355f60ae 1817gboolean
68fde492 1818hostnamed_hostname1_call_set_icon_name_sync (
1819 hostnamedHostname1 *proxy,
355f60ae 1820 const gchar *arg_unnamed_arg0,
1821 gboolean arg_unnamed_arg1,
1822 GCancellable *cancellable,
1823 GError **error)
86cb7727 1824{
355f60ae 1825 GVariant *_ret;
1826 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1827 "SetIconName",
1828 g_variant_new ("(sb)",
1829 arg_unnamed_arg0,
1830 arg_unnamed_arg1),
1831 G_DBUS_CALL_FLAGS_NONE,
1832 -1,
1833 cancellable,
1834 error);
1835 if (_ret == NULL)
1836 goto _out;
1837 g_variant_get (_ret,
1838 "()");
1839 g_variant_unref (_ret);
1840_out:
1841 return _ret != NULL;
86cb7727 1842}
1843
1844/**
68fde492 1845 * hostnamed_hostname1_call_set_chassis:
1846 * @proxy: A #hostnamedHostname1Proxy.
355f60ae 1847 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1848 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1849 * @cancellable: (allow-none): A #GCancellable or %NULL.
1850 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1851 * @user_data: User data to pass to @callback.
86cb7727 1852 *
355f60ae 1853 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-hostname1.SetChassis">SetChassis()</link> D-Bus method on @proxy.
1854 * 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.
68fde492 1855 * You can then call hostnamed_hostname1_call_set_chassis_finish() to get the result of the operation.
86cb7727 1856 *
68fde492 1857 * See hostnamed_hostname1_call_set_chassis_sync() for the synchronous, blocking version of this method.
86cb7727 1858 */
355f60ae 1859void
68fde492 1860hostnamed_hostname1_call_set_chassis (
1861 hostnamedHostname1 *proxy,
355f60ae 1862 const gchar *arg_unnamed_arg0,
1863 gboolean arg_unnamed_arg1,
1864 GCancellable *cancellable,
1865 GAsyncReadyCallback callback,
1866 gpointer user_data)
86cb7727 1867{
355f60ae 1868 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1869 "SetChassis",
1870 g_variant_new ("(sb)",
1871 arg_unnamed_arg0,
1872 arg_unnamed_arg1),
1873 G_DBUS_CALL_FLAGS_NONE,
1874 -1,
1875 cancellable,
1876 callback,
1877 user_data);
86cb7727 1878}
1879
1880/**
68fde492 1881 * hostnamed_hostname1_call_set_chassis_finish:
1882 * @proxy: A #hostnamedHostname1Proxy.
1883 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostnamed_hostname1_call_set_chassis().
355f60ae 1884 * @error: Return location for error or %NULL.
86cb7727 1885 *
68fde492 1886 * Finishes an operation started with hostnamed_hostname1_call_set_chassis().
86cb7727 1887 *
355f60ae 1888 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
86cb7727 1889 */
355f60ae 1890gboolean
68fde492 1891hostnamed_hostname1_call_set_chassis_finish (
1892 hostnamedHostname1 *proxy,
355f60ae 1893 GAsyncResult *res,
1894 GError **error)
86cb7727 1895{
355f60ae 1896 GVariant *_ret;
1897 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1898 if (_ret == NULL)
1899 goto _out;
1900 g_variant_get (_ret,
1901 "()");
1902 g_variant_unref (_ret);
1903_out:
1904 return _ret != NULL;
86cb7727 1905}
1906
1907/**
68fde492 1908 * hostnamed_hostname1_call_set_chassis_sync:
1909 * @proxy: A #hostnamedHostname1Proxy.
355f60ae 1910 * @arg_unnamed_arg0: Argument to pass with the method invocation.
1911 * @arg_unnamed_arg1: Argument to pass with the method invocation.
1912 * @cancellable: (allow-none): A #GCancellable or %NULL.
1913 * @error: Return location for error or %NULL.
86cb7727 1914 *
355f60ae 1915 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-hostname1.SetChassis">SetChassis()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
86cb7727 1916 *
68fde492 1917 * See hostnamed_hostname1_call_set_chassis() for the asynchronous version of this method.
86cb7727 1918 *
355f60ae 1919 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
86cb7727 1920 */
355f60ae 1921gboolean
68fde492 1922hostnamed_hostname1_call_set_chassis_sync (
1923 hostnamedHostname1 *proxy,
355f60ae 1924 const gchar *arg_unnamed_arg0,
1925 gboolean arg_unnamed_arg1,
1926 GCancellable *cancellable,
1927 GError **error)
86cb7727 1928{
355f60ae 1929 GVariant *_ret;
1930 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1931 "SetChassis",
1932 g_variant_new ("(sb)",
1933 arg_unnamed_arg0,
1934 arg_unnamed_arg1),
1935 G_DBUS_CALL_FLAGS_NONE,
1936 -1,
1937 cancellable,
1938 error);
1939 if (_ret == NULL)
1940 goto _out;
1941 g_variant_get (_ret,
1942 "()");
1943 g_variant_unref (_ret);
1944_out:
1945 return _ret != NULL;
86cb7727 1946}
1947
1948/**
68fde492 1949 * hostnamed_hostname1_complete_set_hostname:
1950 * @object: A #hostnamedHostname1.
355f60ae 1951 * @invocation: (transfer full): A #GDBusMethodInvocation.
86cb7727 1952 *
355f60ae 1953 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-hostname1.SetHostname">SetHostname()</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.
86cb7727 1954 *
355f60ae 1955 * This method will free @invocation, you cannot use it afterwards.
86cb7727 1956 */
355f60ae 1957void
68fde492 1958hostnamed_hostname1_complete_set_hostname (
1959 hostnamedHostname1 *object,
355f60ae 1960 GDBusMethodInvocation *invocation)
86cb7727 1961{
355f60ae 1962 g_dbus_method_invocation_return_value (invocation,
1963 g_variant_new ("()"));
86cb7727 1964}
1965
1966/**
68fde492 1967 * hostnamed_hostname1_complete_set_static_hostname:
1968 * @object: A #hostnamedHostname1.
355f60ae 1969 * @invocation: (transfer full): A #GDBusMethodInvocation.
86cb7727 1970 *
355f60ae 1971 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-hostname1.SetStaticHostname">SetStaticHostname()</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.
86cb7727 1972 *
355f60ae 1973 * This method will free @invocation, you cannot use it afterwards.
86cb7727 1974 */
1975void
68fde492 1976hostnamed_hostname1_complete_set_static_hostname (
1977 hostnamedHostname1 *object,
355f60ae 1978 GDBusMethodInvocation *invocation)
86cb7727 1979{
355f60ae 1980 g_dbus_method_invocation_return_value (invocation,
1981 g_variant_new ("()"));
86cb7727 1982}
1983
1984/**
68fde492 1985 * hostnamed_hostname1_complete_set_pretty_hostname:
1986 * @object: A #hostnamedHostname1.
355f60ae 1987 * @invocation: (transfer full): A #GDBusMethodInvocation.
86cb7727 1988 *
355f60ae 1989 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-hostname1.SetPrettyHostname">SetPrettyHostname()</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.
86cb7727 1990 *
355f60ae 1991 * This method will free @invocation, you cannot use it afterwards.
86cb7727 1992 */
1993void
68fde492 1994hostnamed_hostname1_complete_set_pretty_hostname (
1995 hostnamedHostname1 *object,
355f60ae 1996 GDBusMethodInvocation *invocation)
86cb7727 1997{
355f60ae 1998 g_dbus_method_invocation_return_value (invocation,
1999 g_variant_new ("()"));
86cb7727 2000}
2001
2002/**
68fde492 2003 * hostnamed_hostname1_complete_set_icon_name:
2004 * @object: A #hostnamedHostname1.
355f60ae 2005 * @invocation: (transfer full): A #GDBusMethodInvocation.
86cb7727 2006 *
355f60ae 2007 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-hostname1.SetIconName">SetIconName()</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.
86cb7727 2008 *
355f60ae 2009 * This method will free @invocation, you cannot use it afterwards.
86cb7727 2010 */
355f60ae 2011void
68fde492 2012hostnamed_hostname1_complete_set_icon_name (
2013 hostnamedHostname1 *object,
355f60ae 2014 GDBusMethodInvocation *invocation)
86cb7727 2015{
355f60ae 2016 g_dbus_method_invocation_return_value (invocation,
2017 g_variant_new ("()"));
86cb7727 2018}
2019
2020/**
68fde492 2021 * hostnamed_hostname1_complete_set_chassis:
2022 * @object: A #hostnamedHostname1.
355f60ae 2023 * @invocation: (transfer full): A #GDBusMethodInvocation.
86cb7727 2024 *
355f60ae 2025 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-hostname1.SetChassis">SetChassis()</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.
86cb7727 2026 *
355f60ae 2027 * This method will free @invocation, you cannot use it afterwards.
86cb7727 2028 */
355f60ae 2029void
68fde492 2030hostnamed_hostname1_complete_set_chassis (
2031 hostnamedHostname1 *object,
355f60ae 2032 GDBusMethodInvocation *invocation)
86cb7727 2033{
355f60ae 2034 g_dbus_method_invocation_return_value (invocation,
2035 g_variant_new ("()"));
86cb7727 2036}
2037
355f60ae 2038/* ------------------------------------------------------------------------ */
2039
86cb7727 2040/**
68fde492 2041 * hostnamedHostname1Proxy:
86cb7727 2042 *
68fde492 2043 * The #hostnamedHostname1Proxy structure contains only private data and should only be accessed using the provided API.
355f60ae 2044 */
2045
2046/**
68fde492 2047 * hostnamedHostname1ProxyClass:
355f60ae 2048 * @parent_class: The parent class.
86cb7727 2049 *
68fde492 2050 * Class structure for #hostnamedHostname1Proxy.
86cb7727 2051 */
355f60ae 2052
68fde492 2053struct _hostnamedHostname1ProxyPrivate
86cb7727 2054{
355f60ae 2055 GData *qdata;
2056};
2057
68fde492 2058static void hostnamed_hostname1_proxy_iface_init (hostnamedHostname1Iface *iface);
355f60ae 2059
2060#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
68fde492 2061G_DEFINE_TYPE_WITH_CODE (hostnamedHostname1Proxy, hostnamed_hostname1_proxy, G_TYPE_DBUS_PROXY,
2062 G_ADD_PRIVATE (hostnamedHostname1Proxy)
2063 G_IMPLEMENT_INTERFACE (HOSTNAMED_TYPE_HOSTNAME1, hostnamed_hostname1_proxy_iface_init));
355f60ae 2064
2065#else
68fde492 2066G_DEFINE_TYPE_WITH_CODE (hostnamedHostname1Proxy, hostnamed_hostname1_proxy, G_TYPE_DBUS_PROXY,
2067 G_IMPLEMENT_INTERFACE (HOSTNAMED_TYPE_HOSTNAME1, hostnamed_hostname1_proxy_iface_init));
355f60ae 2068
2069#endif
2070static void
68fde492 2071hostnamed_hostname1_proxy_finalize (GObject *object)
355f60ae 2072{
68fde492 2073 hostnamedHostname1Proxy *proxy = HOSTNAMED_HOSTNAME1_PROXY (object);
355f60ae 2074 g_datalist_clear (&proxy->priv->qdata);
68fde492 2075 G_OBJECT_CLASS (hostnamed_hostname1_proxy_parent_class)->finalize (object);
355f60ae 2076}
2077
2078static void
68fde492 2079hostnamed_hostname1_proxy_get_property (GObject *object,
355f60ae 2080 guint prop_id,
2081 GValue *value,
2082 GParamSpec *pspec G_GNUC_UNUSED)
2083{
2084 const _ExtendedGDBusPropertyInfo *info;
2085 GVariant *variant;
2086 g_assert (prop_id != 0 && prop_id - 1 < 10);
68fde492 2087 info = _hostnamed_hostname1_property_info_pointers[prop_id - 1];
355f60ae 2088 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
2089 if (info->use_gvariant)
2090 {
2091 g_value_set_variant (value, variant);
2092 }
2093 else
2094 {
2095 if (variant != NULL)
2096 g_dbus_gvariant_to_gvalue (variant, value);
2097 }
2098 if (variant != NULL)
2099 g_variant_unref (variant);
2100}
2101
2102static void
68fde492 2103hostnamed_hostname1_proxy_set_property_cb (GDBusProxy *proxy,
355f60ae 2104 GAsyncResult *res,
2105 gpointer user_data)
2106{
2107 const _ExtendedGDBusPropertyInfo *info = user_data;
2108 GError *error;
2109 GVariant *_ret;
2110 error = NULL;
2111 _ret = g_dbus_proxy_call_finish (proxy, res, &error);
2112 if (!_ret)
2113 {
2114 g_warning ("Error setting property '%s' on interface org.freedesktop.hostname1: %s (%s, %d)",
2115 info->parent_struct.name,
2116 error->message, g_quark_to_string (error->domain), error->code);
2117 g_error_free (error);
2118 }
2119 else
2120 {
2121 g_variant_unref (_ret);
2122 }
2123}
2124
2125static void
68fde492 2126hostnamed_hostname1_proxy_set_property (GObject *object,
355f60ae 2127 guint prop_id,
2128 const GValue *value,
2129 GParamSpec *pspec G_GNUC_UNUSED)
2130{
2131 const _ExtendedGDBusPropertyInfo *info;
2132 GVariant *variant;
2133 g_assert (prop_id != 0 && prop_id - 1 < 10);
68fde492 2134 info = _hostnamed_hostname1_property_info_pointers[prop_id - 1];
355f60ae 2135 variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
2136 g_dbus_proxy_call (G_DBUS_PROXY (object),
2137 "org.freedesktop.DBus.Properties.Set",
2138 g_variant_new ("(ssv)", "org.freedesktop.hostname1", info->parent_struct.name, variant),
86cb7727 2139 G_DBUS_CALL_FLAGS_NONE,
2140 -1,
68fde492 2141 NULL, (GAsyncReadyCallback) hostnamed_hostname1_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
355f60ae 2142 g_variant_unref (variant);
2143}
2144
2145static void
68fde492 2146hostnamed_hostname1_proxy_g_signal (GDBusProxy *proxy,
355f60ae 2147 const gchar *sender_name G_GNUC_UNUSED,
2148 const gchar *signal_name,
2149 GVariant *parameters)
2150{
2151 _ExtendedGDBusSignalInfo *info;
2152 GVariantIter iter;
2153 GVariant *child;
2154 GValue *paramv;
2155 guint num_params;
2156 guint n;
2157 guint signal_id;
68fde492 2158 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_hostnamed_hostname1_interface_info.parent_struct, signal_name);
355f60ae 2159 if (info == NULL)
2160 return;
2161 num_params = g_variant_n_children (parameters);
2162 paramv = g_new0 (GValue, num_params + 1);
68fde492 2163 g_value_init (&paramv[0], HOSTNAMED_TYPE_HOSTNAME1);
355f60ae 2164 g_value_set_object (&paramv[0], proxy);
2165 g_variant_iter_init (&iter, parameters);
2166 n = 1;
2167 while ((child = g_variant_iter_next_value (&iter)) != NULL)
2168 {
2169 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
2170 if (arg_info->use_gvariant)
2171 {
2172 g_value_init (&paramv[n], G_TYPE_VARIANT);
2173 g_value_set_variant (&paramv[n], child);
2174 n++;
2175 }
2176 else
2177 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
2178 g_variant_unref (child);
2179 }
68fde492 2180 signal_id = g_signal_lookup (info->signal_name, HOSTNAMED_TYPE_HOSTNAME1);
355f60ae 2181 g_signal_emitv (paramv, signal_id, 0, NULL);
2182 for (n = 0; n < num_params + 1; n++)
2183 g_value_unset (&paramv[n]);
2184 g_free (paramv);
2185}
2186
2187static void
68fde492 2188hostnamed_hostname1_proxy_g_properties_changed (GDBusProxy *_proxy,
355f60ae 2189 GVariant *changed_properties,
2190 const gchar *const *invalidated_properties)
2191{
68fde492 2192 hostnamedHostname1Proxy *proxy = HOSTNAMED_HOSTNAME1_PROXY (_proxy);
355f60ae 2193 guint n;
2194 const gchar *key;
2195 GVariantIter *iter;
2196 _ExtendedGDBusPropertyInfo *info;
2197 g_variant_get (changed_properties, "a{sv}", &iter);
2198 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
2199 {
68fde492 2200 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_hostnamed_hostname1_interface_info.parent_struct, key);
355f60ae 2201 g_datalist_remove_data (&proxy->priv->qdata, key);
2202 if (info != NULL)
2203 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
2204 }
2205 g_variant_iter_free (iter);
2206 for (n = 0; invalidated_properties[n] != NULL; n++)
2207 {
68fde492 2208 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_hostnamed_hostname1_interface_info.parent_struct, invalidated_properties[n]);
355f60ae 2209 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
2210 if (info != NULL)
2211 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
2212 }
86cb7727 2213}
2214
355f60ae 2215static const gchar *
68fde492 2216hostnamed_hostname1_proxy_get_hostname (hostnamedHostname1 *object)
86cb7727 2217{
68fde492 2218 hostnamedHostname1Proxy *proxy = HOSTNAMED_HOSTNAME1_PROXY (object);
355f60ae 2219 GVariant *variant;
2220 const gchar *value = NULL;
2221 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Hostname");
2222 if (variant != NULL)
2223 {
2224 value = g_variant_get_string (variant, NULL);
2225 g_variant_unref (variant);
2226 }
2227 return value;
86cb7727 2228}
2229
355f60ae 2230static const gchar *
68fde492 2231hostnamed_hostname1_proxy_get_static_hostname (hostnamedHostname1 *object)
86cb7727 2232{
68fde492 2233 hostnamedHostname1Proxy *proxy = HOSTNAMED_HOSTNAME1_PROXY (object);
355f60ae 2234 GVariant *variant;
2235 const gchar *value = NULL;
2236 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "StaticHostname");
2237 if (variant != NULL)
2238 {
2239 value = g_variant_get_string (variant, NULL);
2240 g_variant_unref (variant);
2241 }
2242 return value;
86cb7727 2243}
2244
355f60ae 2245static const gchar *
68fde492 2246hostnamed_hostname1_proxy_get_pretty_hostname (hostnamedHostname1 *object)
86cb7727 2247{
68fde492 2248 hostnamedHostname1Proxy *proxy = HOSTNAMED_HOSTNAME1_PROXY (object);
355f60ae 2249 GVariant *variant;
2250 const gchar *value = NULL;
2251 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "PrettyHostname");
2252 if (variant != NULL)
2253 {
2254 value = g_variant_get_string (variant, NULL);
2255 g_variant_unref (variant);
2256 }
2257 return value;
86cb7727 2258}
2259
355f60ae 2260static const gchar *
68fde492 2261hostnamed_hostname1_proxy_get_icon_name (hostnamedHostname1 *object)
86cb7727 2262{
68fde492 2263 hostnamedHostname1Proxy *proxy = HOSTNAMED_HOSTNAME1_PROXY (object);
355f60ae 2264 GVariant *variant;
2265 const gchar *value = NULL;
2266 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "IconName");
2267 if (variant != NULL)
2268 {
2269 value = g_variant_get_string (variant, NULL);
2270 g_variant_unref (variant);
2271 }
2272 return value;
86cb7727 2273}
2274
355f60ae 2275static const gchar *
68fde492 2276hostnamed_hostname1_proxy_get_chassis (hostnamedHostname1 *object)
86cb7727 2277{
68fde492 2278 hostnamedHostname1Proxy *proxy = HOSTNAMED_HOSTNAME1_PROXY (object);
355f60ae 2279 GVariant *variant;
2280 const gchar *value = NULL;
2281 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Chassis");
2282 if (variant != NULL)
2283 {
2284 value = g_variant_get_string (variant, NULL);
2285 g_variant_unref (variant);
2286 }
2287 return value;
86cb7727 2288}
2289
355f60ae 2290static const gchar *
68fde492 2291hostnamed_hostname1_proxy_get_kernel_name (hostnamedHostname1 *object)
86cb7727 2292{
68fde492 2293 hostnamedHostname1Proxy *proxy = HOSTNAMED_HOSTNAME1_PROXY (object);
355f60ae 2294 GVariant *variant;
2295 const gchar *value = NULL;
2296 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "KernelName");
2297 if (variant != NULL)
2298 {
2299 value = g_variant_get_string (variant, NULL);
2300 g_variant_unref (variant);
2301 }
2302 return value;
86cb7727 2303}
2304
355f60ae 2305static const gchar *
68fde492 2306hostnamed_hostname1_proxy_get_kernel_release (hostnamedHostname1 *object)
86cb7727 2307{
68fde492 2308 hostnamedHostname1Proxy *proxy = HOSTNAMED_HOSTNAME1_PROXY (object);
355f60ae 2309 GVariant *variant;
2310 const gchar *value = NULL;
2311 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "KernelRelease");
2312 if (variant != NULL)
2313 {
2314 value = g_variant_get_string (variant, NULL);
2315 g_variant_unref (variant);
2316 }
2317 return value;
86cb7727 2318}
2319
355f60ae 2320static const gchar *
68fde492 2321hostnamed_hostname1_proxy_get_kernel_version (hostnamedHostname1 *object)
86cb7727 2322{
68fde492 2323 hostnamedHostname1Proxy *proxy = HOSTNAMED_HOSTNAME1_PROXY (object);
355f60ae 2324 GVariant *variant;
2325 const gchar *value = NULL;
2326 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "KernelVersion");
2327 if (variant != NULL)
2328 {
2329 value = g_variant_get_string (variant, NULL);
2330 g_variant_unref (variant);
2331 }
2332 return value;
7ce16a35 2333}
2334
355f60ae 2335static const gchar *
68fde492 2336hostnamed_hostname1_proxy_get_operating_system_pretty_name (hostnamedHostname1 *object)
7ce16a35 2337{
68fde492 2338 hostnamedHostname1Proxy *proxy = HOSTNAMED_HOSTNAME1_PROXY (object);
355f60ae 2339 GVariant *variant;
2340 const gchar *value = NULL;
2341 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "OperatingSystemPrettyName");
2342 if (variant != NULL)
2343 {
2344 value = g_variant_get_string (variant, NULL);
2345 g_variant_unref (variant);
2346 }
2347 return value;
7ce16a35 2348}
2349
355f60ae 2350static const gchar *
68fde492 2351hostnamed_hostname1_proxy_get_operating_system_cpename (hostnamedHostname1 *object)
7ce16a35 2352{
68fde492 2353 hostnamedHostname1Proxy *proxy = HOSTNAMED_HOSTNAME1_PROXY (object);
355f60ae 2354 GVariant *variant;
2355 const gchar *value = NULL;
2356 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "OperatingSystemCPEName");
2357 if (variant != NULL)
2358 {
2359 value = g_variant_get_string (variant, NULL);
2360 g_variant_unref (variant);
2361 }
2362 return value;
7ce16a35 2363}
2364
355f60ae 2365static void
68fde492 2366hostnamed_hostname1_proxy_init (hostnamedHostname1Proxy *proxy)
7ce16a35 2367{
355f60ae 2368#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
68fde492 2369 proxy->priv = hostnamed_hostname1_proxy_get_instance_private (proxy);
355f60ae 2370#else
68fde492 2371 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, HOSTNAMED_TYPE_HOSTNAME1_PROXY, hostnamedHostname1ProxyPrivate);
355f60ae 2372#endif
2373
68fde492 2374 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), hostnamed_hostname1_interface_info ());
355f60ae 2375}
2376
2377static void
68fde492 2378hostnamed_hostname1_proxy_class_init (hostnamedHostname1ProxyClass *klass)
355f60ae 2379{
2380 GObjectClass *gobject_class;
2381 GDBusProxyClass *proxy_class;
2382
2383 gobject_class = G_OBJECT_CLASS (klass);
68fde492 2384 gobject_class->finalize = hostnamed_hostname1_proxy_finalize;
2385 gobject_class->get_property = hostnamed_hostname1_proxy_get_property;
2386 gobject_class->set_property = hostnamed_hostname1_proxy_set_property;
355f60ae 2387
2388 proxy_class = G_DBUS_PROXY_CLASS (klass);
68fde492 2389 proxy_class->g_signal = hostnamed_hostname1_proxy_g_signal;
2390 proxy_class->g_properties_changed = hostnamed_hostname1_proxy_g_properties_changed;
355f60ae 2391
68fde492 2392 hostnamed_hostname1_override_properties (gobject_class, 1);
355f60ae 2393
2394#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
68fde492 2395 g_type_class_add_private (klass, sizeof (hostnamedHostname1ProxyPrivate));
355f60ae 2396#endif
86cb7727 2397}
2398
355f60ae 2399static void
68fde492 2400hostnamed_hostname1_proxy_iface_init (hostnamedHostname1Iface *iface)
86cb7727 2401{
68fde492 2402 iface->get_hostname = hostnamed_hostname1_proxy_get_hostname;
2403 iface->get_static_hostname = hostnamed_hostname1_proxy_get_static_hostname;
2404 iface->get_pretty_hostname = hostnamed_hostname1_proxy_get_pretty_hostname;
2405 iface->get_icon_name = hostnamed_hostname1_proxy_get_icon_name;
2406 iface->get_chassis = hostnamed_hostname1_proxy_get_chassis;
2407 iface->get_kernel_name = hostnamed_hostname1_proxy_get_kernel_name;
2408 iface->get_kernel_release = hostnamed_hostname1_proxy_get_kernel_release;
2409 iface->get_kernel_version = hostnamed_hostname1_proxy_get_kernel_version;
2410 iface->get_operating_system_pretty_name = hostnamed_hostname1_proxy_get_operating_system_pretty_name;
2411 iface->get_operating_system_cpename = hostnamed_hostname1_proxy_get_operating_system_cpename;
86cb7727 2412}
2413
2414/**
68fde492 2415 * hostnamed_hostname1_proxy_new:
355f60ae 2416 * @connection: A #GDBusConnection.
2417 * @flags: Flags from the #GDBusProxyFlags enumeration.
2418 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
2419 * @object_path: An object path.
2420 * @cancellable: (allow-none): A #GCancellable or %NULL.
2421 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
2422 * @user_data: User data to pass to @callback.
86cb7727 2423 *
355f60ae 2424 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-hostname1.top_of_page">org.freedesktop.hostname1</link>. See g_dbus_proxy_new() for more details.
86cb7727 2425 *
355f60ae 2426 * 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.
68fde492 2427 * You can then call hostnamed_hostname1_proxy_new_finish() to get the result of the operation.
355f60ae 2428 *
68fde492 2429 * See hostnamed_hostname1_proxy_new_sync() for the synchronous, blocking version of this constructor.
86cb7727 2430 */
2431void
68fde492 2432hostnamed_hostname1_proxy_new (
355f60ae 2433 GDBusConnection *connection,
2434 GDBusProxyFlags flags,
2435 const gchar *name,
2436 const gchar *object_path,
2437 GCancellable *cancellable,
2438 GAsyncReadyCallback callback,
2439 gpointer user_data)
86cb7727 2440{
68fde492 2441 g_async_initable_new_async (HOSTNAMED_TYPE_HOSTNAME1_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.hostname1", NULL);
86cb7727 2442}
2443
2444/**
68fde492 2445 * hostnamed_hostname1_proxy_new_finish:
2446 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostnamed_hostname1_proxy_new().
355f60ae 2447 * @error: Return location for error or %NULL
86cb7727 2448 *
68fde492 2449 * Finishes an operation started with hostnamed_hostname1_proxy_new().
86cb7727 2450 *
68fde492 2451 * Returns: (transfer full) (type hostnamedHostname1Proxy): The constructed proxy object or %NULL if @error is set.
86cb7727 2452 */
68fde492 2453hostnamedHostname1 *
2454hostnamed_hostname1_proxy_new_finish (
355f60ae 2455 GAsyncResult *res,
2456 GError **error)
86cb7727 2457{
355f60ae 2458 GObject *ret;
2459 GObject *source_object;
2460 source_object = g_async_result_get_source_object (res);
2461 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
2462 g_object_unref (source_object);
2463 if (ret != NULL)
68fde492 2464 return HOSTNAMED_HOSTNAME1 (ret);
355f60ae 2465 else
2466 return NULL;
86cb7727 2467}
2468
2469/**
68fde492 2470 * hostnamed_hostname1_proxy_new_sync:
355f60ae 2471 * @connection: A #GDBusConnection.
2472 * @flags: Flags from the #GDBusProxyFlags enumeration.
2473 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
2474 * @object_path: An object path.
2475 * @cancellable: (allow-none): A #GCancellable or %NULL.
2476 * @error: Return location for error or %NULL
86cb7727 2477 *
355f60ae 2478 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-hostname1.top_of_page">org.freedesktop.hostname1</link>. See g_dbus_proxy_new_sync() for more details.
86cb7727 2479 *
355f60ae 2480 * The calling thread is blocked until a reply is received.
2481 *
68fde492 2482 * See hostnamed_hostname1_proxy_new() for the asynchronous version of this constructor.
355f60ae 2483 *
68fde492 2484 * Returns: (transfer full) (type hostnamedHostname1Proxy): The constructed proxy object or %NULL if @error is set.
86cb7727 2485 */
68fde492 2486hostnamedHostname1 *
2487hostnamed_hostname1_proxy_new_sync (
355f60ae 2488 GDBusConnection *connection,
2489 GDBusProxyFlags flags,
2490 const gchar *name,
2491 const gchar *object_path,
2492 GCancellable *cancellable,
2493 GError **error)
86cb7727 2494{
355f60ae 2495 GInitable *ret;
68fde492 2496 ret = g_initable_new (HOSTNAMED_TYPE_HOSTNAME1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.hostname1", NULL);
355f60ae 2497 if (ret != NULL)
68fde492 2498 return HOSTNAMED_HOSTNAME1 (ret);
355f60ae 2499 else
2500 return NULL;
86cb7727 2501}
2502
355f60ae 2503
7ce16a35 2504/**
68fde492 2505 * hostnamed_hostname1_proxy_new_for_bus:
355f60ae 2506 * @bus_type: A #GBusType.
2507 * @flags: Flags from the #GDBusProxyFlags enumeration.
2508 * @name: A bus name (well-known or unique).
2509 * @object_path: An object path.
2510 * @cancellable: (allow-none): A #GCancellable or %NULL.
2511 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
2512 * @user_data: User data to pass to @callback.
7ce16a35 2513 *
68fde492 2514 * Like hostnamed_hostname1_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
7ce16a35 2515 *
355f60ae 2516 * 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.
68fde492 2517 * You can then call hostnamed_hostname1_proxy_new_for_bus_finish() to get the result of the operation.
355f60ae 2518 *
68fde492 2519 * See hostnamed_hostname1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
7ce16a35 2520 */
2521void
68fde492 2522hostnamed_hostname1_proxy_new_for_bus (
355f60ae 2523 GBusType bus_type,
2524 GDBusProxyFlags flags,
2525 const gchar *name,
2526 const gchar *object_path,
2527 GCancellable *cancellable,
2528 GAsyncReadyCallback callback,
2529 gpointer user_data)
7ce16a35 2530{
68fde492 2531 g_async_initable_new_async (HOSTNAMED_TYPE_HOSTNAME1_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.hostname1", NULL);
7ce16a35 2532}
2533
86cb7727 2534/**
68fde492 2535 * hostnamed_hostname1_proxy_new_for_bus_finish:
2536 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostnamed_hostname1_proxy_new_for_bus().
355f60ae 2537 * @error: Return location for error or %NULL
86cb7727 2538 *
68fde492 2539 * Finishes an operation started with hostnamed_hostname1_proxy_new_for_bus().
86cb7727 2540 *
68fde492 2541 * Returns: (transfer full) (type hostnamedHostname1Proxy): The constructed proxy object or %NULL if @error is set.
86cb7727 2542 */
68fde492 2543hostnamedHostname1 *
2544hostnamed_hostname1_proxy_new_for_bus_finish (
355f60ae 2545 GAsyncResult *res,
2546 GError **error)
86cb7727 2547{
355f60ae 2548 GObject *ret;
2549 GObject *source_object;
2550 source_object = g_async_result_get_source_object (res);
2551 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
2552 g_object_unref (source_object);
2553 if (ret != NULL)
68fde492 2554 return HOSTNAMED_HOSTNAME1 (ret);
86cb7727 2555 else
355f60ae 2556 return NULL;
86cb7727 2557}
2558
355f60ae 2559/**
68fde492 2560 * hostnamed_hostname1_proxy_new_for_bus_sync:
355f60ae 2561 * @bus_type: A #GBusType.
2562 * @flags: Flags from the #GDBusProxyFlags enumeration.
2563 * @name: A bus name (well-known or unique).
2564 * @object_path: An object path.
2565 * @cancellable: (allow-none): A #GCancellable or %NULL.
2566 * @error: Return location for error or %NULL
2567 *
68fde492 2568 * Like hostnamed_hostname1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
355f60ae 2569 *
2570 * The calling thread is blocked until a reply is received.
2571 *
68fde492 2572 * See hostnamed_hostname1_proxy_new_for_bus() for the asynchronous version of this constructor.
355f60ae 2573 *
68fde492 2574 * Returns: (transfer full) (type hostnamedHostname1Proxy): The constructed proxy object or %NULL if @error is set.
355f60ae 2575 */
68fde492 2576hostnamedHostname1 *
2577hostnamed_hostname1_proxy_new_for_bus_sync (
355f60ae 2578 GBusType bus_type,
2579 GDBusProxyFlags flags,
2580 const gchar *name,
2581 const gchar *object_path,
2582 GCancellable *cancellable,
2583 GError **error)
86cb7727 2584{
355f60ae 2585 GInitable *ret;
68fde492 2586 ret = g_initable_new (HOSTNAMED_TYPE_HOSTNAME1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.hostname1", NULL);
355f60ae 2587 if (ret != NULL)
68fde492 2588 return HOSTNAMED_HOSTNAME1 (ret);
86cb7727 2589 else
355f60ae 2590 return NULL;
86cb7727 2591}
2592
355f60ae 2593
2594/* ------------------------------------------------------------------------ */
2595
2596/**
68fde492 2597 * hostnamedHostname1Skeleton:
355f60ae 2598 *
68fde492 2599 * The #hostnamedHostname1Skeleton structure contains only private data and should only be accessed using the provided API.
355f60ae 2600 */
2601
2602/**
68fde492 2603 * hostnamedHostname1SkeletonClass:
355f60ae 2604 * @parent_class: The parent class.
2605 *
68fde492 2606 * Class structure for #hostnamedHostname1Skeleton.
355f60ae 2607 */
2608
68fde492 2609struct _hostnamedHostname1SkeletonPrivate
86cb7727 2610{
355f60ae 2611 GValue *properties;
2612 GList *changed_properties;
2613 GSource *changed_properties_idle_source;
2614 GMainContext *context;
2615 GMutex lock;
2616};
86cb7727 2617
2618static void
68fde492 2619_hostnamed_hostname1_skeleton_handle_method_call (
355f60ae 2620 GDBusConnection *connection G_GNUC_UNUSED,
2621 const gchar *sender G_GNUC_UNUSED,
2622 const gchar *object_path G_GNUC_UNUSED,
2623 const gchar *interface_name,
2624 const gchar *method_name,
2625 GVariant *parameters,
2626 GDBusMethodInvocation *invocation,
2627 gpointer user_data)
86cb7727 2628{
68fde492 2629 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (user_data);
355f60ae 2630 _ExtendedGDBusMethodInfo *info;
86cb7727 2631 GVariantIter iter;
2632 GVariant *child;
2633 GValue *paramv;
2634 guint num_params;
355f60ae 2635 guint num_extra;
86cb7727 2636 guint n;
2637 guint signal_id;
355f60ae 2638 GValue return_value = G_VALUE_INIT;
2639 info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
2640 g_assert (info != NULL);
86cb7727 2641 num_params = g_variant_n_children (parameters);
355f60ae 2642 num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
2643 n = 0;
68fde492 2644 g_value_init (&paramv[n], HOSTNAMED_TYPE_HOSTNAME1);
355f60ae 2645 g_value_set_object (&paramv[n++], skeleton);
2646 g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
2647 g_value_set_object (&paramv[n++], invocation);
2648 if (info->pass_fdlist)
2649 {
2650#ifdef G_OS_UNIX
2651 g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
2652 g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
2653#else
2654 g_assert_not_reached ();
2655#endif
2656 }
86cb7727 2657 g_variant_iter_init (&iter, parameters);
86cb7727 2658 while ((child = g_variant_iter_next_value (&iter)) != NULL)
2659 {
355f60ae 2660 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
86cb7727 2661 if (arg_info->use_gvariant)
2662 {
2663 g_value_init (&paramv[n], G_TYPE_VARIANT);
2664 g_value_set_variant (&paramv[n], child);
2665 n++;
2666 }
2667 else
2668 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
2669 g_variant_unref (child);
2670 }
68fde492 2671 signal_id = g_signal_lookup (info->signal_name, HOSTNAMED_TYPE_HOSTNAME1);
355f60ae 2672 g_value_init (&return_value, G_TYPE_BOOLEAN);
2673 g_signal_emitv (paramv, signal_id, 0, &return_value);
2674 if (!g_value_get_boolean (&return_value))
2675 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);
2676 g_value_unset (&return_value);
2677 for (n = 0; n < num_params + num_extra; n++)
86cb7727 2678 g_value_unset (&paramv[n]);
2679 g_free (paramv);
2680}
2681
355f60ae 2682static GVariant *
68fde492 2683_hostnamed_hostname1_skeleton_handle_get_property (
355f60ae 2684 GDBusConnection *connection G_GNUC_UNUSED,
2685 const gchar *sender G_GNUC_UNUSED,
2686 const gchar *object_path G_GNUC_UNUSED,
2687 const gchar *interface_name G_GNUC_UNUSED,
2688 const gchar *property_name,
2689 GError **error,
2690 gpointer user_data)
2691{
68fde492 2692 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (user_data);
355f60ae 2693 GValue value = G_VALUE_INIT;
2694 GParamSpec *pspec;
2695 _ExtendedGDBusPropertyInfo *info;
2696 GVariant *ret;
2697 ret = NULL;
68fde492 2698 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_hostnamed_hostname1_interface_info.parent_struct, property_name);
355f60ae 2699 g_assert (info != NULL);
2700 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
2701 if (pspec == NULL)
2702 {
2703 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
2704 }
2705 else
2706 {
2707 g_value_init (&value, pspec->value_type);
2708 g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
2709 ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
2710 g_value_unset (&value);
2711 }
2712 return ret;
2713}
2714
2715static gboolean
68fde492 2716_hostnamed_hostname1_skeleton_handle_set_property (
355f60ae 2717 GDBusConnection *connection G_GNUC_UNUSED,
2718 const gchar *sender G_GNUC_UNUSED,
2719 const gchar *object_path G_GNUC_UNUSED,
2720 const gchar *interface_name G_GNUC_UNUSED,
2721 const gchar *property_name,
2722 GVariant *variant,
2723 GError **error,
2724 gpointer user_data)
2725{
68fde492 2726 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (user_data);
355f60ae 2727 GValue value = G_VALUE_INIT;
2728 GParamSpec *pspec;
2729 _ExtendedGDBusPropertyInfo *info;
2730 gboolean ret;
2731 ret = FALSE;
68fde492 2732 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_hostnamed_hostname1_interface_info.parent_struct, property_name);
355f60ae 2733 g_assert (info != NULL);
2734 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
2735 if (pspec == NULL)
2736 {
2737 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
2738 }
2739 else
2740 {
2741 if (info->use_gvariant)
2742 g_value_set_variant (&value, variant);
2743 else
2744 g_dbus_gvariant_to_gvalue (variant, &value);
2745 g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
2746 g_value_unset (&value);
2747 ret = TRUE;
2748 }
2749 return ret;
2750}
2751
68fde492 2752static const GDBusInterfaceVTable _hostnamed_hostname1_skeleton_vtable =
355f60ae 2753{
68fde492 2754 _hostnamed_hostname1_skeleton_handle_method_call,
2755 _hostnamed_hostname1_skeleton_handle_get_property,
2756 _hostnamed_hostname1_skeleton_handle_set_property,
355f60ae 2757 {NULL}
2758};
2759
2760static GDBusInterfaceInfo *
68fde492 2761hostnamed_hostname1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
355f60ae 2762{
68fde492 2763 return hostnamed_hostname1_interface_info ();
355f60ae 2764}
2765
2766static GDBusInterfaceVTable *
68fde492 2767hostnamed_hostname1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
355f60ae 2768{
68fde492 2769 return (GDBusInterfaceVTable *) &_hostnamed_hostname1_skeleton_vtable;
355f60ae 2770}
2771
2772static GVariant *
68fde492 2773hostnamed_hostname1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
355f60ae 2774{
68fde492 2775 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (_skeleton);
355f60ae 2776
2777 GVariantBuilder builder;
2778 guint n;
2779 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
68fde492 2780 if (_hostnamed_hostname1_interface_info.parent_struct.properties == NULL)
355f60ae 2781 goto out;
68fde492 2782 for (n = 0; _hostnamed_hostname1_interface_info.parent_struct.properties[n] != NULL; n++)
355f60ae 2783 {
68fde492 2784 GDBusPropertyInfo *info = _hostnamed_hostname1_interface_info.parent_struct.properties[n];
355f60ae 2785 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
2786 {
2787 GVariant *value;
68fde492 2788 value = _hostnamed_hostname1_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.hostname1", info->name, NULL, skeleton);
355f60ae 2789 if (value != NULL)
2790 {
2791 g_variant_take_ref (value);
2792 g_variant_builder_add (&builder, "{sv}", info->name, value);
2793 g_variant_unref (value);
2794 }
2795 }
2796 }
2797out:
2798 return g_variant_builder_end (&builder);
2799}
2800
68fde492 2801static gboolean _hostnamed_hostname1_emit_changed (gpointer user_data);
355f60ae 2802
2803static void
68fde492 2804hostnamed_hostname1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
355f60ae 2805{
68fde492 2806 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (_skeleton);
355f60ae 2807 gboolean emit_changed = FALSE;
2808
2809 g_mutex_lock (&skeleton->priv->lock);
2810 if (skeleton->priv->changed_properties_idle_source != NULL)
2811 {
2812 g_source_destroy (skeleton->priv->changed_properties_idle_source);
2813 skeleton->priv->changed_properties_idle_source = NULL;
2814 emit_changed = TRUE;
2815 }
2816 g_mutex_unlock (&skeleton->priv->lock);
2817
2818 if (emit_changed)
68fde492 2819 _hostnamed_hostname1_emit_changed (skeleton);
355f60ae 2820}
2821
68fde492 2822static void hostnamed_hostname1_skeleton_iface_init (hostnamedHostname1Iface *iface);
355f60ae 2823#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
68fde492 2824G_DEFINE_TYPE_WITH_CODE (hostnamedHostname1Skeleton, hostnamed_hostname1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
2825 G_ADD_PRIVATE (hostnamedHostname1Skeleton)
2826 G_IMPLEMENT_INTERFACE (HOSTNAMED_TYPE_HOSTNAME1, hostnamed_hostname1_skeleton_iface_init));
355f60ae 2827
2828#else
68fde492 2829G_DEFINE_TYPE_WITH_CODE (hostnamedHostname1Skeleton, hostnamed_hostname1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
2830 G_IMPLEMENT_INTERFACE (HOSTNAMED_TYPE_HOSTNAME1, hostnamed_hostname1_skeleton_iface_init));
355f60ae 2831
2832#endif
86cb7727 2833static void
68fde492 2834hostnamed_hostname1_skeleton_finalize (GObject *object)
86cb7727 2835{
68fde492 2836 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (object);
86cb7727 2837 guint n;
355f60ae 2838 for (n = 0; n < 10; n++)
2839 g_value_unset (&skeleton->priv->properties[n]);
2840 g_free (skeleton->priv->properties);
2841 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
2842 if (skeleton->priv->changed_properties_idle_source != NULL)
2843 g_source_destroy (skeleton->priv->changed_properties_idle_source);
2844 g_main_context_unref (skeleton->priv->context);
2845 g_mutex_clear (&skeleton->priv->lock);
68fde492 2846 G_OBJECT_CLASS (hostnamed_hostname1_skeleton_parent_class)->finalize (object);
86cb7727 2847}
2848
355f60ae 2849static void
68fde492 2850hostnamed_hostname1_skeleton_get_property (GObject *object,
355f60ae 2851 guint prop_id,
2852 GValue *value,
2853 GParamSpec *pspec G_GNUC_UNUSED)
86cb7727 2854{
68fde492 2855 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (object);
355f60ae 2856 g_assert (prop_id != 0 && prop_id - 1 < 10);
2857 g_mutex_lock (&skeleton->priv->lock);
2858 g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
2859 g_mutex_unlock (&skeleton->priv->lock);
86cb7727 2860}
2861
355f60ae 2862static gboolean
68fde492 2863_hostnamed_hostname1_emit_changed (gpointer user_data)
86cb7727 2864{
68fde492 2865 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (user_data);
355f60ae 2866 GList *l;
2867 GVariantBuilder builder;
2868 GVariantBuilder invalidated_builder;
2869 guint num_changes;
2870
2871 g_mutex_lock (&skeleton->priv->lock);
2872 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
2873 g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
2874 for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
86cb7727 2875 {
355f60ae 2876 ChangedProperty *cp = l->data;
2877 GVariant *variant;
2878 const GValue *cur_value;
2879
2880 cur_value = &skeleton->priv->properties[cp->prop_id - 1];
2881 if (!_g_value_equal (cur_value, &cp->orig_value))
2882 {
2883 variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
2884 g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
2885 g_variant_unref (variant);
2886 num_changes++;
2887 }
86cb7727 2888 }
355f60ae 2889 if (num_changes > 0)
2890 {
2891 GList *connections, *ll;
2892 GVariant *signal_variant;
2893 signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.hostname1",
2894 &builder, &invalidated_builder));
2895 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
2896 for (ll = connections; ll != NULL; ll = ll->next)
2897 {
2898 GDBusConnection *connection = ll->data;
86cb7727 2899
355f60ae 2900 g_dbus_connection_emit_signal (connection,
2901 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
2902 "org.freedesktop.DBus.Properties",
2903 "PropertiesChanged",
2904 signal_variant,
2905 NULL);
2906 }
2907 g_variant_unref (signal_variant);
2908 g_list_free_full (connections, g_object_unref);
2909 }
2910 else
86cb7727 2911 {
355f60ae 2912 g_variant_builder_clear (&builder);
2913 g_variant_builder_clear (&invalidated_builder);
86cb7727 2914 }
355f60ae 2915 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
2916 skeleton->priv->changed_properties = NULL;
2917 skeleton->priv->changed_properties_idle_source = NULL;
2918 g_mutex_unlock (&skeleton->priv->lock);
2919 return FALSE;
86cb7727 2920}
2921
355f60ae 2922static void
68fde492 2923_hostnamed_hostname1_schedule_emit_changed (hostnamedHostname1Skeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
86cb7727 2924{
355f60ae 2925 ChangedProperty *cp;
2926 GList *l;
2927 cp = NULL;
2928 for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
86cb7727 2929 {
355f60ae 2930 ChangedProperty *i_cp = l->data;
2931 if (i_cp->info == info)
2932 {
2933 cp = i_cp;
2934 break;
2935 }
2936 }
2937 if (cp == NULL)
2938 {
2939 cp = g_new0 (ChangedProperty, 1);
2940 cp->prop_id = prop_id;
2941 cp->info = info;
2942 skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
2943 g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
2944 g_value_copy (orig_value, &cp->orig_value);
86cb7727 2945 }
86cb7727 2946}
2947
355f60ae 2948static void
68fde492 2949hostnamed_hostname1_skeleton_notify (GObject *object,
355f60ae 2950 GParamSpec *pspec G_GNUC_UNUSED)
7ce16a35 2951{
68fde492 2952 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (object);
355f60ae 2953 g_mutex_lock (&skeleton->priv->lock);
2954 if (skeleton->priv->changed_properties != NULL &&
2955 skeleton->priv->changed_properties_idle_source == NULL)
7ce16a35 2956 {
355f60ae 2957 skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
2958 g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
68fde492 2959 g_source_set_callback (skeleton->priv->changed_properties_idle_source, _hostnamed_hostname1_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
355f60ae 2960 g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
2961 g_source_unref (skeleton->priv->changed_properties_idle_source);
7ce16a35 2962 }
355f60ae 2963 g_mutex_unlock (&skeleton->priv->lock);
7ce16a35 2964}
2965
355f60ae 2966static void
68fde492 2967hostnamed_hostname1_skeleton_set_property (GObject *object,
355f60ae 2968 guint prop_id,
2969 const GValue *value,
2970 GParamSpec *pspec)
7ce16a35 2971{
68fde492 2972 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (object);
355f60ae 2973 g_assert (prop_id != 0 && prop_id - 1 < 10);
2974 g_mutex_lock (&skeleton->priv->lock);
2975 g_object_freeze_notify (object);
2976 if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
7ce16a35 2977 {
355f60ae 2978 if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
68fde492 2979 _hostnamed_hostname1_schedule_emit_changed (skeleton, _hostnamed_hostname1_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
355f60ae 2980 g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
2981 g_object_notify_by_pspec (object, pspec);
7ce16a35 2982 }
355f60ae 2983 g_mutex_unlock (&skeleton->priv->lock);
2984 g_object_thaw_notify (object);
7ce16a35 2985}
2986
355f60ae 2987static void
68fde492 2988hostnamed_hostname1_skeleton_init (hostnamedHostname1Skeleton *skeleton)
7ce16a35 2989{
355f60ae 2990#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
68fde492 2991 skeleton->priv = hostnamed_hostname1_skeleton_get_instance_private (skeleton);
355f60ae 2992#else
68fde492 2993 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, HOSTNAMED_TYPE_HOSTNAME1_SKELETON, hostnamedHostname1SkeletonPrivate);
355f60ae 2994#endif
2995
2996 g_mutex_init (&skeleton->priv->lock);
2997 skeleton->priv->context = g_main_context_ref_thread_default ();
2998 skeleton->priv->properties = g_new0 (GValue, 10);
2999 g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING);
3000 g_value_init (&skeleton->priv->properties[1], G_TYPE_STRING);
3001 g_value_init (&skeleton->priv->properties[2], G_TYPE_STRING);
3002 g_value_init (&skeleton->priv->properties[3], G_TYPE_STRING);
3003 g_value_init (&skeleton->priv->properties[4], G_TYPE_STRING);
3004 g_value_init (&skeleton->priv->properties[5], G_TYPE_STRING);
3005 g_value_init (&skeleton->priv->properties[6], G_TYPE_STRING);
3006 g_value_init (&skeleton->priv->properties[7], G_TYPE_STRING);
3007 g_value_init (&skeleton->priv->properties[8], G_TYPE_STRING);
3008 g_value_init (&skeleton->priv->properties[9], G_TYPE_STRING);
7ce16a35 3009}
3010
3011static const gchar *
68fde492 3012hostnamed_hostname1_skeleton_get_hostname (hostnamedHostname1 *object)
7ce16a35 3013{
68fde492 3014 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (object);
355f60ae 3015 const gchar *value;
3016 g_mutex_lock (&skeleton->priv->lock);
3017 value = g_value_get_string (&(skeleton->priv->properties[0]));
3018 g_mutex_unlock (&skeleton->priv->lock);
7ce16a35 3019 return value;
3020}
3021
3022static const gchar *
68fde492 3023hostnamed_hostname1_skeleton_get_static_hostname (hostnamedHostname1 *object)
7ce16a35 3024{
68fde492 3025 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (object);
355f60ae 3026 const gchar *value;
3027 g_mutex_lock (&skeleton->priv->lock);
3028 value = g_value_get_string (&(skeleton->priv->properties[1]));
3029 g_mutex_unlock (&skeleton->priv->lock);
7ce16a35 3030 return value;
3031}
3032
3033static const gchar *
68fde492 3034hostnamed_hostname1_skeleton_get_pretty_hostname (hostnamedHostname1 *object)
7ce16a35 3035{
68fde492 3036 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (object);
355f60ae 3037 const gchar *value;
3038 g_mutex_lock (&skeleton->priv->lock);
3039 value = g_value_get_string (&(skeleton->priv->properties[2]));
3040 g_mutex_unlock (&skeleton->priv->lock);
7ce16a35 3041 return value;
3042}
3043
355f60ae 3044static const gchar *
68fde492 3045hostnamed_hostname1_skeleton_get_icon_name (hostnamedHostname1 *object)
86cb7727 3046{
68fde492 3047 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (object);
355f60ae 3048 const gchar *value;
3049 g_mutex_lock (&skeleton->priv->lock);
3050 value = g_value_get_string (&(skeleton->priv->properties[3]));
3051 g_mutex_unlock (&skeleton->priv->lock);
3052 return value;
86cb7727 3053}
3054
355f60ae 3055static const gchar *
68fde492 3056hostnamed_hostname1_skeleton_get_chassis (hostnamedHostname1 *object)
86cb7727 3057{
68fde492 3058 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (object);
355f60ae 3059 const gchar *value;
3060 g_mutex_lock (&skeleton->priv->lock);
3061 value = g_value_get_string (&(skeleton->priv->properties[4]));
3062 g_mutex_unlock (&skeleton->priv->lock);
3063 return value;
86cb7727 3064}
3065
355f60ae 3066static const gchar *
68fde492 3067hostnamed_hostname1_skeleton_get_kernel_name (hostnamedHostname1 *object)
86cb7727 3068{
68fde492 3069 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (object);
355f60ae 3070 const gchar *value;
3071 g_mutex_lock (&skeleton->priv->lock);
3072 value = g_value_get_string (&(skeleton->priv->properties[5]));
3073 g_mutex_unlock (&skeleton->priv->lock);
3074 return value;
86cb7727 3075}
3076
355f60ae 3077static const gchar *
68fde492 3078hostnamed_hostname1_skeleton_get_kernel_release (hostnamedHostname1 *object)
86cb7727 3079{
68fde492 3080 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (object);
355f60ae 3081 const gchar *value;
3082 g_mutex_lock (&skeleton->priv->lock);
3083 value = g_value_get_string (&(skeleton->priv->properties[6]));
3084 g_mutex_unlock (&skeleton->priv->lock);
3085 return value;
86cb7727 3086}
3087
355f60ae 3088static const gchar *
68fde492 3089hostnamed_hostname1_skeleton_get_kernel_version (hostnamedHostname1 *object)
86cb7727 3090{
68fde492 3091 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (object);
355f60ae 3092 const gchar *value;
3093 g_mutex_lock (&skeleton->priv->lock);
3094 value = g_value_get_string (&(skeleton->priv->properties[7]));
3095 g_mutex_unlock (&skeleton->priv->lock);
3096 return value;
86cb7727 3097}
3098
355f60ae 3099static const gchar *
68fde492 3100hostnamed_hostname1_skeleton_get_operating_system_pretty_name (hostnamedHostname1 *object)
86cb7727 3101{
68fde492 3102 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (object);
355f60ae 3103 const gchar *value;
3104 g_mutex_lock (&skeleton->priv->lock);
3105 value = g_value_get_string (&(skeleton->priv->properties[8]));
3106 g_mutex_unlock (&skeleton->priv->lock);
3107 return value;
86cb7727 3108}
3109
355f60ae 3110static const gchar *
68fde492 3111hostnamed_hostname1_skeleton_get_operating_system_cpename (hostnamedHostname1 *object)
355f60ae 3112{
68fde492 3113 hostnamedHostname1Skeleton *skeleton = HOSTNAMED_HOSTNAME1_SKELETON (object);
355f60ae 3114 const gchar *value;
3115 g_mutex_lock (&skeleton->priv->lock);
3116 value = g_value_get_string (&(skeleton->priv->properties[9]));
3117 g_mutex_unlock (&skeleton->priv->lock);
3118 return value;
3119}
86cb7727 3120
355f60ae 3121static void
68fde492 3122hostnamed_hostname1_skeleton_class_init (hostnamedHostname1SkeletonClass *klass)
86cb7727 3123{
355f60ae 3124 GObjectClass *gobject_class;
3125 GDBusInterfaceSkeletonClass *skeleton_class;
3126
3127 gobject_class = G_OBJECT_CLASS (klass);
68fde492 3128 gobject_class->finalize = hostnamed_hostname1_skeleton_finalize;
3129 gobject_class->get_property = hostnamed_hostname1_skeleton_get_property;
3130 gobject_class->set_property = hostnamed_hostname1_skeleton_set_property;
3131 gobject_class->notify = hostnamed_hostname1_skeleton_notify;
355f60ae 3132
3133
68fde492 3134 hostnamed_hostname1_override_properties (gobject_class, 1);
355f60ae 3135
3136 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
68fde492 3137 skeleton_class->get_info = hostnamed_hostname1_skeleton_dbus_interface_get_info;
3138 skeleton_class->get_properties = hostnamed_hostname1_skeleton_dbus_interface_get_properties;
3139 skeleton_class->flush = hostnamed_hostname1_skeleton_dbus_interface_flush;
3140 skeleton_class->get_vtable = hostnamed_hostname1_skeleton_dbus_interface_get_vtable;
355f60ae 3141
3142#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
68fde492 3143 g_type_class_add_private (klass, sizeof (hostnamedHostname1SkeletonPrivate));
355f60ae 3144#endif
86cb7727 3145}
3146
355f60ae 3147static void
68fde492 3148hostnamed_hostname1_skeleton_iface_init (hostnamedHostname1Iface *iface)
86cb7727 3149{
68fde492 3150 iface->get_hostname = hostnamed_hostname1_skeleton_get_hostname;
3151 iface->get_static_hostname = hostnamed_hostname1_skeleton_get_static_hostname;
3152 iface->get_pretty_hostname = hostnamed_hostname1_skeleton_get_pretty_hostname;
3153 iface->get_icon_name = hostnamed_hostname1_skeleton_get_icon_name;
3154 iface->get_chassis = hostnamed_hostname1_skeleton_get_chassis;
3155 iface->get_kernel_name = hostnamed_hostname1_skeleton_get_kernel_name;
3156 iface->get_kernel_release = hostnamed_hostname1_skeleton_get_kernel_release;
3157 iface->get_kernel_version = hostnamed_hostname1_skeleton_get_kernel_version;
3158 iface->get_operating_system_pretty_name = hostnamed_hostname1_skeleton_get_operating_system_pretty_name;
3159 iface->get_operating_system_cpename = hostnamed_hostname1_skeleton_get_operating_system_cpename;
86cb7727 3160}
3161
3162/**
68fde492 3163 * hostnamed_hostname1_skeleton_new:
86cb7727 3164 *
355f60ae 3165 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-hostname1.top_of_page">org.freedesktop.hostname1</link>.
86cb7727 3166 *
68fde492 3167 * Returns: (transfer full) (type hostnamedHostname1Skeleton): The skeleton object.
86cb7727 3168 */
68fde492 3169hostnamedHostname1 *
3170hostnamed_hostname1_skeleton_new (void)
86cb7727 3171{
68fde492 3172 return HOSTNAMED_HOSTNAME1 (g_object_new (HOSTNAMED_TYPE_HOSTNAME1_SKELETON, NULL));
86cb7727 3173}
3174
355f60ae 3175/* ------------------------------------------------------------------------
3176 * Code for Object, ObjectProxy and ObjectSkeleton
3177 * ------------------------------------------------------------------------
3178 */
86cb7727 3179
355f60ae 3180/**
68fde492 3181 * SECTION:hostnamedObject
3182 * @title: hostnamedObject
355f60ae 3183 * @short_description: Specialized GDBusObject types
3184 *
68fde492 3185 * This section contains the #hostnamedObject, #hostnamedObjectProxy, and #hostnamedObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces.
355f60ae 3186 */
86cb7727 3187
3188/**
68fde492 3189 * hostnamedObject:
86cb7727 3190 *
68fde492 3191 * The #hostnamedObject type is a specialized container of interfaces.
86cb7727 3192 */
3193
3194/**
68fde492 3195 * hostnamedObjectIface:
355f60ae 3196 * @parent_iface: The parent interface.
86cb7727 3197 *
68fde492 3198 * Virtual table for the #hostnamedObject interface.
86cb7727 3199 */
3200
68fde492 3201typedef hostnamedObjectIface hostnamedObjectInterface;
3202G_DEFINE_INTERFACE_WITH_CODE (hostnamedObject, hostnamed_object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT));
86cb7727 3203
3204static void
68fde492 3205hostnamed_object_default_init (hostnamedObjectIface *iface)
86cb7727 3206{
355f60ae 3207 /**
68fde492 3208 * hostnamedObject:hostname1:
355f60ae 3209 *
68fde492 3210 * The #hostnamedHostname1 instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-hostname1.top_of_page">org.freedesktop.hostname1</link>, if any.
355f60ae 3211 *
3212 * Connect to the #GObject::notify signal to get informed of property changes.
3213 */
68fde492 3214 g_object_interface_install_property (iface, g_param_spec_object ("hostname1", "hostname1", "hostname1", HOSTNAMED_TYPE_HOSTNAME1, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
86cb7727 3215
86cb7727 3216}
3217
355f60ae 3218/**
68fde492 3219 * hostnamed_object_get_hostname1:
3220 * @object: A #hostnamedObject.
355f60ae 3221 *
68fde492 3222 * Gets the #hostnamedHostname1 instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-hostname1.top_of_page">org.freedesktop.hostname1</link> on @object, if any.
355f60ae 3223 *
68fde492 3224 * Returns: (transfer full): A #hostnamedHostname1 that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
355f60ae 3225 */
68fde492 3226hostnamedHostname1 *hostnamed_object_get_hostname1 (hostnamedObject *object)
86cb7727 3227{
355f60ae 3228 GDBusInterface *ret;
3229 ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.hostname1");
3230 if (ret == NULL)
3231 return NULL;
68fde492 3232 return HOSTNAMED_HOSTNAME1 (ret);
86cb7727 3233}
3234
355f60ae 3235
3236/**
68fde492 3237 * hostnamed_object_peek_hostname1: (skip)
3238 * @object: A #hostnamedObject.
355f60ae 3239 *
68fde492 3240 * Like hostnamed_object_get_hostname1() but doesn't increase the reference count on the returned object.
355f60ae 3241 *
3242 * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
3243 *
68fde492 3244 * Returns: (transfer none): A #hostnamedHostname1 or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
355f60ae 3245 */
68fde492 3246hostnamedHostname1 *hostnamed_object_peek_hostname1 (hostnamedObject *object)
86cb7727 3247{
355f60ae 3248 GDBusInterface *ret;
3249 ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.hostname1");
3250 if (ret == NULL)
3251 return NULL;
3252 g_object_unref (ret);
68fde492 3253 return HOSTNAMED_HOSTNAME1 (ret);
86cb7727 3254}
3255
86cb7727 3256
355f60ae 3257static void
68fde492 3258hostnamed_object_notify (GDBusObject *object, GDBusInterface *interface)
355f60ae 3259{
3260 _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface);
3261 /* info can be NULL if the other end is using a D-Bus interface we don't know
3262 * anything about, for example old generated code in this process talking to
3263 * newer generated code in the other process. */
3264 if (info != NULL)
3265 g_object_notify (G_OBJECT (object), info->hyphen_name);
86cb7727 3266}
3267
355f60ae 3268/**
68fde492 3269 * hostnamedObjectProxy:
355f60ae 3270 *
68fde492 3271 * The #hostnamedObjectProxy structure contains only private data and should only be accessed using the provided API.
355f60ae 3272 */
3273
3274/**
68fde492 3275 * hostnamedObjectProxyClass:
355f60ae 3276 * @parent_class: The parent class.
3277 *
68fde492 3278 * Class structure for #hostnamedObjectProxy.
355f60ae 3279 */
86cb7727 3280
3281static void
68fde492 3282hostnamed_object_proxy__hostnamed_object_iface_init (hostnamedObjectIface *iface G_GNUC_UNUSED)
86cb7727 3283{
355f60ae 3284}
86cb7727 3285
355f60ae 3286static void
68fde492 3287hostnamed_object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)
355f60ae 3288{
68fde492 3289 iface->interface_added = hostnamed_object_notify;
3290 iface->interface_removed = hostnamed_object_notify;
86cb7727 3291}
3292
86cb7727 3293
68fde492 3294G_DEFINE_TYPE_WITH_CODE (hostnamedObjectProxy, hostnamed_object_proxy, G_TYPE_DBUS_OBJECT_PROXY,
3295 G_IMPLEMENT_INTERFACE (HOSTNAMED_TYPE_OBJECT, hostnamed_object_proxy__hostnamed_object_iface_init)
3296 G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, hostnamed_object_proxy__g_dbus_object_iface_init));
86cb7727 3297
86cb7727 3298static void
68fde492 3299hostnamed_object_proxy_init (hostnamedObjectProxy *object G_GNUC_UNUSED)
86cb7727 3300{
86cb7727 3301}
3302
3303static void
68fde492 3304hostnamed_object_proxy_set_property (GObject *gobject,
86cb7727 3305 guint prop_id,
355f60ae 3306 const GValue *value G_GNUC_UNUSED,
3307 GParamSpec *pspec)
86cb7727 3308{
355f60ae 3309 G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
86cb7727 3310}
3311
355f60ae 3312static void
68fde492 3313hostnamed_object_proxy_get_property (GObject *gobject,
355f60ae 3314 guint prop_id,
3315 GValue *value,
3316 GParamSpec *pspec)
86cb7727 3317{
68fde492 3318 hostnamedObjectProxy *object = HOSTNAMED_OBJECT_PROXY (gobject);
355f60ae 3319 GDBusInterface *interface;
86cb7727 3320
355f60ae 3321 switch (prop_id)
86cb7727 3322 {
355f60ae 3323 case 1:
3324 interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.hostname1");
3325 g_value_take_object (value, interface);
3326 break;
86cb7727 3327
355f60ae 3328 default:
3329 G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
3330 break;
3331 }
3332}
86cb7727 3333
355f60ae 3334static void
68fde492 3335hostnamed_object_proxy_class_init (hostnamedObjectProxyClass *klass)
355f60ae 3336{
3337 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
3338
68fde492 3339 gobject_class->set_property = hostnamed_object_proxy_set_property;
3340 gobject_class->get_property = hostnamed_object_proxy_get_property;
355f60ae 3341
3342 g_object_class_override_property (gobject_class, 1, "hostname1");
3343}
3344
3345/**
68fde492 3346 * hostnamed_object_proxy_new:
355f60ae 3347 * @connection: A #GDBusConnection.
3348 * @object_path: An object path.
3349 *
3350 * Creates a new proxy object.
3351 *
3352 * Returns: (transfer full): The proxy object.
3353 */
68fde492 3354hostnamedObjectProxy *
3355hostnamed_object_proxy_new (GDBusConnection *connection,
355f60ae 3356 const gchar *object_path)
3357{
3358 g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
3359 g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
68fde492 3360 return HOSTNAMED_OBJECT_PROXY (g_object_new (HOSTNAMED_TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));
86cb7727 3361}
3362
355f60ae 3363/**
68fde492 3364 * hostnamedObjectSkeleton:
355f60ae 3365 *
68fde492 3366 * The #hostnamedObjectSkeleton structure contains only private data and should only be accessed using the provided API.
355f60ae 3367 */
3368
3369/**
68fde492 3370 * hostnamedObjectSkeletonClass:
355f60ae 3371 * @parent_class: The parent class.
3372 *
68fde492 3373 * Class structure for #hostnamedObjectSkeleton.
355f60ae 3374 */
3375
86cb7727 3376static void
68fde492 3377hostnamed_object_skeleton__hostnamed_object_iface_init (hostnamedObjectIface *iface G_GNUC_UNUSED)
86cb7727 3378{
86cb7727 3379}
3380
355f60ae 3381
86cb7727 3382static void
68fde492 3383hostnamed_object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)
86cb7727 3384{
68fde492 3385 iface->interface_added = hostnamed_object_notify;
3386 iface->interface_removed = hostnamed_object_notify;
86cb7727 3387}
3388
68fde492 3389G_DEFINE_TYPE_WITH_CODE (hostnamedObjectSkeleton, hostnamed_object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,
3390 G_IMPLEMENT_INTERFACE (HOSTNAMED_TYPE_OBJECT, hostnamed_object_skeleton__hostnamed_object_iface_init)
3391 G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, hostnamed_object_skeleton__g_dbus_object_iface_init));
355f60ae 3392
86cb7727 3393static void
68fde492 3394hostnamed_object_skeleton_init (hostnamedObjectSkeleton *object G_GNUC_UNUSED)
86cb7727 3395{
86cb7727 3396}
3397
3398static void
68fde492 3399hostnamed_object_skeleton_set_property (GObject *gobject,
355f60ae 3400 guint prop_id,
3401 const GValue *value,
3402 GParamSpec *pspec)
86cb7727 3403{
68fde492 3404 hostnamedObjectSkeleton *object = HOSTNAMED_OBJECT_SKELETON (gobject);
355f60ae 3405 GDBusInterfaceSkeleton *interface;
86cb7727 3406
355f60ae 3407 switch (prop_id)
3408 {
3409 case 1:
3410 interface = g_value_get_object (value);
3411 if (interface != NULL)
3412 {
68fde492 3413 g_warn_if_fail (HOSTNAMED_IS_HOSTNAME1 (interface));
355f60ae 3414 g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
3415 }
3416 else
3417 {
3418 g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.freedesktop.hostname1");
3419 }
3420 break;
86cb7727 3421
355f60ae 3422 default:
3423 G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
3424 break;
3425 }
86cb7727 3426}
3427
355f60ae 3428static void
68fde492 3429hostnamed_object_skeleton_get_property (GObject *gobject,
355f60ae 3430 guint prop_id,
3431 GValue *value,
3432 GParamSpec *pspec)
86cb7727 3433{
68fde492 3434 hostnamedObjectSkeleton *object = HOSTNAMED_OBJECT_SKELETON (gobject);
355f60ae 3435 GDBusInterface *interface;
3436
3437 switch (prop_id)
3438 {
3439 case 1:
3440 interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.hostname1");
3441 g_value_take_object (value, interface);
3442 break;
3443
3444 default:
3445 G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
3446 break;
3447 }
86cb7727 3448}
3449
355f60ae 3450static void
68fde492 3451hostnamed_object_skeleton_class_init (hostnamedObjectSkeletonClass *klass)
86cb7727 3452{
355f60ae 3453 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
3454
68fde492 3455 gobject_class->set_property = hostnamed_object_skeleton_set_property;
3456 gobject_class->get_property = hostnamed_object_skeleton_get_property;
355f60ae 3457
3458 g_object_class_override_property (gobject_class, 1, "hostname1");
86cb7727 3459}
3460
355f60ae 3461/**
68fde492 3462 * hostnamed_object_skeleton_new:
355f60ae 3463 * @object_path: An object path.
3464 *
3465 * Creates a new skeleton object.
3466 *
3467 * Returns: (transfer full): The skeleton object.
3468 */
68fde492 3469hostnamedObjectSkeleton *
3470hostnamed_object_skeleton_new (const gchar *object_path)
86cb7727 3471{
355f60ae 3472 g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
68fde492 3473 return HOSTNAMED_OBJECT_SKELETON (g_object_new (HOSTNAMED_TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));
86cb7727 3474}
3475
355f60ae 3476/**
68fde492 3477 * hostnamed_object_skeleton_set_hostname1:
3478 * @object: A #hostnamedObjectSkeleton.
3479 * @interface_: (allow-none): A #hostnamedHostname1 or %NULL to clear the interface.
355f60ae 3480 *
68fde492 3481 * Sets the #hostnamedHostname1 instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-hostname1.top_of_page">org.freedesktop.hostname1</link> on @object.
355f60ae 3482 */
68fde492 3483void hostnamed_object_skeleton_set_hostname1 (hostnamedObjectSkeleton *object, hostnamedHostname1 *interface_)
7ce16a35 3484{
355f60ae 3485 g_object_set (G_OBJECT (object), "hostname1", interface_, NULL);
7ce16a35 3486}
3487
355f60ae 3488
3489/* ------------------------------------------------------------------------
3490 * Code for ObjectManager client
3491 * ------------------------------------------------------------------------
3492 */
3493
3494/**
68fde492 3495 * SECTION:hostnamedObjectManagerClient
3496 * @title: hostnamedObjectManagerClient
355f60ae 3497 * @short_description: Generated GDBusObjectManagerClient type
3498 *
68fde492 3499 * This section contains a #GDBusObjectManagerClient that uses hostnamed_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc.
355f60ae 3500 */
3501
3502/**
68fde492 3503 * hostnamedObjectManagerClient:
355f60ae 3504 *
68fde492 3505 * The #hostnamedObjectManagerClient structure contains only private data and should only be accessed using the provided API.
355f60ae 3506 */
3507
3508/**
68fde492 3509 * hostnamedObjectManagerClientClass:
355f60ae 3510 * @parent_class: The parent class.
3511 *
68fde492 3512 * Class structure for #hostnamedObjectManagerClient.
355f60ae 3513 */
3514
68fde492 3515G_DEFINE_TYPE (hostnamedObjectManagerClient, hostnamed_object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT);
355f60ae 3516
3517static void
68fde492 3518hostnamed_object_manager_client_init (hostnamedObjectManagerClient *manager G_GNUC_UNUSED)
7ce16a35 3519{
7ce16a35 3520}
3521
355f60ae 3522static void
68fde492 3523hostnamed_object_manager_client_class_init (hostnamedObjectManagerClientClass *klass G_GNUC_UNUSED)
7ce16a35 3524{
7ce16a35 3525}
3526
355f60ae 3527/**
68fde492 3528 * hostnamed_object_manager_client_get_proxy_type:
355f60ae 3529 * @manager: A #GDBusObjectManagerClient.
3530 * @object_path: The object path of the remote object (unused).
3531 * @interface_name: (allow-none): Interface name of the remote object or %NULL to get the object proxy #GType.
3532 * @user_data: User data (unused).
3533 *
3534 * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy<!-- -->- and #GDBusProxy<!-- -->-derived types.
3535 *
68fde492 3536 * Returns: A #GDBusProxy<!-- -->-derived #GType if @interface_name is not %NULL, otherwise the #GType for #hostnamedObjectProxy.
355f60ae 3537 */
3538GType
68fde492 3539hostnamed_object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED)
7ce16a35 3540{
355f60ae 3541 static gsize once_init_value = 0;
3542 static GHashTable *lookup_hash;
3543 GType ret;
3544
3545 if (interface_name == NULL)
68fde492 3546 return HOSTNAMED_TYPE_OBJECT_PROXY;
355f60ae 3547 if (g_once_init_enter (&once_init_value))
3548 {
3549 lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
68fde492 3550 g_hash_table_insert (lookup_hash, (gpointer) "org.freedesktop.hostname1", GSIZE_TO_POINTER (HOSTNAMED_TYPE_HOSTNAME1_PROXY));
355f60ae 3551 g_once_init_leave (&once_init_value, 1);
3552 }
3553 ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name));
3554 if (ret == (GType) 0)
3555 ret = G_TYPE_DBUS_PROXY;
3556 return ret;
7ce16a35 3557}
3558
355f60ae 3559/**
68fde492 3560 * hostnamed_object_manager_client_new:
355f60ae 3561 * @connection: A #GDBusConnection.
3562 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
3563 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
3564 * @object_path: An object path.
3565 * @cancellable: (allow-none): A #GCancellable or %NULL.
3566 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
3567 * @user_data: User data to pass to @callback.
3568 *
68fde492 3569 * Asynchronously creates #GDBusObjectManagerClient using hostnamed_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details.
355f60ae 3570 *
3571 * 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.
68fde492 3572 * You can then call hostnamed_object_manager_client_new_finish() to get the result of the operation.
355f60ae 3573 *
68fde492 3574 * See hostnamed_object_manager_client_new_sync() for the synchronous, blocking version of this constructor.
355f60ae 3575 */
3576void
68fde492 3577hostnamed_object_manager_client_new (
355f60ae 3578 GDBusConnection *connection,
3579 GDBusObjectManagerClientFlags flags,
3580 const gchar *name,
3581 const gchar *object_path,
3582 GCancellable *cancellable,
3583 GAsyncReadyCallback callback,
3584 gpointer user_data)
7ce16a35 3585{
68fde492 3586 g_async_initable_new_async (HOSTNAMED_TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", hostnamed_object_manager_client_get_proxy_type, NULL);
7ce16a35 3587}
3588
355f60ae 3589/**
68fde492 3590 * hostnamed_object_manager_client_new_finish:
3591 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostnamed_object_manager_client_new().
355f60ae 3592 * @error: Return location for error or %NULL
3593 *
68fde492 3594 * Finishes an operation started with hostnamed_object_manager_client_new().
355f60ae 3595 *
68fde492 3596 * Returns: (transfer full) (type hostnamedObjectManagerClient): The constructed object manager client or %NULL if @error is set.
355f60ae 3597 */
3598GDBusObjectManager *
68fde492 3599hostnamed_object_manager_client_new_finish (
355f60ae 3600 GAsyncResult *res,
3601 GError **error)
7ce16a35 3602{
355f60ae 3603 GObject *ret;
3604 GObject *source_object;
3605 source_object = g_async_result_get_source_object (res);
3606 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
3607 g_object_unref (source_object);
3608 if (ret != NULL)
3609 return G_DBUS_OBJECT_MANAGER (ret);
3610 else
3611 return NULL;
7ce16a35 3612}
3613
355f60ae 3614/**
68fde492 3615 * hostnamed_object_manager_client_new_sync:
355f60ae 3616 * @connection: A #GDBusConnection.
3617 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
3618 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
3619 * @object_path: An object path.
3620 * @cancellable: (allow-none): A #GCancellable or %NULL.
3621 * @error: Return location for error or %NULL
3622 *
68fde492 3623 * Synchronously creates #GDBusObjectManagerClient using hostnamed_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details.
355f60ae 3624 *
3625 * The calling thread is blocked until a reply is received.
3626 *
68fde492 3627 * See hostnamed_object_manager_client_new() for the asynchronous version of this constructor.
355f60ae 3628 *
68fde492 3629 * Returns: (transfer full) (type hostnamedObjectManagerClient): The constructed object manager client or %NULL if @error is set.
355f60ae 3630 */
3631GDBusObjectManager *
68fde492 3632hostnamed_object_manager_client_new_sync (
355f60ae 3633 GDBusConnection *connection,
3634 GDBusObjectManagerClientFlags flags,
3635 const gchar *name,
3636 const gchar *object_path,
3637 GCancellable *cancellable,
3638 GError **error)
86cb7727 3639{
355f60ae 3640 GInitable *ret;
68fde492 3641 ret = g_initable_new (HOSTNAMED_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", hostnamed_object_manager_client_get_proxy_type, NULL);
355f60ae 3642 if (ret != NULL)
3643 return G_DBUS_OBJECT_MANAGER (ret);
3644 else
3645 return NULL;
3646}
86cb7727 3647
86cb7727 3648
355f60ae 3649/**
68fde492 3650 * hostnamed_object_manager_client_new_for_bus:
355f60ae 3651 * @bus_type: A #GBusType.
3652 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
3653 * @name: A bus name (well-known or unique).
3654 * @object_path: An object path.
3655 * @cancellable: (allow-none): A #GCancellable or %NULL.
3656 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
3657 * @user_data: User data to pass to @callback.
3658 *
68fde492 3659 * Like hostnamed_object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection.
355f60ae 3660 *
3661 * 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.
68fde492 3662 * You can then call hostnamed_object_manager_client_new_for_bus_finish() to get the result of the operation.
355f60ae 3663 *
68fde492 3664 * See hostnamed_object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor.
355f60ae 3665 */
3666void
68fde492 3667hostnamed_object_manager_client_new_for_bus (
355f60ae 3668 GBusType bus_type,
3669 GDBusObjectManagerClientFlags flags,
3670 const gchar *name,
3671 const gchar *object_path,
3672 GCancellable *cancellable,
3673 GAsyncReadyCallback callback,
3674 gpointer user_data)
3675{
68fde492 3676 g_async_initable_new_async (HOSTNAMED_TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", hostnamed_object_manager_client_get_proxy_type, NULL);
86cb7727 3677}
3678
355f60ae 3679/**
68fde492 3680 * hostnamed_object_manager_client_new_for_bus_finish:
3681 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostnamed_object_manager_client_new_for_bus().
355f60ae 3682 * @error: Return location for error or %NULL
3683 *
68fde492 3684 * Finishes an operation started with hostnamed_object_manager_client_new_for_bus().
355f60ae 3685 *
68fde492 3686 * Returns: (transfer full) (type hostnamedObjectManagerClient): The constructed object manager client or %NULL if @error is set.
355f60ae 3687 */
3688GDBusObjectManager *
68fde492 3689hostnamed_object_manager_client_new_for_bus_finish (
355f60ae 3690 GAsyncResult *res,
3691 GError **error)
86cb7727 3692{
355f60ae 3693 GObject *ret;
3694 GObject *source_object;
3695 source_object = g_async_result_get_source_object (res);
3696 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
3697 g_object_unref (source_object);
3698 if (ret != NULL)
3699 return G_DBUS_OBJECT_MANAGER (ret);
3700 else
3701 return NULL;
86cb7727 3702}
3703
3704/**
68fde492 3705 * hostnamed_object_manager_client_new_for_bus_sync:
355f60ae 3706 * @bus_type: A #GBusType.
3707 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
3708 * @name: A bus name (well-known or unique).
3709 * @object_path: An object path.
3710 * @cancellable: (allow-none): A #GCancellable or %NULL.
3711 * @error: Return location for error or %NULL
86cb7727 3712 *
68fde492 3713 * Like hostnamed_object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection.
86cb7727 3714 *
355f60ae 3715 * The calling thread is blocked until a reply is received.
3716 *
68fde492 3717 * See hostnamed_object_manager_client_new_for_bus() for the asynchronous version of this constructor.
355f60ae 3718 *
68fde492 3719 * Returns: (transfer full) (type hostnamedObjectManagerClient): The constructed object manager client or %NULL if @error is set.
86cb7727 3720 */
355f60ae 3721GDBusObjectManager *
68fde492 3722hostnamed_object_manager_client_new_for_bus_sync (
355f60ae 3723 GBusType bus_type,
3724 GDBusObjectManagerClientFlags flags,
3725 const gchar *name,
3726 const gchar *object_path,
3727 GCancellable *cancellable,
3728 GError **error)
86cb7727 3729{
355f60ae 3730 GInitable *ret;
68fde492 3731 ret = g_initable_new (HOSTNAMED_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", hostnamed_object_manager_client_get_proxy_type, NULL);
355f60ae 3732 if (ret != NULL)
3733 return G_DBUS_OBJECT_MANAGER (ret);
3734 else
3735 return NULL;
86cb7727 3736}
3737
355f60ae 3738