2 * Generated by gdbus-codegen 2.40.0. DO NOT EDIT.
4 * The license of this code is the same as for the source it was derived from.
11 #include "hostnamed-gen.h"
15 # include <gio/gunixfdlist.h>
20 GDBusArgInfo parent_struct
;
21 gboolean use_gvariant
;
22 } _ExtendedGDBusArgInfo
;
26 GDBusMethodInfo parent_struct
;
27 const gchar
*signal_name
;
29 } _ExtendedGDBusMethodInfo
;
33 GDBusSignalInfo parent_struct
;
34 const gchar
*signal_name
;
35 } _ExtendedGDBusSignalInfo
;
39 GDBusPropertyInfo parent_struct
;
40 const gchar
*hyphen_name
;
41 gboolean use_gvariant
;
42 } _ExtendedGDBusPropertyInfo
;
46 GDBusInterfaceInfo parent_struct
;
47 const gchar
*hyphen_name
;
48 } _ExtendedGDBusInterfaceInfo
;
52 const _ExtendedGDBusPropertyInfo
*info
;
54 GValue orig_value
; /* the value before the change */
58 _changed_property_free (ChangedProperty
*data
)
60 g_value_unset (&data
->orig_value
);
65 _g_strv_equal0 (gchar
**a
, gchar
**b
)
69 if (a
== NULL
&& b
== NULL
)
74 if (a
== NULL
|| b
== NULL
)
76 if (g_strv_length (a
) != g_strv_length (b
))
78 for (n
= 0; a
[n
] != NULL
; n
++)
79 if (g_strcmp0 (a
[n
], b
[n
]) != 0)
87 _g_variant_equal0 (GVariant
*a
, GVariant
*b
)
90 if (a
== NULL
&& b
== NULL
)
95 if (a
== NULL
|| b
== NULL
)
97 ret
= g_variant_equal (a
, b
);
102 G_GNUC_UNUSED
static gboolean
103 _g_value_equal (const GValue
*a
, const GValue
*b
)
105 gboolean ret
= FALSE
;
106 g_assert (G_VALUE_TYPE (a
) == G_VALUE_TYPE (b
));
107 switch (G_VALUE_TYPE (a
))
110 ret
= (g_value_get_boolean (a
) == g_value_get_boolean (b
));
113 ret
= (g_value_get_uchar (a
) == g_value_get_uchar (b
));
116 ret
= (g_value_get_int (a
) == g_value_get_int (b
));
119 ret
= (g_value_get_uint (a
) == g_value_get_uint (b
));
122 ret
= (g_value_get_int64 (a
) == g_value_get_int64 (b
));
125 ret
= (g_value_get_uint64 (a
) == g_value_get_uint64 (b
));
129 /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
130 gdouble da
= g_value_get_double (a
);
131 gdouble db
= g_value_get_double (b
);
132 ret
= memcmp (&da
, &db
, sizeof (gdouble
)) == 0;
136 ret
= (g_strcmp0 (g_value_get_string (a
), g_value_get_string (b
)) == 0);
139 ret
= _g_variant_equal0 (g_value_get_variant (a
), g_value_get_variant (b
));
142 if (G_VALUE_TYPE (a
) == G_TYPE_STRV
)
143 ret
= _g_strv_equal0 (g_value_get_boxed (a
), g_value_get_boxed (b
));
145 g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a
)));
151 /* ------------------------------------------------------------------------
152 * Code for interface org.freedesktop.DBus.Peer
153 * ------------------------------------------------------------------------
159 * @short_description: Generated C code for the org.freedesktop.DBus.Peer D-Bus interface
161 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-DBus-Peer.top_of_page">org.freedesktop.DBus.Peer</link> D-Bus interface in C.
164 /* ---- Introspection data for org.freedesktop.DBus.Peer ---- */
166 static const _ExtendedGDBusMethodInfo _dbus_peer_method_info_ping
=
179 static const _ExtendedGDBusArgInfo _dbus_peer_method_info_get_machine_id_OUT_ARG_machine_uuid
=
183 (gchar
*) "machine_uuid",
190 static const _ExtendedGDBusArgInfo
* const _dbus_peer_method_info_get_machine_id_OUT_ARG_pointers
[] =
192 &_dbus_peer_method_info_get_machine_id_OUT_ARG_machine_uuid
,
196 static const _ExtendedGDBusMethodInfo _dbus_peer_method_info_get_machine_id
=
200 (gchar
*) "GetMachineId",
202 (GDBusArgInfo
**) &_dbus_peer_method_info_get_machine_id_OUT_ARG_pointers
,
205 "handle-get-machine-id",
209 static const _ExtendedGDBusMethodInfo
* const _dbus_peer_method_info_pointers
[] =
211 &_dbus_peer_method_info_ping
,
212 &_dbus_peer_method_info_get_machine_id
,
216 static const _ExtendedGDBusInterfaceInfo _dbus_peer_interface_info
=
220 (gchar
*) "org.freedesktop.DBus.Peer",
221 (GDBusMethodInfo
**) &_dbus_peer_method_info_pointers
,
231 * dbus_peer_interface_info:
233 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-DBus-Peer.top_of_page">org.freedesktop.DBus.Peer</link> D-Bus interface.
235 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
238 dbus_peer_interface_info (void)
240 return (GDBusInterfaceInfo
*) &_dbus_peer_interface_info
.parent_struct
;
244 * dbus_peer_override_properties:
245 * @klass: The class structure for a #GObject<!-- -->-derived class.
246 * @property_id_begin: The property id to assign to the first overridden property.
248 * Overrides all #GObject properties in the #DBusPeer interface for a concrete class.
249 * The properties are overridden in the order they are defined.
251 * Returns: The last property id.
254 dbus_peer_override_properties (GObjectClass
*klass
, guint property_id_begin
)
256 return property_id_begin
- 1;
264 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Peer.top_of_page">org.freedesktop.DBus.Peer</link>.
269 * @parent_iface: The parent interface.
270 * @handle_get_machine_id: Handler for the #DBusPeer::handle-get-machine-id signal.
271 * @handle_ping: Handler for the #DBusPeer::handle-ping signal.
273 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Peer.top_of_page">org.freedesktop.DBus.Peer</link>.
276 typedef DBusPeerIface DBusPeerInterface
;
277 G_DEFINE_INTERFACE (DBusPeer
, dbus_peer
, G_TYPE_OBJECT
);
280 dbus_peer_default_init (DBusPeerIface
*iface
)
282 /* GObject signals for incoming D-Bus method calls: */
284 * DBusPeer::handle-ping:
285 * @object: A #DBusPeer.
286 * @invocation: A #GDBusMethodInvocation.
288 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.Ping">Ping()</link> D-Bus method.
290 * 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 dbus_peer_complete_ping() 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.
292 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
294 g_signal_new ("handle-ping",
295 G_TYPE_FROM_INTERFACE (iface
),
297 G_STRUCT_OFFSET (DBusPeerIface
, handle_ping
),
298 g_signal_accumulator_true_handled
,
300 g_cclosure_marshal_generic
,
303 G_TYPE_DBUS_METHOD_INVOCATION
);
306 * DBusPeer::handle-get-machine-id:
307 * @object: A #DBusPeer.
308 * @invocation: A #GDBusMethodInvocation.
310 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.GetMachineId">GetMachineId()</link> D-Bus method.
312 * 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 dbus_peer_complete_get_machine_id() 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.
314 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
316 g_signal_new ("handle-get-machine-id",
317 G_TYPE_FROM_INTERFACE (iface
),
319 G_STRUCT_OFFSET (DBusPeerIface
, handle_get_machine_id
),
320 g_signal_accumulator_true_handled
,
322 g_cclosure_marshal_generic
,
325 G_TYPE_DBUS_METHOD_INVOCATION
);
330 * dbus_peer_call_ping:
331 * @proxy: A #DBusPeerProxy.
332 * @cancellable: (allow-none): A #GCancellable or %NULL.
333 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
334 * @user_data: User data to pass to @callback.
336 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.Ping">Ping()</link> D-Bus method on @proxy.
337 * 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.
338 * You can then call dbus_peer_call_ping_finish() to get the result of the operation.
340 * See dbus_peer_call_ping_sync() for the synchronous, blocking version of this method.
343 dbus_peer_call_ping (
345 GCancellable
*cancellable
,
346 GAsyncReadyCallback callback
,
349 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
351 g_variant_new ("()"),
352 G_DBUS_CALL_FLAGS_NONE
,
360 * dbus_peer_call_ping_finish:
361 * @proxy: A #DBusPeerProxy.
362 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to dbus_peer_call_ping().
363 * @error: Return location for error or %NULL.
365 * Finishes an operation started with dbus_peer_call_ping().
367 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
370 dbus_peer_call_ping_finish (
376 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
381 g_variant_unref (_ret
);
387 * dbus_peer_call_ping_sync:
388 * @proxy: A #DBusPeerProxy.
389 * @cancellable: (allow-none): A #GCancellable or %NULL.
390 * @error: Return location for error or %NULL.
392 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.Ping">Ping()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
394 * See dbus_peer_call_ping() for the asynchronous version of this method.
396 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
399 dbus_peer_call_ping_sync (
401 GCancellable
*cancellable
,
405 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
407 g_variant_new ("()"),
408 G_DBUS_CALL_FLAGS_NONE
,
416 g_variant_unref (_ret
);
422 * dbus_peer_call_get_machine_id:
423 * @proxy: A #DBusPeerProxy.
424 * @cancellable: (allow-none): A #GCancellable or %NULL.
425 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
426 * @user_data: User data to pass to @callback.
428 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.GetMachineId">GetMachineId()</link> D-Bus method on @proxy.
429 * 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.
430 * You can then call dbus_peer_call_get_machine_id_finish() to get the result of the operation.
432 * See dbus_peer_call_get_machine_id_sync() for the synchronous, blocking version of this method.
435 dbus_peer_call_get_machine_id (
437 GCancellable
*cancellable
,
438 GAsyncReadyCallback callback
,
441 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
443 g_variant_new ("()"),
444 G_DBUS_CALL_FLAGS_NONE
,
452 * dbus_peer_call_get_machine_id_finish:
453 * @proxy: A #DBusPeerProxy.
454 * @out_machine_uuid: (out): Return location for return parameter or %NULL to ignore.
455 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to dbus_peer_call_get_machine_id().
456 * @error: Return location for error or %NULL.
458 * Finishes an operation started with dbus_peer_call_get_machine_id().
460 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
463 dbus_peer_call_get_machine_id_finish (
465 gchar
**out_machine_uuid
,
470 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
476 g_variant_unref (_ret
);
482 * dbus_peer_call_get_machine_id_sync:
483 * @proxy: A #DBusPeerProxy.
484 * @out_machine_uuid: (out): Return location for return parameter or %NULL to ignore.
485 * @cancellable: (allow-none): A #GCancellable or %NULL.
486 * @error: Return location for error or %NULL.
488 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.GetMachineId">GetMachineId()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
490 * See dbus_peer_call_get_machine_id() for the asynchronous version of this method.
492 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
495 dbus_peer_call_get_machine_id_sync (
497 gchar
**out_machine_uuid
,
498 GCancellable
*cancellable
,
502 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
504 g_variant_new ("()"),
505 G_DBUS_CALL_FLAGS_NONE
,
514 g_variant_unref (_ret
);
520 * dbus_peer_complete_ping:
521 * @object: A #DBusPeer.
522 * @invocation: (transfer full): A #GDBusMethodInvocation.
524 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.Ping">Ping()</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.
526 * This method will free @invocation, you cannot use it afterwards.
529 dbus_peer_complete_ping (
531 GDBusMethodInvocation
*invocation
)
533 g_dbus_method_invocation_return_value (invocation
,
534 g_variant_new ("()"));
538 * dbus_peer_complete_get_machine_id:
539 * @object: A #DBusPeer.
540 * @invocation: (transfer full): A #GDBusMethodInvocation.
541 * @machine_uuid: Parameter to return.
543 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus-Peer.GetMachineId">GetMachineId()</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.
545 * This method will free @invocation, you cannot use it afterwards.
548 dbus_peer_complete_get_machine_id (
550 GDBusMethodInvocation
*invocation
,
551 const gchar
*machine_uuid
)
553 g_dbus_method_invocation_return_value (invocation
,
554 g_variant_new ("(s)",
558 /* ------------------------------------------------------------------------ */
563 * The #DBusPeerProxy structure contains only private data and should only be accessed using the provided API.
567 * DBusPeerProxyClass:
568 * @parent_class: The parent class.
570 * Class structure for #DBusPeerProxy.
573 struct _DBusPeerProxyPrivate
578 static void dbus_peer_proxy_iface_init (DBusPeerIface
*iface
);
580 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
581 G_DEFINE_TYPE_WITH_CODE (DBusPeerProxy
, dbus_peer_proxy
, G_TYPE_DBUS_PROXY
,
582 G_ADD_PRIVATE (DBusPeerProxy
)
583 G_IMPLEMENT_INTERFACE (TYPE_DBUS_PEER
, dbus_peer_proxy_iface_init
));
586 G_DEFINE_TYPE_WITH_CODE (DBusPeerProxy
, dbus_peer_proxy
, G_TYPE_DBUS_PROXY
,
587 G_IMPLEMENT_INTERFACE (TYPE_DBUS_PEER
, dbus_peer_proxy_iface_init
));
591 dbus_peer_proxy_finalize (GObject
*object
)
593 DBusPeerProxy
*proxy
= DBUS_PEER_PROXY (object
);
594 g_datalist_clear (&proxy
->priv
->qdata
);
595 G_OBJECT_CLASS (dbus_peer_proxy_parent_class
)->finalize (object
);
599 dbus_peer_proxy_get_property (GObject
*object
,
602 GParamSpec
*pspec G_GNUC_UNUSED
)
607 dbus_peer_proxy_set_property (GObject
*object
,
610 GParamSpec
*pspec G_GNUC_UNUSED
)
615 dbus_peer_proxy_g_signal (GDBusProxy
*proxy
,
616 const gchar
*sender_name G_GNUC_UNUSED
,
617 const gchar
*signal_name
,
618 GVariant
*parameters
)
620 _ExtendedGDBusSignalInfo
*info
;
627 info
= (_ExtendedGDBusSignalInfo
*) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo
*) &_dbus_peer_interface_info
.parent_struct
, signal_name
);
630 num_params
= g_variant_n_children (parameters
);
631 paramv
= g_new0 (GValue
, num_params
+ 1);
632 g_value_init (¶mv
[0], TYPE_DBUS_PEER
);
633 g_value_set_object (¶mv
[0], proxy
);
634 g_variant_iter_init (&iter
, parameters
);
636 while ((child
= g_variant_iter_next_value (&iter
)) != NULL
)
638 _ExtendedGDBusArgInfo
*arg_info
= (_ExtendedGDBusArgInfo
*) info
->parent_struct
.args
[n
- 1];
639 if (arg_info
->use_gvariant
)
641 g_value_init (¶mv
[n
], G_TYPE_VARIANT
);
642 g_value_set_variant (¶mv
[n
], child
);
646 g_dbus_gvariant_to_gvalue (child
, ¶mv
[n
++]);
647 g_variant_unref (child
);
649 signal_id
= g_signal_lookup (info
->signal_name
, TYPE_DBUS_PEER
);
650 g_signal_emitv (paramv
, signal_id
, 0, NULL
);
651 for (n
= 0; n
< num_params
+ 1; n
++)
652 g_value_unset (¶mv
[n
]);
657 dbus_peer_proxy_g_properties_changed (GDBusProxy
*_proxy
,
658 GVariant
*changed_properties
,
659 const gchar
*const *invalidated_properties
)
661 DBusPeerProxy
*proxy
= DBUS_PEER_PROXY (_proxy
);
665 _ExtendedGDBusPropertyInfo
*info
;
666 g_variant_get (changed_properties
, "a{sv}", &iter
);
667 while (g_variant_iter_next (iter
, "{&sv}", &key
, NULL
))
669 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_dbus_peer_interface_info
.parent_struct
, key
);
670 g_datalist_remove_data (&proxy
->priv
->qdata
, key
);
672 g_object_notify (G_OBJECT (proxy
), info
->hyphen_name
);
674 g_variant_iter_free (iter
);
675 for (n
= 0; invalidated_properties
[n
] != NULL
; n
++)
677 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_dbus_peer_interface_info
.parent_struct
, invalidated_properties
[n
]);
678 g_datalist_remove_data (&proxy
->priv
->qdata
, invalidated_properties
[n
]);
680 g_object_notify (G_OBJECT (proxy
), info
->hyphen_name
);
685 dbus_peer_proxy_init (DBusPeerProxy
*proxy
)
687 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
688 proxy
->priv
= dbus_peer_proxy_get_instance_private (proxy
);
690 proxy
->priv
= G_TYPE_INSTANCE_GET_PRIVATE (proxy
, TYPE_DBUS_PEER_PROXY
, DBusPeerProxyPrivate
);
693 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy
), dbus_peer_interface_info ());
697 dbus_peer_proxy_class_init (DBusPeerProxyClass
*klass
)
699 GObjectClass
*gobject_class
;
700 GDBusProxyClass
*proxy_class
;
702 gobject_class
= G_OBJECT_CLASS (klass
);
703 gobject_class
->finalize
= dbus_peer_proxy_finalize
;
704 gobject_class
->get_property
= dbus_peer_proxy_get_property
;
705 gobject_class
->set_property
= dbus_peer_proxy_set_property
;
707 proxy_class
= G_DBUS_PROXY_CLASS (klass
);
708 proxy_class
->g_signal
= dbus_peer_proxy_g_signal
;
709 proxy_class
->g_properties_changed
= dbus_peer_proxy_g_properties_changed
;
711 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
712 g_type_class_add_private (klass
, sizeof (DBusPeerProxyPrivate
));
717 dbus_peer_proxy_iface_init (DBusPeerIface
*iface
)
722 * dbus_peer_proxy_new:
723 * @connection: A #GDBusConnection.
724 * @flags: Flags from the #GDBusProxyFlags enumeration.
725 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
726 * @object_path: An object path.
727 * @cancellable: (allow-none): A #GCancellable or %NULL.
728 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
729 * @user_data: User data to pass to @callback.
731 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Peer.top_of_page">org.freedesktop.DBus.Peer</link>. See g_dbus_proxy_new() for more details.
733 * 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.
734 * You can then call dbus_peer_proxy_new_finish() to get the result of the operation.
736 * See dbus_peer_proxy_new_sync() for the synchronous, blocking version of this constructor.
739 dbus_peer_proxy_new (
740 GDBusConnection
*connection
,
741 GDBusProxyFlags flags
,
743 const gchar
*object_path
,
744 GCancellable
*cancellable
,
745 GAsyncReadyCallback callback
,
748 g_async_initable_new_async (TYPE_DBUS_PEER_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.DBus.Peer", NULL
);
752 * dbus_peer_proxy_new_finish:
753 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to dbus_peer_proxy_new().
754 * @error: Return location for error or %NULL
756 * Finishes an operation started with dbus_peer_proxy_new().
758 * Returns: (transfer full) (type DBusPeerProxy): The constructed proxy object or %NULL if @error is set.
761 dbus_peer_proxy_new_finish (
766 GObject
*source_object
;
767 source_object
= g_async_result_get_source_object (res
);
768 ret
= g_async_initable_new_finish (G_ASYNC_INITABLE (source_object
), res
, error
);
769 g_object_unref (source_object
);
771 return DBUS_PEER (ret
);
777 * dbus_peer_proxy_new_sync:
778 * @connection: A #GDBusConnection.
779 * @flags: Flags from the #GDBusProxyFlags enumeration.
780 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
781 * @object_path: An object path.
782 * @cancellable: (allow-none): A #GCancellable or %NULL.
783 * @error: Return location for error or %NULL
785 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Peer.top_of_page">org.freedesktop.DBus.Peer</link>. See g_dbus_proxy_new_sync() for more details.
787 * The calling thread is blocked until a reply is received.
789 * See dbus_peer_proxy_new() for the asynchronous version of this constructor.
791 * Returns: (transfer full) (type DBusPeerProxy): The constructed proxy object or %NULL if @error is set.
794 dbus_peer_proxy_new_sync (
795 GDBusConnection
*connection
,
796 GDBusProxyFlags flags
,
798 const gchar
*object_path
,
799 GCancellable
*cancellable
,
803 ret
= g_initable_new (TYPE_DBUS_PEER_PROXY
, cancellable
, error
, "g-flags", flags
, "g-name", name
, "g-connection", connection
, "g-object-path", object_path
, "g-interface-name", "org.freedesktop.DBus.Peer", NULL
);
805 return DBUS_PEER (ret
);
812 * dbus_peer_proxy_new_for_bus:
813 * @bus_type: A #GBusType.
814 * @flags: Flags from the #GDBusProxyFlags enumeration.
815 * @name: A bus name (well-known or unique).
816 * @object_path: An object path.
817 * @cancellable: (allow-none): A #GCancellable or %NULL.
818 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
819 * @user_data: User data to pass to @callback.
821 * Like dbus_peer_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
823 * 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.
824 * You can then call dbus_peer_proxy_new_for_bus_finish() to get the result of the operation.
826 * See dbus_peer_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
829 dbus_peer_proxy_new_for_bus (
831 GDBusProxyFlags flags
,
833 const gchar
*object_path
,
834 GCancellable
*cancellable
,
835 GAsyncReadyCallback callback
,
838 g_async_initable_new_async (TYPE_DBUS_PEER_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.DBus.Peer", NULL
);
842 * dbus_peer_proxy_new_for_bus_finish:
843 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to dbus_peer_proxy_new_for_bus().
844 * @error: Return location for error or %NULL
846 * Finishes an operation started with dbus_peer_proxy_new_for_bus().
848 * Returns: (transfer full) (type DBusPeerProxy): The constructed proxy object or %NULL if @error is set.
851 dbus_peer_proxy_new_for_bus_finish (
856 GObject
*source_object
;
857 source_object
= g_async_result_get_source_object (res
);
858 ret
= g_async_initable_new_finish (G_ASYNC_INITABLE (source_object
), res
, error
);
859 g_object_unref (source_object
);
861 return DBUS_PEER (ret
);
867 * dbus_peer_proxy_new_for_bus_sync:
868 * @bus_type: A #GBusType.
869 * @flags: Flags from the #GDBusProxyFlags enumeration.
870 * @name: A bus name (well-known or unique).
871 * @object_path: An object path.
872 * @cancellable: (allow-none): A #GCancellable or %NULL.
873 * @error: Return location for error or %NULL
875 * Like dbus_peer_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
877 * The calling thread is blocked until a reply is received.
879 * See dbus_peer_proxy_new_for_bus() for the asynchronous version of this constructor.
881 * Returns: (transfer full) (type DBusPeerProxy): The constructed proxy object or %NULL if @error is set.
884 dbus_peer_proxy_new_for_bus_sync (
886 GDBusProxyFlags flags
,
888 const gchar
*object_path
,
889 GCancellable
*cancellable
,
893 ret
= g_initable_new (TYPE_DBUS_PEER_PROXY
, cancellable
, error
, "g-flags", flags
, "g-name", name
, "g-bus-type", bus_type
, "g-object-path", object_path
, "g-interface-name", "org.freedesktop.DBus.Peer", NULL
);
895 return DBUS_PEER (ret
);
901 /* ------------------------------------------------------------------------ */
906 * The #DBusPeerSkeleton structure contains only private data and should only be accessed using the provided API.
910 * DBusPeerSkeletonClass:
911 * @parent_class: The parent class.
913 * Class structure for #DBusPeerSkeleton.
916 struct _DBusPeerSkeletonPrivate
919 GList
*changed_properties
;
920 GSource
*changed_properties_idle_source
;
921 GMainContext
*context
;
926 _dbus_peer_skeleton_handle_method_call (
927 GDBusConnection
*connection G_GNUC_UNUSED
,
928 const gchar
*sender G_GNUC_UNUSED
,
929 const gchar
*object_path G_GNUC_UNUSED
,
930 const gchar
*interface_name
,
931 const gchar
*method_name
,
932 GVariant
*parameters
,
933 GDBusMethodInvocation
*invocation
,
936 DBusPeerSkeleton
*skeleton
= DBUS_PEER_SKELETON (user_data
);
937 _ExtendedGDBusMethodInfo
*info
;
945 GValue return_value
= G_VALUE_INIT
;
946 info
= (_ExtendedGDBusMethodInfo
*) g_dbus_method_invocation_get_method_info (invocation
);
947 g_assert (info
!= NULL
);
948 num_params
= g_variant_n_children (parameters
);
949 num_extra
= info
->pass_fdlist
? 3 : 2; paramv
= g_new0 (GValue
, num_params
+ num_extra
);
951 g_value_init (¶mv
[n
], TYPE_DBUS_PEER
);
952 g_value_set_object (¶mv
[n
++], skeleton
);
953 g_value_init (¶mv
[n
], G_TYPE_DBUS_METHOD_INVOCATION
);
954 g_value_set_object (¶mv
[n
++], invocation
);
955 if (info
->pass_fdlist
)
958 g_value_init (¶mv
[n
], G_TYPE_UNIX_FD_LIST
);
959 g_value_set_object (¶mv
[n
++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation
)));
961 g_assert_not_reached ();
964 g_variant_iter_init (&iter
, parameters
);
965 while ((child
= g_variant_iter_next_value (&iter
)) != NULL
)
967 _ExtendedGDBusArgInfo
*arg_info
= (_ExtendedGDBusArgInfo
*) info
->parent_struct
.in_args
[n
- num_extra
];
968 if (arg_info
->use_gvariant
)
970 g_value_init (¶mv
[n
], G_TYPE_VARIANT
);
971 g_value_set_variant (¶mv
[n
], child
);
975 g_dbus_gvariant_to_gvalue (child
, ¶mv
[n
++]);
976 g_variant_unref (child
);
978 signal_id
= g_signal_lookup (info
->signal_name
, TYPE_DBUS_PEER
);
979 g_value_init (&return_value
, G_TYPE_BOOLEAN
);
980 g_signal_emitv (paramv
, signal_id
, 0, &return_value
);
981 if (!g_value_get_boolean (&return_value
))
982 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
);
983 g_value_unset (&return_value
);
984 for (n
= 0; n
< num_params
+ num_extra
; n
++)
985 g_value_unset (¶mv
[n
]);
990 _dbus_peer_skeleton_handle_get_property (
991 GDBusConnection
*connection G_GNUC_UNUSED
,
992 const gchar
*sender G_GNUC_UNUSED
,
993 const gchar
*object_path G_GNUC_UNUSED
,
994 const gchar
*interface_name G_GNUC_UNUSED
,
995 const gchar
*property_name
,
999 DBusPeerSkeleton
*skeleton
= DBUS_PEER_SKELETON (user_data
);
1000 GValue value
= G_VALUE_INIT
;
1002 _ExtendedGDBusPropertyInfo
*info
;
1005 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_dbus_peer_interface_info
.parent_struct
, property_name
);
1006 g_assert (info
!= NULL
);
1007 pspec
= g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton
), info
->hyphen_name
);
1010 g_set_error (error
, G_DBUS_ERROR
, G_DBUS_ERROR_INVALID_ARGS
, "No property with name %s", property_name
);
1014 g_value_init (&value
, pspec
->value_type
);
1015 g_object_get_property (G_OBJECT (skeleton
), info
->hyphen_name
, &value
);
1016 ret
= g_dbus_gvalue_to_gvariant (&value
, G_VARIANT_TYPE (info
->parent_struct
.signature
));
1017 g_value_unset (&value
);
1023 _dbus_peer_skeleton_handle_set_property (
1024 GDBusConnection
*connection G_GNUC_UNUSED
,
1025 const gchar
*sender G_GNUC_UNUSED
,
1026 const gchar
*object_path G_GNUC_UNUSED
,
1027 const gchar
*interface_name G_GNUC_UNUSED
,
1028 const gchar
*property_name
,
1033 DBusPeerSkeleton
*skeleton
= DBUS_PEER_SKELETON (user_data
);
1034 GValue value
= G_VALUE_INIT
;
1036 _ExtendedGDBusPropertyInfo
*info
;
1039 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_dbus_peer_interface_info
.parent_struct
, property_name
);
1040 g_assert (info
!= NULL
);
1041 pspec
= g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton
), info
->hyphen_name
);
1044 g_set_error (error
, G_DBUS_ERROR
, G_DBUS_ERROR_INVALID_ARGS
, "No property with name %s", property_name
);
1048 if (info
->use_gvariant
)
1049 g_value_set_variant (&value
, variant
);
1051 g_dbus_gvariant_to_gvalue (variant
, &value
);
1052 g_object_set_property (G_OBJECT (skeleton
), info
->hyphen_name
, &value
);
1053 g_value_unset (&value
);
1059 static const GDBusInterfaceVTable _dbus_peer_skeleton_vtable
=
1061 _dbus_peer_skeleton_handle_method_call
,
1062 _dbus_peer_skeleton_handle_get_property
,
1063 _dbus_peer_skeleton_handle_set_property
,
1067 static GDBusInterfaceInfo
*
1068 dbus_peer_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton
*skeleton G_GNUC_UNUSED
)
1070 return dbus_peer_interface_info ();
1073 static GDBusInterfaceVTable
*
1074 dbus_peer_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton
*skeleton G_GNUC_UNUSED
)
1076 return (GDBusInterfaceVTable
*) &_dbus_peer_skeleton_vtable
;
1080 dbus_peer_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton
*_skeleton
)
1082 DBusPeerSkeleton
*skeleton
= DBUS_PEER_SKELETON (_skeleton
);
1084 GVariantBuilder builder
;
1086 g_variant_builder_init (&builder
, G_VARIANT_TYPE ("a{sv}"));
1087 if (_dbus_peer_interface_info
.parent_struct
.properties
== NULL
)
1089 for (n
= 0; _dbus_peer_interface_info
.parent_struct
.properties
[n
] != NULL
; n
++)
1091 GDBusPropertyInfo
*info
= _dbus_peer_interface_info
.parent_struct
.properties
[n
];
1092 if (info
->flags
& G_DBUS_PROPERTY_INFO_FLAGS_READABLE
)
1095 value
= _dbus_peer_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.DBus.Peer", info
->name
, NULL
, skeleton
);
1098 g_variant_take_ref (value
);
1099 g_variant_builder_add (&builder
, "{sv}", info
->name
, value
);
1100 g_variant_unref (value
);
1105 return g_variant_builder_end (&builder
);
1109 dbus_peer_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton
*_skeleton
)
1113 static void dbus_peer_skeleton_iface_init (DBusPeerIface
*iface
);
1114 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1115 G_DEFINE_TYPE_WITH_CODE (DBusPeerSkeleton
, dbus_peer_skeleton
, G_TYPE_DBUS_INTERFACE_SKELETON
,
1116 G_ADD_PRIVATE (DBusPeerSkeleton
)
1117 G_IMPLEMENT_INTERFACE (TYPE_DBUS_PEER
, dbus_peer_skeleton_iface_init
));
1120 G_DEFINE_TYPE_WITH_CODE (DBusPeerSkeleton
, dbus_peer_skeleton
, G_TYPE_DBUS_INTERFACE_SKELETON
,
1121 G_IMPLEMENT_INTERFACE (TYPE_DBUS_PEER
, dbus_peer_skeleton_iface_init
));
1125 dbus_peer_skeleton_finalize (GObject
*object
)
1127 DBusPeerSkeleton
*skeleton
= DBUS_PEER_SKELETON (object
);
1128 g_list_free_full (skeleton
->priv
->changed_properties
, (GDestroyNotify
) _changed_property_free
);
1129 if (skeleton
->priv
->changed_properties_idle_source
!= NULL
)
1130 g_source_destroy (skeleton
->priv
->changed_properties_idle_source
);
1131 g_main_context_unref (skeleton
->priv
->context
);
1132 g_mutex_clear (&skeleton
->priv
->lock
);
1133 G_OBJECT_CLASS (dbus_peer_skeleton_parent_class
)->finalize (object
);
1137 dbus_peer_skeleton_init (DBusPeerSkeleton
*skeleton
)
1139 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1140 skeleton
->priv
= dbus_peer_skeleton_get_instance_private (skeleton
);
1142 skeleton
->priv
= G_TYPE_INSTANCE_GET_PRIVATE (skeleton
, TYPE_DBUS_PEER_SKELETON
, DBusPeerSkeletonPrivate
);
1145 g_mutex_init (&skeleton
->priv
->lock
);
1146 skeleton
->priv
->context
= g_main_context_ref_thread_default ();
1150 dbus_peer_skeleton_class_init (DBusPeerSkeletonClass
*klass
)
1152 GObjectClass
*gobject_class
;
1153 GDBusInterfaceSkeletonClass
*skeleton_class
;
1155 gobject_class
= G_OBJECT_CLASS (klass
);
1156 gobject_class
->finalize
= dbus_peer_skeleton_finalize
;
1158 skeleton_class
= G_DBUS_INTERFACE_SKELETON_CLASS (klass
);
1159 skeleton_class
->get_info
= dbus_peer_skeleton_dbus_interface_get_info
;
1160 skeleton_class
->get_properties
= dbus_peer_skeleton_dbus_interface_get_properties
;
1161 skeleton_class
->flush
= dbus_peer_skeleton_dbus_interface_flush
;
1162 skeleton_class
->get_vtable
= dbus_peer_skeleton_dbus_interface_get_vtable
;
1164 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1165 g_type_class_add_private (klass
, sizeof (DBusPeerSkeletonPrivate
));
1170 dbus_peer_skeleton_iface_init (DBusPeerIface
*iface
)
1175 * dbus_peer_skeleton_new:
1177 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Peer.top_of_page">org.freedesktop.DBus.Peer</link>.
1179 * Returns: (transfer full) (type DBusPeerSkeleton): The skeleton object.
1182 dbus_peer_skeleton_new (void)
1184 return DBUS_PEER (g_object_new (TYPE_DBUS_PEER_SKELETON
, NULL
));
1187 /* ------------------------------------------------------------------------
1188 * Code for interface org.freedesktop.DBus.Introspectable
1189 * ------------------------------------------------------------------------
1193 * SECTION:DBusIntrospectable
1194 * @title: DBusIntrospectable
1195 * @short_description: Generated C code for the org.freedesktop.DBus.Introspectable D-Bus interface
1197 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-DBus-Introspectable.top_of_page">org.freedesktop.DBus.Introspectable</link> D-Bus interface in C.
1200 /* ---- Introspection data for org.freedesktop.DBus.Introspectable ---- */
1202 static const _ExtendedGDBusArgInfo _dbus_introspectable_method_info_introspect_OUT_ARG_data
=
1213 static const _ExtendedGDBusArgInfo
* const _dbus_introspectable_method_info_introspect_OUT_ARG_pointers
[] =
1215 &_dbus_introspectable_method_info_introspect_OUT_ARG_data
,
1219 static const _ExtendedGDBusMethodInfo _dbus_introspectable_method_info_introspect
=
1223 (gchar
*) "Introspect",
1225 (GDBusArgInfo
**) &_dbus_introspectable_method_info_introspect_OUT_ARG_pointers
,
1228 "handle-introspect",
1232 static const _ExtendedGDBusMethodInfo
* const _dbus_introspectable_method_info_pointers
[] =
1234 &_dbus_introspectable_method_info_introspect
,
1238 static const _ExtendedGDBusInterfaceInfo _dbus_introspectable_interface_info
=
1242 (gchar
*) "org.freedesktop.DBus.Introspectable",
1243 (GDBusMethodInfo
**) &_dbus_introspectable_method_info_pointers
,
1248 "dbus-introspectable",
1253 * dbus_introspectable_interface_info:
1255 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-DBus-Introspectable.top_of_page">org.freedesktop.DBus.Introspectable</link> D-Bus interface.
1257 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
1259 GDBusInterfaceInfo
*
1260 dbus_introspectable_interface_info (void)
1262 return (GDBusInterfaceInfo
*) &_dbus_introspectable_interface_info
.parent_struct
;
1266 * dbus_introspectable_override_properties:
1267 * @klass: The class structure for a #GObject<!-- -->-derived class.
1268 * @property_id_begin: The property id to assign to the first overridden property.
1270 * Overrides all #GObject properties in the #DBusIntrospectable interface for a concrete class.
1271 * The properties are overridden in the order they are defined.
1273 * Returns: The last property id.
1276 dbus_introspectable_override_properties (GObjectClass
*klass
, guint property_id_begin
)
1278 return property_id_begin
- 1;
1284 * DBusIntrospectable:
1286 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Introspectable.top_of_page">org.freedesktop.DBus.Introspectable</link>.
1290 * DBusIntrospectableIface:
1291 * @parent_iface: The parent interface.
1292 * @handle_introspect: Handler for the #DBusIntrospectable::handle-introspect signal.
1294 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Introspectable.top_of_page">org.freedesktop.DBus.Introspectable</link>.
1297 typedef DBusIntrospectableIface DBusIntrospectableInterface
;
1298 G_DEFINE_INTERFACE (DBusIntrospectable
, dbus_introspectable
, G_TYPE_OBJECT
);
1301 dbus_introspectable_default_init (DBusIntrospectableIface
*iface
)
1303 /* GObject signals for incoming D-Bus method calls: */
1305 * DBusIntrospectable::handle-introspect:
1306 * @object: A #DBusIntrospectable.
1307 * @invocation: A #GDBusMethodInvocation.
1309 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Introspectable.Introspect">Introspect()</link> D-Bus method.
1311 * 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 dbus_introspectable_complete_introspect() 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.
1313 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
1315 g_signal_new ("handle-introspect",
1316 G_TYPE_FROM_INTERFACE (iface
),
1318 G_STRUCT_OFFSET (DBusIntrospectableIface
, handle_introspect
),
1319 g_signal_accumulator_true_handled
,
1321 g_cclosure_marshal_generic
,
1324 G_TYPE_DBUS_METHOD_INVOCATION
);
1329 * dbus_introspectable_call_introspect:
1330 * @proxy: A #DBusIntrospectableProxy.
1331 * @cancellable: (allow-none): A #GCancellable or %NULL.
1332 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1333 * @user_data: User data to pass to @callback.
1335 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Introspectable.Introspect">Introspect()</link> D-Bus method on @proxy.
1336 * 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.
1337 * You can then call dbus_introspectable_call_introspect_finish() to get the result of the operation.
1339 * See dbus_introspectable_call_introspect_sync() for the synchronous, blocking version of this method.
1342 dbus_introspectable_call_introspect (
1343 DBusIntrospectable
*proxy
,
1344 GCancellable
*cancellable
,
1345 GAsyncReadyCallback callback
,
1348 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
1350 g_variant_new ("()"),
1351 G_DBUS_CALL_FLAGS_NONE
,
1359 * dbus_introspectable_call_introspect_finish:
1360 * @proxy: A #DBusIntrospectableProxy.
1361 * @out_data: (out): Return location for return parameter or %NULL to ignore.
1362 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to dbus_introspectable_call_introspect().
1363 * @error: Return location for error or %NULL.
1365 * Finishes an operation started with dbus_introspectable_call_introspect().
1367 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1370 dbus_introspectable_call_introspect_finish (
1371 DBusIntrospectable
*proxy
,
1377 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
1380 g_variant_get (_ret
,
1383 g_variant_unref (_ret
);
1385 return _ret
!= NULL
;
1389 * dbus_introspectable_call_introspect_sync:
1390 * @proxy: A #DBusIntrospectableProxy.
1391 * @out_data: (out): Return location for return parameter or %NULL to ignore.
1392 * @cancellable: (allow-none): A #GCancellable or %NULL.
1393 * @error: Return location for error or %NULL.
1395 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Introspectable.Introspect">Introspect()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1397 * See dbus_introspectable_call_introspect() for the asynchronous version of this method.
1399 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
1402 dbus_introspectable_call_introspect_sync (
1403 DBusIntrospectable
*proxy
,
1405 GCancellable
*cancellable
,
1409 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
1411 g_variant_new ("()"),
1412 G_DBUS_CALL_FLAGS_NONE
,
1418 g_variant_get (_ret
,
1421 g_variant_unref (_ret
);
1423 return _ret
!= NULL
;
1427 * dbus_introspectable_complete_introspect:
1428 * @object: A #DBusIntrospectable.
1429 * @invocation: (transfer full): A #GDBusMethodInvocation.
1430 * @data: Parameter to return.
1432 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus-Introspectable.Introspect">Introspect()</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.
1434 * This method will free @invocation, you cannot use it afterwards.
1437 dbus_introspectable_complete_introspect (
1438 DBusIntrospectable
*object
,
1439 GDBusMethodInvocation
*invocation
,
1442 g_dbus_method_invocation_return_value (invocation
,
1443 g_variant_new ("(s)",
1447 /* ------------------------------------------------------------------------ */
1450 * DBusIntrospectableProxy:
1452 * The #DBusIntrospectableProxy structure contains only private data and should only be accessed using the provided API.
1456 * DBusIntrospectableProxyClass:
1457 * @parent_class: The parent class.
1459 * Class structure for #DBusIntrospectableProxy.
1462 struct _DBusIntrospectableProxyPrivate
1467 static void dbus_introspectable_proxy_iface_init (DBusIntrospectableIface
*iface
);
1469 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1470 G_DEFINE_TYPE_WITH_CODE (DBusIntrospectableProxy
, dbus_introspectable_proxy
, G_TYPE_DBUS_PROXY
,
1471 G_ADD_PRIVATE (DBusIntrospectableProxy
)
1472 G_IMPLEMENT_INTERFACE (TYPE_DBUS_INTROSPECTABLE
, dbus_introspectable_proxy_iface_init
));
1475 G_DEFINE_TYPE_WITH_CODE (DBusIntrospectableProxy
, dbus_introspectable_proxy
, G_TYPE_DBUS_PROXY
,
1476 G_IMPLEMENT_INTERFACE (TYPE_DBUS_INTROSPECTABLE
, dbus_introspectable_proxy_iface_init
));
1480 dbus_introspectable_proxy_finalize (GObject
*object
)
1482 DBusIntrospectableProxy
*proxy
= DBUS_INTROSPECTABLE_PROXY (object
);
1483 g_datalist_clear (&proxy
->priv
->qdata
);
1484 G_OBJECT_CLASS (dbus_introspectable_proxy_parent_class
)->finalize (object
);
1488 dbus_introspectable_proxy_get_property (GObject
*object
,
1491 GParamSpec
*pspec G_GNUC_UNUSED
)
1496 dbus_introspectable_proxy_set_property (GObject
*object
,
1498 const GValue
*value
,
1499 GParamSpec
*pspec G_GNUC_UNUSED
)
1504 dbus_introspectable_proxy_g_signal (GDBusProxy
*proxy
,
1505 const gchar
*sender_name G_GNUC_UNUSED
,
1506 const gchar
*signal_name
,
1507 GVariant
*parameters
)
1509 _ExtendedGDBusSignalInfo
*info
;
1516 info
= (_ExtendedGDBusSignalInfo
*) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo
*) &_dbus_introspectable_interface_info
.parent_struct
, signal_name
);
1519 num_params
= g_variant_n_children (parameters
);
1520 paramv
= g_new0 (GValue
, num_params
+ 1);
1521 g_value_init (¶mv
[0], TYPE_DBUS_INTROSPECTABLE
);
1522 g_value_set_object (¶mv
[0], proxy
);
1523 g_variant_iter_init (&iter
, parameters
);
1525 while ((child
= g_variant_iter_next_value (&iter
)) != NULL
)
1527 _ExtendedGDBusArgInfo
*arg_info
= (_ExtendedGDBusArgInfo
*) info
->parent_struct
.args
[n
- 1];
1528 if (arg_info
->use_gvariant
)
1530 g_value_init (¶mv
[n
], G_TYPE_VARIANT
);
1531 g_value_set_variant (¶mv
[n
], child
);
1535 g_dbus_gvariant_to_gvalue (child
, ¶mv
[n
++]);
1536 g_variant_unref (child
);
1538 signal_id
= g_signal_lookup (info
->signal_name
, TYPE_DBUS_INTROSPECTABLE
);
1539 g_signal_emitv (paramv
, signal_id
, 0, NULL
);
1540 for (n
= 0; n
< num_params
+ 1; n
++)
1541 g_value_unset (¶mv
[n
]);
1546 dbus_introspectable_proxy_g_properties_changed (GDBusProxy
*_proxy
,
1547 GVariant
*changed_properties
,
1548 const gchar
*const *invalidated_properties
)
1550 DBusIntrospectableProxy
*proxy
= DBUS_INTROSPECTABLE_PROXY (_proxy
);
1554 _ExtendedGDBusPropertyInfo
*info
;
1555 g_variant_get (changed_properties
, "a{sv}", &iter
);
1556 while (g_variant_iter_next (iter
, "{&sv}", &key
, NULL
))
1558 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_dbus_introspectable_interface_info
.parent_struct
, key
);
1559 g_datalist_remove_data (&proxy
->priv
->qdata
, key
);
1561 g_object_notify (G_OBJECT (proxy
), info
->hyphen_name
);
1563 g_variant_iter_free (iter
);
1564 for (n
= 0; invalidated_properties
[n
] != NULL
; n
++)
1566 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_dbus_introspectable_interface_info
.parent_struct
, invalidated_properties
[n
]);
1567 g_datalist_remove_data (&proxy
->priv
->qdata
, invalidated_properties
[n
]);
1569 g_object_notify (G_OBJECT (proxy
), info
->hyphen_name
);
1574 dbus_introspectable_proxy_init (DBusIntrospectableProxy
*proxy
)
1576 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1577 proxy
->priv
= dbus_introspectable_proxy_get_instance_private (proxy
);
1579 proxy
->priv
= G_TYPE_INSTANCE_GET_PRIVATE (proxy
, TYPE_DBUS_INTROSPECTABLE_PROXY
, DBusIntrospectableProxyPrivate
);
1582 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy
), dbus_introspectable_interface_info ());
1586 dbus_introspectable_proxy_class_init (DBusIntrospectableProxyClass
*klass
)
1588 GObjectClass
*gobject_class
;
1589 GDBusProxyClass
*proxy_class
;
1591 gobject_class
= G_OBJECT_CLASS (klass
);
1592 gobject_class
->finalize
= dbus_introspectable_proxy_finalize
;
1593 gobject_class
->get_property
= dbus_introspectable_proxy_get_property
;
1594 gobject_class
->set_property
= dbus_introspectable_proxy_set_property
;
1596 proxy_class
= G_DBUS_PROXY_CLASS (klass
);
1597 proxy_class
->g_signal
= dbus_introspectable_proxy_g_signal
;
1598 proxy_class
->g_properties_changed
= dbus_introspectable_proxy_g_properties_changed
;
1600 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1601 g_type_class_add_private (klass
, sizeof (DBusIntrospectableProxyPrivate
));
1606 dbus_introspectable_proxy_iface_init (DBusIntrospectableIface
*iface
)
1611 * dbus_introspectable_proxy_new:
1612 * @connection: A #GDBusConnection.
1613 * @flags: Flags from the #GDBusProxyFlags enumeration.
1614 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1615 * @object_path: An object path.
1616 * @cancellable: (allow-none): A #GCancellable or %NULL.
1617 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1618 * @user_data: User data to pass to @callback.
1620 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Introspectable.top_of_page">org.freedesktop.DBus.Introspectable</link>. See g_dbus_proxy_new() for more details.
1622 * 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.
1623 * You can then call dbus_introspectable_proxy_new_finish() to get the result of the operation.
1625 * See dbus_introspectable_proxy_new_sync() for the synchronous, blocking version of this constructor.
1628 dbus_introspectable_proxy_new (
1629 GDBusConnection
*connection
,
1630 GDBusProxyFlags flags
,
1632 const gchar
*object_path
,
1633 GCancellable
*cancellable
,
1634 GAsyncReadyCallback callback
,
1637 g_async_initable_new_async (TYPE_DBUS_INTROSPECTABLE_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.DBus.Introspectable", NULL
);
1641 * dbus_introspectable_proxy_new_finish:
1642 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to dbus_introspectable_proxy_new().
1643 * @error: Return location for error or %NULL
1645 * Finishes an operation started with dbus_introspectable_proxy_new().
1647 * Returns: (transfer full) (type DBusIntrospectableProxy): The constructed proxy object or %NULL if @error is set.
1649 DBusIntrospectable
*
1650 dbus_introspectable_proxy_new_finish (
1655 GObject
*source_object
;
1656 source_object
= g_async_result_get_source_object (res
);
1657 ret
= g_async_initable_new_finish (G_ASYNC_INITABLE (source_object
), res
, error
);
1658 g_object_unref (source_object
);
1660 return DBUS_INTROSPECTABLE (ret
);
1666 * dbus_introspectable_proxy_new_sync:
1667 * @connection: A #GDBusConnection.
1668 * @flags: Flags from the #GDBusProxyFlags enumeration.
1669 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1670 * @object_path: An object path.
1671 * @cancellable: (allow-none): A #GCancellable or %NULL.
1672 * @error: Return location for error or %NULL
1674 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Introspectable.top_of_page">org.freedesktop.DBus.Introspectable</link>. See g_dbus_proxy_new_sync() for more details.
1676 * The calling thread is blocked until a reply is received.
1678 * See dbus_introspectable_proxy_new() for the asynchronous version of this constructor.
1680 * Returns: (transfer full) (type DBusIntrospectableProxy): The constructed proxy object or %NULL if @error is set.
1682 DBusIntrospectable
*
1683 dbus_introspectable_proxy_new_sync (
1684 GDBusConnection
*connection
,
1685 GDBusProxyFlags flags
,
1687 const gchar
*object_path
,
1688 GCancellable
*cancellable
,
1692 ret
= g_initable_new (TYPE_DBUS_INTROSPECTABLE_PROXY
, cancellable
, error
, "g-flags", flags
, "g-name", name
, "g-connection", connection
, "g-object-path", object_path
, "g-interface-name", "org.freedesktop.DBus.Introspectable", NULL
);
1694 return DBUS_INTROSPECTABLE (ret
);
1701 * dbus_introspectable_proxy_new_for_bus:
1702 * @bus_type: A #GBusType.
1703 * @flags: Flags from the #GDBusProxyFlags enumeration.
1704 * @name: A bus name (well-known or unique).
1705 * @object_path: An object path.
1706 * @cancellable: (allow-none): A #GCancellable or %NULL.
1707 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1708 * @user_data: User data to pass to @callback.
1710 * Like dbus_introspectable_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
1712 * 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.
1713 * You can then call dbus_introspectable_proxy_new_for_bus_finish() to get the result of the operation.
1715 * See dbus_introspectable_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
1718 dbus_introspectable_proxy_new_for_bus (
1720 GDBusProxyFlags flags
,
1722 const gchar
*object_path
,
1723 GCancellable
*cancellable
,
1724 GAsyncReadyCallback callback
,
1727 g_async_initable_new_async (TYPE_DBUS_INTROSPECTABLE_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.DBus.Introspectable", NULL
);
1731 * dbus_introspectable_proxy_new_for_bus_finish:
1732 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to dbus_introspectable_proxy_new_for_bus().
1733 * @error: Return location for error or %NULL
1735 * Finishes an operation started with dbus_introspectable_proxy_new_for_bus().
1737 * Returns: (transfer full) (type DBusIntrospectableProxy): The constructed proxy object or %NULL if @error is set.
1739 DBusIntrospectable
*
1740 dbus_introspectable_proxy_new_for_bus_finish (
1745 GObject
*source_object
;
1746 source_object
= g_async_result_get_source_object (res
);
1747 ret
= g_async_initable_new_finish (G_ASYNC_INITABLE (source_object
), res
, error
);
1748 g_object_unref (source_object
);
1750 return DBUS_INTROSPECTABLE (ret
);
1756 * dbus_introspectable_proxy_new_for_bus_sync:
1757 * @bus_type: A #GBusType.
1758 * @flags: Flags from the #GDBusProxyFlags enumeration.
1759 * @name: A bus name (well-known or unique).
1760 * @object_path: An object path.
1761 * @cancellable: (allow-none): A #GCancellable or %NULL.
1762 * @error: Return location for error or %NULL
1764 * Like dbus_introspectable_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
1766 * The calling thread is blocked until a reply is received.
1768 * See dbus_introspectable_proxy_new_for_bus() for the asynchronous version of this constructor.
1770 * Returns: (transfer full) (type DBusIntrospectableProxy): The constructed proxy object or %NULL if @error is set.
1772 DBusIntrospectable
*
1773 dbus_introspectable_proxy_new_for_bus_sync (
1775 GDBusProxyFlags flags
,
1777 const gchar
*object_path
,
1778 GCancellable
*cancellable
,
1782 ret
= g_initable_new (TYPE_DBUS_INTROSPECTABLE_PROXY
, cancellable
, error
, "g-flags", flags
, "g-name", name
, "g-bus-type", bus_type
, "g-object-path", object_path
, "g-interface-name", "org.freedesktop.DBus.Introspectable", NULL
);
1784 return DBUS_INTROSPECTABLE (ret
);
1790 /* ------------------------------------------------------------------------ */
1793 * DBusIntrospectableSkeleton:
1795 * The #DBusIntrospectableSkeleton structure contains only private data and should only be accessed using the provided API.
1799 * DBusIntrospectableSkeletonClass:
1800 * @parent_class: The parent class.
1802 * Class structure for #DBusIntrospectableSkeleton.
1805 struct _DBusIntrospectableSkeletonPrivate
1808 GList
*changed_properties
;
1809 GSource
*changed_properties_idle_source
;
1810 GMainContext
*context
;
1815 _dbus_introspectable_skeleton_handle_method_call (
1816 GDBusConnection
*connection G_GNUC_UNUSED
,
1817 const gchar
*sender G_GNUC_UNUSED
,
1818 const gchar
*object_path G_GNUC_UNUSED
,
1819 const gchar
*interface_name
,
1820 const gchar
*method_name
,
1821 GVariant
*parameters
,
1822 GDBusMethodInvocation
*invocation
,
1825 DBusIntrospectableSkeleton
*skeleton
= DBUS_INTROSPECTABLE_SKELETON (user_data
);
1826 _ExtendedGDBusMethodInfo
*info
;
1834 GValue return_value
= G_VALUE_INIT
;
1835 info
= (_ExtendedGDBusMethodInfo
*) g_dbus_method_invocation_get_method_info (invocation
);
1836 g_assert (info
!= NULL
);
1837 num_params
= g_variant_n_children (parameters
);
1838 num_extra
= info
->pass_fdlist
? 3 : 2; paramv
= g_new0 (GValue
, num_params
+ num_extra
);
1840 g_value_init (¶mv
[n
], TYPE_DBUS_INTROSPECTABLE
);
1841 g_value_set_object (¶mv
[n
++], skeleton
);
1842 g_value_init (¶mv
[n
], G_TYPE_DBUS_METHOD_INVOCATION
);
1843 g_value_set_object (¶mv
[n
++], invocation
);
1844 if (info
->pass_fdlist
)
1847 g_value_init (¶mv
[n
], G_TYPE_UNIX_FD_LIST
);
1848 g_value_set_object (¶mv
[n
++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation
)));
1850 g_assert_not_reached ();
1853 g_variant_iter_init (&iter
, parameters
);
1854 while ((child
= g_variant_iter_next_value (&iter
)) != NULL
)
1856 _ExtendedGDBusArgInfo
*arg_info
= (_ExtendedGDBusArgInfo
*) info
->parent_struct
.in_args
[n
- num_extra
];
1857 if (arg_info
->use_gvariant
)
1859 g_value_init (¶mv
[n
], G_TYPE_VARIANT
);
1860 g_value_set_variant (¶mv
[n
], child
);
1864 g_dbus_gvariant_to_gvalue (child
, ¶mv
[n
++]);
1865 g_variant_unref (child
);
1867 signal_id
= g_signal_lookup (info
->signal_name
, TYPE_DBUS_INTROSPECTABLE
);
1868 g_value_init (&return_value
, G_TYPE_BOOLEAN
);
1869 g_signal_emitv (paramv
, signal_id
, 0, &return_value
);
1870 if (!g_value_get_boolean (&return_value
))
1871 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
);
1872 g_value_unset (&return_value
);
1873 for (n
= 0; n
< num_params
+ num_extra
; n
++)
1874 g_value_unset (¶mv
[n
]);
1879 _dbus_introspectable_skeleton_handle_get_property (
1880 GDBusConnection
*connection G_GNUC_UNUSED
,
1881 const gchar
*sender G_GNUC_UNUSED
,
1882 const gchar
*object_path G_GNUC_UNUSED
,
1883 const gchar
*interface_name G_GNUC_UNUSED
,
1884 const gchar
*property_name
,
1888 DBusIntrospectableSkeleton
*skeleton
= DBUS_INTROSPECTABLE_SKELETON (user_data
);
1889 GValue value
= G_VALUE_INIT
;
1891 _ExtendedGDBusPropertyInfo
*info
;
1894 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_dbus_introspectable_interface_info
.parent_struct
, property_name
);
1895 g_assert (info
!= NULL
);
1896 pspec
= g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton
), info
->hyphen_name
);
1899 g_set_error (error
, G_DBUS_ERROR
, G_DBUS_ERROR_INVALID_ARGS
, "No property with name %s", property_name
);
1903 g_value_init (&value
, pspec
->value_type
);
1904 g_object_get_property (G_OBJECT (skeleton
), info
->hyphen_name
, &value
);
1905 ret
= g_dbus_gvalue_to_gvariant (&value
, G_VARIANT_TYPE (info
->parent_struct
.signature
));
1906 g_value_unset (&value
);
1912 _dbus_introspectable_skeleton_handle_set_property (
1913 GDBusConnection
*connection G_GNUC_UNUSED
,
1914 const gchar
*sender G_GNUC_UNUSED
,
1915 const gchar
*object_path G_GNUC_UNUSED
,
1916 const gchar
*interface_name G_GNUC_UNUSED
,
1917 const gchar
*property_name
,
1922 DBusIntrospectableSkeleton
*skeleton
= DBUS_INTROSPECTABLE_SKELETON (user_data
);
1923 GValue value
= G_VALUE_INIT
;
1925 _ExtendedGDBusPropertyInfo
*info
;
1928 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_dbus_introspectable_interface_info
.parent_struct
, property_name
);
1929 g_assert (info
!= NULL
);
1930 pspec
= g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton
), info
->hyphen_name
);
1933 g_set_error (error
, G_DBUS_ERROR
, G_DBUS_ERROR_INVALID_ARGS
, "No property with name %s", property_name
);
1937 if (info
->use_gvariant
)
1938 g_value_set_variant (&value
, variant
);
1940 g_dbus_gvariant_to_gvalue (variant
, &value
);
1941 g_object_set_property (G_OBJECT (skeleton
), info
->hyphen_name
, &value
);
1942 g_value_unset (&value
);
1948 static const GDBusInterfaceVTable _dbus_introspectable_skeleton_vtable
=
1950 _dbus_introspectable_skeleton_handle_method_call
,
1951 _dbus_introspectable_skeleton_handle_get_property
,
1952 _dbus_introspectable_skeleton_handle_set_property
,
1956 static GDBusInterfaceInfo
*
1957 dbus_introspectable_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton
*skeleton G_GNUC_UNUSED
)
1959 return dbus_introspectable_interface_info ();
1962 static GDBusInterfaceVTable
*
1963 dbus_introspectable_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton
*skeleton G_GNUC_UNUSED
)
1965 return (GDBusInterfaceVTable
*) &_dbus_introspectable_skeleton_vtable
;
1969 dbus_introspectable_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton
*_skeleton
)
1971 DBusIntrospectableSkeleton
*skeleton
= DBUS_INTROSPECTABLE_SKELETON (_skeleton
);
1973 GVariantBuilder builder
;
1975 g_variant_builder_init (&builder
, G_VARIANT_TYPE ("a{sv}"));
1976 if (_dbus_introspectable_interface_info
.parent_struct
.properties
== NULL
)
1978 for (n
= 0; _dbus_introspectable_interface_info
.parent_struct
.properties
[n
] != NULL
; n
++)
1980 GDBusPropertyInfo
*info
= _dbus_introspectable_interface_info
.parent_struct
.properties
[n
];
1981 if (info
->flags
& G_DBUS_PROPERTY_INFO_FLAGS_READABLE
)
1984 value
= _dbus_introspectable_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.DBus.Introspectable", info
->name
, NULL
, skeleton
);
1987 g_variant_take_ref (value
);
1988 g_variant_builder_add (&builder
, "{sv}", info
->name
, value
);
1989 g_variant_unref (value
);
1994 return g_variant_builder_end (&builder
);
1998 dbus_introspectable_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton
*_skeleton
)
2002 static void dbus_introspectable_skeleton_iface_init (DBusIntrospectableIface
*iface
);
2003 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2004 G_DEFINE_TYPE_WITH_CODE (DBusIntrospectableSkeleton
, dbus_introspectable_skeleton
, G_TYPE_DBUS_INTERFACE_SKELETON
,
2005 G_ADD_PRIVATE (DBusIntrospectableSkeleton
)
2006 G_IMPLEMENT_INTERFACE (TYPE_DBUS_INTROSPECTABLE
, dbus_introspectable_skeleton_iface_init
));
2009 G_DEFINE_TYPE_WITH_CODE (DBusIntrospectableSkeleton
, dbus_introspectable_skeleton
, G_TYPE_DBUS_INTERFACE_SKELETON
,
2010 G_IMPLEMENT_INTERFACE (TYPE_DBUS_INTROSPECTABLE
, dbus_introspectable_skeleton_iface_init
));
2014 dbus_introspectable_skeleton_finalize (GObject
*object
)
2016 DBusIntrospectableSkeleton
*skeleton
= DBUS_INTROSPECTABLE_SKELETON (object
);
2017 g_list_free_full (skeleton
->priv
->changed_properties
, (GDestroyNotify
) _changed_property_free
);
2018 if (skeleton
->priv
->changed_properties_idle_source
!= NULL
)
2019 g_source_destroy (skeleton
->priv
->changed_properties_idle_source
);
2020 g_main_context_unref (skeleton
->priv
->context
);
2021 g_mutex_clear (&skeleton
->priv
->lock
);
2022 G_OBJECT_CLASS (dbus_introspectable_skeleton_parent_class
)->finalize (object
);
2026 dbus_introspectable_skeleton_init (DBusIntrospectableSkeleton
*skeleton
)
2028 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2029 skeleton
->priv
= dbus_introspectable_skeleton_get_instance_private (skeleton
);
2031 skeleton
->priv
= G_TYPE_INSTANCE_GET_PRIVATE (skeleton
, TYPE_DBUS_INTROSPECTABLE_SKELETON
, DBusIntrospectableSkeletonPrivate
);
2034 g_mutex_init (&skeleton
->priv
->lock
);
2035 skeleton
->priv
->context
= g_main_context_ref_thread_default ();
2039 dbus_introspectable_skeleton_class_init (DBusIntrospectableSkeletonClass
*klass
)
2041 GObjectClass
*gobject_class
;
2042 GDBusInterfaceSkeletonClass
*skeleton_class
;
2044 gobject_class
= G_OBJECT_CLASS (klass
);
2045 gobject_class
->finalize
= dbus_introspectable_skeleton_finalize
;
2047 skeleton_class
= G_DBUS_INTERFACE_SKELETON_CLASS (klass
);
2048 skeleton_class
->get_info
= dbus_introspectable_skeleton_dbus_interface_get_info
;
2049 skeleton_class
->get_properties
= dbus_introspectable_skeleton_dbus_interface_get_properties
;
2050 skeleton_class
->flush
= dbus_introspectable_skeleton_dbus_interface_flush
;
2051 skeleton_class
->get_vtable
= dbus_introspectable_skeleton_dbus_interface_get_vtable
;
2053 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
2054 g_type_class_add_private (klass
, sizeof (DBusIntrospectableSkeletonPrivate
));
2059 dbus_introspectable_skeleton_iface_init (DBusIntrospectableIface
*iface
)
2064 * dbus_introspectable_skeleton_new:
2066 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Introspectable.top_of_page">org.freedesktop.DBus.Introspectable</link>.
2068 * Returns: (transfer full) (type DBusIntrospectableSkeleton): The skeleton object.
2070 DBusIntrospectable
*
2071 dbus_introspectable_skeleton_new (void)
2073 return DBUS_INTROSPECTABLE (g_object_new (TYPE_DBUS_INTROSPECTABLE_SKELETON
, NULL
));
2076 /* ------------------------------------------------------------------------
2077 * Code for interface org.freedesktop.DBus.Properties
2078 * ------------------------------------------------------------------------
2082 * SECTION:DBusProperties
2083 * @title: DBusProperties
2084 * @short_description: Generated C code for the org.freedesktop.DBus.Properties D-Bus interface
2086 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link> D-Bus interface in C.
2089 /* ---- Introspection data for org.freedesktop.DBus.Properties ---- */
2091 static const _ExtendedGDBusArgInfo _dbus_properties_method_info_get_IN_ARG_interface
=
2095 (gchar
*) "interface",
2102 static const _ExtendedGDBusArgInfo _dbus_properties_method_info_get_IN_ARG_property
=
2106 (gchar
*) "property",
2113 static const _ExtendedGDBusArgInfo
* const _dbus_properties_method_info_get_IN_ARG_pointers
[] =
2115 &_dbus_properties_method_info_get_IN_ARG_interface
,
2116 &_dbus_properties_method_info_get_IN_ARG_property
,
2120 static const _ExtendedGDBusArgInfo _dbus_properties_method_info_get_OUT_ARG_value
=
2131 static const _ExtendedGDBusArgInfo
* const _dbus_properties_method_info_get_OUT_ARG_pointers
[] =
2133 &_dbus_properties_method_info_get_OUT_ARG_value
,
2137 static const _ExtendedGDBusMethodInfo _dbus_properties_method_info_get
=
2142 (GDBusArgInfo
**) &_dbus_properties_method_info_get_IN_ARG_pointers
,
2143 (GDBusArgInfo
**) &_dbus_properties_method_info_get_OUT_ARG_pointers
,
2150 static const _ExtendedGDBusArgInfo _dbus_properties_method_info_get_all_IN_ARG_interface
=
2154 (gchar
*) "interface",
2161 static const _ExtendedGDBusArgInfo
* const _dbus_properties_method_info_get_all_IN_ARG_pointers
[] =
2163 &_dbus_properties_method_info_get_all_IN_ARG_interface
,
2167 static const _ExtendedGDBusArgInfo _dbus_properties_method_info_get_all_OUT_ARG_properties
=
2171 (gchar
*) "properties",
2178 static const _ExtendedGDBusArgInfo
* const _dbus_properties_method_info_get_all_OUT_ARG_pointers
[] =
2180 &_dbus_properties_method_info_get_all_OUT_ARG_properties
,
2184 static const _ExtendedGDBusMethodInfo _dbus_properties_method_info_get_all
=
2189 (GDBusArgInfo
**) &_dbus_properties_method_info_get_all_IN_ARG_pointers
,
2190 (GDBusArgInfo
**) &_dbus_properties_method_info_get_all_OUT_ARG_pointers
,
2197 static const _ExtendedGDBusArgInfo _dbus_properties_method_info_set_IN_ARG_interface
=
2201 (gchar
*) "interface",
2208 static const _ExtendedGDBusArgInfo _dbus_properties_method_info_set_IN_ARG_property
=
2212 (gchar
*) "property",
2219 static const _ExtendedGDBusArgInfo _dbus_properties_method_info_set_IN_ARG_value
=
2230 static const _ExtendedGDBusArgInfo
* const _dbus_properties_method_info_set_IN_ARG_pointers
[] =
2232 &_dbus_properties_method_info_set_IN_ARG_interface
,
2233 &_dbus_properties_method_info_set_IN_ARG_property
,
2234 &_dbus_properties_method_info_set_IN_ARG_value
,
2238 static const _ExtendedGDBusMethodInfo _dbus_properties_method_info_set
=
2243 (GDBusArgInfo
**) &_dbus_properties_method_info_set_IN_ARG_pointers
,
2251 static const _ExtendedGDBusMethodInfo
* const _dbus_properties_method_info_pointers
[] =
2253 &_dbus_properties_method_info_get
,
2254 &_dbus_properties_method_info_get_all
,
2255 &_dbus_properties_method_info_set
,
2259 static const _ExtendedGDBusArgInfo _dbus_properties_signal_info_properties_changed_ARG_interface
=
2263 (gchar
*) "interface",
2270 static const _ExtendedGDBusArgInfo _dbus_properties_signal_info_properties_changed_ARG_changed_properties
=
2274 (gchar
*) "changed_properties",
2281 static const _ExtendedGDBusArgInfo _dbus_properties_signal_info_properties_changed_ARG_invalidated_properties
=
2285 (gchar
*) "invalidated_properties",
2292 static const _ExtendedGDBusArgInfo
* const _dbus_properties_signal_info_properties_changed_ARG_pointers
[] =
2294 &_dbus_properties_signal_info_properties_changed_ARG_interface
,
2295 &_dbus_properties_signal_info_properties_changed_ARG_changed_properties
,
2296 &_dbus_properties_signal_info_properties_changed_ARG_invalidated_properties
,
2300 static const _ExtendedGDBusSignalInfo _dbus_properties_signal_info_properties_changed
=
2304 (gchar
*) "PropertiesChanged",
2305 (GDBusArgInfo
**) &_dbus_properties_signal_info_properties_changed_ARG_pointers
,
2308 "properties-changed"
2311 static const _ExtendedGDBusSignalInfo
* const _dbus_properties_signal_info_pointers
[] =
2313 &_dbus_properties_signal_info_properties_changed
,
2317 static const _ExtendedGDBusInterfaceInfo _dbus_properties_interface_info
=
2321 (gchar
*) "org.freedesktop.DBus.Properties",
2322 (GDBusMethodInfo
**) &_dbus_properties_method_info_pointers
,
2323 (GDBusSignalInfo
**) &_dbus_properties_signal_info_pointers
,
2332 * dbus_properties_interface_info:
2334 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link> D-Bus interface.
2336 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
2338 GDBusInterfaceInfo
*
2339 dbus_properties_interface_info (void)
2341 return (GDBusInterfaceInfo
*) &_dbus_properties_interface_info
.parent_struct
;
2345 * dbus_properties_override_properties:
2346 * @klass: The class structure for a #GObject<!-- -->-derived class.
2347 * @property_id_begin: The property id to assign to the first overridden property.
2349 * Overrides all #GObject properties in the #DBusProperties interface for a concrete class.
2350 * The properties are overridden in the order they are defined.
2352 * Returns: The last property id.
2355 dbus_properties_override_properties (GObjectClass
*klass
, guint property_id_begin
)
2357 return property_id_begin
- 1;
2365 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>.
2369 * DBusPropertiesIface:
2370 * @parent_iface: The parent interface.
2371 * @handle_get: Handler for the #DBusProperties::handle-get signal.
2372 * @handle_get_all: Handler for the #DBusProperties::handle-get-all signal.
2373 * @handle_set: Handler for the #DBusProperties::handle-set signal.
2374 * @properties_changed: Handler for the #DBusProperties::properties-changed signal.
2376 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>.
2379 typedef DBusPropertiesIface DBusPropertiesInterface
;
2380 G_DEFINE_INTERFACE (DBusProperties
, dbus_properties
, G_TYPE_OBJECT
);
2383 dbus_properties_default_init (DBusPropertiesIface
*iface
)
2385 /* GObject signals for incoming D-Bus method calls: */
2387 * DBusProperties::handle-get:
2388 * @object: A #DBusProperties.
2389 * @invocation: A #GDBusMethodInvocation.
2390 * @arg_interface: Argument passed by remote caller.
2391 * @arg_property: Argument passed by remote caller.
2393 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Get">Get()</link> D-Bus method.
2395 * 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 dbus_properties_complete_get() 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.
2397 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
2399 g_signal_new ("handle-get",
2400 G_TYPE_FROM_INTERFACE (iface
),
2402 G_STRUCT_OFFSET (DBusPropertiesIface
, handle_get
),
2403 g_signal_accumulator_true_handled
,
2405 g_cclosure_marshal_generic
,
2408 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_STRING
, G_TYPE_STRING
);
2411 * DBusProperties::handle-get-all:
2412 * @object: A #DBusProperties.
2413 * @invocation: A #GDBusMethodInvocation.
2414 * @arg_interface: Argument passed by remote caller.
2416 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.GetAll">GetAll()</link> D-Bus method.
2418 * 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 dbus_properties_complete_get_all() 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.
2420 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
2422 g_signal_new ("handle-get-all",
2423 G_TYPE_FROM_INTERFACE (iface
),
2425 G_STRUCT_OFFSET (DBusPropertiesIface
, handle_get_all
),
2426 g_signal_accumulator_true_handled
,
2428 g_cclosure_marshal_generic
,
2431 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_STRING
);
2434 * DBusProperties::handle-set:
2435 * @object: A #DBusProperties.
2436 * @invocation: A #GDBusMethodInvocation.
2437 * @arg_interface: Argument passed by remote caller.
2438 * @arg_property: Argument passed by remote caller.
2439 * @arg_value: Argument passed by remote caller.
2441 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Set">Set()</link> D-Bus method.
2443 * 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 dbus_properties_complete_set() 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.
2445 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
2447 g_signal_new ("handle-set",
2448 G_TYPE_FROM_INTERFACE (iface
),
2450 G_STRUCT_OFFSET (DBusPropertiesIface
, handle_set
),
2451 g_signal_accumulator_true_handled
,
2453 g_cclosure_marshal_generic
,
2456 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_STRING
, G_TYPE_STRING
, G_TYPE_VARIANT
);
2458 /* GObject signals for received D-Bus signals: */
2460 * DBusProperties::properties-changed:
2461 * @object: A #DBusProperties.
2462 * @arg_interface: Argument.
2463 * @arg_changed_properties: Argument.
2464 * @arg_invalidated_properties: Argument.
2466 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-DBus-Properties.PropertiesChanged">"PropertiesChanged"</link> is received.
2468 * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
2470 g_signal_new ("properties-changed",
2471 G_TYPE_FROM_INTERFACE (iface
),
2473 G_STRUCT_OFFSET (DBusPropertiesIface
, properties_changed
),
2476 g_cclosure_marshal_generic
,
2478 3, G_TYPE_STRING
, G_TYPE_VARIANT
, G_TYPE_STRV
);
2483 * dbus_properties_emit_properties_changed:
2484 * @object: A #DBusProperties.
2485 * @arg_interface: Argument to pass with the signal.
2486 * @arg_changed_properties: Argument to pass with the signal.
2487 * @arg_invalidated_properties: Argument to pass with the signal.
2489 * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus-Properties.PropertiesChanged">"PropertiesChanged"</link> D-Bus signal.
2492 dbus_properties_emit_properties_changed (
2493 DBusProperties
*object
,
2494 const gchar
*arg_interface
,
2495 GVariant
*arg_changed_properties
,
2496 const gchar
*const *arg_invalidated_properties
)
2498 g_signal_emit_by_name (object
, "properties-changed", arg_interface
, arg_changed_properties
, arg_invalidated_properties
);
2502 * dbus_properties_call_get:
2503 * @proxy: A #DBusPropertiesProxy.
2504 * @arg_interface: Argument to pass with the method invocation.
2505 * @arg_property: Argument to pass with the method invocation.
2506 * @cancellable: (allow-none): A #GCancellable or %NULL.
2507 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2508 * @user_data: User data to pass to @callback.
2510 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Get">Get()</link> D-Bus method on @proxy.
2511 * 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.
2512 * You can then call dbus_properties_call_get_finish() to get the result of the operation.
2514 * See dbus_properties_call_get_sync() for the synchronous, blocking version of this method.
2517 dbus_properties_call_get (
2518 DBusProperties
*proxy
,
2519 const gchar
*arg_interface
,
2520 const gchar
*arg_property
,
2521 GCancellable
*cancellable
,
2522 GAsyncReadyCallback callback
,
2525 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
2527 g_variant_new ("(ss)",
2530 G_DBUS_CALL_FLAGS_NONE
,
2538 * dbus_properties_call_get_finish:
2539 * @proxy: A #DBusPropertiesProxy.
2540 * @out_value: (out): Return location for return parameter or %NULL to ignore.
2541 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to dbus_properties_call_get().
2542 * @error: Return location for error or %NULL.
2544 * Finishes an operation started with dbus_properties_call_get().
2546 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
2549 dbus_properties_call_get_finish (
2550 DBusProperties
*proxy
,
2551 GVariant
**out_value
,
2556 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
2559 g_variant_get (_ret
,
2562 g_variant_unref (_ret
);
2564 return _ret
!= NULL
;
2568 * dbus_properties_call_get_sync:
2569 * @proxy: A #DBusPropertiesProxy.
2570 * @arg_interface: Argument to pass with the method invocation.
2571 * @arg_property: Argument to pass with the method invocation.
2572 * @out_value: (out): Return location for return parameter or %NULL to ignore.
2573 * @cancellable: (allow-none): A #GCancellable or %NULL.
2574 * @error: Return location for error or %NULL.
2576 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Get">Get()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2578 * See dbus_properties_call_get() for the asynchronous version of this method.
2580 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
2583 dbus_properties_call_get_sync (
2584 DBusProperties
*proxy
,
2585 const gchar
*arg_interface
,
2586 const gchar
*arg_property
,
2587 GVariant
**out_value
,
2588 GCancellable
*cancellable
,
2592 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
2594 g_variant_new ("(ss)",
2597 G_DBUS_CALL_FLAGS_NONE
,
2603 g_variant_get (_ret
,
2606 g_variant_unref (_ret
);
2608 return _ret
!= NULL
;
2612 * dbus_properties_call_get_all:
2613 * @proxy: A #DBusPropertiesProxy.
2614 * @arg_interface: Argument to pass with the method invocation.
2615 * @cancellable: (allow-none): A #GCancellable or %NULL.
2616 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2617 * @user_data: User data to pass to @callback.
2619 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.GetAll">GetAll()</link> D-Bus method on @proxy.
2620 * 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.
2621 * You can then call dbus_properties_call_get_all_finish() to get the result of the operation.
2623 * See dbus_properties_call_get_all_sync() for the synchronous, blocking version of this method.
2626 dbus_properties_call_get_all (
2627 DBusProperties
*proxy
,
2628 const gchar
*arg_interface
,
2629 GCancellable
*cancellable
,
2630 GAsyncReadyCallback callback
,
2633 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
2635 g_variant_new ("(s)",
2637 G_DBUS_CALL_FLAGS_NONE
,
2645 * dbus_properties_call_get_all_finish:
2646 * @proxy: A #DBusPropertiesProxy.
2647 * @out_properties: (out): Return location for return parameter or %NULL to ignore.
2648 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to dbus_properties_call_get_all().
2649 * @error: Return location for error or %NULL.
2651 * Finishes an operation started with dbus_properties_call_get_all().
2653 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
2656 dbus_properties_call_get_all_finish (
2657 DBusProperties
*proxy
,
2658 GVariant
**out_properties
,
2663 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
2666 g_variant_get (_ret
,
2669 g_variant_unref (_ret
);
2671 return _ret
!= NULL
;
2675 * dbus_properties_call_get_all_sync:
2676 * @proxy: A #DBusPropertiesProxy.
2677 * @arg_interface: Argument to pass with the method invocation.
2678 * @out_properties: (out): Return location for return parameter or %NULL to ignore.
2679 * @cancellable: (allow-none): A #GCancellable or %NULL.
2680 * @error: Return location for error or %NULL.
2682 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.GetAll">GetAll()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2684 * See dbus_properties_call_get_all() for the asynchronous version of this method.
2686 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
2689 dbus_properties_call_get_all_sync (
2690 DBusProperties
*proxy
,
2691 const gchar
*arg_interface
,
2692 GVariant
**out_properties
,
2693 GCancellable
*cancellable
,
2697 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
2699 g_variant_new ("(s)",
2701 G_DBUS_CALL_FLAGS_NONE
,
2707 g_variant_get (_ret
,
2710 g_variant_unref (_ret
);
2712 return _ret
!= NULL
;
2716 * dbus_properties_call_set:
2717 * @proxy: A #DBusPropertiesProxy.
2718 * @arg_interface: Argument to pass with the method invocation.
2719 * @arg_property: Argument to pass with the method invocation.
2720 * @arg_value: Argument to pass with the method invocation.
2721 * @cancellable: (allow-none): A #GCancellable or %NULL.
2722 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2723 * @user_data: User data to pass to @callback.
2725 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Set">Set()</link> D-Bus method on @proxy.
2726 * 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.
2727 * You can then call dbus_properties_call_set_finish() to get the result of the operation.
2729 * See dbus_properties_call_set_sync() for the synchronous, blocking version of this method.
2732 dbus_properties_call_set (
2733 DBusProperties
*proxy
,
2734 const gchar
*arg_interface
,
2735 const gchar
*arg_property
,
2736 GVariant
*arg_value
,
2737 GCancellable
*cancellable
,
2738 GAsyncReadyCallback callback
,
2741 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
2743 g_variant_new ("(ss@v)",
2747 G_DBUS_CALL_FLAGS_NONE
,
2755 * dbus_properties_call_set_finish:
2756 * @proxy: A #DBusPropertiesProxy.
2757 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to dbus_properties_call_set().
2758 * @error: Return location for error or %NULL.
2760 * Finishes an operation started with dbus_properties_call_set().
2762 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
2765 dbus_properties_call_set_finish (
2766 DBusProperties
*proxy
,
2771 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
2774 g_variant_get (_ret
,
2776 g_variant_unref (_ret
);
2778 return _ret
!= NULL
;
2782 * dbus_properties_call_set_sync:
2783 * @proxy: A #DBusPropertiesProxy.
2784 * @arg_interface: Argument to pass with the method invocation.
2785 * @arg_property: Argument to pass with the method invocation.
2786 * @arg_value: Argument to pass with the method invocation.
2787 * @cancellable: (allow-none): A #GCancellable or %NULL.
2788 * @error: Return location for error or %NULL.
2790 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Set">Set()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2792 * See dbus_properties_call_set() for the asynchronous version of this method.
2794 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
2797 dbus_properties_call_set_sync (
2798 DBusProperties
*proxy
,
2799 const gchar
*arg_interface
,
2800 const gchar
*arg_property
,
2801 GVariant
*arg_value
,
2802 GCancellable
*cancellable
,
2806 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
2808 g_variant_new ("(ss@v)",
2812 G_DBUS_CALL_FLAGS_NONE
,
2818 g_variant_get (_ret
,
2820 g_variant_unref (_ret
);
2822 return _ret
!= NULL
;
2826 * dbus_properties_complete_get:
2827 * @object: A #DBusProperties.
2828 * @invocation: (transfer full): A #GDBusMethodInvocation.
2829 * @value: Parameter to return.
2831 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Get">Get()</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.
2833 * This method will free @invocation, you cannot use it afterwards.
2836 dbus_properties_complete_get (
2837 DBusProperties
*object
,
2838 GDBusMethodInvocation
*invocation
,
2841 g_dbus_method_invocation_return_value (invocation
,
2842 g_variant_new ("(@v)",
2847 * dbus_properties_complete_get_all:
2848 * @object: A #DBusProperties.
2849 * @invocation: (transfer full): A #GDBusMethodInvocation.
2850 * @properties: Parameter to return.
2852 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.GetAll">GetAll()</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.
2854 * This method will free @invocation, you cannot use it afterwards.
2857 dbus_properties_complete_get_all (
2858 DBusProperties
*object
,
2859 GDBusMethodInvocation
*invocation
,
2860 GVariant
*properties
)
2862 g_dbus_method_invocation_return_value (invocation
,
2863 g_variant_new ("(@a{sv})",
2868 * dbus_properties_complete_set:
2869 * @object: A #DBusProperties.
2870 * @invocation: (transfer full): A #GDBusMethodInvocation.
2872 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Set">Set()</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.
2874 * This method will free @invocation, you cannot use it afterwards.
2877 dbus_properties_complete_set (
2878 DBusProperties
*object
,
2879 GDBusMethodInvocation
*invocation
)
2881 g_dbus_method_invocation_return_value (invocation
,
2882 g_variant_new ("()"));
2885 /* ------------------------------------------------------------------------ */
2888 * DBusPropertiesProxy:
2890 * The #DBusPropertiesProxy structure contains only private data and should only be accessed using the provided API.
2894 * DBusPropertiesProxyClass:
2895 * @parent_class: The parent class.
2897 * Class structure for #DBusPropertiesProxy.
2900 struct _DBusPropertiesProxyPrivate
2905 static void dbus_properties_proxy_iface_init (DBusPropertiesIface
*iface
);
2907 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2908 G_DEFINE_TYPE_WITH_CODE (DBusPropertiesProxy
, dbus_properties_proxy
, G_TYPE_DBUS_PROXY
,
2909 G_ADD_PRIVATE (DBusPropertiesProxy
)
2910 G_IMPLEMENT_INTERFACE (TYPE_DBUS_PROPERTIES
, dbus_properties_proxy_iface_init
));
2913 G_DEFINE_TYPE_WITH_CODE (DBusPropertiesProxy
, dbus_properties_proxy
, G_TYPE_DBUS_PROXY
,
2914 G_IMPLEMENT_INTERFACE (TYPE_DBUS_PROPERTIES
, dbus_properties_proxy_iface_init
));
2918 dbus_properties_proxy_finalize (GObject
*object
)
2920 DBusPropertiesProxy
*proxy
= DBUS_PROPERTIES_PROXY (object
);
2921 g_datalist_clear (&proxy
->priv
->qdata
);
2922 G_OBJECT_CLASS (dbus_properties_proxy_parent_class
)->finalize (object
);
2926 dbus_properties_proxy_get_property (GObject
*object
,
2929 GParamSpec
*pspec G_GNUC_UNUSED
)
2934 dbus_properties_proxy_set_property (GObject
*object
,
2936 const GValue
*value
,
2937 GParamSpec
*pspec G_GNUC_UNUSED
)
2942 dbus_properties_proxy_g_signal (GDBusProxy
*proxy
,
2943 const gchar
*sender_name G_GNUC_UNUSED
,
2944 const gchar
*signal_name
,
2945 GVariant
*parameters
)
2947 _ExtendedGDBusSignalInfo
*info
;
2954 info
= (_ExtendedGDBusSignalInfo
*) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo
*) &_dbus_properties_interface_info
.parent_struct
, signal_name
);
2957 num_params
= g_variant_n_children (parameters
);
2958 paramv
= g_new0 (GValue
, num_params
+ 1);
2959 g_value_init (¶mv
[0], TYPE_DBUS_PROPERTIES
);
2960 g_value_set_object (¶mv
[0], proxy
);
2961 g_variant_iter_init (&iter
, parameters
);
2963 while ((child
= g_variant_iter_next_value (&iter
)) != NULL
)
2965 _ExtendedGDBusArgInfo
*arg_info
= (_ExtendedGDBusArgInfo
*) info
->parent_struct
.args
[n
- 1];
2966 if (arg_info
->use_gvariant
)
2968 g_value_init (¶mv
[n
], G_TYPE_VARIANT
);
2969 g_value_set_variant (¶mv
[n
], child
);
2973 g_dbus_gvariant_to_gvalue (child
, ¶mv
[n
++]);
2974 g_variant_unref (child
);
2976 signal_id
= g_signal_lookup (info
->signal_name
, TYPE_DBUS_PROPERTIES
);
2977 g_signal_emitv (paramv
, signal_id
, 0, NULL
);
2978 for (n
= 0; n
< num_params
+ 1; n
++)
2979 g_value_unset (¶mv
[n
]);
2984 dbus_properties_proxy_g_properties_changed (GDBusProxy
*_proxy
,
2985 GVariant
*changed_properties
,
2986 const gchar
*const *invalidated_properties
)
2988 DBusPropertiesProxy
*proxy
= DBUS_PROPERTIES_PROXY (_proxy
);
2992 _ExtendedGDBusPropertyInfo
*info
;
2993 g_variant_get (changed_properties
, "a{sv}", &iter
);
2994 while (g_variant_iter_next (iter
, "{&sv}", &key
, NULL
))
2996 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_dbus_properties_interface_info
.parent_struct
, key
);
2997 g_datalist_remove_data (&proxy
->priv
->qdata
, key
);
2999 g_object_notify (G_OBJECT (proxy
), info
->hyphen_name
);
3001 g_variant_iter_free (iter
);
3002 for (n
= 0; invalidated_properties
[n
] != NULL
; n
++)
3004 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_dbus_properties_interface_info
.parent_struct
, invalidated_properties
[n
]);
3005 g_datalist_remove_data (&proxy
->priv
->qdata
, invalidated_properties
[n
]);
3007 g_object_notify (G_OBJECT (proxy
), info
->hyphen_name
);
3012 dbus_properties_proxy_init (DBusPropertiesProxy
*proxy
)
3014 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3015 proxy
->priv
= dbus_properties_proxy_get_instance_private (proxy
);
3017 proxy
->priv
= G_TYPE_INSTANCE_GET_PRIVATE (proxy
, TYPE_DBUS_PROPERTIES_PROXY
, DBusPropertiesProxyPrivate
);
3020 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy
), dbus_properties_interface_info ());
3024 dbus_properties_proxy_class_init (DBusPropertiesProxyClass
*klass
)
3026 GObjectClass
*gobject_class
;
3027 GDBusProxyClass
*proxy_class
;
3029 gobject_class
= G_OBJECT_CLASS (klass
);
3030 gobject_class
->finalize
= dbus_properties_proxy_finalize
;
3031 gobject_class
->get_property
= dbus_properties_proxy_get_property
;
3032 gobject_class
->set_property
= dbus_properties_proxy_set_property
;
3034 proxy_class
= G_DBUS_PROXY_CLASS (klass
);
3035 proxy_class
->g_signal
= dbus_properties_proxy_g_signal
;
3036 proxy_class
->g_properties_changed
= dbus_properties_proxy_g_properties_changed
;
3038 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
3039 g_type_class_add_private (klass
, sizeof (DBusPropertiesProxyPrivate
));
3044 dbus_properties_proxy_iface_init (DBusPropertiesIface
*iface
)
3049 * dbus_properties_proxy_new:
3050 * @connection: A #GDBusConnection.
3051 * @flags: Flags from the #GDBusProxyFlags enumeration.
3052 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
3053 * @object_path: An object path.
3054 * @cancellable: (allow-none): A #GCancellable or %NULL.
3055 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
3056 * @user_data: User data to pass to @callback.
3058 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>. See g_dbus_proxy_new() for more details.
3060 * 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.
3061 * You can then call dbus_properties_proxy_new_finish() to get the result of the operation.
3063 * See dbus_properties_proxy_new_sync() for the synchronous, blocking version of this constructor.
3066 dbus_properties_proxy_new (
3067 GDBusConnection
*connection
,
3068 GDBusProxyFlags flags
,
3070 const gchar
*object_path
,
3071 GCancellable
*cancellable
,
3072 GAsyncReadyCallback callback
,
3075 g_async_initable_new_async (TYPE_DBUS_PROPERTIES_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.DBus.Properties", NULL
);
3079 * dbus_properties_proxy_new_finish:
3080 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to dbus_properties_proxy_new().
3081 * @error: Return location for error or %NULL
3083 * Finishes an operation started with dbus_properties_proxy_new().
3085 * Returns: (transfer full) (type DBusPropertiesProxy): The constructed proxy object or %NULL if @error is set.
3088 dbus_properties_proxy_new_finish (
3093 GObject
*source_object
;
3094 source_object
= g_async_result_get_source_object (res
);
3095 ret
= g_async_initable_new_finish (G_ASYNC_INITABLE (source_object
), res
, error
);
3096 g_object_unref (source_object
);
3098 return DBUS_PROPERTIES (ret
);
3104 * dbus_properties_proxy_new_sync:
3105 * @connection: A #GDBusConnection.
3106 * @flags: Flags from the #GDBusProxyFlags enumeration.
3107 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
3108 * @object_path: An object path.
3109 * @cancellable: (allow-none): A #GCancellable or %NULL.
3110 * @error: Return location for error or %NULL
3112 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>. See g_dbus_proxy_new_sync() for more details.
3114 * The calling thread is blocked until a reply is received.
3116 * See dbus_properties_proxy_new() for the asynchronous version of this constructor.
3118 * Returns: (transfer full) (type DBusPropertiesProxy): The constructed proxy object or %NULL if @error is set.
3121 dbus_properties_proxy_new_sync (
3122 GDBusConnection
*connection
,
3123 GDBusProxyFlags flags
,
3125 const gchar
*object_path
,
3126 GCancellable
*cancellable
,
3130 ret
= g_initable_new (TYPE_DBUS_PROPERTIES_PROXY
, cancellable
, error
, "g-flags", flags
, "g-name", name
, "g-connection", connection
, "g-object-path", object_path
, "g-interface-name", "org.freedesktop.DBus.Properties", NULL
);
3132 return DBUS_PROPERTIES (ret
);
3139 * dbus_properties_proxy_new_for_bus:
3140 * @bus_type: A #GBusType.
3141 * @flags: Flags from the #GDBusProxyFlags enumeration.
3142 * @name: A bus name (well-known or unique).
3143 * @object_path: An object path.
3144 * @cancellable: (allow-none): A #GCancellable or %NULL.
3145 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
3146 * @user_data: User data to pass to @callback.
3148 * Like dbus_properties_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
3150 * 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.
3151 * You can then call dbus_properties_proxy_new_for_bus_finish() to get the result of the operation.
3153 * See dbus_properties_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
3156 dbus_properties_proxy_new_for_bus (
3158 GDBusProxyFlags flags
,
3160 const gchar
*object_path
,
3161 GCancellable
*cancellable
,
3162 GAsyncReadyCallback callback
,
3165 g_async_initable_new_async (TYPE_DBUS_PROPERTIES_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.DBus.Properties", NULL
);
3169 * dbus_properties_proxy_new_for_bus_finish:
3170 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to dbus_properties_proxy_new_for_bus().
3171 * @error: Return location for error or %NULL
3173 * Finishes an operation started with dbus_properties_proxy_new_for_bus().
3175 * Returns: (transfer full) (type DBusPropertiesProxy): The constructed proxy object or %NULL if @error is set.
3178 dbus_properties_proxy_new_for_bus_finish (
3183 GObject
*source_object
;
3184 source_object
= g_async_result_get_source_object (res
);
3185 ret
= g_async_initable_new_finish (G_ASYNC_INITABLE (source_object
), res
, error
);
3186 g_object_unref (source_object
);
3188 return DBUS_PROPERTIES (ret
);
3194 * dbus_properties_proxy_new_for_bus_sync:
3195 * @bus_type: A #GBusType.
3196 * @flags: Flags from the #GDBusProxyFlags enumeration.
3197 * @name: A bus name (well-known or unique).
3198 * @object_path: An object path.
3199 * @cancellable: (allow-none): A #GCancellable or %NULL.
3200 * @error: Return location for error or %NULL
3202 * Like dbus_properties_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
3204 * The calling thread is blocked until a reply is received.
3206 * See dbus_properties_proxy_new_for_bus() for the asynchronous version of this constructor.
3208 * Returns: (transfer full) (type DBusPropertiesProxy): The constructed proxy object or %NULL if @error is set.
3211 dbus_properties_proxy_new_for_bus_sync (
3213 GDBusProxyFlags flags
,
3215 const gchar
*object_path
,
3216 GCancellable
*cancellable
,
3220 ret
= g_initable_new (TYPE_DBUS_PROPERTIES_PROXY
, cancellable
, error
, "g-flags", flags
, "g-name", name
, "g-bus-type", bus_type
, "g-object-path", object_path
, "g-interface-name", "org.freedesktop.DBus.Properties", NULL
);
3222 return DBUS_PROPERTIES (ret
);
3228 /* ------------------------------------------------------------------------ */
3231 * DBusPropertiesSkeleton:
3233 * The #DBusPropertiesSkeleton structure contains only private data and should only be accessed using the provided API.
3237 * DBusPropertiesSkeletonClass:
3238 * @parent_class: The parent class.
3240 * Class structure for #DBusPropertiesSkeleton.
3243 struct _DBusPropertiesSkeletonPrivate
3246 GList
*changed_properties
;
3247 GSource
*changed_properties_idle_source
;
3248 GMainContext
*context
;
3253 _dbus_properties_skeleton_handle_method_call (
3254 GDBusConnection
*connection G_GNUC_UNUSED
,
3255 const gchar
*sender G_GNUC_UNUSED
,
3256 const gchar
*object_path G_GNUC_UNUSED
,
3257 const gchar
*interface_name
,
3258 const gchar
*method_name
,
3259 GVariant
*parameters
,
3260 GDBusMethodInvocation
*invocation
,
3263 DBusPropertiesSkeleton
*skeleton
= DBUS_PROPERTIES_SKELETON (user_data
);
3264 _ExtendedGDBusMethodInfo
*info
;
3272 GValue return_value
= G_VALUE_INIT
;
3273 info
= (_ExtendedGDBusMethodInfo
*) g_dbus_method_invocation_get_method_info (invocation
);
3274 g_assert (info
!= NULL
);
3275 num_params
= g_variant_n_children (parameters
);
3276 num_extra
= info
->pass_fdlist
? 3 : 2; paramv
= g_new0 (GValue
, num_params
+ num_extra
);
3278 g_value_init (¶mv
[n
], TYPE_DBUS_PROPERTIES
);
3279 g_value_set_object (¶mv
[n
++], skeleton
);
3280 g_value_init (¶mv
[n
], G_TYPE_DBUS_METHOD_INVOCATION
);
3281 g_value_set_object (¶mv
[n
++], invocation
);
3282 if (info
->pass_fdlist
)
3285 g_value_init (¶mv
[n
], G_TYPE_UNIX_FD_LIST
);
3286 g_value_set_object (¶mv
[n
++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation
)));
3288 g_assert_not_reached ();
3291 g_variant_iter_init (&iter
, parameters
);
3292 while ((child
= g_variant_iter_next_value (&iter
)) != NULL
)
3294 _ExtendedGDBusArgInfo
*arg_info
= (_ExtendedGDBusArgInfo
*) info
->parent_struct
.in_args
[n
- num_extra
];
3295 if (arg_info
->use_gvariant
)
3297 g_value_init (¶mv
[n
], G_TYPE_VARIANT
);
3298 g_value_set_variant (¶mv
[n
], child
);
3302 g_dbus_gvariant_to_gvalue (child
, ¶mv
[n
++]);
3303 g_variant_unref (child
);
3305 signal_id
= g_signal_lookup (info
->signal_name
, TYPE_DBUS_PROPERTIES
);
3306 g_value_init (&return_value
, G_TYPE_BOOLEAN
);
3307 g_signal_emitv (paramv
, signal_id
, 0, &return_value
);
3308 if (!g_value_get_boolean (&return_value
))
3309 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
);
3310 g_value_unset (&return_value
);
3311 for (n
= 0; n
< num_params
+ num_extra
; n
++)
3312 g_value_unset (¶mv
[n
]);
3317 _dbus_properties_skeleton_handle_get_property (
3318 GDBusConnection
*connection G_GNUC_UNUSED
,
3319 const gchar
*sender G_GNUC_UNUSED
,
3320 const gchar
*object_path G_GNUC_UNUSED
,
3321 const gchar
*interface_name G_GNUC_UNUSED
,
3322 const gchar
*property_name
,
3326 DBusPropertiesSkeleton
*skeleton
= DBUS_PROPERTIES_SKELETON (user_data
);
3327 GValue value
= G_VALUE_INIT
;
3329 _ExtendedGDBusPropertyInfo
*info
;
3332 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_dbus_properties_interface_info
.parent_struct
, property_name
);
3333 g_assert (info
!= NULL
);
3334 pspec
= g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton
), info
->hyphen_name
);
3337 g_set_error (error
, G_DBUS_ERROR
, G_DBUS_ERROR_INVALID_ARGS
, "No property with name %s", property_name
);
3341 g_value_init (&value
, pspec
->value_type
);
3342 g_object_get_property (G_OBJECT (skeleton
), info
->hyphen_name
, &value
);
3343 ret
= g_dbus_gvalue_to_gvariant (&value
, G_VARIANT_TYPE (info
->parent_struct
.signature
));
3344 g_value_unset (&value
);
3350 _dbus_properties_skeleton_handle_set_property (
3351 GDBusConnection
*connection G_GNUC_UNUSED
,
3352 const gchar
*sender G_GNUC_UNUSED
,
3353 const gchar
*object_path G_GNUC_UNUSED
,
3354 const gchar
*interface_name G_GNUC_UNUSED
,
3355 const gchar
*property_name
,
3360 DBusPropertiesSkeleton
*skeleton
= DBUS_PROPERTIES_SKELETON (user_data
);
3361 GValue value
= G_VALUE_INIT
;
3363 _ExtendedGDBusPropertyInfo
*info
;
3366 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_dbus_properties_interface_info
.parent_struct
, property_name
);
3367 g_assert (info
!= NULL
);
3368 pspec
= g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton
), info
->hyphen_name
);
3371 g_set_error (error
, G_DBUS_ERROR
, G_DBUS_ERROR_INVALID_ARGS
, "No property with name %s", property_name
);
3375 if (info
->use_gvariant
)
3376 g_value_set_variant (&value
, variant
);
3378 g_dbus_gvariant_to_gvalue (variant
, &value
);
3379 g_object_set_property (G_OBJECT (skeleton
), info
->hyphen_name
, &value
);
3380 g_value_unset (&value
);
3386 static const GDBusInterfaceVTable _dbus_properties_skeleton_vtable
=
3388 _dbus_properties_skeleton_handle_method_call
,
3389 _dbus_properties_skeleton_handle_get_property
,
3390 _dbus_properties_skeleton_handle_set_property
,
3394 static GDBusInterfaceInfo
*
3395 dbus_properties_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton
*skeleton G_GNUC_UNUSED
)
3397 return dbus_properties_interface_info ();
3400 static GDBusInterfaceVTable
*
3401 dbus_properties_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton
*skeleton G_GNUC_UNUSED
)
3403 return (GDBusInterfaceVTable
*) &_dbus_properties_skeleton_vtable
;
3407 dbus_properties_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton
*_skeleton
)
3409 DBusPropertiesSkeleton
*skeleton
= DBUS_PROPERTIES_SKELETON (_skeleton
);
3411 GVariantBuilder builder
;
3413 g_variant_builder_init (&builder
, G_VARIANT_TYPE ("a{sv}"));
3414 if (_dbus_properties_interface_info
.parent_struct
.properties
== NULL
)
3416 for (n
= 0; _dbus_properties_interface_info
.parent_struct
.properties
[n
] != NULL
; n
++)
3418 GDBusPropertyInfo
*info
= _dbus_properties_interface_info
.parent_struct
.properties
[n
];
3419 if (info
->flags
& G_DBUS_PROPERTY_INFO_FLAGS_READABLE
)
3422 value
= _dbus_properties_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.DBus.Properties", info
->name
, NULL
, skeleton
);
3425 g_variant_take_ref (value
);
3426 g_variant_builder_add (&builder
, "{sv}", info
->name
, value
);
3427 g_variant_unref (value
);
3432 return g_variant_builder_end (&builder
);
3436 dbus_properties_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton
*_skeleton
)
3441 _dbus_properties_on_signal_properties_changed (
3442 DBusProperties
*object
,
3443 const gchar
*arg_interface
,
3444 GVariant
*arg_changed_properties
,
3445 const gchar
*const *arg_invalidated_properties
)
3447 DBusPropertiesSkeleton
*skeleton
= DBUS_PROPERTIES_SKELETON (object
);
3449 GList
*connections
, *l
;
3450 GVariant
*signal_variant
;
3451 connections
= g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton
));
3453 signal_variant
= g_variant_ref_sink (g_variant_new ("(s@a{sv}^as)",
3455 arg_changed_properties
,
3456 arg_invalidated_properties
));
3457 for (l
= connections
; l
!= NULL
; l
= l
->next
)
3459 GDBusConnection
*connection
= l
->data
;
3460 g_dbus_connection_emit_signal (connection
,
3461 NULL
, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton
)), "org.freedesktop.DBus.Properties", "PropertiesChanged",
3462 signal_variant
, NULL
);
3464 g_variant_unref (signal_variant
);
3465 g_list_free_full (connections
, g_object_unref
);
3468 static void dbus_properties_skeleton_iface_init (DBusPropertiesIface
*iface
);
3469 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3470 G_DEFINE_TYPE_WITH_CODE (DBusPropertiesSkeleton
, dbus_properties_skeleton
, G_TYPE_DBUS_INTERFACE_SKELETON
,
3471 G_ADD_PRIVATE (DBusPropertiesSkeleton
)
3472 G_IMPLEMENT_INTERFACE (TYPE_DBUS_PROPERTIES
, dbus_properties_skeleton_iface_init
));
3475 G_DEFINE_TYPE_WITH_CODE (DBusPropertiesSkeleton
, dbus_properties_skeleton
, G_TYPE_DBUS_INTERFACE_SKELETON
,
3476 G_IMPLEMENT_INTERFACE (TYPE_DBUS_PROPERTIES
, dbus_properties_skeleton_iface_init
));
3480 dbus_properties_skeleton_finalize (GObject
*object
)
3482 DBusPropertiesSkeleton
*skeleton
= DBUS_PROPERTIES_SKELETON (object
);
3483 g_list_free_full (skeleton
->priv
->changed_properties
, (GDestroyNotify
) _changed_property_free
);
3484 if (skeleton
->priv
->changed_properties_idle_source
!= NULL
)
3485 g_source_destroy (skeleton
->priv
->changed_properties_idle_source
);
3486 g_main_context_unref (skeleton
->priv
->context
);
3487 g_mutex_clear (&skeleton
->priv
->lock
);
3488 G_OBJECT_CLASS (dbus_properties_skeleton_parent_class
)->finalize (object
);
3492 dbus_properties_skeleton_init (DBusPropertiesSkeleton
*skeleton
)
3494 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3495 skeleton
->priv
= dbus_properties_skeleton_get_instance_private (skeleton
);
3497 skeleton
->priv
= G_TYPE_INSTANCE_GET_PRIVATE (skeleton
, TYPE_DBUS_PROPERTIES_SKELETON
, DBusPropertiesSkeletonPrivate
);
3500 g_mutex_init (&skeleton
->priv
->lock
);
3501 skeleton
->priv
->context
= g_main_context_ref_thread_default ();
3505 dbus_properties_skeleton_class_init (DBusPropertiesSkeletonClass
*klass
)
3507 GObjectClass
*gobject_class
;
3508 GDBusInterfaceSkeletonClass
*skeleton_class
;
3510 gobject_class
= G_OBJECT_CLASS (klass
);
3511 gobject_class
->finalize
= dbus_properties_skeleton_finalize
;
3513 skeleton_class
= G_DBUS_INTERFACE_SKELETON_CLASS (klass
);
3514 skeleton_class
->get_info
= dbus_properties_skeleton_dbus_interface_get_info
;
3515 skeleton_class
->get_properties
= dbus_properties_skeleton_dbus_interface_get_properties
;
3516 skeleton_class
->flush
= dbus_properties_skeleton_dbus_interface_flush
;
3517 skeleton_class
->get_vtable
= dbus_properties_skeleton_dbus_interface_get_vtable
;
3519 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
3520 g_type_class_add_private (klass
, sizeof (DBusPropertiesSkeletonPrivate
));
3525 dbus_properties_skeleton_iface_init (DBusPropertiesIface
*iface
)
3527 iface
->properties_changed
= _dbus_properties_on_signal_properties_changed
;
3531 * dbus_properties_skeleton_new:
3533 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>.
3535 * Returns: (transfer full) (type DBusPropertiesSkeleton): The skeleton object.
3538 dbus_properties_skeleton_new (void)
3540 return DBUS_PROPERTIES (g_object_new (TYPE_DBUS_PROPERTIES_SKELETON
, NULL
));
3543 /* ------------------------------------------------------------------------
3544 * Code for interface org.freedesktop.hostname1
3545 * ------------------------------------------------------------------------
3551 * @short_description: Generated C code for the org.freedesktop.hostname1 D-Bus interface
3553 * 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.
3556 /* ---- Introspection data for org.freedesktop.hostname1 ---- */
3558 static const _ExtendedGDBusArgInfo _hostname1_method_info_set_hostname_IN_ARG_unnamed_arg0
=
3562 (gchar
*) "unnamed_arg0",
3569 static const _ExtendedGDBusArgInfo _hostname1_method_info_set_hostname_IN_ARG_unnamed_arg1
=
3573 (gchar
*) "unnamed_arg1",
3580 static const _ExtendedGDBusArgInfo
* const _hostname1_method_info_set_hostname_IN_ARG_pointers
[] =
3582 &_hostname1_method_info_set_hostname_IN_ARG_unnamed_arg0
,
3583 &_hostname1_method_info_set_hostname_IN_ARG_unnamed_arg1
,
3587 static const _ExtendedGDBusMethodInfo _hostname1_method_info_set_hostname
=
3591 (gchar
*) "SetHostname",
3592 (GDBusArgInfo
**) &_hostname1_method_info_set_hostname_IN_ARG_pointers
,
3596 "handle-set-hostname",
3600 static const _ExtendedGDBusArgInfo _hostname1_method_info_set_static_hostname_IN_ARG_unnamed_arg0
=
3604 (gchar
*) "unnamed_arg0",
3611 static const _ExtendedGDBusArgInfo _hostname1_method_info_set_static_hostname_IN_ARG_unnamed_arg1
=
3615 (gchar
*) "unnamed_arg1",
3622 static const _ExtendedGDBusArgInfo
* const _hostname1_method_info_set_static_hostname_IN_ARG_pointers
[] =
3624 &_hostname1_method_info_set_static_hostname_IN_ARG_unnamed_arg0
,
3625 &_hostname1_method_info_set_static_hostname_IN_ARG_unnamed_arg1
,
3629 static const _ExtendedGDBusMethodInfo _hostname1_method_info_set_static_hostname
=
3633 (gchar
*) "SetStaticHostname",
3634 (GDBusArgInfo
**) &_hostname1_method_info_set_static_hostname_IN_ARG_pointers
,
3638 "handle-set-static-hostname",
3642 static const _ExtendedGDBusArgInfo _hostname1_method_info_set_pretty_hostname_IN_ARG_unnamed_arg0
=
3646 (gchar
*) "unnamed_arg0",
3653 static const _ExtendedGDBusArgInfo _hostname1_method_info_set_pretty_hostname_IN_ARG_unnamed_arg1
=
3657 (gchar
*) "unnamed_arg1",
3664 static const _ExtendedGDBusArgInfo
* const _hostname1_method_info_set_pretty_hostname_IN_ARG_pointers
[] =
3666 &_hostname1_method_info_set_pretty_hostname_IN_ARG_unnamed_arg0
,
3667 &_hostname1_method_info_set_pretty_hostname_IN_ARG_unnamed_arg1
,
3671 static const _ExtendedGDBusMethodInfo _hostname1_method_info_set_pretty_hostname
=
3675 (gchar
*) "SetPrettyHostname",
3676 (GDBusArgInfo
**) &_hostname1_method_info_set_pretty_hostname_IN_ARG_pointers
,
3680 "handle-set-pretty-hostname",
3684 static const _ExtendedGDBusArgInfo _hostname1_method_info_set_icon_name_IN_ARG_unnamed_arg0
=
3688 (gchar
*) "unnamed_arg0",
3695 static const _ExtendedGDBusArgInfo _hostname1_method_info_set_icon_name_IN_ARG_unnamed_arg1
=
3699 (gchar
*) "unnamed_arg1",
3706 static const _ExtendedGDBusArgInfo
* const _hostname1_method_info_set_icon_name_IN_ARG_pointers
[] =
3708 &_hostname1_method_info_set_icon_name_IN_ARG_unnamed_arg0
,
3709 &_hostname1_method_info_set_icon_name_IN_ARG_unnamed_arg1
,
3713 static const _ExtendedGDBusMethodInfo _hostname1_method_info_set_icon_name
=
3717 (gchar
*) "SetIconName",
3718 (GDBusArgInfo
**) &_hostname1_method_info_set_icon_name_IN_ARG_pointers
,
3722 "handle-set-icon-name",
3726 static const _ExtendedGDBusArgInfo _hostname1_method_info_set_chassis_IN_ARG_unnamed_arg0
=
3730 (gchar
*) "unnamed_arg0",
3737 static const _ExtendedGDBusArgInfo _hostname1_method_info_set_chassis_IN_ARG_unnamed_arg1
=
3741 (gchar
*) "unnamed_arg1",
3748 static const _ExtendedGDBusArgInfo
* const _hostname1_method_info_set_chassis_IN_ARG_pointers
[] =
3750 &_hostname1_method_info_set_chassis_IN_ARG_unnamed_arg0
,
3751 &_hostname1_method_info_set_chassis_IN_ARG_unnamed_arg1
,
3755 static const _ExtendedGDBusMethodInfo _hostname1_method_info_set_chassis
=
3759 (gchar
*) "SetChassis",
3760 (GDBusArgInfo
**) &_hostname1_method_info_set_chassis_IN_ARG_pointers
,
3764 "handle-set-chassis",
3768 static const _ExtendedGDBusMethodInfo
* const _hostname1_method_info_pointers
[] =
3770 &_hostname1_method_info_set_hostname
,
3771 &_hostname1_method_info_set_static_hostname
,
3772 &_hostname1_method_info_set_pretty_hostname
,
3773 &_hostname1_method_info_set_icon_name
,
3774 &_hostname1_method_info_set_chassis
,
3778 static const GDBusAnnotationInfo _hostname1_property_hostname_annotation_info_0
=
3781 (gchar
*) "org.freedesktop.DBus.Property.EmitsChangedSignal",
3786 static const GDBusAnnotationInfo
* const _hostname1_property_hostname_annotation_info_pointers
[] =
3788 &_hostname1_property_hostname_annotation_info_0
,
3792 static const _ExtendedGDBusPropertyInfo _hostname1_property_info_hostname
=
3796 (gchar
*) "Hostname",
3798 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
3799 (GDBusAnnotationInfo
**) &_hostname1_property_hostname_annotation_info_pointers
3805 static const _ExtendedGDBusPropertyInfo _hostname1_property_info_static_hostname
=
3809 (gchar
*) "StaticHostname",
3811 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
3818 static const _ExtendedGDBusPropertyInfo _hostname1_property_info_pretty_hostname
=
3822 (gchar
*) "PrettyHostname",
3824 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
3831 static const _ExtendedGDBusPropertyInfo _hostname1_property_info_icon_name
=
3835 (gchar
*) "IconName",
3837 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
3844 static const _ExtendedGDBusPropertyInfo _hostname1_property_info_chassis
=
3848 (gchar
*) "Chassis",
3850 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
3857 static const GDBusAnnotationInfo _hostname1_property_kernel_name_annotation_info_0
=
3860 (gchar
*) "org.freedesktop.DBus.Property.EmitsChangedSignal",
3865 static const GDBusAnnotationInfo
* const _hostname1_property_kernel_name_annotation_info_pointers
[] =
3867 &_hostname1_property_kernel_name_annotation_info_0
,
3871 static const _ExtendedGDBusPropertyInfo _hostname1_property_info_kernel_name
=
3875 (gchar
*) "KernelName",
3877 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
3878 (GDBusAnnotationInfo
**) &_hostname1_property_kernel_name_annotation_info_pointers
3884 static const GDBusAnnotationInfo _hostname1_property_kernel_release_annotation_info_0
=
3887 (gchar
*) "org.freedesktop.DBus.Property.EmitsChangedSignal",
3892 static const GDBusAnnotationInfo
* const _hostname1_property_kernel_release_annotation_info_pointers
[] =
3894 &_hostname1_property_kernel_release_annotation_info_0
,
3898 static const _ExtendedGDBusPropertyInfo _hostname1_property_info_kernel_release
=
3902 (gchar
*) "KernelRelease",
3904 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
3905 (GDBusAnnotationInfo
**) &_hostname1_property_kernel_release_annotation_info_pointers
3911 static const GDBusAnnotationInfo _hostname1_property_kernel_version_annotation_info_0
=
3914 (gchar
*) "org.freedesktop.DBus.Property.EmitsChangedSignal",
3919 static const GDBusAnnotationInfo
* const _hostname1_property_kernel_version_annotation_info_pointers
[] =
3921 &_hostname1_property_kernel_version_annotation_info_0
,
3925 static const _ExtendedGDBusPropertyInfo _hostname1_property_info_kernel_version
=
3929 (gchar
*) "KernelVersion",
3931 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
3932 (GDBusAnnotationInfo
**) &_hostname1_property_kernel_version_annotation_info_pointers
3938 static const GDBusAnnotationInfo _hostname1_property_operating_system_pretty_name_annotation_info_0
=
3941 (gchar
*) "org.freedesktop.DBus.Property.EmitsChangedSignal",
3946 static const GDBusAnnotationInfo
* const _hostname1_property_operating_system_pretty_name_annotation_info_pointers
[] =
3948 &_hostname1_property_operating_system_pretty_name_annotation_info_0
,
3952 static const _ExtendedGDBusPropertyInfo _hostname1_property_info_operating_system_pretty_name
=
3956 (gchar
*) "OperatingSystemPrettyName",
3958 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
3959 (GDBusAnnotationInfo
**) &_hostname1_property_operating_system_pretty_name_annotation_info_pointers
3961 "operating-system-pretty-name",
3965 static const GDBusAnnotationInfo _hostname1_property_operating_system_cpename_annotation_info_0
=
3968 (gchar
*) "org.freedesktop.DBus.Property.EmitsChangedSignal",
3973 static const GDBusAnnotationInfo
* const _hostname1_property_operating_system_cpename_annotation_info_pointers
[] =
3975 &_hostname1_property_operating_system_cpename_annotation_info_0
,
3979 static const _ExtendedGDBusPropertyInfo _hostname1_property_info_operating_system_cpename
=
3983 (gchar
*) "OperatingSystemCPEName",
3985 G_DBUS_PROPERTY_INFO_FLAGS_READABLE
,
3986 (GDBusAnnotationInfo
**) &_hostname1_property_operating_system_cpename_annotation_info_pointers
3988 "operating-system-cpename",
3992 static const _ExtendedGDBusPropertyInfo
* const _hostname1_property_info_pointers
[] =
3994 &_hostname1_property_info_hostname
,
3995 &_hostname1_property_info_static_hostname
,
3996 &_hostname1_property_info_pretty_hostname
,
3997 &_hostname1_property_info_icon_name
,
3998 &_hostname1_property_info_chassis
,
3999 &_hostname1_property_info_kernel_name
,
4000 &_hostname1_property_info_kernel_release
,
4001 &_hostname1_property_info_kernel_version
,
4002 &_hostname1_property_info_operating_system_pretty_name
,
4003 &_hostname1_property_info_operating_system_cpename
,
4007 static const _ExtendedGDBusInterfaceInfo _hostname1_interface_info
=
4011 (gchar
*) "org.freedesktop.hostname1",
4012 (GDBusMethodInfo
**) &_hostname1_method_info_pointers
,
4014 (GDBusPropertyInfo
**) &_hostname1_property_info_pointers
,
4022 * hostname1_interface_info:
4024 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-hostname1.top_of_page">org.freedesktop.hostname1</link> D-Bus interface.
4026 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
4028 GDBusInterfaceInfo
*
4029 hostname1_interface_info (void)
4031 return (GDBusInterfaceInfo
*) &_hostname1_interface_info
.parent_struct
;
4035 * hostname1_override_properties:
4036 * @klass: The class structure for a #GObject<!-- -->-derived class.
4037 * @property_id_begin: The property id to assign to the first overridden property.
4039 * Overrides all #GObject properties in the #Hostname1 interface for a concrete class.
4040 * The properties are overridden in the order they are defined.
4042 * Returns: The last property id.
4045 hostname1_override_properties (GObjectClass
*klass
, guint property_id_begin
)
4047 g_object_class_override_property (klass
, property_id_begin
++, "hostname");
4048 g_object_class_override_property (klass
, property_id_begin
++, "static-hostname");
4049 g_object_class_override_property (klass
, property_id_begin
++, "pretty-hostname");
4050 g_object_class_override_property (klass
, property_id_begin
++, "icon-name");
4051 g_object_class_override_property (klass
, property_id_begin
++, "chassis");
4052 g_object_class_override_property (klass
, property_id_begin
++, "kernel-name");
4053 g_object_class_override_property (klass
, property_id_begin
++, "kernel-release");
4054 g_object_class_override_property (klass
, property_id_begin
++, "kernel-version");
4055 g_object_class_override_property (klass
, property_id_begin
++, "operating-system-pretty-name");
4056 g_object_class_override_property (klass
, property_id_begin
++, "operating-system-cpename");
4057 return property_id_begin
- 1;
4065 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-hostname1.top_of_page">org.freedesktop.hostname1</link>.
4070 * @parent_iface: The parent interface.
4071 * @handle_set_chassis: Handler for the #Hostname1::handle-set-chassis signal.
4072 * @handle_set_hostname: Handler for the #Hostname1::handle-set-hostname signal.
4073 * @handle_set_icon_name: Handler for the #Hostname1::handle-set-icon-name signal.
4074 * @handle_set_pretty_hostname: Handler for the #Hostname1::handle-set-pretty-hostname signal.
4075 * @handle_set_static_hostname: Handler for the #Hostname1::handle-set-static-hostname signal.
4076 * @get_chassis: Getter for the #Hostname1:chassis property.
4077 * @get_hostname: Getter for the #Hostname1:hostname property.
4078 * @get_icon_name: Getter for the #Hostname1:icon-name property.
4079 * @get_kernel_name: Getter for the #Hostname1:kernel-name property.
4080 * @get_kernel_release: Getter for the #Hostname1:kernel-release property.
4081 * @get_kernel_version: Getter for the #Hostname1:kernel-version property.
4082 * @get_operating_system_cpename: Getter for the #Hostname1:operating-system-cpename property.
4083 * @get_operating_system_pretty_name: Getter for the #Hostname1:operating-system-pretty-name property.
4084 * @get_pretty_hostname: Getter for the #Hostname1:pretty-hostname property.
4085 * @get_static_hostname: Getter for the #Hostname1:static-hostname property.
4087 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-hostname1.top_of_page">org.freedesktop.hostname1</link>.
4090 typedef Hostname1Iface Hostname1Interface
;
4091 G_DEFINE_INTERFACE (Hostname1
, hostname1
, G_TYPE_OBJECT
);
4094 hostname1_default_init (Hostname1Iface
*iface
)
4096 /* GObject signals for incoming D-Bus method calls: */
4098 * Hostname1::handle-set-hostname:
4099 * @object: A #Hostname1.
4100 * @invocation: A #GDBusMethodInvocation.
4101 * @arg_unnamed_arg0: Argument passed by remote caller.
4102 * @arg_unnamed_arg1: Argument passed by remote caller.
4104 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-hostname1.SetHostname">SetHostname()</link> D-Bus method.
4106 * 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 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.
4108 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
4110 g_signal_new ("handle-set-hostname",
4111 G_TYPE_FROM_INTERFACE (iface
),
4113 G_STRUCT_OFFSET (Hostname1Iface
, handle_set_hostname
),
4114 g_signal_accumulator_true_handled
,
4116 g_cclosure_marshal_generic
,
4119 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_STRING
, G_TYPE_BOOLEAN
);
4122 * Hostname1::handle-set-static-hostname:
4123 * @object: A #Hostname1.
4124 * @invocation: A #GDBusMethodInvocation.
4125 * @arg_unnamed_arg0: Argument passed by remote caller.
4126 * @arg_unnamed_arg1: Argument passed by remote caller.
4128 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-hostname1.SetStaticHostname">SetStaticHostname()</link> D-Bus method.
4130 * 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 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.
4132 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
4134 g_signal_new ("handle-set-static-hostname",
4135 G_TYPE_FROM_INTERFACE (iface
),
4137 G_STRUCT_OFFSET (Hostname1Iface
, handle_set_static_hostname
),
4138 g_signal_accumulator_true_handled
,
4140 g_cclosure_marshal_generic
,
4143 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_STRING
, G_TYPE_BOOLEAN
);
4146 * Hostname1::handle-set-pretty-hostname:
4147 * @object: A #Hostname1.
4148 * @invocation: A #GDBusMethodInvocation.
4149 * @arg_unnamed_arg0: Argument passed by remote caller.
4150 * @arg_unnamed_arg1: Argument passed by remote caller.
4152 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-hostname1.SetPrettyHostname">SetPrettyHostname()</link> D-Bus method.
4154 * 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 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.
4156 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
4158 g_signal_new ("handle-set-pretty-hostname",
4159 G_TYPE_FROM_INTERFACE (iface
),
4161 G_STRUCT_OFFSET (Hostname1Iface
, handle_set_pretty_hostname
),
4162 g_signal_accumulator_true_handled
,
4164 g_cclosure_marshal_generic
,
4167 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_STRING
, G_TYPE_BOOLEAN
);
4170 * Hostname1::handle-set-icon-name:
4171 * @object: A #Hostname1.
4172 * @invocation: A #GDBusMethodInvocation.
4173 * @arg_unnamed_arg0: Argument passed by remote caller.
4174 * @arg_unnamed_arg1: Argument passed by remote caller.
4176 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-hostname1.SetIconName">SetIconName()</link> D-Bus method.
4178 * 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 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.
4180 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
4182 g_signal_new ("handle-set-icon-name",
4183 G_TYPE_FROM_INTERFACE (iface
),
4185 G_STRUCT_OFFSET (Hostname1Iface
, handle_set_icon_name
),
4186 g_signal_accumulator_true_handled
,
4188 g_cclosure_marshal_generic
,
4191 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_STRING
, G_TYPE_BOOLEAN
);
4194 * Hostname1::handle-set-chassis:
4195 * @object: A #Hostname1.
4196 * @invocation: A #GDBusMethodInvocation.
4197 * @arg_unnamed_arg0: Argument passed by remote caller.
4198 * @arg_unnamed_arg1: Argument passed by remote caller.
4200 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-hostname1.SetChassis">SetChassis()</link> D-Bus method.
4202 * 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 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.
4204 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
4206 g_signal_new ("handle-set-chassis",
4207 G_TYPE_FROM_INTERFACE (iface
),
4209 G_STRUCT_OFFSET (Hostname1Iface
, handle_set_chassis
),
4210 g_signal_accumulator_true_handled
,
4212 g_cclosure_marshal_generic
,
4215 G_TYPE_DBUS_METHOD_INVOCATION
, G_TYPE_STRING
, G_TYPE_BOOLEAN
);
4217 /* GObject properties for D-Bus properties: */
4219 * Hostname1:hostname:
4221 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.Hostname">"Hostname"</link>.
4223 * 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.
4225 g_object_interface_install_property (iface
,
4226 g_param_spec_string ("hostname", "Hostname", "Hostname", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
4228 * Hostname1:static-hostname:
4230 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.StaticHostname">"StaticHostname"</link>.
4232 * 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.
4234 g_object_interface_install_property (iface
,
4235 g_param_spec_string ("static-hostname", "StaticHostname", "StaticHostname", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
4237 * Hostname1:pretty-hostname:
4239 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.PrettyHostname">"PrettyHostname"</link>.
4241 * 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.
4243 g_object_interface_install_property (iface
,
4244 g_param_spec_string ("pretty-hostname", "PrettyHostname", "PrettyHostname", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
4246 * Hostname1:icon-name:
4248 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.IconName">"IconName"</link>.
4250 * 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.
4252 g_object_interface_install_property (iface
,
4253 g_param_spec_string ("icon-name", "IconName", "IconName", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
4255 * Hostname1:chassis:
4257 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.Chassis">"Chassis"</link>.
4259 * 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.
4261 g_object_interface_install_property (iface
,
4262 g_param_spec_string ("chassis", "Chassis", "Chassis", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
4264 * Hostname1:kernel-name:
4266 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.KernelName">"KernelName"</link>.
4268 * 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.
4270 g_object_interface_install_property (iface
,
4271 g_param_spec_string ("kernel-name", "KernelName", "KernelName", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
4273 * Hostname1:kernel-release:
4275 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.KernelRelease">"KernelRelease"</link>.
4277 * 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.
4279 g_object_interface_install_property (iface
,
4280 g_param_spec_string ("kernel-release", "KernelRelease", "KernelRelease", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
4282 * Hostname1:kernel-version:
4284 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.KernelVersion">"KernelVersion"</link>.
4286 * 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.
4288 g_object_interface_install_property (iface
,
4289 g_param_spec_string ("kernel-version", "KernelVersion", "KernelVersion", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
4291 * Hostname1:operating-system-pretty-name:
4293 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemPrettyName">"OperatingSystemPrettyName"</link>.
4295 * 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.
4297 g_object_interface_install_property (iface
,
4298 g_param_spec_string ("operating-system-pretty-name", "OperatingSystemPrettyName", "OperatingSystemPrettyName", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
4300 * Hostname1:operating-system-cpename:
4302 * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemCPEName">"OperatingSystemCPEName"</link>.
4304 * 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.
4306 g_object_interface_install_property (iface
,
4307 g_param_spec_string ("operating-system-cpename", "OperatingSystemCPEName", "OperatingSystemCPEName", NULL
, G_PARAM_READWRITE
| G_PARAM_STATIC_STRINGS
));
4311 * hostname1_get_hostname: (skip)
4312 * @object: A #Hostname1.
4314 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.Hostname">"Hostname"</link> D-Bus property.
4316 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4318 * <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 hostname1_dup_hostname() if on another thread.</warning>
4320 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
4323 hostname1_get_hostname (Hostname1
*object
)
4325 return HOSTNAME1_GET_IFACE (object
)->get_hostname (object
);
4329 * hostname1_dup_hostname: (skip)
4330 * @object: A #Hostname1.
4332 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.Hostname">"Hostname"</link> D-Bus property.
4334 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4336 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
4339 hostname1_dup_hostname (Hostname1
*object
)
4342 g_object_get (G_OBJECT (object
), "hostname", &value
, NULL
);
4347 * hostname1_set_hostname: (skip)
4348 * @object: A #Hostname1.
4349 * @value: The value to set.
4351 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.Hostname">"Hostname"</link> D-Bus property to @value.
4353 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4356 hostname1_set_hostname (Hostname1
*object
, const gchar
*value
)
4358 g_object_set (G_OBJECT (object
), "hostname", value
, NULL
);
4362 * hostname1_get_static_hostname: (skip)
4363 * @object: A #Hostname1.
4365 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.StaticHostname">"StaticHostname"</link> D-Bus property.
4367 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4369 * <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 hostname1_dup_static_hostname() if on another thread.</warning>
4371 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
4374 hostname1_get_static_hostname (Hostname1
*object
)
4376 return HOSTNAME1_GET_IFACE (object
)->get_static_hostname (object
);
4380 * hostname1_dup_static_hostname: (skip)
4381 * @object: A #Hostname1.
4383 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.StaticHostname">"StaticHostname"</link> D-Bus property.
4385 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4387 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
4390 hostname1_dup_static_hostname (Hostname1
*object
)
4393 g_object_get (G_OBJECT (object
), "static-hostname", &value
, NULL
);
4398 * hostname1_set_static_hostname: (skip)
4399 * @object: A #Hostname1.
4400 * @value: The value to set.
4402 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.StaticHostname">"StaticHostname"</link> D-Bus property to @value.
4404 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4407 hostname1_set_static_hostname (Hostname1
*object
, const gchar
*value
)
4409 g_object_set (G_OBJECT (object
), "static-hostname", value
, NULL
);
4413 * hostname1_get_pretty_hostname: (skip)
4414 * @object: A #Hostname1.
4416 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.PrettyHostname">"PrettyHostname"</link> D-Bus property.
4418 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4420 * <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 hostname1_dup_pretty_hostname() if on another thread.</warning>
4422 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
4425 hostname1_get_pretty_hostname (Hostname1
*object
)
4427 return HOSTNAME1_GET_IFACE (object
)->get_pretty_hostname (object
);
4431 * hostname1_dup_pretty_hostname: (skip)
4432 * @object: A #Hostname1.
4434 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.PrettyHostname">"PrettyHostname"</link> D-Bus property.
4436 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4438 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
4441 hostname1_dup_pretty_hostname (Hostname1
*object
)
4444 g_object_get (G_OBJECT (object
), "pretty-hostname", &value
, NULL
);
4449 * hostname1_set_pretty_hostname: (skip)
4450 * @object: A #Hostname1.
4451 * @value: The value to set.
4453 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.PrettyHostname">"PrettyHostname"</link> D-Bus property to @value.
4455 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4458 hostname1_set_pretty_hostname (Hostname1
*object
, const gchar
*value
)
4460 g_object_set (G_OBJECT (object
), "pretty-hostname", value
, NULL
);
4464 * hostname1_get_icon_name: (skip)
4465 * @object: A #Hostname1.
4467 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.IconName">"IconName"</link> D-Bus property.
4469 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4471 * <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 hostname1_dup_icon_name() if on another thread.</warning>
4473 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
4476 hostname1_get_icon_name (Hostname1
*object
)
4478 return HOSTNAME1_GET_IFACE (object
)->get_icon_name (object
);
4482 * hostname1_dup_icon_name: (skip)
4483 * @object: A #Hostname1.
4485 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.IconName">"IconName"</link> D-Bus property.
4487 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4489 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
4492 hostname1_dup_icon_name (Hostname1
*object
)
4495 g_object_get (G_OBJECT (object
), "icon-name", &value
, NULL
);
4500 * hostname1_set_icon_name: (skip)
4501 * @object: A #Hostname1.
4502 * @value: The value to set.
4504 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.IconName">"IconName"</link> D-Bus property to @value.
4506 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4509 hostname1_set_icon_name (Hostname1
*object
, const gchar
*value
)
4511 g_object_set (G_OBJECT (object
), "icon-name", value
, NULL
);
4515 * hostname1_get_chassis: (skip)
4516 * @object: A #Hostname1.
4518 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.Chassis">"Chassis"</link> D-Bus property.
4520 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4522 * <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 hostname1_dup_chassis() if on another thread.</warning>
4524 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
4527 hostname1_get_chassis (Hostname1
*object
)
4529 return HOSTNAME1_GET_IFACE (object
)->get_chassis (object
);
4533 * hostname1_dup_chassis: (skip)
4534 * @object: A #Hostname1.
4536 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.Chassis">"Chassis"</link> D-Bus property.
4538 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4540 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
4543 hostname1_dup_chassis (Hostname1
*object
)
4546 g_object_get (G_OBJECT (object
), "chassis", &value
, NULL
);
4551 * hostname1_set_chassis: (skip)
4552 * @object: A #Hostname1.
4553 * @value: The value to set.
4555 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.Chassis">"Chassis"</link> D-Bus property to @value.
4557 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4560 hostname1_set_chassis (Hostname1
*object
, const gchar
*value
)
4562 g_object_set (G_OBJECT (object
), "chassis", value
, NULL
);
4566 * hostname1_get_kernel_name: (skip)
4567 * @object: A #Hostname1.
4569 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelName">"KernelName"</link> D-Bus property.
4571 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4573 * <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 hostname1_dup_kernel_name() if on another thread.</warning>
4575 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
4578 hostname1_get_kernel_name (Hostname1
*object
)
4580 return HOSTNAME1_GET_IFACE (object
)->get_kernel_name (object
);
4584 * hostname1_dup_kernel_name: (skip)
4585 * @object: A #Hostname1.
4587 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelName">"KernelName"</link> D-Bus property.
4589 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4591 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
4594 hostname1_dup_kernel_name (Hostname1
*object
)
4597 g_object_get (G_OBJECT (object
), "kernel-name", &value
, NULL
);
4602 * hostname1_set_kernel_name: (skip)
4603 * @object: A #Hostname1.
4604 * @value: The value to set.
4606 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelName">"KernelName"</link> D-Bus property to @value.
4608 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4611 hostname1_set_kernel_name (Hostname1
*object
, const gchar
*value
)
4613 g_object_set (G_OBJECT (object
), "kernel-name", value
, NULL
);
4617 * hostname1_get_kernel_release: (skip)
4618 * @object: A #Hostname1.
4620 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelRelease">"KernelRelease"</link> D-Bus property.
4622 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4624 * <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 hostname1_dup_kernel_release() if on another thread.</warning>
4626 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
4629 hostname1_get_kernel_release (Hostname1
*object
)
4631 return HOSTNAME1_GET_IFACE (object
)->get_kernel_release (object
);
4635 * hostname1_dup_kernel_release: (skip)
4636 * @object: A #Hostname1.
4638 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelRelease">"KernelRelease"</link> D-Bus property.
4640 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4642 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
4645 hostname1_dup_kernel_release (Hostname1
*object
)
4648 g_object_get (G_OBJECT (object
), "kernel-release", &value
, NULL
);
4653 * hostname1_set_kernel_release: (skip)
4654 * @object: A #Hostname1.
4655 * @value: The value to set.
4657 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelRelease">"KernelRelease"</link> D-Bus property to @value.
4659 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4662 hostname1_set_kernel_release (Hostname1
*object
, const gchar
*value
)
4664 g_object_set (G_OBJECT (object
), "kernel-release", value
, NULL
);
4668 * hostname1_get_kernel_version: (skip)
4669 * @object: A #Hostname1.
4671 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelVersion">"KernelVersion"</link> D-Bus property.
4673 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4675 * <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 hostname1_dup_kernel_version() if on another thread.</warning>
4677 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
4680 hostname1_get_kernel_version (Hostname1
*object
)
4682 return HOSTNAME1_GET_IFACE (object
)->get_kernel_version (object
);
4686 * hostname1_dup_kernel_version: (skip)
4687 * @object: A #Hostname1.
4689 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelVersion">"KernelVersion"</link> D-Bus property.
4691 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4693 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
4696 hostname1_dup_kernel_version (Hostname1
*object
)
4699 g_object_get (G_OBJECT (object
), "kernel-version", &value
, NULL
);
4704 * hostname1_set_kernel_version: (skip)
4705 * @object: A #Hostname1.
4706 * @value: The value to set.
4708 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.KernelVersion">"KernelVersion"</link> D-Bus property to @value.
4710 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4713 hostname1_set_kernel_version (Hostname1
*object
, const gchar
*value
)
4715 g_object_set (G_OBJECT (object
), "kernel-version", value
, NULL
);
4719 * hostname1_get_operating_system_pretty_name: (skip)
4720 * @object: A #Hostname1.
4722 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemPrettyName">"OperatingSystemPrettyName"</link> D-Bus property.
4724 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4726 * <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 hostname1_dup_operating_system_pretty_name() if on another thread.</warning>
4728 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
4731 hostname1_get_operating_system_pretty_name (Hostname1
*object
)
4733 return HOSTNAME1_GET_IFACE (object
)->get_operating_system_pretty_name (object
);
4737 * hostname1_dup_operating_system_pretty_name: (skip)
4738 * @object: A #Hostname1.
4740 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemPrettyName">"OperatingSystemPrettyName"</link> D-Bus property.
4742 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4744 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
4747 hostname1_dup_operating_system_pretty_name (Hostname1
*object
)
4750 g_object_get (G_OBJECT (object
), "operating-system-pretty-name", &value
, NULL
);
4755 * hostname1_set_operating_system_pretty_name: (skip)
4756 * @object: A #Hostname1.
4757 * @value: The value to set.
4759 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemPrettyName">"OperatingSystemPrettyName"</link> D-Bus property to @value.
4761 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4764 hostname1_set_operating_system_pretty_name (Hostname1
*object
, const gchar
*value
)
4766 g_object_set (G_OBJECT (object
), "operating-system-pretty-name", value
, NULL
);
4770 * hostname1_get_operating_system_cpename: (skip)
4771 * @object: A #Hostname1.
4773 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemCPEName">"OperatingSystemCPEName"</link> D-Bus property.
4775 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4777 * <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 hostname1_dup_operating_system_cpename() if on another thread.</warning>
4779 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
4782 hostname1_get_operating_system_cpename (Hostname1
*object
)
4784 return HOSTNAME1_GET_IFACE (object
)->get_operating_system_cpename (object
);
4788 * hostname1_dup_operating_system_cpename: (skip)
4789 * @object: A #Hostname1.
4791 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemCPEName">"OperatingSystemCPEName"</link> D-Bus property.
4793 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4795 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
4798 hostname1_dup_operating_system_cpename (Hostname1
*object
)
4801 g_object_get (G_OBJECT (object
), "operating-system-cpename", &value
, NULL
);
4806 * hostname1_set_operating_system_cpename: (skip)
4807 * @object: A #Hostname1.
4808 * @value: The value to set.
4810 * Sets the <link linkend="gdbus-property-org-freedesktop-hostname1.OperatingSystemCPEName">"OperatingSystemCPEName"</link> D-Bus property to @value.
4812 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4815 hostname1_set_operating_system_cpename (Hostname1
*object
, const gchar
*value
)
4817 g_object_set (G_OBJECT (object
), "operating-system-cpename", value
, NULL
);
4821 * hostname1_call_set_hostname:
4822 * @proxy: A #Hostname1Proxy.
4823 * @arg_unnamed_arg0: Argument to pass with the method invocation.
4824 * @arg_unnamed_arg1: Argument to pass with the method invocation.
4825 * @cancellable: (allow-none): A #GCancellable or %NULL.
4826 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
4827 * @user_data: User data to pass to @callback.
4829 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-hostname1.SetHostname">SetHostname()</link> D-Bus method on @proxy.
4830 * 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.
4831 * You can then call hostname1_call_set_hostname_finish() to get the result of the operation.
4833 * See hostname1_call_set_hostname_sync() for the synchronous, blocking version of this method.
4836 hostname1_call_set_hostname (
4838 const gchar
*arg_unnamed_arg0
,
4839 gboolean arg_unnamed_arg1
,
4840 GCancellable
*cancellable
,
4841 GAsyncReadyCallback callback
,
4844 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
4846 g_variant_new ("(sb)",
4849 G_DBUS_CALL_FLAGS_NONE
,
4857 * hostname1_call_set_hostname_finish:
4858 * @proxy: A #Hostname1Proxy.
4859 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostname1_call_set_hostname().
4860 * @error: Return location for error or %NULL.
4862 * Finishes an operation started with hostname1_call_set_hostname().
4864 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4867 hostname1_call_set_hostname_finish (
4873 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
4876 g_variant_get (_ret
,
4878 g_variant_unref (_ret
);
4880 return _ret
!= NULL
;
4884 * hostname1_call_set_hostname_sync:
4885 * @proxy: A #Hostname1Proxy.
4886 * @arg_unnamed_arg0: Argument to pass with the method invocation.
4887 * @arg_unnamed_arg1: Argument to pass with the method invocation.
4888 * @cancellable: (allow-none): A #GCancellable or %NULL.
4889 * @error: Return location for error or %NULL.
4891 * 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.
4893 * See hostname1_call_set_hostname() for the asynchronous version of this method.
4895 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4898 hostname1_call_set_hostname_sync (
4900 const gchar
*arg_unnamed_arg0
,
4901 gboolean arg_unnamed_arg1
,
4902 GCancellable
*cancellable
,
4906 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
4908 g_variant_new ("(sb)",
4911 G_DBUS_CALL_FLAGS_NONE
,
4917 g_variant_get (_ret
,
4919 g_variant_unref (_ret
);
4921 return _ret
!= NULL
;
4925 * hostname1_call_set_static_hostname:
4926 * @proxy: A #Hostname1Proxy.
4927 * @arg_unnamed_arg0: Argument to pass with the method invocation.
4928 * @arg_unnamed_arg1: Argument to pass with the method invocation.
4929 * @cancellable: (allow-none): A #GCancellable or %NULL.
4930 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
4931 * @user_data: User data to pass to @callback.
4933 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-hostname1.SetStaticHostname">SetStaticHostname()</link> D-Bus method on @proxy.
4934 * 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.
4935 * You can then call hostname1_call_set_static_hostname_finish() to get the result of the operation.
4937 * See hostname1_call_set_static_hostname_sync() for the synchronous, blocking version of this method.
4940 hostname1_call_set_static_hostname (
4942 const gchar
*arg_unnamed_arg0
,
4943 gboolean arg_unnamed_arg1
,
4944 GCancellable
*cancellable
,
4945 GAsyncReadyCallback callback
,
4948 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
4949 "SetStaticHostname",
4950 g_variant_new ("(sb)",
4953 G_DBUS_CALL_FLAGS_NONE
,
4961 * hostname1_call_set_static_hostname_finish:
4962 * @proxy: A #Hostname1Proxy.
4963 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostname1_call_set_static_hostname().
4964 * @error: Return location for error or %NULL.
4966 * Finishes an operation started with hostname1_call_set_static_hostname().
4968 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
4971 hostname1_call_set_static_hostname_finish (
4977 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
4980 g_variant_get (_ret
,
4982 g_variant_unref (_ret
);
4984 return _ret
!= NULL
;
4988 * hostname1_call_set_static_hostname_sync:
4989 * @proxy: A #Hostname1Proxy.
4990 * @arg_unnamed_arg0: Argument to pass with the method invocation.
4991 * @arg_unnamed_arg1: Argument to pass with the method invocation.
4992 * @cancellable: (allow-none): A #GCancellable or %NULL.
4993 * @error: Return location for error or %NULL.
4995 * 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.
4997 * See hostname1_call_set_static_hostname() for the asynchronous version of this method.
4999 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
5002 hostname1_call_set_static_hostname_sync (
5004 const gchar
*arg_unnamed_arg0
,
5005 gboolean arg_unnamed_arg1
,
5006 GCancellable
*cancellable
,
5010 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
5011 "SetStaticHostname",
5012 g_variant_new ("(sb)",
5015 G_DBUS_CALL_FLAGS_NONE
,
5021 g_variant_get (_ret
,
5023 g_variant_unref (_ret
);
5025 return _ret
!= NULL
;
5029 * hostname1_call_set_pretty_hostname:
5030 * @proxy: A #Hostname1Proxy.
5031 * @arg_unnamed_arg0: Argument to pass with the method invocation.
5032 * @arg_unnamed_arg1: Argument to pass with the method invocation.
5033 * @cancellable: (allow-none): A #GCancellable or %NULL.
5034 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
5035 * @user_data: User data to pass to @callback.
5037 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-hostname1.SetPrettyHostname">SetPrettyHostname()</link> D-Bus method on @proxy.
5038 * 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.
5039 * You can then call hostname1_call_set_pretty_hostname_finish() to get the result of the operation.
5041 * See hostname1_call_set_pretty_hostname_sync() for the synchronous, blocking version of this method.
5044 hostname1_call_set_pretty_hostname (
5046 const gchar
*arg_unnamed_arg0
,
5047 gboolean arg_unnamed_arg1
,
5048 GCancellable
*cancellable
,
5049 GAsyncReadyCallback callback
,
5052 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
5053 "SetPrettyHostname",
5054 g_variant_new ("(sb)",
5057 G_DBUS_CALL_FLAGS_NONE
,
5065 * hostname1_call_set_pretty_hostname_finish:
5066 * @proxy: A #Hostname1Proxy.
5067 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostname1_call_set_pretty_hostname().
5068 * @error: Return location for error or %NULL.
5070 * Finishes an operation started with hostname1_call_set_pretty_hostname().
5072 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
5075 hostname1_call_set_pretty_hostname_finish (
5081 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
5084 g_variant_get (_ret
,
5086 g_variant_unref (_ret
);
5088 return _ret
!= NULL
;
5092 * hostname1_call_set_pretty_hostname_sync:
5093 * @proxy: A #Hostname1Proxy.
5094 * @arg_unnamed_arg0: Argument to pass with the method invocation.
5095 * @arg_unnamed_arg1: Argument to pass with the method invocation.
5096 * @cancellable: (allow-none): A #GCancellable or %NULL.
5097 * @error: Return location for error or %NULL.
5099 * 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.
5101 * See hostname1_call_set_pretty_hostname() for the asynchronous version of this method.
5103 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
5106 hostname1_call_set_pretty_hostname_sync (
5108 const gchar
*arg_unnamed_arg0
,
5109 gboolean arg_unnamed_arg1
,
5110 GCancellable
*cancellable
,
5114 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
5115 "SetPrettyHostname",
5116 g_variant_new ("(sb)",
5119 G_DBUS_CALL_FLAGS_NONE
,
5125 g_variant_get (_ret
,
5127 g_variant_unref (_ret
);
5129 return _ret
!= NULL
;
5133 * hostname1_call_set_icon_name:
5134 * @proxy: A #Hostname1Proxy.
5135 * @arg_unnamed_arg0: Argument to pass with the method invocation.
5136 * @arg_unnamed_arg1: Argument to pass with the method invocation.
5137 * @cancellable: (allow-none): A #GCancellable or %NULL.
5138 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
5139 * @user_data: User data to pass to @callback.
5141 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-hostname1.SetIconName">SetIconName()</link> D-Bus method on @proxy.
5142 * 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.
5143 * You can then call hostname1_call_set_icon_name_finish() to get the result of the operation.
5145 * See hostname1_call_set_icon_name_sync() for the synchronous, blocking version of this method.
5148 hostname1_call_set_icon_name (
5150 const gchar
*arg_unnamed_arg0
,
5151 gboolean arg_unnamed_arg1
,
5152 GCancellable
*cancellable
,
5153 GAsyncReadyCallback callback
,
5156 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
5158 g_variant_new ("(sb)",
5161 G_DBUS_CALL_FLAGS_NONE
,
5169 * hostname1_call_set_icon_name_finish:
5170 * @proxy: A #Hostname1Proxy.
5171 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostname1_call_set_icon_name().
5172 * @error: Return location for error or %NULL.
5174 * Finishes an operation started with hostname1_call_set_icon_name().
5176 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
5179 hostname1_call_set_icon_name_finish (
5185 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
5188 g_variant_get (_ret
,
5190 g_variant_unref (_ret
);
5192 return _ret
!= NULL
;
5196 * hostname1_call_set_icon_name_sync:
5197 * @proxy: A #Hostname1Proxy.
5198 * @arg_unnamed_arg0: Argument to pass with the method invocation.
5199 * @arg_unnamed_arg1: Argument to pass with the method invocation.
5200 * @cancellable: (allow-none): A #GCancellable or %NULL.
5201 * @error: Return location for error or %NULL.
5203 * 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.
5205 * See hostname1_call_set_icon_name() for the asynchronous version of this method.
5207 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
5210 hostname1_call_set_icon_name_sync (
5212 const gchar
*arg_unnamed_arg0
,
5213 gboolean arg_unnamed_arg1
,
5214 GCancellable
*cancellable
,
5218 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
5220 g_variant_new ("(sb)",
5223 G_DBUS_CALL_FLAGS_NONE
,
5229 g_variant_get (_ret
,
5231 g_variant_unref (_ret
);
5233 return _ret
!= NULL
;
5237 * hostname1_call_set_chassis:
5238 * @proxy: A #Hostname1Proxy.
5239 * @arg_unnamed_arg0: Argument to pass with the method invocation.
5240 * @arg_unnamed_arg1: Argument to pass with the method invocation.
5241 * @cancellable: (allow-none): A #GCancellable or %NULL.
5242 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
5243 * @user_data: User data to pass to @callback.
5245 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-hostname1.SetChassis">SetChassis()</link> D-Bus method on @proxy.
5246 * 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.
5247 * You can then call hostname1_call_set_chassis_finish() to get the result of the operation.
5249 * See hostname1_call_set_chassis_sync() for the synchronous, blocking version of this method.
5252 hostname1_call_set_chassis (
5254 const gchar
*arg_unnamed_arg0
,
5255 gboolean arg_unnamed_arg1
,
5256 GCancellable
*cancellable
,
5257 GAsyncReadyCallback callback
,
5260 g_dbus_proxy_call (G_DBUS_PROXY (proxy
),
5262 g_variant_new ("(sb)",
5265 G_DBUS_CALL_FLAGS_NONE
,
5273 * hostname1_call_set_chassis_finish:
5274 * @proxy: A #Hostname1Proxy.
5275 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostname1_call_set_chassis().
5276 * @error: Return location for error or %NULL.
5278 * Finishes an operation started with hostname1_call_set_chassis().
5280 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
5283 hostname1_call_set_chassis_finish (
5289 _ret
= g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy
), res
, error
);
5292 g_variant_get (_ret
,
5294 g_variant_unref (_ret
);
5296 return _ret
!= NULL
;
5300 * hostname1_call_set_chassis_sync:
5301 * @proxy: A #Hostname1Proxy.
5302 * @arg_unnamed_arg0: Argument to pass with the method invocation.
5303 * @arg_unnamed_arg1: Argument to pass with the method invocation.
5304 * @cancellable: (allow-none): A #GCancellable or %NULL.
5305 * @error: Return location for error or %NULL.
5307 * 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.
5309 * See hostname1_call_set_chassis() for the asynchronous version of this method.
5311 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
5314 hostname1_call_set_chassis_sync (
5316 const gchar
*arg_unnamed_arg0
,
5317 gboolean arg_unnamed_arg1
,
5318 GCancellable
*cancellable
,
5322 _ret
= g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy
),
5324 g_variant_new ("(sb)",
5327 G_DBUS_CALL_FLAGS_NONE
,
5333 g_variant_get (_ret
,
5335 g_variant_unref (_ret
);
5337 return _ret
!= NULL
;
5341 * hostname1_complete_set_hostname:
5342 * @object: A #Hostname1.
5343 * @invocation: (transfer full): A #GDBusMethodInvocation.
5345 * 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.
5347 * This method will free @invocation, you cannot use it afterwards.
5350 hostname1_complete_set_hostname (
5352 GDBusMethodInvocation
*invocation
)
5354 g_dbus_method_invocation_return_value (invocation
,
5355 g_variant_new ("()"));
5359 * hostname1_complete_set_static_hostname:
5360 * @object: A #Hostname1.
5361 * @invocation: (transfer full): A #GDBusMethodInvocation.
5363 * 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.
5365 * This method will free @invocation, you cannot use it afterwards.
5368 hostname1_complete_set_static_hostname (
5370 GDBusMethodInvocation
*invocation
)
5372 g_dbus_method_invocation_return_value (invocation
,
5373 g_variant_new ("()"));
5377 * hostname1_complete_set_pretty_hostname:
5378 * @object: A #Hostname1.
5379 * @invocation: (transfer full): A #GDBusMethodInvocation.
5381 * 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.
5383 * This method will free @invocation, you cannot use it afterwards.
5386 hostname1_complete_set_pretty_hostname (
5388 GDBusMethodInvocation
*invocation
)
5390 g_dbus_method_invocation_return_value (invocation
,
5391 g_variant_new ("()"));
5395 * hostname1_complete_set_icon_name:
5396 * @object: A #Hostname1.
5397 * @invocation: (transfer full): A #GDBusMethodInvocation.
5399 * 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.
5401 * This method will free @invocation, you cannot use it afterwards.
5404 hostname1_complete_set_icon_name (
5406 GDBusMethodInvocation
*invocation
)
5408 g_dbus_method_invocation_return_value (invocation
,
5409 g_variant_new ("()"));
5413 * hostname1_complete_set_chassis:
5414 * @object: A #Hostname1.
5415 * @invocation: (transfer full): A #GDBusMethodInvocation.
5417 * 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.
5419 * This method will free @invocation, you cannot use it afterwards.
5422 hostname1_complete_set_chassis (
5424 GDBusMethodInvocation
*invocation
)
5426 g_dbus_method_invocation_return_value (invocation
,
5427 g_variant_new ("()"));
5430 /* ------------------------------------------------------------------------ */
5435 * The #Hostname1Proxy structure contains only private data and should only be accessed using the provided API.
5439 * Hostname1ProxyClass:
5440 * @parent_class: The parent class.
5442 * Class structure for #Hostname1Proxy.
5445 struct _Hostname1ProxyPrivate
5450 static void hostname1_proxy_iface_init (Hostname1Iface
*iface
);
5452 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
5453 G_DEFINE_TYPE_WITH_CODE (Hostname1Proxy
, hostname1_proxy
, G_TYPE_DBUS_PROXY
,
5454 G_ADD_PRIVATE (Hostname1Proxy
)
5455 G_IMPLEMENT_INTERFACE (TYPE_HOSTNAME1
, hostname1_proxy_iface_init
));
5458 G_DEFINE_TYPE_WITH_CODE (Hostname1Proxy
, hostname1_proxy
, G_TYPE_DBUS_PROXY
,
5459 G_IMPLEMENT_INTERFACE (TYPE_HOSTNAME1
, hostname1_proxy_iface_init
));
5463 hostname1_proxy_finalize (GObject
*object
)
5465 Hostname1Proxy
*proxy
= HOSTNAME1_PROXY (object
);
5466 g_datalist_clear (&proxy
->priv
->qdata
);
5467 G_OBJECT_CLASS (hostname1_proxy_parent_class
)->finalize (object
);
5471 hostname1_proxy_get_property (GObject
*object
,
5474 GParamSpec
*pspec G_GNUC_UNUSED
)
5476 const _ExtendedGDBusPropertyInfo
*info
;
5478 g_assert (prop_id
!= 0 && prop_id
- 1 < 10);
5479 info
= _hostname1_property_info_pointers
[prop_id
- 1];
5480 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object
), info
->parent_struct
.name
);
5481 if (info
->use_gvariant
)
5483 g_value_set_variant (value
, variant
);
5487 if (variant
!= NULL
)
5488 g_dbus_gvariant_to_gvalue (variant
, value
);
5490 if (variant
!= NULL
)
5491 g_variant_unref (variant
);
5495 hostname1_proxy_set_property_cb (GDBusProxy
*proxy
,
5499 const _ExtendedGDBusPropertyInfo
*info
= user_data
;
5503 _ret
= g_dbus_proxy_call_finish (proxy
, res
, &error
);
5506 g_warning ("Error setting property '%s' on interface org.freedesktop.hostname1: %s (%s, %d)",
5507 info
->parent_struct
.name
,
5508 error
->message
, g_quark_to_string (error
->domain
), error
->code
);
5509 g_error_free (error
);
5513 g_variant_unref (_ret
);
5518 hostname1_proxy_set_property (GObject
*object
,
5520 const GValue
*value
,
5521 GParamSpec
*pspec G_GNUC_UNUSED
)
5523 const _ExtendedGDBusPropertyInfo
*info
;
5525 g_assert (prop_id
!= 0 && prop_id
- 1 < 10);
5526 info
= _hostname1_property_info_pointers
[prop_id
- 1];
5527 variant
= g_dbus_gvalue_to_gvariant (value
, G_VARIANT_TYPE (info
->parent_struct
.signature
));
5528 g_dbus_proxy_call (G_DBUS_PROXY (object
),
5529 "org.freedesktop.DBus.Properties.Set",
5530 g_variant_new ("(ssv)", "org.freedesktop.hostname1", info
->parent_struct
.name
, variant
),
5531 G_DBUS_CALL_FLAGS_NONE
,
5533 NULL
, (GAsyncReadyCallback
) hostname1_proxy_set_property_cb
, (GDBusPropertyInfo
*) &info
->parent_struct
);
5534 g_variant_unref (variant
);
5538 hostname1_proxy_g_signal (GDBusProxy
*proxy
,
5539 const gchar
*sender_name G_GNUC_UNUSED
,
5540 const gchar
*signal_name
,
5541 GVariant
*parameters
)
5543 _ExtendedGDBusSignalInfo
*info
;
5550 info
= (_ExtendedGDBusSignalInfo
*) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo
*) &_hostname1_interface_info
.parent_struct
, signal_name
);
5553 num_params
= g_variant_n_children (parameters
);
5554 paramv
= g_new0 (GValue
, num_params
+ 1);
5555 g_value_init (¶mv
[0], TYPE_HOSTNAME1
);
5556 g_value_set_object (¶mv
[0], proxy
);
5557 g_variant_iter_init (&iter
, parameters
);
5559 while ((child
= g_variant_iter_next_value (&iter
)) != NULL
)
5561 _ExtendedGDBusArgInfo
*arg_info
= (_ExtendedGDBusArgInfo
*) info
->parent_struct
.args
[n
- 1];
5562 if (arg_info
->use_gvariant
)
5564 g_value_init (¶mv
[n
], G_TYPE_VARIANT
);
5565 g_value_set_variant (¶mv
[n
], child
);
5569 g_dbus_gvariant_to_gvalue (child
, ¶mv
[n
++]);
5570 g_variant_unref (child
);
5572 signal_id
= g_signal_lookup (info
->signal_name
, TYPE_HOSTNAME1
);
5573 g_signal_emitv (paramv
, signal_id
, 0, NULL
);
5574 for (n
= 0; n
< num_params
+ 1; n
++)
5575 g_value_unset (¶mv
[n
]);
5580 hostname1_proxy_g_properties_changed (GDBusProxy
*_proxy
,
5581 GVariant
*changed_properties
,
5582 const gchar
*const *invalidated_properties
)
5584 Hostname1Proxy
*proxy
= HOSTNAME1_PROXY (_proxy
);
5588 _ExtendedGDBusPropertyInfo
*info
;
5589 g_variant_get (changed_properties
, "a{sv}", &iter
);
5590 while (g_variant_iter_next (iter
, "{&sv}", &key
, NULL
))
5592 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_hostname1_interface_info
.parent_struct
, key
);
5593 g_datalist_remove_data (&proxy
->priv
->qdata
, key
);
5595 g_object_notify (G_OBJECT (proxy
), info
->hyphen_name
);
5597 g_variant_iter_free (iter
);
5598 for (n
= 0; invalidated_properties
[n
] != NULL
; n
++)
5600 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_hostname1_interface_info
.parent_struct
, invalidated_properties
[n
]);
5601 g_datalist_remove_data (&proxy
->priv
->qdata
, invalidated_properties
[n
]);
5603 g_object_notify (G_OBJECT (proxy
), info
->hyphen_name
);
5607 static const gchar
*
5608 hostname1_proxy_get_hostname (Hostname1
*object
)
5610 Hostname1Proxy
*proxy
= HOSTNAME1_PROXY (object
);
5612 const gchar
*value
= NULL
;
5613 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "Hostname");
5614 if (variant
!= NULL
)
5616 value
= g_variant_get_string (variant
, NULL
);
5617 g_variant_unref (variant
);
5622 static const gchar
*
5623 hostname1_proxy_get_static_hostname (Hostname1
*object
)
5625 Hostname1Proxy
*proxy
= HOSTNAME1_PROXY (object
);
5627 const gchar
*value
= NULL
;
5628 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "StaticHostname");
5629 if (variant
!= NULL
)
5631 value
= g_variant_get_string (variant
, NULL
);
5632 g_variant_unref (variant
);
5637 static const gchar
*
5638 hostname1_proxy_get_pretty_hostname (Hostname1
*object
)
5640 Hostname1Proxy
*proxy
= HOSTNAME1_PROXY (object
);
5642 const gchar
*value
= NULL
;
5643 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "PrettyHostname");
5644 if (variant
!= NULL
)
5646 value
= g_variant_get_string (variant
, NULL
);
5647 g_variant_unref (variant
);
5652 static const gchar
*
5653 hostname1_proxy_get_icon_name (Hostname1
*object
)
5655 Hostname1Proxy
*proxy
= HOSTNAME1_PROXY (object
);
5657 const gchar
*value
= NULL
;
5658 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "IconName");
5659 if (variant
!= NULL
)
5661 value
= g_variant_get_string (variant
, NULL
);
5662 g_variant_unref (variant
);
5667 static const gchar
*
5668 hostname1_proxy_get_chassis (Hostname1
*object
)
5670 Hostname1Proxy
*proxy
= HOSTNAME1_PROXY (object
);
5672 const gchar
*value
= NULL
;
5673 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "Chassis");
5674 if (variant
!= NULL
)
5676 value
= g_variant_get_string (variant
, NULL
);
5677 g_variant_unref (variant
);
5682 static const gchar
*
5683 hostname1_proxy_get_kernel_name (Hostname1
*object
)
5685 Hostname1Proxy
*proxy
= HOSTNAME1_PROXY (object
);
5687 const gchar
*value
= NULL
;
5688 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "KernelName");
5689 if (variant
!= NULL
)
5691 value
= g_variant_get_string (variant
, NULL
);
5692 g_variant_unref (variant
);
5697 static const gchar
*
5698 hostname1_proxy_get_kernel_release (Hostname1
*object
)
5700 Hostname1Proxy
*proxy
= HOSTNAME1_PROXY (object
);
5702 const gchar
*value
= NULL
;
5703 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "KernelRelease");
5704 if (variant
!= NULL
)
5706 value
= g_variant_get_string (variant
, NULL
);
5707 g_variant_unref (variant
);
5712 static const gchar
*
5713 hostname1_proxy_get_kernel_version (Hostname1
*object
)
5715 Hostname1Proxy
*proxy
= HOSTNAME1_PROXY (object
);
5717 const gchar
*value
= NULL
;
5718 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "KernelVersion");
5719 if (variant
!= NULL
)
5721 value
= g_variant_get_string (variant
, NULL
);
5722 g_variant_unref (variant
);
5727 static const gchar
*
5728 hostname1_proxy_get_operating_system_pretty_name (Hostname1
*object
)
5730 Hostname1Proxy
*proxy
= HOSTNAME1_PROXY (object
);
5732 const gchar
*value
= NULL
;
5733 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "OperatingSystemPrettyName");
5734 if (variant
!= NULL
)
5736 value
= g_variant_get_string (variant
, NULL
);
5737 g_variant_unref (variant
);
5742 static const gchar
*
5743 hostname1_proxy_get_operating_system_cpename (Hostname1
*object
)
5745 Hostname1Proxy
*proxy
= HOSTNAME1_PROXY (object
);
5747 const gchar
*value
= NULL
;
5748 variant
= g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy
), "OperatingSystemCPEName");
5749 if (variant
!= NULL
)
5751 value
= g_variant_get_string (variant
, NULL
);
5752 g_variant_unref (variant
);
5758 hostname1_proxy_init (Hostname1Proxy
*proxy
)
5760 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
5761 proxy
->priv
= hostname1_proxy_get_instance_private (proxy
);
5763 proxy
->priv
= G_TYPE_INSTANCE_GET_PRIVATE (proxy
, TYPE_HOSTNAME1_PROXY
, Hostname1ProxyPrivate
);
5766 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy
), hostname1_interface_info ());
5770 hostname1_proxy_class_init (Hostname1ProxyClass
*klass
)
5772 GObjectClass
*gobject_class
;
5773 GDBusProxyClass
*proxy_class
;
5775 gobject_class
= G_OBJECT_CLASS (klass
);
5776 gobject_class
->finalize
= hostname1_proxy_finalize
;
5777 gobject_class
->get_property
= hostname1_proxy_get_property
;
5778 gobject_class
->set_property
= hostname1_proxy_set_property
;
5780 proxy_class
= G_DBUS_PROXY_CLASS (klass
);
5781 proxy_class
->g_signal
= hostname1_proxy_g_signal
;
5782 proxy_class
->g_properties_changed
= hostname1_proxy_g_properties_changed
;
5784 hostname1_override_properties (gobject_class
, 1);
5786 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
5787 g_type_class_add_private (klass
, sizeof (Hostname1ProxyPrivate
));
5792 hostname1_proxy_iface_init (Hostname1Iface
*iface
)
5794 iface
->get_hostname
= hostname1_proxy_get_hostname
;
5795 iface
->get_static_hostname
= hostname1_proxy_get_static_hostname
;
5796 iface
->get_pretty_hostname
= hostname1_proxy_get_pretty_hostname
;
5797 iface
->get_icon_name
= hostname1_proxy_get_icon_name
;
5798 iface
->get_chassis
= hostname1_proxy_get_chassis
;
5799 iface
->get_kernel_name
= hostname1_proxy_get_kernel_name
;
5800 iface
->get_kernel_release
= hostname1_proxy_get_kernel_release
;
5801 iface
->get_kernel_version
= hostname1_proxy_get_kernel_version
;
5802 iface
->get_operating_system_pretty_name
= hostname1_proxy_get_operating_system_pretty_name
;
5803 iface
->get_operating_system_cpename
= hostname1_proxy_get_operating_system_cpename
;
5807 * hostname1_proxy_new:
5808 * @connection: A #GDBusConnection.
5809 * @flags: Flags from the #GDBusProxyFlags enumeration.
5810 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
5811 * @object_path: An object path.
5812 * @cancellable: (allow-none): A #GCancellable or %NULL.
5813 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
5814 * @user_data: User data to pass to @callback.
5816 * 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.
5818 * 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.
5819 * You can then call hostname1_proxy_new_finish() to get the result of the operation.
5821 * See hostname1_proxy_new_sync() for the synchronous, blocking version of this constructor.
5824 hostname1_proxy_new (
5825 GDBusConnection
*connection
,
5826 GDBusProxyFlags flags
,
5828 const gchar
*object_path
,
5829 GCancellable
*cancellable
,
5830 GAsyncReadyCallback callback
,
5833 g_async_initable_new_async (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
);
5837 * hostname1_proxy_new_finish:
5838 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostname1_proxy_new().
5839 * @error: Return location for error or %NULL
5841 * Finishes an operation started with hostname1_proxy_new().
5843 * Returns: (transfer full) (type Hostname1Proxy): The constructed proxy object or %NULL if @error is set.
5846 hostname1_proxy_new_finish (
5851 GObject
*source_object
;
5852 source_object
= g_async_result_get_source_object (res
);
5853 ret
= g_async_initable_new_finish (G_ASYNC_INITABLE (source_object
), res
, error
);
5854 g_object_unref (source_object
);
5856 return HOSTNAME1 (ret
);
5862 * hostname1_proxy_new_sync:
5863 * @connection: A #GDBusConnection.
5864 * @flags: Flags from the #GDBusProxyFlags enumeration.
5865 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
5866 * @object_path: An object path.
5867 * @cancellable: (allow-none): A #GCancellable or %NULL.
5868 * @error: Return location for error or %NULL
5870 * 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.
5872 * The calling thread is blocked until a reply is received.
5874 * See hostname1_proxy_new() for the asynchronous version of this constructor.
5876 * Returns: (transfer full) (type Hostname1Proxy): The constructed proxy object or %NULL if @error is set.
5879 hostname1_proxy_new_sync (
5880 GDBusConnection
*connection
,
5881 GDBusProxyFlags flags
,
5883 const gchar
*object_path
,
5884 GCancellable
*cancellable
,
5888 ret
= g_initable_new (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
);
5890 return HOSTNAME1 (ret
);
5897 * hostname1_proxy_new_for_bus:
5898 * @bus_type: A #GBusType.
5899 * @flags: Flags from the #GDBusProxyFlags enumeration.
5900 * @name: A bus name (well-known or unique).
5901 * @object_path: An object path.
5902 * @cancellable: (allow-none): A #GCancellable or %NULL.
5903 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
5904 * @user_data: User data to pass to @callback.
5906 * Like hostname1_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
5908 * 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.
5909 * You can then call hostname1_proxy_new_for_bus_finish() to get the result of the operation.
5911 * See hostname1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
5914 hostname1_proxy_new_for_bus (
5916 GDBusProxyFlags flags
,
5918 const gchar
*object_path
,
5919 GCancellable
*cancellable
,
5920 GAsyncReadyCallback callback
,
5923 g_async_initable_new_async (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
);
5927 * hostname1_proxy_new_for_bus_finish:
5928 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to hostname1_proxy_new_for_bus().
5929 * @error: Return location for error or %NULL
5931 * Finishes an operation started with hostname1_proxy_new_for_bus().
5933 * Returns: (transfer full) (type Hostname1Proxy): The constructed proxy object or %NULL if @error is set.
5936 hostname1_proxy_new_for_bus_finish (
5941 GObject
*source_object
;
5942 source_object
= g_async_result_get_source_object (res
);
5943 ret
= g_async_initable_new_finish (G_ASYNC_INITABLE (source_object
), res
, error
);
5944 g_object_unref (source_object
);
5946 return HOSTNAME1 (ret
);
5952 * hostname1_proxy_new_for_bus_sync:
5953 * @bus_type: A #GBusType.
5954 * @flags: Flags from the #GDBusProxyFlags enumeration.
5955 * @name: A bus name (well-known or unique).
5956 * @object_path: An object path.
5957 * @cancellable: (allow-none): A #GCancellable or %NULL.
5958 * @error: Return location for error or %NULL
5960 * Like hostname1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
5962 * The calling thread is blocked until a reply is received.
5964 * See hostname1_proxy_new_for_bus() for the asynchronous version of this constructor.
5966 * Returns: (transfer full) (type Hostname1Proxy): The constructed proxy object or %NULL if @error is set.
5969 hostname1_proxy_new_for_bus_sync (
5971 GDBusProxyFlags flags
,
5973 const gchar
*object_path
,
5974 GCancellable
*cancellable
,
5978 ret
= g_initable_new (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
);
5980 return HOSTNAME1 (ret
);
5986 /* ------------------------------------------------------------------------ */
5989 * Hostname1Skeleton:
5991 * The #Hostname1Skeleton structure contains only private data and should only be accessed using the provided API.
5995 * Hostname1SkeletonClass:
5996 * @parent_class: The parent class.
5998 * Class structure for #Hostname1Skeleton.
6001 struct _Hostname1SkeletonPrivate
6004 GList
*changed_properties
;
6005 GSource
*changed_properties_idle_source
;
6006 GMainContext
*context
;
6011 _hostname1_skeleton_handle_method_call (
6012 GDBusConnection
*connection G_GNUC_UNUSED
,
6013 const gchar
*sender G_GNUC_UNUSED
,
6014 const gchar
*object_path G_GNUC_UNUSED
,
6015 const gchar
*interface_name
,
6016 const gchar
*method_name
,
6017 GVariant
*parameters
,
6018 GDBusMethodInvocation
*invocation
,
6021 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (user_data
);
6022 _ExtendedGDBusMethodInfo
*info
;
6030 GValue return_value
= G_VALUE_INIT
;
6031 info
= (_ExtendedGDBusMethodInfo
*) g_dbus_method_invocation_get_method_info (invocation
);
6032 g_assert (info
!= NULL
);
6033 num_params
= g_variant_n_children (parameters
);
6034 num_extra
= info
->pass_fdlist
? 3 : 2; paramv
= g_new0 (GValue
, num_params
+ num_extra
);
6036 g_value_init (¶mv
[n
], TYPE_HOSTNAME1
);
6037 g_value_set_object (¶mv
[n
++], skeleton
);
6038 g_value_init (¶mv
[n
], G_TYPE_DBUS_METHOD_INVOCATION
);
6039 g_value_set_object (¶mv
[n
++], invocation
);
6040 if (info
->pass_fdlist
)
6043 g_value_init (¶mv
[n
], G_TYPE_UNIX_FD_LIST
);
6044 g_value_set_object (¶mv
[n
++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation
)));
6046 g_assert_not_reached ();
6049 g_variant_iter_init (&iter
, parameters
);
6050 while ((child
= g_variant_iter_next_value (&iter
)) != NULL
)
6052 _ExtendedGDBusArgInfo
*arg_info
= (_ExtendedGDBusArgInfo
*) info
->parent_struct
.in_args
[n
- num_extra
];
6053 if (arg_info
->use_gvariant
)
6055 g_value_init (¶mv
[n
], G_TYPE_VARIANT
);
6056 g_value_set_variant (¶mv
[n
], child
);
6060 g_dbus_gvariant_to_gvalue (child
, ¶mv
[n
++]);
6061 g_variant_unref (child
);
6063 signal_id
= g_signal_lookup (info
->signal_name
, TYPE_HOSTNAME1
);
6064 g_value_init (&return_value
, G_TYPE_BOOLEAN
);
6065 g_signal_emitv (paramv
, signal_id
, 0, &return_value
);
6066 if (!g_value_get_boolean (&return_value
))
6067 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
);
6068 g_value_unset (&return_value
);
6069 for (n
= 0; n
< num_params
+ num_extra
; n
++)
6070 g_value_unset (¶mv
[n
]);
6075 _hostname1_skeleton_handle_get_property (
6076 GDBusConnection
*connection G_GNUC_UNUSED
,
6077 const gchar
*sender G_GNUC_UNUSED
,
6078 const gchar
*object_path G_GNUC_UNUSED
,
6079 const gchar
*interface_name G_GNUC_UNUSED
,
6080 const gchar
*property_name
,
6084 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (user_data
);
6085 GValue value
= G_VALUE_INIT
;
6087 _ExtendedGDBusPropertyInfo
*info
;
6090 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_hostname1_interface_info
.parent_struct
, property_name
);
6091 g_assert (info
!= NULL
);
6092 pspec
= g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton
), info
->hyphen_name
);
6095 g_set_error (error
, G_DBUS_ERROR
, G_DBUS_ERROR_INVALID_ARGS
, "No property with name %s", property_name
);
6099 g_value_init (&value
, pspec
->value_type
);
6100 g_object_get_property (G_OBJECT (skeleton
), info
->hyphen_name
, &value
);
6101 ret
= g_dbus_gvalue_to_gvariant (&value
, G_VARIANT_TYPE (info
->parent_struct
.signature
));
6102 g_value_unset (&value
);
6108 _hostname1_skeleton_handle_set_property (
6109 GDBusConnection
*connection G_GNUC_UNUSED
,
6110 const gchar
*sender G_GNUC_UNUSED
,
6111 const gchar
*object_path G_GNUC_UNUSED
,
6112 const gchar
*interface_name G_GNUC_UNUSED
,
6113 const gchar
*property_name
,
6118 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (user_data
);
6119 GValue value
= G_VALUE_INIT
;
6121 _ExtendedGDBusPropertyInfo
*info
;
6124 info
= (_ExtendedGDBusPropertyInfo
*) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo
*) &_hostname1_interface_info
.parent_struct
, property_name
);
6125 g_assert (info
!= NULL
);
6126 pspec
= g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton
), info
->hyphen_name
);
6129 g_set_error (error
, G_DBUS_ERROR
, G_DBUS_ERROR_INVALID_ARGS
, "No property with name %s", property_name
);
6133 if (info
->use_gvariant
)
6134 g_value_set_variant (&value
, variant
);
6136 g_dbus_gvariant_to_gvalue (variant
, &value
);
6137 g_object_set_property (G_OBJECT (skeleton
), info
->hyphen_name
, &value
);
6138 g_value_unset (&value
);
6144 static const GDBusInterfaceVTable _hostname1_skeleton_vtable
=
6146 _hostname1_skeleton_handle_method_call
,
6147 _hostname1_skeleton_handle_get_property
,
6148 _hostname1_skeleton_handle_set_property
,
6152 static GDBusInterfaceInfo
*
6153 hostname1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton
*skeleton G_GNUC_UNUSED
)
6155 return hostname1_interface_info ();
6158 static GDBusInterfaceVTable
*
6159 hostname1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton
*skeleton G_GNUC_UNUSED
)
6161 return (GDBusInterfaceVTable
*) &_hostname1_skeleton_vtable
;
6165 hostname1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton
*_skeleton
)
6167 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (_skeleton
);
6169 GVariantBuilder builder
;
6171 g_variant_builder_init (&builder
, G_VARIANT_TYPE ("a{sv}"));
6172 if (_hostname1_interface_info
.parent_struct
.properties
== NULL
)
6174 for (n
= 0; _hostname1_interface_info
.parent_struct
.properties
[n
] != NULL
; n
++)
6176 GDBusPropertyInfo
*info
= _hostname1_interface_info
.parent_struct
.properties
[n
];
6177 if (info
->flags
& G_DBUS_PROPERTY_INFO_FLAGS_READABLE
)
6180 value
= _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
);
6183 g_variant_take_ref (value
);
6184 g_variant_builder_add (&builder
, "{sv}", info
->name
, value
);
6185 g_variant_unref (value
);
6190 return g_variant_builder_end (&builder
);
6193 static gboolean
_hostname1_emit_changed (gpointer user_data
);
6196 hostname1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton
*_skeleton
)
6198 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (_skeleton
);
6199 gboolean emit_changed
= FALSE
;
6201 g_mutex_lock (&skeleton
->priv
->lock
);
6202 if (skeleton
->priv
->changed_properties_idle_source
!= NULL
)
6204 g_source_destroy (skeleton
->priv
->changed_properties_idle_source
);
6205 skeleton
->priv
->changed_properties_idle_source
= NULL
;
6206 emit_changed
= TRUE
;
6208 g_mutex_unlock (&skeleton
->priv
->lock
);
6211 _hostname1_emit_changed (skeleton
);
6214 static void hostname1_skeleton_iface_init (Hostname1Iface
*iface
);
6215 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
6216 G_DEFINE_TYPE_WITH_CODE (Hostname1Skeleton
, hostname1_skeleton
, G_TYPE_DBUS_INTERFACE_SKELETON
,
6217 G_ADD_PRIVATE (Hostname1Skeleton
)
6218 G_IMPLEMENT_INTERFACE (TYPE_HOSTNAME1
, hostname1_skeleton_iface_init
));
6221 G_DEFINE_TYPE_WITH_CODE (Hostname1Skeleton
, hostname1_skeleton
, G_TYPE_DBUS_INTERFACE_SKELETON
,
6222 G_IMPLEMENT_INTERFACE (TYPE_HOSTNAME1
, hostname1_skeleton_iface_init
));
6226 hostname1_skeleton_finalize (GObject
*object
)
6228 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (object
);
6230 for (n
= 0; n
< 10; n
++)
6231 g_value_unset (&skeleton
->priv
->properties
[n
]);
6232 g_free (skeleton
->priv
->properties
);
6233 g_list_free_full (skeleton
->priv
->changed_properties
, (GDestroyNotify
) _changed_property_free
);
6234 if (skeleton
->priv
->changed_properties_idle_source
!= NULL
)
6235 g_source_destroy (skeleton
->priv
->changed_properties_idle_source
);
6236 g_main_context_unref (skeleton
->priv
->context
);
6237 g_mutex_clear (&skeleton
->priv
->lock
);
6238 G_OBJECT_CLASS (hostname1_skeleton_parent_class
)->finalize (object
);
6242 hostname1_skeleton_get_property (GObject
*object
,
6245 GParamSpec
*pspec G_GNUC_UNUSED
)
6247 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (object
);
6248 g_assert (prop_id
!= 0 && prop_id
- 1 < 10);
6249 g_mutex_lock (&skeleton
->priv
->lock
);
6250 g_value_copy (&skeleton
->priv
->properties
[prop_id
- 1], value
);
6251 g_mutex_unlock (&skeleton
->priv
->lock
);
6255 _hostname1_emit_changed (gpointer user_data
)
6257 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (user_data
);
6259 GVariantBuilder builder
;
6260 GVariantBuilder invalidated_builder
;
6263 g_mutex_lock (&skeleton
->priv
->lock
);
6264 g_variant_builder_init (&builder
, G_VARIANT_TYPE ("a{sv}"));
6265 g_variant_builder_init (&invalidated_builder
, G_VARIANT_TYPE ("as"));
6266 for (l
= skeleton
->priv
->changed_properties
, num_changes
= 0; l
!= NULL
; l
= l
->next
)
6268 ChangedProperty
*cp
= l
->data
;
6270 const GValue
*cur_value
;
6272 cur_value
= &skeleton
->priv
->properties
[cp
->prop_id
- 1];
6273 if (!_g_value_equal (cur_value
, &cp
->orig_value
))
6275 variant
= g_dbus_gvalue_to_gvariant (cur_value
, G_VARIANT_TYPE (cp
->info
->parent_struct
.signature
));
6276 g_variant_builder_add (&builder
, "{sv}", cp
->info
->parent_struct
.name
, variant
);
6277 g_variant_unref (variant
);
6281 if (num_changes
> 0)
6283 GList
*connections
, *ll
;
6284 GVariant
*signal_variant
;
6285 signal_variant
= g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.hostname1",
6286 &builder
, &invalidated_builder
));
6287 connections
= g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton
));
6288 for (ll
= connections
; ll
!= NULL
; ll
= ll
->next
)
6290 GDBusConnection
*connection
= ll
->data
;
6292 g_dbus_connection_emit_signal (connection
,
6293 NULL
, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton
)),
6294 "org.freedesktop.DBus.Properties",
6295 "PropertiesChanged",
6299 g_variant_unref (signal_variant
);
6300 g_list_free_full (connections
, g_object_unref
);
6304 g_variant_builder_clear (&builder
);
6305 g_variant_builder_clear (&invalidated_builder
);
6307 g_list_free_full (skeleton
->priv
->changed_properties
, (GDestroyNotify
) _changed_property_free
);
6308 skeleton
->priv
->changed_properties
= NULL
;
6309 skeleton
->priv
->changed_properties_idle_source
= NULL
;
6310 g_mutex_unlock (&skeleton
->priv
->lock
);
6315 _hostname1_schedule_emit_changed (Hostname1Skeleton
*skeleton
, const _ExtendedGDBusPropertyInfo
*info
, guint prop_id
, const GValue
*orig_value
)
6317 ChangedProperty
*cp
;
6320 for (l
= skeleton
->priv
->changed_properties
; l
!= NULL
; l
= l
->next
)
6322 ChangedProperty
*i_cp
= l
->data
;
6323 if (i_cp
->info
== info
)
6331 cp
= g_new0 (ChangedProperty
, 1);
6332 cp
->prop_id
= prop_id
;
6334 skeleton
->priv
->changed_properties
= g_list_prepend (skeleton
->priv
->changed_properties
, cp
);
6335 g_value_init (&cp
->orig_value
, G_VALUE_TYPE (orig_value
));
6336 g_value_copy (orig_value
, &cp
->orig_value
);
6341 hostname1_skeleton_notify (GObject
*object
,
6342 GParamSpec
*pspec G_GNUC_UNUSED
)
6344 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (object
);
6345 g_mutex_lock (&skeleton
->priv
->lock
);
6346 if (skeleton
->priv
->changed_properties
!= NULL
&&
6347 skeleton
->priv
->changed_properties_idle_source
== NULL
)
6349 skeleton
->priv
->changed_properties_idle_source
= g_idle_source_new ();
6350 g_source_set_priority (skeleton
->priv
->changed_properties_idle_source
, G_PRIORITY_DEFAULT
);
6351 g_source_set_callback (skeleton
->priv
->changed_properties_idle_source
, _hostname1_emit_changed
, g_object_ref (skeleton
), (GDestroyNotify
) g_object_unref
);
6352 g_source_attach (skeleton
->priv
->changed_properties_idle_source
, skeleton
->priv
->context
);
6353 g_source_unref (skeleton
->priv
->changed_properties_idle_source
);
6355 g_mutex_unlock (&skeleton
->priv
->lock
);
6359 hostname1_skeleton_set_property (GObject
*object
,
6361 const GValue
*value
,
6364 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (object
);
6365 g_assert (prop_id
!= 0 && prop_id
- 1 < 10);
6366 g_mutex_lock (&skeleton
->priv
->lock
);
6367 g_object_freeze_notify (object
);
6368 if (!_g_value_equal (value
, &skeleton
->priv
->properties
[prop_id
- 1]))
6370 if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton
)) != NULL
)
6371 _hostname1_schedule_emit_changed (skeleton
, _hostname1_property_info_pointers
[prop_id
- 1], prop_id
, &skeleton
->priv
->properties
[prop_id
- 1]);
6372 g_value_copy (value
, &skeleton
->priv
->properties
[prop_id
- 1]);
6373 g_object_notify_by_pspec (object
, pspec
);
6375 g_mutex_unlock (&skeleton
->priv
->lock
);
6376 g_object_thaw_notify (object
);
6380 hostname1_skeleton_init (Hostname1Skeleton
*skeleton
)
6382 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
6383 skeleton
->priv
= hostname1_skeleton_get_instance_private (skeleton
);
6385 skeleton
->priv
= G_TYPE_INSTANCE_GET_PRIVATE (skeleton
, TYPE_HOSTNAME1_SKELETON
, Hostname1SkeletonPrivate
);
6388 g_mutex_init (&skeleton
->priv
->lock
);
6389 skeleton
->priv
->context
= g_main_context_ref_thread_default ();
6390 skeleton
->priv
->properties
= g_new0 (GValue
, 10);
6391 g_value_init (&skeleton
->priv
->properties
[0], G_TYPE_STRING
);
6392 g_value_init (&skeleton
->priv
->properties
[1], G_TYPE_STRING
);
6393 g_value_init (&skeleton
->priv
->properties
[2], G_TYPE_STRING
);
6394 g_value_init (&skeleton
->priv
->properties
[3], G_TYPE_STRING
);
6395 g_value_init (&skeleton
->priv
->properties
[4], G_TYPE_STRING
);
6396 g_value_init (&skeleton
->priv
->properties
[5], G_TYPE_STRING
);
6397 g_value_init (&skeleton
->priv
->properties
[6], G_TYPE_STRING
);
6398 g_value_init (&skeleton
->priv
->properties
[7], G_TYPE_STRING
);
6399 g_value_init (&skeleton
->priv
->properties
[8], G_TYPE_STRING
);
6400 g_value_init (&skeleton
->priv
->properties
[9], G_TYPE_STRING
);
6403 static const gchar
*
6404 hostname1_skeleton_get_hostname (Hostname1
*object
)
6406 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (object
);
6408 g_mutex_lock (&skeleton
->priv
->lock
);
6409 value
= g_value_get_string (&(skeleton
->priv
->properties
[0]));
6410 g_mutex_unlock (&skeleton
->priv
->lock
);
6414 static const gchar
*
6415 hostname1_skeleton_get_static_hostname (Hostname1
*object
)
6417 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (object
);
6419 g_mutex_lock (&skeleton
->priv
->lock
);
6420 value
= g_value_get_string (&(skeleton
->priv
->properties
[1]));
6421 g_mutex_unlock (&skeleton
->priv
->lock
);
6425 static const gchar
*
6426 hostname1_skeleton_get_pretty_hostname (Hostname1
*object
)
6428 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (object
);
6430 g_mutex_lock (&skeleton
->priv
->lock
);
6431 value
= g_value_get_string (&(skeleton
->priv
->properties
[2]));
6432 g_mutex_unlock (&skeleton
->priv
->lock
);
6436 static const gchar
*
6437 hostname1_skeleton_get_icon_name (Hostname1
*object
)
6439 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (object
);
6441 g_mutex_lock (&skeleton
->priv
->lock
);
6442 value
= g_value_get_string (&(skeleton
->priv
->properties
[3]));
6443 g_mutex_unlock (&skeleton
->priv
->lock
);
6447 static const gchar
*
6448 hostname1_skeleton_get_chassis (Hostname1
*object
)
6450 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (object
);
6452 g_mutex_lock (&skeleton
->priv
->lock
);
6453 value
= g_value_get_string (&(skeleton
->priv
->properties
[4]));
6454 g_mutex_unlock (&skeleton
->priv
->lock
);
6458 static const gchar
*
6459 hostname1_skeleton_get_kernel_name (Hostname1
*object
)
6461 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (object
);
6463 g_mutex_lock (&skeleton
->priv
->lock
);
6464 value
= g_value_get_string (&(skeleton
->priv
->properties
[5]));
6465 g_mutex_unlock (&skeleton
->priv
->lock
);
6469 static const gchar
*
6470 hostname1_skeleton_get_kernel_release (Hostname1
*object
)
6472 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (object
);
6474 g_mutex_lock (&skeleton
->priv
->lock
);
6475 value
= g_value_get_string (&(skeleton
->priv
->properties
[6]));
6476 g_mutex_unlock (&skeleton
->priv
->lock
);
6480 static const gchar
*
6481 hostname1_skeleton_get_kernel_version (Hostname1
*object
)
6483 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (object
);
6485 g_mutex_lock (&skeleton
->priv
->lock
);
6486 value
= g_value_get_string (&(skeleton
->priv
->properties
[7]));
6487 g_mutex_unlock (&skeleton
->priv
->lock
);
6491 static const gchar
*
6492 hostname1_skeleton_get_operating_system_pretty_name (Hostname1
*object
)
6494 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (object
);
6496 g_mutex_lock (&skeleton
->priv
->lock
);
6497 value
= g_value_get_string (&(skeleton
->priv
->properties
[8]));
6498 g_mutex_unlock (&skeleton
->priv
->lock
);
6502 static const gchar
*
6503 hostname1_skeleton_get_operating_system_cpename (Hostname1
*object
)
6505 Hostname1Skeleton
*skeleton
= HOSTNAME1_SKELETON (object
);
6507 g_mutex_lock (&skeleton
->priv
->lock
);
6508 value
= g_value_get_string (&(skeleton
->priv
->properties
[9]));
6509 g_mutex_unlock (&skeleton
->priv
->lock
);
6514 hostname1_skeleton_class_init (Hostname1SkeletonClass
*klass
)
6516 GObjectClass
*gobject_class
;
6517 GDBusInterfaceSkeletonClass
*skeleton_class
;
6519 gobject_class
= G_OBJECT_CLASS (klass
);
6520 gobject_class
->finalize
= hostname1_skeleton_finalize
;
6521 gobject_class
->get_property
= hostname1_skeleton_get_property
;
6522 gobject_class
->set_property
= hostname1_skeleton_set_property
;
6523 gobject_class
->notify
= hostname1_skeleton_notify
;
6526 hostname1_override_properties (gobject_class
, 1);
6528 skeleton_class
= G_DBUS_INTERFACE_SKELETON_CLASS (klass
);
6529 skeleton_class
->get_info
= hostname1_skeleton_dbus_interface_get_info
;
6530 skeleton_class
->get_properties
= hostname1_skeleton_dbus_interface_get_properties
;
6531 skeleton_class
->flush
= hostname1_skeleton_dbus_interface_flush
;
6532 skeleton_class
->get_vtable
= hostname1_skeleton_dbus_interface_get_vtable
;
6534 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
6535 g_type_class_add_private (klass
, sizeof (Hostname1SkeletonPrivate
));
6540 hostname1_skeleton_iface_init (Hostname1Iface
*iface
)
6542 iface
->get_hostname
= hostname1_skeleton_get_hostname
;
6543 iface
->get_static_hostname
= hostname1_skeleton_get_static_hostname
;
6544 iface
->get_pretty_hostname
= hostname1_skeleton_get_pretty_hostname
;
6545 iface
->get_icon_name
= hostname1_skeleton_get_icon_name
;
6546 iface
->get_chassis
= hostname1_skeleton_get_chassis
;
6547 iface
->get_kernel_name
= hostname1_skeleton_get_kernel_name
;
6548 iface
->get_kernel_release
= hostname1_skeleton_get_kernel_release
;
6549 iface
->get_kernel_version
= hostname1_skeleton_get_kernel_version
;
6550 iface
->get_operating_system_pretty_name
= hostname1_skeleton_get_operating_system_pretty_name
;
6551 iface
->get_operating_system_cpename
= hostname1_skeleton_get_operating_system_cpename
;
6555 * hostname1_skeleton_new:
6557 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-hostname1.top_of_page">org.freedesktop.hostname1</link>.
6559 * Returns: (transfer full) (type Hostname1Skeleton): The skeleton object.
6562 hostname1_skeleton_new (void)
6564 return HOSTNAME1 (g_object_new (TYPE_HOSTNAME1_SKELETON
, NULL
));