1 /************************************************************/
2 /* THIS FILE IS GENERATED DO NOT EDIT */
3 /************************************************************/
8 * If @action is currently enabled.
10 * If the action is disabled then calls to g_action_activate() and
11 * g_action_change_state() have no effect.
20 * The name of the action. This is mostly meaningful for identifying
21 * the action once it has been added to a #GActionGroup.
28 * GAction:parameter-type:
30 * The type of the parameter that must be given when activating the
40 * The state of the action, or %NULL if the action is stateless.
49 * The #GVariantType of the state that the action has, or %NULL if the
50 * action is stateless.
58 * @name: the name of the action
59 * @activate: the callback to connect to the "activate" signal of the action
60 * @parameter_type: the type of the parameter that must be passed to the activate function for this action, given as a single GVariant type string (or %NULL for no parameter)
61 * @state: the initial state for this action, given in GVariant text format. The state is parsed with no extra type information, so type tags must be added to the string if they are necessary.
62 * @change_state: the callback to connect to the "change-state" signal of the action
64 * This struct defines a single action. It is for use with
65 * g_action_map_add_action_entries().
67 * The order of the items in the structure are intended to reflect
68 * frequency of use. It is permissible to use an incomplete initialiser
69 * in order to leave some of the later values as %NULL. All values
70 * after @name are optional. Additional optional fields may be added in
73 * See g_action_map_add_action_entries() for an example.
78 * GActionGroup::action-added:
79 * @action_group: the #GActionGroup that changed
80 * @action_name: the name of the action in @action_group
82 * Signals that a new action was just added to the group.
83 * This signal is emitted after the action has been added
91 * GActionGroup::action-enabled-changed:
92 * @action_group: the #GActionGroup that changed
93 * @action_name: the name of the action in @action_group
94 * @enabled: whether the action is enabled or not
96 * Signals that the enabled status of the named action has changed.
103 * GActionGroup::action-removed:
104 * @action_group: the #GActionGroup that changed
105 * @action_name: the name of the action in @action_group
107 * Signals that an action is just about to be removed from the group.
108 * This signal is emitted before the action is removed, so the action
109 * is still visible and can be queried from the signal handler.
116 * GActionGroup::action-state-changed:
117 * @action_group: the #GActionGroup that changed
118 * @action_name: the name of the action in @action_group
119 * @value: the new value of the state
121 * Signals that the state of the named action has changed.
128 * GActionGroupInterface:
129 * @has_action: the virtual function pointer for g_action_group_has_action()
130 * @list_actions: the virtual function pointer for g_action_group_list_actions()
131 * @get_action_parameter_type: the virtual function pointer for g_action_group_get_action_parameter_type()
132 * @get_action_state_type: the virtual function pointer for g_action_group_get_action_state_type()
133 * @get_action_state_hint: the virtual function pointer for g_action_group_get_action_state_hint()
134 * @get_action_enabled: the virtual function pointer for g_action_group_get_action_enabled()
135 * @get_action_state: the virtual function pointer for g_action_group_get_action_state()
136 * @change_action_state: the virtual function pointer for g_action_group_change_action_state()
137 * @query_action: the virtual function pointer for g_action_group_query_action()
138 * @activate_action: the virtual function pointer for g_action_group_activate_action()
139 * @action_added: the class closure for the #GActionGroup::action-added signal
140 * @action_removed: the class closure for the #GActionGroup::action-removed signal
141 * @action_enabled_changed: the class closure for the #GActionGroup::action-enabled-changed signal
142 * @action_state_changed: the class closure for the #GActionGroup::action-enabled-changed signal
144 * The virtual function table for #GActionGroup.
152 * @get_name: the virtual function pointer for g_action_get_name()
153 * @get_parameter_type: the virtual function pointer for g_action_get_parameter_type()
154 * @get_state_type: the virtual function pointer for g_action_get_state_type()
155 * @get_state_hint: the virtual function pointer for g_action_get_state_hint()
156 * @get_enabled: the virtual function pointer for g_action_get_enabled()
157 * @get_state: the virtual function pointer for g_action_get_state()
158 * @change_state: the virtual function pointer for g_action_change_state()
159 * @activate: the virtual function pointer for g_action_activate(). Note that #GAction does not have an 'activate' signal but that implementations of it may have one.
161 * The virtual function table for #GAction.
168 * GActionMapInterface:
169 * @lookup_action: the virtual function pointer for g_action_map_lookup_action()
170 * @add_action: the virtual function pointer for g_action_map_add_action()
171 * @remove_action: the virtual function pointer for g_action_map_remove_action()
173 * The virtual function table for #GActionMap.
180 * GApplication::activate:
181 * @application: the application
183 * The ::activate signal is emitted on the primary instance when an
184 * activation occurs. See g_application_activate().
189 * GApplication::command-line:
190 * @application: the application
191 * @command_line: a #GApplicationCommandLine representing the passed commandline
193 * The ::command-line signal is emitted on the primary instance when
194 * a commandline is not handled locally. See g_application_run() and
195 * the #GApplicationCommandLine documentation for more information.
197 * Returns: An integer that is set as the exit status for the calling process. See g_application_command_line_set_exit_status().
202 * GApplication::open:
203 * @application: the application
204 * @files: (array length=n_files) (element-type GFile): an array of #GFiles
205 * @n_files: the length of @files
206 * @hint: a hint provided by the calling instance
208 * The ::open signal is emitted on the primary instance when there are
209 * files to open. See g_application_open() for more information.
214 * GApplication::shutdown:
215 * @application: the application
217 * The ::shutdown signal is emitted only on the registered primary instance
218 * immediately after the main loop terminates.
223 * GApplication::startup:
224 * @application: the application
226 * The ::startup signal is emitted on the primary instance immediately
227 * after registration. See g_application_register().
233 * @startup: invoked on the primary instance immediately after registration
234 * @shutdown: invoked only on the registered primary instance immediately after the main loop terminates
235 * @activate: invoked on the primary instance when an activation occurs
236 * @open: invoked on the primary instance when there are files to open
237 * @command_line: invoked on the primary instance when a command-line is not handled locally
238 * @local_command_line: invoked (locally) when the process has been invoked via commandline execution (as opposed to, say, D-Bus activation - which is not currently supported by GApplication). The virtual function has the chance to inspect (and possibly replace) the list of command line arguments. See g_application_run() for more information.
239 * @before_emit: invoked on the primary instance before 'activate', 'open', 'command-line' or any action invocation, gets the 'platform data' from the calling instance
240 * @after_emit: invoked on the primary instance after 'activate', 'open', 'command-line' or any action invocation, gets the 'platform data' from the calling instance
241 * @add_platform_data: invoked (locally) to add 'platform data' to be sent to the primary instance when activating, opening or invoking actions
242 * @quit_mainloop: Used to be invoked on the primary instance when the use count of the application drops to zero (and after any inactivity timeout, if requested). Not used anymore since 2.32
243 * @run_mainloop: Used to be invoked on the primary instance from g_application_run() if the use-count is non-zero. Since 2.32, GApplication is iterating the main context directly and is not using @run_mainloop anymore
244 * @dbus_register: invoked locally during registration, if the application is using its D-Bus backend. You can use this to export extra objects on the bus, that need to exist before the application tries to own the bus name. The function is passed the #GDBusConnection to to session bus, and the object path that #GApplication will use to export is D-Bus API. If this function returns %TRUE, registration will proceed; otherwise registration will abort. Since: 2.34
245 * @dbus_unregister: invoked locally during unregistration, if the application is using its D-Bus backend. Use this to undo anything done by the @dbus_register vfunc. Since: 2.34
247 * Virtual function table for #GApplication.
254 * GApplicationCommandLineClass:
256 * The <structname>GApplicationCommandLineClass</structname> structure
257 * contains private data only
264 * GCancellable::cancelled:
265 * @cancellable: a #GCancellable.
267 * Emitted when the operation has been cancelled.
269 * Can be used by implementations of cancellable operations. If the
270 * operation is cancelled from another thread, the signal will be
271 * emitted in the thread that cancelled the operation, not the
272 * thread that is running the operation.
274 * Note that disconnecting from this signal (or any signal) in a
275 * multi-threaded program is prone to race conditions. For instance
276 * it is possible that a signal handler may be invoked even
277 * <emphasis>after</emphasis> a call to
278 * g_signal_handler_disconnect() for that handler has already
281 * There is also a problem when cancellation happen
282 * right before connecting to the signal. If this happens the
283 * signal will unexpectedly not be emitted, and checking before
284 * connecting to the signal leaves a race condition where this is
287 * In order to make it safe and easy to connect handlers there
288 * are two helper functions: g_cancellable_connect() and
289 * g_cancellable_disconnect() which protect against problems
292 * An example of how to us this:
294 * /<!-- -->* Make sure we don't do any unnecessary work if already cancelled *<!-- -->/
295 * if (g_cancellable_set_error_if_cancelled (cancellable))
298 * /<!-- -->* Set up all the data needed to be able to
299 * * handle cancellation of the operation *<!-- -->/
300 * my_data = my_data_new (...);
304 * id = g_cancellable_connect (cancellable,
305 * G_CALLBACK (cancelled_handler)
308 * /<!-- -->* cancellable operation here... *<!-- -->/
310 * g_cancellable_disconnect (cancellable, id);
312 * /<!-- -->* cancelled_handler is never called after this, it
313 * * is now safe to free the data *<!-- -->/
314 * my_data_free (my_data);
317 * Note that the cancelled signal is emitted in the thread that
318 * the user cancelled from, which may be the main thread. So, the
319 * cancellable signal should not do something that can block.
326 * Conversions between character sets.
333 * The #GCredentials structure contains only private data and
334 * should only be accessed using the provided API.
343 * Class structure for #GCredentials.
350 * GDBusAuthMechanism:credentials:
352 * If authenticating as a server, this property contains the
353 * received credentials, if any.
355 * If authenticating as a client, the property contains the
356 * credentials that were sent, if any.
363 * The #GDBusAuthObserver structure contains only private data and
364 * should only be accessed using the provided API.
371 * GDBusAuthObserver::allow-mechanism:
372 * @observer: The #GDBusAuthObserver emitting the signal.
373 * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
375 * Emitted to check if @mechanism is allowed to be used.
377 * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
383 * GDBusAuthObserver::authorize-authenticated-peer:
384 * @observer: The #GDBusAuthObserver emitting the signal.
385 * @stream: A #GIOStream for the #GDBusConnection.
386 * @credentials: (allow-none): Credentials received from the peer or %NULL.
388 * Emitted to check if a peer that is successfully authenticated
391 * Returns: %TRUE if the peer is authorized, %FALSE if not.
397 * GDBusAuthObserverClass:
398 * @authorize_authenticated_peer: Signal class handler for the #GDBusAuthObserver::authorize-authenticated-peer signal.
400 * Class structure for #GDBusAuthObserverClass.
409 * The #GDBusConnection structure contains only private data and
410 * should only be accessed using the provided API.
417 * GDBusConnection::closed:
418 * @connection: The #GDBusConnection emitting the signal.
419 * @remote_peer_vanished: %TRUE if @connection is closed because the remote peer closed its end of the connection.
420 * @error: (allow-none): A #GError with more details about the event or %NULL.
422 * Emitted when the connection is closed.
424 * The cause of this event can be
427 * If g_dbus_connection_close() is called. In this case
428 * @remote_peer_vanished is set to %FALSE and @error is %NULL.
431 * If the remote peer closes the connection. In this case
432 * @remote_peer_vanished is set to %TRUE and @error is set.
435 * If the remote peer sends invalid or malformed data. In this
436 * case @remote_peer_vanished is set to %FALSE and @error
441 * Upon receiving this signal, you should give up your reference to
442 * @connection. You are guaranteed that this signal is emitted only
450 * GDBusConnection:address:
452 * A D-Bus address specifying potential endpoints that can be used
453 * when establishing the connection.
460 * GDBusConnection:authentication-observer:
462 * A #GDBusAuthObserver object to assist in the authentication process or %NULL.
469 * GDBusConnection:capabilities:
471 * Flags from the #GDBusCapabilityFlags enumeration
472 * representing connection features negotiated with the other peer.
479 * GDBusConnection:closed:
481 * A boolean specifying whether the connection has been closed.
488 * GDBusConnection:exit-on-close:
490 * A boolean specifying whether the process will be terminated (by
491 * calling <literal>raise(SIGTERM)</literal>) if the connection
492 * is closed by the remote peer.
494 * Note that #GDBusConnection objects returned by g_bus_get_finish() and
495 * g_bus_get_sync() will (usually) have this property set to %TRUE.
502 * GDBusConnection:flags:
504 * Flags from the #GDBusConnectionFlags enumeration.
511 * GDBusConnection:guid:
513 * The GUID of the peer performing the role of server when
516 * If you are constructing a #GDBusConnection and pass
517 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER in the
518 * #GDBusConnection:flags property then you MUST also set this
519 * property to a valid guid.
521 * If you are constructing a #GDBusConnection and pass
522 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT in the
523 * #GDBusConnection:flags property you will be able to read the GUID
524 * of the other peer here after the connection has been successfully
532 * GDBusConnection:locked:
534 * A boolean specifying whether the message is locked.
541 * GDBusConnection:stream:
543 * The underlying #GIOStream used for I/O.
545 * If this is passed on construction and is a #GSocketConnection,
546 * then the corresponding #GSocket will be put into non-blocking mode.
548 * While the #GDBusConnection is active, it will interact with this
549 * stream from a worker thread, so it is not safe to interact with
550 * the stream directly.
557 * GDBusConnection:unique-name:
559 * The unique name as assigned by the message bus or %NULL if the
560 * connection is not open or not a message bus connection.
567 * GDBusConnectionClass:
568 * @closed: Signal class handler for the #GDBusConnection::closed signal.
570 * Class structure for #GDBusConnection.
577 * GDBusInterfaceSkeleton::g-authorize-method:
578 * @interface: The #GDBusInterfaceSkeleton emitting the signal.
579 * @invocation: A #GDBusMethodInvocation.
581 * Emitted when a method is invoked by a remote caller and used to
582 * determine if the method call is authorized.
584 * Note that this signal is emitted in a thread dedicated to
585 * handling the method call so handlers are allowed to perform
586 * blocking IO. This means that it is appropriate to call
588 * url="http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#polkit-authority-check-authorization-sync">polkit_authority_check_authorization_sync()</ulink>
590 * url="http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#POLKIT-CHECK-AUTHORIZATION-FLAGS-ALLOW-USER-INTERACTION:CAPS">POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION</ulink> flag set.
592 * If %FALSE is returned then no further handlers are run and the
593 * signal handler must take a reference to @invocation and finish
594 * handling the call (e.g. return an error via
595 * g_dbus_method_invocation_return_error()).
597 * Otherwise, if %TRUE is returned, signal emission continues. If no
598 * handlers return %FALSE, then the method is dispatched. If
599 * @interface has an enclosing #GDBusObjectSkeleton, then the
600 * #GDBusObjectSkeleton::authorize-method signal handlers run before
601 * the handlers for this signal.
603 * The default class handler just returns %TRUE.
605 * Please note that the common case is optimized: if no signals
606 * handlers are connected and the default class handler isn't
607 * overridden (for both @interface and the enclosing
608 * #GDBusObjectSkeleton, if any) and #GDBusInterfaceSkeleton:g-flags does
610 * %G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD
611 * flags set, no dedicated thread is ever used and the call will be
612 * handled in the same thread as the object that @interface belongs
613 * to was exported in.
615 * Returns: %TRUE if the call is authorized, %FALSE otherwise.
621 * GDBusInterfaceSkeleton:g-flags:
623 * Flags from the #GDBusInterfaceSkeletonFlags enumeration.
632 * The #GDBusMessage structure contains only private data and should
633 * only be accessed using the provided API.
642 * Class structure for #GDBusMessage.
649 * GDBusMethodInvocation:
651 * The #GDBusMethodInvocation structure contains only private data and
652 * should only be accessed using the provided API.
659 * GDBusMethodInvocationClass:
661 * Class structure for #GDBusMethodInvocation.
668 * GDBusObject::interface-added:
669 * @object: The #GDBusObject emitting the signal.
670 * @interface: The #GDBusInterface that was added.
672 * Emitted when @interface is added to @object.
679 * GDBusObject::interface-removed:
680 * @object: The #GDBusObject emitting the signal.
681 * @interface: The #GDBusInterface that was removed.
683 * Emitted when @interface is removed from @object.
690 * GDBusObjectManager::interface-added:
691 * @manager: The #GDBusObjectManager emitting the signal.
692 * @object: The #GDBusObject on which an interface was added.
693 * @interface: The #GDBusInterface that was added.
695 * Emitted when @interface is added to @object.
697 * This signal exists purely as a convenience to avoid having to
698 * connect signals to all objects managed by @manager.
705 * GDBusObjectManager::interface-removed:
706 * @manager: The #GDBusObjectManager emitting the signal.
707 * @object: The #GDBusObject on which an interface was removed.
708 * @interface: The #GDBusInterface that was removed.
710 * Emitted when @interface has been removed from @object.
712 * This signal exists purely as a convenience to avoid having to
713 * connect signals to all objects managed by @manager.
720 * GDBusObjectManager::object-added:
721 * @manager: The #GDBusObjectManager emitting the signal.
722 * @object: The #GDBusObject that was added.
724 * Emitted when @object is added to @manager.
731 * GDBusObjectManager::object-removed:
732 * @manager: The #GDBusObjectManager emitting the signal.
733 * @object: The #GDBusObject that was removed.
735 * Emitted when @object is removed from @manager.
742 * GDBusObjectManagerClient::interface-proxy-properties-changed:
743 * @manager: The #GDBusObjectManagerClient emitting the signal.
744 * @object_proxy: The #GDBusObjectProxy on which an interface has properties that are changing.
745 * @interface_proxy: The #GDBusProxy that has properties that are changing.
746 * @changed_properties: A #GVariant containing the properties that changed.
747 * @invalidated_properties: A %NULL terminated array of properties that was invalidated.
749 * Emitted when one or more D-Bus properties on proxy changes. The
750 * local cache has already been updated when this signal fires. Note
751 * that both @changed_properties and @invalidated_properties are
752 * guaranteed to never be %NULL (either may be empty though).
754 * This signal exists purely as a convenience to avoid having to
755 * connect signals to all interface proxies managed by @manager.
757 * This signal is emitted in the
758 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
759 * that @manager was constructed in.
766 * GDBusObjectManagerClient::interface-proxy-signal:
767 * @manager: The #GDBusObjectManagerClient emitting the signal.
768 * @object_proxy: The #GDBusObjectProxy on which an interface is emitting a D-Bus signal.
769 * @interface_proxy: The #GDBusProxy that is emitting a D-Bus signal.
770 * @sender_name: The sender of the signal or NULL if the connection is not a bus connection.
771 * @signal_name: The signal name.
772 * @parameters: A #GVariant tuple with parameters for the signal.
774 * Emitted when a D-Bus signal is received on @interface_proxy.
776 * This signal exists purely as a convenience to avoid having to
777 * connect signals to all interface proxies managed by @manager.
779 * This signal is emitted in the
780 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
781 * that @manager was constructed in.
788 * GDBusObjectManagerClient:bus-type:
790 * If this property is not %G_BUS_TYPE_NONE, then
791 * #GDBusObjectManagerClient:connection must be %NULL and will be set to the
792 * #GDBusConnection obtained by calling g_bus_get() with the value
800 * GDBusObjectManagerClient:connection:
802 * The #GDBusConnection to use.
809 * GDBusObjectManagerClient:flags:
811 * Flags from the #GDBusObjectManagerClientFlags enumeration.
818 * GDBusObjectManagerClient:get-proxy-type-destroy-notify:
820 * A #GDestroyNotify for the #gpointer user_data in #GDBusObjectManagerClient:get-proxy-type-user-data.
827 * GDBusObjectManagerClient:get-proxy-type-func:
829 * The #GDBusProxyTypeFunc to use when determining what #GType to
830 * use for interface proxies or %NULL.
837 * GDBusObjectManagerClient:get-proxy-type-user-data:
839 * The #gpointer user_data to pass to #GDBusObjectManagerClient:get-proxy-type-func.
846 * GDBusObjectManagerClient:name:
848 * The well-known name or unique name that the manager is for.
855 * GDBusObjectManagerClient:name-owner:
857 * The unique name that owns #GDBusObjectManagerClient:name or %NULL if
858 * no-one is currently owning the name. Connect to the
859 * #GObject::notify signal to track changes to this property.
866 * GDBusObjectManagerClient:object-path:
868 * The object path the manager is for.
875 * GDBusObjectManagerServer:connection:
877 * The #GDBusConnection to export objects on.
884 * GDBusObjectManagerServer:object-path:
886 * The object path to register the manager object at.
893 * GDBusObjectProxy:g-connection:
895 * The connection of the proxy.
902 * GDBusObjectProxy:g-object-path:
904 * The object path of the proxy.
911 * GDBusObjectSkeleton::authorize-method:
912 * @object: The #GDBusObjectSkeleton emitting the signal.
913 * @interface: The #GDBusInterfaceSkeleton that @invocation is for.
914 * @invocation: A #GDBusMethodInvocation.
916 * Emitted when a method is invoked by a remote caller and used to
917 * determine if the method call is authorized.
919 * This signal is like #GDBusInterfaceSkeleton<!-- -->'s
920 * #GDBusInterfaceSkeleton::g-authorize-method signal, except that it is
921 * for the enclosing object.
923 * The default class handler just returns %TRUE.
925 * Returns: %TRUE if the call is authorized, %FALSE otherwise.
931 * GDBusObjectSkeleton:g-object-path:
933 * The object path where the object is exported.
940 * GDBusProxy::g-properties-changed:
941 * @proxy: The #GDBusProxy emitting the signal.
942 * @changed_properties: A #GVariant containing the properties that changed
943 * @invalidated_properties: A %NULL terminated array of properties that was invalidated
945 * Emitted when one or more D-Bus properties on @proxy changes. The
946 * local cache has already been updated when this signal fires. Note
947 * that both @changed_properties and @invalidated_properties are
948 * guaranteed to never be %NULL (either may be empty though).
950 * If the proxy has the flag
951 * %G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES set, then
952 * @invalidated_properties will always be empty.
954 * This signal corresponds to the
955 * <literal>PropertiesChanged</literal> D-Bus signal on the
956 * <literal>org.freedesktop.DBus.Properties</literal> interface.
963 * GDBusProxy::g-signal:
964 * @proxy: The #GDBusProxy emitting the signal.
965 * @sender_name: (allow-none): The sender of the signal or %NULL if the connection is not a bus connection.
966 * @signal_name: The name of the signal.
967 * @parameters: A #GVariant tuple with parameters for the signal.
969 * Emitted when a signal from the remote object and interface that @proxy is for, has been received.
976 * GDBusProxy:g-bus-type:
978 * If this property is not %G_BUS_TYPE_NONE, then
979 * #GDBusProxy:g-connection must be %NULL and will be set to the
980 * #GDBusConnection obtained by calling g_bus_get() with the value
988 * GDBusProxy:g-connection:
990 * The #GDBusConnection the proxy is for.
997 * GDBusProxy:g-default-timeout:
999 * The timeout to use if -1 (specifying default timeout) is passed
1000 * as @timeout_msec in the g_dbus_proxy_call() and
1001 * g_dbus_proxy_call_sync() functions.
1003 * This allows applications to set a proxy-wide timeout for all
1004 * remote method invocations on the proxy. If this property is -1,
1005 * the default timeout (typically 25 seconds) is used. If set to
1006 * %G_MAXINT, then no timeout is used.
1013 * GDBusProxy:g-flags:
1015 * Flags from the #GDBusProxyFlags enumeration.
1022 * GDBusProxy:g-interface-info:
1024 * Ensure that interactions with this proxy conform to the given
1025 * interface. This is mainly to ensure that malformed data received
1026 * from the other peer is ignored. The given #GDBusInterfaceInfo is
1027 * said to be the <emphasis>expected interface</emphasis>.
1029 * The checks performed are:
1032 * When completing a method call, if the type signature of
1033 * the reply message isn't what's expected, the reply is
1034 * discarded and the #GError is set to %G_IO_ERROR_INVALID_ARGUMENT.
1035 * </para></listitem>
1037 * Received signals that have a type signature mismatch are dropped and
1038 * a warning is logged via g_warning().
1039 * </para></listitem>
1041 * Properties received via the initial <literal>GetAll()</literal> call
1042 * or via the <literal>::PropertiesChanged</literal> signal (on the
1043 * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties">org.freedesktop.DBus.Properties</ulink> interface) or
1044 * set using g_dbus_proxy_set_cached_property() with a type signature
1045 * mismatch are ignored and a warning is logged via g_warning().
1046 * </para></listitem>
1048 * Note that these checks are never done on methods, signals and
1049 * properties that are not referenced in the given
1050 * #GDBusInterfaceInfo, since extending a D-Bus interface on the
1051 * service-side is not considered an ABI break.
1058 * GDBusProxy:g-interface-name:
1060 * The D-Bus interface name the proxy is for.
1067 * GDBusProxy:g-name:
1069 * The well-known or unique name that the proxy is for.
1076 * GDBusProxy:g-name-owner:
1078 * The unique name that owns #GDBusProxy:g-name or %NULL if no-one
1079 * currently owns that name. You may connect to #GObject::notify signal to
1080 * track changes to this property.
1087 * GDBusProxy:g-object-path:
1089 * The object path the proxy is for.
1098 * The #GDBusServer structure contains only private data and
1099 * should only be accessed using the provided API.
1106 * GDBusServer::new-connection:
1107 * @server: The #GDBusServer emitting the signal.
1108 * @connection: A #GDBusConnection for the new connection.
1110 * Emitted when a new authenticated connection has been made. Use
1111 * g_dbus_connection_get_peer_credentials() to figure out what
1112 * identity (if any), was authenticated.
1114 * If you want to accept the connection, take a reference to the
1115 * @connection object and return %TRUE. When you are done with the
1116 * connection call g_dbus_connection_close() and give up your
1117 * reference. Note that the other peer may disconnect at any time -
1118 * a typical thing to do when accepting a connection is to listen to
1119 * the #GDBusConnection::closed signal.
1121 * If #GDBusServer:flags contains %G_DBUS_SERVER_FLAGS_RUN_IN_THREAD
1122 * then the signal is emitted in a new thread dedicated to the
1123 * connection. Otherwise the signal is emitted in the <link
1124 * linkend="g-main-context-push-thread-default">thread-default main
1125 * loop</link> of the thread that @server was constructed in.
1127 * You are guaranteed that signal handlers for this signal runs
1128 * before incoming messages on @connection are processed. This means
1129 * that it's suitable to call g_dbus_connection_register_object() or
1130 * similar from the signal handler.
1132 * Returns: %TRUE to claim @connection, %FALSE to let other handlers run.
1138 * GDBusServer:active:
1140 * Whether the server is currently active.
1147 * GDBusServer:address:
1149 * The D-Bus address to listen on.
1156 * GDBusServer:authentication-observer:
1158 * A #GDBusAuthObserver object to assist in the authentication process or %NULL.
1165 * GDBusServer:client-address:
1167 * The D-Bus address that clients can use.
1174 * GDBusServer:flags:
1176 * Flags from the #GDBusServerFlags enumeration.
1185 * The guid of the server.
1193 * @new_connection: Signal class handler for the #GDBusServer::new-connection signal.
1195 * Class structure for #GDBusServer.
1202 * GDataOutputStream:byte-order:
1204 * Determines the byte ordering that is used when writing
1205 * multi-byte entities (such as integers) to the stream.
1210 * GDataStream:byte-order:
1212 * The ::byte-order property determines the byte ordering that
1213 * is used when reading multi-byte entities (such as integers)
1219 * GDataStream:newline-type:
1221 * The :newline-type property determines what is considered
1222 * as a line ending when reading complete lines from the stream.
1229 * Information about an installed application from a desktop file.
1234 * GDesktopAppInfo:filename:
1236 * The origin filename of this #GDesktopAppInfo
1242 * @drive: a #GDrive.
1244 * Emitted when the drive's state has changed.
1249 * GDrive::disconnected:
1250 * @drive: a #GDrive.
1252 * This signal is emitted when the #GDrive have been
1253 * disconnected. If the recipient is holding references to the
1254 * object they should release them so the object can be
1260 * GDrive::eject-button:
1261 * @drive: a #GDrive.
1263 * Emitted when the physical eject button (if any) of a drive has
1269 * GDrive::stop-button:
1270 * @drive: a #GDrive.
1272 * Emitted when the physical stop button (if any) of a drive has
1282 * The file containing the icon.
1287 * GFileMonitor::changed:
1288 * @monitor: a #GFileMonitor.
1290 * @other_file: (allow-none): a #GFile or #NULL.
1291 * @event_type: a #GFileMonitorEvent.
1293 * Emitted when @file has been changed.
1295 * If using #G_FILE_MONITOR_SEND_MOVED flag and @event_type is
1296 * #G_FILE_MONITOR_EVENT_MOVED, @file will be set to a #GFile containing the
1297 * old path, and @other_file will be set to a #GFile containing the new path.
1299 * In all the other cases, @other_file will be set to #NULL.
1304 * GFilenameCompleter::got-completion-data:
1306 * Emitted when the file name completion information comes available.
1313 * Represents a scope for loading IO modules. A scope can be used for blocking
1314 * duplicate modules, or blocking a module you don't want to load.
1316 * The scope can be used with g_io_modules_load_all_in_directory_with_scope()
1317 * or g_io_modules_scan_all_in_directory_with_scope().
1326 * An IPv4 or IPv6 internet address.
1331 * GInetAddress:is-any:
1333 * Whether this is the "any" address for its family.
1334 * See g_inet_address_get_is_any().
1341 * GInetAddress:is-link-local:
1343 * Whether this is a link-local address.
1344 * See g_inet_address_get_is_link_local().
1351 * GInetAddress:is-loopback:
1353 * Whether this is the loopback address for its family.
1354 * See g_inet_address_get_is_loopback().
1361 * GInetAddress:is-mc-global:
1363 * Whether this is a global multicast address.
1364 * See g_inet_address_get_is_mc_global().
1371 * GInetAddress:is-mc-link-local:
1373 * Whether this is a link-local multicast address.
1374 * See g_inet_address_get_is_mc_link_local().
1381 * GInetAddress:is-mc-node-local:
1383 * Whether this is a node-local multicast address.
1384 * See g_inet_address_get_is_mc_node_local().
1391 * GInetAddress:is-mc-org-local:
1393 * Whether this is an organization-local multicast address.
1394 * See g_inet_address_get_is_mc_org_local().
1401 * GInetAddress:is-mc-site-local:
1403 * Whether this is a site-local multicast address.
1404 * See g_inet_address_get_is_mc_site_local().
1411 * GInetAddress:is-multicast:
1413 * Whether this is a multicast address.
1414 * See g_inet_address_get_is_multicast().
1421 * GInetAddress:is-site-local:
1423 * Whether this is a site-local address.
1424 * See g_inet_address_get_is_loopback().
1433 * A combination of an IPv4 or IPv6 base address and a length,
1434 * representing a range of IP addresses.
1441 * GInetSocketAddress:
1443 * An IPv4 or IPv6 socket address, corresponding to a <type>struct
1444 * sockaddr_in</type> or <type>struct sockaddr_in6</type>.
1449 * GInetSocketAddress:flowinfo:
1451 * The <literal>sin6_flowinfo</literal> field, for IPv6 addresses.
1458 * GInetSocketAddress:scope_id:
1460 * The <literal>sin6_scope_id</literal> field, for IPv6 addresses.
1467 * GMemoryOutputStream:data:
1469 * Pointer to buffer where data will be written.
1476 * GMemoryOutputStream:data-size:
1478 * Size of data written to the buffer.
1485 * GMemoryOutputStream:destroy-function: (skip)
1487 * Function called with the buffer as argument when the stream is destroyed.
1494 * GMemoryOutputStream:realloc-function: (skip)
1496 * Function with realloc semantics called to enlarge the buffer.
1503 * GMemoryOutputStream:size:
1505 * Current size of the data buffer.
1514 * #GMenu is an opaque structure type. You must access it using the
1522 * GMenuAttributeIter:
1524 * #GMenuAttributeIter is an opaque structure type. You must access it
1525 * using the functions below.
1534 * #GMenuItem is an opaque structure type. You must access it using the
1544 * #GMenuLinkIter is an opaque structure type. You must access it using
1545 * the functions below.
1554 * #GMenuModel is an opaque structure type. You must access it using the
1562 * GMenuModel::items-changed:
1563 * @model: the #GMenuModel that is changing
1564 * @position: the position of the change
1565 * @removed: the number of items removed
1566 * @added: the number of items added
1568 * Emitted when a change has occured to the menu.
1570 * The only changes that can occur to a menu is that items are removed
1571 * or added. Items may not change (except by being removed and added
1572 * back in the same location). This signal is capable of describing
1573 * both of those changes (at the same time).
1575 * The signal means that starting at the index @position, @removed
1576 * items were removed and @added items were added in their place. If
1577 * @removed is zero then only items were added. If @added is zero
1578 * then only items were removed.
1580 * As an example, if the menu contains items a, b, c, d (in that
1581 * order) and the signal (2, 1, 3) occurs then the new composition of
1582 * the menu will be a, b, _, _, _, d (with each _ representing some
1585 * Signal handlers may query the model (particularly the added items)
1586 * and expect to see the results of the modification that is being
1587 * reported. The signal is emitted after the modification.
1593 * @mount: the object on which the signal is emitted
1595 * Emitted when the mount has been changed.
1600 * GMount::pre-unmount:
1601 * @mount: the object on which the signal is emitted
1603 * This signal is emitted when the #GMount is about to be
1611 * GMount::unmounted:
1612 * @mount: the object on which the signal is emitted
1614 * This signal is emitted when the #GMount have been
1615 * unmounted. If the recipient is holding references to the
1616 * object they should release them so the object can be
1622 * GMountOperation::aborted:
1624 * Emitted by the backend when e.g. a device becomes unavailable
1625 * while a mount operation is in progress.
1627 * Implementations of GMountOperation should handle this signal
1628 * by dismissing open password dialogs.
1635 * GMountOperation::ask-password:
1636 * @op: a #GMountOperation requesting a password.
1637 * @message: string containing a message to display to the user.
1638 * @default_user: string containing the default user name.
1639 * @default_domain: string containing the default domain.
1640 * @flags: a set of #GAskPasswordFlags.
1642 * Emitted when a mount operation asks the user for a password.
1644 * If the message contains a line break, the first line should be
1645 * presented as a heading. For example, it may be used as the
1646 * primary text in a #GtkMessageDialog.
1651 * GMountOperation::ask-question:
1652 * @op: a #GMountOperation asking a question.
1653 * @message: string containing a message to display to the user.
1654 * @choices: an array of strings for each possible choice.
1656 * Emitted when asking the user a question and gives a list of
1657 * choices for the user to choose from.
1659 * If the message contains a line break, the first line should be
1660 * presented as a heading. For example, it may be used as the
1661 * primary text in a #GtkMessageDialog.
1666 * GMountOperation::reply:
1667 * @op: a #GMountOperation.
1668 * @result: a #GMountOperationResult indicating how the request was handled
1670 * Emitted when the user has replied to the mount operation.
1675 * GMountOperation::show-processes:
1676 * @op: a #GMountOperation.
1677 * @message: string containing a message to display to the user.
1678 * @processes: (element-type GPid): an array of #GPid for processes blocking the operation.
1679 * @choices: an array of strings for each possible choice.
1681 * Emitted when one or more processes are blocking an operation
1682 * e.g. unmounting/ejecting a #GMount or stopping a #GDrive.
1684 * Note that this signal may be emitted several times to update the
1685 * list of blocking processes as processes close files. The
1686 * application should only respond with g_mount_operation_reply() to
1687 * the latest signal (setting #GMountOperation:choice to the choice
1690 * If the message contains a line break, the first line should be
1691 * presented as a heading. For example, it may be used as the
1692 * primary text in a #GtkMessageDialog.
1699 * GMountOperation::show-unmount-progress:
1700 * @op: a #GMountOperation:
1701 * @message: string containing a mesage to display to the user
1702 * @time_left: the estimated time left before the operation completes, in microseconds, or -1
1703 * @bytes_left: the amount of bytes to be written before the operation completes (or -1 if such amount is not known), or zero if the operation is completed
1705 * Emitted when an unmount operation has been busy for more than some time
1706 * (typically 1.5 seconds).
1708 * When unmounting or ejecting a volume, the kernel might need to flush
1709 * pending data in its buffers to the volume stable storage, and this operation
1710 * can take a considerable amount of time. This signal may be emitted several
1711 * times as long as the unmount operation is outstanding, and then one
1712 * last time when the operation is completed, with @bytes_left set to zero.
1714 * Implementations of GMountOperation should handle this signal by
1715 * showing an UI notification, and then dismiss it, or show another notification
1716 * of completion, when @bytes_left reaches zero.
1718 * If the message contains a line break, the first line should be
1719 * presented as a heading. For example, it may be used as the
1720 * primary text in a #GtkMessageDialog.
1727 * GMountOperation:anonymous:
1729 * Whether to use an anonymous user when authenticating.
1734 * GMountOperation:choice:
1736 * The index of the user's choice when a question is asked during the
1737 * mount operation. See the #GMountOperation::ask-question signal.
1742 * GMountOperation:domain:
1744 * The domain to use for the mount operation.
1749 * GMountOperation:password:
1751 * The password that is used for authentication when carrying out
1752 * the mount operation.
1757 * GMountOperation:password-save:
1759 * Determines if and how the password information should be saved.
1764 * GMountOperation:username:
1766 * The user name that is used for authentication when carrying out
1767 * the mount operation.
1774 * A #GSocketConnectable for resolving a hostname and connecting to
1782 * #GNetworkMonitor monitors the status of network connections and
1783 * indicates when a possibly-user-visible change has occurred.
1790 * GNetworkMonitor::network-changed:
1791 * @monitor: a #GNetworkMonitor
1792 * @available: the current value of #GNetworkMonitor:network-available
1794 * Emitted when the network configuration changes. If @available is
1795 * %TRUE, then some hosts may be reachable that were not reachable
1796 * before, while others that were reachable before may no longer be
1797 * reachable. If @available is %FALSE, then no remote hosts are
1805 * GNetworkMonitor:network-available:
1807 * Whether the network is considered available. That is, whether the
1808 * system has a default route for at least one of IPv4 or IPv6.
1810 * Real-world networks are of course much more complicated than
1811 * this; the machine may be connected to a wifi hotspot that
1812 * requires payment before allowing traffic through, or may be
1813 * connected to a functioning router that has lost its own upstream
1814 * connectivity. Some hosts might only be accessible when a VPN is
1815 * active. Other hosts might only be accessible when the VPN is
1816 * <emphasis>not</emphasis> active. Thus, it is best to use
1817 * g_network_monitor_can_reach() or
1818 * g_network_monitor_can_reach_async() to test for reachability on a
1819 * host-by-host basis. (On the other hand, when the property is
1820 * %FALSE, the application can reasonably expect that no remote
1821 * hosts at all are reachable, and should indicate this to the user
1824 * See also #GNetworkMonitor::network-changed.
1833 * A #GSocketConnectable for resolving a SRV record and connecting to
1841 * #GPermission is an opaque data structure and can only be accessed
1842 * using the following functions.
1847 * GPermission:allowed:
1849 * %TRUE if the caller currently has permission to perform the action that
1850 * @permission represents the permission to perform.
1855 * GPermission:can-acquire:
1857 * %TRUE if it is generally possible to acquire the permission by calling
1858 * g_permission_acquire().
1863 * GPermission:can-release:
1865 * %TRUE if it is generally possible to release the permission by calling
1866 * g_permission_release().
1873 * A #GInetSocketAddress representing a connection via a proxy server
1880 * GProxyAddress:destination-protocol:
1882 * The protocol being spoke to the destination host, or %NULL if
1883 * the #GProxyAddress doesn't know.
1890 * GProxyAddress:uri:
1892 * The URI string that the proxy was constructed from (or %NULL
1893 * if the creator didn't specify this).
1900 * GRemoteActionGroupInterface:
1901 * @activate_action_full: the virtual function pointer for g_remote_action_group_activate_action_full()
1902 * @change_action_state_full: the virtual function pointer for g_remote_action_group_change_action_state_full()
1904 * The virtual function table for #GRemoteActionGroup.
1913 * The object that handles DNS resolution. Use g_resolver_get_default()
1914 * to get the default resolver.
1919 * GResolver::reload:
1920 * @resolver: a #GResolver
1922 * Emitted when the resolver notices that the system resolver
1923 * configuration has changed.
1928 * GSettings::change-event:
1929 * @settings: the object on which the signal was emitted
1930 * @keys: (array length=n_keys) (element-type GQuark) (allow-none): an array of #GQuark<!-- -->s for the changed keys, or %NULL
1931 * @n_keys: the length of the @keys array, or 0
1933 * The "change-event" signal is emitted once per change event that
1934 * affects this settings object. You should connect to this signal
1935 * only if you are interested in viewing groups of changes before they
1936 * are split out into multiple emissions of the "changed" signal.
1937 * For most use cases it is more appropriate to use the "changed" signal.
1939 * In the event that the change event applies to one or more specified
1940 * keys, @keys will be an array of #GQuark of length @n_keys. In the
1941 * event that the change event applies to the #GSettings object as a
1942 * whole (ie: potentially every key has been changed) then @keys will
1943 * be %NULL and @n_keys will be 0.
1945 * The default handler for this signal invokes the "changed" signal
1946 * for each affected key. If any other connected handler returns
1947 * %TRUE then this default functionality will be suppressed.
1949 * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
1954 * GSettings::changed:
1955 * @settings: the object on which the signal was emitted
1956 * @key: the name of the key that changed
1958 * The "changed" signal is emitted when a key has potentially changed.
1959 * You should call one of the g_settings_get() calls to check the new
1962 * This signal supports detailed connections. You can connect to the
1963 * detailed signal "changed::x" in order to only receive callbacks
1964 * when key "x" changes.
1969 * GSettings::writable-change-event:
1970 * @settings: the object on which the signal was emitted
1971 * @key: the quark of the key, or 0
1973 * The "writable-change-event" signal is emitted once per writability
1974 * change event that affects this settings object. You should connect
1975 * to this signal if you are interested in viewing groups of changes
1976 * before they are split out into multiple emissions of the
1977 * "writable-changed" signal. For most use cases it is more
1978 * appropriate to use the "writable-changed" signal.
1980 * In the event that the writability change applies only to a single
1981 * key, @key will be set to the #GQuark for that key. In the event
1982 * that the writability change affects the entire settings object,
1985 * The default handler for this signal invokes the "writable-changed"
1986 * and "changed" signals for each affected key. This is done because
1987 * changes in writability might also imply changes in value (if for
1988 * example, a new mandatory setting is introduced). If any other
1989 * connected handler returns %TRUE then this default functionality
1990 * will be suppressed.
1992 * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
1997 * GSettings::writable-changed:
1998 * @settings: the object on which the signal was emitted
2001 * The "writable-changed" signal is emitted when the writability of a
2002 * key has potentially changed. You should call
2003 * g_settings_is_writable() in order to determine the new status.
2005 * This signal supports detailed connections. You can connect to the
2006 * detailed signal "writable-changed::x" in order to only receive
2007 * callbacks when the writability of "x" changes.
2012 * GSettings:context:
2014 * The name of the context that the settings are stored in.
2019 * GSettings:delay-apply:
2021 * Whether the #GSettings object is in 'delay-apply' mode. See
2022 * g_settings_delay() for details.
2029 * GSettings:has-unapplied:
2031 * If this property is %TRUE, the #GSettings object has outstanding
2032 * changes that will be applied when g_settings_apply() is called.
2039 * The path within the backend where the settings are stored.
2046 * The name of the schema that describes the types of keys
2047 * for this #GSettings object.
2049 * The type of this property is *not* #GSettingsSchema.
2050 * #GSettingsSchema has only existed since version 2.32 and
2051 * unfortunately this name was used in previous versions to refer to
2052 * the schema ID rather than the schema itself. Take care to use the
2053 * 'settings-schema' property if you wish to pass in a
2056 * Deprecated: 2.32:Use the 'schema-id' property instead. In a future version, this property may instead refer to a #GSettingsSchema.
2061 * GSettings:schema-id:
2063 * The name of the schema that describes the types of keys
2064 * for this #GSettings object.
2069 * GSettings:settings-schema:
2071 * The #GSettingsSchema describing the types of keys for this
2072 * #GSettings object.
2074 * Ideally, this property would be called 'schema'. #GSettingsSchema
2075 * has only existed since version 2.32, however, and before then the
2076 * 'schema' property was used to refer to the ID of the schema rather
2077 * than the schema itself. Take care.
2084 * This is an opaque structure type. You may not access it directly.
2091 * GSettingsSchemaSource:
2093 * This is an opaque structure type. You may not access it directly.
2100 * GSimpleAction::activate:
2101 * @simple: the #GSimpleAction
2102 * @parameter: (allow-none): the parameter to the activation
2104 * Indicates that the action was just activated.
2106 * @parameter will always be of the expected type. In the event that
2107 * an incorrect type was given, no signal will be emitted.
2114 * GSimpleAction::change-state:
2115 * @simple: the #GSimpleAction
2116 * @value: (allow-none): the requested value for the state
2118 * Indicates that the action just received a request to change its
2121 * @value will always be of the correct state type. In the event that
2122 * an incorrect type was given, no signal will be emitted.
2124 * If no handler is connected to this signal then the default
2125 * behaviour is to call g_simple_action_set_state() to set the state
2126 * to the requested value. If you connect a signal handler then no
2127 * default action is taken. If the state should change then you must
2128 * call g_simple_action_set_state() from the handler.
2131 * <title>Example 'change-state' handler</title>
2134 * change_volume_state (GSimpleAction *action,
2136 * gpointer user_data)
2140 * requested = g_variant_get_int32 (value);
2142 * // Volume only goes from 0 to 10
2143 * if (0 <= requested && requested <= 10)
2144 * g_simple_action_set_state (action, value);
2149 * The handler need not set the state to the requested value. It
2150 * could set it to any value at all, or take some other action.
2157 * GSimpleAction:enabled:
2159 * If @action is currently enabled.
2161 * If the action is disabled then calls to g_action_activate() and
2162 * g_action_change_state() have no effect.
2169 * GSimpleAction:name:
2171 * The name of the action. This is mostly meaningful for identifying
2172 * the action once it has been added to a #GSimpleActionGroup.
2179 * GSimpleAction:parameter-type:
2181 * The type of the parameter that must be given when activating the
2189 * GSimpleAction:state:
2191 * The state of the action, or %NULL if the action is stateless.
2198 * GSimpleAction:state-type:
2200 * The #GVariantType of the state that the action has, or %NULL if the
2201 * action is stateless.
2208 * GSimplePermission:
2210 * #GSimplePermission is an opaque data structure. There are no methods
2211 * except for those defined by #GPermission.
2216 * GSocket:broadcast:
2218 * Whether the socket should allow sending to and receiving from broadcast addresses.
2225 * GSocket:multicast-loopback:
2227 * Whether outgoing multicast packets loop back to the local host.
2234 * GSocket:multicast-ttl:
2236 * Time-to-live out outgoing multicast packets
2245 * The timeout in seconds on socket I/O
2254 * Time-to-live for outgoing unicast packets
2263 * A socket endpoint address, corresponding to <type>struct sockaddr</type>
2264 * or one of its subtypes.
2269 * GSocketClient::event:
2270 * @client: the #GSocketClient
2271 * @event: the event that is occurring
2272 * @connectable: the #GSocketConnectable that @event is occurring on
2273 * @connection: the current representation of the connection
2275 * Emitted when @client's activity on @connectable changes state.
2276 * Among other things, this can be used to provide progress
2277 * information about a network connection in the UI. The meanings of
2278 * the different @event values are as follows:
2282 * <term>%G_SOCKET_CLIENT_RESOLVING:</term>
2284 * @client is about to look up @connectable in DNS.
2285 * @connection will be %NULL.
2286 * </para></listitem>
2289 * <term>%G_SOCKET_CLIENT_RESOLVED:</term>
2291 * @client has successfully resolved @connectable in DNS.
2292 * @connection will be %NULL.
2293 * </para></listitem>
2296 * <term>%G_SOCKET_CLIENT_CONNECTING:</term>
2298 * @client is about to make a connection to a remote host;
2299 * either a proxy server or the destination server itself.
2300 * @connection is the #GSocketConnection, which is not yet
2302 * </para></listitem>
2305 * <term>%G_SOCKET_CLIENT_CONNECTED:</term>
2307 * @client has successfully connected to a remote host.
2308 * @connection is the connected #GSocketConnection.
2309 * </para></listitem>
2312 * <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATING:</term>
2314 * @client is about to negotiate with a proxy to get it to
2315 * connect to @connectable. @connection is the
2316 * #GSocketConnection to the proxy server.
2317 * </para></listitem>
2320 * <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATED:</term>
2322 * @client has negotiated a connection to @connectable through
2323 * a proxy server. @connection is the stream returned from
2324 * g_proxy_connect(), which may or may not be a
2325 * #GSocketConnection.
2326 * </para></listitem>
2329 * <term>%G_SOCKET_CLIENT_TLS_HANDSHAKING:</term>
2331 * @client is about to begin a TLS handshake. @connection is a
2332 * #GTlsClientConnection.
2333 * </para></listitem>
2336 * <term>%G_SOCKET_CLIENT_TLS_HANDSHAKED:</term>
2338 * @client has successfully completed the TLS handshake.
2339 * @connection is a #GTlsClientConnection.
2340 * </para></listitem>
2343 * <term>%G_SOCKET_CLIENT_COMPLETE:</term>
2345 * @client has either successfully connected to @connectable
2346 * (in which case @connection is the #GSocketConnection that
2347 * it will be returning to the caller) or has failed (in which
2348 * case @connection is %NULL and the client is about to return
2350 * </para></listitem>
2354 * Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted
2355 * multiple times (or not at all) for a given connectable (in
2356 * particular, if @client ends up attempting to connect to more than
2357 * one address). However, if @client emits the #GSocketClient::event
2358 * signal at all for a given connectable, that it will always emit
2359 * it with %G_SOCKET_CLIENT_COMPLETE when it is done.
2361 * Note that there may be additional #GSocketClientEvent values in
2362 * the future; unrecognized @event values should be ignored.
2369 * GSocketService::incoming:
2370 * @service: the #GSocketService
2371 * @connection: a new #GSocketConnection object
2372 * @source_object: (allow-none): the source_object passed to g_socket_listener_add_address()
2374 * The ::incoming signal is emitted when a new incoming connection
2375 * to @service needs to be handled. The handler must initiate the
2376 * handling of @connection, but may not block; in essence,
2377 * asynchronous operations must be used.
2379 * @connection will be unreffed once the signal handler returns,
2380 * so you need to ref it yourself if you are planning to use it.
2382 * Returns: %TRUE to stop other handlers from being called
2390 * A single target host/port that a network service is running on.
2397 * The opaque object representing a synchronous or asynchronous task
2405 * @source_object: @task's source object
2406 * @task_data: @task's task data
2407 * @cancellable: @task's #GCancellable, or %NULL
2409 * The prototype for a task function to be run in a thread via
2410 * g_task_run_in_thread() or g_task_run_in_thread_sync().
2412 * If the return-on-cancel flag is set on @task, and @cancellable gets
2413 * cancelled, then the #GTask will be completed immediately (as though
2414 * g_task_return_error_if_cancelled() had been called), without
2415 * waiting for the task function to complete. However, the task
2416 * function will continue running in its thread in the background. The
2417 * function therefore needs to be careful about how it uses
2418 * externally-visible state in this case. See
2419 * g_task_set_return_on_cancel() for more details.
2421 * Other than in that case, @task will be completed when the
2422 * #GTaskThreadFunc returns, <emphasis>not</emphasis> when it calls
2423 * a <literal>g_task_return_</literal> function.
2432 * The #GTestDBus structure contains only private data and
2433 * should only be accessed using the provided API.
2442 * #GTestDBusFlags specifying the behaviour of the dbus session
2456 * GThemedIcon:names:
2458 * A %NULL-terminated array of icon names.
2463 * GThemedIcon:use-default-fallbacks:
2465 * Whether to use the default fallbacks found by shortening the icon name
2466 * at '-' characters. If the "names" array has more than one element,
2467 * ignores any past the first.
2469 * For example, if the icon name was "gnome-dev-cdrom-audio", the array
2473 * "gnome-dev-cdrom-audio",
2474 * "gnome-dev-cdrom",
2484 * GThreadedSocketService::run:
2485 * @service: the #GThreadedSocketService.
2486 * @connection: a new #GSocketConnection object.
2487 * @source_object: the source_object passed to g_socket_listener_add_address().
2489 * The ::run signal is emitted in a worker thread in response to an
2490 * incoming connection. This thread is dedicated to handling
2491 * @connection and may perform blocking IO. The signal handler need
2492 * not return until the connection is closed.
2494 * Returns: %TRUE to stop further signal handlers from being called
2501 * TLS (Transport Layer Security, aka SSL) backend. This is an
2502 * internal type used to coordinate the different classes implemented
2512 * Abstract base class for TLS certificate types.
2519 * GTlsCertificate:certificate:
2521 * The DER (binary) encoded representation of the certificate.
2522 * This property and the #GTlsCertificate:certificate-pem property
2523 * represent the same data, just in different forms.
2530 * GTlsCertificate:certificate-pem:
2532 * The PEM (ASCII) encoded representation of the certificate.
2533 * This property and the #GTlsCertificate:certificate
2534 * property represent the same data, just in different forms.
2541 * GTlsCertificate:issuer:
2543 * A #GTlsCertificate representing the entity that issued this
2544 * certificate. If %NULL, this means that the certificate is either
2545 * self-signed, or else the certificate of the issuer is not
2553 * GTlsCertificate:private-key:
2555 * The DER (binary) encoded representation of the certificate's
2556 * private key, in either PKCS#1 format or unencrypted PKCS#8
2557 * format. This property (or the #GTlsCertificate:private-key-pem
2558 * property) can be set when constructing a key (eg, from a file),
2559 * but cannot be read.
2561 * PKCS#8 format is supported since 2.32; earlier releases only
2562 * support PKCS#1. You can use the <literal>openssl rsa</literal>
2563 * tool to convert PKCS#8 keys to PKCS#1.
2570 * GTlsCertificate:private-key-pem:
2572 * The PEM (ASCII) encoded representation of the certificate's
2573 * private key in either PKCS#1 format ("<literal>BEGIN RSA PRIVATE
2574 * KEY</literal>") or unencrypted PKCS#8 format ("<literal>BEGIN
2575 * PRIVATE KEY</literal>"). This property (or the
2576 * #GTlsCertificate:private-key property) can be set when
2577 * constructing a key (eg, from a file), but cannot be read.
2579 * PKCS#8 format is supported since 2.32; earlier releases only
2580 * support PKCS#1. You can use the <literal>openssl rsa</literal>
2581 * tool to convert PKCS#8 keys to PKCS#1.
2588 * GTlsClientConnection:
2590 * Abstract base class for the backend-specific client connection
2598 * GTlsClientConnection:accepted-cas:
2600 * A list of the distinguished names of the Certificate Authorities
2601 * that the server will accept client certificates signed by. If the
2602 * server requests a client certificate during the handshake, then
2603 * this property will be set after the handshake completes.
2605 * Each item in the list is a #GByteArray which contains the complete
2606 * subject DN of the certificate authority.
2613 * GTlsClientConnection:server-identity:
2615 * A #GSocketConnectable describing the identity of the server that
2616 * is expected on the other end of the connection.
2618 * If the %G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in
2619 * #GTlsClientConnection:validation-flags, this object will be used
2620 * to determine the expected identify of the remote end of the
2621 * connection; if #GTlsClientConnection:server-identity is not set,
2622 * or does not match the identity presented by the server, then the
2623 * %G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail.
2625 * In addition to its use in verifying the server certificate,
2626 * this is also used to give a hint to the server about what
2627 * certificate we expect, which is useful for servers that serve
2635 * GTlsClientConnection:use-ssl3:
2637 * If %TRUE, tells the connection to use SSL 3.0 rather than trying
2638 * to negotiate the best version of TLS or SSL to use. This can be
2639 * used when talking to servers that don't implement version
2640 * negotiation correctly and therefore refuse to handshake at all with
2641 * a "modern" TLS handshake.
2648 * GTlsClientConnection:validation-flags:
2650 * What steps to perform when validating a certificate received from
2651 * a server. Server certificates that fail to validate in all of the
2652 * ways indicated here will be rejected unless the application
2653 * overrides the default via #GTlsConnection::accept-certificate.
2662 * Abstract base class for the backend-specific #GTlsClientConnection
2663 * and #GTlsServerConnection types.
2670 * GTlsConnection::accept-certificate:
2671 * @conn: a #GTlsConnection
2672 * @peer_cert: the peer's #GTlsCertificate
2673 * @errors: the problems with @peer_cert.
2675 * Emitted during the TLS handshake after the peer certificate has
2676 * been received. You can examine @peer_cert's certification path by
2677 * calling g_tls_certificate_get_issuer() on it.
2679 * For a client-side connection, @peer_cert is the server's
2680 * certificate, and the signal will only be emitted if the
2681 * certificate was not acceptable according to @conn's
2682 * #GTlsClientConnection:validation_flags. If you would like the
2683 * certificate to be accepted despite @errors, return %TRUE from the
2684 * signal handler. Otherwise, if no handler accepts the certificate,
2685 * the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE.
2687 * For a server-side connection, @peer_cert is the certificate
2688 * presented by the client, if this was requested via the server's
2689 * #GTlsServerConnection:authentication_mode. On the server side,
2690 * the signal is always emitted when the client presents a
2691 * certificate, and the certificate will only be accepted if a
2692 * handler returns %TRUE.
2694 * Note that if this signal is emitted as part of asynchronous I/O
2695 * in the main thread, then you should not attempt to interact with
2696 * the user before returning from the signal handler. If you want to
2697 * let the user decide whether or not to accept the certificate, you
2698 * would have to return %FALSE from the signal handler on the first
2699 * attempt, and then after the connection attempt returns a
2700 * %G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if
2701 * the user decides to accept the certificate, remember that fact,
2702 * create a new connection, and return %TRUE from the signal handler
2705 * If you are doing I/O in another thread, you do not
2706 * need to worry about this, and can simply block in the signal
2707 * handler until the UI thread returns an answer.
2709 * Returns: %TRUE to accept @peer_cert (which will also immediately end the signal emission). %FALSE to allow the signal emission to continue, which will cause the handshake to fail if no one else overrides it.
2715 * GTlsConnection:base-io-stream:
2717 * The #GIOStream that the connection wraps
2724 * GTlsConnection:certificate:
2726 * The connection's certificate; see
2727 * g_tls_connection_set_certificate().
2734 * GTlsConnection:database:
2736 * The certificate database to use when verifying this TLS connection.
2737 * If no cerificate database is set, then the default database will be
2738 * used. See g_tls_backend_get_default_database().
2745 * GTlsConnection:interaction:
2747 * A #GTlsInteraction object to be used when the connection or certificate
2748 * database need to interact with the user. This will be used to prompt the
2749 * user for passwords where necessary.
2756 * GTlsConnection:peer-certificate:
2758 * The connection's peer's certificate, after the TLS handshake has
2759 * completed and the certificate has been accepted. Note in
2760 * particular that this is not yet set during the emission of
2761 * #GTlsConnection::accept-certificate.
2763 * (You can watch for a #GObject::notify signal on this property to
2764 * detect when a handshake has occurred.)
2771 * GTlsConnection:peer-certificate-errors:
2773 * The errors noticed-and-ignored while verifying
2774 * #GTlsConnection:peer-certificate. Normally this should be 0, but
2775 * it may not be if #GTlsClientConnection:validation-flags is not
2776 * %G_TLS_CERTIFICATE_VALIDATE_ALL, or if
2777 * #GTlsConnection::accept-certificate overrode the default
2785 * GTlsConnection:rehandshake-mode:
2787 * The rehandshaking mode. See
2788 * g_tls_connection_set_rehandshake_mode().
2795 * GTlsConnection:require-close-notify:
2797 * Whether or not proper TLS close notification is required.
2798 * See g_tls_connection_set_require_close_notify().
2805 * GTlsConnection:use-system-certdb:
2807 * Whether or not the system certificate database will be used to
2808 * verify peer certificates. See
2809 * g_tls_connection_set_use_system_certdb().
2811 * Deprecated: 2.30: Use GTlsConnection:database instead
2818 * Abstract base class for the backend-specific database types.
2827 * Implemented by a #GTlsDatabase which allows you to load certificates
2835 * GTlsFileDatabase:anchors:
2837 * The path to a file containing PEM encoded certificate authority
2838 * root anchors. The certificates in this file will be treated as
2839 * root authorities for the purpose of verifying other certificates
2840 * via the g_tls_database_verify_chain() operation.
2849 * An object representing interaction that the TLS connection and database
2850 * might have with the user.
2857 * GTlsInteractionClass:
2858 * @ask_password: ask for a password synchronously. If the implementation returns %G_TLS_INTERACTION_HANDLED, then the password argument should have been filled in by using g_tls_password_set_value() or a similar function.
2859 * @ask_password_async: ask for a password asynchronously.
2860 * @ask_password_finish: complete operation to ask for a password asynchronously. If the implementation returns %G_TLS_INTERACTION_HANDLED, then the password argument of the async method should have been filled in by using g_tls_password_set_value() or a similar function.
2862 * The class for #GTlsInteraction. Derived classes implement the various
2863 * virtual interaction methods to handle TLS interactions.
2865 * Derived classes can choose to implement whichever interactions methods they'd
2866 * like to support by overriding those virtual methods in their class
2867 * initialization function. If a derived class implements an async method,
2868 * it must also implement the corresponding finish method.
2870 * The synchronous interaction methods should implement to display modal dialogs,
2871 * and the asynchronous methods to display modeless dialogs.
2873 * If the user cancels an interaction, then the result should be
2874 * %G_TLS_INTERACTION_FAILED and the error should be set with a domain of
2875 * %G_IO_ERROR and code of %G_IO_ERROR_CANCELLED.
2884 * An abstract interface representing a password used in TLS. Often used in
2885 * user interaction such as unlocking a key storage token.
2892 * GTlsServerConnection:authentication-mode:
2894 * The #GTlsAuthenticationMode for the server. This can be changed
2895 * before calling g_tls_connection_handshake() if you want to
2896 * rehandshake with a different mode from the initial handshake.
2903 * GUnixCredentialsMessage:credentials:
2905 * The credentials stored in the message.
2912 * GUnixInputStream:close-fd:
2914 * Whether to close the file descriptor when the stream is closed.
2921 * GUnixInputStream:fd:
2923 * The file descriptor that the stream reads from.
2930 * GUnixMountMonitor::mountpoints-changed:
2931 * @monitor: the object on which the signal is emitted
2933 * Emitted when the unix mount points have changed.
2938 * GUnixMountMonitor::mounts-changed:
2939 * @monitor: the object on which the signal is emitted
2941 * Emitted when the unix mounts have changed.
2946 * GUnixOutputStream:close-fd:
2948 * Whether to close the file descriptor when the stream is closed.
2955 * GUnixOutputStream:fd:
2957 * The file descriptor that the stream writes to.
2964 * GUnixSocketAddress:
2966 * A UNIX-domain (local) socket address, corresponding to a
2967 * <type>struct sockaddr_un</type>.
2972 * GUnixSocketAddress:abstract:
2974 * Whether or not this is an abstract address
2976 * Deprecated: Use #GUnixSocketAddress:address-type, which distinguishes between zero-padded and non-zero-padded abstract addresses.
2983 * Emitted when the volume has been changed.
2990 * This signal is emitted when the #GVolume have been removed. If
2991 * the recipient is holding references to the object they should
2992 * release them so the object can be finalized.
2997 * GVolumeMonitor::drive-changed:
2998 * @volume_monitor: The volume monitor emitting the signal.
2999 * @drive: the drive that changed
3001 * Emitted when a drive changes.
3006 * GVolumeMonitor::drive-connected:
3007 * @volume_monitor: The volume monitor emitting the signal.
3008 * @drive: a #GDrive that was connected.
3010 * Emitted when a drive is connected to the system.
3015 * GVolumeMonitor::drive-disconnected:
3016 * @volume_monitor: The volume monitor emitting the signal.
3017 * @drive: a #GDrive that was disconnected.
3019 * Emitted when a drive is disconnected from the system.
3024 * GVolumeMonitor::drive-eject-button:
3025 * @volume_monitor: The volume monitor emitting the signal.
3026 * @drive: the drive where the eject button was pressed
3028 * Emitted when the eject button is pressed on @drive.
3035 * GVolumeMonitor::drive-stop-button:
3036 * @volume_monitor: The volume monitor emitting the signal.
3037 * @drive: the drive where the stop button was pressed
3039 * Emitted when the stop button is pressed on @drive.
3046 * GVolumeMonitor::mount-added:
3047 * @volume_monitor: The volume monitor emitting the signal.
3048 * @mount: a #GMount that was added.
3050 * Emitted when a mount is added.
3055 * GVolumeMonitor::mount-changed:
3056 * @volume_monitor: The volume monitor emitting the signal.
3057 * @mount: a #GMount that changed.
3059 * Emitted when a mount changes.
3064 * GVolumeMonitor::mount-pre-unmount:
3065 * @volume_monitor: The volume monitor emitting the signal.
3066 * @mount: a #GMount that is being unmounted.
3068 * Emitted when a mount is about to be removed.
3073 * GVolumeMonitor::mount-removed:
3074 * @volume_monitor: The volume monitor emitting the signal.
3075 * @mount: a #GMount that was removed.
3077 * Emitted when a mount is removed.
3082 * GVolumeMonitor::volume-added:
3083 * @volume_monitor: The volume monitor emitting the signal.
3084 * @volume: a #GVolume that was added.
3086 * Emitted when a mountable volume is added to the system.
3091 * GVolumeMonitor::volume-changed:
3092 * @volume_monitor: The volume monitor emitting the signal.
3093 * @volume: a #GVolume that changed.
3095 * Emitted when mountable volume is changed.
3100 * GVolumeMonitor::volume-removed:
3101 * @volume_monitor: The volume monitor emitting the signal.
3102 * @volume: a #GVolume that was removed.
3104 * Emitted when a mountable volume is removed from the system.
3109 * GWin32InputStream:close-handle:
3111 * Whether to close the file handle when the stream is closed.
3118 * GWin32InputStream:handle:
3120 * The handle that the stream reads from.
3127 * GWin32OutputStream:close-handle:
3129 * Whether to close the file handle when the stream is closed.
3136 * GWin32OutputStream:handle:
3138 * The file handle that the stream writes to.
3147 * Zlib decompression
3152 * GZlibCompressor:file-info:
3154 * If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is
3155 * %G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name
3156 * and modification time from the file info to the GZIP header.
3163 * GZlibDecompressor:
3165 * Zlib decompression
3170 * GZlibDecompressor:file-info:
3172 * A #GFileInfo containing the information found in the GZIP header
3173 * of the data stream processed, or %NULL if the header was not yet
3174 * fully processed, is not present at all, or the compressor's
3175 * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP.
3182 * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT:
3184 * The purpose used to verify the client certificate in a TLS connection.
3185 * Used by TLS servers.
3190 * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER:
3192 * The purpose used to verify the server certificate in a TLS connection. This
3193 * is the most common purpose in use. Used by TLS clients.
3198 * G_TYPE_SETTINGS_SCHEMA:
3200 * A boxed #GType corresponding to #GSettingsSchema.
3207 * G_TYPE_SETTINGS_SCHEMA_SOURCE:
3209 * A boxed #GType corresponding to #GSettingsSchemaSource.
3216 * SECTION:_GFreedesktopDBus
3217 * @title: _GFreedesktopDBus
3218 * @short_description: Generated C code for the org.freedesktop.DBus D-Bus interface
3220 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link> D-Bus interface in C.
3225 * SECTION:extensionpoints
3226 * @short_description: Extension Points
3228 * @see_also: <link linkend="extending-gio">Extending GIO</link>
3230 * #GIOExtensionPoint provides a mechanism for modules to extend the
3231 * functionality of the library or application that loaded it in an
3232 * organized fashion.
3234 * An extension point is identified by a name, and it may optionally
3235 * require that any implementation must by of a certain type (or derived
3236 * thereof). Use g_io_extension_point_register() to register an
3237 * extension point, and g_io_extension_point_set_required_type() to
3238 * set a required type.
3240 * A module can implement an extension point by specifying the #GType
3241 * that implements the functionality. Additionally, each implementation
3242 * of an extension point has a name, and a priority. Use
3243 * g_io_extension_point_implement() to implement an extension point.
3246 * GIOExtensionPoint *ep;
3248 * /* Register an extension point */
3249 * ep = g_io_extension_point_register ("my-extension-point");
3250 * g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE);
3254 * /* Implement an extension point */
3255 * G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
3256 * g_io_extension_point_implement ("my-extension-point",
3257 * my_example_impl_get_type (),
3262 * It is up to the code that registered the extension point how
3263 * it uses the implementations that have been associated with it.
3264 * Depending on the use case, it may use all implementations, or
3265 * only the one with the highest priority, or pick a specific
3268 * To avoid opening all modules just to find out what extension
3269 * points they implement, GIO makes use of a caching mechanism,
3270 * see <link linkend="gio-querymodules">gio-querymodules</link>.
3271 * You are expected to run this command after installing a
3274 * The <envar>GIO_EXTRA_MODULES</envar> environment variable can be
3275 * used to specify additional directories to automatically load modules
3276 * from. This environment variable has the same syntax as the
3277 * <envar>PATH</envar>. If two modules have the same base name in different
3278 * directories, then the latter one will be ignored. If additional
3279 * directories are specified GIO will load modules from the built-in
3287 * @short_description: An action interface
3289 * #GAction represents a single named action.
3291 * The main interface to an action is that it can be activated with
3292 * g_action_activate(). This results in the 'activate' signal being
3293 * emitted. An activation has a #GVariant parameter (which may be
3294 * %NULL). The correct type for the parameter is determined by a static
3295 * parameter type (which is given at construction time).
3297 * An action may optionally have a state, in which case the state may be
3298 * set with g_action_change_state(). This call takes a #GVariant. The
3299 * correct type for the state is determined by a static state type
3300 * (which is given at construction time).
3302 * The state may have a hint associated with it, specifying its valid
3305 * #GAction is merely the interface to the concept of an action, as
3306 * described above. Various implementations of actions exist, including
3307 * #GSimpleAction and #GtkAction.
3309 * In all cases, the implementing class is responsible for storing the
3310 * name of the action, the parameter type, the enabled state, the
3311 * optional state type and the state and emitting the appropriate
3312 * signals when these change. The implementor responsible for filtering
3313 * calls to g_action_activate() and g_action_change_state() for type
3314 * safety and for the state being enabled.
3316 * Probably the only useful thing to do with a #GAction is to put it
3317 * inside of a #GSimpleActionGroup.
3322 * SECTION:gactiongroup
3323 * @title: GActionGroup
3324 * @short_description: A group of actions
3325 * @see_also: #GAction
3327 * #GActionGroup represents a group of actions. Actions can be used to
3328 * expose functionality in a structured way, either from one part of a
3329 * program to another, or to the outside world. Action groups are often
3330 * used together with a #GMenuModel that provides additional
3331 * representation data for displaying the actions to the user, e.g. in
3334 * The main way to interact with the actions in a GActionGroup is to
3335 * activate them with g_action_group_activate_action(). Activating an
3336 * action may require a #GVariant parameter. The required type of the
3337 * parameter can be inquired with g_action_group_get_action_parameter_type().
3338 * Actions may be disabled, see g_action_group_get_action_enabled().
3339 * Activating a disabled action has no effect.
3341 * Actions may optionally have a state in the form of a #GVariant. The
3342 * current state of an action can be inquired with
3343 * g_action_group_get_action_state(). Activating a stateful action may
3344 * change its state, but it is also possible to set the state by calling
3345 * g_action_group_change_action_state().
3347 * As typical example, consider a text editing application which has an
3348 * option to change the current font to 'bold'. A good way to represent
3349 * this would be a stateful action, with a boolean state. Activating the
3350 * action would toggle the state.
3352 * Each action in the group has a unique name (which is a string). All
3353 * method calls, except g_action_group_list_actions() take the name of
3354 * an action as an argument.
3356 * The #GActionGroup API is meant to be the 'public' API to the action
3357 * group. The calls here are exactly the interaction that 'external
3358 * forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have
3359 * with actions. 'Internal' APIs (ie: ones meant only to be accessed by
3360 * the action group implementation) are found on subclasses. This is
3361 * why you will find - for example - g_action_group_get_action_enabled()
3362 * but not an equivalent <function>set()</function> call.
3364 * Signals are emitted on the action group in response to state changes
3365 * on individual actions.
3367 * Implementations of #GActionGroup should provide implementations for
3368 * the virtual functions g_action_group_list_actions() and
3369 * g_action_group_query_action(). The other virtual functions should
3370 * not be implemented - their "wrappers" are actually implemented with
3371 * calls to g_action_group_query_action().
3376 * SECTION:gactiongroupexporter
3377 * @title: GActionGroup exporter
3378 * @short_description: Export GActionGroups on D-Bus
3379 * @see_also: #GActionGroup, #GDBusActionGroup
3381 * These functions support exporting a #GActionGroup on D-Bus.
3382 * The D-Bus interface that is used is a private implementation
3385 * To access an exported #GActionGroup remotely, use
3386 * g_dbus_action_group_get() to obtain a #GDBusActionGroup.
3391 * SECTION:gactionmap
3392 * @title: GActionMap
3393 * @short_description: Interface for action containers
3395 * The GActionMap interface is implemented by #GActionGroup
3396 * implementations that operate by containing a number of
3397 * named #GAction instances, such as #GSimpleActionGroup.
3399 * One useful application of this interface is to map the
3400 * names of actions from various action groups to unique,
3401 * prefixed names (e.g. by prepending "app." or "win.").
3402 * This is the motivation for the 'Map' part of the interface
3411 * @short_description: Application information and launch contexts
3412 * @include: gio/gio.h
3414 * #GAppInfo and #GAppLaunchContext are used for describing and launching
3415 * applications installed on the system.
3417 * As of GLib 2.20, URIs will always be converted to POSIX paths
3418 * (using g_file_get_path()) when using g_app_info_launch() even if
3419 * the application requested an URI and not a POSIX path. For example
3420 * for an desktop-file based application with Exec key <literal>totem
3421 * %U</literal> and a single URI,
3422 * <literal>sftp://foo/file.avi</literal>, then
3423 * <literal>/home/user/.gvfs/sftp on foo/file.avi</literal> will be
3424 * passed. This will only work if a set of suitable GIO extensions
3425 * (such as gvfs 2.26 compiled with FUSE support), is available and
3426 * operational; if this is not the case, the URI will be passed
3427 * unmodified to the application. Some URIs, such as
3428 * <literal>mailto:</literal>, of course cannot be mapped to a POSIX
3429 * path (in gvfs there's no FUSE mount for it); such URIs will be
3430 * passed unmodified to the application.
3432 * Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
3433 * back to the GIO URI in the #GFile constructors (since gvfs
3434 * implements the #GVfs extension point). As such, if the application
3435 * needs to examine the URI, it needs to use g_file_get_uri() or
3436 * similar on #GFile. In other words, an application cannot assume
3437 * that the URI passed to e.g. g_file_new_for_commandline_arg() is
3438 * equal to the result of g_file_get_uri(). The following snippet
3445 * file = g_file_new_for_commandline_arg (uri_from_commandline);
3447 * uri = g_file_get_uri (file);
3448 * strcmp (uri, uri_from_commandline) == 0; // FALSE
3451 * if (g_file_has_uri_scheme (file, "cdda"))
3453 * // do something special with uri
3455 * g_object_unref (file);
3458 * This code will work when both <literal>cdda://sr0/Track
3459 * 1.wav</literal> and <literal>/home/user/.gvfs/cdda on sr0/Track
3460 * 1.wav</literal> is passed to the application. It should be noted
3461 * that it's generally not safe for applications to rely on the format
3462 * of a particular URIs. Different launcher applications (e.g. file
3463 * managers) may have different ideas of what a given URI means.
3468 * SECTION:gapplication
3469 * @title: GApplication
3470 * @short_description: Core application class
3472 * A #GApplication is the foundation of an application. It wraps some
3473 * low-level platform-specific services and is intended to act as the
3474 * foundation for higher-level application classes such as
3475 * #GtkApplication or #MxApplication. In general, you should not use
3476 * this class outside of a higher level framework.
3478 * GApplication provides convenient life cycle management by maintaining
3479 * a <firstterm>use count</firstterm> for the primary application instance.
3480 * The use count can be changed using g_application_hold() and
3481 * g_application_release(). If it drops to zero, the application exits.
3482 * Higher-level classes such as #GtkApplication employ the use count to
3483 * ensure that the application stays alive as long as it has any opened
3486 * Another feature that GApplication (optionally) provides is process
3487 * uniqueness. Applications can make use of this functionality by
3488 * providing a unique application ID. If given, only one application
3489 * with this ID can be running at a time per session. The session
3490 * concept is platform-dependent, but corresponds roughly to a graphical
3491 * desktop login. When your application is launched again, its
3492 * arguments are passed through platform communication to the already
3493 * running program. The already running instance of the program is
3494 * called the <firstterm>primary instance</firstterm>; for non-unique
3495 * applications this is the always the current instance.
3496 * On Linux, the D-Bus session bus is used for communication.
3498 * The use of #GApplication differs from some other commonly-used
3499 * uniqueness libraries (such as libunique) in important ways. The
3500 * application is not expected to manually register itself and check if
3501 * it is the primary instance. Instead, the <code>main()</code>
3502 * function of a #GApplication should do very little more than
3503 * instantiating the application instance, possibly connecting signal
3504 * handlers, then calling g_application_run(). All checks for
3505 * uniqueness are done internally. If the application is the primary
3506 * instance then the startup signal is emitted and the mainloop runs.
3507 * If the application is not the primary instance then a signal is sent
3508 * to the primary instance and g_application_run() promptly returns.
3509 * See the code examples below.
3511 * If used, the expected form of an application identifier is very close
3513 * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface">DBus bus name</ulink>.
3514 * Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator".
3515 * For details on valid application identifiers, see g_application_id_is_valid().
3517 * On Linux, the application identifier is claimed as a well-known bus name
3518 * on the user's session bus. This means that the uniqueness of your
3519 * application is scoped to the current session. It also means that your
3520 * application may provide additional services (through registration of other
3521 * object paths) at that bus name. The registration of these object paths
3522 * should be done with the shared GDBus session bus. Note that due to the
3523 * internal architecture of GDBus, method calls can be dispatched at any time
3524 * (even if a main loop is not running). For this reason, you must ensure that
3525 * any object paths that you wish to register are registered before #GApplication
3526 * attempts to acquire the bus name of your application (which happens in
3527 * g_application_register()). Unfortunately, this means that you cannot use
3528 * g_application_get_is_remote() to decide if you want to register object paths.
3530 * GApplication also implements the #GActionGroup and #GActionMap
3531 * interfaces and lets you easily export actions by adding them with
3532 * g_action_map_add_action(). When invoking an action by calling
3533 * g_action_group_activate_action() on the application, it is always
3534 * invoked in the primary instance. The actions are also exported on
3535 * the session bus, and GIO provides the #GDBusActionGroup wrapper to
3536 * conveniently access them remotely. GIO provides a #GDBusMenuModel wrapper
3537 * for remote access to exported #GMenuModels.
3539 * There is a number of different entry points into a GApplication:
3541 * <listitem>via 'Activate' (i.e. just starting the application)</listitem>
3542 * <listitem>via 'Open' (i.e. opening some files)</listitem>
3543 * <listitem>by handling a command-line</listitem>
3544 * <listitem>via activating an action</listitem>
3546 * The #GApplication::startup signal lets you handle the application
3547 * initialization for all of these in a single place.
3549 * Regardless of which of these entry points is used to start the application,
3550 * GApplication passes some <firstterm id="platform-data">platform
3551 * data</firstterm> from the launching instance to the primary instance,
3552 * in the form of a #GVariant dictionary mapping strings to variants.
3553 * To use platform data, override the @before_emit or @after_emit virtual
3554 * functions in your #GApplication subclass. When dealing with
3555 * #GApplicationCommandLine objects, the platform data is directly
3556 * available via g_application_command_line_get_cwd(),
3557 * g_application_command_line_get_environ() and
3558 * g_application_command_line_get_platform_data().
3560 * As the name indicates, the platform data may vary depending on the
3561 * operating system, but it always includes the current directory (key
3562 * "cwd"), and optionally the environment (ie the set of environment
3563 * variables and their values) of the calling process (key "environ").
3564 * The environment is only added to the platform data if the
3565 * %G_APPLICATION_SEND_ENVIRONMENT flag is set. #GApplication subclasses
3566 * can add their own platform data by overriding the @add_platform_data
3567 * virtual function. For instance, #GtkApplication adds startup notification
3570 * To parse commandline arguments you may handle the
3571 * #GApplication::command-line signal or override the local_command_line()
3572 * vfunc, to parse them in either the primary instance or the local instance,
3575 * <example id="gapplication-example-open"><title>Opening files with a GApplication</title>
3577 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-open.c">
3578 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3583 * <example id="gapplication-example-actions"><title>A GApplication with actions</title>
3585 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-actions.c">
3586 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3591 * <example id="gapplication-example-menu"><title>A GApplication with menus</title>
3593 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-menu.c">
3594 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3599 * <example id="gapplication-example-dbushooks"><title>Using extra D-Bus hooks with a GApplication</title>
3601 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-dbushooks.c">
3602 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3610 * SECTION:gapplicationcommandline
3611 * @title: GApplicationCommandLine
3612 * @short_description: A command-line invocation of an application
3613 * @see_also: #GApplication
3615 * #GApplicationCommandLine represents a command-line invocation of
3616 * an application. It is created by #GApplication and emitted
3617 * in the #GApplication::command-line signal and virtual function.
3619 * The class contains the list of arguments that the program was invoked
3620 * with. It is also possible to query if the commandline invocation was
3621 * local (ie: the current process is running in direct response to the
3622 * invocation) or remote (ie: some other process forwarded the
3623 * commandline to this process).
3625 * The GApplicationCommandLine object can provide the @argc and @argv
3626 * parameters for use with the #GOptionContext command-line parsing API,
3627 * with the g_application_command_line_get_arguments() function. See
3628 * <xref linkend="gapplication-example-cmdline3"/> for an example.
3630 * The exit status of the originally-invoked process may be set and
3631 * messages can be printed to stdout or stderr of that process. The
3632 * lifecycle of the originally-invoked process is tied to the lifecycle
3633 * of this object (ie: the process exits when the last reference is
3636 * The main use for #GApplicationCommandLine (and the
3637 * #GApplication::command-line signal) is 'Emacs server' like use cases:
3638 * You can set the <envar>EDITOR</envar> environment variable to have
3639 * e.g. git use your favourite editor to edit commit messages, and if you
3640 * already have an instance of the editor running, the editing will happen
3641 * in the running instance, instead of opening a new one. An important
3642 * aspect of this use case is that the process that gets started by git
3643 * does not return until the editing is done.
3645 * <example id="gapplication-example-cmdline"><title>Handling commandline arguments with GApplication</title>
3647 * A simple example where the commandline is completely handled
3648 * in the #GApplication::command-line handler. The launching instance exits
3649 * once the signal handler in the primary instance has returned, and the
3650 * return value of the signal handler becomes the exit status of the launching
3654 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline.c">
3655 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3660 * <example id="gapplication-example-cmdline2"><title>Split commandline handling</title>
3662 * An example of split commandline handling. Options that start with
3663 * <literal>--local-</literal> are handled locally, all other options are
3664 * passed to the #GApplication::command-line handler which runs in the primary
3668 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline2.c">
3669 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3674 * <example id="gapplication-example-cmdline3"><title>Deferred commandline handling</title>
3676 * An example of deferred commandline handling. Here, the commandline is
3677 * not completely handled before the #GApplication::command-line handler
3678 * returns. Instead, we keep a reference to the GApplicationCommandLine
3679 * object and handle it later(in this example, in an idle). Note that it
3680 * is necessary to hold the application until you are done with the
3684 * This example also shows how to use #GOptionContext for parsing the
3685 * commandline arguments. Note that it is necessary to disable the
3686 * built-in help-handling of #GOptionContext, since it calls exit()
3687 * after printing help, which is not what you want to happen in
3688 * the primary instance.
3691 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline3.c">
3692 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3700 * SECTION:gasyncinitable
3701 * @short_description: Asynchronously failable object initialization interface
3702 * @include: gio/gio.h
3703 * @see_also: #GInitable
3705 * This is the asynchronous version of #GInitable; it behaves the same
3706 * in all ways except that initialization is asynchronous. For more details
3707 * see the descriptions on #GInitable.
3709 * A class may implement both the #GInitable and #GAsyncInitable interfaces.
3711 * Users of objects implementing this are not intended to use the interface
3712 * method directly; instead it will be used automatically in various ways.
3713 * For C applications you generally just call g_async_initable_new_async()
3714 * directly, or indirectly via a foo_thing_new_async() wrapper. This will call
3715 * g_async_initable_init_async() under the cover, calling back with %NULL and
3716 * a set %GError on failure.
3718 * A typical implementation might look something like this:
3728 * _foo_ready_cb (Foo *self)
3732 * self->priv->state = INITIALIZED;
3734 * for (l = self->priv->init_results; l != NULL; l = l->next)
3736 * GTask *task = l->data;
3738 * if (self->priv->success)
3739 * g_task_return_boolean (task, TRUE);
3741 * g_task_return_new_error (task, ...);
3742 * g_object_unref (task);
3745 * g_list_free (self->priv->init_results);
3746 * self->priv->init_results = NULL;
3750 * foo_init_async (GAsyncInitable *initable,
3752 * GCancellable *cancellable,
3753 * GAsyncReadyCallback callback,
3754 * gpointer user_data)
3756 * Foo *self = FOO (initable);
3759 * task = g_task_new (initable, cancellable, callback, user_data);
3761 * switch (self->priv->state)
3763 * case NOT_INITIALIZED:
3764 * _foo_get_ready (self);
3765 * self->priv->init_results = g_list_append (self->priv->init_results,
3767 * self->priv->state = INITIALIZING;
3769 * case INITIALIZING:
3770 * self->priv->init_results = g_list_append (self->priv->init_results,
3774 * if (!self->priv->success)
3775 * g_task_return_new_error (task, ...);
3777 * g_task_return_boolean (task, TRUE);
3778 * g_object_unref (task);
3784 * foo_init_finish (GAsyncInitable *initable,
3785 * GAsyncResult *result,
3788 * g_return_val_if_fail (g_task_is_valid (result, initable), FALSE);
3790 * return g_task_propagate_boolean (G_TASK (result), error);
3794 * foo_async_initable_iface_init (gpointer g_iface,
3797 * GAsyncInitableIface *iface = g_iface;
3799 * iface->init_async = foo_init_async;
3800 * iface->init_finish = foo_init_finish;
3807 * SECTION:gasyncresult
3808 * @short_description: Asynchronous Function Results
3809 * @include: gio/gio.h
3812 * Provides a base class for implementing asynchronous function results.
3814 * Asynchronous operations are broken up into two separate operations
3815 * which are chained together by a #GAsyncReadyCallback. To begin
3816 * an asynchronous operation, provide a #GAsyncReadyCallback to the
3817 * asynchronous function. This callback will be triggered when the
3818 * operation has completed, and will be passed a #GAsyncResult instance
3819 * filled with the details of the operation's success or failure, the
3820 * object the asynchronous function was started for and any error codes
3821 * returned. The asynchronous callback function is then expected to call
3822 * the corresponding "_finish()" function, passing the object the
3823 * function was called for, the #GAsyncResult instance, and (optionally)
3824 * an @error to grab any error conditions that may have occurred.
3826 * The "_finish()" function for an operation takes the generic result
3827 * (of type #GAsyncResult) and returns the specific result that the
3828 * operation in question yields (e.g. a #GFileEnumerator for a
3829 * "enumerate children" operation). If the result or error status of the
3830 * operation is not needed, there is no need to call the "_finish()"
3831 * function; GIO will take care of cleaning up the result and error
3832 * information after the #GAsyncReadyCallback returns. You can pass
3833 * %NULL for the #GAsyncReadyCallback if you don't need to take any
3834 * action at all after the operation completes. Applications may also
3835 * take a reference to the #GAsyncResult and call "_finish()" later;
3836 * however, the "_finish()" function may be called at most once.
3838 * Example of a typical asynchronous operation flow:
3840 * void _theoretical_frobnitz_async (Theoretical *t,
3842 * GAsyncReadyCallback *cb,
3845 * gboolean _theoretical_frobnitz_finish (Theoretical *t,
3846 * GAsyncResult *res,
3850 * frobnitz_result_func (GObject *source_object,
3851 * GAsyncResult *res,
3852 * gpointer user_data)
3854 * gboolean success = FALSE;
3856 * success = _theoretical_frobnitz_finish (source_object, res, NULL);
3859 * g_printf ("Hurray!\n");
3861 * g_printf ("Uh oh!\n");
3863 * /<!-- -->* ... *<!-- -->/
3867 * int main (int argc, void *argv[])
3869 * /<!-- -->* ... *<!-- -->/
3871 * _theoretical_frobnitz_async (theoretical_data,
3873 * frobnitz_result_func,
3876 * /<!-- -->* ... *<!-- -->/
3880 * The callback for an asynchronous operation is called only once, and is
3881 * always called, even in the case of a cancelled operation. On cancellation
3882 * the result is a %G_IO_ERROR_CANCELLED error.
3884 * <para id="io-priority"><indexterm><primary>I/O
3885 * priority</primary></indexterm> Many I/O-related asynchronous
3886 * operations have a priority parameter, which is used in certain
3887 * cases to determine the order in which operations are executed. They
3888 * are <emphasis>not</emphasis> used to determine system-wide I/O
3889 * scheduling. Priorities are integers, with lower numbers indicating
3890 * higher priority. It is recommended to choose priorities between
3891 * %G_PRIORITY_LOW and %G_PRIORITY_HIGH, with %G_PRIORITY_DEFAULT as a
3897 * SECTION:gbufferedinputstream
3898 * @short_description: Buffered Input Stream
3899 * @include: gio/gio.h
3900 * @see_also: #GFilterInputStream, #GInputStream
3902 * Buffered input stream implements #GFilterInputStream and provides
3903 * for buffered reads.
3905 * By default, #GBufferedInputStream's buffer size is set at 4 kilobytes.
3907 * To create a buffered input stream, use g_buffered_input_stream_new(),
3908 * or g_buffered_input_stream_new_sized() to specify the buffer's size at
3911 * To get the size of a buffer within a buffered input stream, use
3912 * g_buffered_input_stream_get_buffer_size(). To change the size of a
3913 * buffered input stream's buffer, use
3914 * g_buffered_input_stream_set_buffer_size(). Note that the buffer's size
3915 * cannot be reduced below the size of the data within the buffer.
3920 * SECTION:gbufferedoutputstream
3921 * @short_description: Buffered Output Stream
3922 * @include: gio/gio.h
3923 * @see_also: #GFilterOutputStream, #GOutputStream
3925 * Buffered output stream implements #GFilterOutputStream and provides
3926 * for buffered writes.
3928 * By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.
3930 * To create a buffered output stream, use g_buffered_output_stream_new(),
3931 * or g_buffered_output_stream_new_sized() to specify the buffer's size
3934 * To get the size of a buffer within a buffered input stream, use
3935 * g_buffered_output_stream_get_buffer_size(). To change the size of a
3936 * buffered output stream's buffer, use
3937 * g_buffered_output_stream_set_buffer_size(). Note that the buffer's
3938 * size cannot be reduced below the size of the data within the buffer.
3943 * SECTION:gcancellable
3944 * @short_description: Thread-safe Operation Cancellation Stack
3945 * @include: gio/gio.h
3947 * GCancellable is a thread-safe operation cancellation stack used
3948 * throughout GIO to allow for cancellation of synchronous and
3949 * asynchronous operations.
3954 * SECTION:gcharsetconverter
3955 * @short_description: Convert between charsets
3956 * @include: gio/gio.h
3958 * #GCharsetConverter is an implementation of #GConverter based on
3964 * SECTION:gcontenttype
3965 * @short_description: Platform-specific content typing
3966 * @include: gio/gio.h
3968 * A content type is a platform specific string that defines the type
3969 * of a file. On UNIX it is a <ulink url="http://www.wikipedia.org/wiki/Internet_media_type">mime type</ulink> like "text/plain" or "image/png".
3970 * On Win32 it is an extension string like ".doc", ".txt" or a perceived
3971 * string like "audio". Such strings can be looked up in the registry at
3972 * HKEY_CLASSES_ROOT.
3977 * SECTION:gconverter
3978 * @short_description: Data conversion interface
3979 * @include: gio/gio.h
3980 * @see_also: #GInputStream, #GOutputStream
3982 * #GConverter is implemented by objects that convert
3983 * binary data in various ways. The conversion can be
3984 * stateful and may fail at any place.
3986 * Some example conversions are: character set conversion,
3987 * compression, decompression and regular expression
3995 * SECTION:gconverterinputstream
3996 * @short_description: Converter Input Stream
3997 * @include: gio/gio.h
3998 * @see_also: #GInputStream, #GConverter
4000 * Converter input stream implements #GInputStream and allows
4001 * conversion of data of various types during reading.
4003 * As of GLib 2.34, #GConverterInputStream implements
4004 * #GPollableInputStream.
4009 * SECTION:gconverteroutputstream
4010 * @short_description: Converter Output Stream
4011 * @include: gio/gio.h
4012 * @see_also: #GOutputStream, #GConverter
4014 * Converter output stream implements #GOutputStream and allows
4015 * conversion of data of various types during reading.
4017 * As of GLib 2.34, #GConverterOutputStream implements
4018 * #GPollableOutputStream.
4023 * SECTION:gcredentials
4024 * @short_description: An object containing credentials
4025 * @include: gio/gio.h
4027 * The #GCredentials type is a reference-counted wrapper for native
4028 * credentials. This information is typically used for identifying,
4029 * authenticating and authorizing other processes.
4031 * Some operating systems supports looking up the credentials of the
4032 * remote peer of a communication endpoint - see e.g.
4033 * g_socket_get_credentials().
4035 * Some operating systems supports securely sending and receiving
4036 * credentials over a Unix Domain Socket, see
4037 * #GUnixCredentialsMessage, g_unix_connection_send_credentials() and
4038 * g_unix_connection_receive_credentials() for details.
4040 * On Linux, the native credential type is a <type>struct ucred</type>
4042 * <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>
4043 * man page for details. This corresponds to
4044 * %G_CREDENTIALS_TYPE_LINUX_UCRED.
4046 * On FreeBSD, the native credential type is a <type>struct cmsgcred</type>.
4047 * This corresponds to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED.
4049 * On OpenBSD, the native credential type is a <type>struct sockpeercred</type>.
4050 * This corresponds to %G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED.
4055 * SECTION:gdatainputstream
4056 * @short_description: Data Input Stream
4057 * @include: gio/gio.h
4058 * @see_also: #GInputStream
4060 * Data input stream implements #GInputStream and includes functions for
4061 * reading structured data directly from a binary input stream.
4066 * SECTION:gdataoutputstream
4067 * @short_description: Data Output Stream
4068 * @include: gio/gio.h
4069 * @see_also: #GOutputStream
4071 * Data output stream implements #GOutputStream and includes functions for
4072 * writing data directly to an output stream.
4077 * SECTION:gdbusactiongroup
4078 * @title: GDBusActionGroup
4079 * @short_description: A D-Bus GActionGroup implementation
4080 * @see_also: <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
4082 * #GDBusActionGroup is an implementation of the #GActionGroup
4083 * interface that can be used as a proxy for an action group
4084 * that is exported over D-Bus with g_dbus_connection_export_action_group().
4089 * SECTION:gdbusaddress
4090 * @title: D-Bus Addresses
4091 * @short_description: D-Bus connection endpoints
4092 * @include: gio/gio.h
4094 * Routines for working with D-Bus addresses. A D-Bus address is a string
4095 * like "unix:tmpdir=/tmp/my-app-name". The exact format of addresses
4096 * is explained in detail in the <link linkend="http://dbus.freedesktop.org/doc/dbus-specification.html#addresses">D-Bus specification</link>.
4101 * SECTION:gdbusauthobserver
4102 * @short_description: Object used for authenticating connections
4103 * @include: gio/gio.h
4105 * The #GDBusAuthObserver type provides a mechanism for participating
4106 * in how a #GDBusServer (or a #GDBusConnection) authenticates remote
4107 * peers. Simply instantiate a #GDBusAuthObserver and connect to the
4108 * signals you are interested in. Note that new signals may be added
4111 * For example, if you only want to allow D-Bus connections from
4112 * processes owned by the same uid as the server, you would use a
4113 * signal handler like the following:
4114 * <example id="auth-observer"><title>Controlling Authentication</title><programlisting>
4116 * on_authorize_authenticated_peer (GDBusAuthObserver *observer,
4117 * GIOStream *stream,
4118 * GCredentials *credentials,
4119 * gpointer user_data)
4121 * gboolean authorized;
4123 * authorized = FALSE;
4124 * if (credentials != NULL)
4126 * GCredentials *own_credentials;
4127 * own_credentials = g_credentials_new ();
4128 * if (g_credentials_is_same_user (credentials, own_credentials, NULL))
4129 * authorized = TRUE;
4130 * g_object_unref (own_credentials);
4133 * return authorized;
4135 * </programlisting></example>
4140 * SECTION:gdbusconnection
4141 * @short_description: D-Bus Connections
4142 * @include: gio/gio.h
4144 * The #GDBusConnection type is used for D-Bus connections to remote
4145 * peers such as a message buses. It is a low-level API that offers a
4146 * lot of flexibility. For instance, it lets you establish a connection
4147 * over any transport that can by represented as an #GIOStream.
4149 * This class is rarely used directly in D-Bus clients. If you are writing
4150 * an D-Bus client, it is often easier to use the g_bus_own_name(),
4151 * g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs.
4153 * As an exception to the usual GLib rule that a particular object must not be
4154 * used by two threads at the same time, #GDBusConnection's methods may be
4155 * called from any thread<footnote>
4157 * This is so that g_bus_get() and g_bus_get_sync() can safely return the
4158 * same #GDBusConnection when called from any thread.
4162 * Most of the ways to obtain a #GDBusConnection automatically initialize it
4163 * (i.e. connect to D-Bus): for instance, g_dbus_connection_new() and
4164 * g_bus_get(), and the synchronous versions of those methods, give you an
4165 * initialized connection. Language bindings for GIO should use
4166 * g_initable_new() or g_async_initable_new_async(), which also initialize the
4169 * If you construct an uninitialized #GDBusConnection, such as via
4170 * g_object_new(), you must initialize it via g_initable_init() or
4171 * g_async_initable_init_async() before using its methods or properties.
4172 * Calling methods or accessing properties on a #GDBusConnection that has not
4173 * completed initialization successfully is considered to be invalid, and leads
4174 * to undefined behaviour. In particular, if initialization fails with a
4175 * #GError, the only valid thing you can do with that #GDBusConnection is to
4176 * free it with g_object_unref().
4178 * <example id="gdbus-server"><title>D-Bus server example</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-server.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4180 * <example id="gdbus-subtree-server"><title>D-Bus subtree example</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-subtree.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4182 * <example id="gdbus-unix-fd-client"><title>D-Bus UNIX File Descriptor example</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-unix-fd-client.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4184 * <example id="gdbus-export"><title>Exporting a GObject</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-export.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4189 * SECTION:gdbuserror
4190 * @title: GDBusError
4191 * @short_description: Mapping D-Bus errors to and from GError
4192 * @include: gio/gio.h
4194 * All facilities that return errors from remote methods (such as
4195 * g_dbus_connection_call_sync()) use #GError to represent both D-Bus
4196 * errors (e.g. errors returned from the other peer) and locally
4197 * in-process generated errors.
4199 * To check if a returned #GError is an error from a remote peer, use
4200 * g_dbus_error_is_remote_error(). To get the actual D-Bus error name,
4201 * use g_dbus_error_get_remote_error(). Before presenting an error,
4202 * always use g_dbus_error_strip_remote_error().
4204 * In addition, facilities used to return errors to a remote peer also
4205 * use #GError. See g_dbus_method_invocation_return_error() for
4206 * discussion about how the D-Bus error name is set.
4208 * Applications can associate a #GError error domain with a set of D-Bus errors in order to
4209 * automatically map from D-Bus errors to #GError and back. This
4210 * is typically done in the function returning the #GQuark for the
4212 * <example id="error-registration"><title>Error Registration</title><programlisting>
4213 * /<!-- -->* foo-bar-error.h: *<!-- -->/
4215 * #define FOO_BAR_ERROR (foo_bar_error_quark ())
4216 * GQuark foo_bar_error_quark (void);
4220 * FOO_BAR_ERROR_FAILED,
4221 * FOO_BAR_ERROR_ANOTHER_ERROR,
4222 * FOO_BAR_ERROR_SOME_THIRD_ERROR,
4223 * FOO_BAR_N_ERRORS /<!-- -->*< skip >*<!-- -->/
4226 * /<!-- -->* foo-bar-error.c: *<!-- -->/
4228 * static const GDBusErrorEntry foo_bar_error_entries[] =
4230 * {FOO_BAR_ERROR_FAILED, "org.project.Foo.Bar.Error.Failed"},
4231 * {FOO_BAR_ERROR_ANOTHER_ERROR, "org.project.Foo.Bar.Error.AnotherError"},
4232 * {FOO_BAR_ERROR_SOME_THIRD_ERROR, "org.project.Foo.Bar.Error.SomeThirdError"},
4235 * /<!-- -->* Ensure that every error code has an associated D-Bus error name *<!-- -->/
4236 * G_STATIC_ASSERT (G_N_ELEMENTS (foo_bar_error_entries) == FOO_BAR_N_ERRORS);
4239 * foo_bar_error_quark (void)
4241 * static volatile gsize quark_volatile = 0;
4242 * g_dbus_error_register_error_domain ("foo-bar-error-quark",
4244 * foo_bar_error_entries,
4245 * G_N_ELEMENTS (foo_bar_error_entries));
4246 * return (GQuark) quark_volatile;
4248 * </programlisting></example>
4249 * With this setup, a D-Bus peer can transparently pass e.g. %FOO_BAR_ERROR_ANOTHER_ERROR and
4250 * other peers will see the D-Bus error name <literal>org.project.Foo.Bar.Error.AnotherError</literal>.
4251 * If the other peer is using GDBus, the peer will see also %FOO_BAR_ERROR_ANOTHER_ERROR instead
4252 * of %G_IO_ERROR_DBUS_ERROR. Note that GDBus clients can still recover
4253 * <literal>org.project.Foo.Bar.Error.AnotherError</literal> using g_dbus_error_get_remote_error().
4255 * Note that errors in the %G_DBUS_ERROR error domain is intended only
4256 * for returning errors from a remote message bus process. Errors
4257 * generated locally in-process by e.g. #GDBusConnection is from the
4258 * %G_IO_ERROR domain.
4263 * SECTION:gdbusinterface
4264 * @short_description: Base type for D-Bus interfaces
4265 * @include: gio/gio.h
4267 * The #GDBusInterface type is the base type for D-Bus interfaces both
4268 * on the service side (see #GDBusInterfaceSkeleton) and client side
4269 * (see #GDBusProxy).
4274 * SECTION:gdbusinterfaceskeleton
4275 * @short_description: Service-side D-Bus interface
4276 * @include: gio/gio.h
4278 * Abstract base class for D-Bus interfaces on the service side.
4283 * SECTION:gdbusintrospection
4284 * @title: D-Bus Introspection Data
4285 * @short_description: Node and interface description data structures
4286 * @include: gio/gio.h
4288 * Various data structures and convenience routines to parse and
4289 * generate D-Bus introspection XML. Introspection information is
4290 * used when registering objects with g_dbus_connection_register_object().
4292 * The format of D-Bus introspection XML is specified in the
4293 * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format">D-Bus specification</ulink>.
4298 * SECTION:gdbusmenumodel
4299 * @title: GDBusMenuModel
4300 * @short_description: A D-Bus GMenuModel implementation
4301 * @see_also: <link linkend="gio-GMenuModel-exporter">GMenuModel Exporter</link>
4303 * #GDBusMenuModel is an implementation of #GMenuModel that can be used
4304 * as a proxy for a menu model that is exported over D-Bus with
4305 * g_dbus_connection_export_menu_model().
4310 * SECTION:gdbusmessage
4311 * @short_description: D-Bus Message
4312 * @include: gio/gio.h
4314 * A type for representing D-Bus messages that can be sent or received
4315 * on a #GDBusConnection.
4320 * SECTION:gdbusmethodinvocation
4321 * @short_description: Object for handling remote calls
4322 * @include: gio/gio.h
4324 * Instances of the #GDBusMethodInvocation class are used when
4325 * handling D-Bus method calls. It provides a way to asynchronously
4326 * return results and errors.
4328 * The normal way to obtain a #GDBusMethodInvocation object is to receive
4329 * it as an argument to the handle_method_call() function in a
4330 * #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
4335 * SECTION:gdbusnameowning
4336 * @title: Owning Bus Names
4337 * @short_description: Simple API for owning bus names
4338 * @include: gio/gio.h
4340 * Convenience API for owning bus names.
4342 * <example id="gdbus-owning-names"><title>Simple application owning a name</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-own-name.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4347 * SECTION:gdbusnamewatching
4348 * @title: Watching Bus Names
4349 * @short_description: Simple API for watching bus names
4350 * @include: gio/gio.h
4352 * Convenience API for watching bus names.
4354 * <example id="gdbus-watching-names"><title>Simple application watching a name</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-watch-name.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4359 * SECTION:gdbusobject
4360 * @short_description: Base type for D-Bus objects
4361 * @include: gio/gio.h
4363 * The #GDBusObject type is the base type for D-Bus objects on both
4364 * the service side (see #GDBusObjectSkeleton) and the client side
4365 * (see #GDBusObjectProxy). It is essentially just a container of
4371 * SECTION:gdbusobjectmanager
4372 * @short_description: Base type for D-Bus object managers
4373 * @include: gio/gio.h
4375 * The #GDBusObjectManager type is the base type for service- and
4376 * client-side implementations of the standardized <ulink
4377 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4380 * See #GDBusObjectManagerClient for the client-side implementation
4381 * and #GDBusObjectManagerServer for the service-side implementation.
4386 * SECTION:gdbusobjectmanagerclient
4387 * @short_description: Client-side object manager
4388 * @include: gio/gio.h
4390 * #GDBusObjectManagerClient is used to create, monitor and delete object
4391 * proxies for remote objects exported by a #GDBusObjectManagerServer (or any
4392 * code implementing the <ulink
4393 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4396 * Once an instance of this type has been created, you can connect to
4397 * the #GDBusObjectManager::object-added and
4398 * #GDBusObjectManager::object-removed signals and inspect the
4399 * #GDBusObjectProxy objects returned by
4400 * g_dbus_object_manager_get_objects().
4402 * If the name for a #GDBusObjectManagerClient is not owned by anyone at
4403 * object construction time, the default behavior is to request the
4404 * message bus to launch an owner for the name. This behavior can be
4405 * disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
4406 * flag. It's also worth noting that this only works if the name of
4407 * interest is activatable in the first place. E.g. in some cases it
4408 * is not possible to launch an owner for the requested name. In this
4409 * case, #GDBusObjectManagerClient object construction still succeeds but
4410 * there will be no object proxies
4411 * (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
4412 * the #GDBusObjectManagerClient:name-owner property is %NULL.
4414 * The owner of the requested name can come and go (for example
4415 * consider a system service being restarted) – #GDBusObjectManagerClient
4416 * handles this case too; simply connect to the #GObject::notify
4417 * signal to watch for changes on the #GDBusObjectManagerClient:name-owner
4418 * property. When the name owner vanishes, the behavior is that
4419 * #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
4420 * emission of the #GObject::notify signal) and then
4421 * #GDBusObjectManager::object-removed signals are synthesized
4422 * for all currently existing object proxies. Since
4423 * #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
4424 * use this information to disambiguate a synthesized signal from a
4425 * genuine signal caused by object removal on the remote
4426 * #GDBusObjectManager. Similarly, when a new name owner appears,
4427 * #GDBusObjectManager::object-added signals are synthesized
4428 * while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
4429 * object proxies have been added, the #GDBusObjectManagerClient:name-owner
4430 * is set to the new name owner (this includes emission of the
4431 * #GObject::notify signal). Furthermore, you are guaranteed that
4432 * #GDBusObjectManagerClient:name-owner will alternate between a name owner
4433 * (e.g. <literal>:1.42</literal>) and %NULL even in the case where
4434 * the name of interest is atomically replaced
4436 * Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
4437 * instances. All signals (including the
4438 * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
4439 * signal) delivered to #GDBusProxy instances are guaranteed to
4440 * originate from the name owner. This guarantee along with the
4441 * behavior described above, means that certain race conditions
4442 * including the <emphasis><quote>half the proxy is from the old owner
4443 * and the other half is from the new owner</quote></emphasis> problem
4446 * To avoid having the application connect to signals on the returned
4447 * #GDBusObjectProxy and #GDBusProxy objects, the
4448 * #GDBusObject::interface-added,
4449 * #GDBusObject::interface-removed,
4450 * #GDBusProxy::g-properties-changed and
4451 * #GDBusProxy::g-signal signals
4452 * are also emitted on the #GDBusObjectManagerClient instance managing these
4453 * objects. The signals emitted are
4454 * #GDBusObjectManager::interface-added,
4455 * #GDBusObjectManager::interface-removed,
4456 * #GDBusObjectManagerClient::interface-proxy-properties-changed and
4457 * #GDBusObjectManagerClient::interface-proxy-signal.
4459 * Note that all callbacks and signals are emitted in the
4460 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4461 * that the #GDBusObjectManagerClient object was constructed
4462 * in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
4463 * originating from the #GDBusObjectManagerClient object will be created in
4464 * the same context and, consequently, will deliver signals in the
4470 * SECTION:gdbusobjectmanagerserver
4471 * @short_description: Service-side object manager
4472 * @include: gio/gio.h
4474 * #GDBusObjectManagerServer is used to export #GDBusObject instances using
4475 * the standardized <ulink
4476 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4477 * interface. For example, remote D-Bus clients can get all objects
4478 * and properties in a single call. Additionally, any change in the
4479 * object hierarchy is broadcast using signals. This means that D-Bus
4480 * clients can keep caches up to date by only listening to D-Bus
4483 * See #GDBusObjectManagerClient for the client-side code that is
4484 * intended to be used with #GDBusObjectManagerServer or any D-Bus
4485 * object implementing the org.freedesktop.DBus.ObjectManager
4491 * SECTION:gdbusobjectproxy
4492 * @short_description: Client-side D-Bus object
4493 * @include: gio/gio.h
4495 * A #GDBusObjectProxy is an object used to represent a remote object
4496 * with one or more D-Bus interfaces. Normally, you don't instantiate
4497 * a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
4498 * is used to obtain it.
4505 * SECTION:gdbusobjectskeleton
4506 * @short_description: Service-side D-Bus object
4507 * @include: gio/gio.h
4509 * A #GDBusObjectSkeleton instance is essentially a group of D-Bus
4510 * interfaces. The set of exported interfaces on the object may be
4511 * dynamic and change at runtime.
4513 * This type is intended to be used with #GDBusObjectManager.
4518 * SECTION:gdbusproxy
4519 * @short_description: Client-side D-Bus interface proxy
4520 * @include: gio/gio.h
4522 * #GDBusProxy is a base class used for proxies to access a D-Bus
4523 * interface on a remote object. A #GDBusProxy can be constructed for
4524 * both well-known and unique names.
4526 * By default, #GDBusProxy will cache all properties (and listen to
4527 * changes) of the remote object, and proxy all signals that gets
4528 * emitted. This behaviour can be changed by passing suitable
4529 * #GDBusProxyFlags when the proxy is created. If the proxy is for a
4530 * well-known name, the property cache is flushed when the name owner
4531 * vanishes and reloaded when a name owner appears.
4533 * If a #GDBusProxy is used for a well-known name, the owner of the
4534 * name is tracked and can be read from
4535 * #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
4536 * get notified of changes. Additionally, only signals and property
4537 * changes emitted from the current name owner are considered and
4538 * calls are always sent to the current name owner. This avoids a
4539 * number of race conditions when the name is lost by one owner and
4540 * claimed by another. However, if no name owner currently exists,
4541 * then calls will be sent to the well-known name which may result in
4542 * the message bus launching an owner (unless
4543 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
4545 * The generic #GDBusProxy::g-properties-changed and
4546 * #GDBusProxy::g-signal signals are not very convenient to work
4547 * with. Therefore, the recommended way of working with proxies is to
4548 * subclass #GDBusProxy, and have more natural properties and signals
4549 * in your derived class. See <xref linkend="gdbus-example-gdbus-codegen"/>
4550 * for how this can easily be done using the
4551 * <command><link linkend="gdbus-codegen">gdbus-codegen</link></command>
4554 * A #GDBusProxy instance can be used from multiple threads but note
4555 * that all signals (e.g. #GDBusProxy::g-signal, #GDBusProxy::g-properties-changed
4556 * and #GObject::notify) are emitted in the
4557 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4558 * of the thread where the instance was constructed.
4560 * <example id="gdbus-wellknown-proxy"><title>GDBusProxy for a well-known-name</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-watch-proxy.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4565 * SECTION:gdbusserver
4566 * @short_description: Helper for accepting connections
4567 * @include: gio/gio.h
4569 * #GDBusServer is a helper for listening to and accepting D-Bus
4570 * connections. This can be used to create a new D-Bus server, allowing two
4571 * peers to use the D-Bus protocol for their own specialized communication.
4572 * A server instance provided in this way will not perform message routing or
4573 * implement the org.freedesktop.DBus interface.
4575 * To just export an object on a well-known name on a message bus, such as the
4576 * session or system bus, you should instead use g_bus_own_name().
4578 * <example id="gdbus-peer-to-peer"><title>D-Bus peer-to-peer example</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-peer.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
4583 * SECTION:gdbusutils
4584 * @title: D-Bus Utilities
4585 * @short_description: Various utilities related to D-Bus.
4586 * @include: gio/gio.h
4588 * Various utility routines related to D-Bus.
4593 * SECTION:gdesktopappinfo
4594 * @title: GDesktopAppInfo
4595 * @short_description: Application information from desktop files
4596 * @include: gio/gdesktopappinfo.h
4598 * #GDesktopAppInfo is an implementation of #GAppInfo based on
4601 * Note that <filename><gio/gdesktopappinfo.h></filename> belongs to
4602 * the UNIX-specific GIO interfaces, thus you have to use the
4603 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4609 * @short_description: Drive management
4610 * @include: gio/gio.h
4612 * #GDrive - this represent a piece of hardware connected to the machine.
4613 * It's generally only created for removable hardware or hardware with
4616 * #GDrive is a container class for #GVolume objects that stem from
4617 * the same piece of media. As such, #GDrive abstracts a drive with
4618 * (or without) removable media and provides operations for querying
4619 * whether media is available, determing whether media change is
4620 * automatically detected and ejecting the media.
4622 * If the #GDrive reports that media isn't automatically detected, one
4623 * can poll for media; typically one should not do this periodically
4624 * as a poll for media operation is potententially expensive and may
4625 * spin up the drive creating noise.
4627 * #GDrive supports starting and stopping drives with authentication
4628 * support for the former. This can be used to support a diverse set
4629 * of use cases including connecting/disconnecting iSCSI devices,
4630 * powering down external disk enclosures and starting/stopping
4631 * multi-disk devices such as RAID devices. Note that the actual
4632 * semantics and side-effects of starting/stopping a #GDrive may vary
4633 * according to implementation. To choose the correct verbs in e.g. a
4634 * file manager, use g_drive_get_start_stop_type().
4636 * For porting from GnomeVFS note that there is no equivalent of
4637 * #GDrive in that API.
4643 * @short_description: An object for emblems
4644 * @include: gio/gio.h
4645 * @see_also: #GIcon, #GEmblemedIcon, #GLoadableIcon, #GThemedIcon
4647 * #GEmblem is an implementation of #GIcon that supports
4648 * having an emblem, which is an icon with additional properties.
4649 * It can than be added to a #GEmblemedIcon.
4651 * Currently, only metainformation about the emblem's origin is
4652 * supported. More may be added in the future.
4657 * SECTION:gemblemedicon
4658 * @short_description: Icon with emblems
4659 * @include: gio/gio.h
4660 * @see_also: #GIcon, #GLoadableIcon, #GThemedIcon, #GEmblem
4662 * #GEmblemedIcon is an implementation of #GIcon that supports
4663 * adding an emblem to an icon. Adding multiple emblems to an
4664 * icon is ensured via g_emblemed_icon_add_emblem().
4666 * Note that #GEmblemedIcon allows no control over the position
4667 * of the emblems. See also #GEmblem for more information.
4673 * @short_description: File and Directory Handling
4674 * @include: gio/gio.h
4675 * @see_also: #GFileInfo, #GFileEnumerator
4677 * #GFile is a high level abstraction for manipulating files on a
4678 * virtual file system. #GFiles are lightweight, immutable objects
4679 * that do no I/O upon creation. It is necessary to understand that
4680 * #GFile objects do not represent files, merely an identifier for a
4681 * file. All file content I/O is implemented as streaming operations
4682 * (see #GInputStream and #GOutputStream).
4684 * To construct a #GFile, you can use:
4686 * <member>g_file_new_for_path() if you have a path.</member>
4687 * <member>g_file_new_for_uri() if you have a URI.</member>
4688 * <member>g_file_new_for_commandline_arg() for a command line argument.</member>
4689 * <member>g_file_new_tmp() to create a temporary file from a template.</member>
4690 * <member>g_file_parse_name() from a UTF-8 string gotten from g_file_get_parse_name().</member>
4693 * One way to think of a #GFile is as an abstraction of a pathname. For
4694 * normal files the system pathname is what is stored internally, but as
4695 * #GFiles are extensible it could also be something else that corresponds
4696 * to a pathname in a userspace implementation of a filesystem.
4698 * #GFiles make up hierarchies of directories and files that correspond to
4699 * the files on a filesystem. You can move through the file system with
4700 * #GFile using g_file_get_parent() to get an identifier for the parent
4701 * directory, g_file_get_child() to get a child within a directory,
4702 * g_file_resolve_relative_path() to resolve a relative path between two
4703 * #GFiles. There can be multiple hierarchies, so you may not end up at
4704 * the same root if you repeatedly call g_file_get_parent() on two different
4707 * All #GFiles have a basename (get with g_file_get_basename()). These names
4708 * are byte strings that are used to identify the file on the filesystem
4709 * (relative to its parent directory) and there is no guarantees that they
4710 * have any particular charset encoding or even make any sense at all. If
4711 * you want to use filenames in a user interface you should use the display
4712 * name that you can get by requesting the
4713 * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
4714 * This is guaranteed to be in UTF-8 and can be used in a user interface.
4715 * But always store the real basename or the #GFile to use to actually
4716 * access the file, because there is no way to go from a display name to
4719 * Using #GFile as an identifier has the same weaknesses as using a path
4720 * in that there may be multiple aliases for the same file. For instance,
4721 * hard or soft links may cause two different #GFiles to refer to the same
4722 * file. Other possible causes for aliases are: case insensitive filesystems,
4723 * short and long names on FAT/NTFS, or bind mounts in Linux. If you want to
4724 * check if two #GFiles point to the same file you can query for the
4725 * %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
4726 * canonicalization of pathnames passed in, so that trivial differences in
4727 * the path string used at creation (duplicated slashes, slash at end of
4728 * path, "." or ".." path segments, etc) does not create different #GFiles.
4730 * Many #GFile operations have both synchronous and asynchronous versions
4731 * to suit your application. Asynchronous versions of synchronous functions
4732 * simply have _async() appended to their function names. The asynchronous
4733 * I/O functions call a #GAsyncReadyCallback which is then used to finalize
4734 * the operation, producing a GAsyncResult which is then passed to the
4735 * function's matching _finish() operation.
4737 * Some #GFile operations do not have synchronous analogs, as they may
4738 * take a very long time to finish, and blocking may leave an application
4739 * unusable. Notable cases include:
4741 * <member>g_file_mount_mountable() to mount a mountable file.</member>
4742 * <member>g_file_unmount_mountable_with_operation() to unmount a mountable file.</member>
4743 * <member>g_file_eject_mountable_with_operation() to eject a mountable file.</member>
4746 * <para id="gfile-etag"><indexterm><primary>entity tag</primary></indexterm>
4747 * One notable feature of #GFiles are entity tags, or "etags" for
4748 * short. Entity tags are somewhat like a more abstract version of the
4749 * traditional mtime, and can be used to quickly determine if the file has
4750 * been modified from the version on the file system. See the HTTP 1.1
4751 * <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">specification</ulink>
4752 * for HTTP Etag headers, which are a very similar concept.
4758 * SECTION:gfileattribute
4759 * @short_description: Key-Value Paired File Attributes
4760 * @include: gio/gio.h
4761 * @see_also: #GFile, #GFileInfo
4763 * File attributes in GIO consist of a list of key-value pairs.
4765 * Keys are strings that contain a key namespace and a key name, separated
4766 * by a colon, e.g. "namespace:keyname". Namespaces are included to sort
4767 * key-value pairs by namespaces for relevance. Keys can be retrived
4768 * using wildcards, e.g. "standard::*" will return all of the keys in the
4769 * "standard" namespace.
4771 * The list of possible attributes for a filesystem (pointed to by a #GFile) is
4772 * available as a #GFileAttributeInfoList. This list is queryable by key names
4773 * as indicated earlier.
4775 * Information is stored within the list in #GFileAttributeInfo structures.
4776 * The info structure can store different types, listed in the enum
4777 * #GFileAttributeType. Upon creation of a #GFileAttributeInfo, the type will
4778 * be set to %G_FILE_ATTRIBUTE_TYPE_INVALID.
4780 * Classes that implement #GFileIface will create a #GFileAttributeInfoList and
4781 * install default keys and values for their given file system, architecture,
4782 * and other possible implementation details (e.g., on a UNIX system, a file
4783 * attribute key will be registered for the user id for a given file).
4787 * <title>GFileAttributes Default Namespaces</title>
4788 * <tgroup cols='2' align='left'><thead>
4789 * <row><entry>Namspace</entry><entry>Description</entry></row>
4792 * <row><entry>"standard"</entry><entry>The "Standard" namespace. General file
4793 * information that any application may need should be put in this namespace.
4794 * Examples include the file's name, type, and size.</entry></row>
4795 * <row><entry>"etag"</entry><entry>The <link linkend="gfile-etag">"Entity Tag"</link>
4796 * namespace. Currently, the only key in this namespace is "value", which contains
4797 * the value of the current entity tag.</entry></row>
4798 * <row><entry>"id"</entry><entry>The "Identification" namespace. This
4799 * namespace is used by file managers and applications that list directories
4800 * to check for loops and to uniquely identify files.</entry></row>
4801 * <row><entry>"access"</entry><entry>The "Access" namespace. Used to check
4802 * if a user has the proper privilidges to access files and perform
4803 * file operations. Keys in this namespace are made to be generic
4804 * and easily understood, e.g. the "can_read" key is %TRUE if
4805 * the current user has permission to read the file. UNIX permissions and
4806 * NTFS ACLs in Windows should be mapped to these values.</entry></row>
4807 * <row><entry>"mountable"</entry><entry>The "Mountable" namespace. Includes
4808 * simple boolean keys for checking if a file or path supports mount operations, e.g.
4809 * mount, unmount, eject. These are used for files of type %G_FILE_TYPE_MOUNTABLE.</entry></row>
4810 * <row><entry>"time"</entry><entry>The "Time" namespace. Includes file
4811 * access, changed, created times. </entry></row>
4812 * <row><entry>"unix"</entry><entry>The "Unix" namespace. Includes UNIX-specific
4813 * information and may not be available for all files. Examples include
4814 * the UNIX "UID", "GID", etc.</entry></row>
4815 * <row><entry>"dos"</entry><entry>The "DOS" namespace. Includes DOS-specific
4816 * information and may not be available for all files. Examples include
4817 * "is_system" for checking if a file is marked as a system file, and "is_archive"
4818 * for checking if a file is marked as an archive file.</entry></row>
4819 * <row><entry>"owner"</entry><entry>The "Owner" namespace. Includes information
4820 * about who owns a file. May not be available for all file systems. Examples include
4821 * "user" for getting the user name of the file owner. This information is often mapped from
4822 * some backend specific data such as a unix UID.</entry></row>
4823 * <row><entry>"thumbnail"</entry><entry>The "Thumbnail" namespace. Includes
4824 * information about file thumbnails and their location within the file system. Examples of
4825 * keys in this namespace include "path" to get the location of a thumbnail, and "failed"
4826 * to check if thumbnailing of the file failed.</entry></row>
4827 * <row><entry>"filesystem"</entry><entry>The "Filesystem" namespace. Gets information
4828 * about the file system where a file is located, such as its type, how much
4829 * space is left available, and the overall size of the file system.</entry></row>
4830 * <row><entry>"gvfs"</entry><entry>The "GVFS" namespace. Keys in this namespace
4831 * contain information about the current GVFS backend in use. </entry></row>
4832 * <row><entry>"xattr"</entry><entry>The "xattr" namespace. Gets information
4833 * about extended user attributes. See attr(5). The "user." prefix of the
4834 * extended user attribute name is stripped away when constructing keys in
4835 * this namespace, e.g. "xattr::mime_type" for the extended attribute with
4836 * the name "user.mime_type". Note that this information is only available
4837 * if GLib has been built with extended attribute support.</entry></row>
4838 * <row><entry>"xattr-sys"</entry><entry>The "xattr-sys" namespace.
4839 * Gets information about extended attributes which are not user-specific.
4840 * See attr(5). Note that this information is only available if GLib
4841 * has been built with extended attribute support.</entry></row>
4842 * <row><entry>"selinux"</entry><entry>The "SELinux" namespace. Includes
4843 * information about the SELinux context of files. Note that this information
4844 * is only available if GLib has been built with SELinux support.</entry></row>
4850 * Please note that these are not all of the possible namespaces.
4851 * More namespaces can be added from GIO modules or by individual applications.
4852 * For more information about writing GIO modules, see #GIOModule.
4854 * <!-- TODO: Implementation note about using extended attributes on supported
4858 * <title>GFileAttributes Built-in Keys and Value Types</title>
4859 * <tgroup cols='3' align='left'><thead>
4860 * <row><entry>Enum Value</entry><entry>Namespace:Key</entry><entry>Value Type</entry></row>
4862 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TYPE</entry><entry>standard::type</entry><entry>uint32 (#GFileType)</entry></row>
4863 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN</entry><entry>standard::is-hidden</entry><entry>boolean</entry></row>
4864 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP</entry><entry>standard::is-backup</entry><entry>boolean</entry></row>
4865 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK</entry><entry>standard::is-symlink</entry><entry>boolean</entry></row>
4866 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL</entry><entry>standard::is-virtual</entry><entry>boolean</entry></row>
4867 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_NAME</entry><entry>standard::name</entry><entry>byte string</entry></row>
4868 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</entry><entry>standard::display-name</entry><entry>string</entry></row>
4869 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME</entry><entry>standard::edit-name</entry><entry>string</entry></row>
4870 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ICON</entry><entry>standard::icon</entry><entry>object (#GIcon)</entry></row>
4871 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE</entry><entry>standard::content-type</entry><entry>string</entry></row>
4872 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE</entry><entry>standard::fast-content-type</entry><entry>string</entry></row>
4873 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SIZE</entry><entry>standard::size</entry><entry>uint64</entry></row>
4874 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE</entry><entry>standard::allocated-size</entry><entry>uint64</entry></row>
4875 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET</entry><entry>standard::symlink-target</entry><entry>byte string</entry></row>
4876 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TARGET_URI</entry><entry>standard::target-uri</entry><entry>string</entry></row>
4877 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER</entry><entry>standard::sort-order</entry><entry>int32</entry></row>
4878 * <row><entry>%G_FILE_ATTRIBUTE_ETAG_VALUE</entry><entry>etag::value</entry><entry>string</entry></row>
4879 * <row><entry>%G_FILE_ATTRIBUTE_ID_FILE</entry><entry>id::file</entry><entry>string</entry></row>
4880 * <row><entry>%G_FILE_ATTRIBUTE_ID_FILESYSTEM</entry><entry>id::filesystem</entry><entry>string</entry></row>
4881 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_READ</entry><entry>access::can-read</entry><entry>boolean</entry></row>
4882 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE</entry><entry>access::can-write</entry><entry>boolean</entry></row>
4883 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE</entry><entry>access::can-execute</entry><entry>boolean</entry></row>
4884 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE</entry><entry>access::can-delete</entry><entry>boolean</entry></row>
4885 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH</entry><entry>access::can-trash</entry><entry>boolean</entry></row>
4886 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME</entry><entry>access::can-rename</entry><entry>boolean</entry></row>
4887 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT</entry><entry>mountable::can-mount</entry><entry>boolean</entry></row>
4888 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT</entry><entry>mountable::can-unmount</entry><entry>boolean</entry></row>
4889 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT</entry><entry>mountable::can-eject</entry><entry>boolean</entry></row>
4890 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE</entry><entry>mountable::unix-device</entry><entry>uint32</entry></row>
4891 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE</entry><entry>mountable::unix-device-file</entry><entry>string</entry></row>
4892 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI</entry><entry>mountable::hal-udi</entry><entry>string</entry></row>
4893 * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED</entry><entry>time::modified</entry><entry>uint64</entry></row>
4894 * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC</entry><entry>time::modified-usec</entry><entry>uint32</entry></row>
4895 * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS</entry><entry>time::access</entry><entry>uint64</entry></row>
4896 * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS_USEC</entry><entry>time::access-usec</entry><entry>uint32</entry></row>
4897 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED</entry><entry>time::changed</entry><entry>uint64</entry></row>
4898 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED_USEC</entry><entry>time::changed-usec</entry><entry>uint32</entry></row>
4899 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED</entry><entry>time::created</entry><entry>uint64</entry></row>
4900 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED_USEC</entry><entry>time::created-usec</entry><entry>uint32</entry></row>
4901 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_DEVICE</entry><entry>unix::device</entry><entry>uint32</entry></row>
4902 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_INODE</entry><entry>unix::inode</entry><entry>uint64</entry></row>
4903 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_MODE</entry><entry>unix::mode</entry><entry>uint32</entry></row>
4904 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_NLINK</entry><entry>unix::nlink</entry><entry>uint32</entry></row>
4905 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_UID</entry><entry>unix::uid</entry><entry>uint32</entry></row>
4906 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_GID</entry><entry>unix::gid</entry><entry>uint32</entry></row>
4907 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_RDEV</entry><entry>unix::rdev</entry><entry>uint32</entry></row>
4908 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE</entry><entry>unix::block-size</entry><entry>uint32</entry></row>
4909 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCKS</entry><entry>unix::blocks</entry><entry>uint64</entry></row>
4910 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT</entry><entry>unix::is-mountpoint</entry><entry>boolean</entry></row>
4911 * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE</entry><entry>dos::is-archive</entry><entry>boolean</entry></row>
4912 * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_SYSTEM</entry><entry>dos::is-system</entry><entry>boolean</entry></row>
4913 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER</entry><entry>owner::user</entry><entry>string</entry></row>
4914 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER_REAL</entry><entry>owner::user-real</entry><entry>string</entry></row>
4915 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_GROUP</entry><entry>owner::group</entry><entry>string</entry></row>
4916 * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAIL_PATH</entry><entry>thumbnail::path</entry><entry>bytestring</entry></row>
4917 * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAILING_FAILED</entry><entry>thumbnail::failed</entry><entry>boolean</entry></row>
4918 * <row><entry>%G_FILE_ATTRIBUTE_PREVIEW_ICON</entry><entry>preview::icon</entry><entry>object (#GIcon)</entry></row>
4919 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_SIZE</entry><entry>filesystem::size</entry><entry>uint64</entry></row>
4920 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_FREE</entry><entry>filesystem::free</entry><entry>uint64</entry></row>
4921 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_USED</entry><entry>filesystem::used</entry><entry>uint64</entry></row>
4922 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_TYPE</entry><entry>filesystem::type</entry><entry>string</entry></row>
4923 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_READONLY</entry><entry>filesystem::readonly</entry><entry>boolean</entry></row>
4924 * <row><entry>%G_FILE_ATTRIBUTE_GVFS_BACKEND</entry><entry>gvfs::backend</entry><entry>string</entry></row>
4925 * <row><entry>%G_FILE_ATTRIBUTE_SELINUX_CONTEXT</entry><entry>selinux::context</entry><entry>string</entry></row>
4926 * </tbody></tgroup></table></para>
4928 * Note that there are no predefined keys in the "xattr" and "xattr-sys"
4929 * namespaces. Keys for the "xattr" namespace are constructed by stripping
4930 * away the "user." prefix from the extended user attribute, and prepending
4931 * "xattr::". Keys for the "xattr-sys" namespace are constructed by
4932 * concatenating "xattr-sys::" with the extended attribute name. All extended
4933 * attribute values are returned as hex-encoded strings in which bytes outside
4934 * the ASCII range are encoded as hexadecimal escape sequences of the form
4935 * \x<replaceable>nn</replaceable>.
4940 * SECTION:gfiledescriptorbased
4941 * @short_description: Interface for file descriptor based IO
4942 * @include: gio/gfiledescriptorbased.h
4943 * @see_also: #GInputStream, #GOutputStream
4945 * #GFileDescriptorBased is implemented by streams (implementations of
4946 * #GInputStream or #GOutputStream) that are based on file descriptors.
4948 * Note that <filename><gio/gfiledescriptorbased.h></filename> belongs to
4949 * the UNIX-specific GIO interfaces, thus you have to use the
4950 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4957 * SECTION:gfileenumerator
4958 * @short_description: Enumerated Files Routines
4959 * @include: gio/gio.h
4961 * #GFileEnumerator allows you to operate on a set of #GFile<!-- -->s,
4962 * returning a #GFileInfo structure for each file enumerated (e.g.
4963 * g_file_enumerate_children() will return a #GFileEnumerator for each
4964 * of the children within a directory).
4966 * To get the next file's information from a #GFileEnumerator, use
4967 * g_file_enumerator_next_file() or its asynchronous version,
4968 * g_file_enumerator_next_files_async(). Note that the asynchronous
4969 * version will return a list of #GFileInfo<!---->s, whereas the
4970 * synchronous will only return the next file in the enumerator.
4972 * To close a #GFileEnumerator, use g_file_enumerator_close(), or
4973 * its asynchronous version, g_file_enumerator_close_async(). Once
4974 * a #GFileEnumerator is closed, no further actions may be performed
4975 * on it, and it should be freed with g_object_unref().
4981 * @short_description: Icons pointing to an image file
4982 * @include: gio/gio.h
4983 * @see_also: #GIcon, #GLoadableIcon
4985 * #GFileIcon specifies an icon by pointing to an image file
4986 * to be used as icon.
4992 * @short_description: File Information and Attributes
4993 * @include: gio/gio.h
4994 * @see_also: #GFile, <link linkend="gio-GFileAttribute">GFileAttribute</link>
4996 * Functionality for manipulating basic metadata for files. #GFileInfo
4997 * implements methods for getting information that all files should
4998 * contain, and allows for manipulation of extended attributes.
5000 * See <link linkend="gio-GFileAttribute">GFileAttribute</link> for more
5001 * information on how GIO handles file attributes.
5003 * To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
5004 * async variant). To obtain a #GFileInfo for a file input or output
5005 * stream, use g_file_input_stream_query_info() or
5006 * g_file_output_stream_query_info() (or their async variants).
5008 * To change the actual attributes of a file, you should then set the
5009 * attribute in the #GFileInfo and call g_file_set_attributes_from_info()
5010 * or g_file_set_attributes_async() on a GFile.
5012 * However, not all attributes can be changed in the file. For instance,
5013 * the actual size of a file cannot be changed via g_file_info_set_size().
5014 * You may call g_file_query_settable_attributes() and
5015 * g_file_query_writable_namespaces() to discover the settable attributes
5016 * of a particular file at runtime.
5018 * #GFileAttributeMatcher allows for searching through a #GFileInfo for
5024 * SECTION:gfileinputstream
5025 * @short_description: File input streaming operations
5026 * @include: gio/gio.h
5027 * @see_also: #GInputStream, #GDataInputStream, #GSeekable
5029 * GFileInputStream provides input streams that take their
5030 * content from a file.
5032 * GFileInputStream implements #GSeekable, which allows the input
5033 * stream to jump to arbitrary positions in the file, provided the
5034 * filesystem of the file allows it. To find the position of a file
5035 * input stream, use g_seekable_tell(). To find out if a file input
5036 * stream supports seeking, use g_seekable_can_seek().
5037 * To position a file input stream, use g_seekable_seek().
5042 * SECTION:gfileiostream
5043 * @short_description: File read and write streaming operations
5044 * @include: gio/gio.h
5045 * @see_also: #GIOStream, #GFileInputStream, #GFileOutputStream, #GSeekable
5047 * GFileIOStream provides io streams that both read and write to the same
5050 * GFileIOStream implements #GSeekable, which allows the io
5051 * stream to jump to arbitrary positions in the file and to truncate
5052 * the file, provided the filesystem of the file supports these
5055 * To find the position of a file io stream, use
5056 * g_seekable_tell().
5058 * To find out if a file io stream supports seeking, use g_seekable_can_seek().
5059 * To position a file io stream, use g_seekable_seek().
5060 * To find out if a file io stream supports truncating, use
5061 * g_seekable_can_truncate(). To truncate a file io
5062 * stream, use g_seekable_truncate().
5064 * The default implementation of all the #GFileIOStream operations
5065 * and the implementation of #GSeekable just call into the same operations
5066 * on the output stream.
5073 * SECTION:gfilemonitor
5074 * @short_description: File Monitor
5075 * @include: gio/gio.h
5077 * Monitors a file or directory for changes.
5079 * To obtain a #GFileMonitor for a file or directory, use
5080 * g_file_monitor(), g_file_monitor_file(), or
5081 * g_file_monitor_directory().
5083 * To get informed about changes to the file or directory you are
5084 * monitoring, connect to the #GFileMonitor::changed signal. The
5085 * signal will be emitted in the <link
5086 * linkend="g-main-context-push-thread-default">thread-default main
5087 * context</link> of the thread that the monitor was created in
5088 * (though if the global default main context is blocked, this may
5089 * cause notifications to be blocked even if the thread-default
5090 * context is still running).
5095 * SECTION:gfilenamecompleter
5096 * @short_description: Filename Completer
5097 * @include: gio/gio.h
5099 * Completes partial file and directory names given a partial string by
5100 * looking in the file system for clues. Can return a list of possible
5101 * completion strings for widget implementations.
5106 * SECTION:gfileoutputstream
5107 * @short_description: File output streaming operations
5108 * @include: gio/gio.h
5109 * @see_also: #GOutputStream, #GDataOutputStream, #GSeekable
5111 * GFileOutputStream provides output streams that write their
5112 * content to a file.
5114 * GFileOutputStream implements #GSeekable, which allows the output
5115 * stream to jump to arbitrary positions in the file and to truncate
5116 * the file, provided the filesystem of the file supports these
5119 * To find the position of a file output stream, use g_seekable_tell().
5120 * To find out if a file output stream supports seeking, use
5121 * g_seekable_can_seek().To position a file output stream, use
5122 * g_seekable_seek(). To find out if a file output stream supports
5123 * truncating, use g_seekable_can_truncate(). To truncate a file output
5124 * stream, use g_seekable_truncate().
5129 * SECTION:gfilterinputstream
5130 * @short_description: Filter Input Stream
5131 * @include: gio/gio.h
5133 * Base class for input stream implementations that perform some
5134 * kind of filtering operation on a base stream. Typical examples
5135 * of filtering operations are character set conversion, compression
5136 * and byte order flipping.
5141 * SECTION:gfilteroutputstream
5142 * @short_description: Filter Output Stream
5143 * @include: gio/gio.h
5145 * Base class for output stream implementations that perform some
5146 * kind of filtering operation on a base stream. Typical examples
5147 * of filtering operations are character set conversion, compression
5148 * and byte order flipping.
5154 * @short_description: Interface for icons
5155 * @include: gio/gio.h
5157 * #GIcon is a very minimal interface for icons. It provides functions
5158 * for checking the equality of two icons, hashing of icons and
5159 * serializing an icon to and from strings.
5161 * #GIcon does not provide the actual pixmap for the icon as this is out
5162 * of GIO's scope, however implementations of #GIcon may contain the name
5163 * of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
5165 * To obtain a hash of a #GIcon, see g_icon_hash().
5167 * To check if two #GIcons are equal, see g_icon_equal().
5169 * For serializing a #GIcon, use g_icon_to_string() and
5170 * g_icon_new_for_string().
5172 * If your application or library provides one or more #GIcon
5173 * implementations you need to ensure that each #GType is registered
5174 * with the type system prior to calling g_icon_new_for_string().
5179 * SECTION:ginetaddress
5180 * @short_description: An IPv4/IPv6 address
5182 * #GInetAddress represents an IPv4 or IPv6 internet address. Use
5183 * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
5184 * look up the #GInetAddress for a hostname. Use
5185 * g_resolver_lookup_by_address() or
5186 * g_resolver_lookup_by_address_async() to look up the hostname for a
5189 * To actually connect to a remote host, you will need a
5190 * #GInetSocketAddress (which includes a #GInetAddress as well as a
5196 * SECTION:ginetaddressmask
5197 * @short_description: An IPv4/IPv6 address mask
5199 * #GInetAddressMask represents a range of IPv4 or IPv6 addresses
5200 * described by a base address and a length indicating how many bits
5201 * of the base address are relevant for matching purposes. These are
5202 * often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".
5207 * SECTION:ginetsocketaddress
5208 * @short_description: Internet GSocketAddress
5210 * An IPv4 or IPv6 socket address; that is, the combination of a
5211 * #GInetAddress and a port number.
5217 * @short_description: Failable object initialization interface
5218 * @include: gio/gio.h
5219 * @see_also: #GAsyncInitable
5221 * #GInitable is implemented by objects that can fail during
5222 * initialization. If an object implements this interface then
5223 * it must be initialized as the first thing after construction,
5224 * either via g_initable_init() or g_async_initable_init_async()
5225 * (the latter is only available if it also implements #GAsyncInitable).
5227 * If the object is not initialized, or initialization returns with an
5228 * error, then all operations on the object except g_object_ref() and
5229 * g_object_unref() are considered to be invalid, and have undefined
5230 * behaviour. They will often fail with g_critical() or g_warning(), but
5231 * this must not be relied on.
5233 * Users of objects implementing this are not intended to use
5234 * the interface method directly, instead it will be used automatically
5235 * in various ways. For C applications you generally just call
5236 * g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
5237 * This will call g_initable_init() under the cover, returning %NULL and
5238 * setting a #GError on failure (at which point the instance is
5241 * For bindings in languages where the native constructor supports
5242 * exceptions the binding could check for objects implemention %GInitable
5243 * during normal construction and automatically initialize them, throwing
5244 * an exception on failure.
5249 * SECTION:ginputstream
5250 * @short_description: Base class for implementing streaming input
5251 * @include: gio/gio.h
5253 * #GInputStream has functions to read from a stream (g_input_stream_read()),
5254 * to close a stream (g_input_stream_close()) and to skip some content
5255 * (g_input_stream_skip()).
5257 * To copy the content of an input stream to an output stream without
5258 * manually handling the reads and writes, use g_output_stream_splice().
5260 * All of these functions have async variants too.
5266 * @short_description: Error helper functions
5267 * @include: gio/gio.h
5269 * Contains helper functions for reporting errors to the user.
5275 * @short_description: Loadable GIO Modules
5276 * @include: gio/gio.h
5278 * Provides an interface and default functions for loading and unloading
5279 * modules. This is used internally to make GIO extensible, but can also
5280 * be used by others to implement module loading.
5285 * SECTION:gioscheduler
5286 * @short_description: I/O Scheduler
5287 * @include: gio/gio.h
5290 * As of GLib 2.36, the <literal>g_io_scheduler</literal> methods
5291 * are deprecated in favor of #GThreadPool and #GTask.
5294 * Schedules asynchronous I/O operations. #GIOScheduler integrates
5295 * into the main event loop (#GMainLoop) and uses threads.
5301 * @short_description: Base class for implementing read/write streams
5302 * @include: gio/gio.h
5303 * @see_also: #GInputStream, #GOutputStream
5305 * GIOStream represents an object that has both read and write streams.
5306 * Generally the two streams acts as separate input and output streams,
5307 * but they share some common resources and state. For instance, for
5308 * seekable streams they may use the same position in both streams.
5310 * Examples of #GIOStream objects are #GSocketConnection which represents
5311 * a two-way network connection, and #GFileIOStream which represent a
5312 * file handle opened in read-write mode.
5314 * To do the actual reading and writing you need to get the substreams
5315 * with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
5317 * The #GIOStream object owns the input and the output streams, not the other
5318 * way around, so keeping the substreams alive will not keep the #GIOStream
5319 * object alive. If the #GIOStream object is freed it will be closed, thus
5320 * closing the substream, so even if the substreams stay alive they will
5321 * always just return a %G_IO_ERROR_CLOSED for all operations.
5323 * To close a stream use g_io_stream_close() which will close the common
5324 * stream object and also the individual substreams. You can also close
5325 * the substreams themselves. In most cases this only marks the
5326 * substream as closed, so further I/O on it fails. However, some streams
5327 * may support "half-closed" states where one direction of the stream
5328 * is actually shut down.
5335 * SECTION:gloadableicon
5336 * @short_description: Loadable Icons
5337 * @include: gio/gio.h
5338 * @see_also: #GIcon, #GThemedIcon
5340 * Extends the #GIcon interface and adds the ability to
5341 * load icons from streams.
5346 * SECTION:gmemoryinputstream
5347 * @short_description: Streaming input operations on memory chunks
5348 * @include: gio/gio.h
5349 * @see_also: #GMemoryOutputStream
5351 * #GMemoryInputStream is a class for using arbitrary
5352 * memory chunks as input for GIO streaming input operations.
5354 * As of GLib 2.34, #GMemoryInputStream implements
5355 * #GPollableInputStream.
5360 * SECTION:gmemoryoutputstream
5361 * @short_description: Streaming output operations on memory chunks
5362 * @include: gio/gio.h
5363 * @see_also: #GMemoryInputStream
5365 * #GMemoryOutputStream is a class for using arbitrary
5366 * memory chunks as output for GIO streaming output operations.
5368 * As of GLib 2.34, #GMemoryOutputStream implements
5369 * #GPollableOutputStream.
5376 * @short_description: A simple implementation of GMenuModel
5378 * #GMenu is a simple implementation of #GMenuModel.
5379 * You populate a #GMenu by adding #GMenuItem instances to it.
5381 * There are some convenience functions to allow you to directly
5382 * add items (avoiding #GMenuItem) for the common cases. To add
5383 * a regular item, use g_menu_insert(). To add a section, use
5384 * g_menu_insert_section(). To add a submenu, use
5385 * g_menu_insert_submenu().
5390 * SECTION:gmenuexporter
5391 * @title: GMenuModel exporter
5392 * @short_description: Export GMenuModels on D-Bus
5393 * @see_also: #GMenuModel, #GDBusMenuModel
5395 * These functions support exporting a #GMenuModel on D-Bus.
5396 * The D-Bus interface that is used is a private implementation
5399 * To access an exported #GMenuModel remotely, use
5400 * g_dbus_menu_model_get() to obtain a #GDBusMenuModel.
5405 * SECTION:gmenumodel
5406 * @title: GMenuModel
5407 * @short_description: An abstract class representing the contents of a menu
5408 * @see_also: #GActionGroup
5410 * #GMenuModel represents the contents of a menu -- an ordered list of
5411 * menu items. The items are associated with actions, which can be
5412 * activated through them. Items can be grouped in sections, and may
5413 * have submenus associated with them. Both items and sections usually
5414 * have some representation data, such as labels or icons. The type of
5415 * the associated action (ie whether it is stateful, and what kind of
5416 * state it has) can influence the representation of the item.
5418 * The conceptual model of menus in #GMenuModel is hierarchical:
5419 * sections and submenus are again represented by #GMenuModels.
5420 * Menus themselves do not define their own roles. Rather, the role
5421 * of a particular #GMenuModel is defined by the item that references
5422 * it (or, in the case of the 'root' menu, is defined by the context
5423 * in which it is used).
5425 * As an example, consider the visible portions of the menu in
5426 * <xref linkend="menu-example"/>.
5428 * <figure id="menu-example">
5429 * <title>An example menu</title>
5430 * <graphic fileref="menu-example.png" format="PNG"></graphic>
5433 * There are 8 "menus" visible in the screenshot: one menubar, two
5434 * submenus and 5 sections:
5436 * <listitem>the toplevel menubar (containing 4 items)</listitem>
5437 * <listitem>the View submenu (containing 3 sections)</listitem>
5438 * <listitem>the first section of the View submenu (containing 2 items)</listitem>
5439 * <listitem>the second section of the View submenu (containing 1 item)</listitem>
5440 * <listitem>the final section of the View submenu (containing 1 item)</listitem>
5441 * <listitem>the Highlight Mode submenu (containing 2 sections)</listitem>
5442 * <listitem>the Sources section (containing 2 items)</listitem>
5443 * <listitem>the Markup section (containing 2 items)</listitem>
5446 * <xref linkend="menu-model"/> illustrates the conceptual connection between
5447 * these 8 menus. Each large block in the figure represents a menu and the
5448 * smaller blocks within the large block represent items in that menu. Some
5449 * items contain references to other menus.
5451 * <figure id="menu-model">
5452 * <title>A menu model</title>
5453 * <graphic fileref="menu-model.png" format="PNG"></graphic>
5456 * Notice that the separators visible in <xref linkend="menu-example"/>
5457 * appear nowhere in <xref linkend="menu-model"/>. This is because
5458 * separators are not explicitly represented in the menu model. Instead,
5459 * a separator is inserted between any two non-empty sections of a menu.
5460 * Section items can have labels just like any other item. In that case,
5461 * a display system may show a section header instead of a separator.
5463 * The motivation for this abstract model of application controls is
5464 * that modern user interfaces tend to make these controls available
5465 * outside the application. Examples include global menus, jumplists,
5466 * dash boards, etc. To support such uses, it is necessary to 'export'
5467 * information about actions and their representation in menus, which
5468 * is exactly what the
5469 * <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
5471 * <link linkend="gio-GMenuModel-exporter">GMenuModel exporter</link>
5472 * do for #GActionGroup and #GMenuModel. The client-side counterparts
5473 * to make use of the exported information are #GDBusActionGroup and
5476 * The API of #GMenuModel is very generic, with iterators for the
5477 * attributes and links of an item, see g_menu_model_iterate_item_attributes()
5478 * and g_menu_model_iterate_item_links(). The 'standard' attributes and
5479 * link types have predefined names: %G_MENU_ATTRIBUTE_LABEL,
5480 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, %G_MENU_LINK_SECTION
5481 * and %G_MENU_LINK_SUBMENU.
5483 * Items in a #GMenuModel represent active controls if they refer to
5484 * an action that can get activated when the user interacts with the
5485 * menu item. The reference to the action is encoded by the string id
5486 * in the %G_MENU_ATTRIBUTE_ACTION attribute. An action id uniquely
5487 * identifies an action in an action group. Which action group(s) provide
5488 * actions depends on the context in which the menu model is used.
5489 * E.g. when the model is exported as the application menu of a
5490 * #GtkApplication, actions can be application-wide or window-specific
5491 * (and thus come from two different action groups). By convention, the
5492 * application-wide actions have names that start with "app.", while the
5493 * names of window-specific actions start with "win.".
5495 * While a wide variety of stateful actions is possible, the following
5496 * is the minimum that is expected to be supported by all users of exported
5499 * <listitem>an action with no parameter type and no state</listitem>
5500 * <listitem>an action with no parameter type and boolean state</listitem>
5501 * <listitem>an action with string parameter type and string state</listitem>
5504 * <formalpara><title>Stateless</title>
5506 * A stateless action typically corresponds to an ordinary menu item.
5509 * Selecting such a menu item will activate the action (with no parameter).
5513 * <formalpara><title>Boolean State</title>
5515 * An action with a boolean state will most typically be used with a "toggle"
5516 * or "switch" menu item. The state can be set directly, but activating the
5517 * action (with no parameter) results in the state being toggled.
5520 * Selecting a toggle menu item will activate the action. The menu item should
5521 * be rendered as "checked" when the state is true.
5525 * <formalpara><title>String Parameter and State</title>
5527 * Actions with string parameters and state will most typically be used to
5528 * represent an enumerated choice over the items available for a group of
5529 * radio menu items. Activating the action with a string parameter is
5530 * equivalent to setting that parameter as the state.
5533 * Radio menu items, in addition to being associated with the action, will
5534 * have a target value. Selecting that menu item will result in activation
5535 * of the action with the target value as the parameter. The menu item should
5536 * be rendered as "selected" when the state of the action is equal to the
5537 * target value of the menu item.
5545 * @short_description: Mount management
5546 * @include: gio/gio.h
5547 * @see_also: GVolume, GUnixMountEntry, GUnixMountPoint
5549 * The #GMount interface represents user-visible mounts. Note, when
5550 * porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
5552 * #GMount is a "mounted" filesystem that you can access. Mounted is in
5553 * quotes because it's not the same as a unix mount, it might be a gvfs
5554 * mount, but you can still access the files on it if you use GIO. Might or
5555 * might not be related to a volume object.
5557 * Unmounting a #GMount instance is an asynchronous operation. For
5558 * more information about asynchronous operations, see #GAsyncResult
5559 * and #GSimpleAsyncResult. To unmount a #GMount instance, first call
5560 * g_mount_unmount_with_operation() with (at least) the #GMount instance and a
5561 * #GAsyncReadyCallback. The callback will be fired when the
5562 * operation has resolved (either with success or failure), and a
5563 * #GAsyncReady structure will be passed to the callback. That
5564 * callback should then call g_mount_unmount_with_operation_finish() with the #GMount
5565 * and the #GAsyncReady data to see if the operation was completed
5566 * successfully. If an @error is present when g_mount_unmount_with_operation_finish()
5567 * is called, then it will be filled with any error information.
5572 * SECTION:gmountoperation
5573 * @short_description: Object used for authentication and user interaction
5574 * @include: gio/gio.h
5576 * #GMountOperation provides a mechanism for interacting with the user.
5577 * It can be used for authenticating mountable operations, such as loop
5578 * mounting files, hard drive partitions or server locations. It can
5579 * also be used to ask the user questions or show a list of applications
5580 * preventing unmount or eject operations from completing.
5582 * Note that #GMountOperation is used for more than just #GMount
5583 * objects – for example it is also used in g_drive_start() and
5586 * Users should instantiate a subclass of this that implements all the
5587 * various callbacks to show the required dialogs, such as
5588 * #GtkMountOperation. If no user interaction is desired (for example
5589 * when automounting filesystems at login time), usually %NULL can be
5590 * passed, see each method taking a #GMountOperation for details.
5595 * SECTION:gnetworkaddress
5596 * @short_description: A GSocketConnectable for resolving hostnames
5597 * @include: gio/gio.h
5599 * #GNetworkAddress provides an easy way to resolve a hostname and
5600 * then attempt to connect to that host, handling the possibility of
5601 * multiple IP addresses and multiple address families.
5603 * See #GSocketConnectable for and example of using the connectable
5609 * SECTION:gnetworkmonitor
5610 * @title: GNetworkMonitor
5611 * @short_description: Network status monitor
5612 * @include: gio/gio.h
5614 * #GNetworkMonitor provides an easy-to-use cross-platform API
5615 * for monitoring network connectivity. On Linux, the implementation
5616 * is based on the kernels netlink interface.
5621 * SECTION:gnetworkservice
5622 * @short_description: A GSocketConnectable for resolving SRV records
5623 * @include: gio/gio.h
5625 * Like #GNetworkAddress does with hostnames, #GNetworkService
5626 * provides an easy way to resolve a SRV record, and then attempt to
5627 * connect to one of the hosts that implements that service, handling
5628 * service priority/weighting, multiple IP addresses, and multiple
5631 * See #GSrvTarget for more information about SRV records, and see
5632 * #GSocketConnectable for and example of using the connectable
5638 * SECTION:goutputstream
5639 * @short_description: Base class for implementing streaming output
5640 * @include: gio/gio.h
5642 * #GOutputStream has functions to write to a stream (g_output_stream_write()),
5643 * to close a stream (g_output_stream_close()) and to flush pending writes
5644 * (g_output_stream_flush()).
5646 * To copy the content of an input stream to an output stream without
5647 * manually handling the reads and writes, use g_output_stream_splice().
5649 * All of these functions have async variants too.
5654 * SECTION:gpermission
5655 * @title: GPermission
5656 * @short_description: An object representing the permission to perform a certain action
5658 * A #GPermission represents the status of the caller's permission to
5659 * perform a certain action.
5661 * You can query if the action is currently allowed and if it is
5662 * possible to acquire the permission so that the action will be allowed
5665 * There is also an API to actually acquire the permission and one to
5668 * As an example, a #GPermission might represent the ability for the
5669 * user to write to a #GSettings object. This #GPermission object could
5670 * then be used to decide if it is appropriate to show a "Click here to
5671 * unlock" button in a dialog and to provide the mechanism to invoke
5672 * when that button is clicked.
5677 * SECTION:gpollableinputstream
5678 * @short_description: Interface for pollable input streams
5679 * @include: gio/gio.h
5680 * @see_also: #GInputStream, #GPollableOutputStream, #GFileDescriptorBased
5682 * #GPollableInputStream is implemented by #GInputStreams that
5683 * can be polled for readiness to read. This can be used when
5684 * interfacing with a non-GIO API that expects
5685 * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5692 * SECTION:gpollableoutputstream
5693 * @short_description: Interface for pollable output streams
5694 * @include: gio/gio.h
5695 * @see_also: #GOutputStream, #GFileDescriptorBased, #GPollableInputStream
5697 * #GPollableOutputStream is implemented by #GOutputStreams that
5698 * can be polled for readiness to write. This can be used when
5699 * interfacing with a non-GIO API that expects
5700 * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5707 * SECTION:gpollableutils
5708 * @short_description: #GPollableInputStream / #GPollableOutputStream utilities
5709 * @include: gio/gio.h
5711 * Utility functions for #GPollableInputStream and
5712 * #GPollableOutputStream implementations.
5718 * @short_description: Interface for proxy handling
5720 * A #GProxy handles connecting to a remote host via a given type of
5721 * proxy server. It is implemented by the 'gio-proxy' extension point.
5722 * The extensions are named after their proxy protocol name. As an
5723 * example, a SOCKS5 proxy implementation can be retrieved with the
5724 * name 'socks5' using the function
5725 * g_io_extension_point_get_extension_by_name().
5732 * SECTION:gproxyaddress
5733 * @short_description: An internet address with proxy information
5735 * Support for proxied #GInetSocketAddress.
5740 * SECTION:gproxyresolver
5741 * @short_description: Asynchronous and cancellable network proxy resolver
5742 * @include: gio/gio.h
5744 * #GProxyResolver provides synchronous and asynchronous network proxy
5745 * resolution. #GProxyResolver is used within #GSocketClient through
5746 * the method g_socket_connectable_proxy_enumerate().
5751 * SECTION:gremoteactiongroup
5752 * @title: GRemoteActionGroup
5753 * @short_description: a #GActionGroup that interacts with other processes
5755 * The GRemoteActionGroup interface is implemented by #GActionGroup
5756 * instances that either transmit action invocations to other processes
5757 * or receive action invocations in the local process from other
5760 * The interface has <literal>_full</literal> variants of the two
5761 * methods on #GActionGroup used to activate actions:
5762 * g_action_group_activate_action() and
5763 * g_action_group_change_action_state(). These variants allow a
5764 * "platform data" #GVariant to be specified: a dictionary providing
5765 * context for the action invocation (for example: timestamps, startup
5766 * notification IDs, etc).
5768 * #GDBusActionGroup implements #GRemoteActionGroup. This provides a
5769 * mechanism to send platform data for action invocations over D-Bus.
5771 * Additionally, g_dbus_connection_export_action_group() will check if
5772 * the exported #GActionGroup implements #GRemoteActionGroup and use the
5773 * <literal>_full</literal> variants of the calls if available. This
5774 * provides a mechanism by which to receive platform data for action
5775 * invocations that arrive by way of D-Bus.
5783 * @short_description: Asynchronous and cancellable DNS resolver
5784 * @include: gio/gio.h
5786 * #GResolver provides cancellable synchronous and asynchronous DNS
5787 * resolution, for hostnames (g_resolver_lookup_by_address(),
5788 * g_resolver_lookup_by_name() and their async variants) and SRV
5789 * (service) records (g_resolver_lookup_service()).
5791 * #GNetworkAddress and #GNetworkService provide wrappers around
5792 * #GResolver functionality that also implement #GSocketConnectable,
5793 * making it easy to connect to a remote host/service.
5799 * @short_description: Resource framework
5800 * @include: gio/gio.h
5802 * Applications and libraries often contain binary or textual data that is really part of the
5803 * application, rather than user data. For instance #GtkBuilder .ui files, splashscreen images,
5804 * GMenu markup xml, CSS files, icons, etc. These are often shipped as files in <filename>$datadir/appname</filename>, or
5805 * manually included as literal strings in the code.
5807 * The #GResource API and the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5808 * provide a convenient and efficient alternative to this which has some nice properties. You
5809 * maintain the files as normal files, so its easy to edit them, but during the build the files
5810 * are combined into a binary bundle that is linked into the executable. This means that loading
5811 * the resource files are efficient (as they are already in memory, shared with other instances) and
5812 * simple (no need to check for things like I/O errors or locate the files in the filesystem). It
5813 * also makes it easier to create relocatable applications.
5815 * Resource files can also be marked as compressed. Such files will be included in the resource bundle
5816 * in a compressed form, but will be automatically uncompressed when the resource is used. This
5817 * is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away.
5819 * Resource files can also be marked to be preprocessed, by setting the value of the
5820 * <literal>preprocess</literal> attribute to a comma-separated list of preprocessing options.
5821 * The only options currently supported are:
5823 * <literal>xml-stripblanks</literal> which will use <command>xmllint</command> to strip
5824 * ignorable whitespace from the xml file. For this to work, the <envar>XMLLINT</envar>
5825 * environment variable must be set to the full path to the xmllint executable, or xmllint
5826 * must be in the PATH; otherwise the preprocessing step is skipped.
5828 * <literal>to-pixdata</literal> which will use <command>gdk-pixbuf-pixdata</command> to convert
5829 * images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside
5830 * the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata
5831 * program must be in the PATH, or the <envar>GDK_PIXBUF_PIXDATA</envar> environment variable must be
5832 * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will
5835 * Resource bundles are created by the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5836 * which takes an xml file that describes the bundle, and a set of files that the xml references. These
5837 * are combined into a binary resource bundle.
5839 * <example id="resource-example"><title>Example resource description</title>
5840 * <programlisting><![CDATA[
5841 * <?xml version="1.0" encoding="UTF-8"?>
5843 * <gresource prefix="/org/gtk/Example">
5844 * <file>data/splashscreen.png</file>
5845 * <file compressed="true">dialog.ui</file>
5846 * <file preprocess="xml-stripblanks">menumarkup.xml</file>
5849 * ]]></programlisting></example>
5851 * This will create a resource bundle with the following files:
5852 * <programlisting><![CDATA[
5853 * /org/gtk/Example/data/splashscreen.png
5854 * /org/gtk/Example/dialog.ui
5855 * /org/gtk/Example/menumarkup.xml
5856 * ]]></programlisting>
5858 * Note that all resources in the process share the same namespace, so use java-style
5859 * path prefixes (like in the above example) to avoid conflicts.
5861 * You can then use <link linkend="glib-compile-resources">glib-compile-resources</link> to compile the xml to a
5862 * binary bundle that you can load with g_resource_load(). However, its more common to use the --generate-source and
5863 * --generate-header arguments to create a source file and header to link directly into your application.
5865 * Once a #GResource has been created and registered all the data in it can be accessed globally in the process by
5866 * using API calls like g_resources_open_stream() to stream the data or g_resources_lookup_data() to get a direct pointer
5867 * to the data. You can also use uris like "resource:///org/gtk/Example/data/splashscreen.png" with #GFile to access
5868 * the resource data.
5870 * There are two forms of the generated source, the default version uses the compiler support for constructor
5871 * and destructor functions (where available) to automatically create and register the #GResource on startup
5872 * or library load time. If you pass --manual-register two functions to register/unregister the resource is instead
5873 * created. This requires an explicit initialization call in your application/library, but it works on all platforms,
5874 * even on the minor ones where this is not available. (Constructor support is available for at least Win32, MacOS and Linux.)
5876 * Note that resource data can point directly into the data segment of e.g. a library, so if you are unloading libraries
5877 * during runtime you need to be very careful with keeping around pointers to data from a resource, as this goes away
5878 * when the library is unloaded. However, in practice this is not generally a problem, since most resource accesses
5879 * is for your own resources, and resource data is often used once, during parsing, and then released.
5887 * @short_description: Stream seeking interface
5888 * @include: gio/gio.h
5889 * @see_also: #GInputStream, #GOutputStream
5891 * #GSeekable is implemented by streams (implementations of
5892 * #GInputStream or #GOutputStream) that support seeking.
5898 * @short_description: High-level API for application settings
5900 * The #GSettings class provides a convenient API for storing and retrieving
5901 * application settings.
5903 * Reads and writes can be considered to be non-blocking. Reading
5904 * settings with #GSettings is typically extremely fast: on
5905 * approximately the same order of magnitude (but slower than) a
5906 * #GHashTable lookup. Writing settings is also extremely fast in terms
5907 * of time to return to your application, but can be extremely expensive
5908 * for other threads and other processes. Many settings backends
5909 * (including dconf) have lazy initialisation which means in the common
5910 * case of the user using their computer without modifying any settings
5911 * a lot of work can be avoided. For dconf, the D-Bus service doesn't
5912 * even need to be started in this case. For this reason, you should
5913 * only ever modify #GSettings keys in response to explicit user action.
5914 * Particular care should be paid to ensure that modifications are not
5915 * made during startup -- for example, when setting the initial value
5916 * of preferences widgets. The built-in g_settings_bind() functionality
5917 * is careful not to write settings in response to notify signals as a
5918 * result of modifications that it makes to widgets.
5920 * When creating a GSettings instance, you have to specify a schema
5921 * that describes the keys in your settings and their types and default
5922 * values, as well as some other information.
5924 * Normally, a schema has as fixed path that determines where the settings
5925 * are stored in the conceptual global tree of settings. However, schemas
5926 * can also be 'relocatable', i.e. not equipped with a fixed path. This is
5927 * useful e.g. when the schema describes an 'account', and you want to be
5928 * able to store a arbitrary number of accounts.
5930 * Paths must start with and end with a forward slash character ('/')
5931 * and must not contain two sequential slash characters. Paths should
5932 * be chosen based on a domain name associated with the program or
5933 * library to which the settings belong. Examples of paths are
5934 * "/org/gtk/settings/file-chooser/" and "/ca/desrt/dconf-editor/".
5935 * Paths should not start with "/apps/", "/desktop/" or "/system/" as
5936 * they often did in GConf.
5938 * Unlike other configuration systems (like GConf), GSettings does not
5939 * restrict keys to basic types like strings and numbers. GSettings stores
5940 * values as #GVariant, and allows any #GVariantType for keys. Key names
5941 * are restricted to lowercase characters, numbers and '-'. Furthermore,
5942 * the names must begin with a lowercase character, must not end
5943 * with a '-', and must not contain consecutive dashes.
5945 * Similar to GConf, the default values in GSettings schemas can be
5946 * localized, but the localized values are stored in gettext catalogs
5947 * and looked up with the domain that is specified in the
5948 * <tag class="attribute">gettext-domain</tag> attribute of the
5949 * <tag class="starttag">schemalist</tag> or <tag class="starttag">schema</tag>
5950 * elements and the category that is specified in the l10n attribute of the
5951 * <tag class="starttag">key</tag> element.
5953 * GSettings uses schemas in a compact binary form that is created
5954 * by the <link linkend="glib-compile-schemas">glib-compile-schemas</link>
5955 * utility. The input is a schema description in an XML format that can be
5956 * described by the following DTD:
5957 * |[<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/gschema.dtd"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include>]|
5959 * glib-compile-schemas expects schema files to have the extension <filename>.gschema.xml</filename>
5961 * At runtime, schemas are identified by their id (as specified
5962 * in the <tag class="attribute">id</tag> attribute of the
5963 * <tag class="starttag">schema</tag> element). The
5964 * convention for schema ids is to use a dotted name, similar in
5965 * style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
5966 * if the settings are for a specific service that owns a D-Bus bus name,
5967 * the D-Bus bus name and schema id should match. For schemas which deal
5968 * with settings not associated with one named application, the id should
5969 * not use StudlyCaps, e.g. "org.gnome.font-rendering".
5971 * In addition to #GVariant types, keys can have types that have enumerated
5972 * types. These can be described by a <tag class="starttag">choice</tag>,
5973 * <tag class="starttag">enum</tag> or <tag class="starttag">flags</tag> element, see
5974 * <xref linkend="schema-enumerated"/>. The underlying type of
5975 * such a key is string, but you can use g_settings_get_enum(),
5976 * g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags()
5977 * access the numeric values corresponding to the string value of enum
5980 * <example id="schema-default-values"><title>Default values</title>
5981 * <programlisting><![CDATA[
5983 * <schema id="org.gtk.Test" path="/org/gtk/Test/" gettext-domain="test">
5985 * <key name="greeting" type="s">
5986 * <default l10n="messages">"Hello, earthlings"</default>
5987 * <summary>A greeting</summary>
5989 * Greeting of the invading martians
5993 * <key name="box" type="(ii)">
5994 * <default>(20,30)</default>
5999 * ]]></programlisting></example>
6001 * <example id="schema-enumerated"><title>Ranges, choices and enumerated types</title>
6002 * <programlisting><![CDATA[
6005 * <enum id="org.gtk.Test.myenum">
6006 * <value nick="first" value="1"/>
6007 * <value nick="second" value="2"/>
6010 * <flags id="org.gtk.Test.myflags">
6011 * <value nick="flag1" value="1"/>
6012 * <value nick="flag2" value="2"/>
6013 * <value nick="flag3" value="4"/>
6016 * <schema id="org.gtk.Test">
6018 * <key name="key-with-range" type="i">
6019 * <range min="1" max="100"/>
6020 * <default>10</default>
6023 * <key name="key-with-choices" type="s">
6025 * <choice value='Elisabeth'/>
6026 * <choice value='Annabeth'/>
6027 * <choice value='Joe'/>
6030 * <alias value='Anna' target='Annabeth'/>
6031 * <alias value='Beth' target='Elisabeth'/>
6033 * <default>'Joe'</default>
6036 * <key name='enumerated-key' enum='org.gtk.Test.myenum'>
6037 * <default>'first'</default>
6040 * <key name='flags-key' flags='org.gtk.Test.myflags'>
6041 * <default>["flag1",flag2"]</default>
6045 * ]]></programlisting></example>
6048 * <title>Vendor overrides</title>
6050 * Default values are defined in the schemas that get installed by
6051 * an application. Sometimes, it is necessary for a vendor or distributor
6052 * to adjust these defaults. Since patching the XML source for the schema
6053 * is inconvenient and error-prone,
6054 * <link linkend="glib-compile-schemas">glib-compile-schemas</link> reads
6055 * so-called 'vendor override' files. These are keyfiles in the same
6056 * directory as the XML schema sources which can override default values.
6057 * The schema id serves as the group name in the key file, and the values
6058 * are expected in serialized GVariant form, as in the following example:
6059 * <informalexample><programlisting>
6063 * </programlisting></informalexample>
6066 * glib-compile-schemas expects schema files to have the extension
6067 * <filename>.gschema.override</filename>
6072 * <title>Binding</title>
6074 * A very convenient feature of GSettings lets you bind #GObject properties
6075 * directly to settings, using g_settings_bind(). Once a GObject property
6076 * has been bound to a setting, changes on either side are automatically
6077 * propagated to the other side. GSettings handles details like
6078 * mapping between GObject and GVariant types, and preventing infinite
6082 * This makes it very easy to hook up a preferences dialog to the
6083 * underlying settings. To make this even more convenient, GSettings
6084 * looks for a boolean property with the name "sensitivity" and
6085 * automatically binds it to the writability of the bound setting.
6086 * If this 'magic' gets in the way, it can be suppressed with the
6087 * #G_SETTINGS_BIND_NO_SENSITIVITY flag.
6094 * SECTION:gsettingsbackend
6095 * @title: GSettingsBackend
6096 * @short_description: Interface for settings backend implementations
6097 * @include: gio/gsettingsbackend.h
6098 * @see_also: #GSettings, #GIOExtensionPoint
6100 * The #GSettingsBackend interface defines a generic interface for
6101 * non-strictly-typed data that is stored in a hierarchy. To implement
6102 * an alternative storage backend for #GSettings, you need to implement
6103 * the #GSettingsBackend interface and then make it implement the
6104 * extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.
6106 * The interface defines methods for reading and writing values, a
6107 * method for determining if writing of certain values will fail
6108 * (lockdown) and a change notification mechanism.
6110 * The semantics of the interface are very precisely defined and
6111 * implementations must carefully adhere to the expectations of
6112 * callers that are documented on each of the interface methods.
6114 * Some of the GSettingsBackend functions accept or return a #GTree.
6115 * These trees always have strings as keys and #GVariant as values.
6116 * g_settings_backend_create_tree() is a convenience function to create
6120 * The #GSettingsBackend API is exported to allow third-party
6121 * implementations, but does not carry the same stability guarantees
6122 * as the public GIO API. For this reason, you have to define the
6123 * C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including
6124 * <filename>gio/gsettingsbackend.h</filename>
6130 * SECTION:gsettingsschema
6131 * @short_description: introspecting and controlling the loading of GSettings schemas
6133 * The #GSettingsSchemaSource and #GSettingsSchema APIs provide a
6134 * mechanism for advanced control over the loading of schemas and a
6135 * mechanism for introspecting their content.
6137 * Plugin loading systems that wish to provide plugins a way to access
6138 * settings face the problem of how to make the schemas for these
6139 * settings visible to GSettings. Typically, a plugin will want to ship
6140 * the schema along with itself and it won't be installed into the
6141 * standard system directories for schemas.
6143 * #GSettingsSchemaSource provides a mechanism for dealing with this by
6144 * allowing the creation of a new 'schema source' from which schemas can
6145 * be acquired. This schema source can then become part of the metadata
6146 * associated with the plugin and queried whenever the plugin requires
6147 * access to some settings.
6149 * Consider the following example:
6155 * GSettingsSchemaSource *schema_source;
6160 * initialise_plugin (const gchar *dir)
6166 * plugin->schema_source =
6167 * g_settings_new_schema_source_from_directory (dir,
6168 * g_settings_schema_source_get_default (), FALSE, NULL);
6178 * plugin_get_settings (Plugin *plugin,
6179 * const gchar *schema_id)
6181 * GSettingsSchema *schema;
6183 * if (schema_id == NULL)
6184 * schema_id = plugin->identifier;
6186 * schema = g_settings_schema_source_lookup (plugin->schema_source,
6187 * schema_id, FALSE);
6189 * if (schema == NULL)
6191 * ... disable the plugin or abort, etc ...
6194 * return g_settings_new_full (schema, NULL, NULL);
6198 * The code above shows how hooks should be added to the code that
6199 * initialises (or enables) the plugin to create the schema source and
6200 * how an API can be added to the plugin system to provide a convenient
6201 * way for the plugin to access its settings, using the schemas that it
6204 * From the standpoint of the plugin, it would need to ensure that it
6205 * ships a gschemas.compiled file as part of itself, and then simply do
6210 * GSettings *settings;
6213 * settings = plugin_get_settings (self, NULL);
6214 * some_value = g_settings_get_int (settings, "some-value");
6219 * It's also possible that the plugin system expects the schema source
6220 * files (ie: .gschema.xml files) instead of a gschemas.compiled file.
6221 * In that case, the plugin loading system must compile the schemas for
6222 * itself before attempting to create the settings source.
6229 * SECTION:gsimpleaction
6230 * @title: GSimpleAction
6231 * @short_description: A simple GAction implementation
6233 * A #GSimpleAction is the obvious simple implementation of the #GAction
6234 * interface. This is the easiest way to create an action for purposes of
6235 * adding it to a #GSimpleActionGroup.
6237 * See also #GtkAction.
6242 * SECTION:gsimpleactiongroup
6243 * @title: GSimpleActionGroup
6244 * @short_description: A simple GActionGroup implementation
6246 * #GSimpleActionGroup is a hash table filled with #GAction objects,
6247 * implementing the #GActionGroup and #GActionMap interfaces.
6252 * SECTION:gsimpleasyncresult
6253 * @short_description: Simple asynchronous results implementation
6254 * @include: gio/gio.h
6255 * @see_also: #GAsyncResult
6258 * As of GLib 2.36, #GSimpleAsyncResult is deprecated in favor of
6259 * #GTask, which provides a simpler API.
6262 * #GSimpleAsyncResult implements #GAsyncResult.
6264 * GSimpleAsyncResult handles #GAsyncReadyCallback<!-- -->s, error
6265 * reporting, operation cancellation and the final state of an operation,
6266 * completely transparent to the application. Results can be returned
6267 * as a pointer e.g. for functions that return data that is collected
6268 * asynchronously, a boolean value for checking the success or failure
6269 * of an operation, or a #gssize for operations which return the number
6270 * of bytes modified by the operation; all of the simple return cases
6273 * Most of the time, an application will not need to know of the details
6274 * of this API; it is handled transparently, and any necessary operations
6275 * are handled by #GAsyncResult's interface. However, if implementing a
6276 * new GIO module, for writing language bindings, or for complex
6277 * applications that need better control of how asynchronous operations
6278 * are completed, it is important to understand this functionality.
6280 * GSimpleAsyncResults are tagged with the calling function to ensure
6281 * that asynchronous functions and their finishing functions are used
6282 * together correctly.
6284 * To create a new #GSimpleAsyncResult, call g_simple_async_result_new().
6285 * If the result needs to be created for a #GError, use
6286 * g_simple_async_result_new_from_error() or
6287 * g_simple_async_result_new_take_error(). If a #GError is not available
6288 * (e.g. the asynchronous operation's doesn't take a #GError argument),
6289 * but the result still needs to be created for an error condition, use
6290 * g_simple_async_result_new_error() (or g_simple_async_result_set_error_va()
6291 * if your application or binding requires passing a variable argument list
6292 * directly), and the error can then be propagated through the use of
6293 * g_simple_async_result_propagate_error().
6295 * An asynchronous operation can be made to ignore a cancellation event by
6296 * calling g_simple_async_result_set_handle_cancellation() with a
6297 * #GSimpleAsyncResult for the operation and %FALSE. This is useful for
6298 * operations that are dangerous to cancel, such as close (which would
6299 * cause a leak if cancelled before being run).
6301 * GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
6302 * or it can use #GThread<!-- -->s.
6303 * g_simple_async_result_complete() will finish an I/O task directly
6304 * from the point where it is called. g_simple_async_result_complete_in_idle()
6305 * will finish it from an idle handler in the <link
6306 * linkend="g-main-context-push-thread-default">thread-default main
6307 * context</link>. g_simple_async_result_run_in_thread() will run the
6308 * job in a separate thread and then deliver the result to the
6309 * thread-default main context.
6311 * To set the results of an asynchronous function,
6312 * g_simple_async_result_set_op_res_gpointer(),
6313 * g_simple_async_result_set_op_res_gboolean(), and
6314 * g_simple_async_result_set_op_res_gssize()
6315 * are provided, setting the operation's result to a gpointer, gboolean, or
6316 * gssize, respectively.
6318 * Likewise, to get the result of an asynchronous function,
6319 * g_simple_async_result_get_op_res_gpointer(),
6320 * g_simple_async_result_get_op_res_gboolean(), and
6321 * g_simple_async_result_get_op_res_gssize() are
6322 * provided, getting the operation's result as a gpointer, gboolean, and
6323 * gssize, respectively.
6325 * For the details of the requirements implementations must respect, see
6326 * #GAsyncResult. A typical implementation of an asynchronous operation
6327 * using GSimpleAsyncResult looks something like this:
6331 * baked_cb (Cake *cake,
6332 * gpointer user_data)
6334 * /* In this example, this callback is not given a reference to the cake, so
6335 * * the GSimpleAsyncResult has to take a reference to it.
6337 * GSimpleAsyncResult *result = user_data;
6340 * g_simple_async_result_set_error (result,
6342 * BAKER_ERROR_NO_FLOUR,
6343 * "Go to the supermarket");
6345 * g_simple_async_result_set_op_res_gpointer (result,
6346 * g_object_ref (cake),
6350 * /* In this example, we assume that baked_cb is called as a callback from
6351 * * the mainloop, so it's safe to complete the operation synchronously here.
6352 * * If, however, _baker_prepare_cake () might call its callback without
6353 * * first returning to the mainloop — inadvisable, but some APIs do so —
6354 * * we would need to use g_simple_async_result_complete_in_idle().
6356 * g_simple_async_result_complete (result);
6357 * g_object_unref (result);
6361 * baker_bake_cake_async (Baker *self,
6363 * GAsyncReadyCallback callback,
6364 * gpointer user_data)
6366 * GSimpleAsyncResult *simple;
6371 * g_simple_async_report_error_in_idle (G_OBJECT (self),
6375 * BAKER_ERROR_TOO_SMALL,
6376 * "%ucm radius cakes are silly",
6381 * simple = g_simple_async_result_new (G_OBJECT (self),
6384 * baker_bake_cake_async);
6385 * cake = _baker_get_cached_cake (self, radius);
6389 * g_simple_async_result_set_op_res_gpointer (simple,
6390 * g_object_ref (cake),
6392 * g_simple_async_result_complete_in_idle (simple);
6393 * g_object_unref (simple);
6394 * /* Drop the reference returned by _baker_get_cached_cake(); the
6395 * * GSimpleAsyncResult has taken its own reference.
6397 * g_object_unref (cake);
6401 * _baker_prepare_cake (self, radius, baked_cb, simple);
6405 * baker_bake_cake_finish (Baker *self,
6406 * GAsyncResult *result,
6409 * GSimpleAsyncResult *simple;
6412 * g_return_val_if_fail (g_simple_async_result_is_valid (result,
6414 * baker_bake_cake_async),
6417 * simple = (GSimpleAsyncResult *) result;
6419 * if (g_simple_async_result_propagate_error (simple, error))
6422 * cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
6423 * return g_object_ref (cake);
6430 * SECTION:gsimplepermission
6431 * @title: GSimplePermission
6432 * @short_description: A GPermission that doesn't change value
6434 * #GSimplePermission is a trivial implementation of #GPermission that
6435 * represents a permission that is either always or never allowed. The
6436 * value is given at construction and doesn't change.
6438 * Calling request or release will result in errors.
6444 * @short_description: Low-level socket object
6445 * @include: gio/gio.h
6446 * @see_also: #GInitable
6448 * A #GSocket is a low-level networking primitive. It is a more or less
6449 * direct mapping of the BSD socket API in a portable GObject based API.
6450 * It supports both the UNIX socket implementations and winsock2 on Windows.
6452 * #GSocket is the platform independent base upon which the higher level
6453 * network primitives are based. Applications are not typically meant to
6454 * use it directly, but rather through classes like #GSocketClient,
6455 * #GSocketService and #GSocketConnection. However there may be cases where
6456 * direct use of #GSocket is useful.
6458 * #GSocket implements the #GInitable interface, so if it is manually constructed
6459 * by e.g. g_object_new() you must call g_initable_init() and check the
6460 * results before using the object. This is done automatically in
6461 * g_socket_new() and g_socket_new_from_fd(), so these functions can return
6464 * Sockets operate in two general modes, blocking or non-blocking. When
6465 * in blocking mode all operations block until the requested operation
6466 * is finished or there is an error. In non-blocking mode all calls that
6467 * would block return immediately with a %G_IO_ERROR_WOULD_BLOCK error.
6468 * To know when a call would successfully run you can call g_socket_condition_check(),
6469 * or g_socket_condition_wait(). You can also use g_socket_create_source() and
6470 * attach it to a #GMainContext to get callbacks when I/O is possible.
6471 * Note that all sockets are always set to non blocking mode in the system, and
6472 * blocking mode is emulated in GSocket.
6474 * When working in non-blocking mode applications should always be able to
6475 * handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other
6476 * function said that I/O was possible. This can easily happen in case
6477 * of a race condition in the application, but it can also happen for other
6478 * reasons. For instance, on Windows a socket is always seen as writable
6479 * until a write returns %G_IO_ERROR_WOULD_BLOCK.
6481 * #GSocket<!-- -->s can be either connection oriented or datagram based.
6482 * For connection oriented types you must first establish a connection by
6483 * either connecting to an address or accepting a connection from another
6484 * address. For connectionless socket types the target/source address is
6485 * specified or received in each I/O operation.
6487 * All socket file descriptors are set to be close-on-exec.
6489 * Note that creating a #GSocket causes the signal %SIGPIPE to be
6490 * ignored for the remainder of the program. If you are writing a
6491 * command-line utility that uses #GSocket, you may need to take into
6492 * account the fact that your program will not automatically be killed
6493 * if it tries to write to %stdout after it has been closed.
6500 * SECTION:gsocketaddress
6501 * @short_description: Abstract base class representing endpoints for socket communication
6503 * #GSocketAddress is the equivalent of <type>struct sockaddr</type>
6504 * in the BSD sockets API. This is an abstract class; use
6505 * #GInetSocketAddress for internet sockets, or #GUnixSocketAddress
6506 * for UNIX domain sockets.
6511 * SECTION:gsocketclient
6512 * @short_description: Helper for connecting to a network service
6513 * @include: gio/gio.h
6514 * @see_also: #GSocketConnection, #GSocketListener
6516 * #GSocketClient is a lightweight high-level utility class for connecting to
6517 * a network host using a connection oriented socket type.
6519 * You create a #GSocketClient object, set any options you want, and then
6520 * call a sync or async connect operation, which returns a #GSocketConnection
6521 * subclass on success.
6523 * The type of the #GSocketConnection object returned depends on the type of
6524 * the underlying socket that is in use. For instance, for a TCP/IP connection
6525 * it will be a #GTcpConnection.
6527 * As #GSocketClient is a lightweight object, you don't need to cache it. You
6528 * can just create a new one any time you need one.
6535 * SECTION:gsocketconnectable
6536 * @short_description: Interface for potential socket endpoints
6538 * Objects that describe one or more potential socket endpoints
6539 * implement #GSocketConnectable. Callers can then use
6540 * g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator
6541 * to try out each socket address in turn until one succeeds, as shown
6542 * in the sample code below.
6545 * MyConnectionType *
6546 * connect_to_host (const char *hostname,
6548 * GCancellable *cancellable,
6551 * MyConnection *conn = NULL;
6552 * GSocketConnectable *addr;
6553 * GSocketAddressEnumerator *enumerator;
6554 * GSocketAddress *sockaddr;
6555 * GError *conn_error = NULL;
6557 * addr = g_network_address_new ("www.gnome.org", 80);
6558 * enumerator = g_socket_connectable_enumerate (addr);
6559 * g_object_unref (addr);
6561 * /<!-- -->* Try each sockaddr until we succeed. Record the first
6562 * * connection error, but not any further ones (since they'll probably
6563 * * be basically the same as the first).
6565 * while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error))
6567 * conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error);
6568 * g_object_unref (sockaddr);
6570 * g_object_unref (enumerator);
6576 * /<!-- -->* We couldn't connect to the first address, but we succeeded
6577 * * in connecting to a later address.
6579 * g_error_free (conn_error);
6585 * /<!-- -->* Either the initial lookup failed, or else the caller
6589 * g_error_free (conn_error);
6594 * g_error_propagate (error, conn_error);
6603 * SECTION:gsocketconnection
6604 * @short_description: A socket connection
6605 * @include: gio/gio.h
6606 * @see_also: #GIOStream, #GSocketClient, #GSocketListener
6608 * #GSocketConnection is a #GIOStream for a connected socket. They
6609 * can be created either by #GSocketClient when connecting to a host,
6610 * or by #GSocketListener when accepting a new client.
6612 * The type of the #GSocketConnection object returned from these calls
6613 * depends on the type of the underlying socket that is in use. For
6614 * instance, for a TCP/IP connection it will be a #GTcpConnection.
6616 * Choosing what type of object to construct is done with the socket
6617 * connection factory, and it is possible for 3rd parties to register
6618 * custom socket connection types for specific combination of socket
6619 * family/type/protocol using g_socket_connection_factory_register_type().
6626 * SECTION:gsocketcontrolmessage
6627 * @title: GSocketControlMessage
6628 * @short_description: A GSocket control message
6629 * @see_also: #GSocket.
6631 * A #GSocketControlMessage is a special-purpose utility message that
6632 * can be sent to or received from a #GSocket. These types of
6633 * messages are often called "ancillary data".
6635 * The message can represent some sort of special instruction to or
6636 * information from the socket or can represent a special kind of
6637 * transfer to the peer (for example, sending a file description over
6640 * These messages are sent with g_socket_send_message() and received
6641 * with g_socket_receive_message().
6643 * To extend the set of control message that can be sent, subclass this
6644 * class and override the get_size, get_level, get_type and serialize
6647 * To extend the set of control messages that can be received, subclass
6648 * this class and implement the deserialize method. Also, make sure your
6649 * class is registered with the GType typesystem before calling
6650 * g_socket_receive_message() to read such a message.
6657 * SECTION:gsocketlistener
6658 * @title: GSocketListener
6659 * @short_description: Helper for accepting network client connections
6660 * @see_also: #GThreadedSocketService, #GSocketService.
6662 * A #GSocketListener is an object that keeps track of a set
6663 * of server sockets and helps you accept sockets from any of the
6664 * socket, either sync or async.
6666 * If you want to implement a network server, also look at #GSocketService
6667 * and #GThreadedSocketService which are subclass of #GSocketListener
6668 * that makes this even easier.
6675 * SECTION:gsocketservice
6676 * @title: GSocketService
6677 * @short_description: Make it easy to implement a network service
6678 * @see_also: #GThreadedSocketService, #GSocketListener.
6680 * A #GSocketService is an object that represents a service that
6681 * is provided to the network or over local sockets. When a new
6682 * connection is made to the service the #GSocketService::incoming
6683 * signal is emitted.
6685 * A #GSocketService is a subclass of #GSocketListener and you need
6686 * to add the addresses you want to accept connections on with the
6687 * #GSocketListener APIs.
6689 * There are two options for implementing a network service based on
6690 * #GSocketService. The first is to create the service using
6691 * g_socket_service_new() and to connect to the #GSocketService::incoming
6692 * signal. The second is to subclass #GSocketService and override the
6693 * default signal handler implementation.
6695 * In either case, the handler must immediately return, or else it
6696 * will block additional incoming connections from being serviced.
6697 * If you are interested in writing connection handlers that contain
6698 * blocking code then see #GThreadedSocketService.
6700 * The socket service runs on the main loop of the <link
6701 * linkend="g-main-context-push-thread-default-context">thread-default
6702 * context</link> of the thread it is created in, and is not
6703 * threadsafe in general. However, the calls to start and stop the
6704 * service are thread-safe so these can be used from threads that
6705 * handle incoming clients.
6712 * SECTION:gsrvtarget
6713 * @short_description: DNS SRV record target
6714 * @include: gio/gio.h
6716 * SRV (service) records are used by some network protocols to provide
6717 * service-specific aliasing and load-balancing. For example, XMPP
6718 * (Jabber) uses SRV records to locate the XMPP server for a domain;
6719 * rather than connecting directly to "example.com" or assuming a
6720 * specific server hostname like "xmpp.example.com", an XMPP client
6721 * would look up the "xmpp-client" SRV record for "example.com", and
6722 * then connect to whatever host was pointed to by that record.
6724 * You can use g_resolver_lookup_service() or
6725 * g_resolver_lookup_service_async() to find the #GSrvTarget<!-- -->s
6726 * for a given service. However, if you are simply planning to connect
6727 * to the remote service, you can use #GNetworkService's
6728 * #GSocketConnectable interface and not need to worry about
6729 * #GSrvTarget at all.
6735 * @short_description: Cancellable synchronous or asynchronous task and result
6736 * @include: gio/gio.h
6737 * @see_also: #GAsyncResult
6740 * A #GTask represents and manages a cancellable "task".
6743 * <title>Asynchronous operations</title>
6745 * The most common usage of #GTask is as a #GAsyncResult, to
6746 * manage data during an asynchronous operation. You call
6747 * g_task_new() in the "start" method, followed by
6748 * g_task_set_task_data() and the like if you need to keep some
6749 * additional data associated with the task, and then pass the
6750 * task object around through your asynchronous operation.
6751 * Eventually, you will call a method such as
6752 * g_task_return_pointer() or g_task_return_error(), which will
6753 * save the value you give it and then invoke the task's callback
6754 * function (waiting until the next next iteration of the main
6755 * loop first, if necessary). The caller will pass the #GTask back
6756 * to the operation's finish function (as a #GAsyncResult), and
6757 * you can use g_task_propagate_pointer() or the like to extract
6760 * <example id="gtask-async"><title>GTask as a GAsyncResult</title>
6763 * CakeFrostingType frosting;
6768 * decoration_data_free (DecorationData *decoration)
6770 * g_free (decoration->message);
6771 * g_slice_free (DecorationData, decoration);
6775 * baked_cb (Cake *cake,
6776 * gpointer user_data)
6778 * GTask *task = user_data;
6779 * DecorationData *decoration = g_task_get_task_data (task);
6780 * GError *error = NULL;
6784 * g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_NO_FLOUR,
6785 * "Go to the supermarket");
6786 * g_object_unref (task);
6790 * if (!cake_decorate (cake, decoration->frosting, decoration->message, &error))
6792 * g_object_unref (cake);
6793 * /* g_task_return_error() takes ownership of error */
6794 * g_task_return_error (task, error);
6795 * g_object_unref (task);
6799 * g_task_return_pointer (result, cake, g_object_unref);
6800 * g_object_unref (task);
6804 * baker_bake_cake_async (Baker *self,
6806 * CakeFlavor flavor,
6807 * CakeFrostingType frosting,
6808 * const char *message,
6809 * GCancellable *cancellable,
6810 * GAsyncReadyCallback callback,
6811 * gpointer user_data)
6814 * DecorationData *decoration;
6817 * task = g_task_new (self, cancellable, callback, user_data);
6820 * g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_TOO_SMALL,
6821 * "%ucm radius cakes are silly",
6823 * g_object_unref (task);
6827 * cake = _baker_get_cached_cake (self, radius, flavor, frosting, message);
6830 * /* _baker_get_cached_cake() returns a reffed cake */
6831 * g_task_return_pointer (task, cake, g_object_unref);
6832 * g_object_unref (task);
6836 * decoration = g_slice_new (DecorationData);
6837 * decoration->frosting = frosting;
6838 * decoration->message = g_strdup (message);
6839 * g_task_set_task_data (task, decoration, (GDestroyNotify) decoration_data_free);
6841 * _baker_begin_cake (self, radius, flavor, cancellable, baked_cb, task);
6845 * baker_bake_cake_finish (Baker *self,
6846 * GAsyncResult *result,
6849 * g_return_val_if_fail (g_task_is_valid (result, self), NULL);
6851 * return g_task_propagate_pointer (G_TASK (result), error);
6857 * <title>Chained asynchronous operations</title>
6859 * #GTask also tries to simplify asynchronous operations that
6860 * internally chain together several smaller asynchronous
6861 * operations. g_task_get_cancellable(), g_task_get_context(), and
6862 * g_task_get_priority() allow you to get back the task's
6863 * #GCancellable, #GMainContext, and <link
6864 * linkend="io-priority">I/O priority</link> when starting a new
6865 * subtask, so you don't have to keep track of them yourself.
6866 * g_task_attach_source() simplifies the case of waiting for a
6867 * source to fire (automatically using the correct #GMainContext
6870 * <example id="gtask-chained"><title>Chained asynchronous operations</title>
6874 * CakeFrostingType frosting;
6879 * decoration_data_free (BakingData *bd)
6882 * g_object_unref (bd->cake);
6883 * g_free (bd->message);
6884 * g_slice_free (BakingData, bd);
6888 * decorated_cb (Cake *cake,
6889 * GAsyncResult *result,
6890 * gpointer user_data)
6892 * GTask *task = user_data;
6893 * GError *error = NULL;
6895 * if (!cake_decorate_finish (cake, result, &error))
6897 * g_object_unref (cake);
6898 * g_task_return_error (task, error);
6899 * g_object_unref (task);
6903 * /* baking_data_free() will drop its ref on the cake, so
6904 * * we have to take another here to give to the caller.
6906 * g_task_return_pointer (result, g_object_ref (cake), g_object_unref);
6907 * g_object_unref (task);
6911 * decorator_ready (gpointer user_data)
6913 * GTask *task = user_data;
6914 * BakingData *bd = g_task_get_task_data (task);
6916 * cake_decorate_async (bd->cake, bd->frosting, bd->message,
6917 * g_task_get_cancellable (task),
6918 * decorated_cb, task);
6922 * baked_cb (Cake *cake,
6923 * gpointer user_data)
6925 * GTask *task = user_data;
6926 * BakingData *bd = g_task_get_task_data (task);
6927 * GError *error = NULL;
6931 * g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_NO_FLOUR,
6932 * "Go to the supermarket");
6933 * g_object_unref (task);
6939 * /* Bail out now if the user has already cancelled */
6940 * if (g_task_return_error_if_cancelled (g_task_get_cancellable (task)))
6942 * g_object_unref (task);
6946 * if (cake_decorator_available (cake))
6947 * decorator_ready (task);
6952 * source = cake_decorator_wait_source_new (cake);
6953 * /* Attach @source to @task's GMainContext and have it call
6954 * * decorator_ready() when it is ready.
6956 * g_task_attach_source (task, source,
6957 * G_CALLBACK (decorator_ready));
6958 * g_source_unref (source);
6963 * baker_bake_cake_async (Baker *self,
6965 * CakeFlavor flavor,
6966 * CakeFrostingType frosting,
6967 * const char *message,
6969 * GCancellable *cancellable,
6970 * GAsyncReadyCallback callback,
6971 * gpointer user_data)
6976 * task = g_task_new (self, cancellable, callback, user_data);
6977 * g_task_set_priority (task, priority);
6979 * bd = g_slice_new0 (BakingData);
6980 * bd->frosting = frosting;
6981 * bd->message = g_strdup (message);
6982 * g_task_set_task_data (task, bd, (GDestroyNotify) baking_data_free);
6984 * _baker_begin_cake (self, radius, flavor, cancellable, baked_cb, task);
6988 * baker_bake_cake_finish (Baker *self,
6989 * GAsyncResult *result,
6992 * g_return_val_if_fail (g_task_is_valid (result, self), NULL);
6994 * return g_task_propagate_pointer (G_TASK (result), error);
7000 * <title>Asynchronous operations from synchronous ones</title>
7002 * You can use g_task_run_in_thread() to turn a synchronous
7003 * operation into an asynchronous one, by running it in a thread
7004 * which will then dispatch the result back to the caller's
7005 * #GMainContext when it completes.
7007 * <example id="gtask-run-in-thread"><title>g_task_run_in_thread()</title>
7011 * CakeFlavor flavor;
7012 * CakeFrostingType frosting;
7017 * cake_data_free (CakeData *cake_data)
7019 * g_free (cake_data->message);
7020 * g_slice_free (CakeData, cake_data);
7024 * bake_cake_thread (GTask *task,
7025 * gpointer source_object,
7026 * gpointer task_data,
7027 * GCancellable *cancellable)
7029 * Baker *self = source_object;
7030 * CakeData *cake_data = task_data;
7032 * GError *error = NULL;
7034 * cake = bake_cake (baker, cake_data->radius, cake_data->flavor,
7035 * cake_data->frosting, cake_data->message,
7036 * cancellable, &error);
7038 * g_task_return_pointer (task, cake, g_object_unref);
7040 * g_task_return_error (task, error);
7044 * baker_bake_cake_async (Baker *self,
7046 * CakeFlavor flavor,
7047 * CakeFrostingType frosting,
7048 * const char *message,
7049 * GCancellable *cancellable,
7050 * GAsyncReadyCallback callback,
7051 * gpointer user_data)
7053 * CakeData *cake_data;
7056 * cake_data = g_slice_new (CakeData);
7057 * cake_data->radius = radius;
7058 * cake_data->flavor = flavor;
7059 * cake_data->frosting = frosting;
7060 * cake_data->message = g_strdup (message);
7061 * task = g_task_new (self, cancellable, callback, user_data);
7062 * g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7063 * g_task_run_in_thread (task, bake_cake_thread);
7067 * baker_bake_cake_finish (Baker *self,
7068 * GAsyncResult *result,
7071 * g_return_val_if_fail (g_task_is_valid (result, self), NULL);
7073 * return g_task_propagate_pointer (G_TASK (result), error);
7079 * <title>Adding cancellability to uncancellable tasks</title>
7081 * Finally, g_task_run_in_thread() and g_task_run_in_thread_sync()
7082 * can be used to turn an uncancellable operation into a
7083 * cancellable one. If you call g_task_set_return_on_cancel(),
7084 * passing %TRUE, then if the task's #GCancellable is cancelled,
7085 * it will return control back to the caller immediately, while
7086 * allowing the task thread to continue running in the background
7087 * (and simply discarding its result when it finally does finish).
7088 * Provided that the task thread is careful about how it uses
7089 * locks and other externally-visible resources, this allows you
7090 * to make "GLib-friendly" asynchronous and cancellable
7091 * synchronous variants of blocking APIs.
7093 * <example id="gtask-cancellable"><title>g_task_set_return_on_cancel()</title>
7096 * bake_cake_thread (GTask *task,
7097 * gpointer source_object,
7098 * gpointer task_data,
7099 * GCancellable *cancellable)
7101 * Baker *self = source_object;
7102 * CakeData *cake_data = task_data;
7104 * GError *error = NULL;
7106 * cake = bake_cake (baker, cake_data->radius, cake_data->flavor,
7107 * cake_data->frosting, cake_data->message,
7111 * g_task_return_error (task, error);
7115 * /* If the task has already been cancelled, then we don't
7116 * * want to add the cake to the cake cache. Likewise, we don't
7117 * * want to have the task get cancelled in the middle of
7118 * * updating the cache. g_task_set_return_on_cancel() will
7119 * * return %TRUE here if it managed to disable return-on-cancel,
7120 * * or %FALSE if the task was cancelled before it could.
7122 * if (g_task_set_return_on_cancel (task, FALSE))
7124 * /* If the caller cancels at this point, their
7125 * * GAsyncReadyCallback won't be invoked until we return,
7126 * * so we don't have to worry that this code will run at
7127 * * the same time as that code does. But if there were
7128 * * other functions that might look at the cake cache,
7129 * * then we'd probably need a GMutex here as well.
7131 * baker_add_cake_to_cache (baker, cake);
7132 * g_task_return_pointer (task, cake, g_object_unref);
7137 * baker_bake_cake_async (Baker *self,
7139 * CakeFlavor flavor,
7140 * CakeFrostingType frosting,
7141 * const char *message,
7142 * GCancellable *cancellable,
7143 * GAsyncReadyCallback callback,
7144 * gpointer user_data)
7146 * CakeData *cake_data;
7149 * cake_data = g_slice_new (CakeData);
7152 * task = g_task_new (self, cancellable, callback, user_data);
7153 * g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7154 * g_task_set_return_on_cancel (task, TRUE);
7155 * g_task_run_in_thread (task, bake_cake_thread);
7159 * baker_bake_cake_sync (Baker *self,
7161 * CakeFlavor flavor,
7162 * CakeFrostingType frosting,
7163 * const char *message,
7164 * GCancellable *cancellable,
7167 * CakeData *cake_data;
7171 * cake_data = g_slice_new (CakeData);
7174 * task = g_task_new (self, cancellable, NULL, NULL);
7175 * g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7176 * g_task_set_return_on_cancel (task, TRUE);
7177 * g_task_run_in_thread_sync (task, bake_cake_thread);
7179 * cake = g_task_propagate_pointer (task, error);
7180 * g_object_unref (task);
7187 * <title>Porting from <literal>GSimpleAsyncResult</literal></title>
7189 * #GTask's API attempts to be simpler than #GSimpleAsyncResult's
7194 * You can save task-specific data with g_task_set_task_data(), and
7195 * retrieve it later with g_task_get_task_data(). This replaces the
7196 * abuse of g_simple_async_result_set_op_res_gpointer() for the same
7197 * purpose with #GSimpleAsyncResult.
7198 * </para></listitem>
7200 * In addition to the task data, #GTask also keeps track of the
7201 * <link linkend="io-priority">priority</link>, #GCancellable, and
7202 * #GMainContext associated with the task, so tasks that consist of
7203 * a chain of simpler asynchronous operations will have easy access
7204 * to those values when starting each sub-task.
7205 * </para></listitem>
7207 * g_task_return_error_if_cancelled() provides simplified
7208 * handling for cancellation. In addition, cancellation
7209 * overrides any other #GTask return value by default, like
7210 * #GSimpleAsyncResult does when
7211 * g_simple_async_result_set_check_cancellable() is called.
7212 * (You can use g_task_set_check_cancellable() to turn off that
7213 * behavior.) On the other hand, g_task_run_in_thread()
7214 * guarantees that it will always run your
7215 * <literal>task_func</literal>, even if the task's #GCancellable
7216 * is already cancelled before the task gets a chance to run;
7217 * you can start your <literal>task_func</literal> with a
7218 * g_task_return_error_if_cancelled() check if you need the
7220 * </para></listitem>
7222 * The "return" methods (eg, g_task_return_pointer())
7223 * automatically cause the task to be "completed" as well, and
7224 * there is no need to worry about the "complete" vs "complete
7225 * in idle" distinction. (#GTask automatically figures out
7226 * whether the task's callback can be invoked directly, or
7227 * if it needs to be sent to another #GMainContext, or delayed
7228 * until the next iteration of the current #GMainContext.)
7229 * </para></listitem>
7231 * The "finish" functions for #GTask-based operations are generally
7232 * much simpler than #GSimpleAsyncResult ones, normally consisting
7233 * of only a single call to g_task_propagate_pointer() or the like.
7234 * Since g_task_propagate_pointer() "steals" the return value from
7235 * the #GTask, it is not necessary to juggle pointers around to
7236 * prevent it from being freed twice.
7237 * </para></listitem>
7239 * With #GSimpleAsyncResult, it was common to call
7240 * g_simple_async_result_propagate_error() from the
7241 * <literal>_finish()</literal> wrapper function, and have
7242 * virtual method implementations only deal with successful
7243 * returns. This behavior is deprecated, because it makes it
7244 * difficult for a subclass to chain to a parent class's async
7245 * methods. Instead, the wrapper function should just be a
7246 * simple wrapper, and the virtual method should call an
7247 * appropriate <literal>g_task_propagate_</literal> function.
7248 * Note that wrapper methods can now use
7249 * g_async_result_legacy_propagate_error() to do old-style
7250 * #GSimpleAsyncResult error-returning behavior, and
7251 * g_async_result_is_tagged() to check if a result is tagged as
7252 * having come from the <literal>_async()</literal> wrapper
7253 * function (for "short-circuit" results, such as when passing
7254 * 0 to g_input_stream_read_async()).
7255 * </para></listitem>
7262 * SECTION:gtcpconnection
7263 * @title: GTcpConnection
7264 * @short_description: A TCP GSocketConnection
7265 * @see_also: #GSocketConnection.
7267 * This is the subclass of #GSocketConnection that is created
7268 * for TCP/IP sockets.
7275 * SECTION:gtcpwrapperconnection
7276 * @title: GTcpWrapperConnection
7277 * @short_description: wrapper for non-GSocketConnection-based, GSocket-based GIOStreams
7278 * @see_also: #GSocketConnection.
7280 * A #GTcpWrapperConnection can be used to wrap a #GIOStream that is
7281 * based on a #GSocket, but which is not actually a
7282 * #GSocketConnection. This is used by #GSocketClient so that it can
7283 * always return a #GSocketConnection, even when the connection it has
7284 * actually created is not directly a #GSocketConnection.
7292 * @short_description: D-Bus testing helper
7293 * @include: gio/gio.h
7295 * A helper class for testing code which uses D-Bus without touching the user's
7301 * SECTION:gthemedicon
7302 * @short_description: Icon theming support
7303 * @include: gio/gio.h
7304 * @see_also: #GIcon, #GLoadableIcon
7306 * #GThemedIcon is an implementation of #GIcon that supports icon themes.
7307 * #GThemedIcon contains a list of all of the icons present in an icon
7308 * theme, so that icons can be looked up quickly. #GThemedIcon does
7309 * not provide actual pixmaps for icons, just the icon names.
7310 * Ideally something like gtk_icon_theme_choose_icon() should be used to
7311 * resolve the list of names so that fallback icons work nicely with
7312 * themes that inherit other themes.
7317 * SECTION:gthreadedsocketservice
7318 * @title: GThreadedSocketService
7319 * @short_description: A threaded GSocketService
7320 * @see_also: #GSocketService.
7322 * A #GThreadedSocketService is a simple subclass of #GSocketService
7323 * that handles incoming connections by creating a worker thread and
7324 * dispatching the connection to it by emitting the
7325 * #GThreadedSocketService::run signal in the new thread.
7327 * The signal handler may perform blocking IO and need not return
7328 * until the connection is closed.
7330 * The service is implemented using a thread pool, so there is a
7331 * limited amount of threads available to serve incoming requests.
7332 * The service automatically stops the #GSocketService from accepting
7333 * new connections when all threads are busy.
7335 * As with #GSocketService, you may connect to #GThreadedSocketService::run,
7336 * or subclass and override the default handler.
7342 * @title: TLS Overview
7343 * @short_description: TLS (aka SSL) support for GSocketConnection
7344 * @include: gio/gio.h
7346 * #GTlsConnection and related classes provide TLS (Transport Layer
7347 * Security, previously known as SSL, Secure Sockets Layer) support for
7348 * gio-based network streams.
7350 * In the simplest case, for a client connection, you can just set the
7351 * #GSocketClient:tls flag on a #GSocketClient, and then any
7352 * connections created by that client will have TLS negotiated
7353 * automatically, using appropriate default settings, and rejecting
7354 * any invalid or self-signed certificates (unless you change that
7355 * default by setting the #GSocketClient:tls-validation-flags
7356 * property). The returned object will be a #GTcpWrapperConnection,
7357 * which wraps the underlying #GTlsClientConnection.
7359 * For greater control, you can create your own #GTlsClientConnection,
7360 * wrapping a #GSocketConnection (or an arbitrary #GIOStream with
7361 * pollable input and output streams) and then connect to its signals,
7362 * such as #GTlsConnection::accept-certificate, before starting the
7365 * Server-side TLS is similar, using #GTlsServerConnection. At the
7366 * moment, there is no support for automatically wrapping server-side
7367 * connections in the way #GSocketClient does for client-side
7373 * SECTION:gtlsbackend
7374 * @title: GTlsBackend
7375 * @short_description: TLS backend implementation
7376 * @include: gio/gio.h
7383 * SECTION:gtlscertificate
7384 * @title: GTlsCertificate
7385 * @short_description: TLS certificate
7386 * @see_also: #GTlsConnection
7388 * A certificate used for TLS authentication and encryption.
7389 * This can represent either a certificate only (eg, the certificate
7390 * received by a client from a server), or the combination of
7391 * a certificate and a private key (which is needed when acting as a
7392 * #GTlsServerConnection).
7399 * SECTION:gtlsclientconnection
7400 * @short_description: TLS client-side connection
7401 * @include: gio/gio.h
7403 * #GTlsClientConnection is the client-side subclass of
7404 * #GTlsConnection, representing a client-side TLS connection.
7409 * SECTION:gtlsconnection
7410 * @short_description: TLS connection type
7411 * @include: gio/gio.h
7413 * #GTlsConnection is the base TLS connection class type, which wraps
7414 * a #GIOStream and provides TLS encryption on top of it. Its
7415 * subclasses, #GTlsClientConnection and #GTlsServerConnection,
7416 * implement client-side and server-side TLS, respectively.
7423 * SECTION:gtlsdatabase
7424 * @short_description: TLS database type
7425 * @include: gio/gio.h
7427 * #GTlsDatabase is used to lookup certificates and other information
7428 * from a certificate or key store. It is an abstract base class which
7429 * TLS library specific subtypes override.
7431 * Most common client applications will not directly interact with
7432 * #GTlsDatabase. It is used internally by #GTlsConnection.
7439 * SECTION:gtlsfiledatabase
7440 * @short_description: TLS file based database type
7441 * @include: gio/gio.h
7443 * #GTlsFileDatabase is implemented by #GTlsDatabase objects which load
7444 * their certificate information from a file. It is in interface which
7445 * TLS library specific subtypes implement.
7452 * SECTION:gtlsinteraction
7453 * @short_description: Interaction with the user during TLS operations.
7454 * @include: gio/gio.h
7456 * #GTlsInteraction provides a mechanism for the TLS connection and database
7457 * code to interact with the user. It can be used to ask the user for passwords.
7459 * To use a #GTlsInteraction with a TLS connection use
7460 * g_tls_connection_set_interaction().
7462 * Callers should instantiate a derived class that implements the various
7463 * interaction methods to show the required dialogs.
7465 * Callers should use the 'invoke' functions like
7466 * g_tls_interaction_invoke_ask_password() to run interaction methods. These
7467 * functions make sure that the interaction is invoked in the main loop
7468 * and not in the current thread, if the current thread is not running the
7471 * Derived classes can choose to implement whichever interactions methods they'd
7472 * like to support by overriding those virtual methods in their class
7473 * initialization function. Any interactions not implemented will return
7474 * %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
7475 * it must also implement the corresponding finish method.
7480 * SECTION:gtlspassword
7481 * @title: GTlsPassword
7482 * @short_description: TLS Passwords for prompting
7483 * @include: gio/gio.h
7485 * Holds a password used in TLS.
7490 * SECTION:gtlsserverconnection
7491 * @short_description: TLS server-side connection
7492 * @include: gio/gio.h
7494 * #GTlsServerConnection is the server-side subclass of #GTlsConnection,
7495 * representing a server-side TLS connection.
7502 * SECTION:gunixconnection
7503 * @title: GUnixConnection
7504 * @short_description: A UNIX domain GSocketConnection
7505 * @include: gio/gunixconnection.h
7506 * @see_also: #GSocketConnection.
7508 * This is the subclass of #GSocketConnection that is created
7509 * for UNIX domain sockets.
7511 * It contains functions to do some of the UNIX socket specific
7512 * functionality like passing file descriptors.
7514 * Note that <filename><gio/gunixconnection.h></filename> belongs to
7515 * the UNIX-specific GIO interfaces, thus you have to use the
7516 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7523 * SECTION:gunixcredentialsmessage
7524 * @title: GUnixCredentialsMessage
7525 * @short_description: A GSocketControlMessage containing credentials
7526 * @include: gio/gunixcredentialsmessage.h
7527 * @see_also: #GUnixConnection, #GSocketControlMessage
7529 * This #GSocketControlMessage contains a #GCredentials instance. It
7530 * may be sent using g_socket_send_message() and received using
7531 * g_socket_receive_message() over UNIX sockets (ie: sockets in the
7532 * %G_SOCKET_FAMILY_UNIX family).
7534 * For an easier way to send and receive credentials over
7535 * stream-oriented UNIX sockets, see
7536 * g_unix_connection_send_credentials() and
7537 * g_unix_connection_receive_credentials(). To receive credentials of
7538 * a foreign process connected to a socket, use
7539 * g_socket_get_credentials().
7544 * SECTION:gunixfdlist
7545 * @title: GUnixFDList
7546 * @short_description: An object containing a set of UNIX file descriptors
7547 * @include: gio/gunixfdlist.h
7548 * @see_also: #GUnixFDMessage
7550 * A #GUnixFDList contains a list of file descriptors. It owns the file
7551 * descriptors that it contains, closing them when finalized.
7553 * It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
7554 * the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
7555 * and received using g_socket_receive_message().
7557 * Note that <filename><gio/gunixfdlist.h></filename> belongs to
7558 * the UNIX-specific GIO interfaces, thus you have to use the
7559 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7564 * SECTION:gunixfdmessage
7565 * @title: GUnixFDMessage
7566 * @short_description: A GSocketControlMessage containing a GUnixFDList
7567 * @include: gio/gunixfdmessage.h
7568 * @see_also: #GUnixConnection, #GUnixFDList, #GSocketControlMessage
7570 * This #GSocketControlMessage contains a #GUnixFDList.
7571 * It may be sent using g_socket_send_message() and received using
7572 * g_socket_receive_message() over UNIX sockets (ie: sockets in the
7573 * %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied
7574 * between processes by the kernel.
7576 * For an easier way to send and receive file descriptors over
7577 * stream-oriented UNIX sockets, see g_unix_connection_send_fd() and
7578 * g_unix_connection_receive_fd().
7580 * Note that <filename><gio/gunixfdmessage.h></filename> belongs to
7581 * the UNIX-specific GIO interfaces, thus you have to use the
7582 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7587 * SECTION:gunixinputstream
7588 * @short_description: Streaming input operations for UNIX file descriptors
7589 * @include: gio/gunixinputstream.h
7590 * @see_also: #GInputStream
7592 * #GUnixInputStream implements #GInputStream for reading from a UNIX
7593 * file descriptor, including asynchronous operations. (If the file
7594 * descriptor refers to a socket or pipe, this will use poll() to do
7595 * asynchronous I/O. If it refers to a regular file, it will fall back
7596 * to doing asynchronous I/O in another thread.)
7598 * Note that <filename><gio/gunixinputstream.h></filename> belongs
7599 * to the UNIX-specific GIO interfaces, thus you have to use the
7600 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7605 * SECTION:gunixmounts
7606 * @include: gio/gunixmounts.h
7607 * @short_description: UNIX mounts
7609 * Routines for managing mounted UNIX mount points and paths.
7611 * Note that <filename><gio/gunixmounts.h></filename> belongs to the
7612 * UNIX-specific GIO interfaces, thus you have to use the
7613 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7618 * SECTION:gunixoutputstream
7619 * @short_description: Streaming output operations for UNIX file descriptors
7620 * @include: gio/gunixoutputstream.h
7621 * @see_also: #GOutputStream
7623 * #GUnixOutputStream implements #GOutputStream for writing to a UNIX
7624 * file descriptor, including asynchronous operations. (If the file
7625 * descriptor refers to a socket or pipe, this will use poll() to do
7626 * asynchronous I/O. If it refers to a regular file, it will fall back
7627 * to doing asynchronous I/O in another thread.)
7629 * Note that <filename><gio/gunixoutputstream.h></filename> belongs
7630 * to the UNIX-specific GIO interfaces, thus you have to use the
7631 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7636 * SECTION:gunixsocketaddress
7637 * @short_description: UNIX GSocketAddress
7638 * @include: gio/gunixsocketaddress.h
7640 * Support for UNIX-domain (also known as local) sockets.
7642 * UNIX domain sockets are generally visible in the filesystem.
7643 * However, some systems support abstract socket names which are not
7644 * visible in the filesystem and not affected by the filesystem
7645 * permissions, visibility, etc. Currently this is only supported
7646 * under Linux. If you attempt to use abstract sockets on other
7647 * systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED
7648 * errors. You can use g_unix_socket_address_abstract_names_supported()
7649 * to see if abstract names are supported.
7651 * Note that <filename><gio/gunixsocketaddress.h></filename> belongs to
7652 * the UNIX-specific GIO interfaces, thus you have to use the
7653 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7659 * @short_description: Virtual File System
7660 * @include: gio/gio.h
7662 * Entry point for using GIO functionality.
7668 * @short_description: Volume management
7669 * @include: gio/gio.h
7671 * The #GVolume interface represents user-visible objects that can be
7672 * mounted. Note, when porting from GnomeVFS, #GVolume is the moral
7673 * equivalent of #GnomeVFSDrive.
7675 * Mounting a #GVolume instance is an asynchronous operation. For more
7676 * information about asynchronous operations, see #GAsyncResult and
7677 * #GSimpleAsyncResult. To mount a #GVolume, first call
7678 * g_volume_mount() with (at least) the #GVolume instance, optionally
7679 * a #GMountOperation object and a #GAsyncReadyCallback.
7681 * Typically, one will only want to pass %NULL for the
7682 * #GMountOperation if automounting all volumes when a desktop session
7683 * starts since it's not desirable to put up a lot of dialogs asking
7686 * The callback will be fired when the operation has resolved (either
7687 * with success or failure), and a #GAsyncReady structure will be
7688 * passed to the callback. That callback should then call
7689 * g_volume_mount_finish() with the #GVolume instance and the
7690 * #GAsyncReady data to see if the operation was completed
7691 * successfully. If an @error is present when g_volume_mount_finish()
7692 * is called, then it will be filled with any error information.
7694 * <para id="volume-identifier">
7695 * It is sometimes necessary to directly access the underlying
7696 * operating system object behind a volume (e.g. for passing a volume
7697 * to an application via the commandline). For this purpose, GIO
7698 * allows to obtain an 'identifier' for the volume. There can be
7699 * different kinds of identifiers, such as Hal UDIs, filesystem labels,
7700 * traditional Unix devices (e.g. <filename>/dev/sda2</filename>),
7701 * uuids. GIO uses predefind strings as names for the different kinds
7702 * of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
7703 * #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
7704 * to obtain an identifier for a volume.
7707 * Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
7708 * when the gvfs hal volume monitor is in use. Other volume monitors
7709 * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
7710 * identifier, which can be used to obtain a hal device by means of
7711 * libhal_manager_find_device_string_match().
7716 * SECTION:gvolumemonitor
7717 * @short_description: Volume Monitor
7718 * @include: gio/gio.h
7719 * @see_also: #GFileMonitor
7721 * #GVolumeMonitor is for listing the user interesting devices and volumes
7722 * on the computer. In other words, what a file selector or file manager
7723 * would show in a sidebar.
7725 * #GVolumeMonitor is not <link
7726 * linkend="g-main-context-push-thread-default">thread-default-context
7727 * aware</link>, and so should not be used other than from the main
7728 * thread, with no thread-default-context active.
7733 * SECTION:gwin32inputstream
7734 * @short_description: Streaming input operations for Windows file handles
7735 * @include: gio/gwin32inputstream.h
7736 * @see_also: #GInputStream
7738 * #GWin32InputStream implements #GInputStream for reading from a
7739 * Windows file handle.
7741 * Note that <filename><gio/gwin32inputstream.h></filename> belongs
7742 * to the Windows-specific GIO interfaces, thus you have to use the
7743 * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7748 * SECTION:gwin32outputstream
7749 * @short_description: Streaming output operations for Windows file handles
7750 * @include: gio/gwin32outputstream.h
7751 * @see_also: #GOutputStream
7753 * #GWin32OutputStream implements #GOutputStream for writing to a
7754 * Windows file handle.
7756 * Note that <filename><gio/gwin32outputstream.h></filename> belongs
7757 * to the Windows-specific GIO interfaces, thus you have to use the
7758 * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7763 * SECTION:gzcompressor
7764 * @short_description: Zlib compressor
7765 * @include: gio/gio.h
7767 * #GZlibCompressor is an implementation of #GConverter that
7768 * compresses data using zlib.
7773 * SECTION:gzdecompressor
7774 * @short_description: Zlib decompressor
7775 * @include: gio/gio.h
7777 * #GZlibDecompressor is an implementation of #GConverter that
7778 * decompresses data compressed with zlib.
7783 * _GFreedesktopDBus:
7785 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
7790 * _GFreedesktopDBus::handle-add-match:
7791 * @object: A #_GFreedesktopDBus.
7792 * @invocation: A #GDBusMethodInvocation.
7793 * @arg_rule: Argument passed by remote caller.
7795 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method.
7797 * 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 _g_freedesktop_dbus_complete_add_match() 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.
7799 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7804 * _GFreedesktopDBus::handle-get-connection-selinux-security-context:
7805 * @object: A #_GFreedesktopDBus.
7806 * @invocation: A #GDBusMethodInvocation.
7807 * @arg_name: Argument passed by remote caller.
7809 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method.
7811 * 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 _g_freedesktop_dbus_complete_get_connection_selinux_security_context() 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.
7813 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7818 * _GFreedesktopDBus::handle-get-connection-unix-process-id:
7819 * @object: A #_GFreedesktopDBus.
7820 * @invocation: A #GDBusMethodInvocation.
7821 * @arg_name: Argument passed by remote caller.
7823 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method.
7825 * 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 _g_freedesktop_dbus_complete_get_connection_unix_process_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.
7827 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7832 * _GFreedesktopDBus::handle-get-connection-unix-user:
7833 * @object: A #_GFreedesktopDBus.
7834 * @invocation: A #GDBusMethodInvocation.
7835 * @arg_name: Argument passed by remote caller.
7837 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method.
7839 * 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 _g_freedesktop_dbus_complete_get_connection_unix_user() 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.
7841 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7846 * _GFreedesktopDBus::handle-get-id:
7847 * @object: A #_GFreedesktopDBus.
7848 * @invocation: A #GDBusMethodInvocation.
7850 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method.
7852 * 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 _g_freedesktop_dbus_complete_get_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.
7854 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7859 * _GFreedesktopDBus::handle-get-name-owner:
7860 * @object: A #_GFreedesktopDBus.
7861 * @invocation: A #GDBusMethodInvocation.
7862 * @arg_name: Argument passed by remote caller.
7864 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method.
7866 * 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 _g_freedesktop_dbus_complete_get_name_owner() 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.
7868 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7873 * _GFreedesktopDBus::handle-hello:
7874 * @object: A #_GFreedesktopDBus.
7875 * @invocation: A #GDBusMethodInvocation.
7877 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method.
7879 * 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 _g_freedesktop_dbus_complete_hello() 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.
7881 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7886 * _GFreedesktopDBus::handle-list-activatable-names:
7887 * @object: A #_GFreedesktopDBus.
7888 * @invocation: A #GDBusMethodInvocation.
7890 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method.
7892 * 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 _g_freedesktop_dbus_complete_list_activatable_names() 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.
7894 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7899 * _GFreedesktopDBus::handle-list-names:
7900 * @object: A #_GFreedesktopDBus.
7901 * @invocation: A #GDBusMethodInvocation.
7903 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method.
7905 * 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 _g_freedesktop_dbus_complete_list_names() 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.
7907 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7912 * _GFreedesktopDBus::handle-list-queued-owners:
7913 * @object: A #_GFreedesktopDBus.
7914 * @invocation: A #GDBusMethodInvocation.
7915 * @arg_name: Argument passed by remote caller.
7917 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method.
7919 * 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 _g_freedesktop_dbus_complete_list_queued_owners() 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.
7921 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7926 * _GFreedesktopDBus::handle-name-has-owner:
7927 * @object: A #_GFreedesktopDBus.
7928 * @invocation: A #GDBusMethodInvocation.
7929 * @arg_name: Argument passed by remote caller.
7931 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method.
7933 * 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 _g_freedesktop_dbus_complete_name_has_owner() 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.
7935 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7940 * _GFreedesktopDBus::handle-release-name:
7941 * @object: A #_GFreedesktopDBus.
7942 * @invocation: A #GDBusMethodInvocation.
7943 * @arg_name: Argument passed by remote caller.
7945 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method.
7947 * 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 _g_freedesktop_dbus_complete_release_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.
7949 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7954 * _GFreedesktopDBus::handle-reload-config:
7955 * @object: A #_GFreedesktopDBus.
7956 * @invocation: A #GDBusMethodInvocation.
7958 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method.
7960 * 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 _g_freedesktop_dbus_complete_reload_config() 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.
7962 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7967 * _GFreedesktopDBus::handle-remove-match:
7968 * @object: A #_GFreedesktopDBus.
7969 * @invocation: A #GDBusMethodInvocation.
7970 * @arg_rule: Argument passed by remote caller.
7972 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method.
7974 * 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 _g_freedesktop_dbus_complete_remove_match() 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.
7976 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7981 * _GFreedesktopDBus::handle-request-name:
7982 * @object: A #_GFreedesktopDBus.
7983 * @invocation: A #GDBusMethodInvocation.
7984 * @arg_name: Argument passed by remote caller.
7985 * @arg_flags: Argument passed by remote caller.
7987 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method.
7989 * 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 _g_freedesktop_dbus_complete_request_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.
7991 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7996 * _GFreedesktopDBus::handle-start-service-by-name:
7997 * @object: A #_GFreedesktopDBus.
7998 * @invocation: A #GDBusMethodInvocation.
7999 * @arg_name: Argument passed by remote caller.
8000 * @arg_flags: Argument passed by remote caller.
8002 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method.
8004 * 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 _g_freedesktop_dbus_complete_start_service_by_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.
8006 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
8011 * _GFreedesktopDBus::handle-update-activation-environment:
8012 * @object: A #_GFreedesktopDBus.
8013 * @invocation: A #GDBusMethodInvocation.
8014 * @arg_environment: Argument passed by remote caller.
8016 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method.
8018 * 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 _g_freedesktop_dbus_complete_update_activation_environment() 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.
8020 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
8025 * _GFreedesktopDBus::name-acquired:
8026 * @object: A #_GFreedesktopDBus.
8027 * @arg_name: Argument.
8029 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-DBus.NameAcquired">"NameAcquired"</link> is received.
8031 * 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.
8036 * _GFreedesktopDBus::name-lost:
8037 * @object: A #_GFreedesktopDBus.
8038 * @arg_name: Argument.
8040 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-DBus.NameLost">"NameLost"</link> is received.
8042 * 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.
8047 * _GFreedesktopDBus::name-owner-changed:
8048 * @object: A #_GFreedesktopDBus.
8049 * @arg_name: Argument.
8050 * @arg_old_owner: Argument.
8051 * @arg_new_owner: Argument.
8053 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-DBus.NameOwnerChanged">"NameOwnerChanged"</link> is received.
8055 * 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.
8060 * _GFreedesktopDBusIface:
8061 * @parent_iface: The parent interface.
8062 * @handle_add_match: Handler for the #_GFreedesktopDBus::handle-add-match signal.
8063 * @handle_get_connection_selinux_security_context: Handler for the #_GFreedesktopDBus::handle-get-connection-selinux-security-context signal.
8064 * @handle_get_connection_unix_process_id: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-process-id signal.
8065 * @handle_get_connection_unix_user: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-user signal.
8066 * @handle_get_id: Handler for the #_GFreedesktopDBus::handle-get-id signal.
8067 * @handle_get_name_owner: Handler for the #_GFreedesktopDBus::handle-get-name-owner signal.
8068 * @handle_hello: Handler for the #_GFreedesktopDBus::handle-hello signal.
8069 * @handle_list_activatable_names: Handler for the #_GFreedesktopDBus::handle-list-activatable-names signal.
8070 * @handle_list_names: Handler for the #_GFreedesktopDBus::handle-list-names signal.
8071 * @handle_list_queued_owners: Handler for the #_GFreedesktopDBus::handle-list-queued-owners signal.
8072 * @handle_name_has_owner: Handler for the #_GFreedesktopDBus::handle-name-has-owner signal.
8073 * @handle_release_name: Handler for the #_GFreedesktopDBus::handle-release-name signal.
8074 * @handle_reload_config: Handler for the #_GFreedesktopDBus::handle-reload-config signal.
8075 * @handle_remove_match: Handler for the #_GFreedesktopDBus::handle-remove-match signal.
8076 * @handle_request_name: Handler for the #_GFreedesktopDBus::handle-request-name signal.
8077 * @handle_start_service_by_name: Handler for the #_GFreedesktopDBus::handle-start-service-by-name signal.
8078 * @handle_update_activation_environment: Handler for the #_GFreedesktopDBus::handle-update-activation-environment signal.
8079 * @name_acquired: Handler for the #_GFreedesktopDBus::name-acquired signal.
8080 * @name_lost: Handler for the #_GFreedesktopDBus::name-lost signal.
8081 * @name_owner_changed: Handler for the #_GFreedesktopDBus::name-owner-changed signal.
8083 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
8088 * _GFreedesktopDBusProxy:
8090 * The #_GFreedesktopDBusProxy structure contains only private data and should only be accessed using the provided API.
8095 * _GFreedesktopDBusProxyClass:
8096 * @parent_class: The parent class.
8098 * Class structure for #_GFreedesktopDBusProxy.
8103 * _GFreedesktopDBusSkeleton:
8105 * The #_GFreedesktopDBusSkeleton structure contains only private data and should only be accessed using the provided API.
8110 * _GFreedesktopDBusSkeletonClass:
8111 * @parent_class: The parent class.
8113 * Class structure for #_GFreedesktopDBusSkeleton.
8118 * _g_freedesktop_dbus_call_add_match:
8119 * @proxy: A #_GFreedesktopDBusProxy.
8120 * @arg_rule: Argument to pass with the method invocation.
8121 * @cancellable: (allow-none): A #GCancellable or %NULL.
8122 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8123 * @user_data: User data to pass to @callback.
8125 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method on @proxy.
8126 * 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.
8127 * You can then call _g_freedesktop_dbus_call_add_match_finish() to get the result of the operation.
8129 * See _g_freedesktop_dbus_call_add_match_sync() for the synchronous, blocking version of this method.
8134 * _g_freedesktop_dbus_call_add_match_finish:
8135 * @proxy: A #_GFreedesktopDBusProxy.
8136 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_add_match().
8137 * @error: Return location for error or %NULL.
8139 * Finishes an operation started with _g_freedesktop_dbus_call_add_match().
8141 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8146 * _g_freedesktop_dbus_call_add_match_sync:
8147 * @proxy: A #_GFreedesktopDBusProxy.
8148 * @arg_rule: Argument to pass with the method invocation.
8149 * @cancellable: (allow-none): A #GCancellable or %NULL.
8150 * @error: Return location for error or %NULL.
8152 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8154 * See _g_freedesktop_dbus_call_add_match() for the asynchronous version of this method.
8156 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8161 * _g_freedesktop_dbus_call_get_connection_selinux_security_context:
8162 * @proxy: A #_GFreedesktopDBusProxy.
8163 * @arg_name: Argument to pass with the method invocation.
8164 * @cancellable: (allow-none): A #GCancellable or %NULL.
8165 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8166 * @user_data: User data to pass to @callback.
8168 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method on @proxy.
8169 * 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.
8170 * You can then call _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish() to get the result of the operation.
8172 * See _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync() for the synchronous, blocking version of this method.
8177 * _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish:
8178 * @proxy: A #_GFreedesktopDBusProxy.
8179 * @out_security_context: (out): Return location for return parameter or %NULL to ignore.
8180 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_selinux_security_context().
8181 * @error: Return location for error or %NULL.
8183 * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_selinux_security_context().
8185 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8190 * _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync:
8191 * @proxy: A #_GFreedesktopDBusProxy.
8192 * @arg_name: Argument to pass with the method invocation.
8193 * @out_security_context: (out): Return location for return parameter or %NULL to ignore.
8194 * @cancellable: (allow-none): A #GCancellable or %NULL.
8195 * @error: Return location for error or %NULL.
8197 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8199 * See _g_freedesktop_dbus_call_get_connection_selinux_security_context() for the asynchronous version of this method.
8201 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8206 * _g_freedesktop_dbus_call_get_connection_unix_process_id:
8207 * @proxy: A #_GFreedesktopDBusProxy.
8208 * @arg_name: Argument to pass with the method invocation.
8209 * @cancellable: (allow-none): A #GCancellable or %NULL.
8210 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8211 * @user_data: User data to pass to @callback.
8213 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method on @proxy.
8214 * 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.
8215 * You can then call _g_freedesktop_dbus_call_get_connection_unix_process_id_finish() to get the result of the operation.
8217 * See _g_freedesktop_dbus_call_get_connection_unix_process_id_sync() for the synchronous, blocking version of this method.
8222 * _g_freedesktop_dbus_call_get_connection_unix_process_id_finish:
8223 * @proxy: A #_GFreedesktopDBusProxy.
8224 * @out_pid: (out): Return location for return parameter or %NULL to ignore.
8225 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_process_id().
8226 * @error: Return location for error or %NULL.
8228 * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_process_id().
8230 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8235 * _g_freedesktop_dbus_call_get_connection_unix_process_id_sync:
8236 * @proxy: A #_GFreedesktopDBusProxy.
8237 * @arg_name: Argument to pass with the method invocation.
8238 * @out_pid: (out): Return location for return parameter or %NULL to ignore.
8239 * @cancellable: (allow-none): A #GCancellable or %NULL.
8240 * @error: Return location for error or %NULL.
8242 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8244 * See _g_freedesktop_dbus_call_get_connection_unix_process_id() for the asynchronous version of this method.
8246 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8251 * _g_freedesktop_dbus_call_get_connection_unix_user:
8252 * @proxy: A #_GFreedesktopDBusProxy.
8253 * @arg_name: Argument to pass with the method invocation.
8254 * @cancellable: (allow-none): A #GCancellable or %NULL.
8255 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8256 * @user_data: User data to pass to @callback.
8258 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method on @proxy.
8259 * 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.
8260 * You can then call _g_freedesktop_dbus_call_get_connection_unix_user_finish() to get the result of the operation.
8262 * See _g_freedesktop_dbus_call_get_connection_unix_user_sync() for the synchronous, blocking version of this method.
8267 * _g_freedesktop_dbus_call_get_connection_unix_user_finish:
8268 * @proxy: A #_GFreedesktopDBusProxy.
8269 * @out_uid: (out): Return location for return parameter or %NULL to ignore.
8270 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_user().
8271 * @error: Return location for error or %NULL.
8273 * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_user().
8275 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8280 * _g_freedesktop_dbus_call_get_connection_unix_user_sync:
8281 * @proxy: A #_GFreedesktopDBusProxy.
8282 * @arg_name: Argument to pass with the method invocation.
8283 * @out_uid: (out): Return location for return parameter or %NULL to ignore.
8284 * @cancellable: (allow-none): A #GCancellable or %NULL.
8285 * @error: Return location for error or %NULL.
8287 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8289 * See _g_freedesktop_dbus_call_get_connection_unix_user() for the asynchronous version of this method.
8291 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8296 * _g_freedesktop_dbus_call_get_id:
8297 * @proxy: A #_GFreedesktopDBusProxy.
8298 * @cancellable: (allow-none): A #GCancellable or %NULL.
8299 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8300 * @user_data: User data to pass to @callback.
8302 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method on @proxy.
8303 * 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.
8304 * You can then call _g_freedesktop_dbus_call_get_id_finish() to get the result of the operation.
8306 * See _g_freedesktop_dbus_call_get_id_sync() for the synchronous, blocking version of this method.
8311 * _g_freedesktop_dbus_call_get_id_finish:
8312 * @proxy: A #_GFreedesktopDBusProxy.
8313 * @out_unique_id: (out): Return location for return parameter or %NULL to ignore.
8314 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_id().
8315 * @error: Return location for error or %NULL.
8317 * Finishes an operation started with _g_freedesktop_dbus_call_get_id().
8319 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8324 * _g_freedesktop_dbus_call_get_id_sync:
8325 * @proxy: A #_GFreedesktopDBusProxy.
8326 * @out_unique_id: (out): Return location for return parameter or %NULL to ignore.
8327 * @cancellable: (allow-none): A #GCancellable or %NULL.
8328 * @error: Return location for error or %NULL.
8330 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8332 * See _g_freedesktop_dbus_call_get_id() for the asynchronous version of this method.
8334 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8339 * _g_freedesktop_dbus_call_get_name_owner:
8340 * @proxy: A #_GFreedesktopDBusProxy.
8341 * @arg_name: Argument to pass with the method invocation.
8342 * @cancellable: (allow-none): A #GCancellable or %NULL.
8343 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8344 * @user_data: User data to pass to @callback.
8346 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method on @proxy.
8347 * 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.
8348 * You can then call _g_freedesktop_dbus_call_get_name_owner_finish() to get the result of the operation.
8350 * See _g_freedesktop_dbus_call_get_name_owner_sync() for the synchronous, blocking version of this method.
8355 * _g_freedesktop_dbus_call_get_name_owner_finish:
8356 * @proxy: A #_GFreedesktopDBusProxy.
8357 * @out_unique_name: (out): Return location for return parameter or %NULL to ignore.
8358 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_name_owner().
8359 * @error: Return location for error or %NULL.
8361 * Finishes an operation started with _g_freedesktop_dbus_call_get_name_owner().
8363 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8368 * _g_freedesktop_dbus_call_get_name_owner_sync:
8369 * @proxy: A #_GFreedesktopDBusProxy.
8370 * @arg_name: Argument to pass with the method invocation.
8371 * @out_unique_name: (out): Return location for return parameter or %NULL to ignore.
8372 * @cancellable: (allow-none): A #GCancellable or %NULL.
8373 * @error: Return location for error or %NULL.
8375 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8377 * See _g_freedesktop_dbus_call_get_name_owner() for the asynchronous version of this method.
8379 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8384 * _g_freedesktop_dbus_call_hello:
8385 * @proxy: A #_GFreedesktopDBusProxy.
8386 * @cancellable: (allow-none): A #GCancellable or %NULL.
8387 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8388 * @user_data: User data to pass to @callback.
8390 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method on @proxy.
8391 * 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.
8392 * You can then call _g_freedesktop_dbus_call_hello_finish() to get the result of the operation.
8394 * See _g_freedesktop_dbus_call_hello_sync() for the synchronous, blocking version of this method.
8399 * _g_freedesktop_dbus_call_hello_finish:
8400 * @proxy: A #_GFreedesktopDBusProxy.
8401 * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore.
8402 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_hello().
8403 * @error: Return location for error or %NULL.
8405 * Finishes an operation started with _g_freedesktop_dbus_call_hello().
8407 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8412 * _g_freedesktop_dbus_call_hello_sync:
8413 * @proxy: A #_GFreedesktopDBusProxy.
8414 * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore.
8415 * @cancellable: (allow-none): A #GCancellable or %NULL.
8416 * @error: Return location for error or %NULL.
8418 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8420 * See _g_freedesktop_dbus_call_hello() for the asynchronous version of this method.
8422 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8427 * _g_freedesktop_dbus_call_list_activatable_names:
8428 * @proxy: A #_GFreedesktopDBusProxy.
8429 * @cancellable: (allow-none): A #GCancellable or %NULL.
8430 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8431 * @user_data: User data to pass to @callback.
8433 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method on @proxy.
8434 * 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.
8435 * You can then call _g_freedesktop_dbus_call_list_activatable_names_finish() to get the result of the operation.
8437 * See _g_freedesktop_dbus_call_list_activatable_names_sync() for the synchronous, blocking version of this method.
8442 * _g_freedesktop_dbus_call_list_activatable_names_finish:
8443 * @proxy: A #_GFreedesktopDBusProxy.
8444 * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore.
8445 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_activatable_names().
8446 * @error: Return location for error or %NULL.
8448 * Finishes an operation started with _g_freedesktop_dbus_call_list_activatable_names().
8450 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8455 * _g_freedesktop_dbus_call_list_activatable_names_sync:
8456 * @proxy: A #_GFreedesktopDBusProxy.
8457 * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore.
8458 * @cancellable: (allow-none): A #GCancellable or %NULL.
8459 * @error: Return location for error or %NULL.
8461 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8463 * See _g_freedesktop_dbus_call_list_activatable_names() for the asynchronous version of this method.
8465 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8470 * _g_freedesktop_dbus_call_list_names:
8471 * @proxy: A #_GFreedesktopDBusProxy.
8472 * @cancellable: (allow-none): A #GCancellable or %NULL.
8473 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8474 * @user_data: User data to pass to @callback.
8476 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method on @proxy.
8477 * 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.
8478 * You can then call _g_freedesktop_dbus_call_list_names_finish() to get the result of the operation.
8480 * See _g_freedesktop_dbus_call_list_names_sync() for the synchronous, blocking version of this method.
8485 * _g_freedesktop_dbus_call_list_names_finish:
8486 * @proxy: A #_GFreedesktopDBusProxy.
8487 * @out_names: (out): Return location for return parameter or %NULL to ignore.
8488 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_names().
8489 * @error: Return location for error or %NULL.
8491 * Finishes an operation started with _g_freedesktop_dbus_call_list_names().
8493 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8498 * _g_freedesktop_dbus_call_list_names_sync:
8499 * @proxy: A #_GFreedesktopDBusProxy.
8500 * @out_names: (out): Return location for return parameter or %NULL to ignore.
8501 * @cancellable: (allow-none): A #GCancellable or %NULL.
8502 * @error: Return location for error or %NULL.
8504 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8506 * See _g_freedesktop_dbus_call_list_names() for the asynchronous version of this method.
8508 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8513 * _g_freedesktop_dbus_call_list_queued_owners:
8514 * @proxy: A #_GFreedesktopDBusProxy.
8515 * @arg_name: Argument to pass with the method invocation.
8516 * @cancellable: (allow-none): A #GCancellable or %NULL.
8517 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8518 * @user_data: User data to pass to @callback.
8520 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method on @proxy.
8521 * 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.
8522 * You can then call _g_freedesktop_dbus_call_list_queued_owners_finish() to get the result of the operation.
8524 * See _g_freedesktop_dbus_call_list_queued_owners_sync() for the synchronous, blocking version of this method.
8529 * _g_freedesktop_dbus_call_list_queued_owners_finish:
8530 * @proxy: A #_GFreedesktopDBusProxy.
8531 * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore.
8532 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_queued_owners().
8533 * @error: Return location for error or %NULL.
8535 * Finishes an operation started with _g_freedesktop_dbus_call_list_queued_owners().
8537 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8542 * _g_freedesktop_dbus_call_list_queued_owners_sync:
8543 * @proxy: A #_GFreedesktopDBusProxy.
8544 * @arg_name: Argument to pass with the method invocation.
8545 * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore.
8546 * @cancellable: (allow-none): A #GCancellable or %NULL.
8547 * @error: Return location for error or %NULL.
8549 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8551 * See _g_freedesktop_dbus_call_list_queued_owners() for the asynchronous version of this method.
8553 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8558 * _g_freedesktop_dbus_call_name_has_owner:
8559 * @proxy: A #_GFreedesktopDBusProxy.
8560 * @arg_name: Argument to pass with the method invocation.
8561 * @cancellable: (allow-none): A #GCancellable or %NULL.
8562 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8563 * @user_data: User data to pass to @callback.
8565 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method on @proxy.
8566 * 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.
8567 * You can then call _g_freedesktop_dbus_call_name_has_owner_finish() to get the result of the operation.
8569 * See _g_freedesktop_dbus_call_name_has_owner_sync() for the synchronous, blocking version of this method.
8574 * _g_freedesktop_dbus_call_name_has_owner_finish:
8575 * @proxy: A #_GFreedesktopDBusProxy.
8576 * @out_has_owner: (out): Return location for return parameter or %NULL to ignore.
8577 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_name_has_owner().
8578 * @error: Return location for error or %NULL.
8580 * Finishes an operation started with _g_freedesktop_dbus_call_name_has_owner().
8582 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8587 * _g_freedesktop_dbus_call_name_has_owner_sync:
8588 * @proxy: A #_GFreedesktopDBusProxy.
8589 * @arg_name: Argument to pass with the method invocation.
8590 * @out_has_owner: (out): Return location for return parameter or %NULL to ignore.
8591 * @cancellable: (allow-none): A #GCancellable or %NULL.
8592 * @error: Return location for error or %NULL.
8594 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8596 * See _g_freedesktop_dbus_call_name_has_owner() for the asynchronous version of this method.
8598 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8603 * _g_freedesktop_dbus_call_release_name:
8604 * @proxy: A #_GFreedesktopDBusProxy.
8605 * @arg_name: Argument to pass with the method invocation.
8606 * @cancellable: (allow-none): A #GCancellable or %NULL.
8607 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8608 * @user_data: User data to pass to @callback.
8610 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method on @proxy.
8611 * 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.
8612 * You can then call _g_freedesktop_dbus_call_release_name_finish() to get the result of the operation.
8614 * See _g_freedesktop_dbus_call_release_name_sync() for the synchronous, blocking version of this method.
8619 * _g_freedesktop_dbus_call_release_name_finish:
8620 * @proxy: A #_GFreedesktopDBusProxy.
8621 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8622 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_release_name().
8623 * @error: Return location for error or %NULL.
8625 * Finishes an operation started with _g_freedesktop_dbus_call_release_name().
8627 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8632 * _g_freedesktop_dbus_call_release_name_sync:
8633 * @proxy: A #_GFreedesktopDBusProxy.
8634 * @arg_name: Argument to pass with the method invocation.
8635 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8636 * @cancellable: (allow-none): A #GCancellable or %NULL.
8637 * @error: Return location for error or %NULL.
8639 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8641 * See _g_freedesktop_dbus_call_release_name() for the asynchronous version of this method.
8643 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8648 * _g_freedesktop_dbus_call_reload_config:
8649 * @proxy: A #_GFreedesktopDBusProxy.
8650 * @cancellable: (allow-none): A #GCancellable or %NULL.
8651 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8652 * @user_data: User data to pass to @callback.
8654 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method on @proxy.
8655 * 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.
8656 * You can then call _g_freedesktop_dbus_call_reload_config_finish() to get the result of the operation.
8658 * See _g_freedesktop_dbus_call_reload_config_sync() for the synchronous, blocking version of this method.
8663 * _g_freedesktop_dbus_call_reload_config_finish:
8664 * @proxy: A #_GFreedesktopDBusProxy.
8665 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_reload_config().
8666 * @error: Return location for error or %NULL.
8668 * Finishes an operation started with _g_freedesktop_dbus_call_reload_config().
8670 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8675 * _g_freedesktop_dbus_call_reload_config_sync:
8676 * @proxy: A #_GFreedesktopDBusProxy.
8677 * @cancellable: (allow-none): A #GCancellable or %NULL.
8678 * @error: Return location for error or %NULL.
8680 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8682 * See _g_freedesktop_dbus_call_reload_config() for the asynchronous version of this method.
8684 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8689 * _g_freedesktop_dbus_call_remove_match:
8690 * @proxy: A #_GFreedesktopDBusProxy.
8691 * @arg_rule: Argument to pass with the method invocation.
8692 * @cancellable: (allow-none): A #GCancellable or %NULL.
8693 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8694 * @user_data: User data to pass to @callback.
8696 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method on @proxy.
8697 * 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.
8698 * You can then call _g_freedesktop_dbus_call_remove_match_finish() to get the result of the operation.
8700 * See _g_freedesktop_dbus_call_remove_match_sync() for the synchronous, blocking version of this method.
8705 * _g_freedesktop_dbus_call_remove_match_finish:
8706 * @proxy: A #_GFreedesktopDBusProxy.
8707 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_remove_match().
8708 * @error: Return location for error or %NULL.
8710 * Finishes an operation started with _g_freedesktop_dbus_call_remove_match().
8712 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8717 * _g_freedesktop_dbus_call_remove_match_sync:
8718 * @proxy: A #_GFreedesktopDBusProxy.
8719 * @arg_rule: Argument to pass with the method invocation.
8720 * @cancellable: (allow-none): A #GCancellable or %NULL.
8721 * @error: Return location for error or %NULL.
8723 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8725 * See _g_freedesktop_dbus_call_remove_match() for the asynchronous version of this method.
8727 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8732 * _g_freedesktop_dbus_call_request_name:
8733 * @proxy: A #_GFreedesktopDBusProxy.
8734 * @arg_name: Argument to pass with the method invocation.
8735 * @arg_flags: Argument to pass with the method invocation.
8736 * @cancellable: (allow-none): A #GCancellable or %NULL.
8737 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8738 * @user_data: User data to pass to @callback.
8740 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method on @proxy.
8741 * 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.
8742 * You can then call _g_freedesktop_dbus_call_request_name_finish() to get the result of the operation.
8744 * See _g_freedesktop_dbus_call_request_name_sync() for the synchronous, blocking version of this method.
8749 * _g_freedesktop_dbus_call_request_name_finish:
8750 * @proxy: A #_GFreedesktopDBusProxy.
8751 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8752 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_request_name().
8753 * @error: Return location for error or %NULL.
8755 * Finishes an operation started with _g_freedesktop_dbus_call_request_name().
8757 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8762 * _g_freedesktop_dbus_call_request_name_sync:
8763 * @proxy: A #_GFreedesktopDBusProxy.
8764 * @arg_name: Argument to pass with the method invocation.
8765 * @arg_flags: Argument to pass with the method invocation.
8766 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8767 * @cancellable: (allow-none): A #GCancellable or %NULL.
8768 * @error: Return location for error or %NULL.
8770 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8772 * See _g_freedesktop_dbus_call_request_name() for the asynchronous version of this method.
8774 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8779 * _g_freedesktop_dbus_call_start_service_by_name:
8780 * @proxy: A #_GFreedesktopDBusProxy.
8781 * @arg_name: Argument to pass with the method invocation.
8782 * @arg_flags: Argument to pass with the method invocation.
8783 * @cancellable: (allow-none): A #GCancellable or %NULL.
8784 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8785 * @user_data: User data to pass to @callback.
8787 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method on @proxy.
8788 * 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.
8789 * You can then call _g_freedesktop_dbus_call_start_service_by_name_finish() to get the result of the operation.
8791 * See _g_freedesktop_dbus_call_start_service_by_name_sync() for the synchronous, blocking version of this method.
8796 * _g_freedesktop_dbus_call_start_service_by_name_finish:
8797 * @proxy: A #_GFreedesktopDBusProxy.
8798 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8799 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_start_service_by_name().
8800 * @error: Return location for error or %NULL.
8802 * Finishes an operation started with _g_freedesktop_dbus_call_start_service_by_name().
8804 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8809 * _g_freedesktop_dbus_call_start_service_by_name_sync:
8810 * @proxy: A #_GFreedesktopDBusProxy.
8811 * @arg_name: Argument to pass with the method invocation.
8812 * @arg_flags: Argument to pass with the method invocation.
8813 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8814 * @cancellable: (allow-none): A #GCancellable or %NULL.
8815 * @error: Return location for error or %NULL.
8817 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8819 * See _g_freedesktop_dbus_call_start_service_by_name() for the asynchronous version of this method.
8821 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8826 * _g_freedesktop_dbus_call_update_activation_environment:
8827 * @proxy: A #_GFreedesktopDBusProxy.
8828 * @arg_environment: Argument to pass with the method invocation.
8829 * @cancellable: (allow-none): A #GCancellable or %NULL.
8830 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8831 * @user_data: User data to pass to @callback.
8833 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method on @proxy.
8834 * 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.
8835 * You can then call _g_freedesktop_dbus_call_update_activation_environment_finish() to get the result of the operation.
8837 * See _g_freedesktop_dbus_call_update_activation_environment_sync() for the synchronous, blocking version of this method.
8842 * _g_freedesktop_dbus_call_update_activation_environment_finish:
8843 * @proxy: A #_GFreedesktopDBusProxy.
8844 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_update_activation_environment().
8845 * @error: Return location for error or %NULL.
8847 * Finishes an operation started with _g_freedesktop_dbus_call_update_activation_environment().
8849 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8854 * _g_freedesktop_dbus_call_update_activation_environment_sync:
8855 * @proxy: A #_GFreedesktopDBusProxy.
8856 * @arg_environment: Argument to pass with the method invocation.
8857 * @cancellable: (allow-none): A #GCancellable or %NULL.
8858 * @error: Return location for error or %NULL.
8860 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8862 * See _g_freedesktop_dbus_call_update_activation_environment() for the asynchronous version of this method.
8864 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8869 * _g_freedesktop_dbus_complete_add_match:
8870 * @object: A #_GFreedesktopDBus.
8871 * @invocation: (transfer full): A #GDBusMethodInvocation.
8873 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</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.
8875 * This method will free @invocation, you cannot use it afterwards.
8880 * _g_freedesktop_dbus_complete_get_connection_selinux_security_context:
8881 * @object: A #_GFreedesktopDBus.
8882 * @invocation: (transfer full): A #GDBusMethodInvocation.
8883 * @security_context: Parameter to return.
8885 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</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.
8887 * This method will free @invocation, you cannot use it afterwards.
8892 * _g_freedesktop_dbus_complete_get_connection_unix_process_id:
8893 * @object: A #_GFreedesktopDBus.
8894 * @invocation: (transfer full): A #GDBusMethodInvocation.
8895 * @pid: Parameter to return.
8897 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</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.
8899 * This method will free @invocation, you cannot use it afterwards.
8904 * _g_freedesktop_dbus_complete_get_connection_unix_user:
8905 * @object: A #_GFreedesktopDBus.
8906 * @invocation: (transfer full): A #GDBusMethodInvocation.
8907 * @uid: Parameter to return.
8909 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</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.
8911 * This method will free @invocation, you cannot use it afterwards.
8916 * _g_freedesktop_dbus_complete_get_id:
8917 * @object: A #_GFreedesktopDBus.
8918 * @invocation: (transfer full): A #GDBusMethodInvocation.
8919 * @unique_id: Parameter to return.
8921 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</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.
8923 * This method will free @invocation, you cannot use it afterwards.
8928 * _g_freedesktop_dbus_complete_get_name_owner:
8929 * @object: A #_GFreedesktopDBus.
8930 * @invocation: (transfer full): A #GDBusMethodInvocation.
8931 * @unique_name: Parameter to return.
8933 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</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.
8935 * This method will free @invocation, you cannot use it afterwards.
8940 * _g_freedesktop_dbus_complete_hello:
8941 * @object: A #_GFreedesktopDBus.
8942 * @invocation: (transfer full): A #GDBusMethodInvocation.
8943 * @assigned_name: Parameter to return.
8945 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</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.
8947 * This method will free @invocation, you cannot use it afterwards.
8952 * _g_freedesktop_dbus_complete_list_activatable_names:
8953 * @object: A #_GFreedesktopDBus.
8954 * @invocation: (transfer full): A #GDBusMethodInvocation.
8955 * @activatable_names: Parameter to return.
8957 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</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.
8959 * This method will free @invocation, you cannot use it afterwards.
8964 * _g_freedesktop_dbus_complete_list_names:
8965 * @object: A #_GFreedesktopDBus.
8966 * @invocation: (transfer full): A #GDBusMethodInvocation.
8967 * @names: Parameter to return.
8969 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</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.
8971 * This method will free @invocation, you cannot use it afterwards.
8976 * _g_freedesktop_dbus_complete_list_queued_owners:
8977 * @object: A #_GFreedesktopDBus.
8978 * @invocation: (transfer full): A #GDBusMethodInvocation.
8979 * @queued_owners: Parameter to return.
8981 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</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.
8983 * This method will free @invocation, you cannot use it afterwards.
8988 * _g_freedesktop_dbus_complete_name_has_owner:
8989 * @object: A #_GFreedesktopDBus.
8990 * @invocation: (transfer full): A #GDBusMethodInvocation.
8991 * @has_owner: Parameter to return.
8993 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</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.
8995 * This method will free @invocation, you cannot use it afterwards.
9000 * _g_freedesktop_dbus_complete_release_name:
9001 * @object: A #_GFreedesktopDBus.
9002 * @invocation: (transfer full): A #GDBusMethodInvocation.
9003 * @value: Parameter to return.
9005 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</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.
9007 * This method will free @invocation, you cannot use it afterwards.
9012 * _g_freedesktop_dbus_complete_reload_config:
9013 * @object: A #_GFreedesktopDBus.
9014 * @invocation: (transfer full): A #GDBusMethodInvocation.
9016 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</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.
9018 * This method will free @invocation, you cannot use it afterwards.
9023 * _g_freedesktop_dbus_complete_remove_match:
9024 * @object: A #_GFreedesktopDBus.
9025 * @invocation: (transfer full): A #GDBusMethodInvocation.
9027 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</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.
9029 * This method will free @invocation, you cannot use it afterwards.
9034 * _g_freedesktop_dbus_complete_request_name:
9035 * @object: A #_GFreedesktopDBus.
9036 * @invocation: (transfer full): A #GDBusMethodInvocation.
9037 * @value: Parameter to return.
9039 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</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.
9041 * This method will free @invocation, you cannot use it afterwards.
9046 * _g_freedesktop_dbus_complete_start_service_by_name:
9047 * @object: A #_GFreedesktopDBus.
9048 * @invocation: (transfer full): A #GDBusMethodInvocation.
9049 * @value: Parameter to return.
9051 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</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.
9053 * This method will free @invocation, you cannot use it afterwards.
9058 * _g_freedesktop_dbus_complete_update_activation_environment:
9059 * @object: A #_GFreedesktopDBus.
9060 * @invocation: (transfer full): A #GDBusMethodInvocation.
9062 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</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.
9064 * This method will free @invocation, you cannot use it afterwards.
9069 * _g_freedesktop_dbus_emit_name_acquired:
9070 * @object: A #_GFreedesktopDBus.
9071 * @arg_name: Argument to pass with the signal.
9073 * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameAcquired">"NameAcquired"</link> D-Bus signal.
9078 * _g_freedesktop_dbus_emit_name_lost:
9079 * @object: A #_GFreedesktopDBus.
9080 * @arg_name: Argument to pass with the signal.
9082 * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameLost">"NameLost"</link> D-Bus signal.
9087 * _g_freedesktop_dbus_emit_name_owner_changed:
9088 * @object: A #_GFreedesktopDBus.
9089 * @arg_name: Argument to pass with the signal.
9090 * @arg_old_owner: Argument to pass with the signal.
9091 * @arg_new_owner: Argument to pass with the signal.
9093 * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameOwnerChanged">"NameOwnerChanged"</link> D-Bus signal.
9098 * _g_freedesktop_dbus_interface_info:
9100 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link> D-Bus interface.
9102 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
9107 * _g_freedesktop_dbus_override_properties:
9108 * @klass: The class structure for a #GObject<!-- -->-derived class.
9109 * @property_id_begin: The property id to assign to the first overridden property.
9111 * Overrides all #GObject properties in the #_GFreedesktopDBus interface for a concrete class.
9112 * The properties are overridden in the order they are defined.
9114 * Returns: The last property id.
9119 * _g_freedesktop_dbus_proxy_new:
9120 * @connection: A #GDBusConnection.
9121 * @flags: Flags from the #GDBusProxyFlags enumeration.
9122 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
9123 * @object_path: An object path.
9124 * @cancellable: (allow-none): A #GCancellable or %NULL.
9125 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
9126 * @user_data: User data to pass to @callback.
9128 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>. See g_dbus_proxy_new() for more details.
9130 * 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.
9131 * You can then call _g_freedesktop_dbus_proxy_new_finish() to get the result of the operation.
9133 * See _g_freedesktop_dbus_proxy_new_sync() for the synchronous, blocking version of this constructor.
9138 * _g_freedesktop_dbus_proxy_new_finish:
9139 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new().
9140 * @error: Return location for error or %NULL
9142 * Finishes an operation started with _g_freedesktop_dbus_proxy_new().
9144 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
9149 * _g_freedesktop_dbus_proxy_new_for_bus:
9150 * @bus_type: A #GBusType.
9151 * @flags: Flags from the #GDBusProxyFlags enumeration.
9152 * @name: A bus name (well-known or unique).
9153 * @object_path: An object path.
9154 * @cancellable: (allow-none): A #GCancellable or %NULL.
9155 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
9156 * @user_data: User data to pass to @callback.
9158 * Like _g_freedesktop_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
9160 * 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.
9161 * You can then call _g_freedesktop_dbus_proxy_new_for_bus_finish() to get the result of the operation.
9163 * See _g_freedesktop_dbus_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
9168 * _g_freedesktop_dbus_proxy_new_for_bus_finish:
9169 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new_for_bus().
9170 * @error: Return location for error or %NULL
9172 * Finishes an operation started with _g_freedesktop_dbus_proxy_new_for_bus().
9174 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
9179 * _g_freedesktop_dbus_proxy_new_for_bus_sync:
9180 * @bus_type: A #GBusType.
9181 * @flags: Flags from the #GDBusProxyFlags enumeration.
9182 * @name: A bus name (well-known or unique).
9183 * @object_path: An object path.
9184 * @cancellable: (allow-none): A #GCancellable or %NULL.
9185 * @error: Return location for error or %NULL
9187 * Like _g_freedesktop_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
9189 * The calling thread is blocked until a reply is received.
9191 * See _g_freedesktop_dbus_proxy_new_for_bus() for the asynchronous version of this constructor.
9193 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
9198 * _g_freedesktop_dbus_proxy_new_sync:
9199 * @connection: A #GDBusConnection.
9200 * @flags: Flags from the #GDBusProxyFlags enumeration.
9201 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
9202 * @object_path: An object path.
9203 * @cancellable: (allow-none): A #GCancellable or %NULL.
9204 * @error: Return location for error or %NULL
9206 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>. See g_dbus_proxy_new_sync() for more details.
9208 * The calling thread is blocked until a reply is received.
9210 * See _g_freedesktop_dbus_proxy_new() for the asynchronous version of this constructor.
9212 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
9217 * _g_freedesktop_dbus_skeleton_new:
9219 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
9221 * Returns: (transfer full) (type _GFreedesktopDBusSkeleton): The skeleton object.
9226 * _g_io_module_get_default:
9227 * @extension_point: the name of an extension point
9228 * @envvar: (allow-none): the name of an environment variable to override the default implementation.
9229 * @verify_func: (allow-none): a function to call to verify that a given implementation is usable in the current environment.
9231 * Retrieves the default object implementing @extension_point.
9233 * If @envvar is not %NULL, and the environment variable with that
9234 * name is set, then the implementation it specifies will be tried
9235 * first. After that, or if @envvar is not set, all other
9236 * implementations will be tried in order of decreasing priority.
9238 * If an extension point implementation implements #GInitable, then
9239 * that implementation will only be used if it initializes
9240 * successfully. Otherwise, if @verify_func is not %NULL, then it will
9241 * be called on each candidate implementation after construction, to
9242 * check if it is actually usable or not.
9244 * The result is cached after it is generated the first time, and
9245 * the function is thread-safe.
9247 * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
9252 * g_action_activate:
9253 * @action: a #GAction
9254 * @parameter: (allow-none): the parameter to the activation
9256 * Activates the action.
9258 * @parameter must be the correct type of parameter for the action (ie:
9259 * the parameter type given at construction time). If the parameter
9260 * type was %NULL then @parameter must also be %NULL.
9267 * g_action_change_state:
9268 * @action: a #GAction
9269 * @value: the new state
9271 * Request for the state of @action to be changed to @value.
9273 * The action must be stateful and @value must be of the correct type.
9274 * See g_action_get_state_type().
9276 * This call merely requests a change. The action may refuse to change
9277 * its state or may change its state to something other than @value.
9278 * See g_action_get_state_hint().
9280 * If the @value GVariant is floating, it is consumed.
9287 * g_action_get_enabled:
9288 * @action: a #GAction
9290 * Checks if @action is currently enabled.
9292 * An action must be enabled in order to be activated or in order to
9293 * have its state changed from outside callers.
9295 * Returns: whether the action is enabled
9301 * g_action_get_name:
9302 * @action: a #GAction
9304 * Queries the name of @action.
9306 * Returns: the name of the action
9312 * g_action_get_parameter_type:
9313 * @action: a #GAction
9315 * Queries the type of the parameter that must be given when activating
9318 * When activating the action using g_action_activate(), the #GVariant
9319 * given to that function must be of the type returned by this function.
9321 * In the case that this function returns %NULL, you must not give any
9322 * #GVariant, but %NULL instead.
9324 * Returns: (allow-none): the parameter type
9330 * g_action_get_state:
9331 * @action: a #GAction
9333 * Queries the current state of @action.
9335 * If the action is not stateful then %NULL will be returned. If the
9336 * action is stateful then the type of the return value is the type
9337 * given by g_action_get_state_type().
9339 * The return value (if non-%NULL) should be freed with
9340 * g_variant_unref() when it is no longer required.
9342 * Returns: (transfer full): the current state of the action
9348 * g_action_get_state_hint:
9349 * @action: a #GAction
9351 * Requests a hint about the valid range of values for the state of
9354 * If %NULL is returned it either means that the action is not stateful
9355 * or that there is no hint about the valid range of values for the
9356 * state of the action.
9358 * If a #GVariant array is returned then each item in the array is a
9359 * possible value for the state. If a #GVariant pair (ie: two-tuple) is
9360 * returned then the tuple specifies the inclusive lower and upper bound
9361 * of valid values for the state.
9363 * In any case, the information is merely a hint. It may be possible to
9364 * have a state value outside of the hinted range and setting a value
9365 * within the range may fail.
9367 * The return value (if non-%NULL) should be freed with
9368 * g_variant_unref() when it is no longer required.
9370 * Returns: (transfer full): the state range hint
9376 * g_action_get_state_type:
9377 * @action: a #GAction
9379 * Queries the type of the state of @action.
9381 * If the action is stateful (e.g. created with
9382 * g_simple_action_new_stateful()) then this function returns the
9383 * #GVariantType of the state. This is the type of the initial value
9384 * given as the state. All calls to g_action_change_state() must give a
9385 * #GVariant of this type and g_action_get_state() will return a
9386 * #GVariant of the same type.
9388 * If the action is not stateful (e.g. created with g_simple_action_new())
9389 * then this function will return %NULL. In that case, g_action_get_state()
9390 * will return %NULL and you must not call g_action_change_state().
9392 * Returns: (allow-none): the state type, if the action is stateful
9398 * g_action_group_action_added:
9399 * @action_group: a #GActionGroup
9400 * @action_name: the name of an action in the group
9402 * Emits the #GActionGroup::action-added signal on @action_group.
9404 * This function should only be called by #GActionGroup implementations.
9411 * g_action_group_action_enabled_changed:
9412 * @action_group: a #GActionGroup
9413 * @action_name: the name of an action in the group
9414 * @enabled: whether or not the action is now enabled
9416 * Emits the #GActionGroup::action-enabled-changed signal on @action_group.
9418 * This function should only be called by #GActionGroup implementations.
9425 * g_action_group_action_removed:
9426 * @action_group: a #GActionGroup
9427 * @action_name: the name of an action in the group
9429 * Emits the #GActionGroup::action-removed signal on @action_group.
9431 * This function should only be called by #GActionGroup implementations.
9438 * g_action_group_action_state_changed:
9439 * @action_group: a #GActionGroup
9440 * @action_name: the name of an action in the group
9441 * @state: the new state of the named action
9443 * Emits the #GActionGroup::action-state-changed signal on @action_group.
9445 * This function should only be called by #GActionGroup implementations.
9452 * g_action_group_activate_action:
9453 * @action_group: a #GActionGroup
9454 * @action_name: the name of the action to activate
9455 * @parameter: (allow-none): parameters to the activation
9457 * Activate the named action within @action_group.
9459 * If the action is expecting a parameter, then the correct type of
9460 * parameter must be given as @parameter. If the action is expecting no
9461 * parameters then @parameter must be %NULL. See
9462 * g_action_group_get_action_parameter_type().
9469 * g_action_group_change_action_state:
9470 * @action_group: a #GActionGroup
9471 * @action_name: the name of the action to request the change on
9472 * @value: the new state
9474 * Request for the state of the named action within @action_group to be
9475 * changed to @value.
9477 * The action must be stateful and @value must be of the correct type.
9478 * See g_action_group_get_action_state_type().
9480 * This call merely requests a change. The action may refuse to change
9481 * its state or may change its state to something other than @value.
9482 * See g_action_group_get_action_state_hint().
9484 * If the @value GVariant is floating, it is consumed.
9491 * g_action_group_get_action_enabled:
9492 * @action_group: a #GActionGroup
9493 * @action_name: the name of the action to query
9495 * Checks if the named action within @action_group is currently enabled.
9497 * An action must be enabled in order to be activated or in order to
9498 * have its state changed from outside callers.
9500 * Returns: whether or not the action is currently enabled
9506 * g_action_group_get_action_parameter_type:
9507 * @action_group: a #GActionGroup
9508 * @action_name: the name of the action to query
9510 * Queries the type of the parameter that must be given when activating
9511 * the named action within @action_group.
9513 * When activating the action using g_action_group_activate_action(),
9514 * the #GVariant given to that function must be of the type returned
9517 * In the case that this function returns %NULL, you must not give any
9518 * #GVariant, but %NULL instead.
9520 * The parameter type of a particular action will never change but it is
9521 * possible for an action to be removed and for a new action to be added
9522 * with the same name but a different parameter type.
9524 * Returns: the parameter type
9530 * g_action_group_get_action_state:
9531 * @action_group: a #GActionGroup
9532 * @action_name: the name of the action to query
9534 * Queries the current state of the named action within @action_group.
9536 * If the action is not stateful then %NULL will be returned. If the
9537 * action is stateful then the type of the return value is the type
9538 * given by g_action_group_get_action_state_type().
9540 * The return value (if non-%NULL) should be freed with
9541 * g_variant_unref() when it is no longer required.
9543 * Returns: (allow-none): the current state of the action
9549 * g_action_group_get_action_state_hint:
9550 * @action_group: a #GActionGroup
9551 * @action_name: the name of the action to query
9553 * Requests a hint about the valid range of values for the state of the
9554 * named action within @action_group.
9556 * If %NULL is returned it either means that the action is not stateful
9557 * or that there is no hint about the valid range of values for the
9558 * state of the action.
9560 * If a #GVariant array is returned then each item in the array is a
9561 * possible value for the state. If a #GVariant pair (ie: two-tuple) is
9562 * returned then the tuple specifies the inclusive lower and upper bound
9563 * of valid values for the state.
9565 * In any case, the information is merely a hint. It may be possible to
9566 * have a state value outside of the hinted range and setting a value
9567 * within the range may fail.
9569 * The return value (if non-%NULL) should be freed with
9570 * g_variant_unref() when it is no longer required.
9572 * Returns: (transfer full): the state range hint
9578 * g_action_group_get_action_state_type:
9579 * @action_group: a #GActionGroup
9580 * @action_name: the name of the action to query
9582 * Queries the type of the state of the named action within
9585 * If the action is stateful then this function returns the
9586 * #GVariantType of the state. All calls to
9587 * g_action_group_change_action_state() must give a #GVariant of this
9588 * type and g_action_group_get_action_state() will return a #GVariant
9591 * If the action is not stateful then this function will return %NULL.
9592 * In that case, g_action_group_get_action_state() will return %NULL
9593 * and you must not call g_action_group_change_action_state().
9595 * The state type of a particular action will never change but it is
9596 * possible for an action to be removed and for a new action to be added
9597 * with the same name but a different state type.
9599 * Returns: (transfer full): the state type, if the action is stateful
9605 * g_action_group_has_action:
9606 * @action_group: a #GActionGroup
9607 * @action_name: the name of the action to check for
9609 * Checks if the named action exists within @action_group.
9611 * Returns: whether the named action exists
9617 * g_action_group_list_actions:
9618 * @action_group: a #GActionGroup
9620 * Lists the actions contained within @action_group.
9622 * The caller is responsible for freeing the list with g_strfreev() when
9623 * it is no longer required.
9625 * Returns: (transfer full): a %NULL-terminated array of the names of the actions in the groupb
9631 * g_action_group_query_action:
9632 * @action_group: a #GActionGroup
9633 * @action_name: the name of an action in the group
9634 * @enabled: (out): if the action is presently enabled
9635 * @parameter_type: (out) (allow-none): the parameter type, or %NULL if none needed
9636 * @state_type: (out) (allow-none): the state type, or %NULL if stateless
9637 * @state_hint: (out) (allow-none): the state hint, or %NULL if none
9638 * @state: (out) (allow-none): the current state, or %NULL if stateless
9640 * Queries all aspects of the named action within an @action_group.
9642 * This function acquires the information available from
9643 * g_action_group_has_action(), g_action_group_get_action_enabled(),
9644 * g_action_group_get_action_parameter_type(),
9645 * g_action_group_get_action_state_type(),
9646 * g_action_group_get_action_state_hint() and
9647 * g_action_group_get_action_state() with a single function call.
9649 * This provides two main benefits.
9651 * The first is the improvement in efficiency that comes with not having
9652 * to perform repeated lookups of the action in order to discover
9653 * different things about it. The second is that implementing
9654 * #GActionGroup can now be done by only overriding this one virtual
9657 * The interface provides a default implementation of this function that
9658 * calls the individual functions, as required, to fetch the
9659 * information. The interface also provides default implementations of
9660 * those functions that call this function. All implementations,
9661 * therefore, must override either this function or all of the others.
9663 * If the action exists, %TRUE is returned and any of the requested
9664 * fields (as indicated by having a non-%NULL reference passed in) are
9665 * filled. If the action doesn't exist, %FALSE is returned and the
9666 * fields may or may not have been modified.
9668 * Returns: %TRUE if the action exists, else %FALSE
9674 * g_action_map_add_action:
9675 * @action_map: a #GActionMap
9676 * @action: a #GAction
9678 * Adds an action to the @action_map.
9680 * If the action map already contains an action with the same name
9681 * as @action then the old action is dropped from the action map.
9683 * The action map takes its own reference on @action.
9690 * g_action_map_add_action_entries:
9691 * @action_map: a #GActionMap
9692 * @entries: a pointer to the first item in an array of #GActionEntry structs
9693 * @n_entries: the length of @entries, or -1 if @entries is %NULL-terminated
9694 * @user_data: the user data for signal connections
9696 * A convenience function for creating multiple #GSimpleAction instances
9697 * and adding them to a #GActionMap.
9699 * Each action is constructed as per one #GActionEntry.
9702 * <title>Using g_action_map_add_action_entries()</title>
9705 * activate_quit (GSimpleAction *simple,
9706 * GVariant *parameter,
9707 * gpointer user_data)
9713 * activate_print_string (GSimpleAction *simple,
9714 * GVariant *parameter,
9715 * gpointer user_data)
9717 * g_print ("%s\n", g_variant_get_string (parameter, NULL));
9720 * static GActionGroup *
9721 * create_action_group (void)
9723 * const GActionEntry entries[] = {
9724 * { "quit", activate_quit },
9725 * { "print-string", activate_print_string, "s" }
9727 * GSimpleActionGroup *group;
9729 * group = g_simple_action_group_new ();
9730 * g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
9732 * return G_ACTION_GROUP (group);
9742 * g_action_map_lookup_action:
9743 * @action_map: a #GActionMap
9744 * @action_name: the name of an action
9746 * Looks up the action with the name @action_name in @action_map.
9748 * If no such action exists, returns %NULL.
9750 * Returns: (transfer none): a #GAction, or %NULL
9756 * g_action_map_remove_action:
9757 * @action_map: a #GActionMap
9758 * @action_name: the name of the action
9760 * Removes the named action from the action map.
9762 * If no action of this name is in the map then nothing happens.
9769 * g_app_info_add_supports_type:
9770 * @appinfo: a #GAppInfo.
9771 * @content_type: a string.
9772 * @error: a #GError.
9774 * Adds a content type to the application information to indicate the
9775 * application is capable of opening files with the given content type.
9777 * Returns: %TRUE on success, %FALSE on error.
9782 * g_app_info_can_delete:
9783 * @appinfo: a #GAppInfo
9785 * Obtains the information whether the #GAppInfo can be deleted.
9786 * See g_app_info_delete().
9788 * Returns: %TRUE if @appinfo can be deleted
9794 * g_app_info_can_remove_supports_type:
9795 * @appinfo: a #GAppInfo.
9797 * Checks if a supported content type can be removed from an application.
9799 * Returns: %TRUE if it is possible to remove supported content types from a given @appinfo, %FALSE if not.
9804 * g_app_info_create_from_commandline:
9805 * @commandline: the commandline to use
9806 * @application_name: (allow-none): the application name, or %NULL to use @commandline
9807 * @flags: flags that can specify details of the created #GAppInfo
9808 * @error: a #GError location to store the error occurring, %NULL to ignore.
9810 * Creates a new #GAppInfo from the given information.
9812 * Note that for @commandline, the quoting rules of the Exec key of the
9813 * <ulink url="http://freedesktop.org/Standards/desktop-entry-spec">freedesktop.org Desktop
9814 * Entry Specification</ulink> are applied. For example, if the @commandline contains
9815 * percent-encoded URIs, the percent-character must be doubled in order to prevent it from
9816 * being swallowed by Exec key unquoting. See the specification for exact quoting rules.
9818 * Returns: (transfer full): new #GAppInfo for given command.
9823 * g_app_info_delete:
9824 * @appinfo: a #GAppInfo
9826 * Tries to delete a #GAppInfo.
9828 * On some platforms, there may be a difference between user-defined
9829 * #GAppInfo<!-- -->s which can be deleted, and system-wide ones which
9830 * cannot. See g_app_info_can_delete().
9832 * Virtual: do_delete
9833 * Returns: %TRUE if @appinfo has been deleted
9840 * @appinfo: a #GAppInfo.
9842 * Creates a duplicate of a #GAppInfo.
9844 * Returns: (transfer full): a duplicate of @appinfo.
9850 * @appinfo1: the first #GAppInfo.
9851 * @appinfo2: the second #GAppInfo.
9853 * Checks if two #GAppInfo<!-- -->s are equal.
9855 * Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
9860 * g_app_info_get_all:
9862 * Gets a list of all of the applications currently registered
9865 * For desktop files, this includes applications that have
9866 * <literal>NoDisplay=true</literal> set or are excluded from
9867 * display by means of <literal>OnlyShowIn</literal> or
9868 * <literal>NotShowIn</literal>. See g_app_info_should_show().
9869 * The returned list does not include applications which have
9870 * the <literal>Hidden</literal> key set.
9872 * Returns: (element-type GAppInfo) (transfer full): a newly allocated #GList of references to #GAppInfo<!---->s.
9877 * g_app_info_get_all_for_type:
9878 * @content_type: the content type to find a #GAppInfo for
9880 * Gets a list of all #GAppInfos for a given content type,
9881 * including the recommended and fallback #GAppInfos. See
9882 * g_app_info_get_recommended_for_type() and
9883 * g_app_info_get_fallback_for_type().
9885 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9890 * g_app_info_get_commandline:
9891 * @appinfo: a #GAppInfo
9893 * Gets the commandline with which the application will be
9896 * Returns: a string containing the @appinfo's commandline, or %NULL if this information is not available
9902 * g_app_info_get_default_for_type:
9903 * @content_type: the content type to find a #GAppInfo for
9904 * @must_support_uris: if %TRUE, the #GAppInfo is expected to support URIs
9906 * Gets the default #GAppInfo for a given content type.
9908 * Returns: (transfer full): #GAppInfo for given @content_type or %NULL on error.
9913 * g_app_info_get_default_for_uri_scheme:
9914 * @uri_scheme: a string containing a URI scheme.
9916 * Gets the default application for handling URIs with
9917 * the given URI scheme. A URI scheme is the initial part
9918 * of the URI, up to but not including the ':', e.g. "http",
9921 * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
9926 * g_app_info_get_description:
9927 * @appinfo: a #GAppInfo.
9929 * Gets a human-readable description of an installed application.
9931 * Returns: a string containing a description of the application @appinfo, or %NULL if none.
9936 * g_app_info_get_display_name:
9937 * @appinfo: a #GAppInfo.
9939 * Gets the display name of the application. The display name is often more
9940 * descriptive to the user than the name itself.
9942 * Returns: the display name of the application for @appinfo, or the name if no display name is available.
9948 * g_app_info_get_executable:
9949 * @appinfo: a #GAppInfo
9951 * Gets the executable's name for the installed application.
9953 * Returns: a string containing the @appinfo's application binaries name
9958 * g_app_info_get_fallback_for_type:
9959 * @content_type: the content type to find a #GAppInfo for
9961 * Gets a list of fallback #GAppInfos for a given content type, i.e.
9962 * those applications which claim to support the given content type
9963 * by MIME type subclassing and not directly.
9965 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9971 * g_app_info_get_icon:
9972 * @appinfo: a #GAppInfo.
9974 * Gets the icon for the application.
9976 * Returns: (transfer none): the default #GIcon for @appinfo or %NULL if there is no default icon.
9981 * g_app_info_get_id:
9982 * @appinfo: a #GAppInfo.
9984 * Gets the ID of an application. An id is a string that
9985 * identifies the application. The exact format of the id is
9986 * platform dependent. For instance, on Unix this is the
9987 * desktop file id from the xdg menu specification.
9989 * Note that the returned ID may be %NULL, depending on how
9990 * the @appinfo has been constructed.
9992 * Returns: a string containing the application's ID.
9997 * g_app_info_get_name:
9998 * @appinfo: a #GAppInfo.
10000 * Gets the installed name of the application.
10002 * Returns: the name of the application for @appinfo.
10007 * g_app_info_get_recommended_for_type:
10008 * @content_type: the content type to find a #GAppInfo for
10010 * Gets a list of recommended #GAppInfos for a given content type, i.e.
10011 * those applications which claim to support the given content type exactly,
10012 * and not by MIME type subclassing.
10013 * Note that the first application of the list is the last used one, i.e.
10014 * the last one for which g_app_info_set_as_last_used_for_type() has been
10017 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
10023 * g_app_info_get_supported_types:
10024 * @appinfo: a #GAppInfo that can handle files
10026 * Retrieves the list of content types that @app_info claims to support.
10027 * If this information is not provided by the environment, this function
10028 * will return %NULL.
10029 * This function does not take in consideration associations added with
10030 * g_app_info_add_supports_type(), but only those exported directly by
10033 * Returns: (transfer none) (array zero-terminated=1) (element-type utf8): a list of content types.
10039 * g_app_info_launch:
10040 * @appinfo: a #GAppInfo
10041 * @files: (allow-none) (element-type GFile): a #GList of #GFile objects
10042 * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
10043 * @error: a #GError
10045 * Launches the application. Passes @files to the launched application
10046 * as arguments, using the optional @launch_context to get information
10047 * about the details of the launcher (like what screen it is on).
10048 * On error, @error will be set accordingly.
10050 * To launch the application without arguments pass a %NULL @files list.
10052 * Note that even if the launch is successful the application launched
10053 * can fail to start if it runs into problems during startup. There is
10054 * no way to detect this.
10056 * Some URIs can be changed when passed through a GFile (for instance
10057 * unsupported URIs with strange formats like mailto:), so if you have
10058 * a textual URI you want to pass in as argument, consider using
10059 * g_app_info_launch_uris() instead.
10061 * The launched application inherits the environment of the launching
10062 * process, but it can be modified with g_app_launch_context_setenv() and
10063 * g_app_launch_context_unsetenv().
10065 * On UNIX, this function sets the <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>
10066 * environment variable with the path of the launched desktop file and
10067 * <envar>GIO_LAUNCHED_DESKTOP_FILE_PID</envar> to the process
10068 * id of the launched process. This can be used to ignore
10069 * <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>, should it be inherited
10070 * by further processes. The <envar>DISPLAY</envar> and
10071 * <envar>DESKTOP_STARTUP_ID</envar> environment variables are also
10072 * set, based on information provided in @launch_context.
10074 * Returns: %TRUE on successful launch, %FALSE otherwise.
10079 * g_app_info_launch_default_for_uri:
10080 * @uri: the uri to show
10081 * @launch_context: (allow-none): an optional #GAppLaunchContext.
10082 * @error: a #GError.
10084 * Utility function that launches the default application
10085 * registered to handle the specified uri. Synchronous I/O
10086 * is done on the uri to detect the type of the file if
10089 * Returns: %TRUE on success, %FALSE on error.
10094 * g_app_info_launch_uris:
10095 * @appinfo: a #GAppInfo
10096 * @uris: (allow-none) (element-type utf8): a #GList containing URIs to launch.
10097 * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
10098 * @error: a #GError
10100 * Launches the application. This passes the @uris to the launched application
10101 * as arguments, using the optional @launch_context to get information
10102 * about the details of the launcher (like what screen it is on).
10103 * On error, @error will be set accordingly.
10105 * To launch the application without arguments pass a %NULL @uris list.
10107 * Note that even if the launch is successful the application launched
10108 * can fail to start if it runs into problems during startup. There is
10109 * no way to detect this.
10111 * Returns: %TRUE on successful launch, %FALSE otherwise.
10116 * g_app_info_remove_supports_type:
10117 * @appinfo: a #GAppInfo.
10118 * @content_type: a string.
10119 * @error: a #GError.
10121 * Removes a supported type from an application, if possible.
10123 * Returns: %TRUE on success, %FALSE on error.
10128 * g_app_info_reset_type_associations:
10129 * @content_type: a content type
10131 * Removes all changes to the type associations done by
10132 * g_app_info_set_as_default_for_type(),
10133 * g_app_info_set_as_default_for_extension(),
10134 * g_app_info_add_supports_type() or
10135 * g_app_info_remove_supports_type().
10142 * g_app_info_set_as_default_for_extension:
10143 * @appinfo: a #GAppInfo.
10144 * @extension: a string containing the file extension (without the dot).
10145 * @error: a #GError.
10147 * Sets the application as the default handler for the given file extension.
10149 * Returns: %TRUE on success, %FALSE on error.
10154 * g_app_info_set_as_default_for_type:
10155 * @appinfo: a #GAppInfo.
10156 * @content_type: the content type.
10157 * @error: a #GError.
10159 * Sets the application as the default handler for a given type.
10161 * Returns: %TRUE on success, %FALSE on error.
10166 * g_app_info_set_as_last_used_for_type:
10167 * @appinfo: a #GAppInfo.
10168 * @content_type: the content type.
10169 * @error: a #GError.
10171 * Sets the application as the last used application for a given type.
10172 * This will make the application appear as first in the list returned
10173 * by g_app_info_get_recommended_for_type(), regardless of the default
10174 * application for that content type.
10176 * Returns: %TRUE on success, %FALSE on error.
10181 * g_app_info_should_show:
10182 * @appinfo: a #GAppInfo.
10184 * Checks if the application info should be shown in menus that
10185 * list available applications.
10187 * Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
10192 * g_app_info_supports_files:
10193 * @appinfo: a #GAppInfo.
10195 * Checks if the application accepts files as arguments.
10197 * Returns: %TRUE if the @appinfo supports files.
10202 * g_app_info_supports_uris:
10203 * @appinfo: a #GAppInfo.
10205 * Checks if the application supports reading files and directories from URIs.
10207 * Returns: %TRUE if the @appinfo supports URIs.
10212 * g_app_launch_context_get_display:
10213 * @context: a #GAppLaunchContext
10214 * @info: a #GAppInfo
10215 * @files: (element-type GFile): a #GList of #GFile objects
10217 * Gets the display string for the @context. This is used to ensure new
10218 * applications are started on the same display as the launching
10219 * application, by setting the <envar>DISPLAY</envar> environment variable.
10221 * Returns: a display string for the display.
10226 * g_app_launch_context_get_environment:
10227 * @context: a #GAppLaunchContext
10229 * Gets the complete environment variable list to be passed to
10230 * the child process when @context is used to launch an application.
10231 * This is a %NULL-terminated array of strings, where each string has
10232 * the form <literal>KEY=VALUE</literal>.
10234 * Returns: (array zero-terminated=1) (transfer full): the child's environment
10240 * g_app_launch_context_get_startup_notify_id:
10241 * @context: a #GAppLaunchContext
10242 * @info: a #GAppInfo
10243 * @files: (element-type GFile): a #GList of of #GFile objects
10245 * Initiates startup notification for the application and returns the
10246 * <envar>DESKTOP_STARTUP_ID</envar> for the launched operation,
10249 * Startup notification IDs are defined in the <ulink
10250 * url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
10251 * FreeDesktop.Org Startup Notifications standard</ulink>.
10253 * Returns: a startup notification ID for the application, or %NULL if not supported.
10258 * g_app_launch_context_launch_failed:
10259 * @context: a #GAppLaunchContext.
10260 * @startup_notify_id: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
10262 * Called when an application has failed to launch, so that it can cancel
10263 * the application startup notification started in g_app_launch_context_get_startup_notify_id().
10268 * g_app_launch_context_new:
10270 * Creates a new application launch context. This is not normally used,
10271 * instead you instantiate a subclass of this, such as #GdkAppLaunchContext.
10273 * Returns: a #GAppLaunchContext.
10278 * g_app_launch_context_setenv:
10279 * @context: a #GAppLaunchContext
10280 * @variable: the environment variable to set
10281 * @value: the value for to set the variable to.
10283 * Arranges for @variable to be set to @value in the child's
10284 * environment when @context is used to launch an application.
10291 * g_app_launch_context_unsetenv:
10292 * @context: a #GAppLaunchContext
10293 * @variable: the environment variable to remove
10295 * Arranges for @variable to be unset in the child's environment
10296 * when @context is used to launch an application.
10303 * g_application_activate:
10304 * @application: a #GApplication
10306 * Activates the application.
10308 * In essence, this results in the #GApplication::activate signal being
10309 * emitted in the primary instance.
10311 * The application must be registered before calling this function.
10318 * g_application_command_line_get_arguments:
10319 * @cmdline: a #GApplicationCommandLine
10320 * @argc: (out) (allow-none): the length of the arguments array, or %NULL
10322 * Gets the list of arguments that was passed on the command line.
10324 * The strings in the array may contain non-utf8 data.
10326 * The return value is %NULL-terminated and should be freed using
10329 * Returns: (array length=argc) (transfer full): the string array containing the arguments (the argv)
10335 * g_application_command_line_get_cwd:
10336 * @cmdline: a #GApplicationCommandLine
10338 * Gets the working directory of the command line invocation.
10339 * The string may contain non-utf8 data.
10341 * It is possible that the remote application did not send a working
10342 * directory, so this may be %NULL.
10344 * The return value should not be modified or freed and is valid for as
10345 * long as @cmdline exists.
10347 * Returns: the current directory, or %NULL
10353 * g_application_command_line_get_environ:
10354 * @cmdline: a #GApplicationCommandLine
10356 * Gets the contents of the 'environ' variable of the command line
10357 * invocation, as would be returned by g_get_environ(), ie as a
10358 * %NULL-terminated list of strings in the form 'NAME=VALUE'.
10359 * The strings may contain non-utf8 data.
10361 * The remote application usually does not send an environment. Use
10362 * %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
10363 * set it is possible that the environment is still not available (due
10364 * to invocation messages from other applications).
10366 * The return value should not be modified or freed and is valid for as
10367 * long as @cmdline exists.
10369 * See g_application_command_line_getenv() if you are only interested
10370 * in the value of a single environment variable.
10372 * Returns: (array zero-terminated=1) (transfer none): the environment strings, or %NULL if they were not sent
10378 * g_application_command_line_get_exit_status:
10379 * @cmdline: a #GApplicationCommandLine
10381 * Gets the exit status of @cmdline. See
10382 * g_application_command_line_set_exit_status() for more information.
10384 * Returns: the exit status
10390 * g_application_command_line_get_is_remote:
10391 * @cmdline: a #GApplicationCommandLine
10393 * Determines if @cmdline represents a remote invocation.
10395 * Returns: %TRUE if the invocation was remote
10401 * g_application_command_line_get_platform_data:
10402 * @cmdline: #GApplicationCommandLine
10404 * Gets the platform data associated with the invocation of @cmdline.
10406 * This is a #GVariant dictionary containing information about the
10407 * context in which the invocation occurred. It typically contains
10408 * information like the current working directory and the startup
10411 * For local invocation, it will be %NULL.
10413 * Returns: (allow-none): the platform data, or %NULL
10419 * g_application_command_line_getenv:
10420 * @cmdline: a #GApplicationCommandLine
10421 * @name: the environment variable to get
10423 * Gets the value of a particular environment variable of the command
10424 * line invocation, as would be returned by g_getenv(). The strings may
10425 * contain non-utf8 data.
10427 * The remote application usually does not send an environment. Use
10428 * %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
10429 * set it is possible that the environment is still not available (due
10430 * to invocation messages from other applications).
10432 * The return value should not be modified or freed and is valid for as
10433 * long as @cmdline exists.
10435 * Returns: the value of the variable, or %NULL if unset or unsent
10441 * g_application_command_line_print:
10442 * @cmdline: a #GApplicationCommandLine
10443 * @format: a printf-style format string
10444 * @...: arguments, as per @format
10446 * Formats a message and prints it using the stdout print handler in the
10447 * invoking process.
10449 * If @cmdline is a local invocation then this is exactly equivalent to
10450 * g_print(). If @cmdline is remote then this is equivalent to calling
10451 * g_print() in the invoking process.
10458 * g_application_command_line_printerr:
10459 * @cmdline: a #GApplicationCommandLine
10460 * @format: a printf-style format string
10461 * @...: arguments, as per @format
10463 * Formats a message and prints it using the stderr print handler in the
10464 * invoking process.
10466 * If @cmdline is a local invocation then this is exactly equivalent to
10467 * g_printerr(). If @cmdline is remote then this is equivalent to
10468 * calling g_printerr() in the invoking process.
10475 * g_application_command_line_set_exit_status:
10476 * @cmdline: a #GApplicationCommandLine
10477 * @exit_status: the exit status
10479 * Sets the exit status that will be used when the invoking process
10482 * The return value of the #GApplication::command-line signal is
10483 * passed to this function when the handler returns. This is the usual
10484 * way of setting the exit status.
10486 * In the event that you want the remote invocation to continue running
10487 * and want to decide on the exit status in the future, you can use this
10488 * call. For the case of a remote invocation, the remote process will
10489 * typically exit when the last reference is dropped on @cmdline. The
10490 * exit status of the remote process will be equal to the last value
10491 * that was set with this function.
10493 * In the case that the commandline invocation is local, the situation
10494 * is slightly more complicated. If the commandline invocation results
10495 * in the mainloop running (ie: because the use-count of the application
10496 * increased to a non-zero value) then the application is considered to
10497 * have been 'successful' in a certain sense, and the exit status is
10498 * always zero. If the application use count is zero, though, the exit
10499 * status of the local #GApplicationCommandLine is used.
10506 * g_application_get_application_id:
10507 * @application: a #GApplication
10509 * Gets the unique identifier for @application.
10511 * Returns: the identifier for @application, owned by @application
10517 * g_application_get_dbus_connection:
10518 * @application: a #GApplication
10520 * Gets the #GDBusConnection being used by the application, or %NULL.
10522 * If #GApplication is using its D-Bus backend then this function will
10523 * return the #GDBusConnection being used for uniqueness and
10524 * communication with the desktop environment and other instances of the
10527 * If #GApplication is not using D-Bus then this function will return
10528 * %NULL. This includes the situation where the D-Bus backend would
10529 * normally be in use but we were unable to connect to the bus.
10531 * This function must not be called before the application has been
10532 * registered. See g_application_get_is_registered().
10534 * Returns: (transfer none): a #GDBusConnection, or %NULL
10540 * g_application_get_dbus_object_path:
10541 * @application: a #GApplication
10543 * Gets the D-Bus object path being used by the application, or %NULL.
10545 * If #GApplication is using its D-Bus backend then this function will
10546 * return the D-Bus object path that #GApplication is using. If the
10547 * application is the primary instance then there is an object published
10548 * at this path. If the application is not the primary instance then
10549 * the result of this function is undefined.
10551 * If #GApplication is not using D-Bus then this function will return
10552 * %NULL. This includes the situation where the D-Bus backend would
10553 * normally be in use but we were unable to connect to the bus.
10555 * This function must not be called before the application has been
10556 * registered. See g_application_get_is_registered().
10558 * Returns: the object path, or %NULL
10564 * g_application_get_default:
10566 * Returns the default #GApplication instance for this process.
10568 * Normally there is only one #GApplication per process and it becomes
10569 * the default when it is created. You can exercise more control over
10570 * this by using g_application_set_default().
10572 * If there is no default application then %NULL is returned.
10574 * Returns: (transfer none): the default application for this process, or %NULL
10580 * g_application_get_flags:
10581 * @application: a #GApplication
10583 * Gets the flags for @application.
10585 * See #GApplicationFlags.
10587 * Returns: the flags for @application
10593 * g_application_get_inactivity_timeout:
10594 * @application: a #GApplication
10596 * Gets the current inactivity timeout for the application.
10598 * This is the amount of time (in milliseconds) after the last call to
10599 * g_application_release() before the application stops running.
10601 * Returns: the timeout, in milliseconds
10607 * g_application_get_is_registered:
10608 * @application: a #GApplication
10610 * Checks if @application is registered.
10612 * An application is registered if g_application_register() has been
10613 * successfully called.
10615 * Returns: %TRUE if @application is registered
10621 * g_application_get_is_remote:
10622 * @application: a #GApplication
10624 * Checks if @application is remote.
10626 * If @application is remote then it means that another instance of
10627 * application already exists (the 'primary' instance). Calls to
10628 * perform actions on @application will result in the actions being
10629 * performed by the primary instance.
10631 * The value of this property cannot be accessed before
10632 * g_application_register() has been called. See
10633 * g_application_get_is_registered().
10635 * Returns: %TRUE if @application is remote
10641 * g_application_hold:
10642 * @application: a #GApplication
10644 * Increases the use count of @application.
10646 * Use this function to indicate that the application has a reason to
10647 * continue to run. For example, g_application_hold() is called by GTK+
10648 * when a toplevel window is on the screen.
10650 * To cancel the hold, call g_application_release().
10655 * g_application_id_is_valid:
10656 * @application_id: a potential application identifier
10658 * Checks if @application_id is a valid application identifier.
10660 * A valid ID is required for calls to g_application_new() and
10661 * g_application_set_application_id().
10663 * For convenience, the restrictions on application identifiers are
10666 * <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-." and must not begin with a digit.</listitem>
10667 * <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least three elements).</listitem>
10668 * <listitem>Application identifiers must not begin or end with a '.' (period) character.</listitem>
10669 * <listitem>Application identifiers must not contain consecutive '.' (period) characters.</listitem>
10670 * <listitem>Application identifiers must not exceed 255 characters.</listitem>
10673 * Returns: %TRUE if @application_id is valid
10678 * g_application_new:
10679 * @application_id: (allow-none): the application id
10680 * @flags: the application flags
10682 * Creates a new #GApplication instance.
10684 * If non-%NULL, the application id must be valid. See
10685 * g_application_id_is_valid().
10687 * If no application ID is given then some features of #GApplication
10688 * (most notably application uniqueness) will be disabled.
10690 * Returns: a new #GApplication instance
10695 * g_application_open:
10696 * @application: a #GApplication
10697 * @files: (array length=n_files): an array of #GFiles to open
10698 * @n_files: the length of the @files array
10699 * @hint: a hint (or ""), but never %NULL
10701 * Opens the given files.
10703 * In essence, this results in the #GApplication::open signal being emitted
10704 * in the primary instance.
10706 * @n_files must be greater than zero.
10708 * @hint is simply passed through to the ::open signal. It is
10709 * intended to be used by applications that have multiple modes for
10710 * opening files (eg: "view" vs "edit", etc). Unless you have a need
10711 * for this functionality, you should use "".
10713 * The application must be registered before calling this function
10714 * and it must have the %G_APPLICATION_HANDLES_OPEN flag set.
10721 * g_application_quit:
10722 * @application: a #GApplication
10724 * Immediately quits the application.
10726 * Upon return to the mainloop, g_application_run() will return,
10727 * calling only the 'shutdown' function before doing so.
10729 * The hold count is ignored.
10731 * The result of calling g_application_run() again after it returns is
10739 * g_application_register:
10740 * @application: a #GApplication
10741 * @cancellable: (allow-none): a #GCancellable, or %NULL
10742 * @error: a pointer to a NULL #GError, or %NULL
10744 * Attempts registration of the application.
10746 * This is the point at which the application discovers if it is the
10747 * primary instance or merely acting as a remote for an already-existing
10748 * primary instance. This is implemented by attempting to acquire the
10749 * application identifier as a unique bus name on the session bus using
10752 * If there is no application ID or if %G_APPLICATION_NON_UNIQUE was
10753 * given, then this process will always become the primary instance.
10755 * Due to the internal architecture of GDBus, method calls can be
10756 * dispatched at any time (even if a main loop is not running). For
10757 * this reason, you must ensure that any object paths that you wish to
10758 * register are registered before calling this function.
10760 * If the application has already been registered then %TRUE is
10761 * returned with no work performed.
10763 * The #GApplication::startup signal is emitted if registration succeeds
10764 * and @application is the primary instance (including the non-unique
10767 * In the event of an error (such as @cancellable being cancelled, or a
10768 * failure to connect to the session bus), %FALSE is returned and @error
10769 * is set appropriately.
10771 * Note: the return value of this function is not an indicator that this
10772 * instance is or is not the primary instance of the application. See
10773 * g_application_get_is_remote() for that.
10775 * Returns: %TRUE if registration succeeded
10781 * g_application_release:
10782 * @application: a #GApplication
10784 * Decrease the use count of @application.
10786 * When the use count reaches zero, the application will stop running.
10788 * Never call this function except to cancel the effect of a previous
10789 * call to g_application_hold().
10794 * g_application_run:
10795 * @application: a #GApplication
10796 * @argc: the argc from main() (or 0 if @argv is %NULL)
10797 * @argv: (array length=argc) (allow-none): the argv from main(), or %NULL
10799 * Runs the application.
10801 * This function is intended to be run from main() and its return value
10802 * is intended to be returned by main(). Although you are expected to pass
10803 * the @argc, @argv parameters from main() to this function, it is possible
10804 * to pass %NULL if @argv is not available or commandline handling is not
10807 * First, the local_command_line() virtual function is invoked.
10808 * This function always runs on the local instance. It gets passed a pointer
10809 * to a %NULL-terminated copy of @argv and is expected to remove the arguments
10810 * that it handled (shifting up remaining arguments). See
10811 * <xref linkend="gapplication-example-cmdline2"/> for an example of
10812 * parsing @argv manually. Alternatively, you may use the #GOptionContext API,
10813 * after setting <literal>argc = g_strv_length (argv);</literal>.
10815 * The last argument to local_command_line() is a pointer to the @status
10816 * variable which can used to set the exit status that is returned from
10817 * g_application_run().
10819 * If local_command_line() returns %TRUE, the command line is expected
10820 * to be completely handled, including possibly registering as the primary
10821 * instance, calling g_application_activate() or g_application_open(), etc.
10823 * If local_command_line() returns %FALSE then the application is registered
10824 * and the #GApplication::command-line signal is emitted in the primary
10825 * instance (which may or may not be this instance). The signal handler
10826 * gets passed a #GApplicationCommandLine object that (among other things)
10827 * contains the remaining commandline arguments that have not been handled
10828 * by local_command_line().
10830 * If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE
10831 * flag set then the default implementation of local_command_line()
10832 * always returns %FALSE immediately, resulting in the commandline
10833 * always being handled in the primary instance.
10835 * Otherwise, the default implementation of local_command_line() tries
10836 * to do a couple of things that are probably reasonable for most
10837 * applications. First, g_application_register() is called to attempt
10838 * to register the application. If that works, then the command line
10839 * arguments are inspected. If no commandline arguments are given, then
10840 * g_application_activate() is called. If commandline arguments are
10841 * given and the %G_APPLICATION_HANDLES_OPEN flag is set then they
10842 * are assumed to be filenames and g_application_open() is called.
10844 * If you need to handle commandline arguments that are not filenames,
10845 * and you don't mind commandline handling to happen in the primary
10846 * instance, you should set %G_APPLICATION_HANDLES_COMMAND_LINE and
10847 * process the commandline arguments in your #GApplication::command-line
10848 * signal handler, either manually or using the #GOptionContext API.
10850 * If you are interested in doing more complicated local handling of the
10851 * commandline then you should implement your own #GApplication subclass
10852 * and override local_command_line(). In this case, you most likely want
10853 * to return %TRUE from your local_command_line() implementation to
10854 * suppress the default handling. See
10855 * <xref linkend="gapplication-example-cmdline2"/> for an example.
10857 * If, after the above is done, the use count of the application is zero
10858 * then the exit status is returned immediately. If the use count is
10859 * non-zero then the default main context is iterated until the use count
10860 * falls to zero, at which point 0 is returned.
10862 * If the %G_APPLICATION_IS_SERVICE flag is set, then the exiting at
10863 * use count of zero is delayed for a while (ie: the instance stays
10864 * around to provide its <emphasis>service</emphasis> to others).
10866 * Returns: the exit status
10872 * g_application_set_action_group:
10873 * @application: a #GApplication
10874 * @action_group: (allow-none): a #GActionGroup, or %NULL
10876 * This used to be how actions were associated with a #GApplication.
10877 * Now there is #GActionMap for that.
10880 * Deprecated: 2.32:Use the #GActionMap interface instead. Never ever mix use of this API with use of #GActionMap on the same @application or things will go very badly wrong. This function is known to introduce buggy behaviour (ie: signals not emitted on changes to the action group), so you should really use #GActionMap instead.
10885 * g_application_set_application_id:
10886 * @application: a #GApplication
10887 * @application_id: (allow-none): the identifier for @application
10889 * Sets the unique identifier for @application.
10891 * The application id can only be modified if @application has not yet
10894 * If non-%NULL, the application id must be valid. See
10895 * g_application_id_is_valid().
10902 * g_application_set_default:
10903 * @application: (allow-none): the application to set as default, or %NULL
10905 * Sets or unsets the default application for the process, as returned
10906 * by g_application_get_default().
10908 * This function does not take its own reference on @application. If
10909 * @application is destroyed then the default application will revert
10917 * g_application_set_flags:
10918 * @application: a #GApplication
10919 * @flags: the flags for @application
10921 * Sets the flags for @application.
10923 * The flags can only be modified if @application has not yet been
10926 * See #GApplicationFlags.
10933 * g_application_set_inactivity_timeout:
10934 * @application: a #GApplication
10935 * @inactivity_timeout: the timeout, in milliseconds
10937 * Sets the current inactivity timeout for the application.
10939 * This is the amount of time (in milliseconds) after the last call to
10940 * g_application_release() before the application stops running.
10942 * This call has no side effects of its own. The value set here is only
10943 * used for next time g_application_release() drops the use count to
10944 * zero. Any timeouts currently in progress are not impacted.
10951 * g_async_initable_init_async:
10952 * @initable: a #GAsyncInitable.
10953 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10954 * @cancellable: optional #GCancellable object, %NULL to ignore.
10955 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
10956 * @user_data: the data to pass to callback function
10958 * Starts asynchronous initialization of the object implementing the
10959 * interface. This must be done before any real use of the object after
10960 * initial construction. If the object also implements #GInitable you can
10961 * optionally call g_initable_init() instead.
10963 * When the initialization is finished, @callback will be called. You can
10964 * then call g_async_initable_init_finish() to get the result of the
10967 * Implementations may also support cancellation. If @cancellable is not
10968 * %NULL, then initialization can be cancelled by triggering the cancellable
10969 * object from another thread. If the operation was cancelled, the error
10970 * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
10971 * the object doesn't support cancellable initialization, the error
10972 * %G_IO_ERROR_NOT_SUPPORTED will be returned.
10974 * As with #GInitable, if the object is not initialized, or initialization
10975 * returns with an error, then all operations on the object except
10976 * g_object_ref() and g_object_unref() are considered to be invalid, and
10977 * have undefined behaviour. They will often fail with g_critical() or
10978 * g_warning(), but this must not be relied on.
10980 * Implementations of this method must be idempotent: i.e. multiple calls
10981 * to this function with the same argument should return the same results.
10982 * Only the first call initializes the object; further calls return the result
10983 * of the first call. This is so that it's safe to implement the singleton
10984 * pattern in the GObject constructor function.
10986 * For classes that also support the #GInitable interface, the default
10987 * implementation of this method will run the g_initable_init() function
10988 * in a thread, so if you want to support asynchronous initialization via
10989 * threads, just implement the #GAsyncInitable interface without overriding
10990 * any interface methods.
10997 * g_async_initable_init_finish:
10998 * @initable: a #GAsyncInitable.
10999 * @res: a #GAsyncResult.
11000 * @error: a #GError location to store the error occurring, or %NULL to ignore.
11002 * Finishes asynchronous initialization and returns the result.
11003 * See g_async_initable_init_async().
11005 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
11011 * g_async_initable_new_async:
11012 * @object_type: a #GType supporting #GAsyncInitable.
11013 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
11014 * @cancellable: optional #GCancellable object, %NULL to ignore.
11015 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
11016 * @user_data: the data to pass to callback function
11017 * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
11018 * @...: the value of the first property, followed by other property value pairs, and ended by %NULL.
11020 * Helper function for constructing #GAsyncInitable object. This is
11021 * similar to g_object_new() but also initializes the object asynchronously.
11023 * When the initialization is finished, @callback will be called. You can
11024 * then call g_async_initable_new_finish() to get the new object and check
11032 * g_async_initable_new_finish:
11033 * @initable: the #GAsyncInitable from the callback
11034 * @res: the #GAsyncResult from the callback
11035 * @error: return location for errors, or %NULL to ignore
11037 * Finishes the async construction for the various g_async_initable_new
11038 * calls, returning the created object or %NULL on error.
11040 * Returns: (transfer full): a newly created #GObject, or %NULL on error. Free with g_object_unref().
11046 * g_async_initable_new_valist_async:
11047 * @object_type: a #GType supporting #GAsyncInitable.
11048 * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
11049 * @var_args: The var args list generated from @first_property_name.
11050 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
11051 * @cancellable: optional #GCancellable object, %NULL to ignore.
11052 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
11053 * @user_data: the data to pass to callback function
11055 * Helper function for constructing #GAsyncInitable object. This is
11056 * similar to g_object_new_valist() but also initializes the object
11059 * When the initialization is finished, @callback will be called. You can
11060 * then call g_async_initable_new_finish() to get the new object and check
11068 * g_async_initable_newv_async:
11069 * @object_type: a #GType supporting #GAsyncInitable.
11070 * @n_parameters: the number of parameters in @parameters
11071 * @parameters: the parameters to use to construct the object
11072 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
11073 * @cancellable: optional #GCancellable object, %NULL to ignore.
11074 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
11075 * @user_data: the data to pass to callback function
11077 * Helper function for constructing #GAsyncInitable object. This is
11078 * similar to g_object_newv() but also initializes the object asynchronously.
11080 * When the initialization is finished, @callback will be called. You can
11081 * then call g_async_initable_new_finish() to get the new object and check
11089 * g_async_result_get_source_object:
11090 * @res: a #GAsyncResult
11092 * Gets the source object from a #GAsyncResult.
11094 * Returns: (transfer full): a new reference to the source object for the @res, or %NULL if there is none.
11099 * g_async_result_get_user_data:
11100 * @res: a #GAsyncResult.
11102 * Gets the user data from a #GAsyncResult.
11104 * Returns: (transfer full): the user data for @res.
11109 * g_async_result_is_tagged:
11110 * @res: a #GAsyncResult
11111 * @source_tag: an application-defined tag
11113 * Checks if @res has the given @source_tag (generally a function
11114 * pointer indicating the function @res was created by).
11116 * Returns: %TRUE if @res has the indicated @source_tag, %FALSE if not.
11122 * g_async_result_legacy_propagate_error:
11123 * @res: a #GAsyncResult
11124 * @error: (out): a location to propagate the error to.
11126 * If @res is a #GSimpleAsyncResult, this is equivalent to
11127 * g_simple_async_result_propagate_error(). Otherwise it returns
11130 * This can be used for legacy error handling in async
11131 * <literal>_finish ()</literal> wrapper functions that traditionally
11132 * handled #GSimpleAsyncResult error returns themselves rather than
11133 * calling into the virtual method. This should not be used in new
11134 * code; #GAsyncResult errors that are set by virtual methods should
11135 * also be extracted by virtual methods, to enable subclasses to chain
11138 * Returns: %TRUE if @error is has been filled in with an error from @res, %FALSE if not.
11144 * g_buffered_input_stream_fill:
11145 * @stream: a #GBufferedInputStream
11146 * @count: the number of bytes that will be read from the stream
11147 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
11148 * @error: location to store the error occurring, or %NULL to ignore
11150 * Tries to read @count bytes from the stream into the buffer.
11151 * Will block during this read.
11153 * If @count is zero, returns zero and does nothing. A value of @count
11154 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
11156 * On success, the number of bytes read into the buffer is returned.
11157 * It is not an error if this is not the same as the requested size, as it
11158 * can happen e.g. near the end of a file. Zero is returned on end of file
11159 * (or if @count is zero), but never otherwise.
11161 * If @count is -1 then the attempted read size is equal to the number of
11162 * bytes that are required to fill the buffer.
11164 * If @cancellable is not %NULL, then the operation can be cancelled by
11165 * triggering the cancellable object from another thread. If the operation
11166 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
11167 * operation was partially finished when the operation was cancelled the
11168 * partial result will be returned, without an error.
11170 * On error -1 is returned and @error is set accordingly.
11172 * For the asynchronous, non-blocking, version of this function, see
11173 * g_buffered_input_stream_fill_async().
11175 * Returns: the number of bytes read into @stream's buffer, up to @count, or -1 on error.
11180 * g_buffered_input_stream_fill_async:
11181 * @stream: a #GBufferedInputStream
11182 * @count: the number of bytes that will be read from the stream
11183 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
11184 * @cancellable: (allow-none): optional #GCancellable object
11185 * @callback: (scope async): a #GAsyncReadyCallback
11186 * @user_data: (closure): a #gpointer
11188 * Reads data into @stream's buffer asynchronously, up to @count size.
11189 * @io_priority can be used to prioritize reads. For the synchronous
11190 * version of this function, see g_buffered_input_stream_fill().
11192 * If @count is -1 then the attempted read size is equal to the number
11193 * of bytes that are required to fill the buffer.
11198 * g_buffered_input_stream_fill_finish:
11199 * @stream: a #GBufferedInputStream
11200 * @result: a #GAsyncResult
11201 * @error: a #GError
11203 * Finishes an asynchronous read.
11205 * Returns: a #gssize of the read stream, or %-1 on an error.
11210 * g_buffered_input_stream_get_available:
11211 * @stream: #GBufferedInputStream
11213 * Gets the size of the available data within the stream.
11215 * Returns: size of the available stream.
11220 * g_buffered_input_stream_get_buffer_size:
11221 * @stream: a #GBufferedInputStream
11223 * Gets the size of the input buffer.
11225 * Returns: the current buffer size.
11230 * g_buffered_input_stream_new:
11231 * @base_stream: a #GInputStream
11233 * Creates a new #GInputStream from the given @base_stream, with
11234 * a buffer set to the default size (4 kilobytes).
11236 * Returns: a #GInputStream for the given @base_stream.
11241 * g_buffered_input_stream_new_sized:
11242 * @base_stream: a #GInputStream
11245 * Creates a new #GBufferedInputStream from the given @base_stream,
11246 * with a buffer set to @size.
11248 * Returns: a #GInputStream.
11253 * g_buffered_input_stream_peek:
11254 * @stream: a #GBufferedInputStream
11255 * @buffer: (array length=count) (element-type guint8): a pointer to an allocated chunk of memory
11256 * @offset: a #gsize
11259 * Peeks in the buffer, copying data of size @count into @buffer,
11260 * offset @offset bytes.
11262 * Returns: a #gsize of the number of bytes peeked, or -1 on error.
11267 * g_buffered_input_stream_peek_buffer:
11268 * @stream: a #GBufferedInputStream
11269 * @count: (out): a #gsize to get the number of bytes available in the buffer
11271 * Returns the buffer with the currently available bytes. The returned
11272 * buffer must not be modified and will become invalid when reading from
11273 * the stream or filling the buffer.
11275 * Returns: (array length=count) (element-type guint8) (transfer none): read-only buffer
11280 * g_buffered_input_stream_read_byte:
11281 * @stream: a #GBufferedInputStream
11282 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
11283 * @error: location to store the error occurring, or %NULL to ignore
11285 * Tries to read a single byte from the stream or the buffer. Will block
11286 * during this read.
11288 * On success, the byte read from the stream is returned. On end of stream
11289 * -1 is returned but it's not an exceptional error and @error is not set.
11291 * If @cancellable is not %NULL, then the operation can be cancelled by
11292 * triggering the cancellable object from another thread. If the operation
11293 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
11294 * operation was partially finished when the operation was cancelled the
11295 * partial result will be returned, without an error.
11297 * On error -1 is returned and @error is set accordingly.
11299 * Returns: the byte read from the @stream, or -1 on end of stream or error.
11304 * g_buffered_input_stream_set_buffer_size:
11305 * @stream: a #GBufferedInputStream
11308 * Sets the size of the internal buffer of @stream to @size, or to the
11309 * size of the contents of the buffer. The buffer can never be resized
11310 * smaller than its current contents.
11315 * g_buffered_output_stream_get_auto_grow:
11316 * @stream: a #GBufferedOutputStream.
11318 * Checks if the buffer automatically grows as data is added.
11320 * Returns: %TRUE if the @stream's buffer automatically grows, %FALSE otherwise.
11325 * g_buffered_output_stream_get_buffer_size:
11326 * @stream: a #GBufferedOutputStream.
11328 * Gets the size of the buffer in the @stream.
11330 * Returns: the current size of the buffer.
11335 * g_buffered_output_stream_new:
11336 * @base_stream: a #GOutputStream.
11338 * Creates a new buffered output stream for a base stream.
11340 * Returns: a #GOutputStream for the given @base_stream.
11345 * g_buffered_output_stream_new_sized:
11346 * @base_stream: a #GOutputStream.
11349 * Creates a new buffered output stream with a given buffer size.
11351 * Returns: a #GOutputStream with an internal buffer set to @size.
11356 * g_buffered_output_stream_set_auto_grow:
11357 * @stream: a #GBufferedOutputStream.
11358 * @auto_grow: a #gboolean.
11360 * Sets whether or not the @stream's buffer should automatically grow.
11361 * If @auto_grow is true, then each write will just make the buffer
11362 * larger, and you must manually flush the buffer to actually write out
11363 * the data to the underlying stream.
11368 * g_buffered_output_stream_set_buffer_size:
11369 * @stream: a #GBufferedOutputStream.
11372 * Sets the size of the internal buffer to @size.
11378 * @bus_type: A #GBusType.
11379 * @cancellable: (allow-none): A #GCancellable or %NULL.
11380 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
11381 * @user_data: The data to pass to @callback.
11383 * Asynchronously connects to the message bus specified by @bus_type.
11385 * When the operation is finished, @callback will be invoked. You can
11386 * then call g_bus_get_finish() to get the result of the operation.
11388 * This is a asynchronous failable function. See g_bus_get_sync() for
11389 * the synchronous version.
11396 * g_bus_get_finish:
11397 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
11398 * @error: Return location for error or %NULL.
11400 * Finishes an operation started with g_bus_get().
11402 * The returned object is a singleton, that is, shared with other
11403 * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
11404 * event that you need a private message bus connection, use
11405 * g_dbus_address_get_for_bus_sync() and
11406 * g_dbus_connection_new_for_address().
11408 * Note that the returned #GDBusConnection object will (usually) have
11409 * the #GDBusConnection:exit-on-close property set to %TRUE.
11411 * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
11418 * @bus_type: A #GBusType.
11419 * @cancellable: (allow-none): A #GCancellable or %NULL.
11420 * @error: Return location for error or %NULL.
11422 * Synchronously connects to the message bus specified by @bus_type.
11423 * Note that the returned object may shared with other callers,
11424 * e.g. if two separate parts of a process calls this function with
11425 * the same @bus_type, they will share the same object.
11427 * This is a synchronous failable function. See g_bus_get() and
11428 * g_bus_get_finish() for the asynchronous version.
11430 * The returned object is a singleton, that is, shared with other
11431 * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
11432 * event that you need a private message bus connection, use
11433 * g_dbus_address_get_for_bus_sync() and
11434 * g_dbus_connection_new_for_address().
11436 * Note that the returned #GDBusConnection object will (usually) have
11437 * the #GDBusConnection:exit-on-close property set to %TRUE.
11439 * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
11446 * @bus_type: The type of bus to own a name on.
11447 * @name: The well-known name to own.
11448 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
11449 * @bus_acquired_handler: (allow-none): Handler to invoke when connected to the bus of type @bus_type or %NULL.
11450 * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
11451 * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
11452 * @user_data: User data to pass to handlers.
11453 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11455 * Starts acquiring @name on the bus specified by @bus_type and calls
11456 * @name_acquired_handler and @name_lost_handler when the name is
11457 * acquired respectively lost. Callbacks will be invoked in the <link
11458 * linkend="g-main-context-push-thread-default">thread-default main
11459 * loop</link> of the thread you are calling this function from.
11461 * You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
11462 * callbacks will be invoked after calling this function - there are three
11466 * @name_lost_handler with a %NULL connection (if a connection to the bus can't be made).
11467 * </para></listitem>
11469 * @bus_acquired_handler then @name_lost_handler (if the name can't be obtained)
11470 * </para></listitem>
11472 * @bus_acquired_handler then @name_acquired_handler (if the name was obtained).
11473 * </para></listitem>
11475 * When you are done owning the name, just call g_bus_unown_name()
11476 * with the owner id this function returns.
11478 * If the name is acquired or lost (for example another application
11479 * could acquire the name if you allow replacement or the application
11480 * currently owning the name exits), the handlers are also invoked. If the
11481 * #GDBusConnection that is used for attempting to own the name
11482 * closes, then @name_lost_handler is invoked since it is no
11483 * longer possible for other processes to access the process.
11485 * You cannot use g_bus_own_name() several times for the same name (unless
11486 * interleaved with calls to g_bus_unown_name()) - only the first call
11489 * Another guarantee is that invocations of @name_acquired_handler
11490 * and @name_lost_handler are guaranteed to alternate; that
11491 * is, if @name_acquired_handler is invoked then you are
11492 * guaranteed that the next time one of the handlers is invoked, it
11493 * will be @name_lost_handler. The reverse is also true.
11495 * If you plan on exporting objects (using e.g.
11496 * g_dbus_connection_register_object()), note that it is generally too late
11497 * to export the objects in @name_acquired_handler. Instead, you can do this
11498 * in @bus_acquired_handler since you are guaranteed that this will run
11499 * before @name is requested from the bus.
11501 * This behavior makes it very simple to write applications that wants
11502 * to own names and export objects, see <xref linkend="gdbus-owning-names"/>.
11503 * Simply register objects to be exported in @bus_acquired_handler and
11504 * unregister the objects (if any) in @name_lost_handler.
11506 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
11512 * g_bus_own_name_on_connection:
11513 * @connection: A #GDBusConnection.
11514 * @name: The well-known name to own.
11515 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
11516 * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
11517 * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
11518 * @user_data: User data to pass to handlers.
11519 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11521 * Like g_bus_own_name() but takes a #GDBusConnection instead of a
11524 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
11530 * g_bus_own_name_on_connection_with_closures:
11531 * @connection: A #GDBusConnection.
11532 * @name: The well-known name to own.
11533 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
11534 * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
11535 * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
11537 * Version of g_bus_own_name_on_connection() using closures instead of callbacks for
11538 * easier binding in other languages.
11540 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
11541 * Rename to: g_bus_own_name_on_connection
11547 * g_bus_own_name_with_closures:
11548 * @bus_type: The type of bus to own a name on.
11549 * @name: The well-known name to own.
11550 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
11551 * @bus_acquired_closure: (allow-none): #GClosure to invoke when connected to the bus of type @bus_type or %NULL.
11552 * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
11553 * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
11555 * Version of g_bus_own_name() using closures instead of callbacks for
11556 * easier binding in other languages.
11558 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
11559 * Rename to: g_bus_own_name
11565 * g_bus_unown_name:
11566 * @owner_id: An identifier obtained from g_bus_own_name()
11568 * Stops owning a name.
11575 * g_bus_unwatch_name:
11576 * @watcher_id: An identifier obtained from g_bus_watch_name()
11578 * Stops watching a name.
11585 * g_bus_watch_name:
11586 * @bus_type: The type of bus to watch a name on.
11587 * @name: The name (well-known or unique) to watch.
11588 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11589 * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
11590 * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
11591 * @user_data: User data to pass to handlers.
11592 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11594 * Starts watching @name on the bus specified by @bus_type and calls
11595 * @name_appeared_handler and @name_vanished_handler when the name is
11596 * known to have a owner respectively known to lose its
11597 * owner. Callbacks will be invoked in the <link
11598 * linkend="g-main-context-push-thread-default">thread-default main
11599 * loop</link> of the thread you are calling this function from.
11601 * You are guaranteed that one of the handlers will be invoked after
11602 * calling this function. When you are done watching the name, just
11603 * call g_bus_unwatch_name() with the watcher id this function
11606 * If the name vanishes or appears (for example the application owning
11607 * the name could restart), the handlers are also invoked. If the
11608 * #GDBusConnection that is used for watching the name disconnects, then
11609 * @name_vanished_handler is invoked since it is no longer
11610 * possible to access the name.
11612 * Another guarantee is that invocations of @name_appeared_handler
11613 * and @name_vanished_handler are guaranteed to alternate; that
11614 * is, if @name_appeared_handler is invoked then you are
11615 * guaranteed that the next time one of the handlers is invoked, it
11616 * will be @name_vanished_handler. The reverse is also true.
11618 * This behavior makes it very simple to write applications that wants
11619 * to take action when a certain name exists, see <xref
11620 * linkend="gdbus-watching-names"/>. Basically, the application
11621 * should create object proxies in @name_appeared_handler and destroy
11622 * them again (if any) in @name_vanished_handler.
11624 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11630 * g_bus_watch_name_on_connection:
11631 * @connection: A #GDBusConnection.
11632 * @name: The name (well-known or unique) to watch.
11633 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11634 * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
11635 * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
11636 * @user_data: User data to pass to handlers.
11637 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11639 * Like g_bus_watch_name() but takes a #GDBusConnection instead of a
11642 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11648 * g_bus_watch_name_on_connection_with_closures:
11649 * @connection: A #GDBusConnection.
11650 * @name: The name (well-known or unique) to watch.
11651 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11652 * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
11653 * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
11655 * Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
11656 * easier binding in other languages.
11658 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11659 * Rename to: g_bus_watch_name_on_connection
11665 * g_bus_watch_name_with_closures:
11666 * @bus_type: The type of bus to watch a name on.
11667 * @name: The name (well-known or unique) to watch.
11668 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11669 * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
11670 * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
11672 * Version of g_bus_watch_name() using closures instead of callbacks for
11673 * easier binding in other languages.
11675 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11676 * Rename to: g_bus_watch_name
11682 * g_cancellable_cancel:
11683 * @cancellable: a #GCancellable object.
11685 * Will set @cancellable to cancelled, and will emit the
11686 * #GCancellable::cancelled signal. (However, see the warning about
11687 * race conditions in the documentation for that signal if you are
11688 * planning to connect to it.)
11690 * This function is thread-safe. In other words, you can safely call
11691 * it from a thread other than the one running the operation that was
11692 * passed the @cancellable.
11694 * The convention within gio is that cancelling an asynchronous
11695 * operation causes it to complete asynchronously. That is, if you
11696 * cancel the operation from the same thread in which it is running,
11697 * then the operation's #GAsyncReadyCallback will not be invoked until
11698 * the application returns to the main loop.
11703 * g_cancellable_connect:
11704 * @cancellable: A #GCancellable.
11705 * @callback: The #GCallback to connect.
11706 * @data: Data to pass to @callback.
11707 * @data_destroy_func: (allow-none): Free function for @data or %NULL.
11709 * Convenience function to connect to the #GCancellable::cancelled
11710 * signal. Also handles the race condition that may happen
11711 * if the cancellable is cancelled right before connecting.
11713 * @callback is called at most once, either directly at the
11714 * time of the connect if @cancellable is already cancelled,
11715 * or when @cancellable is cancelled in some thread.
11717 * @data_destroy_func will be called when the handler is
11718 * disconnected, or immediately if the cancellable is already
11721 * See #GCancellable::cancelled for details on how to use this.
11723 * Returns: The id of the signal handler or 0 if @cancellable has already been cancelled.
11729 * g_cancellable_disconnect:
11730 * @cancellable: (allow-none): A #GCancellable or %NULL.
11731 * @handler_id: Handler id of the handler to be disconnected, or %0.
11733 * Disconnects a handler from a cancellable instance similar to
11734 * g_signal_handler_disconnect(). Additionally, in the event that a
11735 * signal handler is currently running, this call will block until the
11736 * handler has finished. Calling this function from a
11737 * #GCancellable::cancelled signal handler will therefore result in a
11740 * This avoids a race condition where a thread cancels at the
11741 * same time as the cancellable operation is finished and the
11742 * signal handler is removed. See #GCancellable::cancelled for
11743 * details on how to use this.
11745 * If @cancellable is %NULL or @handler_id is %0 this function does
11753 * g_cancellable_get_current:
11755 * Gets the top cancellable from the stack.
11757 * Returns: (transfer none): a #GCancellable from the top of the stack, or %NULL if the stack is empty.
11762 * g_cancellable_get_fd:
11763 * @cancellable: a #GCancellable.
11765 * Gets the file descriptor for a cancellable job. This can be used to
11766 * implement cancellable operations on Unix systems. The returned fd will
11767 * turn readable when @cancellable is cancelled.
11769 * You are not supposed to read from the fd yourself, just check for
11770 * readable status. Reading to unset the readable status is done
11771 * with g_cancellable_reset().
11773 * After a successful return from this function, you should use
11774 * g_cancellable_release_fd() to free up resources allocated for
11775 * the returned file descriptor.
11777 * See also g_cancellable_make_pollfd().
11779 * Returns: A valid file descriptor. %-1 if the file descriptor is not supported, or on errors.
11784 * g_cancellable_is_cancelled:
11785 * @cancellable: (allow-none): a #GCancellable or %NULL
11787 * Checks if a cancellable job has been cancelled.
11789 * Returns: %TRUE if @cancellable is cancelled, FALSE if called with %NULL or if item is not cancelled.
11794 * g_cancellable_make_pollfd:
11795 * @cancellable: (allow-none): a #GCancellable or %NULL
11796 * @pollfd: a pointer to a #GPollFD
11798 * Creates a #GPollFD corresponding to @cancellable; this can be passed
11799 * to g_poll() and used to poll for cancellation. This is useful both
11800 * for unix systems without a native poll and for portability to
11803 * When this function returns %TRUE, you should use
11804 * g_cancellable_release_fd() to free up resources allocated for the
11805 * @pollfd. After a %FALSE return, do not call g_cancellable_release_fd().
11807 * If this function returns %FALSE, either no @cancellable was given or
11808 * resource limits prevent this function from allocating the necessary
11809 * structures for polling. (On Linux, you will likely have reached
11810 * the maximum number of file descriptors.) The suggested way to handle
11811 * these cases is to ignore the @cancellable.
11813 * You are not supposed to read from the fd yourself, just check for
11814 * readable status. Reading to unset the readable status is done
11815 * with g_cancellable_reset().
11817 * Returns: %TRUE if @pollfd was successfully initialized, %FALSE on failure to prepare the cancellable.
11823 * g_cancellable_new:
11825 * Creates a new #GCancellable object.
11827 * Applications that want to start one or more operations
11828 * that should be cancellable should create a #GCancellable
11829 * and pass it to the operations.
11831 * One #GCancellable can be used in multiple consecutive
11832 * operations or in multiple concurrent operations.
11834 * Returns: a #GCancellable.
11839 * g_cancellable_pop_current:
11840 * @cancellable: a #GCancellable object
11842 * Pops @cancellable off the cancellable stack (verifying that @cancellable
11843 * is on the top of the stack).
11848 * g_cancellable_push_current:
11849 * @cancellable: a #GCancellable object
11851 * Pushes @cancellable onto the cancellable stack. The current
11852 * cancellable can then be received using g_cancellable_get_current().
11854 * This is useful when implementing cancellable operations in
11855 * code that does not allow you to pass down the cancellable object.
11857 * This is typically called automatically by e.g. #GFile operations,
11858 * so you rarely have to call this yourself.
11863 * g_cancellable_release_fd:
11864 * @cancellable: a #GCancellable
11866 * Releases a resources previously allocated by g_cancellable_get_fd()
11867 * or g_cancellable_make_pollfd().
11869 * For compatibility reasons with older releases, calling this function
11870 * is not strictly required, the resources will be automatically freed
11871 * when the @cancellable is finalized. However, the @cancellable will
11872 * block scarce file descriptors until it is finalized if this function
11873 * is not called. This can cause the application to run out of file
11874 * descriptors when many #GCancellables are used at the same time.
11881 * g_cancellable_reset:
11882 * @cancellable: a #GCancellable object.
11884 * Resets @cancellable to its uncancelled state.
11886 * If cancellable is currently in use by any cancellable operation
11887 * then the behavior of this function is undefined.
11892 * g_cancellable_set_error_if_cancelled:
11893 * @cancellable: (allow-none): a #GCancellable or %NULL
11894 * @error: #GError to append error state to
11896 * If the @cancellable is cancelled, sets the error to notify
11897 * that the operation was cancelled.
11899 * Returns: %TRUE if @cancellable was cancelled, %FALSE if it was not
11904 * g_cancellable_source_new: (skip)
11905 * @cancellable: (allow-none): a #GCancellable, or %NULL
11907 * Creates a source that triggers if @cancellable is cancelled and
11908 * calls its callback of type #GCancellableSourceFunc. This is
11909 * primarily useful for attaching to another (non-cancellable) source
11910 * with g_source_add_child_source() to add cancellability to it.
11912 * For convenience, you can call this with a %NULL #GCancellable,
11913 * in which case the source will never trigger.
11915 * Returns: (transfer full): the new #GSource.
11921 * g_charset_converter_get_num_fallbacks:
11922 * @converter: a #GCharsetConverter
11924 * Gets the number of fallbacks that @converter has applied so far.
11926 * Returns: the number of fallbacks that @converter has applied
11932 * g_charset_converter_get_use_fallback:
11933 * @converter: a #GCharsetConverter
11935 * Gets the #GCharsetConverter:use-fallback property.
11937 * Returns: %TRUE if fallbacks are used by @converter
11943 * g_charset_converter_new:
11944 * @to_charset: destination charset
11945 * @from_charset: source charset
11946 * @error: #GError for error reporting, or %NULL to ignore.
11948 * Creates a new #GCharsetConverter.
11950 * Returns: a new #GCharsetConverter or %NULL on error.
11956 * g_charset_converter_set_use_fallback:
11957 * @converter: a #GCharsetConverter
11958 * @use_fallback: %TRUE to use fallbacks
11960 * Sets the #GCharsetConverter:use-fallback property.
11967 * g_content_type_can_be_executable:
11968 * @type: a content type string
11970 * Checks if a content type can be executable. Note that for instance
11971 * things like text files can be executables (i.e. scripts and batch files).
11973 * Returns: %TRUE if the file type corresponds to a type that can be executable, %FALSE otherwise.
11978 * g_content_type_equals:
11979 * @type1: a content type string
11980 * @type2: a content type string
11982 * Compares two content types for equality.
11984 * Returns: %TRUE if the two strings are identical or equivalent, %FALSE otherwise.
11989 * g_content_type_from_mime_type:
11990 * @mime_type: a mime type string
11992 * Tries to find a content type based on the mime type name.
11994 * Returns: (allow-none): Newly allocated string with content type or %NULL. Free with g_free()
12000 * g_content_type_get_description:
12001 * @type: a content type string
12003 * Gets the human readable description of the content type.
12005 * Returns: a short description of the content type @type. Free the returned string with g_free()
12010 * g_content_type_get_generic_icon_name:
12011 * @type: a content type string
12013 * Gets the generic icon name for a content type.
12015 * See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
12016 * specification for more on the generic icon name.
12018 * Returns: (allow-none): the registered generic icon name for the given @type, or %NULL if unknown. Free with g_free()
12024 * g_content_type_get_icon:
12025 * @type: a content type string
12027 * Gets the icon for a content type.
12029 * Returns: (transfer full): #GIcon corresponding to the content type. Free the returned object with g_object_unref()
12034 * g_content_type_get_mime_type:
12035 * @type: a content type string
12037 * Gets the mime type for the content type, if one is registered.
12039 * Returns: (allow-none): the registered mime type for the given @type, or %NULL if unknown.
12044 * g_content_type_get_symbolic_icon:
12045 * @type: a content type string
12047 * Gets the symbolic icon for a content type.
12049 * Returns: (transfer full): symbolic #GIcon corresponding to the content type. Free the returned object with g_object_unref()
12055 * g_content_type_guess:
12056 * @filename: (allow-none): a string, or %NULL
12057 * @data: (allow-none) (array length=data_size): a stream of data, or %NULL
12058 * @data_size: the size of @data
12059 * @result_uncertain: (allow-none) (out): return location for the certainty of the result, or %NULL
12061 * Guesses the content type based on example data. If the function is
12062 * uncertain, @result_uncertain will be set to %TRUE. Either @filename
12063 * or @data may be %NULL, in which case the guess will be based solely
12064 * on the other argument.
12066 * Returns: a string indicating a guessed content type for the given data. Free with g_free()
12071 * g_content_type_guess_for_tree:
12072 * @root: the root of the tree to guess a type for
12074 * Tries to guess the type of the tree with root @root, by
12075 * looking at the files it contains. The result is an array
12076 * of content types, with the best guess coming first.
12078 * The types returned all have the form x-content/foo, e.g.
12079 * x-content/audio-cdda (for audio CDs) or x-content/image-dcf
12080 * (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
12081 * specification for more on x-content types.
12083 * This function is useful in the implementation of
12084 * g_mount_guess_content_type().
12086 * Returns: (transfer full) (array zero-terminated=1): an %NULL-terminated array of zero or more content types. Free with g_strfreev()
12092 * g_content_type_is_a:
12093 * @type: a content type string
12094 * @supertype: a content type string
12096 * Determines if @type is a subset of @supertype.
12098 * Returns: %TRUE if @type is a kind of @supertype, %FALSE otherwise.
12103 * g_content_type_is_unknown:
12104 * @type: a content type string
12106 * Checks if the content type is the generic "unknown" type.
12107 * On UNIX this is the "application/octet-stream" mimetype,
12108 * while on win32 it is "*".
12110 * Returns: %TRUE if the type is the unknown type.
12115 * g_content_types_get_registered:
12117 * Gets a list of strings containing all the registered content types
12118 * known to the system. The list and its data should be freed using
12120 * g_list_free_full (list, g_free);
12121 * </programlisting>
12123 * Returns: (element-type utf8) (transfer full): #GList of the registered content types
12128 * g_converter_convert:
12129 * @converter: a #GConverter.
12130 * @inbuf: (array length=inbuf_size) (element-type guint8): the buffer containing the data to convert.
12131 * @inbuf_size: the number of bytes in @inbuf
12132 * @outbuf: a buffer to write converted data in.
12133 * @outbuf_size: the number of bytes in @outbuf, must be at least one
12134 * @flags: a #GConverterFlags controlling the conversion details
12135 * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success
12136 * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success
12137 * @error: location to store the error occurring, or %NULL to ignore
12139 * This is the main operation used when converting data. It is to be called
12140 * multiple times in a loop, and each time it will do some work, i.e.
12141 * producing some output (in @outbuf) or consuming some input (from @inbuf) or
12142 * both. If its not possible to do any work an error is returned.
12144 * Note that a single call may not consume all input (or any input at all).
12145 * Also a call may produce output even if given no input, due to state stored
12146 * in the converter producing output.
12148 * If any data was either produced or consumed, and then an error happens, then
12149 * only the successful conversion is reported and the error is returned on the
12152 * A full conversion loop involves calling this method repeatedly, each time
12153 * giving it new input and space output space. When there is no more input
12154 * data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
12155 * The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
12156 * each time until all data is consumed and all output is produced, then
12157 * %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
12158 * may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
12159 * in a decompression converter where the end of data is detectable from the
12160 * data (and there might even be other data after the end of the compressed data).
12162 * When some data has successfully been converted @bytes_read and is set to
12163 * the number of bytes read from @inbuf, and @bytes_written is set to indicate
12164 * how many bytes was written to @outbuf. If there are more data to output
12165 * or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
12166 * %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
12167 * then %G_CONVERTER_FINISHED is returned.
12169 * On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
12170 * Some errors need special handling:
12172 * %G_IO_ERROR_NO_SPACE is returned if there is not enough space
12173 * to write the resulting converted data, the application should
12174 * call the function again with a larger @outbuf to continue.
12176 * %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
12177 * input to fully determine what the conversion should produce,
12178 * and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
12179 * example with an incomplete multibyte sequence when converting text,
12180 * or when a regexp matches up to the end of the input (and may match
12181 * further input). It may also happen when @inbuf_size is zero and
12182 * there is no more data to produce.
12184 * When this happens the application should read more input and then
12185 * call the function again. If further input shows that there is no
12186 * more data call the function again with the same data but with
12187 * the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
12188 * to finish as e.g. in the regexp match case (or, to fail again with
12189 * %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
12190 * input is actually partial).
12192 * After g_converter_convert() has returned %G_CONVERTER_FINISHED the
12193 * converter object is in an invalid state where its not allowed
12194 * to call g_converter_convert() anymore. At this time you can only
12195 * free the object or call g_converter_reset() to reset it to the
12198 * If the flag %G_CONVERTER_FLUSH is set then conversion is modified
12199 * to try to write out all internal state to the output. The application
12200 * has to call the function multiple times with the flag set, and when
12201 * the available input has been consumed and all internal state has
12202 * been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
12203 * really at the end) is returned instead of %G_CONVERTER_CONVERTED.
12204 * This is somewhat similar to what happens at the end of the input stream,
12205 * but done in the middle of the data.
12207 * This has different meanings for different conversions. For instance
12208 * in a compression converter it would mean that we flush all the
12209 * compression state into output such that if you uncompress the
12210 * compressed data you get back all the input data. Doing this may
12211 * make the final file larger due to padding though. Another example
12212 * is a regexp conversion, where if you at the end of the flushed data
12213 * have a match, but there is also a potential longer match. In the
12214 * non-flushed case we would ask for more input, but when flushing we
12215 * treat this as the end of input and do the match.
12217 * Flushing is not always possible (like if a charset converter flushes
12218 * at a partial multibyte sequence). Converters are supposed to try
12219 * to produce as much output as possible and then return an error
12220 * (typically %G_IO_ERROR_PARTIAL_INPUT).
12222 * Returns: a #GConverterResult, %G_CONVERTER_ERROR on error.
12228 * g_converter_input_stream_get_converter:
12229 * @converter_stream: a #GConverterInputStream
12231 * Gets the #GConverter that is used by @converter_stream.
12233 * Returns: (transfer none): the converter of the converter input stream
12239 * g_converter_input_stream_new:
12240 * @base_stream: a #GInputStream
12241 * @converter: a #GConverter
12243 * Creates a new converter input stream for the @base_stream.
12245 * Returns: a new #GInputStream.
12250 * g_converter_output_stream_get_converter:
12251 * @converter_stream: a #GConverterOutputStream
12253 * Gets the #GConverter that is used by @converter_stream.
12255 * Returns: (transfer none): the converter of the converter output stream
12261 * g_converter_output_stream_new:
12262 * @base_stream: a #GOutputStream
12263 * @converter: a #GConverter
12265 * Creates a new converter output stream for the @base_stream.
12267 * Returns: a new #GOutputStream.
12272 * g_converter_reset:
12273 * @converter: a #GConverter.
12275 * Resets all internal state in the converter, making it behave
12276 * as if it was just created. If the converter has any internal
12277 * state that would produce output then that output is lost.
12284 * g_credentials_get_native: (skip)
12285 * @credentials: A #GCredentials.
12286 * @native_type: The type of native credentials to get.
12288 * Gets a pointer to native credentials of type @native_type from
12291 * It is a programming error (which will cause an warning to be
12292 * logged) to use this method if there is no #GCredentials support for
12293 * the OS or if @native_type isn't supported by the OS.
12295 * Returns: The pointer to native credentials or %NULL if the operation there is no #GCredentials support for the OS or if @native_type isn't supported by the OS. Do not free the returned data, it is owned by @credentials.
12301 * g_credentials_get_unix_user:
12302 * @credentials: A #GCredentials
12303 * @error: Return location for error or %NULL.
12305 * Tries to get the UNIX user identifier from @credentials. This
12306 * method is only available on UNIX platforms.
12308 * This operation can fail if #GCredentials is not supported on the
12309 * OS or if the native credentials type does not contain information
12310 * about the UNIX user.
12312 * Returns: The UNIX user identifier or -1 if @error is set.
12318 * g_credentials_is_same_user:
12319 * @credentials: A #GCredentials.
12320 * @other_credentials: A #GCredentials.
12321 * @error: Return location for error or %NULL.
12323 * Checks if @credentials and @other_credentials is the same user.
12325 * This operation can fail if #GCredentials is not supported on the
12328 * Returns: %TRUE if @credentials and @other_credentials has the same user, %FALSE otherwise or if @error is set.
12334 * g_credentials_new:
12336 * Creates a new #GCredentials object with credentials matching the
12337 * the current process.
12339 * Returns: A #GCredentials. Free with g_object_unref().
12345 * g_credentials_set_native:
12346 * @credentials: A #GCredentials.
12347 * @native_type: The type of native credentials to set.
12348 * @native: A pointer to native credentials.
12350 * Copies the native credentials of type @native_type from @native
12351 * into @credentials.
12353 * It is a programming error (which will cause an warning to be
12354 * logged) to use this method if there is no #GCredentials support for
12355 * the OS or if @native_type isn't supported by the OS.
12362 * g_credentials_set_unix_user:
12363 * @credentials: A #GCredentials.
12364 * @uid: The UNIX user identifier to set.
12365 * @error: Return location for error or %NULL.
12367 * Tries to set the UNIX user identifier on @credentials. This method
12368 * is only available on UNIX platforms.
12370 * This operation can fail if #GCredentials is not supported on the
12371 * OS or if the native credentials type does not contain information
12372 * about the UNIX user.
12374 * Returns: %TRUE if @uid was set, %FALSE if error is set.
12380 * g_credentials_to_string:
12381 * @credentials: A #GCredentials object.
12383 * Creates a human-readable textual representation of @credentials
12384 * that can be used in logging and debug messages. The format of the
12385 * returned string may change in future GLib release.
12387 * Returns: A string that should be freed with g_free().
12393 * g_data_input_stream_get_byte_order:
12394 * @stream: a given #GDataInputStream.
12396 * Gets the byte order for the data input stream.
12398 * Returns: the @stream's current #GDataStreamByteOrder.
12403 * g_data_input_stream_get_newline_type:
12404 * @stream: a given #GDataInputStream.
12406 * Gets the current newline type for the @stream.
12408 * Returns: #GDataStreamNewlineType for the given @stream.
12413 * g_data_input_stream_new:
12414 * @base_stream: a #GInputStream.
12416 * Creates a new data input stream for the @base_stream.
12418 * Returns: a new #GDataInputStream.
12423 * g_data_input_stream_read_byte:
12424 * @stream: a given #GDataInputStream.
12425 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12426 * @error: #GError for error reporting.
12428 * Reads an unsigned 8-bit/1-byte value from @stream.
12430 * Returns: an unsigned 8-bit/1-byte value read from the @stream or %0 if an error occurred.
12435 * g_data_input_stream_read_int16:
12436 * @stream: a given #GDataInputStream.
12437 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12438 * @error: #GError for error reporting.
12440 * Reads a 16-bit/2-byte value from @stream.
12442 * In order to get the correct byte order for this read operation,
12443 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12445 * Returns: a signed 16-bit/2-byte value read from @stream or %0 if an error occurred.
12450 * g_data_input_stream_read_int32:
12451 * @stream: a given #GDataInputStream.
12452 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12453 * @error: #GError for error reporting.
12455 * Reads a signed 32-bit/4-byte value from @stream.
12457 * In order to get the correct byte order for this read operation,
12458 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12460 * If @cancellable is not %NULL, then the operation can be cancelled by
12461 * triggering the cancellable object from another thread. If the operation
12462 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12464 * Returns: a signed 32-bit/4-byte value read from the @stream or %0 if an error occurred.
12469 * g_data_input_stream_read_int64:
12470 * @stream: a given #GDataInputStream.
12471 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12472 * @error: #GError for error reporting.
12474 * Reads a 64-bit/8-byte value from @stream.
12476 * In order to get the correct byte order for this read operation,
12477 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12479 * If @cancellable is not %NULL, then the operation can be cancelled by
12480 * triggering the cancellable object from another thread. If the operation
12481 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12483 * Returns: a signed 64-bit/8-byte value read from @stream or %0 if an error occurred.
12488 * g_data_input_stream_read_line:
12489 * @stream: a given #GDataInputStream.
12490 * @length: (out): a #gsize to get the length of the data read in.
12491 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12492 * @error: #GError for error reporting.
12494 * Reads a line from the data input stream. Note that no encoding
12495 * checks or conversion is performed; the input is not guaranteed to
12496 * be UTF-8, and may in fact have embedded NUL characters.
12498 * If @cancellable is not %NULL, then the operation can be cancelled by
12499 * triggering the cancellable object from another thread. If the operation
12500 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12502 * Returns: (transfer full) (array zero-terminated=1) (element-type guint8): a NUL terminated byte array with the line that was read in (without the newlines). Set @length to a #gsize to get the length of the read line. On an error, it will return %NULL and @error will be set. If there's no content to read, it will still return %NULL, but @error won't be set.
12507 * g_data_input_stream_read_line_async:
12508 * @stream: a given #GDataInputStream.
12509 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12510 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12511 * @callback: (scope async): callback to call when the request is satisfied.
12512 * @user_data: (closure): the data to pass to callback function.
12514 * The asynchronous version of g_data_input_stream_read_line(). It is
12515 * an error to have two outstanding calls to this function.
12517 * When the operation is finished, @callback will be called. You
12518 * can then call g_data_input_stream_read_line_finish() to get
12519 * the result of the operation.
12526 * g_data_input_stream_read_line_finish:
12527 * @stream: a given #GDataInputStream.
12528 * @result: the #GAsyncResult that was provided to the callback.
12529 * @length: (out): a #gsize to get the length of the data read in.
12530 * @error: #GError for error reporting.
12532 * Finish an asynchronous call started by
12533 * g_data_input_stream_read_line_async(). Note the warning about
12534 * string encoding in g_data_input_stream_read_line() applies here as
12537 * Returns: (transfer full) (array zero-terminated=1) (element-type guint8): a NUL-terminated byte array with the line that was read in (without the newlines). Set @length to a #gsize to get the length of the read line. On an error, it will return %NULL and @error will be set. If there's no content to read, it will still return %NULL, but @error won't be set.
12543 * g_data_input_stream_read_line_finish_utf8:
12544 * @stream: a given #GDataInputStream.
12545 * @result: the #GAsyncResult that was provided to the callback.
12546 * @length: (out): a #gsize to get the length of the data read in.
12547 * @error: #GError for error reporting.
12549 * Finish an asynchronous call started by
12550 * g_data_input_stream_read_line_async().
12552 * Returns: (transfer full): a string with the line that was read in (without the newlines). Set @length to a #gsize to get the length of the read line. On an error, it will return %NULL and @error will be set. For UTF-8 conversion errors, the set error domain is %G_CONVERT_ERROR. If there's no content to read, it will still return %NULL, but @error won't be set.
12558 * g_data_input_stream_read_line_utf8:
12559 * @stream: a given #GDataInputStream.
12560 * @length: (out): a #gsize to get the length of the data read in.
12561 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12562 * @error: #GError for error reporting.
12564 * Reads a UTF-8 encoded line from the data input stream.
12566 * If @cancellable is not %NULL, then the operation can be cancelled by
12567 * triggering the cancellable object from another thread. If the operation
12568 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12570 * Returns: (transfer full): a NUL terminated UTF-8 string with the line that was read in (without the newlines). Set @length to a #gsize to get the length of the read line. On an error, it will return %NULL and @error will be set. For UTF-8 conversion errors, the set error domain is %G_CONVERT_ERROR. If there's no content to read, it will still return %NULL, but @error won't be set.
12576 * g_data_input_stream_read_uint16:
12577 * @stream: a given #GDataInputStream.
12578 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12579 * @error: #GError for error reporting.
12581 * Reads an unsigned 16-bit/2-byte value from @stream.
12583 * In order to get the correct byte order for this read operation,
12584 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12586 * Returns: an unsigned 16-bit/2-byte value read from the @stream or %0 if an error occurred.
12591 * g_data_input_stream_read_uint32:
12592 * @stream: a given #GDataInputStream.
12593 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12594 * @error: #GError for error reporting.
12596 * Reads an unsigned 32-bit/4-byte value from @stream.
12598 * In order to get the correct byte order for this read operation,
12599 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12601 * If @cancellable is not %NULL, then the operation can be cancelled by
12602 * triggering the cancellable object from another thread. If the operation
12603 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12605 * Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred.
12610 * g_data_input_stream_read_uint64:
12611 * @stream: a given #GDataInputStream.
12612 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12613 * @error: #GError for error reporting.
12615 * Reads an unsigned 64-bit/8-byte value from @stream.
12617 * In order to get the correct byte order for this read operation,
12618 * see g_data_input_stream_get_byte_order().
12620 * If @cancellable is not %NULL, then the operation can be cancelled by
12621 * triggering the cancellable object from another thread. If the operation
12622 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12624 * Returns: an unsigned 64-bit/8-byte read from @stream or %0 if an error occurred.
12629 * g_data_input_stream_read_until:
12630 * @stream: a given #GDataInputStream.
12631 * @stop_chars: characters to terminate the read.
12632 * @length: (out): a #gsize to get the length of the data read in.
12633 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12634 * @error: #GError for error reporting.
12636 * Reads a string from the data input stream, up to the first
12637 * occurrence of any of the stop characters.
12639 * Note that, in contrast to g_data_input_stream_read_until_async(),
12640 * this function consumes the stop character that it finds.
12642 * Don't use this function in new code. Its functionality is
12643 * inconsistent with g_data_input_stream_read_until_async(). Both
12644 * functions will be marked as deprecated in a future release. Use
12645 * g_data_input_stream_read_upto() instead, but note that that function
12646 * does not consume the stop character.
12648 * Returns: (transfer full): a string with the data that was read before encountering any of the stop characters. Set @length to a #gsize to get the length of the string. This function will return %NULL on an error.
12653 * g_data_input_stream_read_until_async:
12654 * @stream: a given #GDataInputStream.
12655 * @stop_chars: characters to terminate the read.
12656 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12657 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12658 * @callback: (scope async): callback to call when the request is satisfied.
12659 * @user_data: (closure): the data to pass to callback function.
12661 * The asynchronous version of g_data_input_stream_read_until().
12662 * It is an error to have two outstanding calls to this function.
12664 * Note that, in contrast to g_data_input_stream_read_until(),
12665 * this function does not consume the stop character that it finds. You
12666 * must read it for yourself.
12668 * When the operation is finished, @callback will be called. You
12669 * can then call g_data_input_stream_read_until_finish() to get
12670 * the result of the operation.
12672 * Don't use this function in new code. Its functionality is
12673 * inconsistent with g_data_input_stream_read_until(). Both functions
12674 * will be marked as deprecated in a future release. Use
12675 * g_data_input_stream_read_upto_async() instead.
12682 * g_data_input_stream_read_until_finish:
12683 * @stream: a given #GDataInputStream.
12684 * @result: the #GAsyncResult that was provided to the callback.
12685 * @length: (out): a #gsize to get the length of the data read in.
12686 * @error: #GError for error reporting.
12688 * Finish an asynchronous call started by
12689 * g_data_input_stream_read_until_async().
12692 * Returns: (transfer full): a string with the data that was read before encountering any of the stop characters. Set @length to a #gsize to get the length of the string. This function will return %NULL on an error.
12697 * g_data_input_stream_read_upto:
12698 * @stream: a #GDataInputStream
12699 * @stop_chars: characters to terminate the read
12700 * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12701 * @length: (out): a #gsize to get the length of the data read in
12702 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12703 * @error: #GError for error reporting
12705 * Reads a string from the data input stream, up to the first
12706 * occurrence of any of the stop characters.
12708 * In contrast to g_data_input_stream_read_until(), this function
12709 * does <emphasis>not</emphasis> consume the stop character. You have
12710 * to use g_data_input_stream_read_byte() to get it before calling
12711 * g_data_input_stream_read_upto() again.
12713 * Note that @stop_chars may contain '\0' if @stop_chars_len is
12716 * Returns: (transfer full): a string with the data that was read before encountering any of the stop characters. Set @length to a #gsize to get the length of the string. This function will return %NULL on an error
12722 * g_data_input_stream_read_upto_async:
12723 * @stream: a #GDataInputStream
12724 * @stop_chars: characters to terminate the read
12725 * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12726 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12727 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12728 * @callback: (scope async): callback to call when the request is satisfied
12729 * @user_data: (closure): the data to pass to callback function
12731 * The asynchronous version of g_data_input_stream_read_upto().
12732 * It is an error to have two outstanding calls to this function.
12734 * In contrast to g_data_input_stream_read_until(), this function
12735 * does <emphasis>not</emphasis> consume the stop character. You have
12736 * to use g_data_input_stream_read_byte() to get it before calling
12737 * g_data_input_stream_read_upto() again.
12739 * Note that @stop_chars may contain '\0' if @stop_chars_len is
12742 * When the operation is finished, @callback will be called. You
12743 * can then call g_data_input_stream_read_upto_finish() to get
12744 * the result of the operation.
12751 * g_data_input_stream_read_upto_finish:
12752 * @stream: a #GDataInputStream
12753 * @result: the #GAsyncResult that was provided to the callback
12754 * @length: (out): a #gsize to get the length of the data read in
12755 * @error: #GError for error reporting
12757 * Finish an asynchronous call started by
12758 * g_data_input_stream_read_upto_async().
12760 * Note that this function does <emphasis>not</emphasis> consume the
12761 * stop character. You have to use g_data_input_stream_read_byte() to
12762 * get it before calling g_data_input_stream_read_upto_async() again.
12764 * Returns: (transfer full): a string with the data that was read before encountering any of the stop characters. Set @length to a #gsize to get the length of the string. This function will return %NULL on an error.
12770 * g_data_input_stream_set_byte_order:
12771 * @stream: a given #GDataInputStream.
12772 * @order: a #GDataStreamByteOrder to set.
12774 * This function sets the byte order for the given @stream. All subsequent
12775 * reads from the @stream will be read in the given @order.
12780 * g_data_input_stream_set_newline_type:
12781 * @stream: a #GDataInputStream.
12782 * @type: the type of new line return as #GDataStreamNewlineType.
12784 * Sets the newline type for the @stream.
12786 * Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
12787 * chunk ends in "CR" we must read an additional byte to know if this is "CR" or
12788 * "CR LF", and this might block if there is no more data available.
12793 * g_data_output_stream_get_byte_order:
12794 * @stream: a #GDataOutputStream.
12796 * Gets the byte order for the stream.
12798 * Returns: the #GDataStreamByteOrder for the @stream.
12803 * g_data_output_stream_new:
12804 * @base_stream: a #GOutputStream.
12806 * Creates a new data output stream for @base_stream.
12808 * Returns: #GDataOutputStream.
12813 * g_data_output_stream_put_byte:
12814 * @stream: a #GDataOutputStream.
12815 * @data: a #guchar.
12816 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12817 * @error: a #GError, %NULL to ignore.
12819 * Puts a byte into the output stream.
12821 * Returns: %TRUE if @data was successfully added to the @stream.
12826 * g_data_output_stream_put_int16:
12827 * @stream: a #GDataOutputStream.
12828 * @data: a #gint16.
12829 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12830 * @error: a #GError, %NULL to ignore.
12832 * Puts a signed 16-bit integer into the output stream.
12834 * Returns: %TRUE if @data was successfully added to the @stream.
12839 * g_data_output_stream_put_int32:
12840 * @stream: a #GDataOutputStream.
12841 * @data: a #gint32.
12842 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12843 * @error: a #GError, %NULL to ignore.
12845 * Puts a signed 32-bit integer into the output stream.
12847 * Returns: %TRUE if @data was successfully added to the @stream.
12852 * g_data_output_stream_put_int64:
12853 * @stream: a #GDataOutputStream.
12854 * @data: a #gint64.
12855 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12856 * @error: a #GError, %NULL to ignore.
12858 * Puts a signed 64-bit integer into the stream.
12860 * Returns: %TRUE if @data was successfully added to the @stream.
12865 * g_data_output_stream_put_string:
12866 * @stream: a #GDataOutputStream.
12868 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12869 * @error: a #GError, %NULL to ignore.
12871 * Puts a string into the output stream.
12873 * Returns: %TRUE if @string was successfully added to the @stream.
12878 * g_data_output_stream_put_uint16:
12879 * @stream: a #GDataOutputStream.
12880 * @data: a #guint16.
12881 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12882 * @error: a #GError, %NULL to ignore.
12884 * Puts an unsigned 16-bit integer into the output stream.
12886 * Returns: %TRUE if @data was successfully added to the @stream.
12891 * g_data_output_stream_put_uint32:
12892 * @stream: a #GDataOutputStream.
12893 * @data: a #guint32.
12894 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12895 * @error: a #GError, %NULL to ignore.
12897 * Puts an unsigned 32-bit integer into the stream.
12899 * Returns: %TRUE if @data was successfully added to the @stream.
12904 * g_data_output_stream_put_uint64:
12905 * @stream: a #GDataOutputStream.
12906 * @data: a #guint64.
12907 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12908 * @error: a #GError, %NULL to ignore.
12910 * Puts an unsigned 64-bit integer into the stream.
12912 * Returns: %TRUE if @data was successfully added to the @stream.
12917 * g_data_output_stream_set_byte_order:
12918 * @stream: a #GDataOutputStream.
12919 * @order: a %GDataStreamByteOrder.
12921 * Sets the byte order of the data output stream to @order.
12926 * g_dbus_action_group_get:
12927 * @connection: A #GDBusConnection
12928 * @bus_name: the bus name which exports the action group
12929 * @object_path: the object path at which the action group is exported
12931 * Obtains a #GDBusActionGroup for the action group which is exported at
12932 * the given @bus_name and @object_path.
12934 * The thread default main context is taken at the time of this call.
12935 * All signals on the menu model (and any linked models) are reported
12936 * with respect to this context. All calls on the returned menu model
12937 * (and linked models) must also originate from this same context, with
12938 * the thread default main context unchanged.
12940 * This call is non-blocking. The returned action group may or may not
12941 * already be filled in. The correct thing to do is connect the signals
12942 * for the action group to monitor for changes and then to call
12943 * g_action_group_list_actions() to get the initial list.
12945 * Returns: (transfer full): a #GDBusActionGroup
12951 * g_dbus_address_get_for_bus_sync:
12952 * @bus_type: A #GBusType.
12953 * @cancellable: (allow-none): A #GCancellable or %NULL.
12954 * @error: Return location for error or %NULL.
12956 * Synchronously looks up the D-Bus address for the well-known message
12957 * bus instance specified by @bus_type. This may involve using various
12958 * platform specific mechanisms.
12960 * Returns: A valid D-Bus address string for @bus_type or %NULL if @error is set.
12966 * g_dbus_address_get_stream:
12967 * @address: A valid D-Bus address.
12968 * @cancellable: (allow-none): A #GCancellable or %NULL.
12969 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12970 * @user_data: Data to pass to @callback.
12972 * Asynchronously connects to an endpoint specified by @address and
12973 * sets up the connection so it is in a state to run the client-side
12974 * of the D-Bus authentication conversation.
12976 * When the operation is finished, @callback will be invoked. You can
12977 * then call g_dbus_address_get_stream_finish() to get the result of
12980 * This is an asynchronous failable function. See
12981 * g_dbus_address_get_stream_sync() for the synchronous version.
12988 * g_dbus_address_get_stream_finish:
12989 * @res: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
12990 * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12991 * @error: Return location for error or %NULL.
12993 * Finishes an operation started with g_dbus_address_get_stream().
12995 * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
13001 * g_dbus_address_get_stream_sync:
13002 * @address: A valid D-Bus address.
13003 * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
13004 * @cancellable: (allow-none): A #GCancellable or %NULL.
13005 * @error: Return location for error or %NULL.
13007 * Synchronously connects to an endpoint specified by @address and
13008 * sets up the connection so it is in a state to run the client-side
13009 * of the D-Bus authentication conversation.
13011 * This is a synchronous failable function. See
13012 * g_dbus_address_get_stream() for the asynchronous version.
13014 * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
13020 * g_dbus_annotation_info_lookup:
13021 * @annotations: (array zero-terminated=1) (allow-none): A %NULL-terminated array of annotations or %NULL.
13022 * @name: The name of the annotation to look up.
13024 * Looks up the value of an annotation.
13026 * This cost of this function is O(n) in number of annotations.
13028 * Returns: The value or %NULL if not found. Do not free, it is owned by @annotations.
13034 * g_dbus_annotation_info_ref:
13035 * @info: A #GDBusNodeInfo
13037 * If @info is statically allocated does nothing. Otherwise increases
13038 * the reference count.
13040 * Returns: The same @info.
13046 * g_dbus_annotation_info_unref:
13047 * @info: A #GDBusAnnotationInfo.
13049 * If @info is statically allocated, does nothing. Otherwise decreases
13050 * the reference count of @info. When its reference count drops to 0,
13051 * the memory used is freed.
13058 * g_dbus_arg_info_ref:
13059 * @info: A #GDBusArgInfo
13061 * If @info is statically allocated does nothing. Otherwise increases
13062 * the reference count.
13064 * Returns: The same @info.
13070 * g_dbus_arg_info_unref:
13071 * @info: A #GDBusArgInfo.
13073 * If @info is statically allocated, does nothing. Otherwise decreases
13074 * the reference count of @info. When its reference count drops to 0,
13075 * the memory used is freed.
13082 * g_dbus_auth_observer_allow_mechanism:
13083 * @observer: A #GDBusAuthObserver.
13084 * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
13086 * Emits the #GDBusAuthObserver::allow-mechanism signal on @observer.
13088 * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
13094 * g_dbus_auth_observer_authorize_authenticated_peer:
13095 * @observer: A #GDBusAuthObserver.
13096 * @stream: A #GIOStream for the #GDBusConnection.
13097 * @credentials: (allow-none): Credentials received from the peer or %NULL.
13099 * Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
13101 * Returns: %TRUE if the peer is authorized, %FALSE if not.
13107 * g_dbus_auth_observer_new:
13109 * Creates a new #GDBusAuthObserver object.
13111 * Returns: A #GDBusAuthObserver. Free with g_object_unref().
13117 * g_dbus_connection_add_filter:
13118 * @connection: A #GDBusConnection.
13119 * @filter_function: A filter function.
13120 * @user_data: User data to pass to @filter_function.
13121 * @user_data_free_func: Function to free @user_data with when filter is removed or %NULL.
13123 * Adds a message filter. Filters are handlers that are run on all
13124 * incoming and outgoing messages, prior to standard dispatch. Filters
13125 * are run in the order that they were added. The same handler can be
13126 * added as a filter more than once, in which case it will be run more
13127 * than once. Filters added during a filter callback won't be run on
13128 * the message being processed. Filter functions are allowed to modify
13129 * and even drop messages.
13131 * Note that filters are run in a dedicated message handling thread so
13132 * they can't block and, generally, can't do anything but signal a
13133 * worker thread. Also note that filters are rarely needed - use API
13134 * such as g_dbus_connection_send_message_with_reply(),
13135 * g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
13137 * If a filter consumes an incoming message the message is not
13138 * dispatched anywhere else - not even the standard dispatch machinery
13139 * (that API such as g_dbus_connection_signal_subscribe() and
13140 * g_dbus_connection_send_message_with_reply() relies on) will see the
13141 * message. Similary, if a filter consumes an outgoing message, the
13142 * message will not be sent to the other peer.
13144 * Returns: A filter identifier that can be used with g_dbus_connection_remove_filter().
13150 * g_dbus_connection_call:
13151 * @connection: A #GDBusConnection.
13152 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
13153 * @object_path: Path of remote object.
13154 * @interface_name: D-Bus interface to invoke method on.
13155 * @method_name: The name of the method to invoke.
13156 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
13157 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
13158 * @flags: Flags from the #GDBusCallFlags enumeration.
13159 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13160 * @cancellable: (allow-none): A #GCancellable or %NULL.
13161 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
13162 * @user_data: The data to pass to @callback.
13164 * Asynchronously invokes the @method_name method on the
13165 * @interface_name D-Bus interface on the remote object at
13166 * @object_path owned by @bus_name.
13168 * If @connection is closed then the operation will fail with
13169 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13170 * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
13171 * not compatible with the D-Bus protocol, the operation fails with
13172 * %G_IO_ERROR_INVALID_ARGUMENT.
13174 * If @reply_type is non-%NULL then the reply will be checked for having this type and an
13175 * error will be raised if it does not match. Said another way, if you give a @reply_type
13176 * then any non-%NULL return value will be of this type.
13178 * If the @parameters #GVariant is floating, it is consumed. This allows
13179 * convenient 'inline' use of g_variant_new(), e.g.:
13181 * g_dbus_connection_call (connection,
13182 * "org.freedesktop.StringThings",
13183 * "/org/freedesktop/StringThings",
13184 * "org.freedesktop.StringThings",
13186 * g_variant_new ("(ss)",
13190 * G_DBUS_CALL_FLAGS_NONE,
13193 * (GAsyncReadyCallback) two_strings_done,
13197 * This is an asynchronous method. When the operation is finished, @callback will be invoked
13198 * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13199 * of the thread you are calling this method from. You can then call
13200 * g_dbus_connection_call_finish() to get the result of the operation.
13201 * See g_dbus_connection_call_sync() for the synchronous version of this
13204 * If @callback is %NULL then the D-Bus method call message will be sent with
13205 * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
13212 * g_dbus_connection_call_finish:
13213 * @connection: A #GDBusConnection.
13214 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
13215 * @error: Return location for error or %NULL.
13217 * Finishes an operation started with g_dbus_connection_call().
13219 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
13225 * g_dbus_connection_call_sync:
13226 * @connection: A #GDBusConnection.
13227 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
13228 * @object_path: Path of remote object.
13229 * @interface_name: D-Bus interface to invoke method on.
13230 * @method_name: The name of the method to invoke.
13231 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
13232 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
13233 * @flags: Flags from the #GDBusCallFlags enumeration.
13234 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13235 * @cancellable: (allow-none): A #GCancellable or %NULL.
13236 * @error: Return location for error or %NULL.
13238 * Synchronously invokes the @method_name method on the
13239 * @interface_name D-Bus interface on the remote object at
13240 * @object_path owned by @bus_name.
13242 * If @connection is closed then the operation will fail with
13243 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
13244 * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
13245 * contains a value not compatible with the D-Bus protocol, the operation
13246 * fails with %G_IO_ERROR_INVALID_ARGUMENT.
13248 * If @reply_type is non-%NULL then the reply will be checked for having
13249 * this type and an error will be raised if it does not match. Said
13250 * another way, if you give a @reply_type then any non-%NULL return
13251 * value will be of this type.
13253 * If the @parameters #GVariant is floating, it is consumed.
13254 * This allows convenient 'inline' use of g_variant_new(), e.g.:
13256 * g_dbus_connection_call_sync (connection,
13257 * "org.freedesktop.StringThings",
13258 * "/org/freedesktop/StringThings",
13259 * "org.freedesktop.StringThings",
13261 * g_variant_new ("(ss)",
13265 * G_DBUS_CALL_FLAGS_NONE,
13271 * The calling thread is blocked until a reply is received. See
13272 * g_dbus_connection_call() for the asynchronous version of
13275 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
13281 * g_dbus_connection_call_with_unix_fd_list:
13282 * @connection: A #GDBusConnection.
13283 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
13284 * @object_path: Path of remote object.
13285 * @interface_name: D-Bus interface to invoke method on.
13286 * @method_name: The name of the method to invoke.
13287 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
13288 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
13289 * @flags: Flags from the #GDBusCallFlags enumeration.
13290 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13291 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
13292 * @cancellable: (allow-none): A #GCancellable or %NULL.
13293 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't * care about the result of the method invocation.
13294 * @user_data: The data to pass to @callback.
13296 * Like g_dbus_connection_call() but also takes a #GUnixFDList object.
13298 * This method is only available on UNIX.
13305 * g_dbus_connection_call_with_unix_fd_list_finish:
13306 * @connection: A #GDBusConnection.
13307 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
13308 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
13309 * @error: Return location for error or %NULL.
13311 * Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
13313 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
13319 * g_dbus_connection_call_with_unix_fd_list_sync:
13320 * @connection: A #GDBusConnection.
13321 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
13322 * @object_path: Path of remote object.
13323 * @interface_name: D-Bus interface to invoke method on.
13324 * @method_name: The name of the method to invoke.
13325 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
13326 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
13327 * @flags: Flags from the #GDBusCallFlags enumeration.
13328 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13329 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
13330 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
13331 * @cancellable: (allow-none): A #GCancellable or %NULL.
13332 * @error: Return location for error or %NULL.
13334 * Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
13336 * This method is only available on UNIX.
13338 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
13344 * g_dbus_connection_close:
13345 * @connection: A #GDBusConnection.
13346 * @cancellable: (allow-none): A #GCancellable or %NULL.
13347 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13348 * @user_data: The data to pass to @callback.
13350 * Closes @connection. Note that this never causes the process to
13351 * exit (this might only happen if the other end of a shared message
13352 * bus connection disconnects, see #GDBusConnection:exit-on-close).
13354 * Once the connection is closed, operations such as sending a message
13355 * will return with the error %G_IO_ERROR_CLOSED. Closing a connection
13356 * will not automatically flush the connection so queued messages may
13357 * be lost. Use g_dbus_connection_flush() if you need such guarantees.
13359 * If @connection is already closed, this method fails with
13360 * %G_IO_ERROR_CLOSED.
13362 * When @connection has been closed, the #GDBusConnection::closed
13363 * signal is emitted in the <link
13364 * linkend="g-main-context-push-thread-default">thread-default main
13365 * loop</link> of the thread that @connection was constructed in.
13367 * This is an asynchronous method. When the operation is finished,
13368 * @callback will be invoked in the <link
13369 * linkend="g-main-context-push-thread-default">thread-default main
13370 * loop</link> of the thread you are calling this method from. You can
13371 * then call g_dbus_connection_close_finish() to get the result of the
13372 * operation. See g_dbus_connection_close_sync() for the synchronous
13380 * g_dbus_connection_close_finish:
13381 * @connection: A #GDBusConnection.
13382 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
13383 * @error: Return location for error or %NULL.
13385 * Finishes an operation started with g_dbus_connection_close().
13387 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
13393 * g_dbus_connection_close_sync:
13394 * @connection: A #GDBusConnection.
13395 * @cancellable: (allow-none): A #GCancellable or %NULL.
13396 * @error: Return location for error or %NULL.
13398 * Synchronously closees @connection. The calling thread is blocked
13399 * until this is done. See g_dbus_connection_close() for the
13400 * asynchronous version of this method and more details about what it
13403 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
13409 * g_dbus_connection_emit_signal:
13410 * @connection: A #GDBusConnection.
13411 * @destination_bus_name: (allow-none): The unique bus name for the destination for the signal or %NULL to emit to all listeners.
13412 * @object_path: Path of remote object.
13413 * @interface_name: D-Bus interface to emit a signal on.
13414 * @signal_name: The name of the signal to emit.
13415 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
13416 * @error: Return location for error or %NULL.
13420 * If the parameters GVariant is floating, it is consumed.
13422 * This can only fail if @parameters is not compatible with the D-Bus protocol.
13424 * Returns: %TRUE unless @error is set.
13430 * g_dbus_connection_export_action_group:
13431 * @connection: a #GDBusConnection
13432 * @object_path: a D-Bus object path
13433 * @action_group: a #GActionGroup
13434 * @error: a pointer to a %NULL #GError, or %NULL
13436 * Exports @action_group on @connection at @object_path.
13438 * The implemented D-Bus API should be considered private. It is
13439 * subject to change in the future.
13441 * A given object path can only have one action group exported on it.
13442 * If this constraint is violated, the export will fail and 0 will be
13443 * returned (with @error set accordingly).
13445 * You can unexport the action group using
13446 * g_dbus_connection_unexport_action_group() with the return value of
13449 * The thread default main context is taken at the time of this call.
13450 * All incoming action activations and state change requests are
13451 * reported from this context. Any changes on the action group that
13452 * cause it to emit signals must also come from this same context.
13453 * Since incoming action activations and state change requests are
13454 * rather likely to cause changes on the action group, this effectively
13455 * limits a given action group to being exported from only one main
13458 * Returns: the ID of the export (never zero), or 0 in case of failure
13464 * g_dbus_connection_export_menu_model:
13465 * @connection: a #GDBusConnection
13466 * @object_path: a D-Bus object path
13467 * @menu: a #GMenuModel
13468 * @error: return location for an error, or %NULL
13470 * Exports @menu on @connection at @object_path.
13472 * The implemented D-Bus API should be considered private.
13473 * It is subject to change in the future.
13475 * An object path can only have one action group exported on it. If this
13476 * constraint is violated, the export will fail and 0 will be
13477 * returned (with @error set accordingly).
13479 * You can unexport the menu model using
13480 * g_dbus_connection_unexport_menu_model() with the return value of
13483 * Returns: the ID of the export (never zero), or 0 in case of failure
13489 * g_dbus_connection_flush:
13490 * @connection: A #GDBusConnection.
13491 * @cancellable: (allow-none): A #GCancellable or %NULL.
13492 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13493 * @user_data: The data to pass to @callback.
13495 * Asynchronously flushes @connection, that is, writes all queued
13496 * outgoing message to the transport and then flushes the transport
13497 * (using g_output_stream_flush_async()). This is useful in programs
13498 * that wants to emit a D-Bus signal and then exit
13499 * immediately. Without flushing the connection, there is no guarantee
13500 * that the message has been sent to the networking buffers in the OS
13503 * This is an asynchronous method. When the operation is finished,
13504 * @callback will be invoked in the <link
13505 * linkend="g-main-context-push-thread-default">thread-default main
13506 * loop</link> of the thread you are calling this method from. You can
13507 * then call g_dbus_connection_flush_finish() to get the result of the
13508 * operation. See g_dbus_connection_flush_sync() for the synchronous
13516 * g_dbus_connection_flush_finish:
13517 * @connection: A #GDBusConnection.
13518 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
13519 * @error: Return location for error or %NULL.
13521 * Finishes an operation started with g_dbus_connection_flush().
13523 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
13529 * g_dbus_connection_flush_sync:
13530 * @connection: A #GDBusConnection.
13531 * @cancellable: (allow-none): A #GCancellable or %NULL.
13532 * @error: Return location for error or %NULL.
13534 * Synchronously flushes @connection. The calling thread is blocked
13535 * until this is done. See g_dbus_connection_flush() for the
13536 * asynchronous version of this method and more details about what it
13539 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
13545 * g_dbus_connection_get_capabilities:
13546 * @connection: A #GDBusConnection.
13548 * Gets the capabilities negotiated with the remote peer
13550 * Returns: Zero or more flags from the #GDBusCapabilityFlags enumeration.
13556 * g_dbus_connection_get_exit_on_close:
13557 * @connection: A #GDBusConnection.
13559 * Gets whether the process is terminated when @connection is
13560 * closed by the remote peer. See
13561 * #GDBusConnection:exit-on-close for more details.
13563 * Returns: Whether the process is terminated when @connection is closed by the remote peer.
13569 * g_dbus_connection_get_guid:
13570 * @connection: A #GDBusConnection.
13572 * The GUID of the peer performing the role of server when
13573 * authenticating. See #GDBusConnection:guid for more details.
13575 * Returns: The GUID. Do not free this string, it is owned by @connection.
13581 * g_dbus_connection_get_last_serial:
13582 * @connection: A #GDBusConnection.
13584 * Retrieves the last serial number assigned to a #GDBusMessage on
13585 * the current thread. This includes messages sent via both low-level
13586 * API such as g_dbus_connection_send_message() as well as
13587 * high-level API such as g_dbus_connection_emit_signal(),
13588 * g_dbus_connection_call() or g_dbus_proxy_call().
13590 * Returns: the last used serial or zero when no message has been sent within the current thread.
13596 * g_dbus_connection_get_peer_credentials:
13597 * @connection: A #GDBusConnection.
13599 * Gets the credentials of the authenticated peer. This will always
13600 * return %NULL unless @connection acted as a server
13601 * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
13602 * when set up and the client passed credentials as part of the
13603 * authentication process.
13605 * In a message bus setup, the message bus is always the server and
13606 * each application is a client. So this method will always return
13607 * %NULL for message bus clients.
13609 * Returns: (transfer none): A #GCredentials or %NULL if not available. Do not free this object, it is owned by @connection.
13615 * g_dbus_connection_get_stream:
13616 * @connection: a #GDBusConnection
13618 * Gets the underlying stream used for IO.
13620 * While the #GDBusConnection is active, it will interact with this
13621 * stream from a worker thread, so it is not safe to interact with
13622 * the stream directly.
13624 * Returns: (transfer none): the stream used for IO
13630 * g_dbus_connection_get_unique_name:
13631 * @connection: A #GDBusConnection.
13633 * Gets the unique name of @connection as assigned by the message
13634 * bus. This can also be used to figure out if @connection is a
13635 * message bus connection.
13637 * Returns: The unique name or %NULL if @connection is not a message bus connection. Do not free this string, it is owned by @connection.
13643 * g_dbus_connection_is_closed:
13644 * @connection: A #GDBusConnection.
13646 * Gets whether @connection is closed.
13648 * Returns: %TRUE if the connection is closed, %FALSE otherwise.
13654 * g_dbus_connection_new:
13655 * @stream: A #GIOStream.
13656 * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13657 * @flags: Flags describing how to make the connection.
13658 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13659 * @cancellable: (allow-none): A #GCancellable or %NULL.
13660 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13661 * @user_data: The data to pass to @callback.
13663 * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
13664 * with the end represented by @stream.
13666 * If @stream is a #GSocketConnection, then the corresponding #GSocket
13667 * will be put into non-blocking mode.
13669 * The D-Bus connection will interact with @stream from a worker thread.
13670 * As a result, the caller should not interact with @stream after this
13671 * method has been called, except by calling g_object_unref() on it.
13673 * If @observer is not %NULL it may be used to control the
13674 * authentication process.
13676 * When the operation is finished, @callback will be invoked. You can
13677 * then call g_dbus_connection_new_finish() to get the result of the
13680 * This is a asynchronous failable constructor. See
13681 * g_dbus_connection_new_sync() for the synchronous
13689 * g_dbus_connection_new_finish:
13690 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13691 * @error: Return location for error or %NULL.
13693 * Finishes an operation started with g_dbus_connection_new().
13695 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13701 * g_dbus_connection_new_for_address:
13702 * @address: A D-Bus address.
13703 * @flags: Flags describing how to make the connection.
13704 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13705 * @cancellable: (allow-none): A #GCancellable or %NULL.
13706 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13707 * @user_data: The data to pass to @callback.
13709 * Asynchronously connects and sets up a D-Bus client connection for
13710 * exchanging D-Bus messages with an endpoint specified by @address
13711 * which must be in the D-Bus address format.
13713 * This constructor can only be used to initiate client-side
13714 * connections - use g_dbus_connection_new() if you need to act as the
13715 * server. In particular, @flags cannot contain the
13716 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13717 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13719 * When the operation is finished, @callback will be invoked. You can
13720 * then call g_dbus_connection_new_finish() to get the result of the
13723 * If @observer is not %NULL it may be used to control the
13724 * authentication process.
13726 * This is a asynchronous failable constructor. See
13727 * g_dbus_connection_new_for_address_sync() for the synchronous
13735 * g_dbus_connection_new_for_address_finish:
13736 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13737 * @error: Return location for error or %NULL.
13739 * Finishes an operation started with g_dbus_connection_new_for_address().
13741 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13747 * g_dbus_connection_new_for_address_sync:
13748 * @address: A D-Bus address.
13749 * @flags: Flags describing how to make the connection.
13750 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13751 * @cancellable: (allow-none): A #GCancellable or %NULL.
13752 * @error: Return location for error or %NULL.
13754 * Synchronously connects and sets up a D-Bus client connection for
13755 * exchanging D-Bus messages with an endpoint specified by @address
13756 * which must be in the D-Bus address format.
13758 * This constructor can only be used to initiate client-side
13759 * connections - use g_dbus_connection_new_sync() if you need to act
13760 * as the server. In particular, @flags cannot contain the
13761 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13762 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13764 * This is a synchronous failable constructor. See
13765 * g_dbus_connection_new_for_address() for the asynchronous version.
13767 * If @observer is not %NULL it may be used to control the
13768 * authentication process.
13770 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13776 * g_dbus_connection_new_sync:
13777 * @stream: A #GIOStream.
13778 * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13779 * @flags: Flags describing how to make the connection.
13780 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13781 * @cancellable: (allow-none): A #GCancellable or %NULL.
13782 * @error: Return location for error or %NULL.
13784 * Synchronously sets up a D-Bus connection for exchanging D-Bus messages
13785 * with the end represented by @stream.
13787 * If @stream is a #GSocketConnection, then the corresponding #GSocket
13788 * will be put into non-blocking mode.
13790 * The D-Bus connection will interact with @stream from a worker thread.
13791 * As a result, the caller should not interact with @stream after this
13792 * method has been called, except by calling g_object_unref() on it.
13794 * If @observer is not %NULL it may be used to control the
13795 * authentication process.
13797 * This is a synchronous failable constructor. See
13798 * g_dbus_connection_new() for the asynchronous version.
13800 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13806 * g_dbus_connection_register_object:
13807 * @connection: A #GDBusConnection.
13808 * @object_path: The object path to register at.
13809 * @interface_info: Introspection data for the interface.
13810 * @vtable: (allow-none): A #GDBusInterfaceVTable to call into or %NULL.
13811 * @user_data: (allow-none): Data to pass to functions in @vtable.
13812 * @user_data_free_func: Function to call when the object path is unregistered.
13813 * @error: Return location for error or %NULL.
13815 * Registers callbacks for exported objects at @object_path with the
13816 * D-Bus interface that is described in @interface_info.
13818 * Calls to functions in @vtable (and @user_data_free_func) will
13819 * happen in the <link linkend="g-main-context-push-thread-default">thread-default main
13820 * loop</link> of the thread you are calling this method from.
13822 * Note that all #GVariant values passed to functions in @vtable will match
13823 * the signature given in @interface_info - if a remote caller passes
13824 * incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
13825 * is returned to the remote caller.
13827 * Additionally, if the remote caller attempts to invoke methods or
13828 * access properties not mentioned in @interface_info the
13829 * <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
13830 * <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
13831 * are returned to the caller.
13833 * It is considered a programming error if the
13834 * #GDBusInterfaceGetPropertyFunc function in @vtable returns a
13835 * #GVariant of incorrect type.
13837 * If an existing callback is already registered at @object_path and
13838 * @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
13840 * GDBus automatically implements the standard D-Bus interfaces
13841 * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
13842 * and org.freedesktop.Peer, so you don't have to implement those for
13843 * the objects you export. You <emphasis>can</emphasis> implement
13844 * org.freedesktop.DBus.Properties yourself, e.g. to handle getting
13845 * and setting of properties asynchronously.
13847 * Note that the reference count on @interface_info will be
13848 * incremented by 1 (unless allocated statically, e.g. if the
13849 * reference count is -1, see g_dbus_interface_info_ref()) for as long
13850 * as the object is exported. Also note that @vtable will be copied.
13852 * See <xref linkend="gdbus-server"/> for an example of how to use this method.
13854 * Returns: 0 if @error is set, otherwise a registration id (never 0) that can be used with g_dbus_connection_unregister_object() .
13860 * g_dbus_connection_register_subtree:
13861 * @connection: A #GDBusConnection.
13862 * @object_path: The object path to register the subtree at.
13863 * @vtable: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
13864 * @flags: Flags used to fine tune the behavior of the subtree.
13865 * @user_data: Data to pass to functions in @vtable.
13866 * @user_data_free_func: Function to call when the subtree is unregistered.
13867 * @error: Return location for error or %NULL.
13869 * Registers a whole subtree of <quote>dynamic</quote> objects.
13871 * The @enumerate and @introspection functions in @vtable are used to
13872 * convey, to remote callers, what nodes exist in the subtree rooted
13875 * When handling remote calls into any node in the subtree, first the
13876 * @enumerate function is used to check if the node exists. If the node exists
13877 * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
13878 * the @introspection function is used to check if the node supports the
13879 * requested method. If so, the @dispatch function is used to determine
13880 * where to dispatch the call. The collected #GDBusInterfaceVTable and
13881 * #gpointer will be used to call into the interface vtable for processing
13884 * All calls into user-provided code will be invoked in the <link
13885 * linkend="g-main-context-push-thread-default">thread-default main
13886 * loop</link> of the thread you are calling this method from.
13888 * If an existing subtree is already registered at @object_path or
13889 * then @error is set to #G_IO_ERROR_EXISTS.
13891 * Note that it is valid to register regular objects (using
13892 * g_dbus_connection_register_object()) in a subtree registered with
13893 * g_dbus_connection_register_subtree() - if so, the subtree handler
13894 * is tried as the last resort. One way to think about a subtree
13895 * handler is to consider it a <quote>fallback handler</quote>
13896 * for object paths not registered via g_dbus_connection_register_object()
13897 * or other bindings.
13899 * Note that @vtable will be copied so you cannot change it after
13902 * See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
13904 * Returns: 0 if @error is set, otherwise a subtree registration id (never 0) that can be used with g_dbus_connection_unregister_subtree() .
13910 * g_dbus_connection_remove_filter:
13911 * @connection: a #GDBusConnection
13912 * @filter_id: an identifier obtained from g_dbus_connection_add_filter()
13914 * Removes a filter.
13921 * g_dbus_connection_send_message:
13922 * @connection: A #GDBusConnection.
13923 * @message: A #GDBusMessage
13924 * @flags: Flags affecting how the message is sent.
13925 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13926 * @error: Return location for error or %NULL.
13928 * Asynchronously sends @message to the peer represented by @connection.
13930 * Unless @flags contain the
13931 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13932 * will be assigned by @connection and set on @message via
13933 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13934 * serial number used will be written to this location prior to
13935 * submitting the message to the underlying transport.
13937 * If @connection is closed then the operation will fail with
13938 * %G_IO_ERROR_CLOSED. If @message is not well-formed,
13939 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13941 * See <xref linkend="gdbus-server"/> and <xref
13942 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13943 * low-level API to send and receive UNIX file descriptors.
13945 * Note that @message must be unlocked, unless @flags contain the
13946 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13948 * Returns: %TRUE if the message was well-formed and queued for transmission, %FALSE if @error is set.
13954 * g_dbus_connection_send_message_with_reply:
13955 * @connection: A #GDBusConnection.
13956 * @message: A #GDBusMessage.
13957 * @flags: Flags affecting how the message is sent.
13958 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13959 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13960 * @cancellable: (allow-none): A #GCancellable or %NULL.
13961 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13962 * @user_data: The data to pass to @callback.
13964 * Asynchronously sends @message to the peer represented by @connection.
13966 * Unless @flags contain the
13967 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13968 * will be assigned by @connection and set on @message via
13969 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13970 * serial number used will be written to this location prior to
13971 * submitting the message to the underlying transport.
13973 * If @connection is closed then the operation will fail with
13974 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13975 * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13976 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13978 * This is an asynchronous method. When the operation is finished, @callback will be invoked
13979 * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13980 * of the thread you are calling this method from. You can then call
13981 * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
13982 * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
13984 * Note that @message must be unlocked, unless @flags contain the
13985 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13987 * See <xref linkend="gdbus-server"/> and <xref
13988 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13989 * low-level API to send and receive UNIX file descriptors.
13996 * g_dbus_connection_send_message_with_reply_finish:
13997 * @connection: a #GDBusConnection
13998 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
13999 * @error: Return location for error or %NULL.
14001 * Finishes an operation started with g_dbus_connection_send_message_with_reply().
14003 * Note that @error is only set if a local in-process error
14004 * occurred. That is to say that the returned #GDBusMessage object may
14005 * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
14006 * g_dbus_message_to_gerror() to transcode this to a #GError.
14008 * See <xref linkend="gdbus-server"/> and <xref
14009 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
14010 * low-level API to send and receive UNIX file descriptors.
14012 * Returns: (transfer full): A locked #GDBusMessage or %NULL if @error is set.
14018 * g_dbus_connection_send_message_with_reply_sync:
14019 * @connection: A #GDBusConnection.
14020 * @message: A #GDBusMessage.
14021 * @flags: Flags affecting how the message is sent.
14022 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
14023 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
14024 * @cancellable: (allow-none): A #GCancellable or %NULL.
14025 * @error: Return location for error or %NULL.
14027 * Synchronously sends @message to the peer represented by @connection
14028 * and blocks the calling thread until a reply is received or the
14029 * timeout is reached. See g_dbus_connection_send_message_with_reply()
14030 * for the asynchronous version of this method.
14032 * Unless @flags contain the
14033 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
14034 * will be assigned by @connection and set on @message via
14035 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
14036 * serial number used will be written to this location prior to
14037 * submitting the message to the underlying transport.
14039 * If @connection is closed then the operation will fail with
14040 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
14041 * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
14042 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
14044 * Note that @error is only set if a local in-process error
14045 * occurred. That is to say that the returned #GDBusMessage object may
14046 * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
14047 * g_dbus_message_to_gerror() to transcode this to a #GError.
14049 * See <xref linkend="gdbus-server"/> and <xref
14050 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
14051 * low-level API to send and receive UNIX file descriptors.
14053 * Note that @message must be unlocked, unless @flags contain the
14054 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
14056 * Returns: (transfer full): A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
14062 * g_dbus_connection_set_exit_on_close:
14063 * @connection: A #GDBusConnection.
14064 * @exit_on_close: Whether the process should be terminated when @connection is closed by the remote peer.
14066 * Sets whether the process should be terminated when @connection is
14067 * closed by the remote peer. See #GDBusConnection:exit-on-close for
14070 * Note that this function should be used with care. Most modern UNIX
14071 * desktops tie the notion of a user session the session bus, and expect
14072 * all of a users applications to quit when their bus connection goes away.
14073 * If you are setting @exit_on_close to %FALSE for the shared session
14074 * bus connection, you should make sure that your application exits
14075 * when the user session ends.
14082 * g_dbus_connection_signal_subscribe:
14083 * @connection: A #GDBusConnection.
14084 * @sender: (allow-none): Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
14085 * @interface_name: (allow-none): D-Bus interface name to match on or %NULL to match on all interfaces.
14086 * @member: (allow-none): D-Bus signal name to match on or %NULL to match on all signals.
14087 * @object_path: (allow-none): Object path to match on or %NULL to match on all object paths.
14088 * @arg0: (allow-none): Contents of first string argument to match on or %NULL to match on all kinds of arguments.
14089 * @flags: Flags describing how to subscribe to the signal (currently unused).
14090 * @callback: Callback to invoke when there is a signal matching the requested data.
14091 * @user_data: User data to pass to @callback.
14092 * @user_data_free_func: (allow-none): Function to free @user_data with when subscription is removed or %NULL.
14094 * Subscribes to signals on @connection and invokes @callback with a
14095 * whenever the signal is received. Note that @callback
14096 * will be invoked in the <link
14097 * linkend="g-main-context-push-thread-default">thread-default main
14098 * loop</link> of the thread you are calling this method from.
14100 * If @connection is not a message bus connection, @sender must be
14103 * If @sender is a well-known name note that @callback is invoked with
14104 * the unique name for the owner of @sender, not the well-known name
14105 * as one would expect. This is because the message bus rewrites the
14106 * name. As such, to avoid certain race conditions, users should be
14107 * tracking the name owner of the well-known name and use that when
14108 * processing the received signal.
14110 * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
14116 * g_dbus_connection_signal_unsubscribe:
14117 * @connection: A #GDBusConnection.
14118 * @subscription_id: A subscription id obtained from g_dbus_connection_signal_subscribe().
14120 * Unsubscribes from signals.
14127 * g_dbus_connection_start_message_processing:
14128 * @connection: A #GDBusConnection.
14130 * If @connection was created with
14131 * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
14132 * starts processing messages. Does nothing on if @connection wasn't
14133 * created with this flag or if the method has already been called.
14140 * g_dbus_connection_unexport_action_group:
14141 * @connection: a #GDBusConnection
14142 * @export_id: the ID from g_dbus_connection_export_action_group()
14144 * Reverses the effect of a previous call to
14145 * g_dbus_connection_export_action_group().
14147 * It is an error to call this function with an ID that wasn't returned
14148 * from g_dbus_connection_export_action_group() or to call it with the
14149 * same ID more than once.
14156 * g_dbus_connection_unexport_menu_model:
14157 * @connection: a #GDBusConnection
14158 * @export_id: the ID from g_dbus_connection_export_menu_model()
14160 * Reverses the effect of a previous call to
14161 * g_dbus_connection_export_menu_model().
14163 * It is an error to call this function with an ID that wasn't returned
14164 * from g_dbus_connection_export_menu_model() or to call it with the
14165 * same ID more than once.
14172 * g_dbus_connection_unregister_object:
14173 * @connection: A #GDBusConnection.
14174 * @registration_id: A registration id obtained from g_dbus_connection_register_object().
14176 * Unregisters an object.
14178 * Returns: %TRUE if the object was unregistered, %FALSE otherwise.
14184 * g_dbus_connection_unregister_subtree:
14185 * @connection: A #GDBusConnection.
14186 * @registration_id: A subtree registration id obtained from g_dbus_connection_register_subtree().
14188 * Unregisters a subtree.
14190 * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise.
14196 * g_dbus_error_encode_gerror:
14197 * @error: A #GError.
14199 * Creates a D-Bus error name to use for @error. If @error matches
14200 * a registered error (cf. g_dbus_error_register_error()), the corresponding
14201 * D-Bus error name will be returned.
14203 * Otherwise the a name of the form
14204 * <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
14205 * will be used. This allows other GDBus applications to map the error
14206 * on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
14208 * This function is typically only used in object mappings to put a
14209 * #GError on the wire. Regular applications should not use it.
14211 * Returns: A D-Bus error name (never %NULL). Free with g_free().
14217 * g_dbus_error_get_remote_error:
14218 * @error: A #GError.
14220 * Gets the D-Bus error name used for @error, if any.
14222 * This function is guaranteed to return a D-Bus error name for all
14223 * #GError<!-- -->s returned from functions handling remote method
14224 * calls (e.g. g_dbus_connection_call_finish()) unless
14225 * g_dbus_error_strip_remote_error() has been used on @error.
14227 * Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
14233 * g_dbus_error_is_remote_error:
14234 * @error: A #GError.
14236 * Checks if @error represents an error received via D-Bus from a remote peer. If so,
14237 * use g_dbus_error_get_remote_error() to get the name of the error.
14239 * Returns: %TRUE if @error represents an error from a remote peer, %FALSE otherwise.
14245 * g_dbus_error_new_for_dbus_error:
14246 * @dbus_error_name: D-Bus error name.
14247 * @dbus_error_message: D-Bus error message.
14249 * Creates a #GError based on the contents of @dbus_error_name and
14250 * @dbus_error_message.
14252 * Errors registered with g_dbus_error_register_error() will be looked
14253 * up using @dbus_error_name and if a match is found, the error domain
14254 * and code is used. Applications can use g_dbus_error_get_remote_error()
14255 * to recover @dbus_error_name.
14257 * If a match against a registered error is not found and the D-Bus
14258 * error name is in a form as returned by g_dbus_error_encode_gerror()
14259 * the error domain and code encoded in the name is used to
14260 * create the #GError. Also, @dbus_error_name is added to the error message
14261 * such that it can be recovered with g_dbus_error_get_remote_error().
14263 * Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
14264 * in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
14265 * added to the error message such that it can be recovered with
14266 * g_dbus_error_get_remote_error().
14268 * In all three cases, @dbus_error_name can always be recovered from the
14269 * returned #GError using the g_dbus_error_get_remote_error() function
14270 * (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
14272 * This function is typically only used in object mappings to prepare
14273 * #GError instances for applications. Regular applications should not use
14276 * Returns: An allocated #GError. Free with g_error_free().
14282 * g_dbus_error_register_error:
14283 * @error_domain: A #GQuark for a error domain.
14284 * @error_code: An error code.
14285 * @dbus_error_name: A D-Bus error name.
14287 * Creates an association to map between @dbus_error_name and
14288 * #GError<!-- -->s specified by @error_domain and @error_code.
14290 * This is typically done in the routine that returns the #GQuark for
14293 * Returns: %TRUE if the association was created, %FALSE if it already exists.
14299 * g_dbus_error_register_error_domain:
14300 * @error_domain_quark_name: The error domain name.
14301 * @quark_volatile: A pointer where to store the #GQuark.
14302 * @entries: A pointer to @num_entries #GDBusErrorEntry struct items.
14303 * @num_entries: Number of items to register.
14305 * Helper function for associating a #GError error domain with D-Bus error names.
14312 * g_dbus_error_set_dbus_error:
14313 * @error: A pointer to a #GError or %NULL.
14314 * @dbus_error_name: D-Bus error name.
14315 * @dbus_error_message: D-Bus error message.
14316 * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
14317 * @...: Arguments for @format.
14319 * Does nothing if @error is %NULL. Otherwise sets *@error to
14320 * a new #GError created with g_dbus_error_new_for_dbus_error()
14321 * with @dbus_error_message prepend with @format (unless %NULL).
14328 * g_dbus_error_set_dbus_error_valist:
14329 * @error: A pointer to a #GError or %NULL.
14330 * @dbus_error_name: D-Bus error name.
14331 * @dbus_error_message: D-Bus error message.
14332 * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
14333 * @var_args: Arguments for @format.
14335 * Like g_dbus_error_set_dbus_error() but intended for language bindings.
14342 * g_dbus_error_strip_remote_error:
14343 * @error: A #GError.
14345 * Looks for extra information in the error message used to recover
14346 * the D-Bus error name and strips it if found. If stripped, the
14347 * message field in @error will correspond exactly to what was
14348 * received on the wire.
14350 * This is typically used when presenting errors to the end user.
14352 * Returns: %TRUE if information was stripped, %FALSE otherwise.
14358 * g_dbus_error_unregister_error:
14359 * @error_domain: A #GQuark for a error domain.
14360 * @error_code: An error code.
14361 * @dbus_error_name: A D-Bus error name.
14363 * Destroys an association previously set up with g_dbus_error_register_error().
14365 * Returns: %TRUE if the association was destroyed, %FALSE if it wasn't found.
14371 * g_dbus_generate_guid:
14373 * Generate a D-Bus GUID that can be used with
14374 * e.g. g_dbus_connection_new().
14376 * See the D-Bus specification regarding what strings are valid D-Bus
14377 * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
14379 * Returns: A valid D-Bus GUID. Free with g_free().
14385 * g_dbus_gvalue_to_gvariant:
14386 * @gvalue: A #GValue to convert to a #GVariant.
14387 * @type: A #GVariantType.
14389 * Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
14391 * The conversion is using the following rules:
14392 * <table frame='all'>
14393 * <title>#GValue / #GVariant conversion rules</title>
14394 * <tgroup cols='2' align='left' colsep='1' rowsep='1'>
14397 * <entry>If the #GType for @gvalue is...</entry>
14398 * <entry>... then @type must be</entry>
14403 * <entry>#G_TYPE_STRING</entry>
14404 * <entry><link linkend="G-VARIANT-TYPE-STRING:CAPS">'s'</link>, <link linkend="G-VARIANT-TYPE-OBJECT-PATH:CAPS">'o'</link>, <link linkend="G-VARIANT-TYPE-SIGNATURE:CAPS">'g'</link> or <link linkend="G-VARIANT-TYPE-BYTESTRING:CAPS">'ay'</link></entry>
14407 * <entry>#G_TYPE_STRV</entry>
14408 * <entry><link linkend="G-VARIANT-TYPE-STRING-ARRAY:CAPS">'as'</link>, <link linkend="G-VARIANT-TYPE-OBJECT-PATH-ARRAY:CAPS">'ao'</link> or <link linkend="G-VARIANT-TYPE-BYTESTRING-ARRAY:CAPS">'aay'</link></entry>
14411 * <entry>#G_TYPE_BOOLEAN</entry>
14412 * <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
14415 * <entry>#G_TYPE_UCHAR</entry>
14416 * <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
14419 * <entry>#G_TYPE_INT</entry>
14420 * <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
14423 * <entry>#G_TYPE_UINT</entry>
14424 * <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
14427 * <entry>#G_TYPE_INT64</entry>
14428 * <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
14431 * <entry>#G_TYPE_UINT64</entry>
14432 * <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
14435 * <entry>#G_TYPE_DOUBLE</entry>
14436 * <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
14439 * <entry>#G_TYPE_VARIANT</entry>
14440 * <entry>Any #GVariantType</entry>
14445 * This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
14446 * is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
14447 * also fail for any #GType (including e.g. #G_TYPE_OBJECT and
14448 * #G_TYPE_BOXED derived-types) not in the table above.
14450 * Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
14451 * %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
14452 * %NULL) for @type is returned (e.g. 0 for scalar types, the empty
14453 * string for string types, <literal>'/'</literal> for object path
14454 * types, the empty array for any array type and so on).
14456 * See the g_dbus_gvariant_to_gvalue() function for how to convert a
14457 * #GVariant to a #GValue.
14459 * Returns: A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or %NULL in case of failure. Free with g_variant_unref().
14465 * g_dbus_gvariant_to_gvalue:
14466 * @value: A #GVariant.
14467 * @out_gvalue: (out): Return location pointing to a zero-filled (uninitialized) #GValue.
14469 * Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
14471 * The rules specified in the g_dbus_gvalue_to_gvariant() function are
14472 * used - this function is essentially its reverse form.
14474 * The conversion never fails - a valid #GValue is always returned in
14482 * g_dbus_interface_dup_object:
14483 * @interface_: An exported D-Bus interface.
14485 * Gets the #GDBusObject that @interface_ belongs to, if any.
14487 * Returns: (transfer full): A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
14489 * Rename to: g_dbus_interface_get_object
14494 * g_dbus_interface_get_info:
14495 * @interface_: An exported D-Bus interface.
14497 * Gets D-Bus introspection information for the D-Bus interface
14498 * implemented by @interface_.
14500 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
14506 * g_dbus_interface_get_object: (skip)
14507 * @interface_: An exported D-Bus interface.
14509 * Gets the #GDBusObject that @interface_ belongs to, if any.
14511 * <warning>It is not safe to use the returned object if @interface_
14512 * or the returned object is being used from other threads. See
14513 * g_dbus_interface_dup_object() for a thread-safe
14514 * alternative.</warning>
14516 * Returns: (transfer none): A #GDBusObject or %NULL. The returned reference belongs to @interface_ and should not be freed.
14522 * g_dbus_interface_info_cache_build:
14523 * @info: A #GDBusInterfaceInfo.
14525 * Builds a lookup-cache to speed up
14526 * g_dbus_interface_info_lookup_method(),
14527 * g_dbus_interface_info_lookup_signal() and
14528 * g_dbus_interface_info_lookup_property().
14530 * If this has already been called with @info, the existing cache is
14531 * used and its use count is increased.
14533 * Note that @info cannot be modified until
14534 * g_dbus_interface_info_cache_release() is called.
14541 * g_dbus_interface_info_cache_release:
14542 * @info: A GDBusInterfaceInfo
14544 * Decrements the usage count for the cache for @info built by
14545 * g_dbus_interface_info_cache_build() (if any) and frees the
14546 * resources used by the cache if the usage count drops to zero.
14553 * g_dbus_interface_info_generate_xml:
14554 * @info: A #GDBusNodeInfo
14555 * @indent: Indentation level.
14556 * @string_builder: (out): A #GString to to append XML data to.
14558 * Appends an XML representation of @info (and its children) to @string_builder.
14560 * This function is typically used for generating introspection XML
14561 * documents at run-time for handling the
14562 * <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
14570 * g_dbus_interface_info_lookup_method:
14571 * @info: A #GDBusInterfaceInfo.
14572 * @name: A D-Bus method name (typically in CamelCase)
14574 * Looks up information about a method.
14576 * This cost of this function is O(n) in number of methods unless
14577 * g_dbus_interface_info_cache_build() has been used on @info.
14579 * Returns: (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
14585 * g_dbus_interface_info_lookup_property:
14586 * @info: A #GDBusInterfaceInfo.
14587 * @name: A D-Bus property name (typically in CamelCase).
14589 * Looks up information about a property.
14591 * This cost of this function is O(n) in number of properties unless
14592 * g_dbus_interface_info_cache_build() has been used on @info.
14594 * Returns: (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
14600 * g_dbus_interface_info_lookup_signal:
14601 * @info: A #GDBusInterfaceInfo.
14602 * @name: A D-Bus signal name (typically in CamelCase)
14604 * Looks up information about a signal.
14606 * This cost of this function is O(n) in number of signals unless
14607 * g_dbus_interface_info_cache_build() has been used on @info.
14609 * Returns: (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
14615 * g_dbus_interface_info_ref:
14616 * @info: A #GDBusInterfaceInfo
14618 * If @info is statically allocated does nothing. Otherwise increases
14619 * the reference count.
14621 * Returns: The same @info.
14627 * g_dbus_interface_info_unref:
14628 * @info: A #GDBusInterfaceInfo.
14630 * If @info is statically allocated, does nothing. Otherwise decreases
14631 * the reference count of @info. When its reference count drops to 0,
14632 * the memory used is freed.
14639 * g_dbus_interface_set_object:
14640 * @interface_: An exported D-Bus interface.
14641 * @object: (allow-none): A #GDBusObject or %NULL.
14643 * Sets the #GDBusObject for @interface_ to @object.
14645 * Note that @interface_ will hold a weak reference to @object.
14652 * g_dbus_interface_skeleton_export:
14653 * @interface_: The D-Bus interface to export.
14654 * @connection: A #GDBusConnection to export @interface_ on.
14655 * @object_path: The path to export the interface at.
14656 * @error: Return location for error or %NULL.
14658 * Exports @interface_ at @object_path on @connection.
14660 * This can be called multiple times to export the same @interface_
14661 * onto multiple connections however the @object_path provided must be
14662 * the same for all connections.
14664 * Use g_dbus_interface_skeleton_unexport() to unexport the object.
14666 * Returns: %TRUE if the interface was exported on @connection, otherwise %FALSE with @error set.
14672 * g_dbus_interface_skeleton_flush:
14673 * @interface_: A #GDBusInterfaceSkeleton.
14675 * If @interface_ has outstanding changes, request for these changes to be
14676 * emitted immediately.
14678 * For example, an exported D-Bus interface may queue up property
14679 * changes and emit the
14680 * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
14681 * signal later (e.g. in an idle handler). This technique is useful
14682 * for collapsing multiple property changes into one.
14689 * g_dbus_interface_skeleton_get_connection:
14690 * @interface_: A #GDBusInterfaceSkeleton.
14692 * Gets the first connection that @interface_ is exported on, if any.
14694 * Returns: (transfer none): A #GDBusConnection or %NULL if @interface_ is not exported anywhere. Do not free, the object belongs to @interface_.
14700 * g_dbus_interface_skeleton_get_connections:
14701 * @interface_: A #GDBusInterfaceSkeleton.
14703 * Gets a list of the connections that @interface_ is exported on.
14705 * Returns: (element-type GDBusConnection) (transfer full): A list of all the connections that @interface_ is exported on. The returned list should be freed with g_list_free() after each element has been freed with g_object_unref().
14711 * g_dbus_interface_skeleton_get_flags:
14712 * @interface_: A #GDBusInterfaceSkeleton.
14714 * Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
14717 * Returns: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
14723 * g_dbus_interface_skeleton_get_info:
14724 * @interface_: A #GDBusInterfaceSkeleton.
14726 * Gets D-Bus introspection information for the D-Bus interface
14727 * implemented by @interface_.
14729 * Returns: (transfer none): A #GDBusInterfaceInfo (never %NULL). Do not free.
14735 * g_dbus_interface_skeleton_get_object_path:
14736 * @interface_: A #GDBusInterfaceSkeleton.
14738 * Gets the object path that @interface_ is exported on, if any.
14740 * Returns: A string owned by @interface_ or %NULL if @interface_ is not exported anywhere. Do not free, the string belongs to @interface_.
14746 * g_dbus_interface_skeleton_get_properties:
14747 * @interface_: A #GDBusInterfaceSkeleton.
14749 * Gets all D-Bus properties for @interface_.
14751 * Returns: (transfer full): A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
14757 * g_dbus_interface_skeleton_get_vtable: (skip)
14758 * @interface_: A #GDBusInterfaceSkeleton.
14760 * Gets the interface vtable for the D-Bus interface implemented by
14761 * @interface_. The returned function pointers should expect @interface_
14762 * itself to be passed as @user_data.
14764 * Returns: A #GDBusInterfaceVTable (never %NULL).
14770 * g_dbus_interface_skeleton_has_connection:
14771 * @interface_: A #GDBusInterfaceSkeleton.
14772 * @connection: A #GDBusConnection.
14774 * Checks if @interface_ is exported on @connection.
14776 * Returns: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
14782 * g_dbus_interface_skeleton_set_flags:
14783 * @interface_: A #GDBusInterfaceSkeleton.
14784 * @flags: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
14786 * Sets flags describing what the behavior of @skeleton should be.
14793 * g_dbus_interface_skeleton_unexport:
14794 * @interface_: A #GDBusInterfaceSkeleton.
14796 * Stops exporting @interface_ on all connections it is exported on.
14798 * To unexport @interface_ from only a single connection, use
14799 * g_dbus_interface_skeleton_unexport_from_connection()
14806 * g_dbus_interface_skeleton_unexport_from_connection:
14807 * @interface_: A #GDBusInterfaceSkeleton.
14808 * @connection: A #GDBusConnection.
14810 * Stops exporting @interface_ on @connection.
14812 * To stop exporting on all connections the interface is exported on,
14813 * use g_dbus_interface_skeleton_unexport().
14820 * g_dbus_is_address:
14821 * @string: A string.
14823 * Checks if @string is a D-Bus address.
14825 * This doesn't check if @string is actually supported by #GDBusServer
14826 * or #GDBusConnection - use g_dbus_is_supported_address() to do more
14829 * Returns: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
14836 * @string: The string to check.
14838 * Checks if @string is a D-Bus GUID.
14840 * See the D-Bus specification regarding what strings are valid D-Bus
14841 * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
14843 * Returns: %TRUE if @string is a guid, %FALSE otherwise.
14849 * g_dbus_is_interface_name:
14850 * @string: The string to check.
14852 * Checks if @string is a valid D-Bus interface name.
14854 * Returns: %TRUE if valid, %FALSE otherwise.
14860 * g_dbus_is_member_name:
14861 * @string: The string to check.
14863 * Checks if @string is a valid D-Bus member (e.g. signal or method) name.
14865 * Returns: %TRUE if valid, %FALSE otherwise.
14872 * @string: The string to check.
14874 * Checks if @string is a valid D-Bus bus name (either unique or well-known).
14876 * Returns: %TRUE if valid, %FALSE otherwise.
14882 * g_dbus_is_supported_address:
14883 * @string: A string.
14884 * @error: Return location for error or %NULL.
14886 * Like g_dbus_is_address() but also checks if the library suppors the
14887 * transports in @string and that key/value pairs for each transport
14890 * Returns: %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set.
14896 * g_dbus_is_unique_name:
14897 * @string: The string to check.
14899 * Checks if @string is a valid D-Bus unique bus name.
14901 * Returns: %TRUE if valid, %FALSE otherwise.
14907 * g_dbus_menu_model_get:
14908 * @connection: a #GDBusConnection
14909 * @bus_name: the bus name which exports the menu model
14910 * @object_path: the object path at which the menu model is exported
14912 * Obtains a #GDBusMenuModel for the menu model which is exported
14913 * at the given @bus_name and @object_path.
14915 * The thread default main context is taken at the time of this call.
14916 * All signals on the menu model (and any linked models) are reported
14917 * with respect to this context. All calls on the returned menu model
14918 * (and linked models) must also originate from this same context, with
14919 * the thread default main context unchanged.
14921 * Returns: (transfer full): a #GDBusMenuModel object. Free with g_object_unref().
14927 * g_dbus_message_bytes_needed:
14928 * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14929 * @blob_len: The length of @blob (must be at least 16).
14930 * @error: Return location for error or %NULL.
14932 * Utility function to calculate how many bytes are needed to
14933 * completely deserialize the D-Bus message stored at @blob.
14935 * Returns: Number of bytes needed or -1 if @error is set (e.g. if @blob contains invalid data or not enough data is available to determine the size).
14941 * g_dbus_message_copy:
14942 * @message: A #GDBusMessage.
14943 * @error: Return location for error or %NULL.
14945 * Copies @message. The copy is a deep copy and the returned
14946 * #GDBusMessage is completely identical except that it is guaranteed
14947 * to not be locked.
14949 * This operation can fail if e.g. @message contains file descriptors
14950 * and the per-process or system-wide open files limit is reached.
14952 * Returns: (transfer full): A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14958 * g_dbus_message_get_arg0:
14959 * @message: A #GDBusMessage.
14961 * Convenience to get the first item in the body of @message.
14963 * Returns: The string item or %NULL if the first item in the body of @message is not a string.
14969 * g_dbus_message_get_body:
14970 * @message: A #GDBusMessage.
14972 * Gets the body of a message.
14974 * Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
14980 * g_dbus_message_get_byte_order:
14981 * @message: A #GDBusMessage.
14983 * Gets the byte order of @message.
14985 * Returns: The byte order.
14990 * g_dbus_message_get_destination:
14991 * @message: A #GDBusMessage.
14993 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14995 * Returns: The value.
15001 * g_dbus_message_get_error_name:
15002 * @message: A #GDBusMessage.
15004 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
15006 * Returns: The value.
15012 * g_dbus_message_get_flags:
15013 * @message: A #GDBusMessage.
15015 * Gets the flags for @message.
15017 * Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
15023 * g_dbus_message_get_header:
15024 * @message: A #GDBusMessage.
15025 * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
15027 * Gets a header field on @message.
15029 * Returns: A #GVariant with the value if the header was found, %NULL otherwise. Do not free, it is owned by @message.
15035 * g_dbus_message_get_header_fields:
15036 * @message: A #GDBusMessage.
15038 * Gets an array of all header fields on @message that are set.
15040 * Returns: (array zero-terminated=1): An array of header fields terminated by %G_DBUS_MESSAGE_HEADER_FIELD_INVALID. Each element is a #guchar. Free with g_free().
15046 * g_dbus_message_get_interface:
15047 * @message: A #GDBusMessage.
15049 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
15051 * Returns: The value.
15057 * g_dbus_message_get_locked:
15058 * @message: A #GDBusMessage.
15060 * Checks whether @message is locked. To monitor changes to this
15061 * value, conncet to the #GObject::notify signal to listen for changes
15062 * on the #GDBusMessage:locked property.
15064 * Returns: %TRUE if @message is locked, %FALSE otherwise.
15070 * g_dbus_message_get_member:
15071 * @message: A #GDBusMessage.
15073 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
15075 * Returns: The value.
15081 * g_dbus_message_get_message_type:
15082 * @message: A #GDBusMessage.
15084 * Gets the type of @message.
15086 * Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
15092 * g_dbus_message_get_num_unix_fds:
15093 * @message: A #GDBusMessage.
15095 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
15097 * Returns: The value.
15103 * g_dbus_message_get_path:
15104 * @message: A #GDBusMessage.
15106 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
15108 * Returns: The value.
15114 * g_dbus_message_get_reply_serial:
15115 * @message: A #GDBusMessage.
15117 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
15119 * Returns: The value.
15125 * g_dbus_message_get_sender:
15126 * @message: A #GDBusMessage.
15128 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
15130 * Returns: The value.
15136 * g_dbus_message_get_serial:
15137 * @message: A #GDBusMessage.
15139 * Gets the serial for @message.
15141 * Returns: A #guint32.
15147 * g_dbus_message_get_signature:
15148 * @message: A #GDBusMessage.
15150 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
15152 * Returns: The value.
15158 * g_dbus_message_get_unix_fd_list:
15159 * @message: A #GDBusMessage.
15161 * Gets the UNIX file descriptors associated with @message, if any.
15163 * This method is only available on UNIX.
15165 * Returns: (transfer none): A #GUnixFDList or %NULL if no file descriptors are associated. Do not free, this object is owned by @message.
15171 * g_dbus_message_lock:
15172 * @message: A #GDBusMessage.
15174 * If @message is locked, does nothing. Otherwise locks the message.
15181 * g_dbus_message_new:
15183 * Creates a new empty #GDBusMessage.
15185 * Returns: A #GDBusMessage. Free with g_object_unref().
15191 * g_dbus_message_new_from_blob:
15192 * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
15193 * @blob_len: The length of @blob.
15194 * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
15195 * @error: Return location for error or %NULL.
15197 * Creates a new #GDBusMessage from the data stored at @blob. The byte
15198 * order that the message was in can be retrieved using
15199 * g_dbus_message_get_byte_order().
15201 * Returns: A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
15207 * g_dbus_message_new_method_call:
15208 * @name: (allow-none): A valid D-Bus name or %NULL.
15209 * @path: A valid object path.
15210 * @interface_: (allow-none): A valid D-Bus interface name or %NULL.
15211 * @method: A valid method name.
15213 * Creates a new #GDBusMessage for a method call.
15215 * Returns: A #GDBusMessage. Free with g_object_unref().
15221 * g_dbus_message_new_method_error:
15222 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
15223 * @error_name: A valid D-Bus error name.
15224 * @error_message_format: The D-Bus error message in a printf() format.
15225 * @...: Arguments for @error_message_format.
15227 * Creates a new #GDBusMessage that is an error reply to @method_call_message.
15229 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
15235 * g_dbus_message_new_method_error_literal:
15236 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
15237 * @error_name: A valid D-Bus error name.
15238 * @error_message: The D-Bus error message.
15240 * Creates a new #GDBusMessage that is an error reply to @method_call_message.
15242 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
15248 * g_dbus_message_new_method_error_valist:
15249 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
15250 * @error_name: A valid D-Bus error name.
15251 * @error_message_format: The D-Bus error message in a printf() format.
15252 * @var_args: Arguments for @error_message_format.
15254 * Like g_dbus_message_new_method_error() but intended for language bindings.
15256 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
15262 * g_dbus_message_new_method_reply:
15263 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
15265 * Creates a new #GDBusMessage that is a reply to @method_call_message.
15267 * Returns: (transfer full): #GDBusMessage. Free with g_object_unref().
15273 * g_dbus_message_new_signal:
15274 * @path: A valid object path.
15275 * @interface_: A valid D-Bus interface name.
15276 * @signal: A valid signal name.
15278 * Creates a new #GDBusMessage for a signal emission.
15280 * Returns: A #GDBusMessage. Free with g_object_unref().
15286 * g_dbus_message_print:
15287 * @message: A #GDBusMessage.
15288 * @indent: Indentation level.
15290 * Produces a human-readable multi-line description of @message.
15292 * The contents of the description has no ABI guarantees, the contents
15293 * and formatting is subject to change at any time. Typical output
15294 * looks something like this:
15296 * Type: method-call
15297 * Flags: none
15301 * path -> objectpath '/org/gtk/GDBus/TestObject'
15302 * interface -> 'org.gtk.GDBus.TestInterface'
15303 * member -> 'GimmeStdout'
15304 * destination -> ':1.146'
15306 * UNIX File Descriptors:
15308 * </programlisting>
15311 * Type: method-return
15312 * Flags: no-reply-expected
15314 * Serial: 477
15316 * reply-serial -> uint32 4
15317 * destination -> ':1.159'
15318 * sender -> ':1.146'
15319 * num-unix-fds -> uint32 1
15321 * UNIX File Descriptors:
15322 * fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
15323 * </programlisting>
15325 * Returns: A string that should be freed with g_free().
15331 * g_dbus_message_set_body:
15332 * @message: A #GDBusMessage.
15333 * @body: Either %NULL or a #GVariant that is a tuple.
15335 * Sets the body @message. As a side-effect the
15336 * %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
15337 * type string of @body (or cleared if @body is %NULL).
15339 * If @body is floating, @message assumes ownership of @body.
15346 * g_dbus_message_set_byte_order:
15347 * @message: A #GDBusMessage.
15348 * @byte_order: The byte order.
15350 * Sets the byte order of @message.
15355 * g_dbus_message_set_destination:
15356 * @message: A #GDBusMessage.
15357 * @value: The value to set.
15359 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
15366 * g_dbus_message_set_error_name:
15367 * @message: A #GDBusMessage.
15368 * @value: The value to set.
15370 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
15377 * g_dbus_message_set_flags:
15378 * @message: A #GDBusMessage.
15379 * @flags: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
15381 * Sets the flags to set on @message.
15388 * g_dbus_message_set_header:
15389 * @message: A #GDBusMessage.
15390 * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
15391 * @value: (allow-none): A #GVariant to set the header field or %NULL to clear the header field.
15393 * Sets a header field on @message.
15395 * If @value is floating, @message assumes ownership of @value.
15402 * g_dbus_message_set_interface:
15403 * @message: A #GDBusMessage.
15404 * @value: The value to set.
15406 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
15413 * g_dbus_message_set_member:
15414 * @message: A #GDBusMessage.
15415 * @value: The value to set.
15417 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
15424 * g_dbus_message_set_message_type:
15425 * @message: A #GDBusMessage.
15426 * @type: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
15428 * Sets @message to be of @type.
15435 * g_dbus_message_set_num_unix_fds:
15436 * @message: A #GDBusMessage.
15437 * @value: The value to set.
15439 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
15446 * g_dbus_message_set_path:
15447 * @message: A #GDBusMessage.
15448 * @value: The value to set.
15450 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
15457 * g_dbus_message_set_reply_serial:
15458 * @message: A #GDBusMessage.
15459 * @value: The value to set.
15461 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
15468 * g_dbus_message_set_sender:
15469 * @message: A #GDBusMessage.
15470 * @value: The value to set.
15472 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
15479 * g_dbus_message_set_serial:
15480 * @message: A #GDBusMessage.
15481 * @serial: A #guint32.
15483 * Sets the serial for @message.
15490 * g_dbus_message_set_signature:
15491 * @message: A #GDBusMessage.
15492 * @value: The value to set.
15494 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
15501 * g_dbus_message_set_unix_fd_list:
15502 * @message: A #GDBusMessage.
15503 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15505 * Sets the UNIX file descriptors associated with @message. As a
15506 * side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
15507 * field is set to the number of fds in @fd_list (or cleared if
15508 * @fd_list is %NULL).
15510 * This method is only available on UNIX.
15517 * g_dbus_message_to_blob:
15518 * @message: A #GDBusMessage.
15519 * @out_size: Return location for size of generated blob.
15520 * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
15521 * @error: Return location for error.
15523 * Serializes @message to a blob. The byte order returned by
15524 * g_dbus_message_get_byte_order() will be used.
15526 * Returns: (array length=out_size) (transfer full): A pointer to a valid binary D-Bus message of @out_size bytes generated by @message or %NULL if @error is set. Free with g_free().
15532 * g_dbus_message_to_gerror:
15533 * @message: A #GDBusMessage.
15534 * @error: The #GError to set.
15536 * If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
15537 * nothing and returns %FALSE.
15539 * Otherwise this method encodes the error in @message as a #GError
15540 * using g_dbus_error_set_dbus_error() using the information in the
15541 * %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
15542 * well as the first string item in @message's body.
15544 * Returns: %TRUE if @error was set, %FALSE otherwise.
15550 * g_dbus_method_info_ref:
15551 * @info: A #GDBusMethodInfo
15553 * If @info is statically allocated does nothing. Otherwise increases
15554 * the reference count.
15556 * Returns: The same @info.
15562 * g_dbus_method_info_unref:
15563 * @info: A #GDBusMethodInfo.
15565 * If @info is statically allocated, does nothing. Otherwise decreases
15566 * the reference count of @info. When its reference count drops to 0,
15567 * the memory used is freed.
15574 * g_dbus_method_invocation_get_connection:
15575 * @invocation: A #GDBusMethodInvocation.
15577 * Gets the #GDBusConnection the method was invoked on.
15579 * Returns: (transfer none): A #GDBusConnection. Do not free, it is owned by @invocation.
15585 * g_dbus_method_invocation_get_interface_name:
15586 * @invocation: A #GDBusMethodInvocation.
15588 * Gets the name of the D-Bus interface the method was invoked on.
15590 * Returns: A string. Do not free, it is owned by @invocation.
15596 * g_dbus_method_invocation_get_message:
15597 * @invocation: A #GDBusMethodInvocation.
15599 * Gets the #GDBusMessage for the method invocation. This is useful if
15600 * you need to use low-level protocol features, such as UNIX file
15601 * descriptor passing, that cannot be properly expressed in the
15604 * See <xref linkend="gdbus-server"/> and <xref
15605 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
15606 * low-level API to send and receive UNIX file descriptors.
15608 * Returns: (transfer none): #GDBusMessage. Do not free, it is owned by @invocation.
15614 * g_dbus_method_invocation_get_method_info:
15615 * @invocation: A #GDBusMethodInvocation.
15617 * Gets information about the method call, if any.
15619 * Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
15625 * g_dbus_method_invocation_get_method_name:
15626 * @invocation: A #GDBusMethodInvocation.
15628 * Gets the name of the method that was invoked.
15630 * Returns: A string. Do not free, it is owned by @invocation.
15636 * g_dbus_method_invocation_get_object_path:
15637 * @invocation: A #GDBusMethodInvocation.
15639 * Gets the object path the method was invoked on.
15641 * Returns: A string. Do not free, it is owned by @invocation.
15647 * g_dbus_method_invocation_get_parameters:
15648 * @invocation: A #GDBusMethodInvocation.
15650 * Gets the parameters of the method invocation. If there are no input
15651 * parameters then this will return a GVariant with 0 children rather than NULL.
15653 * Returns: (transfer none): A #GVariant tuple. Do not unref this because it is owned by @invocation.
15659 * g_dbus_method_invocation_get_sender:
15660 * @invocation: A #GDBusMethodInvocation.
15662 * Gets the bus name that invoked the method.
15664 * Returns: A string. Do not free, it is owned by @invocation.
15670 * g_dbus_method_invocation_get_user_data: (skip)
15671 * @invocation: A #GDBusMethodInvocation.
15673 * Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
15675 * Returns: A #gpointer.
15681 * g_dbus_method_invocation_return_dbus_error:
15682 * @invocation: (transfer full): A #GDBusMethodInvocation.
15683 * @error_name: A valid D-Bus error name.
15684 * @error_message: A valid D-Bus error message.
15686 * Finishes handling a D-Bus method call by returning an error.
15688 * This method will free @invocation, you cannot use it afterwards.
15695 * g_dbus_method_invocation_return_error:
15696 * @invocation: (transfer full): A #GDBusMethodInvocation.
15697 * @domain: A #GQuark for the #GError error domain.
15698 * @code: The error code.
15699 * @format: printf()-style format.
15700 * @...: Parameters for @format.
15702 * Finishes handling a D-Bus method call by returning an error.
15704 * See g_dbus_error_encode_gerror() for details about what error name
15705 * will be returned on the wire. In a nutshell, if the given error is
15706 * registered using g_dbus_error_register_error() the name given
15707 * during registration is used. Otherwise, a name of the form
15708 * <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
15709 * used. This provides transparent mapping of #GError between
15710 * applications using GDBus.
15712 * If you are writing an application intended to be portable,
15713 * <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
15714 * or use g_dbus_method_invocation_return_dbus_error().
15716 * This method will free @invocation, you cannot use it afterwards.
15723 * g_dbus_method_invocation_return_error_literal:
15724 * @invocation: (transfer full): A #GDBusMethodInvocation.
15725 * @domain: A #GQuark for the #GError error domain.
15726 * @code: The error code.
15727 * @message: The error message.
15729 * Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
15731 * This method will free @invocation, you cannot use it afterwards.
15738 * g_dbus_method_invocation_return_error_valist:
15739 * @invocation: (transfer full): A #GDBusMethodInvocation.
15740 * @domain: A #GQuark for the #GError error domain.
15741 * @code: The error code.
15742 * @format: printf()-style format.
15743 * @var_args: #va_list of parameters for @format.
15745 * Like g_dbus_method_invocation_return_error() but intended for
15746 * language bindings.
15748 * This method will free @invocation, you cannot use it afterwards.
15755 * g_dbus_method_invocation_return_gerror:
15756 * @invocation: (transfer full): A #GDBusMethodInvocation.
15757 * @error: A #GError.
15759 * Like g_dbus_method_invocation_return_error() but takes a #GError
15760 * instead of the error domain, error code and message.
15762 * This method will free @invocation, you cannot use it afterwards.
15769 * g_dbus_method_invocation_return_value:
15770 * @invocation: (transfer full): A #GDBusMethodInvocation.
15771 * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15773 * Finishes handling a D-Bus method call by returning @parameters.
15774 * If the @parameters GVariant is floating, it is consumed.
15776 * It is an error if @parameters is not of the right format.
15778 * This method will free @invocation, you cannot use it afterwards.
15785 * g_dbus_method_invocation_return_value_with_unix_fd_list:
15786 * @invocation: (transfer full): A #GDBusMethodInvocation.
15787 * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15788 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15790 * Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
15792 * This method is only available on UNIX.
15794 * This method will free @invocation, you cannot use it afterwards.
15801 * g_dbus_method_invocation_take_error: (skip)
15802 * @invocation: (transfer full): A #GDBusMethodInvocation.
15803 * @error: (transfer full): A #GError.
15805 * Like g_dbus_method_invocation_return_gerror() but takes ownership
15806 * of @error so the caller does not need to free it.
15808 * This method will free @invocation, you cannot use it afterwards.
15815 * g_dbus_node_info_generate_xml:
15816 * @info: A #GDBusNodeInfo.
15817 * @indent: Indentation level.
15818 * @string_builder: (out): A #GString to to append XML data to.
15820 * Appends an XML representation of @info (and its children) to @string_builder.
15822 * This function is typically used for generating introspection XML documents at run-time for
15823 * handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
15830 * g_dbus_node_info_lookup_interface:
15831 * @info: A #GDBusNodeInfo.
15832 * @name: A D-Bus interface name.
15834 * Looks up information about an interface.
15836 * This cost of this function is O(n) in number of interfaces.
15838 * Returns: (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
15844 * g_dbus_node_info_new_for_xml:
15845 * @xml_data: Valid D-Bus introspection XML.
15846 * @error: Return location for error.
15848 * Parses @xml_data and returns a #GDBusNodeInfo representing the data.
15850 * The introspection XML must contain exactly one top-level
15851 * <tag class="starttag">node</tag> element.
15853 * Note that this routine is using a
15854 * <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
15855 * parser that only accepts a subset of valid XML documents.
15857 * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free with g_dbus_node_info_unref().
15863 * g_dbus_node_info_ref:
15864 * @info: A #GDBusNodeInfo
15866 * If @info is statically allocated does nothing. Otherwise increases
15867 * the reference count.
15869 * Returns: The same @info.
15875 * g_dbus_node_info_unref:
15876 * @info: A #GDBusNodeInfo.
15878 * If @info is statically allocated, does nothing. Otherwise decreases
15879 * the reference count of @info. When its reference count drops to 0,
15880 * the memory used is freed.
15887 * g_dbus_object_get_interface:
15888 * @object: A #GDBusObject.
15889 * @interface_name: A D-Bus interface name.
15891 * Gets the D-Bus interface with name @interface_name associated with
15894 * Returns: (transfer full): %NULL if not found, otherwise a #GDBusInterface that must be freed with g_object_unref().
15900 * g_dbus_object_get_interfaces:
15901 * @object: A #GDBusObject.
15903 * Gets the D-Bus interfaces associated with @object.
15905 * Returns: (element-type GDBusInterface) (transfer full): A list of #GDBusInterface instances. The returned list must be freed by g_list_free() after each element has been freed with g_object_unref().
15911 * g_dbus_object_get_object_path:
15912 * @object: A #GDBusObject.
15914 * Gets the object path for @object.
15916 * Returns: A string owned by @object. Do not free.
15922 * g_dbus_object_manager_client_get_connection:
15923 * @manager: A #GDBusObjectManagerClient
15925 * Gets the #GDBusConnection used by @manager.
15927 * Returns: (transfer none): A #GDBusConnection object. Do not free, the object belongs to @manager.
15933 * g_dbus_object_manager_client_get_flags:
15934 * @manager: A #GDBusObjectManagerClient
15936 * Gets the flags that @manager was constructed with.
15938 * Returns: Zero of more flags from the #GDBusObjectManagerClientFlags enumeration.
15944 * g_dbus_object_manager_client_get_name:
15945 * @manager: A #GDBusObjectManagerClient
15947 * Gets the name that @manager is for.
15949 * Returns: A unique or well-known name. Do not free, the string belongs to @manager.
15955 * g_dbus_object_manager_client_get_name_owner:
15956 * @manager: A #GDBusObjectManagerClient.
15958 * The unique name that owns the name that @manager is for or %NULL if
15959 * no-one currently owns that name. You can connect to the
15960 * #GObject::notify signal to track changes to the
15961 * #GDBusObjectManagerClient:name-owner property.
15963 * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15969 * g_dbus_object_manager_client_new:
15970 * @connection: A #GDBusConnection.
15971 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15972 * @name: The owner of the control object (unique or well-known name).
15973 * @object_path: The object path of the control object.
15974 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15975 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15976 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15977 * @cancellable: (allow-none): A #GCancellable or %NULL
15978 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15979 * @user_data: The data to pass to @callback.
15981 * Asynchronously creates a new #GDBusObjectManagerClient object.
15983 * This is an asynchronous failable constructor. When the result is
15984 * ready, @callback will be invoked in the
15985 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15986 * of the thread you are calling this method from. You can
15987 * then call g_dbus_object_manager_client_new_finish() to get the result. See
15988 * g_dbus_object_manager_client_new_sync() for the synchronous version.
15995 * g_dbus_object_manager_client_new_finish:
15996 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
15997 * @error: Return location for error or %NULL.
15999 * Finishes an operation started with g_dbus_object_manager_client_new().
16001 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
16007 * g_dbus_object_manager_client_new_for_bus:
16008 * @bus_type: A #GBusType.
16009 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
16010 * @name: The owner of the control object (unique or well-known name).
16011 * @object_path: The object path of the control object.
16012 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
16013 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
16014 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
16015 * @cancellable: (allow-none): A #GCancellable or %NULL
16016 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
16017 * @user_data: The data to pass to @callback.
16019 * Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
16020 * #GDBusConnection.
16022 * This is an asynchronous failable constructor. When the result is
16023 * ready, @callback will be invoked in the
16024 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
16025 * of the thread you are calling this method from. You can
16026 * then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
16027 * g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
16034 * g_dbus_object_manager_client_new_for_bus_finish:
16035 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
16036 * @error: Return location for error or %NULL.
16038 * Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
16040 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
16046 * g_dbus_object_manager_client_new_for_bus_sync:
16047 * @bus_type: A #GBusType.
16048 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
16049 * @name: The owner of the control object (unique or well-known name).
16050 * @object_path: The object path of the control object.
16051 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
16052 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
16053 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
16054 * @cancellable: (allow-none): A #GCancellable or %NULL
16055 * @error: Return location for error or %NULL.
16057 * Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
16058 * of a #GDBusConnection.
16060 * This is a synchronous failable constructor - the calling thread is
16061 * blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
16062 * for the asynchronous version.
16064 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
16070 * g_dbus_object_manager_client_new_sync:
16071 * @connection: A #GDBusConnection.
16072 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
16073 * @name: The owner of the control object (unique or well-known name).
16074 * @object_path: The object path of the control object.
16075 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
16076 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
16077 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
16078 * @cancellable: (allow-none): A #GCancellable or %NULL
16079 * @error: Return location for error or %NULL.
16081 * Creates a new #GDBusObjectManagerClient object.
16083 * This is a synchronous failable constructor - the calling thread is
16084 * blocked until a reply is received. See g_dbus_object_manager_client_new()
16085 * for the asynchronous version.
16087 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
16093 * g_dbus_object_manager_get_interface:
16094 * @manager: A #GDBusObjectManager.
16095 * @object_path: Object path to lookup.
16096 * @interface_name: D-Bus interface name to lookup.
16098 * Gets the interface proxy for @interface_name at @object_path, if
16101 * Returns: (transfer full): A #GDBusInterface instance or %NULL. Free with g_object_unref().
16107 * g_dbus_object_manager_get_object:
16108 * @manager: A #GDBusObjectManager.
16109 * @object_path: Object path to lookup.
16111 * Gets the #GDBusObjectProxy at @object_path, if any.
16113 * Returns: (transfer full): A #GDBusObject or %NULL. Free with g_object_unref().
16119 * g_dbus_object_manager_get_object_path:
16120 * @manager: A #GDBusObjectManager.
16122 * Gets the object path that @manager is for.
16124 * Returns: A string owned by @manager. Do not free.
16130 * g_dbus_object_manager_get_objects:
16131 * @manager: A #GDBusObjectManager.
16133 * Gets all #GDBusObject objects known to @manager.
16135 * Returns: (transfer full) (element-type GDBusObject): A list of #GDBusObject objects. The returned list should be freed with g_list_free() after each element has been freed with g_object_unref().
16141 * g_dbus_object_manager_server_export:
16142 * @manager: A #GDBusObjectManagerServer.
16143 * @object: A #GDBusObjectSkeleton.
16145 * Exports @object on @manager.
16147 * If there is already a #GDBusObject exported at the object path,
16148 * then the old object is removed.
16150 * The object path for @object must be in the hierarchy rooted by the
16151 * object path for @manager.
16153 * Note that @manager will take a reference on @object for as long as
16161 * g_dbus_object_manager_server_export_uniquely:
16162 * @manager: A #GDBusObjectManagerServer.
16163 * @object: An object.
16165 * Like g_dbus_object_manager_server_export() but appends a string of
16166 * the form <literal>_N</literal> (with N being a natural number) to
16167 * @object<!-- -->'s object path if an object with the given path
16168 * already exists. As such, the #GDBusObjectProxy:g-object-path property
16169 * of @object may be modified.
16176 * g_dbus_object_manager_server_get_connection:
16177 * @manager: A #GDBusObjectManagerServer
16179 * Gets the #GDBusConnection used by @manager.
16181 * Returns: (transfer full): A #GDBusConnection object or %NULL if @manager isn't exported on a connection. The returned object should be freed with g_object_unref().
16187 * g_dbus_object_manager_server_is_exported:
16188 * @manager: A #GDBusObjectManagerServer.
16189 * @object: An object.
16191 * Returns whether @object is currently exported on @manager.
16193 * Returns: %TRUE if @object is exported
16199 * g_dbus_object_manager_server_new:
16200 * @object_path: The object path to export the manager object at.
16202 * Creates a new #GDBusObjectManagerServer object.
16204 * The returned server isn't yet exported on any connection. To do so,
16205 * use g_dbus_object_manager_server_set_connection(). Normally you
16206 * want to export all of your objects before doing so to avoid <ulink
16207 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
16208 * signals being emitted.
16210 * Returns: A #GDBusObjectManagerServer object. Free with g_object_unref().
16216 * g_dbus_object_manager_server_set_connection:
16217 * @manager: A #GDBusObjectManagerServer.
16218 * @connection: (allow-none): A #GDBusConnection or %NULL.
16220 * Exports all objects managed by @manager on @connection. If
16221 * @connection is %NULL, stops exporting objects.
16226 * g_dbus_object_manager_server_unexport:
16227 * @manager: A #GDBusObjectManagerServer.
16228 * @object_path: An object path.
16230 * If @manager has an object at @path, removes the object. Otherwise
16233 * Note that @object_path must be in the hierarchy rooted by the
16234 * object path for @manager.
16236 * Returns: %TRUE if object at @object_path was removed, %FALSE otherwise.
16242 * g_dbus_object_proxy_get_connection:
16243 * @proxy: a #GDBusObjectProxy
16245 * Gets the connection that @proxy is for.
16247 * Returns: (transfer none): A #GDBusConnection. Do not free, the object is owned by @proxy.
16253 * g_dbus_object_proxy_new:
16254 * @connection: a #GDBusConnection
16255 * @object_path: the object path
16257 * Creates a new #GDBusObjectProxy for the given connection and
16260 * Returns: a new #GDBusObjectProxy
16266 * g_dbus_object_skeleton_add_interface:
16267 * @object: A #GDBusObjectSkeleton.
16268 * @interface_: A #GDBusInterfaceSkeleton.
16270 * Adds @interface_ to @object.
16272 * If @object already contains a #GDBusInterfaceSkeleton with the same
16273 * interface name, it is removed before @interface_ is added.
16275 * Note that @object takes its own reference on @interface_ and holds
16276 * it until removed.
16283 * g_dbus_object_skeleton_flush:
16284 * @object: A #GDBusObjectSkeleton.
16286 * This method simply calls g_dbus_interface_skeleton_flush() on all
16287 * interfaces belonging to @object. See that method for when flushing
16295 * g_dbus_object_skeleton_new:
16296 * @object_path: An object path.
16298 * Creates a new #GDBusObjectSkeleton.
16300 * Returns: A #GDBusObjectSkeleton. Free with g_object_unref().
16306 * g_dbus_object_skeleton_remove_interface:
16307 * @object: A #GDBusObjectSkeleton.
16308 * @interface_: A #GDBusInterfaceSkeleton.
16310 * Removes @interface_ from @object.
16317 * g_dbus_object_skeleton_remove_interface_by_name:
16318 * @object: A #GDBusObjectSkeleton.
16319 * @interface_name: A D-Bus interface name.
16321 * Removes the #GDBusInterface with @interface_name from @object.
16323 * If no D-Bus interface of the given interface exists, this function
16331 * g_dbus_object_skeleton_set_object_path:
16332 * @object: A #GDBusObjectSkeleton.
16333 * @object_path: A valid D-Bus object path.
16335 * Sets the object path for @object.
16342 * g_dbus_property_info_ref:
16343 * @info: A #GDBusPropertyInfo
16345 * If @info is statically allocated does nothing. Otherwise increases
16346 * the reference count.
16348 * Returns: The same @info.
16354 * g_dbus_property_info_unref:
16355 * @info: A #GDBusPropertyInfo.
16357 * If @info is statically allocated, does nothing. Otherwise decreases
16358 * the reference count of @info. When its reference count drops to 0,
16359 * the memory used is freed.
16366 * g_dbus_proxy_call:
16367 * @proxy: A #GDBusProxy.
16368 * @method_name: Name of method to invoke.
16369 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
16370 * @flags: Flags from the #GDBusCallFlags enumeration.
16371 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
16372 * @cancellable: (allow-none): A #GCancellable or %NULL.
16373 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
16374 * @user_data: The data to pass to @callback.
16376 * Asynchronously invokes the @method_name method on @proxy.
16378 * If @method_name contains any dots, then @name is split into interface and
16379 * method name parts. This allows using @proxy for invoking methods on
16380 * other interfaces.
16382 * If the #GDBusConnection associated with @proxy is closed then
16383 * the operation will fail with %G_IO_ERROR_CLOSED. If
16384 * @cancellable is canceled, the operation will fail with
16385 * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
16386 * compatible with the D-Bus protocol, the operation fails with
16387 * %G_IO_ERROR_INVALID_ARGUMENT.
16389 * If the @parameters #GVariant is floating, it is consumed. This allows
16390 * convenient 'inline' use of g_variant_new(), e.g.:
16392 * g_dbus_proxy_call (proxy,
16394 * g_variant_new ("(ss)",
16397 * G_DBUS_CALL_FLAGS_NONE,
16400 * (GAsyncReadyCallback) two_strings_done,
16404 * If @proxy has an expected interface (see
16405 * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
16406 * then the return value is checked against the return type.
16408 * This is an asynchronous method. When the operation is finished,
16409 * @callback will be invoked in the
16410 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
16411 * of the thread you are calling this method from.
16412 * You can then call g_dbus_proxy_call_finish() to get the result of
16413 * the operation. See g_dbus_proxy_call_sync() for the synchronous
16414 * version of this method.
16416 * If @callback is %NULL then the D-Bus method call message will be sent with
16417 * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
16424 * g_dbus_proxy_call_finish:
16425 * @proxy: A #GDBusProxy.
16426 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
16427 * @error: Return location for error or %NULL.
16429 * Finishes an operation started with g_dbus_proxy_call().
16431 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
16437 * g_dbus_proxy_call_sync:
16438 * @proxy: A #GDBusProxy.
16439 * @method_name: Name of method to invoke.
16440 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
16441 * @flags: Flags from the #GDBusCallFlags enumeration.
16442 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
16443 * @cancellable: (allow-none): A #GCancellable or %NULL.
16444 * @error: Return location for error or %NULL.
16446 * Synchronously invokes the @method_name method on @proxy.
16448 * If @method_name contains any dots, then @name is split into interface and
16449 * method name parts. This allows using @proxy for invoking methods on
16450 * other interfaces.
16452 * If the #GDBusConnection associated with @proxy is disconnected then
16453 * the operation will fail with %G_IO_ERROR_CLOSED. If
16454 * @cancellable is canceled, the operation will fail with
16455 * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
16456 * compatible with the D-Bus protocol, the operation fails with
16457 * %G_IO_ERROR_INVALID_ARGUMENT.
16459 * If the @parameters #GVariant is floating, it is consumed. This allows
16460 * convenient 'inline' use of g_variant_new(), e.g.:
16462 * g_dbus_proxy_call_sync (proxy,
16464 * g_variant_new ("(ss)",
16467 * G_DBUS_CALL_FLAGS_NONE,
16473 * The calling thread is blocked until a reply is received. See
16474 * g_dbus_proxy_call() for the asynchronous version of this
16477 * If @proxy has an expected interface (see
16478 * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
16479 * then the return value is checked against the return type.
16481 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
16487 * g_dbus_proxy_call_with_unix_fd_list:
16488 * @proxy: A #GDBusProxy.
16489 * @method_name: Name of method to invoke.
16490 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
16491 * @flags: Flags from the #GDBusCallFlags enumeration.
16492 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
16493 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
16494 * @cancellable: (allow-none): A #GCancellable or %NULL.
16495 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
16496 * @user_data: The data to pass to @callback.
16498 * Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
16500 * This method is only available on UNIX.
16507 * g_dbus_proxy_call_with_unix_fd_list_finish:
16508 * @proxy: A #GDBusProxy.
16509 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
16510 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
16511 * @error: Return location for error or %NULL.
16513 * Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
16515 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
16521 * g_dbus_proxy_call_with_unix_fd_list_sync:
16522 * @proxy: A #GDBusProxy.
16523 * @method_name: Name of method to invoke.
16524 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
16525 * @flags: Flags from the #GDBusCallFlags enumeration.
16526 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
16527 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
16528 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
16529 * @cancellable: (allow-none): A #GCancellable or %NULL.
16530 * @error: Return location for error or %NULL.
16532 * Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
16534 * This method is only available on UNIX.
16536 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
16542 * g_dbus_proxy_get_cached_property:
16543 * @proxy: A #GDBusProxy.
16544 * @property_name: Property name.
16546 * Looks up the value for a property from the cache. This call does no
16549 * If @proxy has an expected interface (see
16550 * #GDBusProxy:g-interface-info) and @property_name is referenced by
16551 * it, then @value is checked against the type of the property.
16553 * Returns: A reference to the #GVariant instance that holds the value for @property_name or %NULL if the value is not in the cache. The returned reference must be freed with g_variant_unref().
16559 * g_dbus_proxy_get_cached_property_names:
16560 * @proxy: A #GDBusProxy.
16562 * Gets the names of all cached properties on @proxy.
16564 * Returns: (transfer full): A %NULL-terminated array of strings or %NULL if @proxy has no cached properties. Free the returned array with g_strfreev().
16570 * g_dbus_proxy_get_connection:
16571 * @proxy: A #GDBusProxy.
16573 * Gets the connection @proxy is for.
16575 * Returns: (transfer none): A #GDBusConnection owned by @proxy. Do not free.
16581 * g_dbus_proxy_get_default_timeout:
16582 * @proxy: A #GDBusProxy.
16584 * Gets the timeout to use if -1 (specifying default timeout) is
16585 * passed as @timeout_msec in the g_dbus_proxy_call() and
16586 * g_dbus_proxy_call_sync() functions.
16588 * See the #GDBusProxy:g-default-timeout property for more details.
16590 * Returns: Timeout to use for @proxy.
16596 * g_dbus_proxy_get_flags:
16597 * @proxy: A #GDBusProxy.
16599 * Gets the flags that @proxy was constructed with.
16601 * Returns: Flags from the #GDBusProxyFlags enumeration.
16607 * g_dbus_proxy_get_interface_info:
16608 * @proxy: A #GDBusProxy
16610 * Returns the #GDBusInterfaceInfo, if any, specifying the interface
16611 * that @proxy conforms to. See the #GDBusProxy:g-interface-info
16612 * property for more details.
16614 * Returns: A #GDBusInterfaceInfo or %NULL. Do not unref the returned object, it is owned by @proxy.
16620 * g_dbus_proxy_get_interface_name:
16621 * @proxy: A #GDBusProxy.
16623 * Gets the D-Bus interface name @proxy is for.
16625 * Returns: A string owned by @proxy. Do not free.
16631 * g_dbus_proxy_get_name:
16632 * @proxy: A #GDBusProxy.
16634 * Gets the name that @proxy was constructed for.
16636 * Returns: A string owned by @proxy. Do not free.
16642 * g_dbus_proxy_get_name_owner:
16643 * @proxy: A #GDBusProxy.
16645 * The unique name that owns the name that @proxy is for or %NULL if
16646 * no-one currently owns that name. You may connect to the
16647 * #GObject::notify signal to track changes to the
16648 * #GDBusProxy:g-name-owner property.
16650 * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
16656 * g_dbus_proxy_get_object_path:
16657 * @proxy: A #GDBusProxy.
16659 * Gets the object path @proxy is for.
16661 * Returns: A string owned by @proxy. Do not free.
16667 * g_dbus_proxy_new:
16668 * @connection: A #GDBusConnection.
16669 * @flags: Flags used when constructing the proxy.
16670 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16671 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16672 * @object_path: An object path.
16673 * @interface_name: A D-Bus interface name.
16674 * @cancellable: (allow-none): A #GCancellable or %NULL.
16675 * @callback: Callback function to invoke when the proxy is ready.
16676 * @user_data: User data to pass to @callback.
16678 * Creates a proxy for accessing @interface_name on the remote object
16679 * at @object_path owned by @name at @connection and asynchronously
16680 * loads D-Bus properties unless the
16681 * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
16682 * the #GDBusProxy::g-properties-changed signal to get notified about
16683 * property changes.
16685 * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16686 * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16687 * to handle signals from the remote object.
16689 * If @name is a well-known name and the
16690 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16691 * owner currently exists, the message bus will be requested to launch
16692 * a name owner for the name.
16694 * This is a failable asynchronous constructor - when the proxy is
16695 * ready, @callback will be invoked and you can use
16696 * g_dbus_proxy_new_finish() to get the result.
16698 * See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
16700 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16707 * g_dbus_proxy_new_finish:
16708 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
16709 * @error: Return location for error or %NULL.
16711 * Finishes creating a #GDBusProxy.
16713 * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16719 * g_dbus_proxy_new_for_bus:
16720 * @bus_type: A #GBusType.
16721 * @flags: Flags used when constructing the proxy.
16722 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16723 * @name: A bus name (well-known or unique).
16724 * @object_path: An object path.
16725 * @interface_name: A D-Bus interface name.
16726 * @cancellable: (allow-none): A #GCancellable or %NULL.
16727 * @callback: Callback function to invoke when the proxy is ready.
16728 * @user_data: User data to pass to @callback.
16730 * Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
16732 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16739 * g_dbus_proxy_new_for_bus_finish:
16740 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
16741 * @error: Return location for error or %NULL.
16743 * Finishes creating a #GDBusProxy.
16745 * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16751 * g_dbus_proxy_new_for_bus_sync:
16752 * @bus_type: A #GBusType.
16753 * @flags: Flags used when constructing the proxy.
16754 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16755 * @name: A bus name (well-known or unique).
16756 * @object_path: An object path.
16757 * @interface_name: A D-Bus interface name.
16758 * @cancellable: (allow-none): A #GCancellable or %NULL.
16759 * @error: Return location for error or %NULL.
16761 * Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
16763 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16765 * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16771 * g_dbus_proxy_new_sync:
16772 * @connection: A #GDBusConnection.
16773 * @flags: Flags used when constructing the proxy.
16774 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16775 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16776 * @object_path: An object path.
16777 * @interface_name: A D-Bus interface name.
16778 * @cancellable: (allow-none): A #GCancellable or %NULL.
16779 * @error: (allow-none): Return location for error or %NULL.
16781 * Creates a proxy for accessing @interface_name on the remote object
16782 * at @object_path owned by @name at @connection and synchronously
16783 * loads D-Bus properties unless the
16784 * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
16786 * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16787 * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16788 * to handle signals from the remote object.
16790 * If @name is a well-known name and the
16791 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16792 * owner currently exists, the message bus will be requested to launch
16793 * a name owner for the name.
16795 * This is a synchronous failable constructor. See g_dbus_proxy_new()
16796 * and g_dbus_proxy_new_finish() for the asynchronous version.
16798 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16800 * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16806 * g_dbus_proxy_set_cached_property:
16807 * @proxy: A #GDBusProxy
16808 * @property_name: Property name.
16809 * @value: (allow-none): Value for the property or %NULL to remove it from the cache.
16811 * If @value is not %NULL, sets the cached value for the property with
16812 * name @property_name to the value in @value.
16814 * If @value is %NULL, then the cached value is removed from the
16817 * If @proxy has an expected interface (see
16818 * #GDBusProxy:g-interface-info) and @property_name is referenced by
16819 * it, then @value is checked against the type of the property.
16821 * If the @value #GVariant is floating, it is consumed. This allows
16822 * convenient 'inline' use of g_variant_new(), e.g.
16824 * g_dbus_proxy_set_cached_property (proxy,
16826 * g_variant_new ("(si)",
16831 * Normally you will not need to use this method since @proxy is
16832 * tracking changes using the
16833 * <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
16834 * D-Bus signal. However, for performance reasons an object may decide
16835 * to not use this signal for some properties and instead use a
16836 * proprietary out-of-band mechanism to transmit changes.
16838 * As a concrete example, consider an object with a property
16839 * <literal>ChatroomParticipants</literal> which is an array of
16840 * strings. Instead of transmitting the same (long) array every time
16841 * the property changes, it is more efficient to only transmit the
16842 * delta using e.g. signals <literal>ChatroomParticipantJoined(String
16843 * name)</literal> and <literal>ChatroomParticipantParted(String
16851 * g_dbus_proxy_set_default_timeout:
16852 * @proxy: A #GDBusProxy.
16853 * @timeout_msec: Timeout in milliseconds.
16855 * Sets the timeout to use if -1 (specifying default timeout) is
16856 * passed as @timeout_msec in the g_dbus_proxy_call() and
16857 * g_dbus_proxy_call_sync() functions.
16859 * See the #GDBusProxy:g-default-timeout property for more details.
16866 * g_dbus_proxy_set_interface_info:
16867 * @proxy: A #GDBusProxy
16868 * @info: (allow-none): Minimum interface this proxy conforms to or %NULL to unset.
16870 * Ensure that interactions with @proxy conform to the given
16871 * interface. See the #GDBusProxy:g-interface-info property for more
16879 * g_dbus_server_get_client_address:
16880 * @server: A #GDBusServer.
16882 * Gets a D-Bus address string that can be used by clients to connect
16885 * Returns: A D-Bus address string. Do not free, the string is owned by @server.
16891 * g_dbus_server_get_flags:
16892 * @server: A #GDBusServer.
16894 * Gets the flags for @server.
16896 * Returns: A set of flags from the #GDBusServerFlags enumeration.
16902 * g_dbus_server_get_guid:
16903 * @server: A #GDBusServer.
16905 * Gets the GUID for @server.
16907 * Returns: A D-Bus GUID. Do not free this string, it is owned by @server.
16913 * g_dbus_server_is_active:
16914 * @server: A #GDBusServer.
16916 * Gets whether @server is active.
16918 * Returns: %TRUE if server is active, %FALSE otherwise.
16924 * g_dbus_server_new_sync:
16925 * @address: A D-Bus address.
16926 * @flags: Flags from the #GDBusServerFlags enumeration.
16927 * @guid: A D-Bus GUID.
16928 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
16929 * @cancellable: (allow-none): A #GCancellable or %NULL.
16930 * @error: Return location for server or %NULL.
16932 * Creates a new D-Bus server that listens on the first address in
16933 * @address that works.
16935 * Once constructed, you can use g_dbus_server_get_client_address() to
16936 * get a D-Bus address string that clients can use to connect.
16938 * Connect to the #GDBusServer::new-connection signal to handle
16939 * incoming connections.
16941 * The returned #GDBusServer isn't active - you have to start it with
16942 * g_dbus_server_start().
16944 * See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
16947 * This is a synchronous failable constructor. See
16948 * g_dbus_server_new() for the asynchronous version.
16950 * Returns: A #GDBusServer or %NULL if @error is set. Free with g_object_unref().
16956 * g_dbus_server_start:
16957 * @server: A #GDBusServer.
16966 * g_dbus_server_stop:
16967 * @server: A #GDBusServer.
16976 * g_dbus_signal_info_ref:
16977 * @info: A #GDBusSignalInfo
16979 * If @info is statically allocated does nothing. Otherwise increases
16980 * the reference count.
16982 * Returns: The same @info.
16988 * g_dbus_signal_info_unref:
16989 * @info: A #GDBusSignalInfo.
16991 * If @info is statically allocated, does nothing. Otherwise decreases
16992 * the reference count of @info. When its reference count drops to 0,
16993 * the memory used is freed.
17000 * g_desktop_app_info_get_categories:
17001 * @info: a #GDesktopAppInfo
17003 * Gets the categories from the desktop file.
17005 * Returns: The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by ';' or validate it.
17010 * g_desktop_app_info_get_filename:
17011 * @info: a #GDesktopAppInfo
17013 * When @info was created from a known filename, return it. In some
17014 * situations such as the #GDesktopAppInfo returned from
17015 * g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
17017 * Returns: The full path to the file for @info, or %NULL if not known.
17023 * g_desktop_app_info_get_generic_name:
17024 * @info: a #GDesktopAppInfo
17026 * Gets the generic name from the destkop file.
17028 * Returns: The value of the GenericName key
17033 * g_desktop_app_info_get_is_hidden:
17034 * @info: a #GDesktopAppInfo.
17036 * A desktop file is hidden if the Hidden key in it is
17039 * Returns: %TRUE if hidden, %FALSE otherwise.
17044 * g_desktop_app_info_get_keywords:
17045 * @info: a #GDesktopAppInfo
17047 * Gets the keywords from the desktop file.
17049 * Returns: (transfer none): The value of the Keywords key
17055 * g_desktop_app_info_get_nodisplay:
17056 * @info: a #GDesktopAppInfo
17058 * Gets the value of the NoDisplay key, which helps determine if the
17059 * application info should be shown in menus. See
17060 * #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
17062 * Returns: The value of the NoDisplay key
17068 * g_desktop_app_info_get_show_in:
17069 * @info: a #GDesktopAppInfo
17070 * @desktop_env: a string specifying a desktop name
17072 * Checks if the application info should be shown in menus that list available
17073 * applications for a specific name of the desktop, based on the
17074 * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
17076 * If @desktop_env is %NULL, then the name of the desktop set with
17077 * g_desktop_app_info_set_desktop_env() is used.
17079 * Note that g_app_info_should_show() for @info will include this check (with
17080 * %NULL for @desktop_env) as well as additional checks.
17082 * Returns: %TRUE if the @info should be shown in @desktop_env according to the <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE otherwise.
17088 * g_desktop_app_info_get_startup_wm_class:
17089 * @info: a #GDesktopAppInfo that supports startup notify
17091 * Retrieves the StartupWMClass field from @info. This represents the
17092 * WM_CLASS property of the main window of the application, if launched
17095 * Returns: (transfer none): the startup WM class, or %NULL if none is set in the desktop file.
17101 * g_desktop_app_info_launch_uris_as_manager:
17102 * @appinfo: a #GDesktopAppInfo
17103 * @uris: (element-type utf8): List of URIs
17104 * @launch_context: a #GAppLaunchContext
17105 * @spawn_flags: #GSpawnFlags, used for each process
17106 * @user_setup: (scope call): a #GSpawnChildSetupFunc, used once for each process.
17107 * @user_setup_data: (closure user_setup): User data for @user_setup
17108 * @pid_callback: (scope call): Callback for child processes
17109 * @pid_callback_data: (closure pid_callback): User data for @callback
17110 * @error: return location for a #GError, or %NULL
17112 * This function performs the equivalent of g_app_info_launch_uris(),
17113 * but is intended primarily for operating system components that
17114 * launch applications. Ordinary applications should use
17115 * g_app_info_launch_uris().
17117 * In contrast to g_app_info_launch_uris(), all processes created will
17118 * always be run directly as children as if by the UNIX fork()/exec()
17121 * This guarantee allows additional control over the exact environment
17122 * of the child processes, which is provided via a setup function
17123 * @user_setup, as well as the process identifier of each child process
17124 * via @pid_callback. See g_spawn_async() for more information about the
17125 * semantics of the @user_setup function.
17127 * Returns: %TRUE on successful launch, %FALSE otherwise.
17132 * g_desktop_app_info_lookup_get_default_for_uri_scheme:
17133 * @lookup: a #GDesktopAppInfoLookup
17134 * @uri_scheme: a string containing a URI scheme.
17136 * Gets the default application for launching applications
17137 * using this URI scheme for a particular GDesktopAppInfoLookup
17140 * The GDesktopAppInfoLookup interface and this function is used
17141 * to implement g_app_info_get_default_for_uri_scheme() backends
17142 * in a GIO module. There is no reason for applications to use it
17143 * directly. Applications should use g_app_info_get_default_for_uri_scheme().
17145 * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
17146 * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
17151 * g_desktop_app_info_new:
17152 * @desktop_id: the desktop file id
17154 * Creates a new #GDesktopAppInfo based on a desktop file id.
17156 * A desktop file id is the basename of the desktop file, including the
17157 * .desktop extension. GIO is looking for a desktop file with this name
17158 * in the <filename>applications</filename> subdirectories of the XDG data
17159 * directories (i.e. the directories specified in the
17160 * <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
17161 * variables). GIO also supports the prefix-to-subdirectory mapping that is
17162 * described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
17163 * (i.e. a desktop id of kde-foo.desktop will match
17164 * <filename>/usr/share/applications/kde/foo.desktop</filename>).
17166 * Returns: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
17171 * g_desktop_app_info_new_from_filename:
17172 * @filename: the path of a desktop file, in the GLib filename encoding
17174 * Creates a new #GDesktopAppInfo.
17176 * Returns: a new #GDesktopAppInfo or %NULL on error.
17181 * g_desktop_app_info_new_from_keyfile:
17182 * @key_file: an opened #GKeyFile
17184 * Creates a new #GDesktopAppInfo.
17186 * Returns: a new #GDesktopAppInfo or %NULL on error.
17192 * g_desktop_app_info_set_desktop_env:
17193 * @desktop_env: a string specifying what desktop this is
17195 * Sets the name of the desktop that the application is running in.
17196 * This is used by g_app_info_should_show() and
17197 * g_desktop_app_info_get_show_in() to evaluate the
17198 * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
17199 * desktop entry fields.
17201 * The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
17202 * Menu specification</ulink> recognizes the following:
17204 * <member>GNOME</member>
17205 * <member>KDE</member>
17206 * <member>ROX</member>
17207 * <member>XFCE</member>
17208 * <member>LXDE</member>
17209 * <member>Unity</member>
17210 * <member>Old</member>
17213 * Should be called only once; subsequent calls are ignored.
17218 * g_drive_can_eject:
17219 * @drive: a #GDrive.
17221 * Checks if a drive can be ejected.
17223 * Returns: %TRUE if the @drive can be ejected, %FALSE otherwise.
17228 * g_drive_can_poll_for_media:
17229 * @drive: a #GDrive.
17231 * Checks if a drive can be polled for media changes.
17233 * Returns: %TRUE if the @drive can be polled for media changes, %FALSE otherwise.
17238 * g_drive_can_start:
17239 * @drive: a #GDrive.
17241 * Checks if a drive can be started.
17243 * Returns: %TRUE if the @drive can be started, %FALSE otherwise.
17249 * g_drive_can_start_degraded:
17250 * @drive: a #GDrive.
17252 * Checks if a drive can be started degraded.
17254 * Returns: %TRUE if the @drive can be started degraded, %FALSE otherwise.
17260 * g_drive_can_stop:
17261 * @drive: a #GDrive.
17263 * Checks if a drive can be stopped.
17265 * Returns: %TRUE if the @drive can be stopped, %FALSE otherwise.
17272 * @drive: a #GDrive.
17273 * @flags: flags affecting the unmount if required for eject
17274 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17275 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
17276 * @user_data: user data to pass to @callback
17278 * Asynchronously ejects a drive.
17280 * When the operation is finished, @callback will be called.
17281 * You can then call g_drive_eject_finish() to obtain the
17282 * result of the operation.
17284 * Deprecated: 2.22: Use g_drive_eject_with_operation() instead.
17289 * g_drive_eject_finish:
17290 * @drive: a #GDrive.
17291 * @result: a #GAsyncResult.
17292 * @error: a #GError, or %NULL
17294 * Finishes ejecting a drive.
17296 * Returns: %TRUE if the drive has been ejected successfully, %FALSE otherwise.
17297 * Deprecated: 2.22: Use g_drive_eject_with_operation_finish() instead.
17302 * g_drive_eject_with_operation:
17303 * @drive: a #GDrive.
17304 * @flags: flags affecting the unmount if required for eject
17305 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
17306 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17307 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
17308 * @user_data: user data passed to @callback.
17310 * Ejects a drive. This is an asynchronous operation, and is
17311 * finished by calling g_drive_eject_with_operation_finish() with the @drive
17312 * and #GAsyncResult data returned in the @callback.
17319 * g_drive_eject_with_operation_finish:
17320 * @drive: a #GDrive.
17321 * @result: a #GAsyncResult.
17322 * @error: a #GError location to store the error occurring, or %NULL to ignore.
17324 * Finishes ejecting a drive. If any errors occurred during the operation,
17325 * @error will be set to contain the errors and %FALSE will be returned.
17327 * Returns: %TRUE if the drive was successfully ejected. %FALSE otherwise.
17333 * g_drive_enumerate_identifiers:
17334 * @drive: a #GDrive
17336 * Gets the kinds of identifiers that @drive has.
17337 * Use g_drive_get_identifier() to obtain the identifiers
17340 * Returns: (transfer full) (array zero-terminated=1): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
17345 * g_drive_get_icon:
17346 * @drive: a #GDrive.
17348 * Gets the icon for @drive.
17350 * Returns: (transfer full): #GIcon for the @drive. Free the returned object with g_object_unref().
17355 * g_drive_get_identifier:
17356 * @drive: a #GDrive
17357 * @kind: the kind of identifier to return
17359 * Gets the identifier of the given kind for @drive.
17361 * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GDrive doesn't have this kind of identifier.
17366 * g_drive_get_name:
17367 * @drive: a #GDrive.
17369 * Gets the name of @drive.
17371 * Returns: a string containing @drive's name. The returned string should be freed when no longer needed.
17376 * g_drive_get_sort_key:
17377 * @drive: A #GDrive.
17379 * Gets the sort key for @drive, if any.
17381 * Returns: Sorting key for @drive or %NULL if no such key is available.
17387 * g_drive_get_start_stop_type:
17388 * @drive: a #GDrive.
17390 * Gets a hint about how a drive can be started/stopped.
17392 * Returns: A value from the #GDriveStartStopType enumeration.
17398 * g_drive_get_symbolic_icon:
17399 * @drive: a #GDrive.
17401 * Gets the icon for @drive.
17403 * Returns: (transfer full): symbolic #GIcon for the @drive. Free the returned object with g_object_unref().
17409 * g_drive_get_volumes:
17410 * @drive: a #GDrive.
17412 * Get a list of mountable volumes for @drive.
17414 * The returned list should be freed with g_list_free(), after
17415 * its elements have been unreffed with g_object_unref().
17417 * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive.
17422 * g_drive_has_media:
17423 * @drive: a #GDrive.
17425 * Checks if the @drive has media. Note that the OS may not be polling
17426 * the drive for media changes; see g_drive_is_media_check_automatic()
17427 * for more details.
17429 * Returns: %TRUE if @drive has media, %FALSE otherwise.
17434 * g_drive_has_volumes:
17435 * @drive: a #GDrive.
17437 * Check if @drive has any mountable volumes.
17439 * Returns: %TRUE if the @drive contains volumes, %FALSE otherwise.
17444 * g_drive_is_media_check_automatic:
17445 * @drive: a #GDrive.
17447 * Checks if @drive is capabable of automatically detecting media changes.
17449 * Returns: %TRUE if the @drive is capabable of automatically detecting media changes, %FALSE otherwise.
17454 * g_drive_is_media_removable:
17455 * @drive: a #GDrive.
17457 * Checks if the @drive supports removable media.
17459 * Returns: %TRUE if @drive supports removable media, %FALSE otherwise.
17464 * g_drive_poll_for_media:
17465 * @drive: a #GDrive.
17466 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17467 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
17468 * @user_data: user data to pass to @callback
17470 * Asynchronously polls @drive to see if media has been inserted or removed.
17472 * When the operation is finished, @callback will be called.
17473 * You can then call g_drive_poll_for_media_finish() to obtain the
17474 * result of the operation.
17479 * g_drive_poll_for_media_finish:
17480 * @drive: a #GDrive.
17481 * @result: a #GAsyncResult.
17482 * @error: a #GError, or %NULL
17484 * Finishes an operation started with g_drive_poll_for_media() on a drive.
17486 * Returns: %TRUE if the drive has been poll_for_mediaed successfully, %FALSE otherwise.
17492 * @drive: a #GDrive.
17493 * @flags: flags affecting the start operation.
17494 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
17495 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17496 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
17497 * @user_data: user data to pass to @callback
17499 * Asynchronously starts a drive.
17501 * When the operation is finished, @callback will be called.
17502 * You can then call g_drive_start_finish() to obtain the
17503 * result of the operation.
17510 * g_drive_start_finish:
17511 * @drive: a #GDrive.
17512 * @result: a #GAsyncResult.
17513 * @error: a #GError, or %NULL
17515 * Finishes starting a drive.
17517 * Returns: %TRUE if the drive has been started successfully, %FALSE otherwise.
17524 * @drive: a #GDrive.
17525 * @flags: flags affecting the unmount if required for stopping.
17526 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
17527 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17528 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
17529 * @user_data: user data to pass to @callback
17531 * Asynchronously stops a drive.
17533 * When the operation is finished, @callback will be called.
17534 * You can then call g_drive_stop_finish() to obtain the
17535 * result of the operation.
17542 * g_drive_stop_finish:
17543 * @drive: a #GDrive.
17544 * @result: a #GAsyncResult.
17545 * @error: a #GError, or %NULL
17547 * Finishes stopping a drive.
17549 * Returns: %TRUE if the drive has been stopped successfully, %FALSE otherwise.
17555 * g_emblem_get_icon:
17556 * @emblem: a #GEmblem from which the icon should be extracted.
17558 * Gives back the icon from @emblem.
17560 * Returns: (transfer none): a #GIcon. The returned object belongs to the emblem and should not be modified or freed.
17566 * g_emblem_get_origin:
17567 * @emblem: a #GEmblem
17569 * Gets the origin of the emblem.
17571 * Returns: (transfer none): the origin of the emblem
17578 * @icon: a GIcon containing the icon.
17580 * Creates a new emblem for @icon.
17582 * Returns: a new #GEmblem.
17588 * g_emblem_new_with_origin:
17589 * @icon: a GIcon containing the icon.
17590 * @origin: a GEmblemOrigin enum defining the emblem's origin
17592 * Creates a new emblem for @icon.
17594 * Returns: a new #GEmblem.
17600 * g_emblemed_icon_add_emblem:
17601 * @emblemed: a #GEmblemedIcon
17602 * @emblem: a #GEmblem
17604 * Adds @emblem to the #GList of #GEmblem <!-- -->s.
17611 * g_emblemed_icon_clear_emblems:
17612 * @emblemed: a #GEmblemedIcon
17614 * Removes all the emblems from @icon.
17621 * g_emblemed_icon_get_emblems:
17622 * @emblemed: a #GEmblemedIcon
17624 * Gets the list of emblems for the @icon.
17626 * Returns: (element-type Gio.Emblem) (transfer none): a #GList of #GEmblem <!-- -->s that is owned by @emblemed
17632 * g_emblemed_icon_get_icon:
17633 * @emblemed: a #GEmblemedIcon
17635 * Gets the main icon for @emblemed.
17637 * Returns: (transfer none): a #GIcon that is owned by @emblemed
17643 * g_emblemed_icon_new:
17645 * @emblem: (allow-none): a #GEmblem, or %NULL
17647 * Creates a new emblemed icon for @icon with the emblem @emblem.
17649 * Returns: (transfer full) (type GEmblemedIcon): a new #GIcon
17655 * g_file_append_to:
17656 * @file: input #GFile
17657 * @flags: a set of #GFileCreateFlags
17658 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17659 * @error: a #GError, or %NULL
17661 * Gets an output stream for appending data to the file.
17662 * If the file doesn't already exist it is created.
17664 * By default files created are generally readable by everyone,
17665 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17666 * will be made readable only to the current user, to the level that
17667 * is supported on the target filesystem.
17669 * If @cancellable is not %NULL, then the operation can be cancelled
17670 * by triggering the cancellable object from another thread. If the
17671 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17674 * Some file systems don't allow all file names, and may return an
17675 * %G_IO_ERROR_INVALID_FILENAME error. If the file is a directory the
17676 * %G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are
17677 * possible too, and depend on what kind of filesystem the file is on.
17679 * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
17684 * g_file_append_to_async:
17685 * @file: input #GFile
17686 * @flags: a set of #GFileCreateFlags
17687 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17688 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17689 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17690 * @user_data: (closure): the data to pass to callback function
17692 * Asynchronously opens @file for appending.
17694 * For more details, see g_file_append_to() which is
17695 * the synchronous version of this call.
17697 * When the operation is finished, @callback will be called.
17698 * You can then call g_file_append_to_finish() to get the result
17699 * of the operation.
17704 * g_file_append_to_finish:
17705 * @file: input #GFile
17706 * @res: #GAsyncResult
17707 * @error: a #GError, or %NULL
17709 * Finishes an asynchronous file append operation started with
17710 * g_file_append_to_async().
17712 * Returns: (transfer full): a valid #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17717 * g_file_attribute_info_list_add:
17718 * @list: a #GFileAttributeInfoList.
17719 * @name: the name of the attribute to add.
17720 * @type: the #GFileAttributeType for the attribute.
17721 * @flags: #GFileAttributeInfoFlags for the attribute.
17723 * Adds a new attribute with @name to the @list, setting
17724 * its @type and @flags.
17729 * g_file_attribute_info_list_dup:
17730 * @list: a #GFileAttributeInfoList to duplicate.
17732 * Makes a duplicate of a file attribute info list.
17734 * Returns: a copy of the given @list.
17739 * g_file_attribute_info_list_lookup:
17740 * @list: a #GFileAttributeInfoList.
17741 * @name: the name of the attribute to lookup.
17743 * Gets the file attribute with the name @name from @list.
17745 * Returns: a #GFileAttributeInfo for the @name, or %NULL if an attribute isn't found.
17750 * g_file_attribute_info_list_new:
17752 * Creates a new file attribute info list.
17754 * Returns: a #GFileAttributeInfoList.
17759 * g_file_attribute_info_list_ref:
17760 * @list: a #GFileAttributeInfoList to reference.
17762 * References a file attribute info list.
17764 * Returns: #GFileAttributeInfoList or %NULL on error.
17769 * g_file_attribute_info_list_unref:
17770 * @list: The #GFileAttributeInfoList to unreference.
17772 * Removes a reference from the given @list. If the reference count
17773 * falls to zero, the @list is deleted.
17778 * g_file_attribute_matcher_enumerate_namespace:
17779 * @matcher: a #GFileAttributeMatcher.
17780 * @ns: a string containing a file attribute namespace.
17782 * Checks if the matcher will match all of the keys in a given namespace.
17783 * This will always return %TRUE if a wildcard character is in use (e.g. if
17784 * matcher was created with "standard::*" and @ns is "standard", or if matcher was created
17785 * using "*" and namespace is anything.)
17787 * TODO: this is awkwardly worded.
17789 * Returns: %TRUE if the matcher matches all of the entries in the given @ns, %FALSE otherwise.
17794 * g_file_attribute_matcher_enumerate_next:
17795 * @matcher: a #GFileAttributeMatcher.
17797 * Gets the next matched attribute from a #GFileAttributeMatcher.
17799 * Returns: a string containing the next attribute or %NULL if no more attribute exist.
17804 * g_file_attribute_matcher_matches:
17805 * @matcher: a #GFileAttributeMatcher.
17806 * @attribute: a file attribute key.
17808 * Checks if an attribute will be matched by an attribute matcher. If
17809 * the matcher was created with the "*" matching string, this function
17810 * will always return %TRUE.
17812 * Returns: %TRUE if @attribute matches @matcher. %FALSE otherwise.
17817 * g_file_attribute_matcher_matches_only:
17818 * @matcher: a #GFileAttributeMatcher.
17819 * @attribute: a file attribute key.
17821 * Checks if a attribute matcher only matches a given attribute. Always
17822 * returns %FALSE if "*" was used when creating the matcher.
17824 * Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
17829 * g_file_attribute_matcher_new:
17830 * @attributes: an attribute string to match.
17832 * Creates a new file attribute matcher, which matches attributes
17833 * against a given string. #GFileAttributeMatcher<!-- -->s are reference
17834 * counted structures, and are created with a reference count of 1. If
17835 * the number of references falls to 0, the #GFileAttributeMatcher is
17836 * automatically destroyed.
17838 * The @attribute string should be formatted with specific keys separated
17839 * from namespaces with a double colon. Several "namespace::key" strings may be
17840 * concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
17841 * The wildcard "*" may be used to match all keys and namespaces, or
17842 * "namespace::*" will match all keys in a given namespace.
17844 * Examples of strings to use:
17846 * <title>File Attribute Matcher strings and results</title>
17847 * <tgroup cols='2' align='left'><thead>
17848 * <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
17850 * <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
17851 * <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
17852 * <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
17853 * all keys in the unix namespace.</entry></row>
17854 * </tbody></tgroup>
17857 * Returns: a #GFileAttributeMatcher.
17862 * g_file_attribute_matcher_ref:
17863 * @matcher: a #GFileAttributeMatcher.
17865 * References a file attribute matcher.
17867 * Returns: a #GFileAttributeMatcher.
17872 * g_file_attribute_matcher_subtract:
17873 * @matcher: Matcher to subtract from
17874 * @subtract: The matcher to subtract
17876 * Subtracts all attributes of @subtract from @matcher and returns
17877 * a matcher that supports those attributes.
17879 * Note that currently it is not possible to remove a single
17880 * attribute when the @matcher matches the whole namespace - or remove
17881 * a namespace or attribute when the matcher matches everything. This
17882 * is a limitation of the current implementation, but may be fixed
17885 * Returns: A file attribute matcher matching all attributes of @matcher that are not matched by @subtract
17890 * g_file_attribute_matcher_to_string:
17891 * @matcher: (allow-none): a #GFileAttributeMatcher.
17893 * Prints what the matcher is matching against. The format will be
17894 * equal to the format passed to g_file_attribute_matcher_new().
17895 * The output however, might not be identical, as the matcher may
17896 * decide to use a different order or omit needless parts.
17898 * Returns: a string describing the attributes the matcher matches against or %NULL if @matcher was %NULL.
17904 * g_file_attribute_matcher_unref:
17905 * @matcher: a #GFileAttributeMatcher.
17907 * Unreferences @matcher. If the reference count falls below 1,
17908 * the @matcher is automatically freed.
17914 * @source: input #GFile
17915 * @destination: destination #GFile
17916 * @flags: set of #GFileCopyFlags
17917 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17918 * @progress_callback: (allow-none) (scope call): function to callback with progress information, or %NULL if progress information is not needed
17919 * @progress_callback_data: (closure): user data to pass to @progress_callback
17920 * @error: #GError to set on error, or %NULL
17922 * Copies the file @source to the location specified by @destination.
17923 * Can not handle recursive copies of directories.
17925 * If the flag #G_FILE_COPY_OVERWRITE is specified an already
17926 * existing @destination file is overwritten.
17928 * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
17929 * will be copied as symlinks, otherwise the target of the
17930 * @source symlink will be copied.
17932 * If @cancellable is not %NULL, then the operation can be cancelled by
17933 * triggering the cancellable object from another thread. If the operation
17934 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17936 * If @progress_callback is not %NULL, then the operation can be monitored
17937 * by setting this to a #GFileProgressCallback function.
17938 * @progress_callback_data will be passed to this function. It is guaranteed
17939 * that this callback will be called after all data has been transferred with
17940 * the total number of bytes copied during the operation.
17942 * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND error
17943 * is returned, independent on the status of the @destination.
17945 * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then
17946 * the error %G_IO_ERROR_EXISTS is returned.
17948 * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
17949 * error is returned. If trying to overwrite a directory with a directory the
17950 * %G_IO_ERROR_WOULD_MERGE error is returned.
17952 * If the source is a directory and the target does not exist, or
17953 * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
17954 * %G_IO_ERROR_WOULD_RECURSE error is returned.
17956 * If you are interested in copying the #GFile object itself (not the on-disk
17957 * file), see g_file_dup().
17959 * Returns: %TRUE on success, %FALSE otherwise.
17964 * g_file_copy_async: (skip)
17965 * @source: input #GFile
17966 * @destination: destination #GFile
17967 * @flags: set of #GFileCopyFlags
17968 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17969 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17970 * @progress_callback: (allow-none): function to callback with progress information, or %NULL if progress information is not needed
17971 * @progress_callback_data: (closure): user data to pass to @progress_callback
17972 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17973 * @user_data: the data to pass to callback function
17975 * Copies the file @source to the location specified by @destination
17976 * asynchronously. For details of the behaviour, see g_file_copy().
17978 * If @progress_callback is not %NULL, then that function that will be called
17979 * just like in g_file_copy(), however the callback will run in the main loop,
17980 * not in the thread that is doing the I/O operation.
17982 * When the operation is finished, @callback will be called. You can then call
17983 * g_file_copy_finish() to get the result of the operation.
17988 * g_file_copy_attributes:
17989 * @source: a #GFile with attributes
17990 * @destination: a #GFile to copy attributes to
17991 * @flags: a set of #GFileCopyFlags
17992 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17993 * @error: a #GError, %NULL to ignore
17995 * Copies the file attributes from @source to @destination.
17997 * Normally only a subset of the file attributes are copied,
17998 * those that are copies in a normal file copy operation
17999 * (which for instance does not include e.g. owner). However
18000 * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
18001 * all the metadata that is possible to copy is copied. This
18002 * is useful when implementing move by copy + delete source.
18004 * Returns: %TRUE if the attributes were copied successfully, %FALSE otherwise.
18009 * g_file_copy_finish:
18010 * @file: input #GFile
18011 * @res: a #GAsyncResult
18012 * @error: a #GError, or %NULL
18014 * Finishes copying the file started with g_file_copy_async().
18016 * Returns: a %TRUE on success, %FALSE on error.
18022 * @file: input #GFile
18023 * @flags: a set of #GFileCreateFlags
18024 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18025 * @error: a #GError, or %NULL
18027 * Creates a new file and returns an output stream for writing to it.
18028 * The file must not already exist.
18030 * By default files created are generally readable by everyone,
18031 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
18032 * will be made readable only to the current user, to the level
18033 * that is supported on the target filesystem.
18035 * If @cancellable is not %NULL, then the operation can be cancelled
18036 * by triggering the cancellable object from another thread. If the
18037 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
18040 * If a file or directory with this name already exists the
18041 * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
18042 * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
18043 * error, and if the name is to long %G_IO_ERROR_FILENAME_TOO_LONG will
18044 * be returned. Other errors are possible too, and depend on what kind
18045 * of filesystem the file is on.
18047 * Returns: (transfer full): a #GFileOutputStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
18052 * g_file_create_async:
18053 * @file: input #GFile
18054 * @flags: a set of #GFileCreateFlags
18055 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
18056 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18057 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18058 * @user_data: (closure): the data to pass to callback function
18060 * Asynchronously creates a new file and returns an output stream
18061 * for writing to it. The file must not already exist.
18063 * For more details, see g_file_create() which is
18064 * the synchronous version of this call.
18066 * When the operation is finished, @callback will be called.
18067 * You can then call g_file_create_finish() to get the result
18068 * of the operation.
18073 * g_file_create_finish:
18074 * @file: input #GFile
18075 * @res: a #GAsyncResult
18076 * @error: a #GError, or %NULL
18078 * Finishes an asynchronous file create operation started with
18079 * g_file_create_async().
18081 * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
18086 * g_file_create_readwrite:
18088 * @flags: a set of #GFileCreateFlags
18089 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18090 * @error: return location for a #GError, or %NULL
18092 * Creates a new file and returns a stream for reading and
18093 * writing to it. The file must not already exist.
18095 * By default files created are generally readable by everyone,
18096 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
18097 * will be made readable only to the current user, to the level
18098 * that is supported on the target filesystem.
18100 * If @cancellable is not %NULL, then the operation can be cancelled
18101 * by triggering the cancellable object from another thread. If the
18102 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
18105 * If a file or directory with this name already exists, the
18106 * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
18107 * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
18108 * error, and if the name is too long, %G_IO_ERROR_FILENAME_TOO_LONG
18109 * will be returned. Other errors are possible too, and depend on what
18110 * kind of filesystem the file is on.
18112 * Note that in many non-local file cases read and write streams are
18113 * not supported, so make sure you really need to do read and write
18114 * streaming, rather than just opening for reading or writing.
18116 * Returns: (transfer full): a #GFileIOStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
18122 * g_file_create_readwrite_async:
18123 * @file: input #GFile
18124 * @flags: a set of #GFileCreateFlags
18125 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
18126 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18127 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18128 * @user_data: (closure): the data to pass to callback function
18130 * Asynchronously creates a new file and returns a stream
18131 * for reading and writing to it. The file must not already exist.
18133 * For more details, see g_file_create_readwrite() which is
18134 * the synchronous version of this call.
18136 * When the operation is finished, @callback will be called.
18137 * You can then call g_file_create_readwrite_finish() to get
18138 * the result of the operation.
18145 * g_file_create_readwrite_finish:
18146 * @file: input #GFile
18147 * @res: a #GAsyncResult
18148 * @error: a #GError, or %NULL
18150 * Finishes an asynchronous file create operation started with
18151 * g_file_create_readwrite_async().
18153 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
18160 * @file: input #GFile
18161 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18162 * @error: a #GError, or %NULL
18164 * Deletes a file. If the @file is a directory, it will only be
18165 * deleted if it is empty. This has the same semantics as g_unlink().
18167 * If @cancellable is not %NULL, then the operation can be cancelled by
18168 * triggering the cancellable object from another thread. If the operation
18169 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18171 * Virtual: delete_file
18172 * Returns: %TRUE if the file was deleted. %FALSE otherwise.
18177 * g_file_delete_async:
18178 * @file: input #GFile
18179 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
18180 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18181 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
18182 * @user_data: the data to pass to callback function
18184 * Asynchronously delete a file. If the @file is a directory, it will
18185 * only be deleted if it is empty. This has the same semantics as
18188 * Virtual: delete_file_async
18194 * g_file_delete_finish:
18195 * @file: input #GFile
18196 * @result: a #GAsyncResult
18197 * @error: a #GError, or %NULL
18199 * Finishes deleting a file started with g_file_delete_async().
18201 * Virtual: delete_file_finish
18207 * g_file_descriptor_based_get_fd:
18208 * @fd_based: a #GFileDescriptorBased.
18210 * Gets the underlying file descriptor.
18212 * Returns: The file descriptor
18219 * @file: input #GFile
18221 * Duplicates a #GFile handle. This operation does not duplicate
18222 * the actual file or directory represented by the #GFile; see
18223 * g_file_copy() if attempting to copy a file.
18225 * This call does no blocking I/O.
18227 * Returns: (transfer full): a new #GFile that is a duplicate of the given #GFile.
18232 * g_file_eject_mountable:
18233 * @file: input #GFile
18234 * @flags: flags affecting the operation
18235 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18236 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
18237 * @user_data: (closure): the data to pass to callback function
18239 * Starts an asynchronous eject on a mountable.
18240 * When this operation has completed, @callback will be called with
18241 * @user_user data, and the operation can be finalized with
18242 * g_file_eject_mountable_finish().
18244 * If @cancellable is not %NULL, then the operation can be cancelled by
18245 * triggering the cancellable object from another thread. If the operation
18246 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18248 * Deprecated: 2.22: Use g_file_eject_mountable_with_operation() instead.
18253 * g_file_eject_mountable_finish:
18254 * @file: input #GFile
18255 * @result: a #GAsyncResult
18256 * @error: a #GError, or %NULL
18258 * Finishes an asynchronous eject operation started by
18259 * g_file_eject_mountable().
18261 * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
18262 * Deprecated: 2.22: Use g_file_eject_mountable_with_operation_finish() instead.
18267 * g_file_eject_mountable_with_operation:
18268 * @file: input #GFile
18269 * @flags: flags affecting the operation
18270 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
18271 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18272 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
18273 * @user_data: (closure): the data to pass to callback function
18275 * Starts an asynchronous eject on a mountable.
18276 * When this operation has completed, @callback will be called with
18277 * @user_user data, and the operation can be finalized with
18278 * g_file_eject_mountable_with_operation_finish().
18280 * If @cancellable is not %NULL, then the operation can be cancelled by
18281 * triggering the cancellable object from another thread. If the operation
18282 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18289 * g_file_eject_mountable_with_operation_finish:
18290 * @file: input #GFile
18291 * @result: a #GAsyncResult
18292 * @error: a #GError, or %NULL
18294 * Finishes an asynchronous eject operation started by
18295 * g_file_eject_mountable_with_operation().
18297 * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
18303 * g_file_enumerate_children:
18304 * @file: input #GFile
18305 * @attributes: an attribute query string
18306 * @flags: a set of #GFileQueryInfoFlags
18307 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18308 * @error: #GError for error reporting
18310 * Gets the requested information about the files in a directory.
18311 * The result is a #GFileEnumerator object that will give out
18312 * #GFileInfo objects for all the files in the directory.
18314 * The @attributes value is a string that specifies the file
18315 * attributes that should be gathered. It is not an error if
18316 * it's not possible to read a particular requested attribute
18317 * from a file - it just won't be set. @attributes should
18318 * be a comma-separated list of attributes or attribute wildcards.
18319 * The wildcard "*" means all attributes, and a wildcard like
18320 * "standard::*" means all attributes in the standard namespace.
18321 * An example attribute query be "standard::*,owner::user".
18322 * The standard attributes are available as defines, like
18323 * #G_FILE_ATTRIBUTE_STANDARD_NAME.
18325 * If @cancellable is not %NULL, then the operation can be cancelled
18326 * by triggering the cancellable object from another thread. If the
18327 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
18330 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
18331 * be returned. If the file is not a directory, the %G_FILE_ERROR_NOTDIR
18332 * error will be returned. Other errors are possible too.
18334 * Returns: (transfer full): A #GFileEnumerator if successful, %NULL on error. Free the returned object with g_object_unref().
18339 * g_file_enumerate_children_async:
18340 * @file: input #GFile
18341 * @attributes: an attribute query string
18342 * @flags: a set of #GFileQueryInfoFlags
18343 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
18344 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18345 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18346 * @user_data: (closure): the data to pass to callback function
18348 * Asynchronously gets the requested information about the files
18349 * in a directory. The result is a #GFileEnumerator object that will
18350 * give out #GFileInfo objects for all the files in the directory.
18352 * For more details, see g_file_enumerate_children() which is
18353 * the synchronous version of this call.
18355 * When the operation is finished, @callback will be called. You can
18356 * then call g_file_enumerate_children_finish() to get the result of
18362 * g_file_enumerate_children_finish:
18363 * @file: input #GFile
18364 * @res: a #GAsyncResult
18365 * @error: a #GError
18367 * Finishes an async enumerate children operation.
18368 * See g_file_enumerate_children_async().
18370 * Returns: (transfer full): a #GFileEnumerator or %NULL if an error occurred. Free the returned object with g_object_unref().
18375 * g_file_enumerator_close:
18376 * @enumerator: a #GFileEnumerator.
18377 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18378 * @error: location to store the error occurring, or %NULL to ignore
18380 * Releases all resources used by this enumerator, making the
18381 * enumerator return %G_IO_ERROR_CLOSED on all calls.
18383 * This will be automatically called when the last reference
18384 * is dropped, but you might want to call this function to make
18385 * sure resources are released as early as possible.
18387 * Returns: #TRUE on success or #FALSE on error.
18392 * g_file_enumerator_close_async:
18393 * @enumerator: a #GFileEnumerator.
18394 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18395 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18396 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18397 * @user_data: (closure): the data to pass to callback function
18399 * Asynchronously closes the file enumerator.
18401 * If @cancellable is not %NULL, then the operation can be cancelled by
18402 * triggering the cancellable object from another thread. If the operation
18403 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
18404 * g_file_enumerator_close_finish().
18409 * g_file_enumerator_close_finish:
18410 * @enumerator: a #GFileEnumerator.
18411 * @result: a #GAsyncResult.
18412 * @error: a #GError location to store the error occurring, or %NULL to ignore.
18414 * Finishes closing a file enumerator, started from g_file_enumerator_close_async().
18416 * If the file enumerator was already closed when g_file_enumerator_close_async()
18417 * was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
18418 * return %FALSE. If the file enumerator had pending operation when the close
18419 * operation was started, then this function will report %G_IO_ERROR_PENDING, and
18420 * return %FALSE. If @cancellable was not %NULL, then the operation may have been
18421 * cancelled by triggering the cancellable object from another thread. If the operation
18422 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
18425 * Returns: %TRUE if the close operation has finished successfully.
18430 * g_file_enumerator_get_container:
18431 * @enumerator: a #GFileEnumerator
18433 * Get the #GFile container which is being enumerated.
18435 * Returns: (transfer none): the #GFile which is being enumerated.
18441 * g_file_enumerator_has_pending:
18442 * @enumerator: a #GFileEnumerator.
18444 * Checks if the file enumerator has pending operations.
18446 * Returns: %TRUE if the @enumerator has pending operations.
18451 * g_file_enumerator_is_closed:
18452 * @enumerator: a #GFileEnumerator.
18454 * Checks if the file enumerator has been closed.
18456 * Returns: %TRUE if the @enumerator is closed.
18461 * g_file_enumerator_next_file:
18462 * @enumerator: a #GFileEnumerator.
18463 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18464 * @error: location to store the error occurring, or %NULL to ignore
18466 * Returns information for the next file in the enumerated object.
18467 * Will block until the information is available. The #GFileInfo
18468 * returned from this function will contain attributes that match the
18469 * attribute string that was passed when the #GFileEnumerator was created.
18471 * On error, returns %NULL and sets @error to the error. If the
18472 * enumerator is at the end, %NULL will be returned and @error will
18475 * Returns: (transfer full): A #GFileInfo or %NULL on error or end of enumerator. Free the returned object with g_object_unref() when no longer needed.
18480 * g_file_enumerator_next_files_async:
18481 * @enumerator: a #GFileEnumerator.
18482 * @num_files: the number of file info objects to request
18483 * @io_priority: the <link linkend="io-priority">io priority</link> of the request.
18484 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18485 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18486 * @user_data: (closure): the data to pass to callback function
18488 * Request information for a number of files from the enumerator asynchronously.
18489 * When all i/o for the operation is finished the @callback will be called with
18490 * the requested information.
18492 * The callback can be called with less than @num_files files in case of error
18493 * or at the end of the enumerator. In case of a partial error the callback will
18494 * be called with any succeeding items and no error, and on the next request the
18495 * error will be reported. If a request is cancelled the callback will be called
18496 * with %G_IO_ERROR_CANCELLED.
18498 * During an async request no other sync and async calls are allowed, and will
18499 * result in %G_IO_ERROR_PENDING errors.
18501 * Any outstanding i/o request with higher priority (lower numerical value) will
18502 * be executed before an outstanding request with lower priority. Default
18503 * priority is %G_PRIORITY_DEFAULT.
18508 * g_file_enumerator_next_files_finish:
18509 * @enumerator: a #GFileEnumerator.
18510 * @result: a #GAsyncResult.
18511 * @error: a #GError location to store the error occurring, or %NULL to ignore.
18513 * Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
18515 * Returns: (transfer full) (element-type Gio.FileInfo): a #GList of #GFileInfo<!---->s. You must free the list with g_list_free() and unref the infos with g_object_unref() when you're done with them.
18520 * g_file_enumerator_set_pending:
18521 * @enumerator: a #GFileEnumerator.
18522 * @pending: a boolean value.
18524 * Sets the file enumerator as having pending operations.
18530 * @file1: the first #GFile
18531 * @file2: the second #GFile
18533 * Checks equality of two given #GFiles.
18535 * Note that two #GFiles that differ can still refer to the same
18536 * file on the filesystem due to various forms of filename
18539 * This call does no blocking I/O.
18541 * Returns: %TRUE if @file1 and @file2 are equal. %FALSE if either is not a #GFile.
18546 * g_file_find_enclosing_mount:
18547 * @file: input #GFile
18548 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18549 * @error: a #GError
18551 * Gets a #GMount for the #GFile.
18553 * If the #GFileIface for @file does not have a mount (e.g.
18554 * possibly a remote share), @error will be set to %G_IO_ERROR_NOT_FOUND
18555 * and %NULL will be returned.
18557 * If @cancellable is not %NULL, then the operation can be cancelled by
18558 * triggering the cancellable object from another thread. If the operation
18559 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18561 * Returns: (transfer full): a #GMount where the @file is located or %NULL on error. Free the returned object with g_object_unref().
18566 * g_file_find_enclosing_mount_async:
18568 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
18569 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18570 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18571 * @user_data: (closure): the data to pass to callback function
18573 * Asynchronously gets the mount for the file.
18575 * For more details, see g_file_find_enclosing_mount() which is
18576 * the synchronous version of this call.
18578 * When the operation is finished, @callback will be called.
18579 * You can then call g_file_find_enclosing_mount_finish() to
18580 * get the result of the operation.
18585 * g_file_find_enclosing_mount_finish:
18587 * @res: a #GAsyncResult
18588 * @error: a #GError
18590 * Finishes an asynchronous find mount request.
18591 * See g_file_find_enclosing_mount_async().
18593 * Returns: (transfer full): #GMount for given @file or %NULL on error. Free the returned object with g_object_unref().
18598 * g_file_get_basename:
18599 * @file: input #GFile
18601 * Gets the base name (the last component of the path) for a given #GFile.
18603 * If called for the top level of a system (such as the filesystem root
18604 * or a uri like sftp://host/) it will return a single directory separator
18605 * (and on Windows, possibly a drive letter).
18607 * The base name is a byte string (not UTF-8). It has no defined encoding
18608 * or rules other than it may not contain zero bytes. If you want to use
18609 * filenames in a user interface you should use the display name that you
18610 * can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
18611 * attribute with g_file_query_info().
18613 * This call does no blocking I/O.
18615 * Returns: string containing the #GFile's base name, or %NULL if given #GFile is invalid. The returned string should be freed with g_free() when no longer needed.
18620 * g_file_get_child:
18621 * @file: input #GFile
18622 * @name: string containing the child's basename
18624 * Gets a child of @file with basename equal to @name.
18626 * Note that the file with that specific name might not exist, but
18627 * you can still have a #GFile that points to it. You can use this
18628 * for instance to create that file.
18630 * This call does no blocking I/O.
18632 * Returns: (transfer full): a #GFile to a child specified by @name. Free the returned object with g_object_unref().
18637 * g_file_get_child_for_display_name:
18638 * @file: input #GFile
18639 * @display_name: string to a possible child
18640 * @error: return location for an error
18642 * Gets the child of @file for a given @display_name (i.e. a UTF-8
18643 * version of the name). If this function fails, it returns %NULL
18644 * and @error will be set. This is very useful when constructing a
18645 * #GFile for a new file and the user entered the filename in the
18646 * user interface, for instance when you select a directory and
18647 * type a filename in the file selector.
18649 * This call does no blocking I/O.
18651 * Returns: (transfer full): a #GFile to the specified child, or %NULL if the display name couldn't be converted. Free the returned object with g_object_unref().
18656 * g_file_get_parent:
18657 * @file: input #GFile
18659 * Gets the parent directory for the @file.
18660 * If the @file represents the root directory of the
18661 * file system, then %NULL will be returned.
18663 * This call does no blocking I/O.
18665 * Returns: (transfer full): a #GFile structure to the parent of the given #GFile or %NULL if there is no parent. Free the returned object with g_object_unref().
18670 * g_file_get_parse_name:
18671 * @file: input #GFile
18673 * Gets the parse name of the @file.
18674 * A parse name is a UTF-8 string that describes the
18675 * file such that one can get the #GFile back using
18676 * g_file_parse_name().
18678 * This is generally used to show the #GFile as a nice
18679 * full-pathname kind of string in a user interface,
18680 * like in a location entry.
18682 * For local files with names that can safely be converted
18683 * to UTF-8 the pathname is used, otherwise the IRI is used
18684 * (a form of URI that allows UTF-8 characters unescaped).
18686 * This call does no blocking I/O.
18688 * Returns: a string containing the #GFile's parse name. The returned string should be freed with g_free() when no longer needed.
18694 * @file: input #GFile
18696 * Gets the local pathname for #GFile, if one exists.
18698 * This call does no blocking I/O.
18700 * Returns: string containing the #GFile's path, or %NULL if no such path exists. The returned string should be freed with g_free() when no longer needed.
18705 * g_file_get_relative_path:
18706 * @parent: input #GFile
18707 * @descendant: input #GFile
18709 * Gets the path for @descendant relative to @parent.
18711 * This call does no blocking I/O.
18713 * Returns: string with the relative path from @descendant to @parent, or %NULL if @descendant doesn't have @parent as prefix. The returned string should be freed with g_free() when no longer needed.
18719 * @file: input #GFile
18721 * Gets the URI for the @file.
18723 * This call does no blocking I/O.
18725 * Returns: a string containing the #GFile's URI. The returned string should be freed with g_free() when no longer needed.
18730 * g_file_get_uri_scheme:
18731 * @file: input #GFile
18733 * Gets the URI scheme for a #GFile.
18734 * RFC 3986 decodes the scheme as:
18736 * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
18737 * </programlisting>
18738 * Common schemes include "file", "http", "ftp", etc.
18740 * This call does no blocking I/O.
18742 * Returns: a string containing the URI scheme for the given #GFile. The returned string should be freed with g_free() when no longer needed.
18747 * g_file_has_parent:
18748 * @file: input #GFile
18749 * @parent: (allow-none): the parent to check for, or %NULL
18751 * Checks if @file has a parent, and optionally, if it is @parent.
18753 * If @parent is %NULL then this function returns %TRUE if @file has any
18754 * parent at all. If @parent is non-%NULL then %TRUE is only returned
18755 * if @file is a child of @parent.
18757 * Returns: %TRUE if @file is a child of @parent (or any parent in the case that @parent is %NULL).
18763 * g_file_has_prefix:
18764 * @file: input #GFile
18765 * @prefix: input #GFile
18767 * Checks whether @file has the prefix specified by @prefix.
18769 * In other words, if the names of initial elements of @file's
18770 * pathname match @prefix. Only full pathname elements are matched,
18771 * so a path like /foo is not considered a prefix of /foobar, only
18774 * This call does no I/O, as it works purely on names. As such it can
18775 * sometimes return %FALSE even if @file is inside a @prefix (from a
18776 * filesystem point of view), because the prefix of @file is an alias
18779 * Virtual: prefix_matches
18780 * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix, %FALSE otherwise.
18785 * g_file_has_uri_scheme:
18786 * @file: input #GFile
18787 * @uri_scheme: a string containing a URI scheme
18789 * Checks to see if a #GFile has a given URI scheme.
18791 * This call does no blocking I/O.
18793 * Returns: %TRUE if #GFile's backend supports the given URI scheme, %FALSE if URI scheme is %NULL, not supported, or #GFile is invalid.
18799 * @file: (type GFile): #gconstpointer to a #GFile
18801 * Creates a hash value for a #GFile.
18803 * This call does no blocking I/O.
18806 * Returns: 0 if @file is not a valid #GFile, otherwise an integer that can be used as hash value for the #GFile. This function is intended for easily hashing a #GFile to add to a #GHashTable or similar data structure.
18811 * g_file_icon_get_file:
18814 * Gets the #GFile associated with the given @icon.
18816 * Returns: (transfer none): a #GFile, or %NULL.
18824 * Creates a new icon for a file.
18826 * Returns: (transfer full) (type GFileIcon): a #GIcon for the given @file, or %NULL on error.
18831 * g_file_info_clear_status:
18832 * @info: a #GFileInfo.
18834 * Clears the status information from @info.
18839 * g_file_info_copy_into:
18840 * @src_info: source to copy attributes from.
18841 * @dest_info: destination to copy attributes to.
18843 * Copies all of the <link linkend="gio-GFileAttribute">GFileAttribute</link>s
18844 * from @src_info to @dest_info.
18850 * @other: a #GFileInfo.
18852 * Duplicates a file info structure.
18854 * Returns: (transfer full): a duplicate #GFileInfo of @other.
18859 * g_file_info_get_attribute_as_string:
18860 * @info: a #GFileInfo.
18861 * @attribute: a file attribute key.
18863 * Gets the value of a attribute, formated as a string.
18864 * This escapes things as needed to make the string valid
18867 * Returns: a UTF-8 string associated with the given @attribute. When you're done with the string it must be freed with g_free().
18872 * g_file_info_get_attribute_boolean:
18873 * @info: a #GFileInfo.
18874 * @attribute: a file attribute key.
18876 * Gets the value of a boolean attribute. If the attribute does not
18877 * contain a boolean value, %FALSE will be returned.
18879 * Returns: the boolean value contained within the attribute.
18884 * g_file_info_get_attribute_byte_string:
18885 * @info: a #GFileInfo.
18886 * @attribute: a file attribute key.
18888 * Gets the value of a byte string attribute. If the attribute does
18889 * not contain a byte string, %NULL will be returned.
18891 * Returns: the contents of the @attribute value as a byte string, or %NULL otherwise.
18896 * g_file_info_get_attribute_data:
18897 * @info: a #GFileInfo
18898 * @attribute: a file attribute key
18899 * @type: (out) (allow-none): return location for the attribute type, or %NULL
18900 * @value_pp: (out) (allow-none): return location for the attribute value, or %NULL
18901 * @status: (out) (allow-none): return location for the attribute status, or %NULL
18903 * Gets the attribute type, value and status for an attribute key.
18905 * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
18910 * g_file_info_get_attribute_int32:
18911 * @info: a #GFileInfo.
18912 * @attribute: a file attribute key.
18914 * Gets a signed 32-bit integer contained within the attribute. If the
18915 * attribute does not contain a signed 32-bit integer, or is invalid,
18916 * 0 will be returned.
18918 * Returns: a signed 32-bit integer from the attribute.
18923 * g_file_info_get_attribute_int64:
18924 * @info: a #GFileInfo.
18925 * @attribute: a file attribute key.
18927 * Gets a signed 64-bit integer contained within the attribute. If the
18928 * attribute does not contain an signed 64-bit integer, or is invalid,
18929 * 0 will be returned.
18931 * Returns: a signed 64-bit integer from the attribute.
18936 * g_file_info_get_attribute_object:
18937 * @info: a #GFileInfo.
18938 * @attribute: a file attribute key.
18940 * Gets the value of a #GObject attribute. If the attribute does
18941 * not contain a #GObject, %NULL will be returned.
18943 * Returns: (transfer none): a #GObject associated with the given @attribute, or %NULL otherwise.
18948 * g_file_info_get_attribute_status:
18949 * @info: a #GFileInfo
18950 * @attribute: a file attribute key
18952 * Gets the attribute status for an attribute key.
18954 * Returns: a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
18959 * g_file_info_get_attribute_string:
18960 * @info: a #GFileInfo.
18961 * @attribute: a file attribute key.
18963 * Gets the value of a string attribute. If the attribute does
18964 * not contain a string, %NULL will be returned.
18966 * Returns: the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
18971 * g_file_info_get_attribute_stringv:
18972 * @info: a #GFileInfo.
18973 * @attribute: a file attribute key.
18975 * Gets the value of a stringv attribute. If the attribute does
18976 * not contain a stringv, %NULL will be returned.
18978 * Returns: (transfer none): the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
18984 * g_file_info_get_attribute_type:
18985 * @info: a #GFileInfo.
18986 * @attribute: a file attribute key.
18988 * Gets the attribute type for an attribute key.
18990 * Returns: a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
18995 * g_file_info_get_attribute_uint32:
18996 * @info: a #GFileInfo.
18997 * @attribute: a file attribute key.
18999 * Gets an unsigned 32-bit integer contained within the attribute. If the
19000 * attribute does not contain an unsigned 32-bit integer, or is invalid,
19001 * 0 will be returned.
19003 * Returns: an unsigned 32-bit integer from the attribute.
19008 * g_file_info_get_attribute_uint64:
19009 * @info: a #GFileInfo.
19010 * @attribute: a file attribute key.
19012 * Gets a unsigned 64-bit integer contained within the attribute. If the
19013 * attribute does not contain an unsigned 64-bit integer, or is invalid,
19014 * 0 will be returned.
19016 * Returns: a unsigned 64-bit integer from the attribute.
19021 * g_file_info_get_content_type:
19022 * @info: a #GFileInfo.
19024 * Gets the file's content type.
19026 * Returns: a string containing the file's content type.
19031 * g_file_info_get_display_name:
19032 * @info: a #GFileInfo.
19034 * Gets a display name for a file.
19036 * Returns: a string containing the display name.
19041 * g_file_info_get_edit_name:
19042 * @info: a #GFileInfo.
19044 * Gets the edit name for a file.
19046 * Returns: a string containing the edit name.
19051 * g_file_info_get_etag:
19052 * @info: a #GFileInfo.
19054 * Gets the <link linkend="gfile-etag">entity tag</link> for a given
19055 * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
19057 * Returns: a string containing the value of the "etag:value" attribute.
19062 * g_file_info_get_file_type:
19063 * @info: a #GFileInfo.
19065 * Gets a file's type (whether it is a regular file, symlink, etc).
19066 * This is different from the file's content type, see g_file_info_get_content_type().
19068 * Returns: a #GFileType for the given file.
19073 * g_file_info_get_icon:
19074 * @info: a #GFileInfo.
19076 * Gets the icon for a file.
19078 * Returns: (transfer none): #GIcon for the given @info.
19083 * g_file_info_get_is_backup:
19084 * @info: a #GFileInfo.
19086 * Checks if a file is a backup file.
19088 * Returns: %TRUE if file is a backup file, %FALSE otherwise.
19093 * g_file_info_get_is_hidden:
19094 * @info: a #GFileInfo.
19096 * Checks if a file is hidden.
19098 * Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
19103 * g_file_info_get_is_symlink:
19104 * @info: a #GFileInfo.
19106 * Checks if a file is a symlink.
19108 * Returns: %TRUE if the given @info is a symlink.
19113 * g_file_info_get_modification_time:
19114 * @info: a #GFileInfo.
19115 * @result: (out caller-allocates): a #GTimeVal.
19117 * Gets the modification time of the current @info and sets it
19123 * g_file_info_get_name:
19124 * @info: a #GFileInfo.
19126 * Gets the name for a file.
19128 * Returns: a string containing the file name.
19133 * g_file_info_get_size:
19134 * @info: a #GFileInfo.
19136 * Gets the file's size.
19138 * Returns: a #goffset containing the file's size.
19143 * g_file_info_get_sort_order:
19144 * @info: a #GFileInfo.
19146 * Gets the value of the sort_order attribute from the #GFileInfo.
19147 * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
19149 * Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
19154 * g_file_info_get_symbolic_icon:
19155 * @info: a #GFileInfo.
19157 * Gets the symbolic icon for a file.
19159 * Returns: (transfer none): #GIcon for the given @info.
19165 * g_file_info_get_symlink_target:
19166 * @info: a #GFileInfo.
19168 * Gets the symlink target for a given #GFileInfo.
19170 * Returns: a string containing the symlink target.
19175 * g_file_info_has_attribute:
19176 * @info: a #GFileInfo.
19177 * @attribute: a file attribute key.
19179 * Checks if a file info structure has an attribute named @attribute.
19181 * Returns: %TRUE if @Ginfo has an attribute named @attribute, %FALSE otherwise.
19186 * g_file_info_has_namespace:
19187 * @info: a #GFileInfo.
19188 * @name_space: a file attribute namespace.
19190 * Checks if a file info structure has an attribute in the
19191 * specified @name_space.
19193 * Returns: %TRUE if @Ginfo has an attribute in @name_space, %FALSE otherwise.
19199 * g_file_info_list_attributes:
19200 * @info: a #GFileInfo.
19201 * @name_space: a file attribute key's namespace.
19203 * Lists the file info structure's attributes.
19205 * Returns: (array zero-terminated=1) (transfer full): a null-terminated array of strings of all of the possible attribute types for the given @name_space, or %NULL on error.
19212 * Creates a new file info structure.
19214 * Returns: a #GFileInfo.
19219 * g_file_info_remove_attribute:
19220 * @info: a #GFileInfo.
19221 * @attribute: a file attribute key.
19223 * Removes all cases of @attribute from @info if it exists.
19228 * g_file_info_set_attribute:
19229 * @info: a #GFileInfo.
19230 * @attribute: a file attribute key.
19231 * @type: a #GFileAttributeType
19232 * @value_p: pointer to the value
19234 * Sets the @attribute to contain the given value, if possible. To unset the
19235 * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
19240 * g_file_info_set_attribute_boolean:
19241 * @info: a #GFileInfo.
19242 * @attribute: a file attribute key.
19243 * @attr_value: a boolean value.
19245 * Sets the @attribute to contain the given @attr_value,
19251 * g_file_info_set_attribute_byte_string:
19252 * @info: a #GFileInfo.
19253 * @attribute: a file attribute key.
19254 * @attr_value: a byte string.
19256 * Sets the @attribute to contain the given @attr_value,
19262 * g_file_info_set_attribute_int32:
19263 * @info: a #GFileInfo.
19264 * @attribute: a file attribute key.
19265 * @attr_value: a signed 32-bit integer
19267 * Sets the @attribute to contain the given @attr_value,
19273 * g_file_info_set_attribute_int64:
19274 * @info: a #GFileInfo.
19275 * @attribute: attribute name to set.
19276 * @attr_value: int64 value to set attribute to.
19278 * Sets the @attribute to contain the given @attr_value,
19284 * g_file_info_set_attribute_mask:
19285 * @info: a #GFileInfo.
19286 * @mask: a #GFileAttributeMatcher.
19288 * Sets @mask on @info to match specific attribute types.
19293 * g_file_info_set_attribute_object:
19294 * @info: a #GFileInfo.
19295 * @attribute: a file attribute key.
19296 * @attr_value: a #GObject.
19298 * Sets the @attribute to contain the given @attr_value,
19304 * g_file_info_set_attribute_status:
19305 * @info: a #GFileInfo
19306 * @attribute: a file attribute key
19307 * @status: a #GFileAttributeStatus
19309 * Sets the attribute status for an attribute key. This is only
19310 * needed by external code that implement g_file_set_attributes_from_info()
19311 * or similar functions.
19313 * The attribute must exist in @info for this to work. Otherwise %FALSE
19314 * is returned and @info is unchanged.
19316 * Returns: %TRUE if the status was changed, %FALSE if the key was not set.
19322 * g_file_info_set_attribute_string:
19323 * @info: a #GFileInfo.
19324 * @attribute: a file attribute key.
19325 * @attr_value: a UTF-8 string.
19327 * Sets the @attribute to contain the given @attr_value,
19333 * g_file_info_set_attribute_stringv:
19334 * @info: a #GFileInfo.
19335 * @attribute: a file attribute key
19336 * @attr_value: (array) (element-type utf8): a %NULL terminated array of UTF-8 strings.
19338 * Sets the @attribute to contain the given @attr_value,
19346 * g_file_info_set_attribute_uint32:
19347 * @info: a #GFileInfo.
19348 * @attribute: a file attribute key.
19349 * @attr_value: an unsigned 32-bit integer.
19351 * Sets the @attribute to contain the given @attr_value,
19357 * g_file_info_set_attribute_uint64:
19358 * @info: a #GFileInfo.
19359 * @attribute: a file attribute key.
19360 * @attr_value: an unsigned 64-bit integer.
19362 * Sets the @attribute to contain the given @attr_value,
19368 * g_file_info_set_content_type:
19369 * @info: a #GFileInfo.
19370 * @content_type: a content type. See <link linkend="gio-GContentType">GContentType</link>.
19372 * Sets the content type attribute for a given #GFileInfo.
19373 * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
19378 * g_file_info_set_display_name:
19379 * @info: a #GFileInfo.
19380 * @display_name: a string containing a display name.
19382 * Sets the display name for the current #GFileInfo.
19383 * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
19388 * g_file_info_set_edit_name:
19389 * @info: a #GFileInfo.
19390 * @edit_name: a string containing an edit name.
19392 * Sets the edit name for the current file.
19393 * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
19398 * g_file_info_set_file_type:
19399 * @info: a #GFileInfo.
19400 * @type: a #GFileType.
19402 * Sets the file type in a #GFileInfo to @type.
19403 * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
19408 * g_file_info_set_icon:
19409 * @info: a #GFileInfo.
19412 * Sets the icon for a given #GFileInfo.
19413 * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
19418 * g_file_info_set_is_hidden:
19419 * @info: a #GFileInfo.
19420 * @is_hidden: a #gboolean.
19422 * Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
19423 * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
19428 * g_file_info_set_is_symlink:
19429 * @info: a #GFileInfo.
19430 * @is_symlink: a #gboolean.
19432 * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
19433 * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
19438 * g_file_info_set_modification_time:
19439 * @info: a #GFileInfo.
19440 * @mtime: a #GTimeVal.
19442 * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
19443 * info to the given time value.
19448 * g_file_info_set_name:
19449 * @info: a #GFileInfo.
19450 * @name: a string containing a name.
19452 * Sets the name attribute for the current #GFileInfo.
19453 * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
19458 * g_file_info_set_size:
19459 * @info: a #GFileInfo.
19460 * @size: a #goffset containing the file's size.
19462 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
19463 * to the given size.
19468 * g_file_info_set_sort_order:
19469 * @info: a #GFileInfo.
19470 * @sort_order: a sort order integer.
19472 * Sets the sort order attribute in the file info structure. See
19473 * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
19478 * g_file_info_set_symbolic_icon:
19479 * @info: a #GFileInfo.
19482 * Sets the symbolic icon for a given #GFileInfo.
19483 * See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
19490 * g_file_info_set_symlink_target:
19491 * @info: a #GFileInfo.
19492 * @symlink_target: a static string containing a path to a symlink target.
19494 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
19495 * to the given symlink target.
19500 * g_file_info_unset_attribute_mask:
19501 * @info: #GFileInfo.
19503 * Unsets a mask set by g_file_info_set_attribute_mask(), if one
19509 * g_file_input_stream_query_info:
19510 * @stream: a #GFileInputStream.
19511 * @attributes: a file attribute query string.
19512 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19513 * @error: a #GError location to store the error occurring, or %NULL to ignore.
19515 * Queries a file input stream the given @attributes. This function blocks
19516 * while querying the stream. For the asynchronous (non-blocking) version
19517 * of this function, see g_file_input_stream_query_info_async(). While the
19518 * stream is blocked, the stream will set the pending flag internally, and
19519 * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
19521 * Returns: (transfer full): a #GFileInfo, or %NULL on error.
19526 * g_file_input_stream_query_info_async:
19527 * @stream: a #GFileInputStream.
19528 * @attributes: a file attribute query string.
19529 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
19530 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19531 * @callback: (scope async): callback to call when the request is satisfied
19532 * @user_data: (closure): the data to pass to callback function
19534 * Queries the stream information asynchronously.
19535 * When the operation is finished @callback will be called.
19536 * You can then call g_file_input_stream_query_info_finish()
19537 * to get the result of the operation.
19539 * For the synchronous version of this function,
19540 * see g_file_input_stream_query_info().
19542 * If @cancellable is not %NULL, then the operation can be cancelled by
19543 * triggering the cancellable object from another thread. If the operation
19544 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set
19549 * g_file_input_stream_query_info_finish:
19550 * @stream: a #GFileInputStream.
19551 * @result: a #GAsyncResult.
19552 * @error: a #GError location to store the error occurring, or %NULL to ignore.
19554 * Finishes an asynchronous info query operation.
19556 * Returns: (transfer full): #GFileInfo.
19561 * g_file_io_stream_get_etag:
19562 * @stream: a #GFileIOStream.
19564 * Gets the entity tag for the file when it has been written.
19565 * This must be called after the stream has been written
19566 * and closed, as the etag can change while writing.
19568 * Returns: the entity tag for the stream.
19574 * g_file_io_stream_query_info:
19575 * @stream: a #GFileIOStream.
19576 * @attributes: a file attribute query string.
19577 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19578 * @error: a #GError, %NULL to ignore.
19580 * Queries a file io stream for the given @attributes.
19581 * This function blocks while querying the stream. For the asynchronous
19582 * version of this function, see g_file_io_stream_query_info_async().
19583 * While the stream is blocked, the stream will set the pending flag
19584 * internally, and any other operations on the stream will fail with
19585 * %G_IO_ERROR_PENDING.
19587 * Can fail if the stream was already closed (with @error being set to
19588 * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19589 * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19590 * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
19591 * all cases of failure, %NULL will be returned.
19593 * If @cancellable is not %NULL, then the operation can be cancelled by
19594 * triggering the cancellable object from another thread. If the operation
19595 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19598 * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19604 * g_file_io_stream_query_info_async:
19605 * @stream: a #GFileIOStream.
19606 * @attributes: a file attribute query string.
19607 * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19608 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19609 * @callback: (scope async): callback to call when the request is satisfied
19610 * @user_data: (closure): the data to pass to callback function
19612 * Asynchronously queries the @stream for a #GFileInfo. When completed,
19613 * @callback will be called with a #GAsyncResult which can be used to
19614 * finish the operation with g_file_io_stream_query_info_finish().
19616 * For the synchronous version of this function, see
19617 * g_file_io_stream_query_info().
19624 * g_file_io_stream_query_info_finish:
19625 * @stream: a #GFileIOStream.
19626 * @result: a #GAsyncResult.
19627 * @error: a #GError, %NULL to ignore.
19629 * Finalizes the asynchronous query started
19630 * by g_file_io_stream_query_info_async().
19632 * Returns: (transfer full): A #GFileInfo for the finished query.
19638 * g_file_is_native:
19639 * @file: input #GFile
19641 * Checks to see if a file is native to the platform.
19643 * A native file s one expressed in the platform-native filename format,
19644 * e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
19645 * as it might be on a locally mounted remote filesystem.
19647 * On some systems non-native files may be available using the native
19648 * filesystem via a userspace filesystem (FUSE), in these cases this call
19649 * will return %FALSE, but g_file_get_path() will still return a native path.
19651 * This call does no blocking I/O.
19653 * Returns: %TRUE if @file is native
19658 * g_file_load_contents:
19659 * @file: input #GFile
19660 * @cancellable: optional #GCancellable object, %NULL to ignore
19661 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19662 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19663 * @etag_out: (out) (allow-none): a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
19664 * @error: a #GError, or %NULL
19666 * Loads the content of the file into memory. The data is always
19667 * zero-terminated, but this is not included in the resultant @length.
19668 * The returned @content should be freed with g_free() when no longer
19671 * If @cancellable is not %NULL, then the operation can be cancelled by
19672 * triggering the cancellable object from another thread. If the operation
19673 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19675 * Returns: %TRUE if the @file's contents were successfully loaded. %FALSE if there were errors.
19680 * g_file_load_contents_async:
19681 * @file: input #GFile
19682 * @cancellable: optional #GCancellable object, %NULL to ignore
19683 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19684 * @user_data: the data to pass to callback function
19686 * Starts an asynchronous load of the @file's contents.
19688 * For more details, see g_file_load_contents() which is
19689 * the synchronous version of this call.
19691 * When the load operation has completed, @callback will be called
19692 * with @user data. To finish the operation, call
19693 * g_file_load_contents_finish() with the #GAsyncResult returned by
19696 * If @cancellable is not %NULL, then the operation can be cancelled by
19697 * triggering the cancellable object from another thread. If the operation
19698 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19703 * g_file_load_contents_finish:
19704 * @file: input #GFile
19705 * @res: a #GAsyncResult
19706 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19707 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19708 * @etag_out: (out) (allow-none): a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
19709 * @error: a #GError, or %NULL
19711 * Finishes an asynchronous load of the @file's contents.
19712 * The contents are placed in @contents, and @length is set to the
19713 * size of the @contents string. The @content should be freed with
19714 * g_free() when no longer needed. If @etag_out is present, it will be
19715 * set to the new entity tag for the @file.
19717 * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19722 * g_file_load_partial_contents_async: (skip)
19723 * @file: input #GFile
19724 * @cancellable: optional #GCancellable object, %NULL to ignore
19725 * @read_more_callback: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read
19726 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19727 * @user_data: the data to pass to the callback functions
19729 * Reads the partial contents of a file. A #GFileReadMoreCallback should
19730 * be used to stop reading from the file when appropriate, else this
19731 * function will behave exactly as g_file_load_contents_async(). This
19732 * operation can be finished by g_file_load_partial_contents_finish().
19734 * Users of this function should be aware that @user_data is passed to
19735 * both the @read_more_callback and the @callback.
19737 * If @cancellable is not %NULL, then the operation can be cancelled by
19738 * triggering the cancellable object from another thread. If the operation
19739 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19744 * g_file_load_partial_contents_finish:
19745 * @file: input #GFile
19746 * @res: a #GAsyncResult
19747 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19748 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19749 * @etag_out: (out) (allow-none): a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
19750 * @error: a #GError, or %NULL
19752 * Finishes an asynchronous partial load operation that was started
19753 * with g_file_load_partial_contents_async(). The data is always
19754 * zero-terminated, but this is not included in the resultant @length.
19755 * The returned @content should be freed with g_free() when no longer
19758 * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19763 * g_file_make_directory:
19764 * @file: input #GFile
19765 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19766 * @error: a #GError, or %NULL
19768 * Creates a directory. Note that this will only create a child directory
19769 * of the immediate parent directory of the path or URI given by the #GFile.
19770 * To recursively create directories, see g_file_make_directory_with_parents().
19771 * This function will fail if the parent directory does not exist, setting
19772 * @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support
19773 * creating directories, this function will fail, setting @error to
19774 * %G_IO_ERROR_NOT_SUPPORTED.
19776 * For a local #GFile the newly created directory will have the default
19777 * (current) ownership and permissions of the current process.
19779 * If @cancellable is not %NULL, then the operation can be cancelled by
19780 * triggering the cancellable object from another thread. If the operation
19781 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19783 * Returns: %TRUE on successful creation, %FALSE otherwise.
19788 * g_file_make_directory_with_parents:
19789 * @file: input #GFile
19790 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19791 * @error: a #GError, or %NULL
19793 * Creates a directory and any parent directories that may not
19794 * exist similar to 'mkdir -p'. If the file system does not support
19795 * creating directories, this function will fail, setting @error to
19796 * %G_IO_ERROR_NOT_SUPPORTED. If the directory itself already exists,
19797 * this function will fail setting @error to %G_IO_ERROR_EXISTS, unlike
19798 * the similar g_mkdir_with_parents().
19800 * For a local #GFile the newly created directories will have the default
19801 * (current) ownership and permissions of the current process.
19803 * If @cancellable is not %NULL, then the operation can be cancelled by
19804 * triggering the cancellable object from another thread. If the operation
19805 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19807 * Returns: %TRUE if all directories have been successfully created, %FALSE otherwise.
19813 * g_file_make_symbolic_link:
19814 * @file: a #GFile with the name of the symlink to create
19815 * @symlink_value: a string with the path for the target of the new symlink
19816 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19817 * @error: a #GError
19819 * Creates a symbolic link named @file which contains the string
19822 * If @cancellable is not %NULL, then the operation can be cancelled by
19823 * triggering the cancellable object from another thread. If the operation
19824 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19826 * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
19832 * @file: input #GFile
19833 * @flags: a set of #GFileMonitorFlags
19834 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19835 * @error: a #GError, or %NULL
19837 * Obtains a file or directory monitor for the given file,
19838 * depending on the type of the file.
19840 * If @cancellable is not %NULL, then the operation can be cancelled by
19841 * triggering the cancellable object from another thread. If the operation
19842 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19844 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19850 * g_file_monitor_cancel:
19851 * @monitor: a #GFileMonitor.
19853 * Cancels a file monitor.
19855 * Returns: %TRUE if monitor was cancelled.
19860 * g_file_monitor_directory:
19861 * @file: input #GFile
19862 * @flags: a set of #GFileMonitorFlags
19863 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19864 * @error: a #GError, or %NULL
19866 * Obtains a directory monitor for the given file.
19867 * This may fail if directory monitoring is not supported.
19869 * If @cancellable is not %NULL, then the operation can be cancelled by
19870 * triggering the cancellable object from another thread. If the operation
19871 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19873 * Virtual: monitor_dir
19874 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19879 * g_file_monitor_emit_event:
19880 * @monitor: a #GFileMonitor.
19881 * @child: a #GFile.
19882 * @other_file: a #GFile.
19883 * @event_type: a set of #GFileMonitorEvent flags.
19885 * Emits the #GFileMonitor::changed signal if a change
19886 * has taken place. Should be called from file monitor
19887 * implementations only.
19889 * The signal will be emitted from an idle handler (in the <link
19890 * linkend="g-main-context-push-thread-default">thread-default main
19896 * g_file_monitor_file:
19897 * @file: input #GFile
19898 * @flags: a set of #GFileMonitorFlags
19899 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19900 * @error: a #GError, or %NULL
19902 * Obtains a file monitor for the given file. If no file notification
19903 * mechanism exists, then regular polling of the file is used.
19905 * If @cancellable is not %NULL, then the operation can be cancelled by
19906 * triggering the cancellable object from another thread. If the operation
19907 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19909 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19914 * g_file_monitor_is_cancelled:
19915 * @monitor: a #GFileMonitor
19917 * Returns whether the monitor is canceled.
19919 * Returns: %TRUE if monitor is canceled. %FALSE otherwise.
19924 * g_file_monitor_set_rate_limit:
19925 * @monitor: a #GFileMonitor.
19926 * @limit_msecs: a non-negative integer with the limit in milliseconds to poll for changes
19928 * Sets the rate limit to which the @monitor will report
19929 * consecutive change events to the same file.
19934 * g_file_mount_enclosing_volume:
19935 * @location: input #GFile
19936 * @flags: flags affecting the operation
19937 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction
19938 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19939 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19940 * @user_data: the data to pass to callback function
19942 * Starts a @mount_operation, mounting the volume that contains
19943 * the file @location.
19945 * When this operation has completed, @callback will be called with
19946 * @user_user data, and the operation can be finalized with
19947 * g_file_mount_enclosing_volume_finish().
19949 * If @cancellable is not %NULL, then the operation can be cancelled by
19950 * triggering the cancellable object from another thread. If the operation
19951 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19956 * g_file_mount_enclosing_volume_finish:
19957 * @location: input #GFile
19958 * @result: a #GAsyncResult
19959 * @error: a #GError, or %NULL
19961 * Finishes a mount operation started by g_file_mount_enclosing_volume().
19963 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19968 * g_file_mount_mountable:
19969 * @file: input #GFile
19970 * @flags: flags affecting the operation
19971 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
19972 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19973 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19974 * @user_data: (closure): the data to pass to callback function
19976 * Mounts a file of type G_FILE_TYPE_MOUNTABLE.
19977 * Using @mount_operation, you can request callbacks when, for instance,
19978 * passwords are needed during authentication.
19980 * If @cancellable is not %NULL, then the operation can be cancelled by
19981 * triggering the cancellable object from another thread. If the operation
19982 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19984 * When the operation is finished, @callback will be called.
19985 * You can then call g_file_mount_mountable_finish() to get
19986 * the result of the operation.
19991 * g_file_mount_mountable_finish:
19992 * @file: input #GFile
19993 * @result: a #GAsyncResult
19994 * @error: a #GError, or %NULL
19996 * Finishes a mount operation. See g_file_mount_mountable() for details.
19998 * Finish an asynchronous mount operation that was started
19999 * with g_file_mount_mountable().
20001 * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
20007 * @source: #GFile pointing to the source location
20008 * @destination: #GFile pointing to the destination location
20009 * @flags: set of #GFileCopyFlags
20010 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20011 * @progress_callback: (allow-none) (scope call): #GFileProgressCallback function for updates
20012 * @progress_callback_data: (closure): gpointer to user data for the callback function
20013 * @error: #GError for returning error conditions, or %NULL
20015 * Tries to move the file or directory @source to the location specified
20016 * by @destination. If native move operations are supported then this is
20017 * used, otherwise a copy + delete fallback is used. The native
20018 * implementation may support moving directories (for instance on moves
20019 * inside the same filesystem), but the fallback code does not.
20021 * If the flag #G_FILE_COPY_OVERWRITE is specified an already
20022 * existing @destination file is overwritten.
20024 * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
20025 * will be copied as symlinks, otherwise the target of the
20026 * @source symlink will be copied.
20028 * If @cancellable is not %NULL, then the operation can be cancelled by
20029 * triggering the cancellable object from another thread. If the operation
20030 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20032 * If @progress_callback is not %NULL, then the operation can be monitored
20033 * by setting this to a #GFileProgressCallback function.
20034 * @progress_callback_data will be passed to this function. It is
20035 * guaranteed that this callback will be called after all data has been
20036 * transferred with the total number of bytes copied during the operation.
20038 * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND
20039 * error is returned, independent on the status of the @destination.
20041 * If #G_FILE_COPY_OVERWRITE is not specified and the target exists,
20042 * then the error %G_IO_ERROR_EXISTS is returned.
20044 * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
20045 * error is returned. If trying to overwrite a directory with a directory the
20046 * %G_IO_ERROR_WOULD_MERGE error is returned.
20048 * If the source is a directory and the target does not exist, or
20049 * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then
20050 * the %G_IO_ERROR_WOULD_RECURSE error may be returned (if the native
20051 * move operation isn't available).
20053 * Returns: %TRUE on successful move, %FALSE otherwise.
20058 * g_file_new_for_commandline_arg:
20059 * @arg: a command line string
20061 * Creates a #GFile with the given argument from the command line.
20062 * The value of @arg can be either a URI, an absolute path or a
20063 * relative path resolved relative to the current working directory.
20064 * This operation never fails, but the returned object might not
20065 * support any I/O operation if @arg points to a malformed path.
20067 * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
20072 * g_file_new_for_path:
20073 * @path: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
20075 * Constructs a #GFile for a given path. This operation never
20076 * fails, but the returned object might not support any I/O
20077 * operation if @path is malformed.
20079 * Returns: (transfer full): a new #GFile for the given @path. Free the returned object with g_object_unref().
20084 * g_file_new_for_uri:
20085 * @uri: a UTF-8 string containing a URI
20087 * Constructs a #GFile for a given URI. This operation never
20088 * fails, but the returned object might not support any I/O
20089 * operation if @uri is malformed or if the uri type is
20092 * Returns: (transfer full): a new #GFile for the given @uri. Free the returned object with g_object_unref().
20098 * @tmpl: (type filename) (allow-none): Template for the file name, as in g_file_open_tmp(), or %NULL for a default template
20099 * @iostream: (out): on return, a #GFileIOStream for the created file
20100 * @error: a #GError, or %NULL
20102 * Opens a file in the preferred directory for temporary files (as
20103 * returned by g_get_tmp_dir()) and returns a #GFile and
20104 * #GFileIOStream pointing to it.
20106 * @tmpl should be a string in the GLib file name encoding
20107 * containing a sequence of six 'X' characters, and containing no
20108 * directory components. If it is %NULL, a default template is used.
20110 * Unlike the other #GFile constructors, this will return %NULL if
20111 * a temporary file could not be created.
20113 * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
20119 * g_file_open_readwrite:
20120 * @file: #GFile to open
20121 * @cancellable: (allow-none): a #GCancellable
20122 * @error: a #GError, or %NULL
20124 * Opens an existing file for reading and writing. The result is
20125 * a #GFileIOStream that can be used to read and write the contents
20128 * If @cancellable is not %NULL, then the operation can be cancelled
20129 * by triggering the cancellable object from another thread. If the
20130 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20133 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
20134 * be returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
20135 * error will be returned. Other errors are possible too, and depend on
20136 * what kind of filesystem the file is on. Note that in many non-local
20137 * file cases read and write streams are not supported, so make sure you
20138 * really need to do read and write streaming, rather than just opening
20139 * for reading or writing.
20141 * Returns: (transfer full): #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20147 * g_file_open_readwrite_async:
20148 * @file: input #GFile
20149 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20150 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20151 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20152 * @user_data: (closure): the data to pass to callback function
20154 * Asynchronously opens @file for reading and writing.
20156 * For more details, see g_file_open_readwrite() which is
20157 * the synchronous version of this call.
20159 * When the operation is finished, @callback will be called.
20160 * You can then call g_file_open_readwrite_finish() to get
20161 * the result of the operation.
20168 * g_file_open_readwrite_finish:
20169 * @file: input #GFile
20170 * @res: a #GAsyncResult
20171 * @error: a #GError, or %NULL
20173 * Finishes an asynchronous file read operation started with
20174 * g_file_open_readwrite_async().
20176 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20182 * g_file_output_stream_get_etag:
20183 * @stream: a #GFileOutputStream.
20185 * Gets the entity tag for the file when it has been written.
20186 * This must be called after the stream has been written
20187 * and closed, as the etag can change while writing.
20189 * Returns: the entity tag for the stream.
20194 * g_file_output_stream_query_info:
20195 * @stream: a #GFileOutputStream.
20196 * @attributes: a file attribute query string.
20197 * @cancellable: optional #GCancellable object, %NULL to ignore.
20198 * @error: a #GError, %NULL to ignore.
20200 * Queries a file output stream for the given @attributes.
20201 * This function blocks while querying the stream. For the asynchronous
20202 * version of this function, see g_file_output_stream_query_info_async().
20203 * While the stream is blocked, the stream will set the pending flag
20204 * internally, and any other operations on the stream will fail with
20205 * %G_IO_ERROR_PENDING.
20207 * Can fail if the stream was already closed (with @error being set to
20208 * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
20209 * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
20210 * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
20211 * all cases of failure, %NULL will be returned.
20213 * If @cancellable is not %NULL, then the operation can be cancelled by
20214 * triggering the cancellable object from another thread. If the operation
20215 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
20218 * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
20223 * g_file_output_stream_query_info_async:
20224 * @stream: a #GFileOutputStream.
20225 * @attributes: a file attribute query string.
20226 * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
20227 * @cancellable: optional #GCancellable object, %NULL to ignore.
20228 * @callback: callback to call when the request is satisfied
20229 * @user_data: the data to pass to callback function
20231 * Asynchronously queries the @stream for a #GFileInfo. When completed,
20232 * @callback will be called with a #GAsyncResult which can be used to
20233 * finish the operation with g_file_output_stream_query_info_finish().
20235 * For the synchronous version of this function, see
20236 * g_file_output_stream_query_info().
20241 * g_file_output_stream_query_info_finish:
20242 * @stream: a #GFileOutputStream.
20243 * @result: a #GAsyncResult.
20244 * @error: a #GError, %NULL to ignore.
20246 * Finalizes the asynchronous query started
20247 * by g_file_output_stream_query_info_async().
20249 * Returns: (transfer full): A #GFileInfo for the finished query.
20254 * g_file_parse_name:
20255 * @parse_name: a file name or path to be parsed
20257 * Constructs a #GFile with the given @parse_name (i.e. something
20258 * given by g_file_get_parse_name()). This operation never fails,
20259 * but the returned object might not support any I/O operation if
20260 * the @parse_name cannot be parsed.
20262 * Returns: (transfer full): a new #GFile.
20267 * g_file_poll_mountable:
20268 * @file: input #GFile
20269 * @cancellable: optional #GCancellable object, %NULL to ignore
20270 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20271 * @user_data: the data to pass to callback function
20273 * Polls a file of type #G_FILE_TYPE_MOUNTABLE.
20275 * If @cancellable is not %NULL, then the operation can be cancelled by
20276 * triggering the cancellable object from another thread. If the operation
20277 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20279 * When the operation is finished, @callback will be called.
20280 * You can then call g_file_mount_mountable_finish() to get
20281 * the result of the operation.
20288 * g_file_poll_mountable_finish:
20289 * @file: input #GFile
20290 * @result: a #GAsyncResult
20291 * @error: a #GError, or %NULL
20293 * Finishes a poll operation. See g_file_poll_mountable() for details.
20295 * Finish an asynchronous poll operation that was polled
20296 * with g_file_poll_mountable().
20298 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20304 * g_file_query_default_handler:
20305 * @file: a #GFile to open
20306 * @cancellable: optional #GCancellable object, %NULL to ignore
20307 * @error: a #GError, or %NULL
20309 * Returns the #GAppInfo that is registered as the default
20310 * application to handle the file specified by @file.
20312 * If @cancellable is not %NULL, then the operation can be cancelled by
20313 * triggering the cancellable object from another thread. If the operation
20314 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20316 * Returns: (transfer full): a #GAppInfo if the handle was found, %NULL if there were errors. When you are done with it, release it with g_object_unref()
20321 * g_file_query_exists:
20322 * @file: input #GFile
20323 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20325 * Utility function to check if a particular file exists. This is
20326 * implemented using g_file_query_info() and as such does blocking I/O.
20328 * Note that in many cases it is racy to first check for file existence
20329 * and then execute something based on the outcome of that, because the
20330 * file might have been created or removed in between the operations. The
20331 * general approach to handling that is to not check, but just do the
20332 * operation and handle the errors as they come.
20334 * As an example of race-free checking, take the case of reading a file,
20335 * and if it doesn't exist, creating it. There are two racy versions: read
20336 * it, and on error create it; and: check if it exists, if not create it.
20337 * These can both result in two processes creating the file (with perhaps
20338 * a partially written file as the result). The correct approach is to
20339 * always try to create the file with g_file_create() which will either
20340 * atomically create the file or fail with a %G_IO_ERROR_EXISTS error.
20342 * However, in many cases an existence check is useful in a user interface,
20343 * for instance to make a menu item sensitive/insensitive, so that you don't
20344 * have to fool users that something is possible and then just show an error
20345 * dialog. If you do this, you should make sure to also handle the errors
20346 * that can happen due to races when you execute the operation.
20348 * Returns: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
20353 * g_file_query_file_type:
20354 * @file: input #GFile
20355 * @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info()
20356 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20358 * Utility function to inspect the #GFileType of a file. This is
20359 * implemented using g_file_query_info() and as such does blocking I/O.
20361 * The primary use case of this method is to check if a file is
20362 * a regular file, directory, or symlink.
20364 * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist
20370 * g_file_query_filesystem_info:
20371 * @file: input #GFile
20372 * @attributes: an attribute query string
20373 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20374 * @error: a #GError
20376 * Similar to g_file_query_info(), but obtains information
20377 * about the filesystem the @file is on, rather than the file itself.
20378 * For instance the amount of space available and the type of
20381 * The @attributes value is a string that specifies the attributes
20382 * that should be gathered. It is not an error if it's not possible
20383 * to read a particular requested attribute from a file - it just
20384 * won't be set. @attributes should be a comma-separated list of
20385 * attributes or attribute wildcards. The wildcard "*" means all
20386 * attributes, and a wildcard like "filesystem::*" means all attributes
20387 * in the filesystem namespace. The standard namespace for filesystem
20388 * attributes is "filesystem". Common attributes of interest are
20389 * #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem
20390 * in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available),
20391 * and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
20393 * If @cancellable is not %NULL, then the operation can be cancelled
20394 * by triggering the cancellable object from another thread. If the
20395 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20398 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
20399 * be returned. Other errors are possible too, and depend on what
20400 * kind of filesystem the file is on.
20402 * Returns: (transfer full): a #GFileInfo or %NULL if there was an error. Free the returned object with g_object_unref().
20407 * g_file_query_filesystem_info_async:
20408 * @file: input #GFile
20409 * @attributes: an attribute query string
20410 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20411 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20412 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20413 * @user_data: (closure): the data to pass to callback function
20415 * Asynchronously gets the requested information about the filesystem
20416 * that the specified @file is on. The result is a #GFileInfo object
20417 * that contains key-value attributes (such as type or size for the
20420 * For more details, see g_file_query_filesystem_info() which is the
20421 * synchronous version of this call.
20423 * When the operation is finished, @callback will be called. You can
20424 * then call g_file_query_info_finish() to get the result of the
20430 * g_file_query_filesystem_info_finish:
20431 * @file: input #GFile
20432 * @res: a #GAsyncResult
20433 * @error: a #GError
20435 * Finishes an asynchronous filesystem info query.
20436 * See g_file_query_filesystem_info_async().
20438 * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
20443 * g_file_query_info:
20444 * @file: input #GFile
20445 * @attributes: an attribute query string
20446 * @flags: a set of #GFileQueryInfoFlags
20447 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20448 * @error: a #GError
20450 * Gets the requested information about specified @file.
20451 * The result is a #GFileInfo object that contains key-value
20452 * attributes (such as the type or size of the file).
20454 * The @attributes value is a string that specifies the file
20455 * attributes that should be gathered. It is not an error if
20456 * it's not possible to read a particular requested attribute
20457 * from a file - it just won't be set. @attributes should be a
20458 * comma-separated list of attributes or attribute wildcards.
20459 * The wildcard "*" means all attributes, and a wildcard like
20460 * "standard::*" means all attributes in the standard namespace.
20461 * An example attribute query be "standard::*,owner::user".
20462 * The standard attributes are available as defines, like
20463 * #G_FILE_ATTRIBUTE_STANDARD_NAME.
20465 * If @cancellable is not %NULL, then the operation can be cancelled
20466 * by triggering the cancellable object from another thread. If the
20467 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20470 * For symlinks, normally the information about the target of the
20471 * symlink is returned, rather than information about the symlink
20472 * itself. However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS
20473 * in @flags the information about the symlink itself will be returned.
20474 * Also, for symlinks that point to non-existing files the information
20475 * about the symlink itself will be returned.
20477 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
20478 * returned. Other errors are possible too, and depend on what kind of
20479 * filesystem the file is on.
20481 * Returns: (transfer full): a #GFileInfo for the given @file, or %NULL on error. Free the returned object with g_object_unref().
20486 * g_file_query_info_async:
20487 * @file: input #GFile
20488 * @attributes: an attribute query string
20489 * @flags: a set of #GFileQueryInfoFlags
20490 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20491 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20492 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20493 * @user_data: (closure): the data to pass to callback function
20495 * Asynchronously gets the requested information about specified @file.
20496 * The result is a #GFileInfo object that contains key-value attributes
20497 * (such as type or size for the file).
20499 * For more details, see g_file_query_info() which is the synchronous
20500 * version of this call.
20502 * When the operation is finished, @callback will be called. You can
20503 * then call g_file_query_info_finish() to get the result of the operation.
20508 * g_file_query_info_finish:
20509 * @file: input #GFile
20510 * @res: a #GAsyncResult
20511 * @error: a #GError
20513 * Finishes an asynchronous file info query.
20514 * See g_file_query_info_async().
20516 * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
20521 * g_file_query_settable_attributes:
20522 * @file: input #GFile
20523 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20524 * @error: a #GError, or %NULL
20526 * Obtain the list of settable attributes for the file.
20528 * Returns the type and full attribute name of all the attributes
20529 * that can be set on this file. This doesn't mean setting it will
20530 * always succeed though, you might get an access failure, or some
20531 * specific file may not support a specific attribute.
20533 * If @cancellable is not %NULL, then the operation can be cancelled by
20534 * triggering the cancellable object from another thread. If the operation
20535 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20537 * Returns: a #GFileAttributeInfoList describing the settable attributes. When you are done with it, release it with g_file_attribute_info_list_unref()
20542 * g_file_query_writable_namespaces:
20543 * @file: input #GFile
20544 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20545 * @error: a #GError, or %NULL
20547 * Obtain the list of attribute namespaces where new attributes
20548 * can be created by a user. An example of this is extended
20549 * attributes (in the "xattr" namespace).
20551 * If @cancellable is not %NULL, then the operation can be cancelled by
20552 * triggering the cancellable object from another thread. If the operation
20553 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20555 * Returns: a #GFileAttributeInfoList describing the writable namespaces. When you are done with it, release it with g_file_attribute_info_list_unref()
20561 * @file: #GFile to read
20562 * @cancellable: (allow-none): a #GCancellable
20563 * @error: a #GError, or %NULL
20565 * Opens a file for reading. The result is a #GFileInputStream that
20566 * can be used to read the contents of the file.
20568 * If @cancellable is not %NULL, then the operation can be cancelled by
20569 * triggering the cancellable object from another thread. If the operation
20570 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20572 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
20573 * returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
20574 * error will be returned. Other errors are possible too, and depend
20575 * on what kind of filesystem the file is on.
20578 * Returns: (transfer full): #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20583 * g_file_read_async:
20584 * @file: input #GFile
20585 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20586 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20587 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20588 * @user_data: (closure): the data to pass to callback function
20590 * Asynchronously opens @file for reading.
20592 * For more details, see g_file_read() which is
20593 * the synchronous version of this call.
20595 * When the operation is finished, @callback will be called.
20596 * You can then call g_file_read_finish() to get the result
20597 * of the operation.
20602 * g_file_read_finish:
20603 * @file: input #GFile
20604 * @res: a #GAsyncResult
20605 * @error: a #GError, or %NULL
20607 * Finishes an asynchronous file read operation started with
20608 * g_file_read_async().
20610 * Returns: (transfer full): a #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20616 * @file: input #GFile
20617 * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20618 * @make_backup: %TRUE if a backup should be created
20619 * @flags: a set of #GFileCreateFlags
20620 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20621 * @error: a #GError, or %NULL
20623 * Returns an output stream for overwriting the file, possibly
20624 * creating a backup copy of the file first. If the file doesn't exist,
20625 * it will be created.
20627 * This will try to replace the file in the safest way possible so
20628 * that any errors during the writing will not affect an already
20629 * existing copy of the file. For instance, for local files it
20630 * may write to a temporary file and then atomically rename over
20631 * the destination when the stream is closed.
20633 * By default files created are generally readable by everyone,
20634 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
20635 * will be made readable only to the current user, to the level that
20636 * is supported on the target filesystem.
20638 * If @cancellable is not %NULL, then the operation can be cancelled
20639 * by triggering the cancellable object from another thread. If the
20640 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20643 * If you pass in a non-%NULL @etag value, then this value is
20644 * compared to the current entity tag of the file, and if they differ
20645 * an %G_IO_ERROR_WRONG_ETAG error is returned. This generally means
20646 * that the file has been changed since you last read it. You can get
20647 * the new etag from g_file_output_stream_get_etag() after you've
20648 * finished writing and closed the #GFileOutputStream. When you load
20649 * a new file you can use g_file_input_stream_query_info() to get
20650 * the etag of the file.
20652 * If @make_backup is %TRUE, this function will attempt to make a
20653 * backup of the current file before overwriting it. If this fails
20654 * a %G_IO_ERROR_CANT_CREATE_BACKUP error will be returned. If you
20655 * want to replace anyway, try again with @make_backup set to %FALSE.
20657 * If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will
20658 * be returned, and if the file is some other form of non-regular file
20659 * then a %G_IO_ERROR_NOT_REGULAR_FILE error will be returned. Some
20660 * file systems don't allow all file names, and may return an
20661 * %G_IO_ERROR_INVALID_FILENAME error, and if the name is to long
20662 * %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are
20663 * possible too, and depend on what kind of filesystem the file is on.
20665 * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
20670 * g_file_replace_async:
20671 * @file: input #GFile
20672 * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20673 * @make_backup: %TRUE if a backup should be created
20674 * @flags: a set of #GFileCreateFlags
20675 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20676 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20677 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20678 * @user_data: (closure): the data to pass to callback function
20680 * Asynchronously overwrites the file, replacing the contents,
20681 * possibly creating a backup copy of the file first.
20683 * For more details, see g_file_replace() which is
20684 * the synchronous version of this call.
20686 * When the operation is finished, @callback will be called.
20687 * You can then call g_file_replace_finish() to get the result
20688 * of the operation.
20693 * g_file_replace_contents:
20694 * @file: input #GFile
20695 * @contents: (element-type guint8) (array length=length): a string containing the new contents for @file
20696 * @length: the length of @contents in bytes
20697 * @etag: (allow-none): the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
20698 * @make_backup: %TRUE if a backup should be created
20699 * @flags: a set of #GFileCreateFlags
20700 * @new_etag: (allow-none) (out): a location to a new <link linkend="gfile-etag">entity tag</link> for the document. This should be freed with g_free() when no longer needed, or %NULL
20701 * @cancellable: optional #GCancellable object, %NULL to ignore
20702 * @error: a #GError, or %NULL
20704 * Replaces the contents of @file with @contents of @length bytes.
20706 * If @etag is specified (not %NULL), any existing file must have that etag,
20707 * or the error %G_IO_ERROR_WRONG_ETAG will be returned.
20709 * If @make_backup is %TRUE, this function will attempt to make a backup
20712 * If @cancellable is not %NULL, then the operation can be cancelled by
20713 * triggering the cancellable object from another thread. If the operation
20714 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20716 * The returned @new_etag can be used to verify that the file hasn't
20717 * changed the next time it is saved over.
20719 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
20724 * g_file_replace_contents_async:
20725 * @file: input #GFile
20726 * @contents: (element-type guint8) (array length=length): string of contents to replace the file with
20727 * @length: the length of @contents in bytes
20728 * @etag: (allow-none): a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
20729 * @make_backup: %TRUE if a backup should be created
20730 * @flags: a set of #GFileCreateFlags
20731 * @cancellable: optional #GCancellable object, %NULL to ignore
20732 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
20733 * @user_data: the data to pass to callback function
20735 * Starts an asynchronous replacement of @file with the given
20736 * @contents of @length bytes. @etag will replace the document's
20737 * current entity tag.
20739 * When this operation has completed, @callback will be called with
20740 * @user_user data, and the operation can be finalized with
20741 * g_file_replace_contents_finish().
20743 * If @cancellable is not %NULL, then the operation can be cancelled by
20744 * triggering the cancellable object from another thread. If the operation
20745 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20747 * If @make_backup is %TRUE, this function will attempt to
20748 * make a backup of @file.
20753 * g_file_replace_contents_finish:
20754 * @file: input #GFile
20755 * @res: a #GAsyncResult
20756 * @new_etag: (out) (allow-none): a location of a new <link linkend="gfile-etag">entity tag</link> for the document. This should be freed with g_free() when it is no longer needed, or %NULL
20757 * @error: a #GError, or %NULL
20759 * Finishes an asynchronous replace of the given @file. See
20760 * g_file_replace_contents_async(). Sets @new_etag to the new entity
20761 * tag for the document, if present.
20763 * Returns: %TRUE on success, %FALSE on failure.
20768 * g_file_replace_finish:
20769 * @file: input #GFile
20770 * @res: a #GAsyncResult
20771 * @error: a #GError, or %NULL
20773 * Finishes an asynchronous file replace operation started with
20774 * g_file_replace_async().
20776 * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
20781 * g_file_replace_readwrite:
20783 * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20784 * @make_backup: %TRUE if a backup should be created
20785 * @flags: a set of #GFileCreateFlags
20786 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20787 * @error: return location for a #GError, or %NULL
20789 * Returns an output stream for overwriting the file in readwrite mode,
20790 * possibly creating a backup copy of the file first. If the file doesn't
20791 * exist, it will be created.
20793 * For details about the behaviour, see g_file_replace() which does the
20794 * same thing but returns an output stream only.
20796 * Note that in many non-local file cases read and write streams are not
20797 * supported, so make sure you really need to do read and write streaming,
20798 * rather than just opening for reading or writing.
20800 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20806 * g_file_replace_readwrite_async:
20807 * @file: input #GFile
20808 * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20809 * @make_backup: %TRUE if a backup should be created
20810 * @flags: a set of #GFileCreateFlags
20811 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20812 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20813 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20814 * @user_data: (closure): the data to pass to callback function
20816 * Asynchronously overwrites the file in read-write mode,
20817 * replacing the contents, possibly creating a backup copy
20818 * of the file first.
20820 * For more details, see g_file_replace_readwrite() which is
20821 * the synchronous version of this call.
20823 * When the operation is finished, @callback will be called.
20824 * You can then call g_file_replace_readwrite_finish() to get
20825 * the result of the operation.
20832 * g_file_replace_readwrite_finish:
20833 * @file: input #GFile
20834 * @res: a #GAsyncResult
20835 * @error: a #GError, or %NULL
20837 * Finishes an asynchronous file replace operation started with
20838 * g_file_replace_readwrite_async().
20840 * Returns: (transfer full): a #GFileIOStream, or %NULL on error. Free the returned object with g_object_unref().
20846 * g_file_resolve_relative_path:
20847 * @file: input #GFile
20848 * @relative_path: a given relative path string
20850 * Resolves a relative path for @file to an absolute path.
20852 * This call does no blocking I/O.
20854 * Returns: (transfer full): #GFile to the resolved path. %NULL if @relative_path is %NULL or if @file is invalid. Free the returned object with g_object_unref().
20859 * g_file_set_attribute:
20860 * @file: input #GFile
20861 * @attribute: a string containing the attribute's name
20862 * @type: The type of the attribute
20863 * @value_p: (allow-none): a pointer to the value (or the pointer itself if the type is a pointer type)
20864 * @flags: a set of #GFileQueryInfoFlags
20865 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20866 * @error: a #GError, or %NULL
20868 * Sets an attribute in the file with attribute name @attribute to @value.
20870 * Some attributes can be unset by setting @attribute to
20871 * %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
20873 * If @cancellable is not %NULL, then the operation can be cancelled by
20874 * triggering the cancellable object from another thread. If the operation
20875 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20877 * Returns: %TRUE if the attribute was set, %FALSE otherwise.
20882 * g_file_set_attribute_byte_string:
20883 * @file: input #GFile
20884 * @attribute: a string containing the attribute's name
20885 * @value: a string containing the attribute's new value
20886 * @flags: a #GFileQueryInfoFlags
20887 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20888 * @error: a #GError, or %NULL
20890 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
20891 * If @attribute is of a different type, this operation will fail,
20892 * returning %FALSE.
20894 * If @cancellable is not %NULL, then the operation can be cancelled by
20895 * triggering the cancellable object from another thread. If the operation
20896 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20898 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20903 * g_file_set_attribute_int32:
20904 * @file: input #GFile
20905 * @attribute: a string containing the attribute's name
20906 * @value: a #gint32 containing the attribute's new value
20907 * @flags: a #GFileQueryInfoFlags
20908 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20909 * @error: a #GError, or %NULL
20911 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
20912 * If @attribute is of a different type, this operation will fail.
20914 * If @cancellable is not %NULL, then the operation can be cancelled by
20915 * triggering the cancellable object from another thread. If the operation
20916 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20918 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20923 * g_file_set_attribute_int64:
20924 * @file: input #GFile
20925 * @attribute: a string containing the attribute's name
20926 * @value: a #guint64 containing the attribute's new value
20927 * @flags: a #GFileQueryInfoFlags
20928 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20929 * @error: a #GError, or %NULL
20931 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
20932 * If @attribute is of a different type, this operation will fail.
20934 * If @cancellable is not %NULL, then the operation can be cancelled by
20935 * triggering the cancellable object from another thread. If the operation
20936 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20938 * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20943 * g_file_set_attribute_string:
20944 * @file: input #GFile
20945 * @attribute: a string containing the attribute's name
20946 * @value: a string containing the attribute's value
20947 * @flags: #GFileQueryInfoFlags
20948 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20949 * @error: a #GError, or %NULL
20951 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
20952 * If @attribute is of a different type, this operation will fail.
20954 * If @cancellable is not %NULL, then the operation can be cancelled by
20955 * triggering the cancellable object from another thread. If the operation
20956 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20958 * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20963 * g_file_set_attribute_uint32:
20964 * @file: input #GFile
20965 * @attribute: a string containing the attribute's name
20966 * @value: a #guint32 containing the attribute's new value
20967 * @flags: a #GFileQueryInfoFlags
20968 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20969 * @error: a #GError, or %NULL
20971 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
20972 * If @attribute is of a different type, this operation will fail.
20974 * If @cancellable is not %NULL, then the operation can be cancelled by
20975 * triggering the cancellable object from another thread. If the operation
20976 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20978 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20983 * g_file_set_attribute_uint64:
20984 * @file: input #GFile
20985 * @attribute: a string containing the attribute's name
20986 * @value: a #guint64 containing the attribute's new value
20987 * @flags: a #GFileQueryInfoFlags
20988 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20989 * @error: a #GError, or %NULL
20991 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
20992 * If @attribute is of a different type, this operation will fail.
20994 * If @cancellable is not %NULL, then the operation can be cancelled by
20995 * triggering the cancellable object from another thread. If the operation
20996 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20998 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
21003 * g_file_set_attributes_async:
21004 * @file: input #GFile
21005 * @info: a #GFileInfo
21006 * @flags: a #GFileQueryInfoFlags
21007 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
21008 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21009 * @callback: (scope async): a #GAsyncReadyCallback
21010 * @user_data: (closure): a #gpointer
21012 * Asynchronously sets the attributes of @file with @info.
21014 * For more details, see g_file_set_attributes_from_info(),
21015 * which is the synchronous version of this call.
21017 * When the operation is finished, @callback will be called.
21018 * You can then call g_file_set_attributes_finish() to get
21019 * the result of the operation.
21024 * g_file_set_attributes_finish:
21025 * @file: input #GFile
21026 * @result: a #GAsyncResult
21027 * @info: (out) (transfer full): a #GFileInfo
21028 * @error: a #GError, or %NULL
21030 * Finishes setting an attribute started in g_file_set_attributes_async().
21032 * Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
21037 * g_file_set_attributes_from_info:
21038 * @file: input #GFile
21039 * @info: a #GFileInfo
21040 * @flags: #GFileQueryInfoFlags
21041 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21042 * @error: a #GError, or %NULL
21044 * Tries to set all attributes in the #GFileInfo on the target
21045 * values, not stopping on the first error.
21047 * If there is any error during this operation then @error will
21048 * be set to the first error. Error on particular fields are flagged
21049 * by setting the "status" field in the attribute value to
21050 * %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can
21051 * also detect further errors.
21053 * If @cancellable is not %NULL, then the operation can be cancelled by
21054 * triggering the cancellable object from another thread. If the operation
21055 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21057 * Returns: %TRUE if there was any error, %FALSE otherwise.
21062 * g_file_set_display_name:
21063 * @file: input #GFile
21064 * @display_name: a string
21065 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21066 * @error: a #GError, or %NULL
21068 * Renames @file to the specified display name.
21070 * The display name is converted from UTF-8 to the correct encoding
21071 * for the target filesystem if possible and the @file is renamed to this.
21073 * If you want to implement a rename operation in the user interface the
21074 * edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
21075 * initial value in the rename widget, and then the result after editing
21076 * should be passed to g_file_set_display_name().
21078 * On success the resulting converted filename is returned.
21080 * If @cancellable is not %NULL, then the operation can be cancelled by
21081 * triggering the cancellable object from another thread. If the operation
21082 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21084 * Returns: (transfer full): a #GFile specifying what @file was renamed to, or %NULL if there was an error. Free the returned object with g_object_unref().
21089 * g_file_set_display_name_async:
21090 * @file: input #GFile
21091 * @display_name: a string
21092 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
21093 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21094 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
21095 * @user_data: (closure): the data to pass to callback function
21097 * Asynchronously sets the display name for a given #GFile.
21099 * For more details, see g_file_set_display_name() which is
21100 * the synchronous version of this call.
21102 * When the operation is finished, @callback will be called.
21103 * You can then call g_file_set_display_name_finish() to get
21104 * the result of the operation.
21109 * g_file_set_display_name_finish:
21110 * @file: input #GFile
21111 * @res: a #GAsyncResult
21112 * @error: a #GError, or %NULL
21114 * Finishes setting a display name started with
21115 * g_file_set_display_name_async().
21117 * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
21122 * g_file_start_mountable:
21123 * @file: input #GFile
21124 * @flags: flags affecting the operation
21125 * @start_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
21126 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21127 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
21128 * @user_data: the data to pass to callback function
21130 * Starts a file of type #G_FILE_TYPE_MOUNTABLE.
21131 * Using @start_operation, you can request callbacks when, for instance,
21132 * passwords are needed during authentication.
21134 * If @cancellable is not %NULL, then the operation can be cancelled by
21135 * triggering the cancellable object from another thread. If the operation
21136 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21138 * When the operation is finished, @callback will be called.
21139 * You can then call g_file_mount_mountable_finish() to get
21140 * the result of the operation.
21147 * g_file_start_mountable_finish:
21148 * @file: input #GFile
21149 * @result: a #GAsyncResult
21150 * @error: a #GError, or %NULL
21152 * Finishes a start operation. See g_file_start_mountable() for details.
21154 * Finish an asynchronous start operation that was started
21155 * with g_file_start_mountable().
21157 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
21163 * g_file_stop_mountable:
21164 * @file: input #GFile
21165 * @flags: flags affecting the operation
21166 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
21167 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21168 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
21169 * @user_data: the data to pass to callback function
21171 * Stops a file of type #G_FILE_TYPE_MOUNTABLE.
21173 * If @cancellable is not %NULL, then the operation can be cancelled by
21174 * triggering the cancellable object from another thread. If the operation
21175 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21177 * When the operation is finished, @callback will be called.
21178 * You can then call g_file_stop_mountable_finish() to get
21179 * the result of the operation.
21186 * g_file_stop_mountable_finish:
21187 * @file: input #GFile
21188 * @result: a #GAsyncResult
21189 * @error: a #GError, or %NULL
21191 * Finishes an stop operation, see g_file_stop_mountable() for details.
21193 * Finish an asynchronous stop operation that was started
21194 * with g_file_stop_mountable().
21196 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
21202 * g_file_supports_thread_contexts:
21205 * Checks if @file supports <link
21206 * linkend="g-main-context-push-thread-default-context">thread-default
21207 * contexts</link>. If this returns %FALSE, you cannot perform
21208 * asynchronous operations on @file in a thread that has a
21209 * thread-default context.
21211 * Returns: Whether or not @file supports thread-default contexts.
21218 * @file: #GFile to send to trash
21219 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21220 * @error: a #GError, or %NULL
21222 * Sends @file to the "Trashcan", if possible. This is similar to
21223 * deleting it, but the user can recover it before emptying the trashcan.
21224 * Not all file systems support trashing, so this call can return the
21225 * %G_IO_ERROR_NOT_SUPPORTED error.
21227 * If @cancellable is not %NULL, then the operation can be cancelled by
21228 * triggering the cancellable object from another thread. If the operation
21229 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21231 * Returns: %TRUE on successful trash, %FALSE otherwise.
21236 * g_file_unmount_mountable:
21237 * @file: input #GFile
21238 * @flags: flags affecting the operation
21239 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21240 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
21241 * @user_data: (closure): the data to pass to callback function
21243 * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
21245 * If @cancellable is not %NULL, then the operation can be cancelled by
21246 * triggering the cancellable object from another thread. If the operation
21247 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21249 * When the operation is finished, @callback will be called.
21250 * You can then call g_file_unmount_mountable_finish() to get
21251 * the result of the operation.
21253 * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation() instead.
21258 * g_file_unmount_mountable_finish:
21259 * @file: input #GFile
21260 * @result: a #GAsyncResult
21261 * @error: a #GError, or %NULL
21263 * Finishes an unmount operation, see g_file_unmount_mountable() for details.
21265 * Finish an asynchronous unmount operation that was started
21266 * with g_file_unmount_mountable().
21268 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
21269 * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation_finish() instead.
21274 * g_file_unmount_mountable_with_operation:
21275 * @file: input #GFile
21276 * @flags: flags affecting the operation
21277 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
21278 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21279 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
21280 * @user_data: (closure): the data to pass to callback function
21282 * Unmounts a file of type #G_FILE_TYPE_MOUNTABLE.
21284 * If @cancellable is not %NULL, then the operation can be cancelled by
21285 * triggering the cancellable object from another thread. If the operation
21286 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21288 * When the operation is finished, @callback will be called.
21289 * You can then call g_file_unmount_mountable_finish() to get
21290 * the result of the operation.
21297 * g_file_unmount_mountable_with_operation_finish:
21298 * @file: input #GFile
21299 * @result: a #GAsyncResult
21300 * @error: a #GError, or %NULL
21302 * Finishes an unmount operation,
21303 * see g_file_unmount_mountable_with_operation() for details.
21305 * Finish an asynchronous unmount operation that was started
21306 * with g_file_unmount_mountable_with_operation().
21308 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
21314 * g_filename_completer_get_completion_suffix:
21315 * @completer: the filename completer.
21316 * @initial_text: text to be completed.
21318 * Obtains a completion for @initial_text from @completer.
21320 * Returns: a completed string, or %NULL if no completion exists. This string is not owned by GIO, so remember to g_free() it when finished.
21325 * g_filename_completer_get_completions:
21326 * @completer: the filename completer.
21327 * @initial_text: text to be completed.
21329 * Gets an array of completion strings for a given initial text.
21331 * Returns: (array zero-terminated=1) (transfer full): array of strings with possible completions for @initial_text. This array must be freed by g_strfreev() when finished.
21336 * g_filename_completer_new:
21338 * Creates a new filename completer.
21340 * Returns: a #GFilenameCompleter.
21345 * g_filename_completer_set_dirs_only:
21346 * @completer: the filename completer.
21347 * @dirs_only: a #gboolean.
21349 * If @dirs_only is %TRUE, @completer will only
21350 * complete directory names, and not file names.
21355 * g_filter_input_stream_get_base_stream:
21356 * @stream: a #GFilterInputStream.
21358 * Gets the base stream for the filter stream.
21360 * Returns: (transfer none): a #GInputStream.
21365 * g_filter_input_stream_get_close_base_stream:
21366 * @stream: a #GFilterInputStream.
21368 * Returns whether the base stream will be closed when @stream is
21371 * Returns: %TRUE if the base stream will be closed.
21376 * g_filter_input_stream_set_close_base_stream:
21377 * @stream: a #GFilterInputStream.
21378 * @close_base: %TRUE to close the base stream.
21380 * Sets whether the base stream will be closed when @stream is closed.
21385 * g_filter_output_stream_get_base_stream:
21386 * @stream: a #GFilterOutputStream.
21388 * Gets the base stream for the filter stream.
21390 * Returns: (transfer none): a #GOutputStream.
21395 * g_filter_output_stream_get_close_base_stream:
21396 * @stream: a #GFilterOutputStream.
21398 * Returns whether the base stream will be closed when @stream is
21401 * Returns: %TRUE if the base stream will be closed.
21406 * g_filter_output_stream_set_close_base_stream:
21407 * @stream: a #GFilterOutputStream.
21408 * @close_base: %TRUE to close the base stream.
21410 * Sets whether the base stream will be closed when @stream is closed.
21416 * @icon1: (allow-none): pointer to the first #GIcon.
21417 * @icon2: (allow-none): pointer to the second #GIcon.
21419 * Checks if two icons are equal.
21421 * Returns: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
21427 * @icon: #gconstpointer to an icon object.
21429 * Gets a hash for an icon.
21432 * Returns: a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure.
21437 * g_icon_new_for_string:
21438 * @str: A string obtained via g_icon_to_string().
21439 * @error: Return location for error.
21441 * Generate a #GIcon instance from @str. This function can fail if
21442 * @str is not valid - see g_icon_to_string() for discussion.
21444 * If your application or library provides one or more #GIcon
21445 * implementations you need to ensure that each #GType is registered
21446 * with the type system prior to calling g_icon_new_for_string().
21448 * Returns: (transfer full): An object implementing the #GIcon interface or %NULL if @error is set.
21454 * g_icon_to_string:
21457 * Generates a textual representation of @icon that can be used for
21458 * serialization such as when passing @icon to a different process or
21459 * saving it to persistent storage. Use g_icon_new_for_string() to
21460 * get @icon back from the returned string.
21462 * The encoding of the returned string is proprietary to #GIcon except
21463 * in the following two cases
21467 * If @icon is a #GFileIcon, the returned string is a native path
21468 * (such as <literal>/path/to/my icon.png</literal>) without escaping
21469 * if the #GFile for @icon is a native file. If the file is not
21470 * native, the returned string is the result of g_file_get_uri()
21471 * (such as <literal>sftp://path/to/my%20icon.png</literal>).
21472 * </para></listitem>
21474 * If @icon is a #GThemedIcon with exactly one name, the encoding is
21475 * simply the name (such as <literal>network-server</literal>).
21476 * </para></listitem>
21479 * Virtual: to_tokens
21480 * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't be serialized. Use g_free() to free.
21486 * g_inet_address_equal:
21487 * @address: A #GInetAddress.
21488 * @other_address: Another #GInetAddress.
21490 * Checks if two #GInetAddress instances are equal, e.g. the same address.
21492 * Returns: %TRUE if @address and @other_address are equal, %FALSE otherwise.
21498 * g_inet_address_get_family:
21499 * @address: a #GInetAddress
21501 * Gets @address's family
21503 * Returns: @address's family
21509 * g_inet_address_get_is_any:
21510 * @address: a #GInetAddress
21512 * Tests whether @address is the "any" address for its family.
21514 * Returns: %TRUE if @address is the "any" address for its family.
21520 * g_inet_address_get_is_link_local:
21521 * @address: a #GInetAddress
21523 * Tests whether @address is a link-local address (that is, if it
21524 * identifies a host on a local network that is not connected to the
21527 * Returns: %TRUE if @address is a link-local address.
21533 * g_inet_address_get_is_loopback:
21534 * @address: a #GInetAddress
21536 * Tests whether @address is the loopback address for its family.
21538 * Returns: %TRUE if @address is the loopback address for its family.
21544 * g_inet_address_get_is_mc_global:
21545 * @address: a #GInetAddress
21547 * Tests whether @address is a global multicast address.
21549 * Returns: %TRUE if @address is a global multicast address.
21555 * g_inet_address_get_is_mc_link_local:
21556 * @address: a #GInetAddress
21558 * Tests whether @address is a link-local multicast address.
21560 * Returns: %TRUE if @address is a link-local multicast address.
21566 * g_inet_address_get_is_mc_node_local:
21567 * @address: a #GInetAddress
21569 * Tests whether @address is a node-local multicast address.
21571 * Returns: %TRUE if @address is a node-local multicast address.
21577 * g_inet_address_get_is_mc_org_local:
21578 * @address: a #GInetAddress
21580 * Tests whether @address is an organization-local multicast address.
21582 * Returns: %TRUE if @address is an organization-local multicast address.
21588 * g_inet_address_get_is_mc_site_local:
21589 * @address: a #GInetAddress
21591 * Tests whether @address is a site-local multicast address.
21593 * Returns: %TRUE if @address is a site-local multicast address.
21599 * g_inet_address_get_is_multicast:
21600 * @address: a #GInetAddress
21602 * Tests whether @address is a multicast address.
21604 * Returns: %TRUE if @address is a multicast address.
21610 * g_inet_address_get_is_site_local:
21611 * @address: a #GInetAddress
21613 * Tests whether @address is a site-local address such as 10.0.0.1
21614 * (that is, the address identifies a host on a local network that can
21615 * not be reached directly from the Internet, but which may have
21616 * outgoing Internet connectivity via a NAT or firewall).
21618 * Returns: %TRUE if @address is a site-local address.
21624 * g_inet_address_get_native_size:
21625 * @address: a #GInetAddress
21627 * Gets the size of the native raw binary address for @address. This
21628 * is the size of the data that you get from g_inet_address_to_bytes().
21630 * Returns: the number of bytes used for the native version of @address.
21636 * g_inet_address_mask_equal:
21637 * @mask: a #GInetAddressMask
21638 * @mask2: another #GInetAddressMask
21640 * Tests if @mask and @mask2 are the same mask.
21642 * Returns: whether @mask and @mask2 are the same mask
21648 * g_inet_address_mask_get_address:
21649 * @mask: a #GInetAddressMask
21651 * Gets @mask's base address
21653 * Returns: (transfer none): @mask's base address
21659 * g_inet_address_mask_get_family:
21660 * @mask: a #GInetAddressMask
21662 * Gets the #GSocketFamily of @mask's address
21664 * Returns: the #GSocketFamily of @mask's address
21670 * g_inet_address_mask_get_length:
21671 * @mask: a #GInetAddressMask
21673 * Gets @mask's length
21675 * Returns: @mask's length
21681 * g_inet_address_mask_matches:
21682 * @mask: a #GInetAddressMask
21683 * @address: a #GInetAddress
21685 * Tests if @address falls within the range described by @mask.
21687 * Returns: whether @address falls within the range described by @mask.
21693 * g_inet_address_mask_new:
21694 * @addr: a #GInetAddress
21695 * @length: number of bits of @addr to use
21696 * @error: return location for #GError, or %NULL
21698 * Creates a new #GInetAddressMask representing all addresses whose
21699 * first @length bits match @addr.
21701 * Returns: a new #GInetAddressMask, or %NULL on error
21707 * g_inet_address_mask_new_from_string:
21708 * @mask_string: an IP address or address/length string
21709 * @error: return location for #GError, or %NULL
21711 * Parses @mask_string as an IP address and (optional) length, and
21712 * creates a new #GInetAddressMask. The length, if present, is
21713 * delimited by a "/". If it is not present, then the length is
21714 * assumed to be the full length of the address.
21716 * Returns: a new #GInetAddressMask corresponding to @string, or %NULL on error.
21722 * g_inet_address_mask_to_string:
21723 * @mask: a #GInetAddressMask
21725 * Converts @mask back to its corresponding string form.
21727 * Returns: a string corresponding to @mask.
21733 * g_inet_address_new_any:
21734 * @family: the address family
21736 * Creates a #GInetAddress for the "any" address (unassigned/"don't
21737 * care") for @family.
21739 * Returns: a new #GInetAddress corresponding to the "any" address for @family.
21745 * g_inet_address_new_from_bytes:
21746 * @bytes: (array) (element-type guint8): raw address data
21747 * @family: the address family of @bytes
21749 * Creates a new #GInetAddress from the given @family and @bytes.
21750 * @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
21751 * %G_SOCKET_FAMILY_IPV6.
21753 * Returns: a new #GInetAddress corresponding to @family and @bytes.
21759 * g_inet_address_new_from_string:
21760 * @string: a string representation of an IP address
21762 * Parses @string as an IP address and creates a new #GInetAddress.
21764 * Returns: a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed.
21770 * g_inet_address_new_loopback:
21771 * @family: the address family
21773 * Creates a #GInetAddress for the loopback address for @family.
21775 * Returns: a new #GInetAddress corresponding to the loopback address for @family.
21781 * g_inet_address_to_bytes: (skip)
21782 * @address: a #GInetAddress
21784 * Gets the raw binary address data from @address.
21786 * Returns: a pointer to an internal array of the bytes in @address, which should not be modified, stored, or freed. The size of this array can be gotten with g_inet_address_get_native_size().
21792 * g_inet_address_to_string:
21793 * @address: a #GInetAddress
21795 * Converts @address to string form.
21797 * Returns: a representation of @address as a string, which should be freed after use.
21803 * g_inet_socket_address_get_address:
21804 * @address: a #GInetSocketAddress
21806 * Gets @address's #GInetAddress.
21808 * Returns: (transfer none): the #GInetAddress for @address, which must be g_object_ref()'d if it will be stored
21814 * g_inet_socket_address_get_flowinfo:
21815 * @address: a %G_SOCKET_FAMILY_IPV6 #GInetSocketAddress
21817 * Gets the <literal>sin6_flowinfo</literal> field from @address,
21818 * which must be an IPv6 address.
21820 * Returns: the flowinfo field
21826 * g_inet_socket_address_get_port:
21827 * @address: a #GInetSocketAddress
21829 * Gets @address's port.
21831 * Returns: the port for @address
21837 * g_inet_socket_address_get_scope_id:
21838 * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress
21840 * Gets the <literal>sin6_scope_id</literal> field from @address,
21841 * which must be an IPv6 address.
21843 * Returns: the scope id field
21849 * g_inet_socket_address_new:
21850 * @address: a #GInetAddress
21851 * @port: a port number
21853 * Creates a new #GInetSocketAddress for @address and @port.
21855 * Returns: a new #GInetSocketAddress
21862 * @initable: a #GInitable.
21863 * @cancellable: optional #GCancellable object, %NULL to ignore.
21864 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21866 * Initializes the object implementing the interface.
21868 * The object must be initialized before any real use after initial
21869 * construction, either with this function or g_async_initable_init_async().
21871 * Implementations may also support cancellation. If @cancellable is not %NULL,
21872 * then initialization can be cancelled by triggering the cancellable object
21873 * from another thread. If the operation was cancelled, the error
21874 * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
21875 * the object doesn't support cancellable initialization the error
21876 * %G_IO_ERROR_NOT_SUPPORTED will be returned.
21878 * If the object is not initialized, or initialization returns with an
21879 * error, then all operations on the object except g_object_ref() and
21880 * g_object_unref() are considered to be invalid, and have undefined
21881 * behaviour. See the <xref linkend="ginitable"/> section introduction
21882 * for more details.
21884 * Implementations of this method must be idempotent, i.e. multiple calls
21885 * to this function with the same argument should return the same results.
21886 * Only the first call initializes the object, further calls return the result
21887 * of the first call. This is so that it's safe to implement the singleton
21888 * pattern in the GObject constructor function.
21890 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
21897 * @object_type: a #GType supporting #GInitable.
21898 * @cancellable: optional #GCancellable object, %NULL to ignore.
21899 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21900 * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
21901 * @...: the value if the first property, followed by and other property value pairs, and ended by %NULL.
21903 * Helper function for constructing #GInitable object. This is
21904 * similar to g_object_new() but also initializes the object
21905 * and returns %NULL, setting an error on failure.
21907 * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21913 * g_initable_new_valist:
21914 * @object_type: a #GType supporting #GInitable.
21915 * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
21916 * @var_args: The var args list generated from @first_property_name.
21917 * @cancellable: optional #GCancellable object, %NULL to ignore.
21918 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21920 * Helper function for constructing #GInitable object. This is
21921 * similar to g_object_new_valist() but also initializes the object
21922 * and returns %NULL, setting an error on failure.
21924 * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21931 * @object_type: a #GType supporting #GInitable.
21932 * @n_parameters: the number of parameters in @parameters
21933 * @parameters: (array length=n_parameters): the parameters to use to construct the object
21934 * @cancellable: optional #GCancellable object, %NULL to ignore.
21935 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21937 * Helper function for constructing #GInitable object. This is
21938 * similar to g_object_newv() but also initializes the object
21939 * and returns %NULL, setting an error on failure.
21941 * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21947 * g_input_stream_clear_pending:
21948 * @stream: input stream
21950 * Clears the pending flag on @stream.
21955 * g_input_stream_close:
21956 * @stream: A #GInputStream.
21957 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21958 * @error: location to store the error occurring, or %NULL to ignore
21960 * Closes the stream, releasing resources related to it.
21962 * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
21963 * Closing a stream multiple times will not return an error.
21965 * Streams will be automatically closed when the last reference
21966 * is dropped, but you might want to call this function to make sure
21967 * resources are released as early as possible.
21969 * Some streams might keep the backing store of the stream (e.g. a file descriptor)
21970 * open after the stream is closed. See the documentation for the individual
21971 * stream for details.
21973 * On failure the first error that happened will be reported, but the close
21974 * operation will finish as much as possible. A stream that failed to
21975 * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
21976 * is important to check and report the error to the user.
21978 * If @cancellable is not %NULL, then the operation can be cancelled by
21979 * triggering the cancellable object from another thread. If the operation
21980 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21981 * Cancelling a close will still leave the stream closed, but some streams
21982 * can use a faster close that doesn't block to e.g. check errors.
21984 * Returns: %TRUE on success, %FALSE on failure
21989 * g_input_stream_close_async:
21990 * @stream: A #GInputStream.
21991 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21992 * @cancellable: (allow-none): optional cancellable object
21993 * @callback: (scope async): callback to call when the request is satisfied
21994 * @user_data: (closure): the data to pass to callback function
21996 * Requests an asynchronous closes of the stream, releasing resources related to it.
21997 * When the operation is finished @callback will be called.
21998 * You can then call g_input_stream_close_finish() to get the result of the
22001 * For behaviour details see g_input_stream_close().
22003 * The asyncronous methods have a default fallback that uses threads to implement
22004 * asynchronicity, so they are optional for inheriting classes. However, if you
22005 * override one you must override all.
22010 * g_input_stream_close_finish:
22011 * @stream: a #GInputStream.
22012 * @result: a #GAsyncResult.
22013 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22015 * Finishes closing a stream asynchronously, started from g_input_stream_close_async().
22017 * Returns: %TRUE if the stream was closed successfully.
22022 * g_input_stream_has_pending:
22023 * @stream: input stream.
22025 * Checks if an input stream has pending actions.
22027 * Returns: %TRUE if @stream has pending actions.
22032 * g_input_stream_is_closed:
22033 * @stream: input stream.
22035 * Checks if an input stream is closed.
22037 * Returns: %TRUE if the stream is closed.
22042 * g_input_stream_read:
22043 * @stream: a #GInputStream.
22044 * @buffer: a buffer to read data into (which should be at least count bytes long).
22045 * @count: the number of bytes that will be read from the stream
22046 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22047 * @error: location to store the error occurring, or %NULL to ignore
22049 * Tries to read @count bytes from the stream into the buffer starting at
22050 * @buffer. Will block during this read.
22052 * If count is zero returns zero and does nothing. A value of @count
22053 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
22055 * On success, the number of bytes read into the buffer is returned.
22056 * It is not an error if this is not the same as the requested size, as it
22057 * can happen e.g. near the end of a file. Zero is returned on end of file
22058 * (or if @count is zero), but never otherwise.
22060 * If @cancellable is not %NULL, then the operation can be cancelled by
22061 * triggering the cancellable object from another thread. If the operation
22062 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
22063 * operation was partially finished when the operation was cancelled the
22064 * partial result will be returned, without an error.
22066 * On error -1 is returned and @error is set accordingly.
22068 * Returns: Number of bytes read, or -1 on error, or 0 on end of file.
22073 * g_input_stream_read_all:
22074 * @stream: a #GInputStream.
22075 * @buffer: a buffer to read data into (which should be at least count bytes long).
22076 * @count: the number of bytes that will be read from the stream
22077 * @bytes_read: (out): location to store the number of bytes that was read from the stream
22078 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22079 * @error: location to store the error occurring, or %NULL to ignore
22081 * Tries to read @count bytes from the stream into the buffer starting at
22082 * @buffer. Will block during this read.
22084 * This function is similar to g_input_stream_read(), except it tries to
22085 * read as many bytes as requested, only stopping on an error or end of stream.
22087 * On a successful read of @count bytes, or if we reached the end of the
22088 * stream, %TRUE is returned, and @bytes_read is set to the number of bytes
22089 * read into @buffer.
22091 * If there is an error during the operation %FALSE is returned and @error
22092 * is set to indicate the error status, @bytes_read is updated to contain
22093 * the number of bytes read into @buffer before the error occurred.
22095 * Returns: %TRUE on success, %FALSE if there was an error
22100 * g_input_stream_read_async:
22101 * @stream: A #GInputStream.
22102 * @buffer: a buffer to read data into (which should be at least count bytes long).
22103 * @count: the number of bytes that will be read from the stream
22104 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
22105 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22106 * @callback: (scope async): callback to call when the request is satisfied
22107 * @user_data: (closure): the data to pass to callback function
22109 * Request an asynchronous read of @count bytes from the stream into the buffer
22110 * starting at @buffer. When the operation is finished @callback will be called.
22111 * You can then call g_input_stream_read_finish() to get the result of the
22114 * During an async request no other sync and async calls are allowed on @stream, and will
22115 * result in %G_IO_ERROR_PENDING errors.
22117 * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
22119 * On success, the number of bytes read into the buffer will be passed to the
22120 * callback. It is not an error if this is not the same as the requested size, as it
22121 * can happen e.g. near the end of a file, but generally we try to read
22122 * as many bytes as requested. Zero is returned on end of file
22123 * (or if @count is zero), but never otherwise.
22125 * Any outstanding i/o request with higher priority (lower numerical value) will
22126 * be executed before an outstanding request with lower priority. Default
22127 * priority is %G_PRIORITY_DEFAULT.
22129 * The asyncronous methods have a default fallback that uses threads to implement
22130 * asynchronicity, so they are optional for inheriting classes. However, if you
22131 * override one you must override all.
22136 * g_input_stream_read_bytes:
22137 * @stream: a #GInputStream.
22138 * @count: maximum number of bytes that will be read from the stream. Common values include 4096 and 8192.
22139 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22140 * @error: location to store the error occurring, or %NULL to ignore
22142 * Like g_input_stream_read(), this tries to read @count bytes from
22143 * the stream in a blocking fashion. However, rather than reading into
22144 * a user-supplied buffer, this will create a new #GBytes containing
22145 * the data that was read. This may be easier to use from language
22148 * If count is zero, returns a zero-length #GBytes and does nothing. A
22149 * value of @count larger than %G_MAXSSIZE will cause a
22150 * %G_IO_ERROR_INVALID_ARGUMENT error.
22152 * On success, a new #GBytes is returned. It is not an error if the
22153 * size of this object is not the same as the requested size, as it
22154 * can happen e.g. near the end of a file. A zero-length #GBytes is
22155 * returned on end of file (or if @count is zero), but never
22158 * If @cancellable is not %NULL, then the operation can be cancelled by
22159 * triggering the cancellable object from another thread. If the operation
22160 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
22161 * operation was partially finished when the operation was cancelled the
22162 * partial result will be returned, without an error.
22164 * On error %NULL is returned and @error is set accordingly.
22166 * Returns: a new #GBytes, or %NULL on error
22171 * g_input_stream_read_bytes_async:
22172 * @stream: A #GInputStream.
22173 * @count: the number of bytes that will be read from the stream
22174 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
22175 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22176 * @callback: (scope async): callback to call when the request is satisfied
22177 * @user_data: (closure): the data to pass to callback function
22179 * Request an asynchronous read of @count bytes from the stream into a
22180 * new #GBytes. When the operation is finished @callback will be
22181 * called. You can then call g_input_stream_read_bytes_finish() to get the
22182 * result of the operation.
22184 * During an async request no other sync and async calls are allowed
22185 * on @stream, and will result in %G_IO_ERROR_PENDING errors.
22187 * A value of @count larger than %G_MAXSSIZE will cause a
22188 * %G_IO_ERROR_INVALID_ARGUMENT error.
22190 * On success, the new #GBytes will be passed to the callback. It is
22191 * not an error if this is smaller than the requested size, as it can
22192 * happen e.g. near the end of a file, but generally we try to read as
22193 * many bytes as requested. Zero is returned on end of file (or if
22194 * @count is zero), but never otherwise.
22196 * Any outstanding I/O request with higher priority (lower numerical
22197 * value) will be executed before an outstanding request with lower
22198 * priority. Default priority is %G_PRIORITY_DEFAULT.
22203 * g_input_stream_read_bytes_finish:
22204 * @stream: a #GInputStream.
22205 * @result: a #GAsyncResult.
22206 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22208 * Finishes an asynchronous stream read-into-#GBytes operation.
22210 * Returns: the newly-allocated #GBytes, or %NULL on error
22215 * g_input_stream_read_finish:
22216 * @stream: a #GInputStream.
22217 * @result: a #GAsyncResult.
22218 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22220 * Finishes an asynchronous stream read operation.
22222 * Returns: number of bytes read in, or -1 on error, or 0 on end of file.
22227 * g_input_stream_set_pending:
22228 * @stream: input stream
22229 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22231 * Sets @stream to have actions pending. If the pending flag is
22232 * already set or @stream is closed, it will return %FALSE and set
22235 * Returns: %TRUE if pending was previously unset and is now set.
22240 * g_input_stream_skip:
22241 * @stream: a #GInputStream.
22242 * @count: the number of bytes that will be skipped from the stream
22243 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22244 * @error: location to store the error occurring, or %NULL to ignore
22246 * Tries to skip @count bytes from the stream. Will block during the operation.
22248 * This is identical to g_input_stream_read(), from a behaviour standpoint,
22249 * but the bytes that are skipped are not returned to the user. Some
22250 * streams have an implementation that is more efficient than reading the data.
22252 * This function is optional for inherited classes, as the default implementation
22253 * emulates it using read.
22255 * If @cancellable is not %NULL, then the operation can be cancelled by
22256 * triggering the cancellable object from another thread. If the operation
22257 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
22258 * operation was partially finished when the operation was cancelled the
22259 * partial result will be returned, without an error.
22261 * Returns: Number of bytes skipped, or -1 on error
22266 * g_input_stream_skip_async:
22267 * @stream: A #GInputStream.
22268 * @count: the number of bytes that will be skipped from the stream
22269 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
22270 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22271 * @callback: (scope async): callback to call when the request is satisfied
22272 * @user_data: (closure): the data to pass to callback function
22274 * Request an asynchronous skip of @count bytes from the stream.
22275 * When the operation is finished @callback will be called.
22276 * You can then call g_input_stream_skip_finish() to get the result
22277 * of the operation.
22279 * During an async request no other sync and async calls are allowed,
22280 * and will result in %G_IO_ERROR_PENDING errors.
22282 * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
22284 * On success, the number of bytes skipped will be passed to the callback.
22285 * It is not an error if this is not the same as the requested size, as it
22286 * can happen e.g. near the end of a file, but generally we try to skip
22287 * as many bytes as requested. Zero is returned on end of file
22288 * (or if @count is zero), but never otherwise.
22290 * Any outstanding i/o request with higher priority (lower numerical value)
22291 * will be executed before an outstanding request with lower priority.
22292 * Default priority is %G_PRIORITY_DEFAULT.
22294 * The asynchronous methods have a default fallback that uses threads to
22295 * implement asynchronicity, so they are optional for inheriting classes.
22296 * However, if you override one, you must override all.
22301 * g_input_stream_skip_finish:
22302 * @stream: a #GInputStream.
22303 * @result: a #GAsyncResult.
22304 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22306 * Finishes a stream skip operation.
22308 * Returns: the size of the bytes skipped, or %-1 on error.
22313 * g_io_error_from_errno:
22314 * @err_no: Error number as defined in errno.h.
22316 * Converts errno.h error codes into GIO error codes.
22318 * Returns: #GIOErrorEnum value for the given errno.h error number.
22323 * g_io_error_from_win32_error:
22324 * @error_code: Windows error number.
22326 * Converts some common error codes into GIO error codes. The
22327 * fallback value G_IO_ERROR_FAILED is returned for error codes not
22330 * Returns: #GIOErrorEnum value for the given error number.
22336 * g_io_error_quark:
22338 * Gets the GIO Error Quark.
22340 * Returns: a #GQuark.
22345 * g_io_extension_get_name:
22346 * @extension: a #GIOExtension
22348 * Gets the name under which @extension was registered.
22350 * Note that the same type may be registered as extension
22351 * for multiple extension points, under different names.
22353 * Returns: the name of @extension.
22358 * g_io_extension_get_priority:
22359 * @extension: a #GIOExtension
22361 * Gets the priority with which @extension was registered.
22363 * Returns: the priority of @extension
22368 * g_io_extension_get_type:
22369 * @extension: a #GIOExtension
22371 * Gets the type associated with @extension.
22373 * Returns: the type of @extension
22378 * g_io_extension_point_get_extension_by_name:
22379 * @extension_point: a #GIOExtensionPoint
22380 * @name: the name of the extension to get
22382 * Finds a #GIOExtension for an extension point by name.
22384 * Returns: (transfer none): the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name
22389 * g_io_extension_point_get_extensions:
22390 * @extension_point: a #GIOExtensionPoint
22392 * Gets a list of all extensions that implement this extension point.
22393 * The list is sorted by priority, beginning with the highest priority.
22395 * Returns: (element-type GIOExtension) (transfer none): a #GList of #GIOExtension<!-- -->s. The list is owned by GIO and should not be modified.
22400 * g_io_extension_point_get_required_type:
22401 * @extension_point: a #GIOExtensionPoint
22403 * Gets the required type for @extension_point.
22405 * Returns: the #GType that all implementations must have, or #G_TYPE_INVALID if the extension point has no required type
22410 * g_io_extension_point_implement:
22411 * @extension_point_name: the name of the extension point
22412 * @type: the #GType to register as extension
22413 * @extension_name: the name for the extension
22414 * @priority: the priority for the extension
22416 * Registers @type as extension for the extension point with name
22417 * @extension_point_name.
22419 * If @type has already been registered as an extension for this
22420 * extension point, the existing #GIOExtension object is returned.
22422 * Returns: (transfer none): a #GIOExtension object for #GType
22427 * g_io_extension_point_lookup:
22428 * @name: the name of the extension point
22430 * Looks up an existing extension point.
22432 * Returns: (transfer none): the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name.
22437 * g_io_extension_point_register:
22438 * @name: The name of the extension point
22440 * Registers an extension point.
22442 * Returns: (transfer none): the new #GIOExtensionPoint. This object is owned by GIO and should not be freed.
22447 * g_io_extension_point_set_required_type:
22448 * @extension_point: a #GIOExtensionPoint
22449 * @type: the #GType to require
22451 * Sets the required type for @extension_point to @type.
22452 * All implementations must henceforth have this type.
22457 * g_io_extension_ref_class:
22458 * @extension: a #GIOExtension
22460 * Gets a reference to the class for the type that is
22461 * associated with @extension.
22463 * Returns: (transfer full): the #GTypeClass for the type of @extension
22469 * @filename: filename of the shared library module.
22471 * Creates a new GIOModule that will load the specific
22472 * shared library when in use.
22474 * Returns: a #GIOModule from given @filename, or %NULL on error.
22479 * g_io_module_scope_block:
22480 * @scope: a module loading scope
22481 * @basename: the basename to block
22483 * Block modules with the given @basename from being loaded when
22484 * this scope is used with g_io_modules_scan_all_in_directory_with_scope()
22485 * or g_io_modules_load_all_in_directory_with_scope().
22492 * g_io_module_scope_free:
22493 * @scope: a module loading scope
22495 * Free a module scope.
22502 * g_io_module_scope_new:
22503 * @flags: flags for the new scope
22505 * Create a new scope for loading of IO modules. A scope can be used for
22506 * blocking duplicate modules, or blocking a module you don't want to load.
22508 * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
22509 * which have the same base name as a module that has already been seen
22512 * Returns: (transfer full): the new module scope
22518 * g_io_modules_load_all_in_directory:
22519 * @dirname: pathname for a directory containing modules to load.
22521 * Loads all the modules in the specified directory.
22523 * If don't require all modules to be initialized (and thus registering
22524 * all gtypes) then you can use g_io_modules_scan_all_in_directory()
22525 * which allows delayed/lazy loading of modules.
22527 * Returns: (element-type GIOModule) (transfer full): a list of #GIOModules loaded from the directory, All the modules are loaded into memory, if you want to unload them (enabling on-demand loading) you must call g_type_module_unuse() on all the modules. Free the list with g_list_free().
22532 * g_io_modules_load_all_in_directory_with_scope:
22533 * @dirname: pathname for a directory containing modules to load.
22534 * @scope: a scope to use when scanning the modules.
22536 * Loads all the modules in the specified directory.
22538 * If don't require all modules to be initialized (and thus registering
22539 * all gtypes) then you can use g_io_modules_scan_all_in_directory()
22540 * which allows delayed/lazy loading of modules.
22542 * Returns: (element-type GIOModule) (transfer full): a list of #GIOModules loaded from the directory, All the modules are loaded into memory, if you want to unload them (enabling on-demand loading) you must call g_type_module_unuse() on all the modules. Free the list with g_list_free().
22548 * g_io_modules_scan_all_in_directory:
22549 * @dirname: pathname for a directory containing modules to scan.
22551 * Scans all the modules in the specified directory, ensuring that
22552 * any extension point implemented by a module is registered.
22554 * This may not actually load and initialize all the types in each
22555 * module, some modules may be lazily loaded and initialized when
22556 * an extension point it implementes is used with e.g.
22557 * g_io_extension_point_get_extensions() or
22558 * g_io_extension_point_get_extension_by_name().
22560 * If you need to guarantee that all types are loaded in all the modules,
22561 * use g_io_modules_load_all_in_directory().
22568 * g_io_modules_scan_all_in_directory_with_scope:
22569 * @dirname: pathname for a directory containing modules to scan.
22570 * @scope: a scope to use when scanning the modules
22572 * Scans all the modules in the specified directory, ensuring that
22573 * any extension point implemented by a module is registered.
22575 * This may not actually load and initialize all the types in each
22576 * module, some modules may be lazily loaded and initialized when
22577 * an extension point it implementes is used with e.g.
22578 * g_io_extension_point_get_extensions() or
22579 * g_io_extension_point_get_extension_by_name().
22581 * If you need to guarantee that all types are loaded in all the modules,
22582 * use g_io_modules_load_all_in_directory().
22589 * g_io_scheduler_cancel_all_jobs:
22591 * Cancels all cancellable I/O jobs.
22593 * A job is cancellable if a #GCancellable was passed into
22594 * g_io_scheduler_push_job().
22596 * Deprecated: You should never call this function, since you don't know how other libraries in your program might be making use of gioscheduler.
22601 * g_io_scheduler_job_send_to_mainloop:
22602 * @job: a #GIOSchedulerJob
22603 * @func: a #GSourceFunc callback that will be called in the original thread
22604 * @user_data: data to pass to @func
22605 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22607 * Used from an I/O job to send a callback to be run in the thread
22608 * that the job was started from, waiting for the result (and thus
22609 * blocking the I/O job).
22611 * Returns: The return value of @func
22612 * Deprecated: Use g_main_context_invoke().
22617 * g_io_scheduler_job_send_to_mainloop_async:
22618 * @job: a #GIOSchedulerJob
22619 * @func: a #GSourceFunc callback that will be called in the original thread
22620 * @user_data: data to pass to @func
22621 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22623 * Used from an I/O job to send a callback to be run asynchronously in
22624 * the thread that the job was started from. The callback will be run
22625 * when the main loop is available, but at that time the I/O job might
22626 * have finished. The return value from the callback is ignored.
22628 * Note that if you are passing the @user_data from g_io_scheduler_push_job()
22629 * on to this function you have to ensure that it is not freed before
22630 * @func is called, either by passing %NULL as @notify to
22631 * g_io_scheduler_push_job() or by using refcounting for @user_data.
22633 * Deprecated: Use g_main_context_invoke().
22638 * g_io_scheduler_push_job:
22639 * @job_func: a #GIOSchedulerJobFunc.
22640 * @user_data: data to pass to @job_func
22641 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22642 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
22643 * @cancellable: optional #GCancellable object, %NULL to ignore.
22645 * Schedules the I/O job to run in another thread.
22647 * @notify will be called on @user_data after @job_func has returned,
22648 * regardless whether the job was cancelled or has run to completion.
22650 * If @cancellable is not %NULL, it can be used to cancel the I/O job
22651 * by calling g_cancellable_cancel() or by calling
22652 * g_io_scheduler_cancel_all_jobs().
22654 * Deprecated: use #GThreadPool or g_task_run_in_thread()
22659 * g_io_stream_clear_pending:
22660 * @stream: a #GIOStream
22662 * Clears the pending flag on @stream.
22669 * g_io_stream_close:
22670 * @stream: a #GIOStream
22671 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
22672 * @error: location to store the error occurring, or %NULL to ignore
22674 * Closes the stream, releasing resources related to it. This will also
22675 * closes the individual input and output streams, if they are not already
22678 * Once the stream is closed, all other operations will return
22679 * %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
22682 * Closing a stream will automatically flush any outstanding buffers
22685 * Streams will be automatically closed when the last reference
22686 * is dropped, but you might want to call this function to make sure
22687 * resources are released as early as possible.
22689 * Some streams might keep the backing store of the stream (e.g. a file
22690 * descriptor) open after the stream is closed. See the documentation for
22691 * the individual stream for details.
22693 * On failure the first error that happened will be reported, but the
22694 * close operation will finish as much as possible. A stream that failed
22695 * to close will still return %G_IO_ERROR_CLOSED for all operations.
22696 * Still, it is important to check and report the error to the user,
22697 * otherwise there might be a loss of data as all data might not be written.
22699 * If @cancellable is not NULL, then the operation can be cancelled by
22700 * triggering the cancellable object from another thread. If the operation
22701 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
22702 * Cancelling a close will still leave the stream closed, but some streams
22703 * can use a faster close that doesn't block to e.g. check errors.
22705 * The default implementation of this method just calls close on the
22706 * individual input/output streams.
22708 * Returns: %TRUE on success, %FALSE on failure
22714 * g_io_stream_close_async:
22715 * @stream: a #GIOStream
22716 * @io_priority: the io priority of the request
22717 * @cancellable: (allow-none): optional cancellable object
22718 * @callback: (scope async): callback to call when the request is satisfied
22719 * @user_data: (closure): the data to pass to callback function
22721 * Requests an asynchronous close of the stream, releasing resources
22722 * related to it. When the operation is finished @callback will be
22723 * called. You can then call g_io_stream_close_finish() to get
22724 * the result of the operation.
22726 * For behaviour details see g_io_stream_close().
22728 * The asynchronous methods have a default fallback that uses threads
22729 * to implement asynchronicity, so they are optional for inheriting
22730 * classes. However, if you override one you must override all.
22737 * g_io_stream_close_finish:
22738 * @stream: a #GIOStream
22739 * @result: a #GAsyncResult
22740 * @error: a #GError location to store the error occurring, or %NULL to ignore
22744 * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
22750 * g_io_stream_get_input_stream:
22751 * @stream: a #GIOStream
22753 * Gets the input stream for this object. This is used
22756 * Returns: (transfer none): a #GInputStream, owned by the #GIOStream. Do not free.
22762 * g_io_stream_get_output_stream:
22763 * @stream: a #GIOStream
22765 * Gets the output stream for this object. This is used for
22768 * Returns: (transfer none): a #GOutputStream, owned by the #GIOStream. Do not free.
22774 * g_io_stream_has_pending:
22775 * @stream: a #GIOStream
22777 * Checks if a stream has pending actions.
22779 * Returns: %TRUE if @stream has pending actions.
22785 * g_io_stream_is_closed:
22786 * @stream: a #GIOStream
22788 * Checks if a stream is closed.
22790 * Returns: %TRUE if the stream is closed.
22796 * g_io_stream_set_pending:
22797 * @stream: a #GIOStream
22798 * @error: a #GError location to store the error occurring, or %NULL to ignore
22800 * Sets @stream to have actions pending. If the pending flag is
22801 * already set or @stream is closed, it will return %FALSE and set
22804 * Returns: %TRUE if pending was previously unset and is now set.
22810 * g_io_stream_splice_async:
22811 * @stream1: a #GIOStream.
22812 * @stream2: a #GIOStream.
22813 * @flags: a set of #GIOStreamSpliceFlags.
22814 * @io_priority: the io priority of the request.
22815 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22816 * @callback: (scope async): a #GAsyncReadyCallback.
22817 * @user_data: (closure): user data passed to @callback.
22819 * Asyncronously splice the output stream of @stream1 to the input stream of
22820 * @stream2, and splice the output stream of @stream2 to the input stream of
22823 * When the operation is finished @callback will be called.
22824 * You can then call g_io_stream_splice_finish() to get the
22825 * result of the operation.
22832 * g_io_stream_splice_finish:
22833 * @result: a #GAsyncResult.
22834 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22836 * Finishes an asynchronous io stream splice operation.
22838 * Returns: %TRUE on success, %FALSE otherwise.
22844 * g_keyfile_settings_backend_new:
22845 * @filename: the filename of the keyfile
22846 * @root_path: the path under which all settings keys appear
22847 * @root_group: (allow-none): the group name corresponding to @root_path, or %NULL
22849 * Creates a keyfile-backed #GSettingsBackend.
22851 * The filename of the keyfile to use is given by @filename.
22853 * All settings read to or written from the backend must fall under the
22854 * path given in @root_path (which must start and end with a slash and
22855 * not contain two consecutive slashes). @root_path may be "/".
22857 * If @root_group is non-%NULL then it specifies the name of the keyfile
22858 * group used for keys that are written directly below @root_path. For
22859 * example, if @root_path is "/apps/example/" and @root_group is
22860 * "toplevel", then settings the key "/apps/example/enabled" to a value
22861 * of %TRUE will cause the following to appear in the keyfile:
22868 * If @root_group is %NULL then it is not permitted to store keys
22869 * directly below the @root_path.
22871 * For keys not stored directly below @root_path (ie: in a sub-path),
22872 * the name of the subpath (with the final slash stripped) is used as
22873 * the name of the keyfile group. To continue the example, if
22874 * "/apps/example/profiles/default/font-size" were set to
22875 * 12 then the following would appear in the keyfile:
22878 * [profiles/default]
22882 * The backend will refuse writes (and return writability as being
22883 * %FALSE) for keys outside of @root_path and, in the event that
22884 * @root_group is %NULL, also for keys directly under @root_path.
22885 * Writes will also be refused if the backend detects that it has the
22886 * inability to rewrite the keyfile (ie: the containing directory is not
22889 * There is no checking done for your key namespace clashing with the
22890 * syntax of the key file format. For example, if you have '[' or ']'
22891 * characters in your path names or '=' in your key names you may be in
22894 * Returns: (transfer full): a keyfile-backed #GSettingsBackend
22899 * g_loadable_icon_load:
22900 * @icon: a #GLoadableIcon.
22901 * @size: an integer.
22902 * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
22903 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22904 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22906 * Loads a loadable icon. For the asynchronous version of this function,
22907 * see g_loadable_icon_load_async().
22909 * Returns: (transfer full): a #GInputStream to read the icon from.
22914 * g_loadable_icon_load_async:
22915 * @icon: a #GLoadableIcon.
22916 * @size: an integer.
22917 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22918 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
22919 * @user_data: (closure): the data to pass to callback function
22921 * Loads an icon asynchronously. To finish this function, see
22922 * g_loadable_icon_load_finish(). For the synchronous, blocking
22923 * version of this function, see g_loadable_icon_load().
22928 * g_loadable_icon_load_finish:
22929 * @icon: a #GLoadableIcon.
22930 * @res: a #GAsyncResult.
22931 * @type: a location to store the type of the loaded icon, %NULL to ignore.
22932 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22934 * Finishes an asynchronous icon load started in g_loadable_icon_load_async().
22936 * Returns: (transfer full): a #GInputStream to read the icon from.
22943 * Returns a new #GVfs handle for a local vfs.
22945 * Returns: a new #GVfs handle.
22950 * g_memory_input_stream_add_bytes:
22951 * @stream: a #GMemoryInputStream
22952 * @bytes: input data
22954 * Appends @bytes to data that can be read from the input stream.
22961 * g_memory_input_stream_add_data:
22962 * @stream: a #GMemoryInputStream
22963 * @data: (array length=len) (element-type guint8) (transfer full): input data
22964 * @len: length of the data, may be -1 if @data is a nul-terminated string
22965 * @destroy: (allow-none): function that is called to free @data, or %NULL
22967 * Appends @data to data that can be read from the input stream
22972 * g_memory_input_stream_new:
22974 * Creates a new empty #GMemoryInputStream.
22976 * Returns: a new #GInputStream
22981 * g_memory_input_stream_new_from_bytes:
22982 * @bytes: a #GBytes
22984 * Creates a new #GMemoryInputStream with data from the given @bytes.
22986 * Returns: new #GInputStream read from @bytes
22992 * g_memory_input_stream_new_from_data:
22993 * @data: (array length=len) (element-type guint8) (transfer full): input data
22994 * @len: length of the data, may be -1 if @data is a nul-terminated string
22995 * @destroy: (allow-none): function that is called to free @data, or %NULL
22997 * Creates a new #GMemoryInputStream with data in memory of a given size.
22999 * Returns: new #GInputStream read from @data of @len bytes.
23004 * g_memory_output_stream_get_data:
23005 * @ostream: a #GMemoryOutputStream
23007 * Gets any loaded data from the @ostream.
23009 * Note that the returned pointer may become invalid on the next
23010 * write or truncate operation on the stream.
23012 * Returns: (transfer none): pointer to the stream's data
23017 * g_memory_output_stream_get_data_size:
23018 * @ostream: a #GMemoryOutputStream
23020 * Returns the number of bytes from the start up
23021 * to including the last byte written in the stream
23022 * that has not been truncated away.
23024 * Returns: the number of bytes written to the stream
23030 * g_memory_output_stream_get_size:
23031 * @ostream: a #GMemoryOutputStream
23033 * Gets the size of the currently allocated data area (available from
23034 * g_memory_output_stream_get_data()). If the stream isn't
23035 * growable (no realloc was passed to g_memory_output_stream_new()) then
23036 * this is the maximum size of the stream and further writes
23037 * will return %G_IO_ERROR_NO_SPACE.
23039 * Note that for growable streams the returned size may become invalid on
23040 * the next write or truncate operation on the stream.
23042 * If you want the number of bytes currently written to the stream, use
23043 * g_memory_output_stream_get_data_size().
23045 * Returns: the number of bytes allocated for the data buffer
23050 * g_memory_output_stream_new: (skip)
23051 * @data: (allow-none): pointer to a chunk of memory to use, or %NULL
23052 * @size: the size of @data
23053 * @realloc_function: (allow-none): a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
23054 * @destroy_function: (allow-none): a function to be called on @data when the stream is finalized, or %NULL
23056 * Creates a new #GMemoryOutputStream.
23058 * If @data is non-%NULL, the stream will use that for its internal storage.
23059 * If @realloc_fn is non-%NULL, it will be used for resizing the internal
23060 * storage when necessary. To construct a fixed-size output stream,
23061 * pass %NULL as @realloc_fn.
23064 * /* a stream that can grow */
23065 * stream = g_memory_output_stream_new (NULL, 0, realloc, free);
23067 * /* another stream that can grow */
23068 * stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
23070 * /* a fixed-size stream */
23071 * data = malloc (200);
23072 * stream3 = g_memory_output_stream_new (data, 200, NULL, free);
23075 * Returns: A newly created #GMemoryOutputStream object.
23080 * g_memory_output_stream_steal_as_bytes:
23081 * @ostream: a #GMemoryOutputStream
23083 * Returns data from the @ostream as a #GBytes. @ostream must be
23084 * closed before calling this function.
23086 * Returns: (transfer full): the stream's data
23092 * g_memory_output_stream_steal_data:
23093 * @ostream: a #GMemoryOutputStream
23095 * Gets any loaded data from the @ostream. Ownership of the data
23096 * is transferred to the caller; when no longer needed it must be
23097 * freed using the free function set in @ostream's
23098 * #GMemoryOutputStream:destroy-function property.
23100 * @ostream must be closed before calling this function.
23102 * Returns: (transfer full): the stream's data
23108 * g_memory_settings_backend_new:
23110 * Creates a memory-backed #GSettingsBackend.
23112 * This backend allows changes to settings, but does not write them
23113 * to any backing storage, so the next time you run your application,
23114 * the memory backend will start out with the default values again.
23116 * Returns: (transfer full): a newly created #GSettingsBackend
23124 * @label: (allow-none): the section label, or %NULL
23125 * @detailed_action: (allow-none): the detailed action string, or %NULL
23127 * Convenience function for appending a normal menu item to the end of
23128 * @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
23129 * flexible alternative.
23136 * g_menu_append_item:
23138 * @item: a #GMenuItem to append
23140 * Appends @item to the end of @menu.
23142 * See g_menu_insert_item() for more information.
23149 * g_menu_append_section:
23151 * @label: (allow-none): the section label, or %NULL
23152 * @section: a #GMenuModel with the items of the section
23154 * Convenience function for appending a section menu item to the end of
23155 * @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for a
23156 * more flexible alternative.
23163 * g_menu_append_submenu:
23165 * @label: (allow-none): the section label, or %NULL
23166 * @submenu: a #GMenuModel with the items of the submenu
23168 * Convenience function for appending a submenu menu item to the end of
23169 * @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for a
23170 * more flexible alternative.
23177 * g_menu_attribute_iter_get_name:
23178 * @iter: a #GMenuAttributeIter
23180 * Gets the name of the attribute at the current iterator position, as
23183 * The iterator is not advanced.
23185 * Returns: the name of the attribute
23191 * g_menu_attribute_iter_get_next:
23192 * @iter: a #GMenuAttributeIter
23193 * @out_name: (out) (allow-none) (transfer none): the type of the attribute
23194 * @value: (out) (allow-none) (transfer full): the attribute value
23196 * This function combines g_menu_attribute_iter_next() with
23197 * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
23199 * First the iterator is advanced to the next (possibly first) attribute.
23200 * If that fails, then %FALSE is returned and there are no other
23203 * If successful, @name and @value are set to the name and value of the
23204 * attribute that has just been advanced to. At this point,
23205 * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will
23206 * return the same values again.
23208 * The value returned in @name remains valid for as long as the iterator
23209 * remains at the current position. The value returned in @value must
23210 * be unreffed using g_variant_unref() when it is no longer in use.
23212 * Returns: %TRUE on success, or %FALSE if there is no additional attribute
23218 * g_menu_attribute_iter_get_value:
23219 * @iter: a #GMenuAttributeIter
23221 * Gets the value of the attribute at the current iterator position.
23223 * The iterator is not advanced.
23225 * Returns: (transfer full): the value of the current attribute
23231 * g_menu_attribute_iter_next:
23232 * @iter: a #GMenuAttributeIter
23234 * Attempts to advance the iterator to the next (possibly first)
23237 * %TRUE is returned on success, or %FALSE if there are no more
23240 * You must call this function when you first acquire the iterator
23241 * to advance it to the first attribute (and determine if the first
23242 * attribute exists at all).
23244 * Returns: %TRUE on success, or %FALSE when there are no more attributes
23253 * Marks @menu as frozen.
23255 * After the menu is frozen, it is an error to attempt to make any
23256 * changes to it. In effect this means that the #GMenu API must no
23259 * This function causes g_menu_model_is_mutable() to begin returning
23260 * %FALSE, which has some positive performance implications.
23269 * @position: the position at which to insert the item
23270 * @label: (allow-none): the section label, or %NULL
23271 * @detailed_action: (allow-none): the detailed action string, or %NULL
23273 * Convenience function for inserting a normal menu item into @menu.
23274 * Combine g_menu_item_new() and g_menu_insert_item() for a more flexible
23282 * g_menu_insert_item:
23284 * @position: the position at which to insert the item
23285 * @item: the #GMenuItem to insert
23287 * Inserts @item into @menu.
23289 * The "insertion" is actually done by copying all of the attribute and
23290 * link values of @item and using them to form a new item within @menu.
23291 * As such, @item itself is not really inserted, but rather, a menu item
23292 * that is exactly the same as the one presently described by @item.
23294 * This means that @item is essentially useless after the insertion
23295 * occurs. Any changes you make to it are ignored unless it is inserted
23296 * again (at which point its updated values will be copied).
23298 * You should probably just free @item once you're done.
23300 * There are many convenience functions to take care of common cases.
23301 * See g_menu_insert(), g_menu_insert_section() and
23302 * g_menu_insert_submenu() as well as "prepend" and "append" variants of
23303 * each of these functions.
23310 * g_menu_insert_section:
23312 * @position: the position at which to insert the item
23313 * @label: (allow-none): the section label, or %NULL
23314 * @section: a #GMenuModel with the items of the section
23316 * Convenience function for inserting a section menu item into @menu.
23317 * Combine g_menu_item_new_section() and g_menu_insert_item() for a more
23318 * flexible alternative.
23325 * g_menu_insert_submenu:
23327 * @position: the position at which to insert the item
23328 * @label: (allow-none): the section label, or %NULL
23329 * @submenu: a #GMenuModel with the items of the submenu
23331 * Convenience function for inserting a submenu menu item into @menu.
23332 * Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more
23333 * flexible alternative.
23340 * g_menu_item_get_attribute:
23341 * @menu_item: a #GMenuItem
23342 * @attribute: the attribute name to query
23343 * @format_string: a #GVariant format string
23344 * @...: positional parameters, as per @format_string
23346 * Queries the named @attribute on @menu_item.
23348 * If the attribute exists and matches the #GVariantType corresponding
23349 * to @format_string then @format_string is used to deconstruct the
23350 * value into the positional parameters and %TRUE is returned.
23352 * If the attribute does not exist, or it does exist but has the wrong
23353 * type, then the positional parameters are ignored and %FALSE is
23356 * Returns: %TRUE if the named attribute was found with the expected type
23362 * g_menu_item_get_attribute_value:
23363 * @menu_item: a #GMenuItem
23364 * @attribute: the attribute name to query
23365 * @expected_type: (allow-none): the expected type of the attribute
23367 * Queries the named @attribute on @menu_item.
23369 * If @expected_type is specified and the attribute does not have this
23370 * type, %NULL is returned. %NULL is also returned if the attribute
23371 * simply does not exist.
23373 * Returns: (transfer full): the attribute value, or %NULL
23379 * g_menu_item_get_link:
23380 * @menu_item: a #GMenuItem
23381 * @link: the link name to query
23383 * Queries the named @link on @menu_item.
23385 * Returns: (transfer full): the link, or %NULL
23392 * @label: (allow-none): the section label, or %NULL
23393 * @detailed_action: (allow-none): the detailed action string, or %NULL
23395 * Creates a new #GMenuItem.
23397 * If @label is non-%NULL it is used to set the "label" attribute of the
23400 * If @detailed_action is non-%NULL it is used to set the "action" and
23401 * possibly the "target" attribute of the new item. See
23402 * g_menu_item_set_detailed_action() for more information.
23404 * Returns: a new #GMenuItem
23410 * g_menu_item_new_from_model:
23411 * @model: a #GMenuModel
23412 * @item_index: the index of an item in @model
23414 * Creates a #GMenuItem as an exact copy of an existing menu item in a
23417 * @item_index must be valid (ie: be sure to call
23418 * g_menu_model_get_n_items() first).
23420 * Returns: a new #GMenuItem.
23426 * g_menu_item_new_section:
23427 * @label: (allow-none): the section label, or %NULL
23428 * @section: a #GMenuModel with the items of the section
23430 * Creates a new #GMenuItem representing a section.
23432 * This is a convenience API around g_menu_item_new() and
23433 * g_menu_item_set_section().
23435 * The effect of having one menu appear as a section of another is
23436 * exactly as it sounds: the items from @section become a direct part of
23437 * the menu that @menu_item is added to.
23439 * Visual separation is typically displayed between two non-empty
23440 * sections. If @label is non-%NULL then it will be encorporated into
23441 * this visual indication. This allows for labeled subsections of a
23444 * As a simple example, consider a typical "Edit" menu from a simple
23445 * program. It probably contains an "Undo" and "Redo" item, followed by
23446 * a separator, followed by "Cut", "Copy" and "Paste".
23448 * This would be accomplished by creating three #GMenu instances. The
23449 * first would be populated with the "Undo" and "Redo" items, and the
23450 * second with the "Cut", "Copy" and "Paste" items. The first and
23451 * second menus would then be added as submenus of the third. In XML
23452 * format, this would look something like the following:
23454 * <informalexample><programlisting><![CDATA[
23455 * <menu id='edit-menu'>
23457 * <item label='Undo'/>
23458 * <item label='Redo'/>
23461 * <item label='Cut'/>
23462 * <item label='Copy'/>
23463 * <item label='Paste'/>
23466 * ]]></programlisting></informalexample>
23468 * The following example is exactly equivalent. It is more illustrative
23469 * of the exact relationship between the menus and items (keeping in
23470 * mind that the 'link' element defines a new menu that is linked to the
23471 * containing one). The style of the second example is more verbose and
23472 * difficult to read (and therefore not recommended except for the
23473 * purpose of understanding what is really going on).
23475 * <informalexample><programlisting><![CDATA[
23476 * <menu id='edit-menu'>
23478 * <link name='section'>
23479 * <item label='Undo'/>
23480 * <item label='Redo'/>
23484 * <link name='section'>
23485 * <item label='Cut'/>
23486 * <item label='Copy'/>
23487 * <item label='Paste'/>
23491 * ]]></programlisting></informalexample>
23493 * Returns: a new #GMenuItem
23499 * g_menu_item_new_submenu:
23500 * @label: (allow-none): the section label, or %NULL
23501 * @submenu: a #GMenuModel with the items of the submenu
23503 * Creates a new #GMenuItem representing a submenu.
23505 * This is a convenience API around g_menu_item_new() and
23506 * g_menu_item_set_submenu().
23508 * Returns: a new #GMenuItem
23514 * g_menu_item_set_action_and_target:
23515 * @menu_item: a #GMenuItem
23516 * @action: (allow-none): the name of the action for this item
23517 * @format_string: (allow-none): a GVariant format string
23518 * @...: positional parameters, as per @format_string
23520 * Sets or unsets the "action" and "target" attributes of @menu_item.
23522 * If @action is %NULL then both the "action" and "target" attributes
23523 * are unset (and @format_string is ignored along with the positional
23526 * If @action is non-%NULL then the "action" attribute is set.
23527 * @format_string is then inspected. If it is non-%NULL then the proper
23528 * position parameters are collected to create a #GVariant instance to
23529 * use as the target value. If it is %NULL then the positional
23530 * parameters are ignored and the "target" attribute is unset.
23532 * See also g_menu_item_set_action_and_target_value() for an equivalent
23533 * call that directly accepts a #GVariant. See
23534 * g_menu_item_set_detailed_action() for a more convenient version that
23535 * works with string-typed targets.
23537 * See also g_menu_item_set_action_and_target_value() for a
23538 * description of the semantics of the action and target attributes.
23545 * g_menu_item_set_action_and_target_value:
23546 * @menu_item: a #GMenuItem
23547 * @action: (allow-none): the name of the action for this item
23548 * @target_value: (allow-none): a #GVariant to use as the action target
23550 * Sets or unsets the "action" and "target" attributes of @menu_item.
23552 * If @action is %NULL then both the "action" and "target" attributes
23553 * are unset (and @target_value is ignored).
23555 * If @action is non-%NULL then the "action" attribute is set. The
23556 * "target" attribute is then set to the value of @target_value if it is
23557 * non-%NULL or unset otherwise.
23559 * Normal menu items (ie: not submenu, section or other custom item
23560 * types) are expected to have the "action" attribute set to identify
23561 * the action that they are associated with. The state type of the
23562 * action help to determine the disposition of the menu item. See
23563 * #GAction and #GActionGroup for an overview of actions.
23565 * In general, clicking on the menu item will result in activation of
23566 * the named action with the "target" attribute given as the parameter
23567 * to the action invocation. If the "target" attribute is not set then
23568 * the action is invoked with no parameter.
23570 * If the action has no state then the menu item is usually drawn as a
23571 * plain menu item (ie: with no additional decoration).
23573 * If the action has a boolean state then the menu item is usually drawn
23574 * as a toggle menu item (ie: with a checkmark or equivalent
23575 * indication). The item should be marked as 'toggled' or 'checked'
23576 * when the boolean state is %TRUE.
23578 * If the action has a string state then the menu item is usually drawn
23579 * as a radio menu item (ie: with a radio bullet or equivalent
23580 * indication). The item should be marked as 'selected' when the string
23581 * state is equal to the value of the @target property.
23583 * See g_menu_item_set_action_and_target() or
23584 * g_menu_item_set_detailed_action() for two equivalent calls that are
23585 * probably more convenient for most uses.
23592 * g_menu_item_set_attribute:
23593 * @menu_item: a #GMenuItem
23594 * @attribute: the attribute to set
23595 * @format_string: (allow-none): a #GVariant format string, or %NULL
23596 * @...: positional parameters, as per @format_string
23598 * Sets or unsets an attribute on @menu_item.
23600 * The attribute to set or unset is specified by @attribute. This
23601 * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23602 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23604 * Attribute names are restricted to lowercase characters, numbers
23605 * and '-'. Furthermore, the names must begin with a lowercase character,
23606 * must not end with a '-', and must not contain consecutive dashes.
23608 * If @format_string is non-%NULL then the proper position parameters
23609 * are collected to create a #GVariant instance to use as the attribute
23610 * value. If it is %NULL then the positional parameterrs are ignored
23611 * and the named attribute is unset.
23613 * See also g_menu_item_set_attribute_value() for an equivalent call
23614 * that directly accepts a #GVariant.
23621 * g_menu_item_set_attribute_value:
23622 * @menu_item: a #GMenuItem
23623 * @attribute: the attribute to set
23624 * @value: (allow-none): a #GVariant to use as the value, or %NULL
23626 * Sets or unsets an attribute on @menu_item.
23628 * The attribute to set or unset is specified by @attribute. This
23629 * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23630 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23632 * Attribute names are restricted to lowercase characters, numbers
23633 * and '-'. Furthermore, the names must begin with a lowercase character,
23634 * must not end with a '-', and must not contain consecutive dashes.
23636 * must consist only of lowercase
23637 * ASCII characters, digits and '-'.
23639 * If @value is non-%NULL then it is used as the new value for the
23640 * attribute. If @value is %NULL then the attribute is unset. If
23641 * the @value #GVariant is floating, it is consumed.
23643 * See also g_menu_item_set_attribute() for a more convenient way to do
23651 * g_menu_item_set_detailed_action:
23652 * @menu_item: a #GMenuItem
23653 * @detailed_action: the "detailed" action string
23655 * Sets the "action" and possibly the "target" attribute of @menu_item.
23657 * If @detailed_action contains a double colon ("::") then it is used as
23658 * a separator between an action name and a target string. In this
23659 * case, this call is equivalent to calling
23660 * g_menu_item_set_action_and_target() with the part before the "::" and
23661 * with a string-type #GVariant containing the part following the "::".
23663 * If @detailed_action doesn't contain "::" then the action is set to
23664 * the given string (verbatim) and the target value is unset.
23666 * See g_menu_item_set_action_and_target() or
23667 * g_menu_item_set_action_and_target_value() for more flexible (but
23668 * slightly less convenient) alternatives.
23670 * See also g_menu_item_set_action_and_target_value() for a description of
23671 * the semantics of the action and target attributes.
23678 * g_menu_item_set_label:
23679 * @menu_item: a #GMenuItem
23680 * @label: (allow-none): the label to set, or %NULL to unset
23682 * Sets or unsets the "label" attribute of @menu_item.
23684 * If @label is non-%NULL it is used as the label for the menu item. If
23685 * it is %NULL then the label attribute is unset.
23692 * g_menu_item_set_link:
23693 * @menu_item: a #GMenuItem
23694 * @link: type of link to establish or unset
23695 * @model: (allow-none): the #GMenuModel to link to (or %NULL to unset)
23697 * Creates a link from @menu_item to @model if non-%NULL, or unsets it.
23699 * Links are used to establish a relationship between a particular menu
23700 * item and another menu. For example, %G_MENU_LINK_SUBMENU is used to
23701 * associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
23702 * is used to create a section. Other types of link can be used, but there
23703 * is no guarantee that clients will be able to make sense of them.
23704 * Link types are restricted to lowercase characters, numbers
23705 * and '-'. Furthermore, the names must begin with a lowercase character,
23706 * must not end with a '-', and must not contain consecutive dashes.
23713 * g_menu_item_set_section:
23714 * @menu_item: a #GMenuItem
23715 * @section: (allow-none): a #GMenuModel, or %NULL
23717 * Sets or unsets the "section" link of @menu_item to @section.
23719 * The effect of having one menu appear as a section of another is
23720 * exactly as it sounds: the items from @section become a direct part of
23721 * the menu that @menu_item is added to. See g_menu_item_new_section()
23722 * for more information about what it means for a menu item to be a
23730 * g_menu_item_set_submenu:
23731 * @menu_item: a #GMenuItem
23732 * @submenu: (allow-none): a #GMenuModel, or %NULL
23734 * Sets or unsets the "submenu" link of @menu_item to @submenu.
23736 * If @submenu is non-%NULL, it is linked to. If it is %NULL then the
23739 * The effect of having one menu appear as a submenu of another is
23740 * exactly as it sounds.
23747 * g_menu_link_iter_get_name:
23748 * @iter: a #GMenuLinkIter
23750 * Gets the name of the link at the current iterator position.
23752 * The iterator is not advanced.
23754 * Returns: the type of the link
23760 * g_menu_link_iter_get_next:
23761 * @iter: a #GMenuLinkIter
23762 * @out_link: (out) (allow-none) (transfer none): the name of the link
23763 * @value: (out) (allow-none) (transfer full): the linked #GMenuModel
23765 * This function combines g_menu_link_iter_next() with
23766 * g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
23768 * First the iterator is advanced to the next (possibly first) link.
23769 * If that fails, then %FALSE is returned and there are no other effects.
23771 * If successful, @out_link and @value are set to the name and #GMenuModel
23772 * of the link that has just been advanced to. At this point,
23773 * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
23774 * same values again.
23776 * The value returned in @out_link remains valid for as long as the iterator
23777 * remains at the current position. The value returned in @value must
23778 * be unreffed using g_object_unref() when it is no longer in use.
23780 * Returns: %TRUE on success, or %FALSE if there is no additional link
23786 * g_menu_link_iter_get_value:
23787 * @iter: a #GMenuLinkIter
23789 * Gets the linked #GMenuModel at the current iterator position.
23791 * The iterator is not advanced.
23793 * Returns: (transfer full): the #GMenuModel that is linked to
23799 * g_menu_link_iter_next:
23800 * @iter: a #GMenuLinkIter
23802 * Attempts to advance the iterator to the next (possibly first)
23805 * %TRUE is returned on success, or %FALSE if there are no more links.
23807 * You must call this function when you first acquire the iterator to
23808 * advance it to the first link (and determine if the first link exists
23811 * Returns: %TRUE on success, or %FALSE when there are no more links
23817 * g_menu_model_get_item_attribute:
23818 * @model: a #GMenuModel
23819 * @item_index: the index of the item
23820 * @attribute: the attribute to query
23821 * @format_string: a #GVariant format string
23822 * @...: positional parameters, as per @format_string
23824 * Queries item at position @item_index in @model for the attribute
23825 * specified by @attribute.
23827 * If the attribute exists and matches the #GVariantType corresponding
23828 * to @format_string then @format_string is used to deconstruct the
23829 * value into the positional parameters and %TRUE is returned.
23831 * If the attribute does not exist, or it does exist but has the wrong
23832 * type, then the positional parameters are ignored and %FALSE is
23835 * This function is a mix of g_menu_model_get_item_attribute_value() and
23836 * g_variant_get(), followed by a g_variant_unref(). As such,
23837 * @format_string must make a complete copy of the data (since the
23838 * #GVariant may go away after the call to g_variant_unref()). In
23839 * particular, no '&' characters are allowed in @format_string.
23841 * Returns: %TRUE if the named attribute was found with the expected type
23847 * g_menu_model_get_item_attribute_value:
23848 * @model: a #GMenuModel
23849 * @item_index: the index of the item
23850 * @attribute: the attribute to query
23851 * @expected_type: (allow-none): the expected type of the attribute, or %NULL
23853 * Queries the item at position @item_index in @model for the attribute
23854 * specified by @attribute.
23856 * If @expected_type is non-%NULL then it specifies the expected type of
23857 * the attribute. If it is %NULL then any type will be accepted.
23859 * If the attribute exists and matches @expected_type (or if the
23860 * expected type is unspecified) then the value is returned.
23862 * If the attribute does not exist, or does not match the expected type
23863 * then %NULL is returned.
23865 * Returns: (transfer full): the value of the attribute
23871 * g_menu_model_get_item_link:
23872 * @model: a #GMenuModel
23873 * @item_index: the index of the item
23874 * @link: the link to query
23876 * Queries the item at position @item_index in @model for the link
23877 * specified by @link.
23879 * If the link exists, the linked #GMenuModel is returned. If the link
23880 * does not exist, %NULL is returned.
23882 * Returns: (transfer full): the linked #GMenuModel, or %NULL
23888 * g_menu_model_get_n_items:
23889 * @model: a #GMenuModel
23891 * Query the number of items in @model.
23893 * Returns: the number of items
23899 * g_menu_model_is_mutable:
23900 * @model: a #GMenuModel
23902 * Queries if @model is mutable.
23904 * An immutable #GMenuModel will never emit the #GMenuModel::items-changed
23905 * signal. Consumers of the model may make optimisations accordingly.
23907 * Returns: %TRUE if the model is mutable (ie: "items-changed" may be emitted).
23913 * g_menu_model_items_changed:
23914 * @model: a #GMenuModel
23915 * @position: the position of the change
23916 * @removed: the number of items removed
23917 * @added: the number of items added
23919 * Requests emission of the #GMenuModel::items-changed signal on @model.
23921 * This function should never be called except by #GMenuModel
23922 * subclasses. Any other calls to this function will very likely lead
23923 * to a violation of the interface of the model.
23925 * The implementation should update its internal representation of the
23926 * menu before emitting the signal. The implementation should further
23927 * expect to receive queries about the new state of the menu (and
23928 * particularly added menu items) while signal handlers are running.
23930 * The implementation must dispatch this call directly from a mainloop
23931 * entry and not in response to calls -- particularly those from the
23932 * #GMenuModel API. Said another way: the menu must not change while
23933 * user code is running without returning to the mainloop.
23940 * g_menu_model_iterate_item_attributes:
23941 * @model: a #GMenuModel
23942 * @item_index: the index of the item
23944 * Creates a #GMenuAttributeIter to iterate over the attributes of
23945 * the item at position @item_index in @model.
23947 * You must free the iterator with g_object_unref() when you are done.
23949 * Returns: (transfer full): a new #GMenuAttributeIter
23955 * g_menu_model_iterate_item_links:
23956 * @model: a #GMenuModel
23957 * @item_index: the index of the item
23959 * Creates a #GMenuLinkIter to iterate over the links of the item at
23960 * position @item_index in @model.
23962 * You must free the iterator with g_object_unref() when you are done.
23964 * Returns: (transfer full): a new #GMenuLinkIter
23972 * Creates a new #GMenu.
23974 * The new menu has no items.
23976 * Returns: a new #GMenu
23984 * @label: (allow-none): the section label, or %NULL
23985 * @detailed_action: (allow-none): the detailed action string, or %NULL
23987 * Convenience function for prepending a normal menu item to the start
23988 * of @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
23989 * flexible alternative.
23996 * g_menu_prepend_item:
23998 * @item: a #GMenuItem to prepend
24000 * Prepends @item to the start of @menu.
24002 * See g_menu_insert_item() for more information.
24009 * g_menu_prepend_section:
24011 * @label: (allow-none): the section label, or %NULL
24012 * @section: a #GMenuModel with the items of the section
24014 * Convenience function for prepending a section menu item to the start
24015 * of @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for
24016 * a more flexible alternative.
24023 * g_menu_prepend_submenu:
24025 * @label: (allow-none): the section label, or %NULL
24026 * @submenu: a #GMenuModel with the items of the submenu
24028 * Convenience function for prepending a submenu menu item to the start
24029 * of @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for
24030 * a more flexible alternative.
24039 * @position: the position of the item to remove
24041 * Removes an item from the menu.
24043 * @position gives the index of the item to remove.
24045 * It is an error if position is not in range the range from 0 to one
24046 * less than the number of items in the menu.
24048 * It is not possible to remove items by identity since items are added
24049 * to the menu simply by copying their links and attributes (ie:
24050 * identity of the item itself is not preserved).
24057 * g_mount_can_eject:
24058 * @mount: a #GMount.
24060 * Checks if @mount can be eject.
24062 * Returns: %TRUE if the @mount can be ejected.
24067 * g_mount_can_unmount:
24068 * @mount: a #GMount.
24070 * Checks if @mount can be mounted.
24072 * Returns: %TRUE if the @mount can be unmounted.
24078 * @mount: a #GMount.
24079 * @flags: flags affecting the unmount if required for eject
24080 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24081 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24082 * @user_data: user data passed to @callback.
24084 * Ejects a mount. This is an asynchronous operation, and is
24085 * finished by calling g_mount_eject_finish() with the @mount
24086 * and #GAsyncResult data returned in the @callback.
24088 * Deprecated: 2.22: Use g_mount_eject_with_operation() instead.
24093 * g_mount_eject_finish:
24094 * @mount: a #GMount.
24095 * @result: a #GAsyncResult.
24096 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24098 * Finishes ejecting a mount. If any errors occurred during the operation,
24099 * @error will be set to contain the errors and %FALSE will be returned.
24101 * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
24102 * Deprecated: 2.22: Use g_mount_eject_with_operation_finish() instead.
24107 * g_mount_eject_with_operation:
24108 * @mount: a #GMount.
24109 * @flags: flags affecting the unmount if required for eject
24110 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
24111 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24112 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24113 * @user_data: user data passed to @callback.
24115 * Ejects a mount. This is an asynchronous operation, and is
24116 * finished by calling g_mount_eject_with_operation_finish() with the @mount
24117 * and #GAsyncResult data returned in the @callback.
24124 * g_mount_eject_with_operation_finish:
24125 * @mount: a #GMount.
24126 * @result: a #GAsyncResult.
24127 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24129 * Finishes ejecting a mount. If any errors occurred during the operation,
24130 * @error will be set to contain the errors and %FALSE will be returned.
24132 * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
24138 * g_mount_get_default_location:
24139 * @mount: a #GMount.
24141 * Gets the default location of @mount. The default location of the given
24142 * @mount is a path that reflects the main entry point for the user (e.g.
24143 * the home directory, or the root of the volume).
24145 * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
24150 * g_mount_get_drive:
24151 * @mount: a #GMount.
24153 * Gets the drive for the @mount.
24155 * This is a convenience method for getting the #GVolume and then
24156 * using that object to get the #GDrive.
24158 * Returns: (transfer full): a #GDrive or %NULL if @mount is not associated with a volume or a drive. The returned object should be unreffed with g_object_unref() when no longer needed.
24163 * g_mount_get_icon:
24164 * @mount: a #GMount.
24166 * Gets the icon for @mount.
24168 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
24173 * g_mount_get_name:
24174 * @mount: a #GMount.
24176 * Gets the name of @mount.
24178 * Returns: the name for the given @mount. The returned string should be freed with g_free() when no longer needed.
24183 * g_mount_get_root:
24184 * @mount: a #GMount.
24186 * Gets the root directory on @mount.
24188 * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
24193 * g_mount_get_sort_key:
24194 * @mount: A #GMount.
24196 * Gets the sort key for @mount, if any.
24198 * Returns: Sorting key for @mount or %NULL if no such key is available.
24204 * g_mount_get_symbolic_icon:
24205 * @mount: a #GMount.
24207 * Gets the symbolic icon for @mount.
24209 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
24215 * g_mount_get_uuid:
24216 * @mount: a #GMount.
24218 * Gets the UUID for the @mount. The reference is typically based on
24219 * the file system UUID for the mount in question and should be
24220 * considered an opaque string. Returns %NULL if there is no UUID
24223 * Returns: the UUID for @mount or %NULL if no UUID can be computed. The returned string should be freed with g_free() when no longer needed.
24228 * g_mount_get_volume:
24229 * @mount: a #GMount.
24231 * Gets the volume for the @mount.
24233 * Returns: (transfer full): a #GVolume or %NULL if @mount is not associated with a volume. The returned object should be unreffed with g_object_unref() when no longer needed.
24238 * g_mount_guess_content_type:
24239 * @mount: a #GMount
24240 * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
24241 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
24242 * @callback: a #GAsyncReadyCallback
24243 * @user_data: user data passed to @callback
24245 * Tries to guess the type of content stored on @mount. Returns one or
24246 * more textual identifiers of well-known content types (typically
24247 * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
24248 * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
24249 * specification for more on x-content types.
24251 * This is an asynchronous operation (see
24252 * g_mount_guess_content_type_sync() for the synchronous version), and
24253 * is finished by calling g_mount_guess_content_type_finish() with the
24254 * @mount and #GAsyncResult data returned in the @callback.
24261 * g_mount_guess_content_type_finish:
24262 * @mount: a #GMount
24263 * @result: a #GAsyncResult
24264 * @error: a #GError location to store the error occurring, or %NULL to ignore
24266 * Finishes guessing content types of @mount. If any errors occurred
24267 * during the operation, @error will be set to contain the errors and
24268 * %FALSE will be returned. In particular, you may get an
24269 * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
24272 * Returns: (transfer full) (element-type utf8): a %NULL-terminated array of content types or %NULL on error. Caller should free this array with g_strfreev() when done with it.
24278 * g_mount_guess_content_type_sync:
24279 * @mount: a #GMount
24280 * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
24281 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
24282 * @error: a #GError location to store the error occurring, or %NULL to ignore
24284 * Tries to guess the type of content stored on @mount. Returns one or
24285 * more textual identifiers of well-known content types (typically
24286 * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
24287 * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
24288 * specification for more on x-content types.
24290 * This is an synchronous operation and as such may block doing IO;
24291 * see g_mount_guess_content_type() for the asynchronous version.
24293 * Returns: (transfer full) (element-type utf8): a %NULL-terminated array of content types or %NULL on error. Caller should free this array with g_strfreev() when done with it.
24299 * g_mount_is_shadowed:
24300 * @mount: A #GMount.
24302 * Determines if @mount is shadowed. Applications or libraries should
24303 * avoid displaying @mount in the user interface if it is shadowed.
24305 * A mount is said to be shadowed if there exists one or more user
24306 * visible objects (currently #GMount objects) with a root that is
24307 * inside the root of @mount.
24309 * One application of shadow mounts is when exposing a single file
24310 * system that is used to address several logical volumes. In this
24311 * situation, a #GVolumeMonitor implementation would create two
24312 * #GVolume objects (for example, one for the camera functionality of
24313 * the device and one for a SD card reader on the device) with
24314 * activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
24315 * and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
24316 * underlying mount (with root
24317 * <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
24318 * #GVolumeMonitor implementation would create two #GMount objects
24319 * (each with their root matching the corresponding volume activation
24320 * root) that would shadow the original mount.
24322 * The proxy monitor in GVfs 2.26 and later, automatically creates and
24323 * manage shadow mounts (and shadows the underlying mount) if the
24324 * activation root on a #GVolume is set.
24326 * Returns: %TRUE if @mount is shadowed.
24332 * g_mount_operation_get_anonymous:
24333 * @op: a #GMountOperation.
24335 * Check to see whether the mount operation is being used
24336 * for an anonymous user.
24338 * Returns: %TRUE if mount operation is anonymous.
24343 * g_mount_operation_get_choice:
24344 * @op: a #GMountOperation.
24346 * Gets a choice from the mount operation.
24348 * Returns: an integer containing an index of the user's choice from the choice's list, or %0.
24353 * g_mount_operation_get_domain:
24354 * @op: a #GMountOperation.
24356 * Gets the domain of the mount operation.
24358 * Returns: a string set to the domain.
24363 * g_mount_operation_get_password:
24364 * @op: a #GMountOperation.
24366 * Gets a password from the mount operation.
24368 * Returns: a string containing the password within @op.
24373 * g_mount_operation_get_password_save:
24374 * @op: a #GMountOperation.
24376 * Gets the state of saving passwords for the mount operation.
24378 * Returns: a #GPasswordSave flag.
24383 * g_mount_operation_get_username:
24384 * @op: a #GMountOperation.
24386 * Get the user name from the mount operation.
24388 * Returns: a string containing the user name.
24393 * g_mount_operation_new:
24395 * Creates a new mount operation.
24397 * Returns: a #GMountOperation.
24402 * g_mount_operation_reply:
24403 * @op: a #GMountOperation
24404 * @result: a #GMountOperationResult
24406 * Emits the #GMountOperation::reply signal.
24411 * g_mount_operation_set_anonymous:
24412 * @op: a #GMountOperation.
24413 * @anonymous: boolean value.
24415 * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
24420 * g_mount_operation_set_choice:
24421 * @op: a #GMountOperation.
24422 * @choice: an integer.
24424 * Sets a default choice for the mount operation.
24429 * g_mount_operation_set_domain:
24430 * @op: a #GMountOperation.
24431 * @domain: the domain to set.
24433 * Sets the mount operation's domain.
24438 * g_mount_operation_set_password:
24439 * @op: a #GMountOperation.
24440 * @password: password to set.
24442 * Sets the mount operation's password to @password.
24447 * g_mount_operation_set_password_save:
24448 * @op: a #GMountOperation.
24449 * @save: a set of #GPasswordSave flags.
24451 * Sets the state of saving passwords for the mount operation.
24456 * g_mount_operation_set_username:
24457 * @op: a #GMountOperation.
24458 * @username: input username.
24460 * Sets the user name within @op to @username.
24466 * @mount: a #GMount.
24467 * @flags: flags affecting the operation
24468 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
24469 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24470 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24471 * @user_data: user data passed to @callback.
24473 * Remounts a mount. This is an asynchronous operation, and is
24474 * finished by calling g_mount_remount_finish() with the @mount
24475 * and #GAsyncResults data returned in the @callback.
24477 * Remounting is useful when some setting affecting the operation
24478 * of the volume has been changed, as these may need a remount to
24479 * take affect. While this is semantically equivalent with unmounting
24480 * and then remounting not all backends might need to actually be
24486 * g_mount_remount_finish:
24487 * @mount: a #GMount.
24488 * @result: a #GAsyncResult.
24489 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24491 * Finishes remounting a mount. If any errors occurred during the operation,
24492 * @error will be set to contain the errors and %FALSE will be returned.
24494 * Returns: %TRUE if the mount was successfully remounted. %FALSE otherwise.
24500 * @mount: A #GMount.
24502 * Increments the shadow count on @mount. Usually used by
24503 * #GVolumeMonitor implementations when creating a shadow mount for
24504 * @mount, see g_mount_is_shadowed() for more information. The caller
24505 * will need to emit the #GMount::changed signal on @mount manually.
24513 * @mount: a #GMount.
24514 * @flags: flags affecting the operation
24515 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24516 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24517 * @user_data: user data passed to @callback.
24519 * Unmounts a mount. This is an asynchronous operation, and is
24520 * finished by calling g_mount_unmount_finish() with the @mount
24521 * and #GAsyncResult data returned in the @callback.
24523 * Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
24528 * g_mount_unmount_finish:
24529 * @mount: a #GMount.
24530 * @result: a #GAsyncResult.
24531 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24533 * Finishes unmounting a mount. If any errors occurred during the operation,
24534 * @error will be set to contain the errors and %FALSE will be returned.
24536 * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
24537 * Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
24542 * g_mount_unmount_with_operation:
24543 * @mount: a #GMount.
24544 * @flags: flags affecting the operation
24545 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
24546 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24547 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24548 * @user_data: user data passed to @callback.
24550 * Unmounts a mount. This is an asynchronous operation, and is
24551 * finished by calling g_mount_unmount_with_operation_finish() with the @mount
24552 * and #GAsyncResult data returned in the @callback.
24559 * g_mount_unmount_with_operation_finish:
24560 * @mount: a #GMount.
24561 * @result: a #GAsyncResult.
24562 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24564 * Finishes unmounting a mount. If any errors occurred during the operation,
24565 * @error will be set to contain the errors and %FALSE will be returned.
24567 * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
24573 * g_mount_unshadow:
24574 * @mount: A #GMount.
24576 * Decrements the shadow count on @mount. Usually used by
24577 * #GVolumeMonitor implementations when destroying a shadow mount for
24578 * @mount, see g_mount_is_shadowed() for more information. The caller
24579 * will need to emit the #GMount::changed signal on @mount manually.
24586 * g_network_address_get_hostname:
24587 * @addr: a #GNetworkAddress
24589 * Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
24590 * depending on what @addr was created with.
24592 * Returns: @addr's hostname
24598 * g_network_address_get_port:
24599 * @addr: a #GNetworkAddress
24601 * Gets @addr's port number
24603 * Returns: @addr's port (which may be 0)
24609 * g_network_address_get_scheme:
24610 * @addr: a #GNetworkAddress
24612 * Gets @addr's scheme
24614 * Returns: @addr's scheme (%NULL if not built from URI)
24620 * g_network_address_new:
24621 * @hostname: the hostname
24624 * Creates a new #GSocketConnectable for connecting to the given
24625 * @hostname and @port.
24627 * Returns: (transfer full) (type GNetworkAddress): the new #GNetworkAddress
24633 * g_network_address_parse:
24634 * @host_and_port: the hostname and optionally a port
24635 * @default_port: the default port if not in @host_and_port
24636 * @error: a pointer to a #GError, or %NULL
24638 * Creates a new #GSocketConnectable for connecting to the given
24639 * @hostname and @port. May fail and return %NULL in case
24640 * parsing @host_and_port fails.
24642 * @host_and_port may be in any of a number of recognised formats; an IPv6
24643 * address, an IPv4 address, or a domain name (in which case a DNS
24644 * lookup is performed). Quoting with [] is supported for all address
24645 * types. A port override may be specified in the usual way with a
24648 * If no port is specified in @host_and_port then @default_port will be
24649 * used as the port number to connect to.
24651 * In general, @host_and_port is expected to be provided by the user
24652 * (allowing them to give the hostname, and a port overide if necessary)
24653 * and @default_port is expected to be provided by the application.
24655 * (The port component of @host_and_port can also be specified as a
24656 * service name rather than as a numeric port, but this functionality
24657 * is deprecated, because it depends on the contents of /etc/services,
24658 * which is generally quite sparse on platforms other than Linux.)
24660 * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24666 * g_network_address_parse_uri:
24667 * @uri: the hostname and optionally a port
24668 * @default_port: The default port if none is found in the URI
24669 * @error: a pointer to a #GError, or %NULL
24671 * Creates a new #GSocketConnectable for connecting to the given
24672 * @uri. May fail and return %NULL in case parsing @uri fails.
24674 * Using this rather than g_network_address_new() or
24675 * g_network_address_parse() allows #GSocketClient to determine
24676 * when to use application-specific proxy protocols.
24678 * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24684 * g_network_monitor_base_add_network:
24685 * @monitor: the #GNetworkMonitorBase
24686 * @network: a #GInetAddressMask
24688 * Adds @network to @monitor's list of available networks.
24695 * g_network_monitor_base_remove_network:
24696 * @monitor: the #GNetworkMonitorBase
24697 * @network: a #GInetAddressMask
24699 * Removes @network from @monitor's list of available networks.
24706 * g_network_monitor_base_set_networks:
24707 * @monitor: the #GNetworkMonitorBase
24708 * @networks: (array length=length): an array of #GInetAddressMask
24709 * @length: length of @networks
24711 * Drops @monitor's current list of available networks and replaces
24712 * it with @networks.
24717 * g_network_monitor_can_reach:
24718 * @monitor: a #GNetworkMonitor
24719 * @connectable: a #GSocketConnectable
24720 * @cancellable: (allow-none): a #GCancellable, or %NULL
24721 * @error: return location for a #GError, or %NULL
24723 * Attempts to determine whether or not the host pointed to by
24724 * @connectable can be reached, without actually trying to connect to
24727 * This may return %TRUE even when #GNetworkMonitor:network-available
24728 * is %FALSE, if, for example, @monitor can determine that
24729 * @connectable refers to a host on a local network.
24731 * If @monitor believes that an attempt to connect to @connectable
24732 * will succeed, it will return %TRUE. Otherwise, it will return
24733 * %FALSE and set @error to an appropriate error (such as
24734 * %G_IO_ERROR_HOST_UNREACHABLE).
24736 * Note that although this does not attempt to connect to
24737 * @connectable, it may still block for a brief period of time (eg,
24738 * trying to do multicast DNS on the local network), so if you do not
24739 * want to block, you should use g_network_monitor_can_reach_async().
24741 * Returns: %TRUE if @connectable is reachable, %FALSE if not.
24747 * g_network_monitor_can_reach_async:
24748 * @monitor: a #GNetworkMonitor
24749 * @connectable: a #GSocketConnectable
24750 * @cancellable: (allow-none): a #GCancellable, or %NULL
24751 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24752 * @user_data: (closure): the data to pass to callback function
24754 * Asynchronously attempts to determine whether or not the host
24755 * pointed to by @connectable can be reached, without actually
24756 * trying to connect to it.
24758 * For more details, see g_network_monitor_can_reach().
24760 * When the operation is finished, @callback will be called.
24761 * You can then call g_network_monitor_can_reach_finish()
24762 * to get the result of the operation.
24767 * g_network_monitor_can_reach_finish:
24768 * @monitor: a #GNetworkMonitor
24769 * @result: a #GAsyncResult
24770 * @error: return location for errors, or %NULL
24772 * Finishes an async network connectivity test.
24773 * See g_network_monitor_can_reach_async().
24775 * Returns: %TRUE if network is reachable, %FALSE if not.
24780 * g_network_monitor_get_default:
24782 * Gets the default #GNetworkMonitor for the system.
24784 * Returns: (transfer none): a #GNetworkMonitor
24790 * g_network_monitor_get_network_available:
24791 * @monitor: the #GNetworkMonitor
24793 * Checks if the network is available. "Available" here means that the
24794 * system has a default route available for at least one of IPv4 or
24795 * IPv6. It does not necessarily imply that the public Internet is
24796 * reachable. See #GNetworkMonitor:network-available for more details.
24798 * Returns: whether the network is available
24804 * g_network_service_get_domain:
24805 * @srv: a #GNetworkService
24807 * Gets the domain that @srv serves. This might be either UTF-8 or
24808 * ASCII-encoded, depending on what @srv was created with.
24810 * Returns: @srv's domain name
24816 * g_network_service_get_protocol:
24817 * @srv: a #GNetworkService
24819 * Gets @srv's protocol name (eg, "tcp").
24821 * Returns: @srv's protocol name
24827 * g_network_service_get_scheme:
24828 * @srv: a #GNetworkService
24830 * Get's the URI scheme used to resolve proxies. By default, the service name
24831 * is used as scheme.
24833 * Returns: @srv's scheme name
24839 * g_network_service_get_service:
24840 * @srv: a #GNetworkService
24842 * Gets @srv's service name (eg, "ldap").
24844 * Returns: @srv's service name
24850 * g_network_service_new:
24851 * @service: the service type to look up (eg, "ldap")
24852 * @protocol: the networking protocol to use for @service (eg, "tcp")
24853 * @domain: the DNS domain to look up the service in
24855 * Creates a new #GNetworkService representing the given @service,
24856 * @protocol, and @domain. This will initially be unresolved; use the
24857 * #GSocketConnectable interface to resolve it.
24859 * Returns: (transfer full) (type GNetworkService): a new #GNetworkService
24865 * g_network_service_set_scheme:
24866 * @srv: a #GNetworkService
24867 * @scheme: a URI scheme
24869 * Set's the URI scheme used to resolve proxies. By default, the service name
24870 * is used as scheme.
24877 * g_null_settings_backend_new:
24879 * Creates a readonly #GSettingsBackend.
24881 * This backend does not allow changes to settings, so all settings
24882 * will always have their default values.
24884 * Returns: (transfer full): a newly created #GSettingsBackend
24890 * g_output_stream_clear_pending:
24891 * @stream: output stream
24893 * Clears the pending flag on @stream.
24898 * g_output_stream_close:
24899 * @stream: A #GOutputStream.
24900 * @cancellable: (allow-none): optional cancellable object
24901 * @error: location to store the error occurring, or %NULL to ignore
24903 * Closes the stream, releasing resources related to it.
24905 * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
24906 * Closing a stream multiple times will not return an error.
24908 * Closing a stream will automatically flush any outstanding buffers in the
24911 * Streams will be automatically closed when the last reference
24912 * is dropped, but you might want to call this function to make sure
24913 * resources are released as early as possible.
24915 * Some streams might keep the backing store of the stream (e.g. a file descriptor)
24916 * open after the stream is closed. See the documentation for the individual
24917 * stream for details.
24919 * On failure the first error that happened will be reported, but the close
24920 * operation will finish as much as possible. A stream that failed to
24921 * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
24922 * is important to check and report the error to the user, otherwise
24923 * there might be a loss of data as all data might not be written.
24925 * If @cancellable is not %NULL, then the operation can be cancelled by
24926 * triggering the cancellable object from another thread. If the operation
24927 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24928 * Cancelling a close will still leave the stream closed, but there some streams
24929 * can use a faster close that doesn't block to e.g. check errors. On
24930 * cancellation (as with any error) there is no guarantee that all written
24931 * data will reach the target.
24933 * Returns: %TRUE on success, %FALSE on failure
24938 * g_output_stream_close_async:
24939 * @stream: A #GOutputStream.
24940 * @io_priority: the io priority of the request.
24941 * @cancellable: (allow-none): optional cancellable object
24942 * @callback: (scope async): callback to call when the request is satisfied
24943 * @user_data: (closure): the data to pass to callback function
24945 * Requests an asynchronous close of the stream, releasing resources
24946 * related to it. When the operation is finished @callback will be
24947 * called. You can then call g_output_stream_close_finish() to get
24948 * the result of the operation.
24950 * For behaviour details see g_output_stream_close().
24952 * The asyncronous methods have a default fallback that uses threads
24953 * to implement asynchronicity, so they are optional for inheriting
24954 * classes. However, if you override one you must override all.
24959 * g_output_stream_close_finish:
24960 * @stream: a #GOutputStream.
24961 * @result: a #GAsyncResult.
24962 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24964 * Closes an output stream.
24966 * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
24971 * g_output_stream_flush:
24972 * @stream: a #GOutputStream.
24973 * @cancellable: (allow-none): optional cancellable object
24974 * @error: location to store the error occurring, or %NULL to ignore
24976 * Forces a write of all user-space buffered data for the given
24977 * @stream. Will block during the operation. Closing the stream will
24978 * implicitly cause a flush.
24980 * This function is optional for inherited classes.
24982 * If @cancellable is not %NULL, then the operation can be cancelled by
24983 * triggering the cancellable object from another thread. If the operation
24984 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24986 * Returns: %TRUE on success, %FALSE on error
24991 * g_output_stream_flush_async:
24992 * @stream: a #GOutputStream.
24993 * @io_priority: the io priority of the request.
24994 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24995 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24996 * @user_data: (closure): the data to pass to callback function
24998 * Forces an asynchronous write of all user-space buffered data for
24999 * the given @stream.
25000 * For behaviour details see g_output_stream_flush().
25002 * When the operation is finished @callback will be
25003 * called. You can then call g_output_stream_flush_finish() to get the
25004 * result of the operation.
25009 * g_output_stream_flush_finish:
25010 * @stream: a #GOutputStream.
25011 * @result: a GAsyncResult.
25012 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25014 * Finishes flushing an output stream.
25016 * Returns: %TRUE if flush operation succeeded, %FALSE otherwise.
25021 * g_output_stream_has_pending:
25022 * @stream: a #GOutputStream.
25024 * Checks if an ouput stream has pending actions.
25026 * Returns: %TRUE if @stream has pending actions.
25031 * g_output_stream_is_closed:
25032 * @stream: a #GOutputStream.
25034 * Checks if an output stream has already been closed.
25036 * Returns: %TRUE if @stream is closed. %FALSE otherwise.
25041 * g_output_stream_is_closing:
25042 * @stream: a #GOutputStream.
25044 * Checks if an output stream is being closed. This can be
25045 * used inside e.g. a flush implementation to see if the
25046 * flush (or other i/o operation) is called from within
25047 * the closing operation.
25049 * Returns: %TRUE if @stream is being closed. %FALSE otherwise.
25055 * g_output_stream_set_pending:
25056 * @stream: a #GOutputStream.
25057 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25059 * Sets @stream to have actions pending. If the pending flag is
25060 * already set or @stream is closed, it will return %FALSE and set
25063 * Returns: %TRUE if pending was previously unset and is now set.
25068 * g_output_stream_splice:
25069 * @stream: a #GOutputStream.
25070 * @source: a #GInputStream.
25071 * @flags: a set of #GOutputStreamSpliceFlags.
25072 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25073 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25075 * Splices an input stream into an output stream.
25077 * Returns: a #gssize containing the size of the data spliced, or -1 if an error occurred. Note that if the number of bytes spliced is greater than %G_MAXSSIZE, then that will be returned, and there is no way to determine the actual number of bytes spliced.
25082 * g_output_stream_splice_async:
25083 * @stream: a #GOutputStream.
25084 * @source: a #GInputStream.
25085 * @flags: a set of #GOutputStreamSpliceFlags.
25086 * @io_priority: the io priority of the request.
25087 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25088 * @callback: (scope async): a #GAsyncReadyCallback.
25089 * @user_data: (closure): user data passed to @callback.
25091 * Splices a stream asynchronously.
25092 * When the operation is finished @callback will be called.
25093 * You can then call g_output_stream_splice_finish() to get the
25094 * result of the operation.
25096 * For the synchronous, blocking version of this function, see
25097 * g_output_stream_splice().
25102 * g_output_stream_splice_finish:
25103 * @stream: a #GOutputStream.
25104 * @result: a #GAsyncResult.
25105 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25107 * Finishes an asynchronous stream splice operation.
25109 * Returns: a #gssize of the number of bytes spliced. Note that if the number of bytes spliced is greater than %G_MAXSSIZE, then that will be returned, and there is no way to determine the actual number of bytes spliced.
25114 * g_output_stream_write:
25115 * @stream: a #GOutputStream.
25116 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25117 * @count: the number of bytes to write
25118 * @cancellable: (allow-none): optional cancellable object
25119 * @error: location to store the error occurring, or %NULL to ignore
25121 * Tries to write @count bytes from @buffer into the stream. Will block
25122 * during the operation.
25124 * If count is 0, returns 0 and does nothing. A value of @count
25125 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
25127 * On success, the number of bytes written to the stream is returned.
25128 * It is not an error if this is not the same as the requested size, as it
25129 * can happen e.g. on a partial I/O error, or if there is not enough
25130 * storage in the stream. All writes block until at least one byte
25131 * is written or an error occurs; 0 is never returned (unless
25134 * If @cancellable is not %NULL, then the operation can be cancelled by
25135 * triggering the cancellable object from another thread. If the operation
25136 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
25137 * operation was partially finished when the operation was cancelled the
25138 * partial result will be returned, without an error.
25140 * On error -1 is returned and @error is set accordingly.
25142 * Virtual: write_fn
25143 * Returns: Number of bytes written, or -1 on error
25148 * g_output_stream_write_all:
25149 * @stream: a #GOutputStream.
25150 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25151 * @count: the number of bytes to write
25152 * @bytes_written: (out): location to store the number of bytes that was written to the stream
25153 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25154 * @error: location to store the error occurring, or %NULL to ignore
25156 * Tries to write @count bytes from @buffer into the stream. Will block
25157 * during the operation.
25159 * This function is similar to g_output_stream_write(), except it tries to
25160 * write as many bytes as requested, only stopping on an error.
25162 * On a successful write of @count bytes, %TRUE is returned, and @bytes_written
25163 * is set to @count.
25165 * If there is an error during the operation %FALSE is returned and @error
25166 * is set to indicate the error status, @bytes_written is updated to contain
25167 * the number of bytes written into the stream before the error occurred.
25169 * Returns: %TRUE on success, %FALSE if there was an error
25174 * g_output_stream_write_async:
25175 * @stream: A #GOutputStream.
25176 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25177 * @count: the number of bytes to write
25178 * @io_priority: the io priority of the request.
25179 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25180 * @callback: (scope async): callback to call when the request is satisfied
25181 * @user_data: (closure): the data to pass to callback function
25183 * Request an asynchronous write of @count bytes from @buffer into
25184 * the stream. When the operation is finished @callback will be called.
25185 * You can then call g_output_stream_write_finish() to get the result of the
25188 * During an async request no other sync and async calls are allowed,
25189 * and will result in %G_IO_ERROR_PENDING errors.
25191 * A value of @count larger than %G_MAXSSIZE will cause a
25192 * %G_IO_ERROR_INVALID_ARGUMENT error.
25194 * On success, the number of bytes written will be passed to the
25195 * @callback. It is not an error if this is not the same as the
25196 * requested size, as it can happen e.g. on a partial I/O error,
25197 * but generally we try to write as many bytes as requested.
25199 * You are guaranteed that this method will never fail with
25200 * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
25201 * method will just wait until this changes.
25203 * Any outstanding I/O request with higher priority (lower numerical
25204 * value) will be executed before an outstanding request with lower
25205 * priority. Default priority is %G_PRIORITY_DEFAULT.
25207 * The asyncronous methods have a default fallback that uses threads
25208 * to implement asynchronicity, so they are optional for inheriting
25209 * classes. However, if you override one you must override all.
25211 * For the synchronous, blocking version of this function, see
25212 * g_output_stream_write().
25217 * g_output_stream_write_bytes:
25218 * @stream: a #GOutputStream.
25219 * @bytes: the #GBytes to write
25220 * @cancellable: (allow-none): optional cancellable object
25221 * @error: location to store the error occurring, or %NULL to ignore
25223 * Tries to write the data from @bytes into the stream. Will block
25224 * during the operation.
25226 * If @bytes is 0-length, returns 0 and does nothing. A #GBytes larger
25227 * than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
25229 * On success, the number of bytes written to the stream is returned.
25230 * It is not an error if this is not the same as the requested size, as it
25231 * can happen e.g. on a partial I/O error, or if there is not enough
25232 * storage in the stream. All writes block until at least one byte
25233 * is written or an error occurs; 0 is never returned (unless
25234 * the size of @bytes is 0).
25236 * If @cancellable is not %NULL, then the operation can be cancelled by
25237 * triggering the cancellable object from another thread. If the operation
25238 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
25239 * operation was partially finished when the operation was cancelled the
25240 * partial result will be returned, without an error.
25242 * On error -1 is returned and @error is set accordingly.
25244 * Returns: Number of bytes written, or -1 on error
25249 * g_output_stream_write_bytes_async:
25250 * @stream: A #GOutputStream.
25251 * @bytes: The bytes to write
25252 * @io_priority: the io priority of the request.
25253 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25254 * @callback: (scope async): callback to call when the request is satisfied
25255 * @user_data: (closure): the data to pass to callback function
25257 * Request an asynchronous write of the data in @bytes to the stream.
25258 * When the operation is finished @callback will be called. You can
25259 * then call g_output_stream_write_bytes_finish() to get the result of
25262 * During an async request no other sync and async calls are allowed,
25263 * and will result in %G_IO_ERROR_PENDING errors.
25265 * A #GBytes larger than %G_MAXSSIZE will cause a
25266 * %G_IO_ERROR_INVALID_ARGUMENT error.
25268 * On success, the number of bytes written will be passed to the
25269 * @callback. It is not an error if this is not the same as the
25270 * requested size, as it can happen e.g. on a partial I/O error,
25271 * but generally we try to write as many bytes as requested.
25273 * You are guaranteed that this method will never fail with
25274 * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
25275 * method will just wait until this changes.
25277 * Any outstanding I/O request with higher priority (lower numerical
25278 * value) will be executed before an outstanding request with lower
25279 * priority. Default priority is %G_PRIORITY_DEFAULT.
25281 * For the synchronous, blocking version of this function, see
25282 * g_output_stream_write_bytes().
25287 * g_output_stream_write_bytes_finish:
25288 * @stream: a #GOutputStream.
25289 * @result: a #GAsyncResult.
25290 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25292 * Finishes a stream write-from-#GBytes operation.
25294 * Returns: a #gssize containing the number of bytes written to the stream.
25299 * g_output_stream_write_finish:
25300 * @stream: a #GOutputStream.
25301 * @result: a #GAsyncResult.
25302 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25304 * Finishes a stream write operation.
25306 * Returns: a #gssize containing the number of bytes written to the stream.
25311 * g_permission_acquire:
25312 * @permission: a #GPermission instance
25313 * @cancellable: (allow-none): a #GCancellable, or %NULL
25314 * @error: a pointer to a %NULL #GError, or %NULL
25316 * Attempts to acquire the permission represented by @permission.
25318 * The precise method by which this happens depends on the permission
25319 * and the underlying authentication mechanism. A simple example is
25320 * that a dialog may appear asking the user to enter their password.
25322 * You should check with g_permission_get_can_acquire() before calling
25325 * If the permission is acquired then %TRUE is returned. Otherwise,
25326 * %FALSE is returned and @error is set appropriately.
25328 * This call is blocking, likely for a very long time (in the case that
25329 * user interaction is required). See g_permission_acquire_async() for
25330 * the non-blocking version.
25332 * Returns: %TRUE if the permission was successfully acquired
25338 * g_permission_acquire_async:
25339 * @permission: a #GPermission instance
25340 * @cancellable: (allow-none): a #GCancellable, or %NULL
25341 * @callback: the #GAsyncReadyCallback to call when done
25342 * @user_data: the user data to pass to @callback
25344 * Attempts to acquire the permission represented by @permission.
25346 * This is the first half of the asynchronous version of
25347 * g_permission_acquire().
25354 * g_permission_acquire_finish:
25355 * @permission: a #GPermission instance
25356 * @result: the #GAsyncResult given to the #GAsyncReadyCallback
25357 * @error: a pointer to a %NULL #GError, or %NULL
25359 * Collects the result of attempting to acquire the permission
25360 * represented by @permission.
25362 * This is the second half of the asynchronous version of
25363 * g_permission_acquire().
25365 * Returns: %TRUE if the permission was successfully acquired
25371 * g_permission_get_allowed:
25372 * @permission: a #GPermission instance
25374 * Gets the value of the 'allowed' property. This property is %TRUE if
25375 * the caller currently has permission to perform the action that
25376 * @permission represents the permission to perform.
25378 * Returns: the value of the 'allowed' property
25384 * g_permission_get_can_acquire:
25385 * @permission: a #GPermission instance
25387 * Gets the value of the 'can-acquire' property. This property is %TRUE
25388 * if it is generally possible to acquire the permission by calling
25389 * g_permission_acquire().
25391 * Returns: the value of the 'can-acquire' property
25397 * g_permission_get_can_release:
25398 * @permission: a #GPermission instance
25400 * Gets the value of the 'can-release' property. This property is %TRUE
25401 * if it is generally possible to release the permission by calling
25402 * g_permission_release().
25404 * Returns: the value of the 'can-release' property
25410 * g_permission_impl_update:
25411 * @permission: a #GPermission instance
25412 * @allowed: the new value for the 'allowed' property
25413 * @can_acquire: the new value for the 'can-acquire' property
25414 * @can_release: the new value for the 'can-release' property
25416 * This function is called by the #GPermission implementation to update
25417 * the properties of the permission. You should never call this
25418 * function except from a #GPermission implementation.
25420 * GObject notify signals are generated, as appropriate.
25427 * g_permission_release:
25428 * @permission: a #GPermission instance
25429 * @cancellable: (allow-none): a #GCancellable, or %NULL
25430 * @error: a pointer to a %NULL #GError, or %NULL
25432 * Attempts to release the permission represented by @permission.
25434 * The precise method by which this happens depends on the permission
25435 * and the underlying authentication mechanism. In most cases the
25436 * permission will be dropped immediately without further action.
25438 * You should check with g_permission_get_can_release() before calling
25441 * If the permission is released then %TRUE is returned. Otherwise,
25442 * %FALSE is returned and @error is set appropriately.
25444 * This call is blocking, likely for a very long time (in the case that
25445 * user interaction is required). See g_permission_release_async() for
25446 * the non-blocking version.
25448 * Returns: %TRUE if the permission was successfully released
25454 * g_permission_release_async:
25455 * @permission: a #GPermission instance
25456 * @cancellable: (allow-none): a #GCancellable, or %NULL
25457 * @callback: the #GAsyncReadyCallback to call when done
25458 * @user_data: the user data to pass to @callback
25460 * Attempts to release the permission represented by @permission.
25462 * This is the first half of the asynchronous version of
25463 * g_permission_release().
25470 * g_permission_release_finish:
25471 * @permission: a #GPermission instance
25472 * @result: the #GAsyncResult given to the #GAsyncReadyCallback
25473 * @error: a pointer to a %NULL #GError, or %NULL
25475 * Collects the result of attempting to release the permission
25476 * represented by @permission.
25478 * This is the second half of the asynchronous version of
25479 * g_permission_release().
25481 * Returns: %TRUE if the permission was successfully released
25487 * g_poll_file_monitor_new:
25490 * Polls @file for changes.
25492 * Returns: a new #GFileMonitor for the given #GFile.
25497 * g_pollable_input_stream_can_poll:
25498 * @stream: a #GPollableInputStream.
25500 * Checks if @stream is actually pollable. Some classes may implement
25501 * #GPollableInputStream but have only certain instances of that class
25502 * be pollable. If this method returns %FALSE, then the behavior of
25503 * other #GPollableInputStream methods is undefined.
25505 * For any given stream, the value returned by this method is constant;
25506 * a stream cannot switch from pollable to non-pollable or vice versa.
25508 * Returns: %TRUE if @stream is pollable, %FALSE if not.
25514 * g_pollable_input_stream_create_source:
25515 * @stream: a #GPollableInputStream.
25516 * @cancellable: (allow-none): a #GCancellable, or %NULL
25518 * Creates a #GSource that triggers when @stream can be read, or
25519 * @cancellable is triggered or an error occurs. The callback on the
25520 * source is of the #GPollableSourceFunc type.
25522 * As with g_pollable_input_stream_is_readable(), it is possible that
25523 * the stream may not actually be readable even after the source
25524 * triggers, so you should use g_pollable_input_stream_read_nonblocking()
25525 * rather than g_input_stream_read() from the callback.
25527 * Returns: (transfer full): a new #GSource
25533 * g_pollable_input_stream_is_readable:
25534 * @stream: a #GPollableInputStream.
25536 * Checks if @stream can be read.
25538 * Note that some stream types may not be able to implement this 100%
25539 * reliably, and it is possible that a call to g_input_stream_read()
25540 * after this returns %TRUE would still block. To guarantee
25541 * non-blocking behavior, you should always use
25542 * g_pollable_input_stream_read_nonblocking(), which will return a
25543 * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
25545 * Returns: %TRUE if @stream is readable, %FALSE if not. If an error has occurred on @stream, this will result in g_pollable_input_stream_is_readable() returning %TRUE, and the next attempt to read will return the error.
25551 * g_pollable_input_stream_read_nonblocking:
25552 * @stream: a #GPollableInputStream
25553 * @buffer: a buffer to read data into (which should be at least @count bytes long).
25554 * @count: the number of bytes you want to read
25555 * @cancellable: (allow-none): a #GCancellable, or %NULL
25556 * @error: #GError for error reporting, or %NULL to ignore.
25558 * Attempts to read up to @count bytes from @stream into @buffer, as
25559 * with g_input_stream_read(). If @stream is not currently readable,
25560 * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
25561 * use g_pollable_input_stream_create_source() to create a #GSource
25562 * that will be triggered when @stream is readable.
25564 * Note that since this method never blocks, you cannot actually
25565 * use @cancellable to cancel it. However, it will return an error
25566 * if @cancellable has already been cancelled when you call, which
25567 * may happen if you call this method after a source triggers due
25568 * to having been cancelled.
25570 * Virtual: read_nonblocking
25571 * Returns: the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
25576 * g_pollable_output_stream_can_poll:
25577 * @stream: a #GPollableOutputStream.
25579 * Checks if @stream is actually pollable. Some classes may implement
25580 * #GPollableOutputStream but have only certain instances of that
25581 * class be pollable. If this method returns %FALSE, then the behavior
25582 * of other #GPollableOutputStream methods is undefined.
25584 * For any given stream, the value returned by this method is constant;
25585 * a stream cannot switch from pollable to non-pollable or vice versa.
25587 * Returns: %TRUE if @stream is pollable, %FALSE if not.
25593 * g_pollable_output_stream_create_source:
25594 * @stream: a #GPollableOutputStream.
25595 * @cancellable: (allow-none): a #GCancellable, or %NULL
25597 * Creates a #GSource that triggers when @stream can be written, or
25598 * @cancellable is triggered or an error occurs. The callback on the
25599 * source is of the #GPollableSourceFunc type.
25601 * As with g_pollable_output_stream_is_writable(), it is possible that
25602 * the stream may not actually be writable even after the source
25603 * triggers, so you should use g_pollable_output_stream_write_nonblocking()
25604 * rather than g_output_stream_write() from the callback.
25606 * Returns: (transfer full): a new #GSource
25612 * g_pollable_output_stream_is_writable:
25613 * @stream: a #GPollableOutputStream.
25615 * Checks if @stream can be written.
25617 * Note that some stream types may not be able to implement this 100%
25618 * reliably, and it is possible that a call to g_output_stream_write()
25619 * after this returns %TRUE would still block. To guarantee
25620 * non-blocking behavior, you should always use
25621 * g_pollable_output_stream_write_nonblocking(), which will return a
25622 * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
25624 * Returns: %TRUE if @stream is writable, %FALSE if not. If an error has occurred on @stream, this will result in g_pollable_output_stream_is_writable() returning %TRUE, and the next attempt to write will return the error.
25630 * g_pollable_output_stream_write_nonblocking:
25631 * @stream: a #GPollableOutputStream
25632 * @buffer: (array length=count) (element-type guint8): a buffer to write data from
25633 * @count: the number of bytes you want to write
25634 * @cancellable: (allow-none): a #GCancellable, or %NULL
25635 * @error: #GError for error reporting, or %NULL to ignore.
25637 * Attempts to write up to @count bytes from @buffer to @stream, as
25638 * with g_output_stream_write(). If @stream is not currently writable,
25639 * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
25640 * use g_pollable_output_stream_create_source() to create a #GSource
25641 * that will be triggered when @stream is writable.
25643 * Note that since this method never blocks, you cannot actually
25644 * use @cancellable to cancel it. However, it will return an error
25645 * if @cancellable has already been cancelled when you call, which
25646 * may happen if you call this method after a source triggers due
25647 * to having been cancelled.
25649 * Virtual: write_nonblocking
25650 * Returns: the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
25655 * g_pollable_source_new:
25656 * @pollable_stream: the stream associated with the new source
25658 * Utility method for #GPollableInputStream and #GPollableOutputStream
25659 * implementations. Creates a new #GSource that expects a callback of
25660 * type #GPollableSourceFunc. The new source does not actually do
25661 * anything on its own; use g_source_add_child_source() to add other
25662 * sources to it to cause it to trigger.
25664 * Returns: (transfer full): the new #GSource.
25670 * g_pollable_source_new_full:
25671 * @pollable_stream: (type GObject): the stream associated with the new source
25672 * @child_source: (allow-none): optional child source to attach
25673 * @cancellable: (allow-none): optional #GCancellable to attach
25675 * Utility method for #GPollableInputStream and #GPollableOutputStream
25676 * implementations. Creates a new #GSource, as with
25677 * g_pollable_source_new(), but also attaching @child_source (with a
25678 * dummy callback), and @cancellable, if they are non-%NULL.
25680 * Returns: (transfer full): the new #GSource.
25686 * g_pollable_stream_read:
25687 * @stream: a #GInputStream
25688 * @buffer: a buffer to read data into
25689 * @count: the number of bytes to read
25690 * @blocking: whether to do blocking I/O
25691 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25692 * @error: location to store the error occurring, or %NULL to ignore
25694 * Tries to read from @stream, as with g_input_stream_read() (if
25695 * @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
25696 * (if @blocking is %FALSE). This can be used to more easily share
25697 * code between blocking and non-blocking implementations of a method.
25699 * If @blocking is %FALSE, then @stream must be a
25700 * #GPollableInputStream for which g_pollable_input_stream_can_poll()
25701 * returns %TRUE, or else the behavior is undefined. If @blocking is
25702 * %TRUE, then @stream does not need to be a #GPollableInputStream.
25704 * Returns: the number of bytes read, or -1 on error.
25710 * g_pollable_stream_write:
25711 * @stream: a #GOutputStream.
25712 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25713 * @count: the number of bytes to write
25714 * @blocking: whether to do blocking I/O
25715 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25716 * @error: location to store the error occurring, or %NULL to ignore
25718 * Tries to write to @stream, as with g_output_stream_write() (if
25719 * @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
25720 * (if @blocking is %FALSE). This can be used to more easily share
25721 * code between blocking and non-blocking implementations of a method.
25723 * If @blocking is %FALSE, then @stream must be a
25724 * #GPollableOutputStream for which
25725 * g_pollable_output_stream_can_poll() returns %TRUE or else the
25726 * behavior is undefined. If @blocking is %TRUE, then @stream does not
25727 * need to be a #GPollableOutputStream.
25729 * Returns: the number of bytes written, or -1 on error.
25735 * g_pollable_stream_write_all:
25736 * @stream: a #GOutputStream.
25737 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25738 * @count: the number of bytes to write
25739 * @blocking: whether to do blocking I/O
25740 * @bytes_written: (out): location to store the number of bytes that was written to the stream
25741 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25742 * @error: location to store the error occurring, or %NULL to ignore
25744 * Tries to write @count bytes to @stream, as with
25745 * g_output_stream_write_all(), but using g_pollable_stream_write()
25746 * rather than g_output_stream_write().
25748 * On a successful write of @count bytes, %TRUE is returned, and
25749 * @bytes_written is set to @count.
25751 * If there is an error during the operation (including
25752 * %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is
25753 * returned and @error is set to indicate the error status,
25754 * @bytes_written is updated to contain the number of bytes written
25755 * into the stream before the error occurred.
25757 * As with g_pollable_stream_write(), if @blocking is %FALSE, then
25758 * @stream must be a #GPollableOutputStream for which
25759 * g_pollable_output_stream_can_poll() returns %TRUE or else the
25760 * behavior is undefined. If @blocking is %TRUE, then @stream does not
25761 * need to be a #GPollableOutputStream.
25763 * Returns: %TRUE on success, %FALSE if there was an error
25769 * g_proxy_address_get_destination_hostname:
25770 * @proxy: a #GProxyAddress
25772 * Gets @proxy's destination hostname; that is, the name of the host
25773 * that will be connected to via the proxy, not the name of the proxy
25776 * Returns: the @proxy's destination hostname
25782 * g_proxy_address_get_destination_port:
25783 * @proxy: a #GProxyAddress
25785 * Gets @proxy's destination port; that is, the port on the
25786 * destination host that will be connected to via the proxy, not the
25787 * port number of the proxy itself.
25789 * Returns: the @proxy's destination port
25795 * g_proxy_address_get_destination_protocol:
25796 * @proxy: a #GProxyAddress
25798 * Gets the protocol that is being spoken to the destination
25799 * server; eg, "http" or "ftp".
25801 * Returns: the @proxy's destination protocol
25807 * g_proxy_address_get_password:
25808 * @proxy: a #GProxyAddress
25810 * Gets @proxy's password.
25812 * Returns: the @proxy's password
25818 * g_proxy_address_get_protocol:
25819 * @proxy: a #GProxyAddress
25821 * Gets @proxy's protocol. eg, "socks" or "http"
25823 * Returns: the @proxy's protocol
25829 * g_proxy_address_get_uri:
25830 * @proxy: a #GProxyAddress
25832 * Gets the proxy URI that @proxy was constructed from.
25834 * Returns: the @proxy's URI, or %NULL if unknown
25840 * g_proxy_address_get_username:
25841 * @proxy: a #GProxyAddress
25843 * Gets @proxy's username.
25845 * Returns: the @proxy's username
25851 * g_proxy_address_new:
25852 * @inetaddr: The proxy server #GInetAddress.
25853 * @port: The proxy server port.
25854 * @protocol: The proxy protocol to support, in lower case (e.g. socks, http).
25855 * @dest_hostname: The destination hostname the proxy should tunnel to.
25856 * @dest_port: The destination port to tunnel to.
25857 * @username: (allow-none): The username to authenticate to the proxy server (or %NULL).
25858 * @password: (allow-none): The password to authenticate to the proxy server (or %NULL).
25860 * Creates a new #GProxyAddress for @inetaddr with @protocol that should
25861 * tunnel through @dest_hostname and @dest_port.
25863 * (Note that this method doesn't set the #GProxyAddress:uri or
25864 * #GProxyAddress:destination-protocol fields; use g_object_new()
25865 * directly if you want to set those.)
25867 * Returns: a new #GProxyAddress
25874 * @proxy: a #GProxy
25875 * @connection: a #GIOStream
25876 * @proxy_address: a #GProxyAddress
25877 * @cancellable: (allow-none): a #GCancellable
25878 * @error: return #GError
25880 * Given @connection to communicate with a proxy (eg, a
25881 * #GSocketConnection that is connected to the proxy server), this
25882 * does the necessary handshake to connect to @proxy_address, and if
25883 * required, wraps the #GIOStream to handle proxy payload.
25885 * Returns: (transfer full): a #GIOStream that will replace @connection. This might be the same as @connection, in which case a reference will be added.
25891 * g_proxy_connect_async:
25892 * @proxy: a #GProxy
25893 * @connection: a #GIOStream
25894 * @proxy_address: a #GProxyAddress
25895 * @cancellable: (allow-none): a #GCancellable
25896 * @callback: (scope async): a #GAsyncReadyCallback
25897 * @user_data: (closure): callback data
25899 * Asynchronous version of g_proxy_connect().
25906 * g_proxy_connect_finish:
25907 * @proxy: a #GProxy
25908 * @result: a #GAsyncResult
25909 * @error: return #GError
25911 * See g_proxy_connect().
25913 * Returns: (transfer full): a #GIOStream.
25919 * g_proxy_get_default_for_protocol:
25920 * @protocol: the proxy protocol name (e.g. http, socks, etc)
25922 * Lookup "gio-proxy" extension point for a proxy implementation that supports
25923 * specified protocol.
25925 * Returns: (transfer full): return a #GProxy or NULL if protocol is not supported.
25931 * g_proxy_resolver_get_default:
25933 * Gets the default #GProxyResolver for the system.
25935 * Returns: (transfer none): the default #GProxyResolver.
25941 * g_proxy_resolver_is_supported:
25942 * @resolver: a #GProxyResolver
25944 * Checks if @resolver can be used on this system. (This is used
25945 * internally; g_proxy_resolver_get_default() will only return a proxy
25946 * resolver that returns %TRUE for this method.)
25948 * Returns: %TRUE if @resolver is supported.
25954 * g_proxy_resolver_lookup:
25955 * @resolver: a #GProxyResolver
25956 * @uri: a URI representing the destination to connect to
25957 * @cancellable: (allow-none): a #GCancellable, or %NULL
25958 * @error: return location for a #GError, or %NULL
25960 * Looks into the system proxy configuration to determine what proxy,
25961 * if any, to use to connect to @uri. The returned proxy URIs are of the
25962 * form <literal><protocol>://[user[:password]@]host:port</literal>
25963 * or <literal>direct://</literal>, where <protocol> could be
25964 * http, rtsp, socks or other proxying protocol.
25966 * If you don't know what network protocol is being used on the
25967 * socket, you should use <literal>none</literal> as the URI protocol.
25968 * In this case, the resolver might still return a generic proxy type
25969 * (such as SOCKS), but would not return protocol-specific proxy types
25972 * <literal>direct://</literal> is used when no proxy is needed.
25973 * Direct connection should not be attempted unless it is part of the
25974 * returned array of proxies.
25976 * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25982 * g_proxy_resolver_lookup_async:
25983 * @resolver: a #GProxyResolver
25984 * @uri: a URI representing the destination to connect to
25985 * @cancellable: (allow-none): a #GCancellable, or %NULL
25986 * @callback: (scope async): callback to call after resolution completes
25987 * @user_data: (closure): data for @callback
25989 * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
25997 * g_proxy_resolver_lookup_finish:
25998 * @resolver: a #GProxyResolver
25999 * @result: the result passed to your #GAsyncReadyCallback
26000 * @error: return location for a #GError, or %NULL
26002 * Call this function to obtain the array of proxy URIs when
26003 * g_proxy_resolver_lookup_async() is complete. See
26004 * g_proxy_resolver_lookup() for more details.
26006 * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
26012 * g_proxy_supports_hostname:
26013 * @proxy: a #GProxy
26015 * Some proxy protocols expect to be passed a hostname, which they
26016 * will resolve to an IP address themselves. Others, like SOCKS4, do
26017 * not allow this. This function will return %FALSE if @proxy is
26018 * implementing such a protocol. When %FALSE is returned, the caller
26019 * should resolve the destination hostname first, and then pass a
26020 * #GProxyAddress containing the stringified IP address to
26021 * g_proxy_connect() or g_proxy_connect_async().
26023 * Returns: %TRUE if hostname resolution is supported.
26029 * g_remote_action_group_activate_action_full:
26030 * @remote: a #GDBusActionGroup
26031 * @action_name: the name of the action to activate
26032 * @parameter: (allow-none): the optional parameter to the activation
26033 * @platform_data: the platform data to send
26035 * Activates the remote action.
26037 * This is the same as g_action_group_activate_action() except that it
26038 * allows for provision of "platform data" to be sent along with the
26039 * activation request. This typically contains details such as the user
26040 * interaction timestamp or startup notification information.
26042 * @platform_data must be non-%NULL and must have the type
26043 * %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
26050 * g_remote_action_group_change_action_state_full:
26051 * @remote: a #GRemoteActionGroup
26052 * @action_name: the name of the action to change the state of
26053 * @value: the new requested value for the state
26054 * @platform_data: the platform data to send
26056 * Changes the state of a remote action.
26058 * This is the same as g_action_group_change_action_state() except that
26059 * it allows for provision of "platform data" to be sent along with the
26060 * state change request. This typically contains details such as the
26061 * user interaction timestamp or startup notification information.
26063 * @platform_data must be non-%NULL and must have the type
26064 * %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
26071 * g_resolver_error_quark:
26073 * Gets the #GResolver Error Quark.
26075 * Returns: a #GQuark.
26081 * g_resolver_free_addresses: (skip)
26082 * @addresses: a #GList of #GInetAddress
26084 * Frees @addresses (which should be the return value from
26085 * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
26086 * (This is a convenience method; you can also simply free the results
26094 * g_resolver_free_targets: (skip)
26095 * @targets: a #GList of #GSrvTarget
26097 * Frees @targets (which should be the return value from
26098 * g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
26099 * (This is a convenience method; you can also simply free the
26100 * results by hand.)
26107 * g_resolver_get_default:
26109 * Gets the default #GResolver. You should unref it when you are done
26110 * with it. #GResolver may use its reference count as a hint about how
26111 * many threads it should allocate for concurrent DNS resolutions.
26113 * Returns: (transfer full): the default #GResolver.
26119 * g_resolver_lookup_by_address:
26120 * @resolver: a #GResolver
26121 * @address: the address to reverse-resolve
26122 * @cancellable: (allow-none): a #GCancellable, or %NULL
26123 * @error: return location for a #GError, or %NULL
26125 * Synchronously reverse-resolves @address to determine its
26126 * associated hostname.
26128 * If the DNS resolution fails, @error (if non-%NULL) will be set to
26129 * a value from #GResolverError.
26131 * If @cancellable is non-%NULL, it can be used to cancel the
26132 * operation, in which case @error (if non-%NULL) will be set to
26133 * %G_IO_ERROR_CANCELLED.
26135 * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
26141 * g_resolver_lookup_by_address_async:
26142 * @resolver: a #GResolver
26143 * @address: the address to reverse-resolve
26144 * @cancellable: (allow-none): a #GCancellable, or %NULL
26145 * @callback: (scope async): callback to call after resolution completes
26146 * @user_data: (closure): data for @callback
26148 * Begins asynchronously reverse-resolving @address to determine its
26149 * associated hostname, and eventually calls @callback, which must
26150 * call g_resolver_lookup_by_address_finish() to get the final result.
26157 * g_resolver_lookup_by_address_finish:
26158 * @resolver: a #GResolver
26159 * @result: the result passed to your #GAsyncReadyCallback
26160 * @error: return location for a #GError, or %NULL
26162 * Retrieves the result of a previous call to
26163 * g_resolver_lookup_by_address_async().
26165 * If the DNS resolution failed, @error (if non-%NULL) will be set to
26166 * a value from #GResolverError. If the operation was cancelled,
26167 * @error will be set to %G_IO_ERROR_CANCELLED.
26169 * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
26175 * g_resolver_lookup_by_name:
26176 * @resolver: a #GResolver
26177 * @hostname: the hostname to look up
26178 * @cancellable: (allow-none): a #GCancellable, or %NULL
26179 * @error: return location for a #GError, or %NULL
26181 * Synchronously resolves @hostname to determine its associated IP
26182 * address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
26183 * the textual form of an IP address (in which case this just becomes
26184 * a wrapper around g_inet_address_new_from_string()).
26186 * On success, g_resolver_lookup_by_name() will return a #GList of
26187 * #GInetAddress, sorted in order of preference and guaranteed to not
26188 * contain duplicates. That is, if using the result to connect to
26189 * @hostname, you should attempt to connect to the first address
26190 * first, then the second if the first fails, etc. If you are using
26191 * the result to listen on a socket, it is appropriate to add each
26192 * result using e.g. g_socket_listener_add_address().
26194 * If the DNS resolution fails, @error (if non-%NULL) will be set to a
26195 * value from #GResolverError.
26197 * If @cancellable is non-%NULL, it can be used to cancel the
26198 * operation, in which case @error (if non-%NULL) will be set to
26199 * %G_IO_ERROR_CANCELLED.
26201 * If you are planning to connect to a socket on the resolved IP
26202 * address, it may be easier to create a #GNetworkAddress and use its
26203 * #GSocketConnectable interface.
26205 * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. You must unref each of the addresses and free the list when you are done with it. (You can use g_resolver_free_addresses() to do this.)
26211 * g_resolver_lookup_by_name_async:
26212 * @resolver: a #GResolver
26213 * @hostname: the hostname to look up the address of
26214 * @cancellable: (allow-none): a #GCancellable, or %NULL
26215 * @callback: (scope async): callback to call after resolution completes
26216 * @user_data: (closure): data for @callback
26218 * Begins asynchronously resolving @hostname to determine its
26219 * associated IP address(es), and eventually calls @callback, which
26220 * must call g_resolver_lookup_by_name_finish() to get the result.
26221 * See g_resolver_lookup_by_name() for more details.
26228 * g_resolver_lookup_by_name_finish:
26229 * @resolver: a #GResolver
26230 * @result: the result passed to your #GAsyncReadyCallback
26231 * @error: return location for a #GError, or %NULL
26233 * Retrieves the result of a call to
26234 * g_resolver_lookup_by_name_async().
26236 * If the DNS resolution failed, @error (if non-%NULL) will be set to
26237 * a value from #GResolverError. If the operation was cancelled,
26238 * @error will be set to %G_IO_ERROR_CANCELLED.
26240 * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name() for more details.
26246 * g_resolver_lookup_records:
26247 * @resolver: a #GResolver
26248 * @rrname: the DNS name to lookup the record for
26249 * @record_type: the type of DNS record to lookup
26250 * @cancellable: (allow-none): a #GCancellable, or %NULL
26251 * @error: return location for a #GError, or %NULL
26253 * Synchronously performs a DNS record lookup for the given @rrname and returns
26254 * a list of records as #GVariant tuples. See #GResolverRecordType for
26255 * information on what the records contain for each @record_type.
26257 * If the DNS resolution fails, @error (if non-%NULL) will be set to
26258 * a value from #GResolverError.
26260 * If @cancellable is non-%NULL, it can be used to cancel the
26261 * operation, in which case @error (if non-%NULL) will be set to
26262 * %G_IO_ERROR_CANCELLED.
26264 * Returns: (element-type GVariant) (transfer full): a #GList of #GVariant, or %NULL on error. You must free each of the records and the list when you are done with it. (You can use g_list_free_full() with g_variant_unref() to do this.)
26270 * g_resolver_lookup_records_async:
26271 * @resolver: a #GResolver
26272 * @rrname: the DNS name to lookup the record for
26273 * @record_type: the type of DNS record to lookup
26274 * @cancellable: (allow-none): a #GCancellable, or %NULL
26275 * @callback: (scope async): callback to call after resolution completes
26276 * @user_data: (closure): data for @callback
26278 * Begins asynchronously performing a DNS lookup for the given
26279 * @rrname, and eventually calls @callback, which must call
26280 * g_resolver_lookup_records_finish() to get the final result. See
26281 * g_resolver_lookup_records() for more details.
26288 * g_resolver_lookup_records_finish:
26289 * @resolver: a #GResolver
26290 * @result: the result passed to your #GAsyncReadyCallback
26291 * @error: return location for a #GError, or %NULL
26293 * Retrieves the result of a previous call to
26294 * g_resolver_lookup_records_async(). Returns a list of records as #GVariant
26295 * tuples. See #GResolverRecordType for information on what the records contain.
26297 * If the DNS resolution failed, @error (if non-%NULL) will be set to
26298 * a value from #GResolverError. If the operation was cancelled,
26299 * @error will be set to %G_IO_ERROR_CANCELLED.
26301 * Returns: (element-type GVariant) (transfer full): a #GList of #GVariant, or %NULL on error. You must free each of the records and the list when you are done with it. (You can use g_list_free_full() with g_variant_unref() to do this.)
26307 * g_resolver_lookup_service:
26308 * @resolver: a #GResolver
26309 * @service: the service type to look up (eg, "ldap")
26310 * @protocol: the networking protocol to use for @service (eg, "tcp")
26311 * @domain: the DNS domain to look up the service in
26312 * @cancellable: (allow-none): a #GCancellable, or %NULL
26313 * @error: return location for a #GError, or %NULL
26315 * Synchronously performs a DNS SRV lookup for the given @service and
26316 * @protocol in the given @domain and returns an array of #GSrvTarget.
26317 * @domain may be an ASCII-only or UTF-8 hostname. Note also that the
26318 * @service and @protocol arguments <emphasis>do not</emphasis>
26319 * include the leading underscore that appears in the actual DNS
26322 * On success, g_resolver_lookup_service() will return a #GList of
26323 * #GSrvTarget, sorted in order of preference. (That is, you should
26324 * attempt to connect to the first target first, then the second if
26325 * the first fails, etc.)
26327 * If the DNS resolution fails, @error (if non-%NULL) will be set to
26328 * a value from #GResolverError.
26330 * If @cancellable is non-%NULL, it can be used to cancel the
26331 * operation, in which case @error (if non-%NULL) will be set to
26332 * %G_IO_ERROR_CANCELLED.
26334 * If you are planning to connect to the service, it is usually easier
26335 * to create a #GNetworkService and use its #GSocketConnectable
26338 * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. You must free each of the targets and the list when you are done with it. (You can use g_resolver_free_targets() to do this.)
26344 * g_resolver_lookup_service_async:
26345 * @resolver: a #GResolver
26346 * @service: the service type to look up (eg, "ldap")
26347 * @protocol: the networking protocol to use for @service (eg, "tcp")
26348 * @domain: the DNS domain to look up the service in
26349 * @cancellable: (allow-none): a #GCancellable, or %NULL
26350 * @callback: (scope async): callback to call after resolution completes
26351 * @user_data: (closure): data for @callback
26353 * Begins asynchronously performing a DNS SRV lookup for the given
26354 * @service and @protocol in the given @domain, and eventually calls
26355 * @callback, which must call g_resolver_lookup_service_finish() to
26356 * get the final result. See g_resolver_lookup_service() for more
26364 * g_resolver_lookup_service_finish:
26365 * @resolver: a #GResolver
26366 * @result: the result passed to your #GAsyncReadyCallback
26367 * @error: return location for a #GError, or %NULL
26369 * Retrieves the result of a previous call to
26370 * g_resolver_lookup_service_async().
26372 * If the DNS resolution failed, @error (if non-%NULL) will be set to
26373 * a value from #GResolverError. If the operation was cancelled,
26374 * @error will be set to %G_IO_ERROR_CANCELLED.
26376 * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. See g_resolver_lookup_service() for more details.
26382 * g_resolver_set_default:
26383 * @resolver: the new default #GResolver
26385 * Sets @resolver to be the application's default resolver (reffing
26386 * @resolver, and unreffing the previous default resolver, if any).
26387 * Future calls to g_resolver_get_default() will return this resolver.
26389 * This can be used if an application wants to perform any sort of DNS
26390 * caching or "pinning"; it can implement its own #GResolver that
26391 * calls the original default resolver for DNS operations, and
26392 * implements its own cache policies on top of that, and then set
26393 * itself as the default resolver for all later code to use.
26400 * g_resource_enumerate_children:
26401 * @resource: A #GResource
26402 * @path: A pathname inside the resource
26403 * @lookup_flags: A #GResourceLookupFlags
26404 * @error: return location for a #GError, or %NULL
26406 * Returns all the names of children at the specified @path in the resource.
26407 * The return result is a %NULL terminated list of strings which should
26408 * be released with g_strfreev().
26410 * @lookup_flags controls the behaviour of the lookup.
26412 * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
26418 * g_resource_error_quark:
26420 * Gets the #GResource Error Quark.
26422 * Returns: a #GQuark
26428 * g_resource_get_info:
26429 * @resource: A #GResource
26430 * @path: A pathname inside the resource
26431 * @lookup_flags: A #GResourceLookupFlags
26432 * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
26433 * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
26434 * @error: return location for a #GError, or %NULL
26436 * Looks for a file at the specified @path in the resource and
26437 * if found returns information about it.
26439 * @lookup_flags controls the behaviour of the lookup.
26441 * Returns: %TRUE if the file was found. %FALSE if there were errors
26448 * @filename: (type filename): the path of a filename to load, in the GLib filename encoding
26449 * @error: return location for a #GError, or %NULL
26451 * Loads a binary resource bundle and creates a #GResource representation of it, allowing
26452 * you to query it for data.
26454 * If you want to use this resource in the global resource namespace you need
26455 * to register it with g_resources_register().
26457 * Returns: (transfer full): a new #GResource, or %NULL on error
26463 * g_resource_lookup_data:
26464 * @resource: A #GResource
26465 * @path: A pathname inside the resource
26466 * @lookup_flags: A #GResourceLookupFlags
26467 * @error: return location for a #GError, or %NULL
26469 * Looks for a file at the specified @path in the resource and
26470 * returns a #GBytes that lets you directly access the data in
26473 * The data is always followed by a zero byte, so you
26474 * can safely use the data as a C string. However, that byte
26475 * is not included in the size of the GBytes.
26477 * For uncompressed resource files this is a pointer directly into
26478 * the resource bundle, which is typically in some readonly data section
26479 * in the program binary. For compressed files we allocate memory on
26480 * the heap and automatically uncompress the data.
26482 * @lookup_flags controls the behaviour of the lookup.
26484 * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
26490 * g_resource_new_from_data:
26492 * @error: return location for a #GError, or %NULL
26494 * Creates a GResource from a reference to the binary resource bundle.
26495 * This will keep a reference to @data while the resource lives, so
26496 * the data should not be modified or freed.
26498 * If you want to use this resource in the global resource namespace you need
26499 * to register it with g_resources_register().
26501 * Returns: (transfer full): a new #GResource, or %NULL on error
26507 * g_resource_open_stream:
26508 * @resource: A #GResource
26509 * @path: A pathname inside the resource
26510 * @lookup_flags: A #GResourceLookupFlags
26511 * @error: return location for a #GError, or %NULL
26513 * Looks for a file at the specified @path in the resource and
26514 * returns a #GInputStream that lets you read the data.
26516 * @lookup_flags controls the behaviour of the lookup.
26518 * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
26525 * @resource: A #GResource
26527 * Atomically increments the reference count of @array by one. This
26528 * function is MT-safe and may be called from any thread.
26530 * Returns: The passed in #GResource
26536 * g_resource_unref:
26537 * @resource: A #GResource
26539 * Atomically decrements the reference count of @resource by one. If the
26540 * reference count drops to 0, all memory allocated by the array is
26541 * released. This function is MT-safe and may be called from any
26549 * g_resources_enumerate_children:
26550 * @path: A pathname inside the resource
26551 * @lookup_flags: A #GResourceLookupFlags
26552 * @error: return location for a #GError, or %NULL
26554 * Returns all the names of children at the specified @path in the set of
26555 * globally registered resources.
26556 * The return result is a %NULL terminated list of strings which should
26557 * be released with g_strfreev().
26559 * @lookup_flags controls the behaviour of the lookup.
26561 * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
26567 * g_resources_get_info:
26568 * @path: A pathname inside the resource
26569 * @lookup_flags: A #GResourceLookupFlags
26570 * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
26571 * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
26572 * @error: return location for a #GError, or %NULL
26574 * Looks for a file at the specified @path in the set of
26575 * globally registered resources and if found returns information about it.
26577 * @lookup_flags controls the behaviour of the lookup.
26579 * Returns: %TRUE if the file was found. %FALSE if there were errors
26585 * g_resources_lookup_data:
26586 * @path: A pathname inside the resource
26587 * @lookup_flags: A #GResourceLookupFlags
26588 * @error: return location for a #GError, or %NULL
26590 * Looks for a file at the specified @path in the set of
26591 * globally registered resources and returns a #GBytes that
26592 * lets you directly access the data in memory.
26594 * The data is always followed by a zero byte, so you
26595 * can safely use the data as a C string. However, that byte
26596 * is not included in the size of the GBytes.
26598 * For uncompressed resource files this is a pointer directly into
26599 * the resource bundle, which is typically in some readonly data section
26600 * in the program binary. For compressed files we allocate memory on
26601 * the heap and automatically uncompress the data.
26603 * @lookup_flags controls the behaviour of the lookup.
26605 * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
26611 * g_resources_open_stream:
26612 * @path: A pathname inside the resource
26613 * @lookup_flags: A #GResourceLookupFlags
26614 * @error: return location for a #GError, or %NULL
26616 * Looks for a file at the specified @path in the set of
26617 * globally registered resources and returns a #GInputStream
26618 * that lets you read the data.
26620 * @lookup_flags controls the behaviour of the lookup.
26622 * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
26628 * g_resources_register:
26629 * @resource: A #GResource
26631 * Registers the resource with the process-global set of resources.
26632 * Once a resource is registered the files in it can be accessed
26633 * with the global resource lookup functions like g_resources_lookup_data().
26640 * g_resources_unregister:
26641 * @resource: A #GResource
26643 * Unregisters the resource from the process-global set of resources.
26650 * g_seekable_can_seek:
26651 * @seekable: a #GSeekable.
26653 * Tests if the stream supports the #GSeekableIface.
26655 * Returns: %TRUE if @seekable can be seeked. %FALSE otherwise.
26660 * g_seekable_can_truncate:
26661 * @seekable: a #GSeekable.
26663 * Tests if the stream can be truncated.
26665 * Returns: %TRUE if the stream can be truncated, %FALSE otherwise.
26671 * @seekable: a #GSeekable.
26672 * @offset: a #goffset.
26673 * @type: a #GSeekType.
26674 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26675 * @error: a #GError location to store the error occurring, or %NULL to ignore.
26677 * Seeks in the stream by the given @offset, modified by @type.
26679 * If @cancellable is not %NULL, then the operation can be cancelled by
26680 * triggering the cancellable object from another thread. If the operation
26681 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
26683 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26689 * @seekable: a #GSeekable.
26691 * Tells the current position within the stream.
26693 * Returns: the offset from the beginning of the buffer.
26698 * g_seekable_truncate:
26699 * @seekable: a #GSeekable.
26700 * @offset: a #goffset.
26701 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26702 * @error: a #GError location to store the error occurring, or %NULL to ignore.
26704 * Truncates a stream with a given #offset.
26706 * If @cancellable is not %NULL, then the operation can be cancelled by
26707 * triggering the cancellable object from another thread. If the operation
26708 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
26709 * operation was partially finished when the operation was cancelled the
26710 * partial result will be returned, without an error.
26712 * Virtual: truncate_fn
26713 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26718 * g_settings_apply:
26719 * @settings: a #GSettings instance
26721 * Applies any changes that have been made to the settings. This
26722 * function does nothing unless @settings is in 'delay-apply' mode;
26723 * see g_settings_delay(). In the normal case settings are always
26724 * applied immediately.
26729 * g_settings_backend_changed:
26730 * @backend: a #GSettingsBackend implementation
26731 * @key: the name of the key
26732 * @origin_tag: the origin tag
26734 * Signals that a single key has possibly changed. Backend
26735 * implementations should call this if a key has possibly changed its
26738 * @key must be a valid key (ie starting with a slash, not containing
26739 * '//', and not ending with a slash).
26741 * The implementation must call this function during any call to
26742 * g_settings_backend_write(), before the call returns (except in the
26743 * case that no keys are actually changed and it cares to detect this
26744 * fact). It may not rely on the existence of a mainloop for
26745 * dispatching the signal later.
26747 * The implementation may call this function at any other time it likes
26748 * in response to other events (such as changes occurring outside of the
26749 * program). These calls may originate from a mainloop or may originate
26750 * in response to any other action (including from calls to
26751 * g_settings_backend_write()).
26753 * In the case that this call is in response to a call to
26754 * g_settings_backend_write() then @origin_tag must be set to the same
26755 * value that was passed to that call.
26762 * g_settings_backend_changed_tree:
26763 * @backend: a #GSettingsBackend implementation
26764 * @tree: a #GTree containing the changes
26765 * @origin_tag: the origin tag
26767 * This call is a convenience wrapper. It gets the list of changes from
26768 * @tree, computes the longest common prefix and calls
26769 * g_settings_backend_changed().
26776 * g_settings_backend_flatten_tree:
26777 * @tree: a #GTree containing the changes
26778 * @path: (out): the location to save the path
26779 * @keys: (out) (transfer container) (array zero-terminated=1): the location to save the relative keys
26780 * @values: (out) (allow-none) (transfer container) (array zero-terminated=1): the location to save the values, or %NULL
26782 * Calculate the longest common prefix of all keys in a tree and write
26783 * out an array of the key names relative to that prefix and,
26784 * optionally, the value to store at each of those keys.
26786 * You must free the value returned in @path, @keys and @values using
26787 * g_free(). You should not attempt to free or unref the contents of
26788 * @keys or @values.
26795 * g_settings_backend_get_default:
26797 * Returns the default #GSettingsBackend. It is possible to override
26798 * the default by setting the <envar>GSETTINGS_BACKEND</envar>
26799 * environment variable to the name of a settings backend.
26801 * The user gets a reference to the backend.
26803 * Returns: (transfer full): the default #GSettingsBackend
26809 * g_settings_backend_keys_changed:
26810 * @backend: a #GSettingsBackend implementation
26811 * @path: the path containing the changes
26812 * @items: (array zero-terminated=1): the %NULL-terminated list of changed keys
26813 * @origin_tag: the origin tag
26815 * Signals that a list of keys have possibly changed. Backend
26816 * implementations should call this if keys have possibly changed their
26819 * @path must be a valid path (ie starting and ending with a slash and
26820 * not containing '//'). Each string in @items must form a valid key
26821 * name when @path is prefixed to it (ie: each item must not start or
26822 * end with '/' and must not contain '//').
26824 * The meaning of this signal is that any of the key names resulting
26825 * from the contatenation of @path with each item in @items may have
26828 * The same rules for when notifications must occur apply as per
26829 * g_settings_backend_changed(). These two calls can be used
26830 * interchangeably if exactly one item has changed (although in that
26831 * case g_settings_backend_changed() is definitely preferred).
26833 * For efficiency reasons, the implementation should strive for @path to
26834 * be as long as possible (ie: the longest common prefix of all of the
26835 * keys that were changed) but this is not strictly required.
26842 * g_settings_backend_path_changed:
26843 * @backend: a #GSettingsBackend implementation
26844 * @path: the path containing the changes
26845 * @origin_tag: the origin tag
26847 * Signals that all keys below a given path may have possibly changed.
26848 * Backend implementations should call this if an entire path of keys
26849 * have possibly changed their values.
26851 * @path must be a valid path (ie starting and ending with a slash and
26852 * not containing '//').
26854 * The meaning of this signal is that any of the key which has a name
26855 * starting with @path may have changed.
26857 * The same rules for when notifications must occur apply as per
26858 * g_settings_backend_changed(). This call might be an appropriate
26859 * reasponse to a 'reset' call but implementations are also free to
26860 * explicitly list the keys that were affected by that call if they can
26863 * For efficiency reasons, the implementation should strive for @path to
26864 * be as long as possible (ie: the longest common prefix of all of the
26865 * keys that were changed) but this is not strictly required. As an
26866 * example, if this function is called with the path of "/" then every
26867 * single key in the application will be notified of a possible change.
26874 * g_settings_backend_path_writable_changed:
26875 * @backend: a #GSettingsBackend implementation
26876 * @path: the name of the path
26878 * Signals that the writability of all keys below a given path may have
26881 * Since GSettings performs no locking operations for itself, this call
26882 * will always be made in response to external events.
26889 * g_settings_backend_writable_changed:
26890 * @backend: a #GSettingsBackend implementation
26891 * @key: the name of the key
26893 * Signals that the writability of a single key has possibly changed.
26895 * Since GSettings performs no locking operations for itself, this call
26896 * will always be made in response to external events.
26904 * @settings: a #GSettings object
26905 * @key: the key to bind
26906 * @object: (type GObject.Object): a #GObject
26907 * @property: the name of the property to bind
26908 * @flags: flags for the binding
26910 * Create a binding between the @key in the @settings object
26911 * and the property @property of @object.
26913 * The binding uses the default GIO mapping functions to map
26914 * between the settings and property values. These functions
26915 * handle booleans, numeric types and string types in a
26916 * straightforward way. Use g_settings_bind_with_mapping() if
26917 * you need a custom mapping, or map between types that are not
26918 * supported by the default mapping functions.
26920 * Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
26921 * function also establishes a binding between the writability of
26922 * @key and the "sensitive" property of @object (if @object has
26923 * a boolean property by that name). See g_settings_bind_writable()
26924 * for more details about writable bindings.
26926 * Note that the lifecycle of the binding is tied to the object,
26927 * and that you can have only one binding per object property.
26928 * If you bind the same property twice on the same object, the second
26929 * binding overrides the first one.
26936 * g_settings_bind_with_mapping: (skip)
26937 * @settings: a #GSettings object
26938 * @key: the key to bind
26939 * @object: (type GObject.Object): a #GObject
26940 * @property: the name of the property to bind
26941 * @flags: flags for the binding
26942 * @get_mapping: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
26943 * @set_mapping: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
26944 * @user_data: data that gets passed to @get_mapping and @set_mapping
26945 * @destroy: #GDestroyNotify function for @user_data
26947 * Create a binding between the @key in the @settings object
26948 * and the property @property of @object.
26950 * The binding uses the provided mapping functions to map between
26951 * settings and property values.
26953 * Note that the lifecycle of the binding is tied to the object,
26954 * and that you can have only one binding per object property.
26955 * If you bind the same property twice on the same object, the second
26956 * binding overrides the first one.
26963 * g_settings_bind_writable:
26964 * @settings: a #GSettings object
26965 * @key: the key to bind
26966 * @object: (type GObject.Object): a #GObject
26967 * @property: the name of a boolean property to bind
26968 * @inverted: whether to 'invert' the value
26970 * Create a binding between the writability of @key in the
26971 * @settings object and the property @property of @object.
26972 * The property must be boolean; "sensitive" or "visible"
26973 * properties of widgets are the most likely candidates.
26975 * Writable bindings are always uni-directional; changes of the
26976 * writability of the setting will be propagated to the object
26977 * property, not the other way.
26979 * When the @inverted argument is %TRUE, the binding inverts the
26980 * value as it passes from the setting to the object, i.e. @property
26981 * will be set to %TRUE if the key is <emphasis>not</emphasis>
26984 * Note that the lifecycle of the binding is tied to the object,
26985 * and that you can have only one binding per object property.
26986 * If you bind the same property twice on the same object, the second
26987 * binding overrides the first one.
26994 * g_settings_create_action:
26995 * @settings: a #GSettings
26996 * @key: the name of a key in @settings
26998 * Creates a #GAction corresponding to a given #GSettings key.
27000 * The action has the same name as the key.
27002 * The value of the key becomes the state of the action and the action
27003 * is enabled when the key is writable. Changing the state of the
27004 * action results in the key being written to. Changes to the value or
27005 * writability of the key cause appropriate change notifications to be
27006 * emitted for the action.
27008 * For boolean-valued keys, action activations take no parameter and
27009 * result in the toggling of the value. For all other types,
27010 * activations take the new value for the key (which must have the
27013 * Returns: (transfer full): a new #GAction
27019 * g_settings_delay:
27020 * @settings: a #GSettings object
27022 * Changes the #GSettings object into 'delay-apply' mode. In this
27023 * mode, changes to @settings are not immediately propagated to the
27024 * backend, but kept locally until g_settings_apply() is called.
27032 * @settings: a #GSettings object
27033 * @key: the key to get the value for
27034 * @format: a #GVariant format string
27035 * @...: arguments as per @format
27037 * Gets the value that is stored at @key in @settings.
27039 * A convenience function that combines g_settings_get_value() with
27042 * It is a programmer error to give a @key that isn't contained in the
27043 * schema for @settings or for the #GVariantType of @format to mismatch
27044 * the type given in the schema.
27051 * g_settings_get_boolean:
27052 * @settings: a #GSettings object
27053 * @key: the key to get the value for
27055 * Gets the value that is stored at @key in @settings.
27057 * A convenience variant of g_settings_get() for booleans.
27059 * It is a programmer error to give a @key that isn't specified as
27060 * having a boolean type in the schema for @settings.
27062 * Returns: a boolean
27068 * g_settings_get_child:
27069 * @settings: a #GSettings object
27070 * @name: the name of the 'child' schema
27072 * Creates a 'child' settings object which has a base path of
27073 * <replaceable>base-path</replaceable>/@name, where
27074 * <replaceable>base-path</replaceable> is the base path of @settings.
27076 * The schema for the child settings object must have been declared
27077 * in the schema of @settings using a <tag class="starttag">child</tag> element.
27079 * Returns: (transfer full): a 'child' settings object
27085 * g_settings_get_double:
27086 * @settings: a #GSettings object
27087 * @key: the key to get the value for
27089 * Gets the value that is stored at @key in @settings.
27091 * A convenience variant of g_settings_get() for doubles.
27093 * It is a programmer error to give a @key that isn't specified as
27094 * having a 'double' type in the schema for @settings.
27096 * Returns: a double
27102 * g_settings_get_enum:
27103 * @settings: a #GSettings object
27104 * @key: the key to get the value for
27106 * Gets the value that is stored in @settings for @key and converts it
27107 * to the enum value that it represents.
27109 * In order to use this function the type of the value must be a string
27110 * and it must be marked in the schema file as an enumerated type.
27112 * It is a programmer error to give a @key that isn't contained in the
27113 * schema for @settings or is not marked as an enumerated type.
27115 * If the value stored in the configuration database is not a valid
27116 * value for the enumerated type then this function will return the
27119 * Returns: the enum value
27125 * g_settings_get_flags:
27126 * @settings: a #GSettings object
27127 * @key: the key to get the value for
27129 * Gets the value that is stored in @settings for @key and converts it
27130 * to the flags value that it represents.
27132 * In order to use this function the type of the value must be an array
27133 * of strings and it must be marked in the schema file as an flags type.
27135 * It is a programmer error to give a @key that isn't contained in the
27136 * schema for @settings or is not marked as a flags type.
27138 * If the value stored in the configuration database is not a valid
27139 * value for the flags type then this function will return the default
27142 * Returns: the flags value
27148 * g_settings_get_has_unapplied:
27149 * @settings: a #GSettings object
27151 * Returns whether the #GSettings object has any unapplied
27152 * changes. This can only be the case if it is in 'delayed-apply' mode.
27154 * Returns: %TRUE if @settings has unapplied changes
27160 * g_settings_get_int:
27161 * @settings: a #GSettings object
27162 * @key: the key to get the value for
27164 * Gets the value that is stored at @key in @settings.
27166 * A convenience variant of g_settings_get() for 32-bit integers.
27168 * It is a programmer error to give a @key that isn't specified as
27169 * having a int32 type in the schema for @settings.
27171 * Returns: an integer
27177 * g_settings_get_mapped:
27178 * @settings: a #GSettings object
27179 * @key: the key to get the value for
27180 * @mapping: (scope call): the function to map the value in the settings database to the value used by the application
27181 * @user_data: user data for @mapping
27183 * Gets the value that is stored at @key in @settings, subject to
27184 * application-level validation/mapping.
27186 * You should use this function when the application needs to perform
27187 * some processing on the value of the key (for example, parsing). The
27188 * @mapping function performs that processing. If the function
27189 * indicates that the processing was unsuccessful (due to a parse error,
27190 * for example) then the mapping is tried again with another value.
27192 * This allows a robust 'fall back to defaults' behaviour to be
27193 * implemented somewhat automatically.
27195 * The first value that is tried is the user's setting for the key. If
27196 * the mapping function fails to map this value, other values may be
27197 * tried in an unspecified order (system or site defaults, translated
27198 * schema default values, untranslated schema default values, etc).
27200 * If the mapping function fails for all possible values, one additional
27201 * attempt is made: the mapping function is called with a %NULL value.
27202 * If the mapping function still indicates failure at this point then
27203 * the application will be aborted.
27205 * The result parameter for the @mapping function is pointed to a
27206 * #gpointer which is initially set to %NULL. The same pointer is given
27207 * to each invocation of @mapping. The final value of that #gpointer is
27208 * what is returned by this function. %NULL is valid; it is returned
27209 * just as any other value would be.
27211 * Returns: (transfer full): the result, which may be %NULL
27216 * g_settings_get_range:
27217 * @settings: a #GSettings
27218 * @key: the key to query the range of
27220 * Queries the range of a key.
27222 * This function will return a #GVariant that fully describes the range
27223 * of values that are valid for @key.
27225 * The type of #GVariant returned is <literal>(sv)</literal>. The
27226 * string describes the type of range restriction in effect. The type
27227 * and meaning of the value contained in the variant depends on the
27230 * If the string is <literal>'type'</literal> then the variant contains
27231 * an empty array. The element type of that empty array is the expected
27232 * type of value and all values of that type are valid.
27234 * If the string is <literal>'enum'</literal> then the variant contains
27235 * an array enumerating the possible values. Each item in the array is
27236 * a possible valid value and no other values are valid.
27238 * If the string is <literal>'flags'</literal> then the variant contains
27239 * an array. Each item in the array is a value that may appear zero or
27240 * one times in an array to be used as the value for this key. For
27241 * example, if the variant contained the array <literal>['x',
27242 * 'y']</literal> then the valid values for the key would be
27243 * <literal>[]</literal>, <literal>['x']</literal>,
27244 * <literal>['y']</literal>, <literal>['x', 'y']</literal> and
27245 * <literal>['y', 'x']</literal>.
27247 * Finally, if the string is <literal>'range'</literal> then the variant
27248 * contains a pair of like-typed values -- the minimum and maximum
27249 * permissible values for this key.
27251 * This information should not be used by normal programs. It is
27252 * considered to be a hint for introspection purposes. Normal programs
27253 * should already know what is permitted by their own schema. The
27254 * format may change in any way in the future -- but particularly, new
27255 * forms may be added to the possibilities described above.
27257 * It is a programmer error to give a @key that isn't contained in the
27258 * schema for @settings.
27260 * You should free the returned value with g_variant_unref() when it is
27261 * no longer needed.
27263 * Returns: a #GVariant describing the range
27269 * g_settings_get_string:
27270 * @settings: a #GSettings object
27271 * @key: the key to get the value for
27273 * Gets the value that is stored at @key in @settings.
27275 * A convenience variant of g_settings_get() for strings.
27277 * It is a programmer error to give a @key that isn't specified as
27278 * having a string type in the schema for @settings.
27280 * Returns: a newly-allocated string
27286 * g_settings_get_strv:
27287 * @settings: a #GSettings object
27288 * @key: the key to get the value for
27290 * A convenience variant of g_settings_get() for string arrays.
27292 * It is a programmer error to give a @key that isn't specified as
27293 * having an array of strings type in the schema for @settings.
27295 * Returns: (array zero-terminated=1) (transfer full): a newly-allocated, %NULL-terminated array of strings, the value that is stored at @key in @settings.
27301 * g_settings_get_uint:
27302 * @settings: a #GSettings object
27303 * @key: the key to get the value for
27305 * Gets the value that is stored at @key in @settings.
27307 * A convenience variant of g_settings_get() for 32-bit unsigned
27310 * It is a programmer error to give a @key that isn't specified as
27311 * having a uint32 type in the schema for @settings.
27313 * Returns: an unsigned integer
27319 * g_settings_get_value:
27320 * @settings: a #GSettings object
27321 * @key: the key to get the value for
27323 * Gets the value that is stored in @settings for @key.
27325 * It is a programmer error to give a @key that isn't contained in the
27326 * schema for @settings.
27328 * Returns: a new #GVariant
27334 * g_settings_is_writable:
27335 * @settings: a #GSettings object
27336 * @name: the name of a key
27338 * Finds out if a key can be written or not
27340 * Returns: %TRUE if the key @name is writable
27346 * g_settings_list_children:
27347 * @settings: a #GSettings object
27349 * Gets the list of children on @settings.
27351 * The list is exactly the list of strings for which it is not an error
27352 * to call g_settings_get_child().
27354 * For GSettings objects that are lists, this value can change at any
27355 * time and you should connect to the "children-changed" signal to watch
27356 * for those changes. Note that there is a race condition here: you may
27357 * request a child after listing it only for it to have been destroyed
27358 * in the meantime. For this reason, g_settings_get_child() may return
27359 * %NULL even for a child that was listed by this function.
27361 * For GSettings objects that are not lists, you should probably not be
27362 * calling this function from "normal" code (since you should already
27363 * know what children are in your schema). This function may still be
27364 * useful there for introspection reasons, however.
27366 * You should free the return value with g_strfreev() when you are done
27369 * Returns: (transfer full) (element-type utf8): a list of the children on @settings
27374 * g_settings_list_keys:
27375 * @settings: a #GSettings object
27377 * Introspects the list of keys on @settings.
27379 * You should probably not be calling this function from "normal" code
27380 * (since you should already know what keys are in your schema). This
27381 * function is intended for introspection reasons.
27383 * You should free the return value with g_strfreev() when you are done
27386 * Returns: (transfer full) (element-type utf8): a list of the keys on @settings
27391 * g_settings_list_relocatable_schemas:
27393 * Gets a list of the relocatable #GSettings schemas installed on the
27394 * system. These are schemas that do not provide their own path. It is
27395 * usual to instantiate these schemas directly, but if you want to you
27396 * can use g_settings_new_with_path() to specify the path.
27398 * The output of this function, taken together with the output of
27399 * g_settings_list_schemas() represents the complete list of all
27400 * installed schemas.
27402 * Returns: (element-type utf8) (transfer none): a list of relocatable #GSettings schemas that are available. The list must not be modified or freed.
27408 * g_settings_list_schemas:
27410 * Gets a list of the #GSettings schemas installed on the system. The
27411 * returned list is exactly the list of schemas for which you may call
27412 * g_settings_new() without adverse effects.
27414 * This function does not list the schemas that do not provide their own
27415 * paths (ie: schemas for which you must use
27416 * g_settings_new_with_path()). See
27417 * g_settings_list_relocatable_schemas() for that.
27419 * Returns: (element-type utf8) (transfer none): a list of #GSettings schemas that are available. The list must not be modified or freed.
27426 * @schema_id: the id of the schema
27428 * Creates a new #GSettings object with the schema specified by
27431 * Signals on the newly created #GSettings object will be dispatched
27432 * via the thread-default #GMainContext in effect at the time of the
27433 * call to g_settings_new(). The new #GSettings will hold a reference
27434 * on the context. See g_main_context_push_thread_default().
27436 * Returns: a new #GSettings object
27442 * g_settings_new_full:
27443 * @schema: a #GSettingsSchema
27444 * @backend: (allow-none): a #GSettingsBackend
27445 * @path: (allow-none): the path to use
27447 * Creates a new #GSettings object with a given schema, backend and
27450 * It should be extremely rare that you ever want to use this function.
27451 * It is made available for advanced use-cases (such as plugin systems
27452 * that want to provide access to schemas loaded from custom locations,
27455 * At the most basic level, a #GSettings object is a pure composition of
27456 * 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
27457 * backend, and a #GMainContext to which signals are dispatched.
27459 * This constructor therefore gives you full control over constructing
27460 * #GSettings instances. The first 4 parameters are given directly as
27461 * @schema, @backend and @path, and the main context is taken from the
27462 * thread-default (as per g_settings_new()).
27464 * If @backend is %NULL then the default backend is used.
27466 * If @path is %NULL then the path from the schema is used. It is an
27467 * error f @path is %NULL and the schema has no path of its own or if
27468 * @path is non-%NULL and not equal to the path that the schema does
27471 * Returns: a new #GSettings object
27477 * g_settings_new_with_backend:
27478 * @schema_id: the id of the schema
27479 * @backend: the #GSettingsBackend to use
27481 * Creates a new #GSettings object with the schema specified by
27482 * @schema_id and a given #GSettingsBackend.
27484 * Creating a #GSettings object with a different backend allows accessing
27485 * settings from a database other than the usual one. For example, it may make
27486 * sense to pass a backend corresponding to the "defaults" settings database on
27487 * the system to get a settings object that modifies the system default
27488 * settings instead of the settings for this user.
27490 * Returns: a new #GSettings object
27496 * g_settings_new_with_backend_and_path:
27497 * @schema_id: the id of the schema
27498 * @backend: the #GSettingsBackend to use
27499 * @path: the path to use
27501 * Creates a new #GSettings object with the schema specified by
27502 * @schema_id and a given #GSettingsBackend and path.
27504 * This is a mix of g_settings_new_with_backend() and
27505 * g_settings_new_with_path().
27507 * Returns: a new #GSettings object
27513 * g_settings_new_with_path:
27514 * @schema_id: the id of the schema
27515 * @path: the path to use
27517 * Creates a new #GSettings object with the relocatable schema specified
27518 * by @schema_id and a given path.
27520 * You only need to do this if you want to directly create a settings
27521 * object with a schema that doesn't have a specified path of its own.
27522 * That's quite rare.
27524 * It is a programmer error to call this function for a schema that
27525 * has an explicitly specified path.
27527 * Returns: a new #GSettings object
27533 * g_settings_range_check:
27534 * @settings: a #GSettings
27535 * @key: the key to check
27536 * @value: the value to check
27538 * Checks if the given @value is of the correct type and within the
27539 * permitted range for @key.
27541 * This API is not intended to be used by normal programs -- they should
27542 * already know what is permitted by their own schemas. This API is
27543 * meant to be used by programs such as editors or commandline tools.
27545 * It is a programmer error to give a @key that isn't contained in the
27546 * schema for @settings.
27548 * Returns: %TRUE if @value is valid for @key
27554 * g_settings_reset:
27555 * @settings: a #GSettings object
27556 * @key: the name of a key
27558 * Resets @key to its default value.
27560 * This call resets the key, as much as possible, to its default value.
27561 * That might the value specified in the schema or the one set by the
27567 * g_settings_revert:
27568 * @settings: a #GSettings instance
27570 * Reverts all non-applied changes to the settings. This function
27571 * does nothing unless @settings is in 'delay-apply' mode; see
27572 * g_settings_delay(). In the normal case settings are always applied
27575 * Change notifications will be emitted for affected keys.
27580 * g_settings_schema_get_id:
27581 * @schema: a #GSettingsSchema
27583 * Get the ID of @schema.
27585 * Returns: (transfer none): the ID
27590 * g_settings_schema_get_path:
27591 * @schema: a #GSettingsSchema
27593 * Gets the path associated with @schema, or %NULL.
27595 * Schemas may be single-instance or relocatable. Single-instance
27596 * schemas correspond to exactly one set of keys in the backend
27597 * database: those located at the path returned by this function.
27599 * Relocatable schemas can be referenced by other schemas and can
27600 * threfore describe multiple sets of keys at different locations. For
27601 * relocatable schemas, this function will return %NULL.
27603 * Returns: (transfer none): the path of the schema, or %NULL
27609 * g_settings_schema_ref:
27610 * @schema: a #GSettingsSchema
27612 * Increase the reference count of @schema, returning a new reference.
27614 * Returns: a new reference to @schema
27620 * g_settings_schema_source_get_default:
27622 * Gets the default system schema source.
27624 * This function is not required for normal uses of #GSettings but it
27625 * may be useful to authors of plugin management systems or to those who
27626 * want to introspect the content of schemas.
27628 * If no schemas are installed, %NULL will be returned.
27630 * The returned source may actually consist of multiple schema sources
27631 * from different directories, depending on which directories were given
27632 * in <envar>XDG_DATA_DIRS</envar> and
27633 * <envar>GSETTINGS_SCHEMA_DIR</envar>. For this reason, all lookups
27634 * performed against the default source should probably be done
27637 * Returns: (transfer none): the default schema source
27643 * g_settings_schema_source_lookup:
27644 * @source: a #GSettingsSchemaSource
27645 * @schema_id: a schema ID
27646 * @recursive: %TRUE if the lookup should be recursive
27648 * Looks up a schema with the identifier @schema_id in @source.
27650 * This function is not required for normal uses of #GSettings but it
27651 * may be useful to authors of plugin management systems or to those who
27652 * want to introspect the content of schemas.
27654 * If the schema isn't found directly in @source and @recursive is %TRUE
27655 * then the parent sources will also be checked.
27657 * If the schema isn't found, %NULL is returned.
27659 * Returns: (transfer full): a new #GSettingsSchema
27665 * g_settings_schema_source_new_from_directory:
27666 * @directory: the filename of a directory
27667 * @parent: (allow-none): a #GSettingsSchemaSource, or %NULL
27668 * @trusted: %TRUE, if the directory is trusted
27669 * @error: a pointer to a #GError pointer set to %NULL, or %NULL
27671 * Attempts to create a new schema source corresponding to the contents
27672 * of the given directory.
27674 * This function is not required for normal uses of #GSettings but it
27675 * may be useful to authors of plugin management systems.
27677 * The directory should contain a file called
27678 * <filename>gschemas.compiled</filename> as produced by
27679 * <command>glib-compile-schemas</command>.
27681 * If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
27682 * trusted not to be corrupted. This assumption has a performance
27683 * advantage, but can result in crashes or inconsistent behaviour in the
27684 * case of a corrupted file. Generally, you should set @trusted to
27685 * %TRUE for files installed by the system and to %FALSE for files in
27686 * the home directory.
27688 * If @parent is non-%NULL then there are two effects.
27690 * First, if g_settings_schema_source_lookup() is called with the
27691 * @recursive flag set to %TRUE and the schema can not be found in the
27692 * source, the lookup will recurse to the parent.
27694 * Second, any references to other schemas specified within this
27695 * source (ie: <literal>child</literal> or <literal>extends</literal>)
27696 * references may be resolved from the @parent.
27698 * For this second reason, except in very unusual situations, the
27699 * @parent should probably be given as the default schema source, as
27700 * returned by g_settings_schema_source_get_default().
27707 * g_settings_schema_source_ref:
27708 * @source: a #GSettingsSchemaSource
27710 * Increase the reference count of @source, returning a new reference.
27712 * Returns: a new reference to @source
27718 * g_settings_schema_source_unref:
27719 * @source: a #GSettingsSchemaSource
27721 * Decrease the reference count of @source, possibly freeing it.
27728 * g_settings_schema_unref:
27729 * @schema: a #GSettingsSchema
27731 * Decrease the reference count of @schema, possibly freeing it.
27739 * @settings: a #GSettings object
27740 * @key: the name of the key to set
27741 * @format: a #GVariant format string
27742 * @...: arguments as per @format
27744 * Sets @key in @settings to @value.
27746 * A convenience function that combines g_settings_set_value() with
27749 * It is a programmer error to give a @key that isn't contained in the
27750 * schema for @settings or for the #GVariantType of @format to mismatch
27751 * the type given in the schema.
27753 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27759 * g_settings_set_boolean:
27760 * @settings: a #GSettings object
27761 * @key: the name of the key to set
27762 * @value: the value to set it to
27764 * Sets @key in @settings to @value.
27766 * A convenience variant of g_settings_set() for booleans.
27768 * It is a programmer error to give a @key that isn't specified as
27769 * having a boolean type in the schema for @settings.
27771 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27777 * g_settings_set_double:
27778 * @settings: a #GSettings object
27779 * @key: the name of the key to set
27780 * @value: the value to set it to
27782 * Sets @key in @settings to @value.
27784 * A convenience variant of g_settings_set() for doubles.
27786 * It is a programmer error to give a @key that isn't specified as
27787 * having a 'double' type in the schema for @settings.
27789 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27795 * g_settings_set_enum:
27796 * @settings: a #GSettings object
27797 * @key: a key, within @settings
27798 * @value: an enumerated value
27800 * Looks up the enumerated type nick for @value and writes it to @key,
27801 * within @settings.
27803 * It is a programmer error to give a @key that isn't contained in the
27804 * schema for @settings or is not marked as an enumerated type, or for
27805 * @value not to be a valid value for the named type.
27807 * After performing the write, accessing @key directly with
27808 * g_settings_get_string() will return the 'nick' associated with
27811 * Returns: %TRUE, if the set succeeds
27816 * g_settings_set_flags:
27817 * @settings: a #GSettings object
27818 * @key: a key, within @settings
27819 * @value: a flags value
27821 * Looks up the flags type nicks for the bits specified by @value, puts
27822 * them in an array of strings and writes the array to @key, within
27825 * It is a programmer error to give a @key that isn't contained in the
27826 * schema for @settings or is not marked as a flags type, or for @value
27827 * to contain any bits that are not value for the named type.
27829 * After performing the write, accessing @key directly with
27830 * g_settings_get_strv() will return an array of 'nicks'; one for each
27833 * Returns: %TRUE, if the set succeeds
27838 * g_settings_set_int:
27839 * @settings: a #GSettings object
27840 * @key: the name of the key to set
27841 * @value: the value to set it to
27843 * Sets @key in @settings to @value.
27845 * A convenience variant of g_settings_set() for 32-bit integers.
27847 * It is a programmer error to give a @key that isn't specified as
27848 * having a int32 type in the schema for @settings.
27850 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27856 * g_settings_set_string:
27857 * @settings: a #GSettings object
27858 * @key: the name of the key to set
27859 * @value: the value to set it to
27861 * Sets @key in @settings to @value.
27863 * A convenience variant of g_settings_set() for strings.
27865 * It is a programmer error to give a @key that isn't specified as
27866 * having a string type in the schema for @settings.
27868 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27874 * g_settings_set_strv:
27875 * @settings: a #GSettings object
27876 * @key: the name of the key to set
27877 * @value: (allow-none) (array zero-terminated=1): the value to set it to, or %NULL
27879 * Sets @key in @settings to @value.
27881 * A convenience variant of g_settings_set() for string arrays. If
27882 * @value is %NULL, then @key is set to be the empty array.
27884 * It is a programmer error to give a @key that isn't specified as
27885 * having an array of strings type in the schema for @settings.
27887 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27893 * g_settings_set_uint:
27894 * @settings: a #GSettings object
27895 * @key: the name of the key to set
27896 * @value: the value to set it to
27898 * Sets @key in @settings to @value.
27900 * A convenience variant of g_settings_set() for 32-bit unsigned
27903 * It is a programmer error to give a @key that isn't specified as
27904 * having a uint32 type in the schema for @settings.
27906 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27912 * g_settings_set_value:
27913 * @settings: a #GSettings object
27914 * @key: the name of the key to set
27915 * @value: a #GVariant of the correct type
27917 * Sets @key in @settings to @value.
27919 * It is a programmer error to give a @key that isn't contained in the
27920 * schema for @settings or for @value to have the incorrect type, per
27923 * If @value is floating then this function consumes the reference.
27925 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27933 * Ensures that all pending operations for the given are complete for
27934 * the default backend.
27936 * Writes made to a #GSettings are handled asynchronously. For this
27937 * reason, it is very unlikely that the changes have it to disk by the
27938 * time g_settings_set() returns.
27940 * This call will block until all of the writes have made it to the
27941 * backend. Since the mainloop is not running, no change notifications
27942 * will be dispatched during this call (but some may be queued by the
27943 * time the call is done).
27948 * g_settings_unbind:
27949 * @object: the object
27950 * @property: the property whose binding is removed
27952 * Removes an existing binding for @property on @object.
27954 * Note that bindings are automatically removed when the
27955 * object is finalized, so it is rarely necessary to call this
27963 * g_simple_action_group_add_entries:
27964 * @simple: a #GSimpleActionGroup
27965 * @entries: (array length=n_entries): a pointer to the first item in an array of #GActionEntry structs
27966 * @n_entries: the length of @entries, or -1
27967 * @user_data: the user data for signal connections
27969 * A convenience function for creating multiple #GSimpleAction instances
27970 * and adding them to the action group.
27977 * g_simple_action_group_insert:
27978 * @simple: a #GSimpleActionGroup
27979 * @action: a #GAction
27981 * Adds an action to the action group.
27983 * If the action group already contains an action with the same name as
27984 * @action then the old action is dropped from the group.
27986 * The action group takes its own reference on @action.
27993 * g_simple_action_group_lookup:
27994 * @simple: a #GSimpleActionGroup
27995 * @action_name: the name of an action
27997 * Looks up the action with the name @action_name in the group.
27999 * If no such action exists, returns %NULL.
28001 * Returns: (transfer none): a #GAction, or %NULL
28007 * g_simple_action_group_new:
28009 * Creates a new, empty, #GSimpleActionGroup.
28011 * Returns: a new #GSimpleActionGroup
28017 * g_simple_action_group_remove:
28018 * @simple: a #GSimpleActionGroup
28019 * @action_name: the name of the action
28021 * Removes the named action from the action group.
28023 * If no action of this name is in the group then nothing happens.
28030 * g_simple_action_new:
28031 * @name: the name of the action
28032 * @parameter_type: (allow-none): the type of parameter to the activate function
28034 * Creates a new action.
28036 * The created action is stateless. See g_simple_action_new_stateful().
28038 * Returns: a new #GSimpleAction
28044 * g_simple_action_new_stateful:
28045 * @name: the name of the action
28046 * @parameter_type: (allow-none): the type of the parameter to the activate function
28047 * @state: the initial state of the action
28049 * Creates a new stateful action.
28051 * @state is the initial state of the action. All future state values
28052 * must have the same #GVariantType as the initial state.
28054 * If the @state GVariant is floating, it is consumed.
28056 * Returns: a new #GSimpleAction
28062 * g_simple_action_set_enabled:
28063 * @simple: a #GSimpleAction
28064 * @enabled: whether the action is enabled
28066 * Sets the action as enabled or not.
28068 * An action must be enabled in order to be activated or in order to
28069 * have its state changed from outside callers.
28071 * This should only be called by the implementor of the action. Users
28072 * of the action should not attempt to modify its enabled flag.
28079 * g_simple_action_set_state:
28080 * @simple: a #GSimpleAction
28081 * @value: the new #GVariant for the state
28083 * Sets the state of the action.
28085 * This directly updates the 'state' property to the given value.
28087 * This should only be called by the implementor of the action. Users
28088 * of the action should not attempt to directly modify the 'state'
28089 * property. Instead, they should call g_action_change_state() to
28090 * request the change.
28097 * g_simple_async_report_error_in_idle: (skip)
28098 * @object: (allow-none): a #GObject, or %NULL.
28099 * @callback: a #GAsyncReadyCallback.
28100 * @user_data: user data passed to @callback.
28101 * @domain: a #GQuark containing the error domain (usually #G_IO_ERROR).
28102 * @code: a specific error code.
28103 * @format: a formatted error reporting string.
28104 * @...: a list of variables to fill in @format.
28106 * Reports an error in an asynchronous function in an idle function by
28107 * directly setting the contents of the #GAsyncResult with the given error
28113 * g_simple_async_report_gerror_in_idle:
28114 * @object: (allow-none): a #GObject, or %NULL
28115 * @callback: (scope async): a #GAsyncReadyCallback.
28116 * @user_data: (closure): user data passed to @callback.
28117 * @error: the #GError to report
28119 * Reports an error in an idle function. Similar to
28120 * g_simple_async_report_error_in_idle(), but takes a #GError rather
28121 * than building a new one.
28126 * g_simple_async_report_take_gerror_in_idle: (skip)
28127 * @object: (allow-none): a #GObject, or %NULL
28128 * @callback: a #GAsyncReadyCallback.
28129 * @user_data: user data passed to @callback.
28130 * @error: the #GError to report
28132 * Reports an error in an idle function. Similar to
28133 * g_simple_async_report_gerror_in_idle(), but takes over the caller's
28134 * ownership of @error, so the caller does not have to free it any more.
28141 * g_simple_async_result_complete:
28142 * @simple: a #GSimpleAsyncResult.
28144 * Completes an asynchronous I/O job immediately. Must be called in
28145 * the thread where the asynchronous result was to be delivered, as it
28146 * invokes the callback directly. If you are in a different thread use
28147 * g_simple_async_result_complete_in_idle().
28149 * Calling this function takes a reference to @simple for as long as
28150 * is needed to complete the call.
28155 * g_simple_async_result_complete_in_idle:
28156 * @simple: a #GSimpleAsyncResult.
28158 * Completes an asynchronous function in an idle handler in the <link
28159 * linkend="g-main-context-push-thread-default">thread-default main
28160 * loop</link> of the thread that @simple was initially created in
28161 * (and re-pushes that context around the invocation of the callback).
28163 * Calling this function takes a reference to @simple for as long as
28164 * is needed to complete the call.
28169 * g_simple_async_result_get_op_res_gboolean:
28170 * @simple: a #GSimpleAsyncResult.
28172 * Gets the operation result boolean from within the asynchronous result.
28174 * Returns: %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE.
28179 * g_simple_async_result_get_op_res_gpointer: (skip)
28180 * @simple: a #GSimpleAsyncResult.
28182 * Gets a pointer result as returned by the asynchronous function.
28184 * Returns: a pointer from the result.
28189 * g_simple_async_result_get_op_res_gssize:
28190 * @simple: a #GSimpleAsyncResult.
28192 * Gets a gssize from the asynchronous result.
28194 * Returns: a gssize returned from the asynchronous function.
28199 * g_simple_async_result_get_source_tag: (skip)
28200 * @simple: a #GSimpleAsyncResult.
28202 * Gets the source tag for the #GSimpleAsyncResult.
28204 * Returns: a #gpointer to the source object for the #GSimpleAsyncResult.
28209 * g_simple_async_result_is_valid:
28210 * @result: the #GAsyncResult passed to the _finish function.
28211 * @source: the #GObject passed to the _finish function.
28212 * @source_tag: the asynchronous function.
28214 * Ensures that the data passed to the _finish function of an async
28215 * operation is consistent. Three checks are performed.
28217 * First, @result is checked to ensure that it is really a
28218 * #GSimpleAsyncResult. Second, @source is checked to ensure that it
28219 * matches the source object of @result. Third, @source_tag is
28220 * checked to ensure that it is either %NULL (as it is when the result was
28221 * created by g_simple_async_report_error_in_idle() or
28222 * g_simple_async_report_gerror_in_idle()) or equal to the
28223 * @source_tag argument given to g_simple_async_result_new() (which, by
28224 * convention, is a pointer to the _async function corresponding to the
28225 * _finish function from which this function is called).
28227 * Returns: #TRUE if all checks passed or #FALSE if any failed.
28233 * g_simple_async_result_new:
28234 * @source_object: (allow-none): a #GObject, or %NULL.
28235 * @callback: (scope async): a #GAsyncReadyCallback.
28236 * @user_data: (closure): user data passed to @callback.
28237 * @source_tag: the asynchronous function.
28239 * Creates a #GSimpleAsyncResult.
28241 * The common convention is to create the #GSimpleAsyncResult in the
28242 * function that starts the asynchronous operation and use that same
28243 * function as the @source_tag.
28245 * If your operation supports cancellation with #GCancellable (which it
28246 * probably should) then you should provide the user's cancellable to
28247 * g_simple_async_result_set_check_cancellable() immediately after
28248 * this function returns.
28250 * Returns: a #GSimpleAsyncResult.
28255 * g_simple_async_result_new_error:
28256 * @source_object: (allow-none): a #GObject, or %NULL.
28257 * @callback: (scope async): a #GAsyncReadyCallback.
28258 * @user_data: (closure): user data passed to @callback.
28259 * @domain: a #GQuark.
28260 * @code: an error code.
28261 * @format: a string with format characters.
28262 * @...: a list of values to insert into @format.
28264 * Creates a new #GSimpleAsyncResult with a set error.
28266 * Returns: a #GSimpleAsyncResult.
28271 * g_simple_async_result_new_from_error:
28272 * @source_object: (allow-none): a #GObject, or %NULL.
28273 * @callback: (scope async): a #GAsyncReadyCallback.
28274 * @user_data: (closure): user data passed to @callback.
28275 * @error: a #GError
28277 * Creates a #GSimpleAsyncResult from an error condition.
28279 * Returns: a #GSimpleAsyncResult.
28284 * g_simple_async_result_new_take_error: (skip)
28285 * @source_object: (allow-none): a #GObject, or %NULL
28286 * @callback: (scope async): a #GAsyncReadyCallback
28287 * @user_data: (closure): user data passed to @callback
28288 * @error: a #GError
28290 * Creates a #GSimpleAsyncResult from an error condition, and takes over the
28291 * caller's ownership of @error, so the caller does not need to free it anymore.
28293 * Returns: a #GSimpleAsyncResult
28299 * g_simple_async_result_propagate_error:
28300 * @simple: a #GSimpleAsyncResult.
28301 * @dest: (out): a location to propagate the error to.
28303 * Propagates an error from within the simple asynchronous result to
28304 * a given destination.
28306 * If the #GCancellable given to a prior call to
28307 * g_simple_async_result_set_check_cancellable() is cancelled then this
28308 * function will return %TRUE with @dest set appropriately.
28310 * Returns: %TRUE if the error was propagated to @dest. %FALSE otherwise.
28315 * g_simple_async_result_run_in_thread: (skip)
28316 * @simple: a #GSimpleAsyncResult.
28317 * @func: a #GSimpleAsyncThreadFunc.
28318 * @io_priority: the io priority of the request.
28319 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28321 * Runs the asynchronous job in a separate thread and then calls
28322 * g_simple_async_result_complete_in_idle() on @simple to return
28323 * the result to the appropriate main loop.
28325 * Calling this function takes a reference to @simple for as long as
28326 * is needed to run the job and report its completion.
28331 * g_simple_async_result_set_check_cancellable:
28332 * @simple: a #GSimpleAsyncResult
28333 * @check_cancellable: (allow-none): a #GCancellable to check, or %NULL to unset
28335 * Sets a #GCancellable to check before dispatching results.
28337 * This function has one very specific purpose: the provided cancellable
28338 * is checked at the time of g_simple_async_result_propagate_error() If
28339 * it is cancelled, these functions will return an "Operation was
28340 * cancelled" error (%G_IO_ERROR_CANCELLED).
28342 * Implementors of cancellable asynchronous functions should use this in
28343 * order to provide a guarantee to their callers that cancelling an
28344 * async operation will reliably result in an error being returned for
28345 * that operation (even if a positive result for the operation has
28346 * already been sent as an idle to the main context to be dispatched).
28348 * The checking described above is done regardless of any call to the
28349 * unrelated g_simple_async_result_set_handle_cancellation() function.
28356 * g_simple_async_result_set_error: (skip)
28357 * @simple: a #GSimpleAsyncResult.
28358 * @domain: a #GQuark (usually #G_IO_ERROR).
28359 * @code: an error code.
28360 * @format: a formatted error reporting string.
28361 * @...: a list of variables to fill in @format.
28363 * Sets an error within the asynchronous result without a #GError.
28368 * g_simple_async_result_set_error_va: (skip)
28369 * @simple: a #GSimpleAsyncResult.
28370 * @domain: a #GQuark (usually #G_IO_ERROR).
28371 * @code: an error code.
28372 * @format: a formatted error reporting string.
28373 * @args: va_list of arguments.
28375 * Sets an error within the asynchronous result without a #GError.
28376 * Unless writing a binding, see g_simple_async_result_set_error().
28381 * g_simple_async_result_set_from_error:
28382 * @simple: a #GSimpleAsyncResult.
28385 * Sets the result from a #GError.
28390 * g_simple_async_result_set_handle_cancellation:
28391 * @simple: a #GSimpleAsyncResult.
28392 * @handle_cancellation: a #gboolean.
28394 * Sets whether to handle cancellation within the asynchronous operation.
28396 * This function has nothing to do with
28397 * g_simple_async_result_set_check_cancellable(). It only refers to the
28398 * #GCancellable passed to g_simple_async_result_run_in_thread().
28403 * g_simple_async_result_set_op_res_gboolean:
28404 * @simple: a #GSimpleAsyncResult.
28405 * @op_res: a #gboolean.
28407 * Sets the operation result to a boolean within the asynchronous result.
28412 * g_simple_async_result_set_op_res_gpointer: (skip)
28413 * @simple: a #GSimpleAsyncResult.
28414 * @op_res: a pointer result from an asynchronous function.
28415 * @destroy_op_res: a #GDestroyNotify function.
28417 * Sets the operation result within the asynchronous result to a pointer.
28422 * g_simple_async_result_set_op_res_gssize:
28423 * @simple: a #GSimpleAsyncResult.
28424 * @op_res: a #gssize.
28426 * Sets the operation result within the asynchronous result to
28427 * the given @op_res.
28432 * g_simple_async_result_take_error: (skip)
28433 * @simple: a #GSimpleAsyncResult
28434 * @error: a #GError
28436 * Sets the result from @error, and takes over the caller's ownership
28437 * of @error, so the caller does not need to free it any more.
28444 * g_simple_permission_new:
28445 * @allowed: %TRUE if the action is allowed
28447 * Creates a new #GPermission instance that represents an action that is
28448 * either always or never allowed.
28450 * Returns: the #GSimplePermission, as a #GPermission
28457 * @socket: a #GSocket.
28458 * @cancellable: (allow-none): a %GCancellable or %NULL
28459 * @error: #GError for error reporting, or %NULL to ignore.
28461 * Accept incoming connections on a connection-based socket. This removes
28462 * the first outstanding connection request from the listening socket and
28463 * creates a #GSocket object for it.
28465 * The @socket must be bound to a local address with g_socket_bind() and
28466 * must be listening for incoming connections (g_socket_listen()).
28468 * If there are no outstanding connections then the operation will block
28469 * or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
28470 * To be notified of an incoming connection, wait for the %G_IO_IN condition.
28472 * Returns: (transfer full): a new #GSocket, or %NULL on error. Free the returned object with g_object_unref().
28478 * g_socket_address_enumerator_next:
28479 * @enumerator: a #GSocketAddressEnumerator
28480 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28481 * @error: a #GError.
28483 * Retrieves the next #GSocketAddress from @enumerator. Note that this
28484 * may block for some amount of time. (Eg, a #GNetworkAddress may need
28485 * to do a DNS lookup before it can return an address.) Use
28486 * g_socket_address_enumerator_next_async() if you need to avoid
28489 * If @enumerator is expected to yield addresses, but for some reason
28490 * is unable to (eg, because of a DNS error), then the first call to
28491 * g_socket_address_enumerator_next() will return an appropriate error
28492 * in *@error. However, if the first call to
28493 * g_socket_address_enumerator_next() succeeds, then any further
28494 * internal errors (other than @cancellable being triggered) will be
28497 * Returns: (transfer full): a #GSocketAddress (owned by the caller), or %NULL on error (in which case *@error will be set) or if there are no more addresses.
28502 * g_socket_address_enumerator_next_async:
28503 * @enumerator: a #GSocketAddressEnumerator
28504 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28505 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
28506 * @user_data: (closure): the data to pass to callback function
28508 * Asynchronously retrieves the next #GSocketAddress from @enumerator
28509 * and then calls @callback, which must call
28510 * g_socket_address_enumerator_next_finish() to get the result.
28515 * g_socket_address_enumerator_next_finish:
28516 * @enumerator: a #GSocketAddressEnumerator
28517 * @result: a #GAsyncResult
28518 * @error: a #GError
28520 * Retrieves the result of a completed call to
28521 * g_socket_address_enumerator_next_async(). See
28522 * g_socket_address_enumerator_next() for more information about
28525 * Returns: (transfer full): a #GSocketAddress (owned by the caller), or %NULL on error (in which case *@error will be set) or if there are no more addresses.
28530 * g_socket_address_get_family:
28531 * @address: a #GSocketAddress
28533 * Gets the socket family type of @address.
28535 * Returns: the socket family type of @address.
28541 * g_socket_address_get_native_size:
28542 * @address: a #GSocketAddress
28544 * Gets the size of @address's native <type>struct sockaddr</type>.
28545 * You can use this to allocate memory to pass to
28546 * g_socket_address_to_native().
28548 * Returns: the size of the native <type>struct sockaddr</type> that @address represents
28554 * g_socket_address_new_from_native:
28555 * @native: a pointer to a <type>struct sockaddr</type>
28556 * @len: the size of the memory location pointed to by @native
28558 * Creates a #GSocketAddress subclass corresponding to the native
28559 * <type>struct sockaddr</type> @native.
28561 * Returns: a new #GSocketAddress if @native could successfully be converted, otherwise %NULL.
28567 * g_socket_address_to_native:
28568 * @address: a #GSocketAddress
28569 * @dest: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
28570 * @destlen: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
28571 * @error: #GError for error reporting, or %NULL to ignore.
28573 * Converts a #GSocketAddress to a native <type>struct
28574 * sockaddr</type>, which can be passed to low-level functions like
28575 * connect() or bind().
28577 * If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
28578 * returned. If the address type is not known on the system
28579 * then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
28581 * Returns: %TRUE if @dest was filled in, %FALSE on error
28588 * @socket: a #GSocket.
28589 * @address: a #GSocketAddress specifying the local address.
28590 * @allow_reuse: whether to allow reusing this address
28591 * @error: #GError for error reporting, or %NULL to ignore.
28593 * When a socket is created it is attached to an address family, but it
28594 * doesn't have an address in this family. g_socket_bind() assigns the
28595 * address (sometimes called name) of the socket.
28597 * It is generally required to bind to a local address before you can
28598 * receive connections. (See g_socket_listen() and g_socket_accept() ).
28599 * In certain situations, you may also want to bind a socket that will be
28600 * used to initiate connections, though this is not normally required.
28602 * @allow_reuse should be %TRUE for server sockets (sockets that you will
28603 * eventually call g_socket_accept() on), and %FALSE for client sockets.
28604 * (Specifically, if it is %TRUE, then g_socket_bind() will set the
28605 * %SO_REUSEADDR flag on the socket, allowing it to bind @address even if
28606 * that address was previously used by another socket that has not yet been
28607 * fully cleaned-up by the kernel. Failing to set this flag on a server
28608 * socket may cause the bind call to return %G_IO_ERROR_ADDRESS_IN_USE if
28609 * the server program is stopped and then immediately restarted.)
28611 * Returns: %TRUE on success, %FALSE on error.
28617 * g_socket_check_connect_result:
28618 * @socket: a #GSocket
28619 * @error: #GError for error reporting, or %NULL to ignore.
28621 * Checks and resets the pending connect error for the socket.
28622 * This is used to check for errors when g_socket_connect() is
28623 * used in non-blocking mode.
28625 * Returns: %TRUE if no error, %FALSE otherwise, setting @error to the error
28631 * g_socket_client_add_application_proxy:
28632 * @client: a #GSocketClient
28633 * @protocol: The proxy protocol
28635 * Enable proxy protocols to be handled by the application. When the
28636 * indicated proxy protocol is returned by the #GProxyResolver,
28637 * #GSocketClient will consider this protocol as supported but will
28638 * not try to find a #GProxy instance to handle handshaking. The
28639 * application must check for this case by calling
28640 * g_socket_connection_get_remote_address() on the returned
28641 * #GSocketConnection, and seeing if it's a #GProxyAddress of the
28642 * appropriate type, to determine whether or not it needs to handle
28643 * the proxy handshaking itself.
28645 * This should be used for proxy protocols that are dialects of
28646 * another protocol such as HTTP proxy. It also allows cohabitation of
28647 * proxy protocols that are reused between protocols. A good example
28648 * is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
28649 * be use as generic socket proxy through the HTTP CONNECT method.
28651 * When the proxy is detected as being an application proxy, TLS handshake
28652 * will be skipped. This is required to let the application do the proxy
28653 * specific handshake.
28658 * g_socket_client_connect:
28659 * @client: a #GSocketClient.
28660 * @connectable: a #GSocketConnectable specifying the remote address.
28661 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28662 * @error: #GError for error reporting, or %NULL to ignore.
28664 * Tries to resolve the @connectable and make a network connection to it.
28666 * Upon a successful connection, a new #GSocketConnection is constructed
28667 * and returned. The caller owns this new object and must drop their
28668 * reference to it when finished with it.
28670 * The type of the #GSocketConnection object returned depends on the type of
28671 * the underlying socket that is used. For instance, for a TCP/IP connection
28672 * it will be a #GTcpConnection.
28674 * The socket created will be the same family as the address that the
28675 * @connectable resolves to, unless family is set with g_socket_client_set_family()
28676 * or indirectly via g_socket_client_set_local_address(). The socket type
28677 * defaults to %G_SOCKET_TYPE_STREAM but can be set with
28678 * g_socket_client_set_socket_type().
28680 * If a local address is specified with g_socket_client_set_local_address() the
28681 * socket will be bound to this address before connecting.
28683 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28689 * g_socket_client_connect_async:
28690 * @client: a #GSocketClient
28691 * @connectable: a #GSocketConnectable specifying the remote address.
28692 * @cancellable: (allow-none): a #GCancellable, or %NULL
28693 * @callback: (scope async): a #GAsyncReadyCallback
28694 * @user_data: (closure): user data for the callback
28696 * This is the asynchronous version of g_socket_client_connect().
28698 * When the operation is finished @callback will be
28699 * called. You can then call g_socket_client_connect_finish() to get
28700 * the result of the operation.
28707 * g_socket_client_connect_finish:
28708 * @client: a #GSocketClient.
28709 * @result: a #GAsyncResult.
28710 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28712 * Finishes an async connect operation. See g_socket_client_connect_async()
28714 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28720 * g_socket_client_connect_to_host:
28721 * @client: a #GSocketClient
28722 * @host_and_port: the name and optionally port of the host to connect to
28723 * @default_port: the default port to connect to
28724 * @cancellable: (allow-none): a #GCancellable, or %NULL
28725 * @error: a pointer to a #GError, or %NULL
28727 * This is a helper function for g_socket_client_connect().
28729 * Attempts to create a TCP connection to the named host.
28731 * @host_and_port may be in any of a number of recognized formats; an IPv6
28732 * address, an IPv4 address, or a domain name (in which case a DNS
28733 * lookup is performed). Quoting with [] is supported for all address
28734 * types. A port override may be specified in the usual way with a
28735 * colon. Ports may be given as decimal numbers or symbolic names (in
28736 * which case an /etc/services lookup is performed).
28738 * If no port override is given in @host_and_port then @default_port will be
28739 * used as the port number to connect to.
28741 * In general, @host_and_port is expected to be provided by the user (allowing
28742 * them to give the hostname, and a port override if necessary) and
28743 * @default_port is expected to be provided by the application.
28745 * In the case that an IP address is given, a single connection
28746 * attempt is made. In the case that a name is given, multiple
28747 * connection attempts may be made, in turn and according to the
28748 * number of address records in DNS, until a connection succeeds.
28750 * Upon a successful connection, a new #GSocketConnection is constructed
28751 * and returned. The caller owns this new object and must drop their
28752 * reference to it when finished with it.
28754 * In the event of any failure (DNS error, service not found, no hosts
28755 * connectable) %NULL is returned and @error (if non-%NULL) is set
28758 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28764 * g_socket_client_connect_to_host_async:
28765 * @client: a #GSocketClient
28766 * @host_and_port: the name and optionally the port of the host to connect to
28767 * @default_port: the default port to connect to
28768 * @cancellable: (allow-none): a #GCancellable, or %NULL
28769 * @callback: (scope async): a #GAsyncReadyCallback
28770 * @user_data: (closure): user data for the callback
28772 * This is the asynchronous version of g_socket_client_connect_to_host().
28774 * When the operation is finished @callback will be
28775 * called. You can then call g_socket_client_connect_to_host_finish() to get
28776 * the result of the operation.
28783 * g_socket_client_connect_to_host_finish:
28784 * @client: a #GSocketClient.
28785 * @result: a #GAsyncResult.
28786 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28788 * Finishes an async connect operation. See g_socket_client_connect_to_host_async()
28790 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28796 * g_socket_client_connect_to_service:
28797 * @client: a #GSocketConnection
28798 * @domain: a domain name
28799 * @service: the name of the service to connect to
28800 * @cancellable: (allow-none): a #GCancellable, or %NULL
28801 * @error: a pointer to a #GError, or %NULL
28803 * Attempts to create a TCP connection to a service.
28805 * This call looks up the SRV record for @service at @domain for the
28806 * "tcp" protocol. It then attempts to connect, in turn, to each of
28807 * the hosts providing the service until either a connection succeeds
28808 * or there are no hosts remaining.
28810 * Upon a successful connection, a new #GSocketConnection is constructed
28811 * and returned. The caller owns this new object and must drop their
28812 * reference to it when finished with it.
28814 * In the event of any failure (DNS error, service not found, no hosts
28815 * connectable) %NULL is returned and @error (if non-%NULL) is set
28818 * Returns: (transfer full): a #GSocketConnection if successful, or %NULL on error
28823 * g_socket_client_connect_to_service_async:
28824 * @client: a #GSocketClient
28825 * @domain: a domain name
28826 * @service: the name of the service to connect to
28827 * @cancellable: (allow-none): a #GCancellable, or %NULL
28828 * @callback: (scope async): a #GAsyncReadyCallback
28829 * @user_data: (closure): user data for the callback
28831 * This is the asynchronous version of
28832 * g_socket_client_connect_to_service().
28839 * g_socket_client_connect_to_service_finish:
28840 * @client: a #GSocketClient.
28841 * @result: a #GAsyncResult.
28842 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28844 * Finishes an async connect operation. See g_socket_client_connect_to_service_async()
28846 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28852 * g_socket_client_connect_to_uri:
28853 * @client: a #GSocketClient
28854 * @uri: A network URI
28855 * @default_port: the default port to connect to
28856 * @cancellable: (allow-none): a #GCancellable, or %NULL
28857 * @error: a pointer to a #GError, or %NULL
28859 * This is a helper function for g_socket_client_connect().
28861 * Attempts to create a TCP connection with a network URI.
28863 * @uri may be any valid URI containing an "authority" (hostname/port)
28864 * component. If a port is not specified in the URI, @default_port
28865 * will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
28866 * (#GSocketClient does not know to automatically assume TLS for
28867 * certain URI schemes.)
28869 * Using this rather than g_socket_client_connect() or
28870 * g_socket_client_connect_to_host() allows #GSocketClient to
28871 * determine when to use application-specific proxy protocols.
28873 * Upon a successful connection, a new #GSocketConnection is constructed
28874 * and returned. The caller owns this new object and must drop their
28875 * reference to it when finished with it.
28877 * In the event of any failure (DNS error, service not found, no hosts
28878 * connectable) %NULL is returned and @error (if non-%NULL) is set
28881 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28887 * g_socket_client_connect_to_uri_async:
28888 * @client: a #GSocketClient
28889 * @uri: a network uri
28890 * @default_port: the default port to connect to
28891 * @cancellable: (allow-none): a #GCancellable, or %NULL
28892 * @callback: (scope async): a #GAsyncReadyCallback
28893 * @user_data: (closure): user data for the callback
28895 * This is the asynchronous version of g_socket_client_connect_to_uri().
28897 * When the operation is finished @callback will be
28898 * called. You can then call g_socket_client_connect_to_uri_finish() to get
28899 * the result of the operation.
28906 * g_socket_client_connect_to_uri_finish:
28907 * @client: a #GSocketClient.
28908 * @result: a #GAsyncResult.
28909 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28911 * Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
28913 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28919 * g_socket_client_get_enable_proxy:
28920 * @client: a #GSocketClient.
28922 * Gets the proxy enable state; see g_socket_client_set_enable_proxy()
28924 * Returns: whether proxying is enabled
28930 * g_socket_client_get_family:
28931 * @client: a #GSocketClient.
28933 * Gets the socket family of the socket client.
28935 * See g_socket_client_set_family() for details.
28937 * Returns: a #GSocketFamily
28943 * g_socket_client_get_local_address:
28944 * @client: a #GSocketClient.
28946 * Gets the local address of the socket client.
28948 * See g_socket_client_set_local_address() for details.
28950 * Returns: (transfer none): a #GSocketAddress or %NULL. Do not free.
28956 * g_socket_client_get_protocol:
28957 * @client: a #GSocketClient
28959 * Gets the protocol name type of the socket client.
28961 * See g_socket_client_set_protocol() for details.
28963 * Returns: a #GSocketProtocol
28969 * g_socket_client_get_socket_type:
28970 * @client: a #GSocketClient.
28972 * Gets the socket type of the socket client.
28974 * See g_socket_client_set_socket_type() for details.
28976 * Returns: a #GSocketFamily
28982 * g_socket_client_get_timeout:
28983 * @client: a #GSocketClient
28985 * Gets the I/O timeout time for sockets created by @client.
28987 * See g_socket_client_set_timeout() for details.
28989 * Returns: the timeout in seconds
28995 * g_socket_client_get_tls:
28996 * @client: a #GSocketClient.
28998 * Gets whether @client creates TLS connections. See
28999 * g_socket_client_set_tls() for details.
29001 * Returns: whether @client uses TLS
29007 * g_socket_client_get_tls_validation_flags:
29008 * @client: a #GSocketClient.
29010 * Gets the TLS validation flags used creating TLS connections via
29013 * Returns: the TLS validation flags
29019 * g_socket_client_new:
29021 * Creates a new #GSocketClient with the default options.
29023 * Returns: a #GSocketClient. Free the returned object with g_object_unref().
29029 * g_socket_client_set_enable_proxy:
29030 * @client: a #GSocketClient.
29031 * @enable: whether to enable proxies
29033 * Sets whether or not @client attempts to make connections via a
29034 * proxy server. When enabled (the default), #GSocketClient will use a
29035 * #GProxyResolver to determine if a proxy protocol such as SOCKS is
29036 * needed, and automatically do the necessary proxy negotiation.
29043 * g_socket_client_set_family:
29044 * @client: a #GSocketClient.
29045 * @family: a #GSocketFamily
29047 * Sets the socket family of the socket client.
29048 * If this is set to something other than %G_SOCKET_FAMILY_INVALID
29049 * then the sockets created by this object will be of the specified
29052 * This might be useful for instance if you want to force the local
29053 * connection to be an ipv4 socket, even though the address might
29054 * be an ipv6 mapped to ipv4 address.
29061 * g_socket_client_set_local_address:
29062 * @client: a #GSocketClient.
29063 * @address: (allow-none): a #GSocketAddress, or %NULL
29065 * Sets the local address of the socket client.
29066 * The sockets created by this object will bound to the
29067 * specified address (if not %NULL) before connecting.
29069 * This is useful if you want to ensure that the local
29070 * side of the connection is on a specific port, or on
29071 * a specific interface.
29078 * g_socket_client_set_protocol:
29079 * @client: a #GSocketClient.
29080 * @protocol: a #GSocketProtocol
29082 * Sets the protocol of the socket client.
29083 * The sockets created by this object will use of the specified
29086 * If @protocol is %0 that means to use the default
29087 * protocol for the socket family and type.
29094 * g_socket_client_set_socket_type:
29095 * @client: a #GSocketClient.
29096 * @type: a #GSocketType
29098 * Sets the socket type of the socket client.
29099 * The sockets created by this object will be of the specified
29102 * It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
29103 * as GSocketClient is used for connection oriented services.
29110 * g_socket_client_set_timeout:
29111 * @client: a #GSocketClient.
29112 * @timeout: the timeout
29114 * Sets the I/O timeout for sockets created by @client. @timeout is a
29115 * time in seconds, or 0 for no timeout (the default).
29117 * The timeout value affects the initial connection attempt as well,
29118 * so setting this may cause calls to g_socket_client_connect(), etc,
29119 * to fail with %G_IO_ERROR_TIMED_OUT.
29126 * g_socket_client_set_tls:
29127 * @client: a #GSocketClient.
29128 * @tls: whether to use TLS
29130 * Sets whether @client creates TLS (aka SSL) connections. If @tls is
29131 * %TRUE, @client will wrap its connections in a #GTlsClientConnection
29132 * and perform a TLS handshake when connecting.
29134 * Note that since #GSocketClient must return a #GSocketConnection,
29135 * but #GTlsClientConnection is not a #GSocketConnection, this
29136 * actually wraps the resulting #GTlsClientConnection in a
29137 * #GTcpWrapperConnection when returning it. You can use
29138 * g_tcp_wrapper_connection_get_base_io_stream() on the return value
29139 * to extract the #GTlsClientConnection.
29141 * If you need to modify the behavior of the TLS handshake (eg, by
29142 * setting a client-side certificate to use, or connecting to the
29143 * #GTlsConnection::accept-certificate signal), you can connect to
29144 * @client's #GSocketClient::event signal and wait for it to be
29145 * emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
29146 * a chance to see the #GTlsClientConnection before the handshake
29154 * g_socket_client_set_tls_validation_flags:
29155 * @client: a #GSocketClient.
29156 * @flags: the validation flags
29158 * Sets the TLS validation flags used when creating TLS connections
29159 * via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
29167 * @socket: a #GSocket
29168 * @error: #GError for error reporting, or %NULL to ignore.
29170 * Closes the socket, shutting down any active connection.
29172 * Closing a socket does not wait for all outstanding I/O operations
29173 * to finish, so the caller should not rely on them to be guaranteed
29174 * to complete even if the close returns with no error.
29176 * Once the socket is closed, all other operations will return
29177 * %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
29180 * Sockets will be automatically closed when the last reference
29181 * is dropped, but you might want to call this function to make sure
29182 * resources are released as early as possible.
29184 * Beware that due to the way that TCP works, it is possible for
29185 * recently-sent data to be lost if either you close a socket while the
29186 * %G_IO_IN condition is set, or else if the remote connection tries to
29187 * send something to you after you close the socket but before it has
29188 * finished reading all of the data you sent. There is no easy generic
29189 * way to avoid this problem; the easiest fix is to design the network
29190 * protocol such that the client will never send data "out of turn".
29191 * Another solution is for the server to half-close the connection by
29192 * calling g_socket_shutdown() with only the @shutdown_write flag set,
29193 * and then wait for the client to notice this and close its side of the
29194 * connection, after which the server can safely call g_socket_close().
29195 * (This is what #GTcpConnection does if you call
29196 * g_tcp_connection_set_graceful_disconnect(). But of course, this
29197 * only works if the client will close its connection after the server
29200 * Returns: %TRUE on success, %FALSE on error
29206 * g_socket_condition_check:
29207 * @socket: a #GSocket
29208 * @condition: a #GIOCondition mask to check
29210 * Checks on the readiness of @socket to perform operations.
29211 * The operations specified in @condition are checked for and masked
29212 * against the currently-satisfied conditions on @socket. The result
29215 * Note that on Windows, it is possible for an operation to return
29216 * %G_IO_ERROR_WOULD_BLOCK even immediately after
29217 * g_socket_condition_check() has claimed that the socket is ready for
29218 * writing. Rather than calling g_socket_condition_check() and then
29219 * writing to the socket if it succeeds, it is generally better to
29220 * simply try writing to the socket right away, and try again later if
29221 * the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
29223 * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
29224 * these conditions will always be set in the output if they are true.
29226 * This call never blocks.
29228 * Returns: the @GIOCondition mask of the current state
29234 * g_socket_condition_timed_wait:
29235 * @socket: a #GSocket
29236 * @condition: a #GIOCondition mask to wait for
29237 * @timeout: the maximum time (in microseconds) to wait, or -1
29238 * @cancellable: (allow-none): a #GCancellable, or %NULL
29239 * @error: a #GError pointer, or %NULL
29241 * Waits for up to @timeout microseconds for @condition to become true
29242 * on @socket. If the condition is met, %TRUE is returned.
29244 * If @cancellable is cancelled before the condition is met, or if
29245 * @timeout (or the socket's #GSocket:timeout) is reached before the
29246 * condition is met, then %FALSE is returned and @error, if non-%NULL,
29247 * is set to the appropriate value (%G_IO_ERROR_CANCELLED or
29248 * %G_IO_ERROR_TIMED_OUT).
29250 * If you don't want a timeout, use g_socket_condition_wait().
29251 * (Alternatively, you can pass -1 for @timeout.)
29253 * Note that although @timeout is in microseconds for consistency with
29254 * other GLib APIs, this function actually only has millisecond
29255 * resolution, and the behavior is undefined if @timeout is not an
29256 * exact number of milliseconds.
29258 * Returns: %TRUE if the condition was met, %FALSE otherwise
29264 * g_socket_condition_wait:
29265 * @socket: a #GSocket
29266 * @condition: a #GIOCondition mask to wait for
29267 * @cancellable: (allow-none): a #GCancellable, or %NULL
29268 * @error: a #GError pointer, or %NULL
29270 * Waits for @condition to become true on @socket. When the condition
29271 * is met, %TRUE is returned.
29273 * If @cancellable is cancelled before the condition is met, or if the
29274 * socket has a timeout set and it is reached before the condition is
29275 * met, then %FALSE is returned and @error, if non-%NULL, is set to
29276 * the appropriate value (%G_IO_ERROR_CANCELLED or
29277 * %G_IO_ERROR_TIMED_OUT).
29279 * See also g_socket_condition_timed_wait().
29281 * Returns: %TRUE if the condition was met, %FALSE otherwise
29287 * g_socket_connect:
29288 * @socket: a #GSocket.
29289 * @address: a #GSocketAddress specifying the remote address.
29290 * @cancellable: (allow-none): a %GCancellable or %NULL
29291 * @error: #GError for error reporting, or %NULL to ignore.
29293 * Connect the socket to the specified remote address.
29295 * For connection oriented socket this generally means we attempt to make
29296 * a connection to the @address. For a connection-less socket it sets
29297 * the default address for g_socket_send() and discards all incoming datagrams
29298 * from other sources.
29300 * Generally connection oriented sockets can only connect once, but
29301 * connection-less sockets can connect multiple times to change the
29304 * If the connect call needs to do network I/O it will block, unless
29305 * non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
29306 * and the user can be notified of the connection finishing by waiting
29307 * for the G_IO_OUT condition. The result of the connection must then be
29308 * checked with g_socket_check_connect_result().
29310 * Returns: %TRUE if connected, %FALSE on error.
29316 * g_socket_connectable_enumerate:
29317 * @connectable: a #GSocketConnectable
29319 * Creates a #GSocketAddressEnumerator for @connectable.
29321 * Returns: (transfer full): a new #GSocketAddressEnumerator.
29327 * g_socket_connectable_proxy_enumerate:
29328 * @connectable: a #GSocketConnectable
29330 * Creates a #GSocketAddressEnumerator for @connectable that will
29331 * return #GProxyAddress<!-- -->es for addresses that you must connect
29334 * If @connectable does not implement
29335 * g_socket_connectable_proxy_enumerate(), this will fall back to
29336 * calling g_socket_connectable_enumerate().
29338 * Returns: (transfer full): a new #GSocketAddressEnumerator.
29344 * g_socket_connection_connect:
29345 * @connection: a #GSocketConnection
29346 * @address: a #GSocketAddress specifying the remote address.
29347 * @cancellable: (allow-none): a %GCancellable or %NULL
29348 * @error: #GError for error reporting, or %NULL to ignore.
29350 * Connect @connection to the specified remote address.
29352 * Returns: %TRUE if the connection succeeded, %FALSE on error
29358 * g_socket_connection_connect_async:
29359 * @connection: a #GSocketConnection
29360 * @address: a #GSocketAddress specifying the remote address.
29361 * @cancellable: (allow-none): a %GCancellable or %NULL
29362 * @callback: (scope async): a #GAsyncReadyCallback
29363 * @user_data: (closure): user data for the callback
29365 * Asynchronously connect @connection to the specified remote address.
29367 * This clears the #GSocket:blocking flag on @connection's underlying
29368 * socket if it is currently set.
29370 * Use g_socket_connection_connect_finish() to retrieve the result.
29377 * g_socket_connection_connect_finish:
29378 * @connection: a #GSocketConnection
29379 * @result: the #GAsyncResult
29380 * @error: #GError for error reporting, or %NULL to ignore.
29382 * Gets the result of a g_socket_connection_connect_async() call.
29384 * Returns: %TRUE if the connection succeeded, %FALSE on error
29390 * g_socket_connection_factory_create_connection:
29391 * @socket: a #GSocket
29393 * Creates a #GSocketConnection subclass of the right type for
29396 * Returns: (transfer full): a #GSocketConnection
29402 * g_socket_connection_factory_lookup_type:
29403 * @family: a #GSocketFamily
29404 * @type: a #GSocketType
29405 * @protocol_id: a protocol id
29407 * Looks up the #GType to be used when creating socket connections on
29408 * sockets with the specified @family, @type and @protocol_id.
29410 * If no type is registered, the #GSocketConnection base type is returned.
29412 * Returns: a #GType
29418 * g_socket_connection_factory_register_type:
29419 * @g_type: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
29420 * @family: a #GSocketFamily
29421 * @type: a #GSocketType
29422 * @protocol: a protocol id
29424 * Looks up the #GType to be used when creating socket connections on
29425 * sockets with the specified @family, @type and @protocol.
29427 * If no type is registered, the #GSocketConnection base type is returned.
29434 * g_socket_connection_get_local_address:
29435 * @connection: a #GSocketConnection
29436 * @error: #GError for error reporting, or %NULL to ignore.
29438 * Try to get the local address of a socket connection.
29440 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29446 * g_socket_connection_get_remote_address:
29447 * @connection: a #GSocketConnection
29448 * @error: #GError for error reporting, or %NULL to ignore.
29450 * Try to get the remote address of a socket connection.
29452 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29458 * g_socket_connection_get_socket:
29459 * @connection: a #GSocketConnection
29461 * Gets the underlying #GSocket object of the connection.
29462 * This can be useful if you want to do something unusual on it
29463 * not supported by the #GSocketConnection APIs.
29465 * Returns: (transfer none): a #GSocketAddress or %NULL on error.
29471 * g_socket_connection_is_connected:
29472 * @connection: a #GSocketConnection
29474 * Checks if @connection is connected. This is equivalent to calling
29475 * g_socket_is_connected() on @connection's underlying #GSocket.
29477 * Returns: whether @connection is connected
29483 * g_socket_control_message_deserialize:
29484 * @level: a socket level
29485 * @type: a socket control message type for the given @level
29486 * @size: the size of the data in bytes
29487 * @data: (array length=size) (element-type guint8): pointer to the message data
29489 * Tries to deserialize a socket control message of a given
29490 * @level and @type. This will ask all known (to GType) subclasses
29491 * of #GSocketControlMessage if they can understand this kind
29492 * of message and if so deserialize it into a #GSocketControlMessage.
29494 * If there is no implementation for this kind of control message, %NULL
29495 * will be returned.
29497 * Returns: (transfer full): the deserialized message or %NULL
29503 * g_socket_control_message_get_level:
29504 * @message: a #GSocketControlMessage
29506 * Returns the "level" (i.e. the originating protocol) of the control message.
29507 * This is often SOL_SOCKET.
29509 * Returns: an integer describing the level
29515 * g_socket_control_message_get_msg_type:
29516 * @message: a #GSocketControlMessage
29518 * Returns the protocol specific type of the control message.
29519 * For instance, for UNIX fd passing this would be SCM_RIGHTS.
29521 * Returns: an integer describing the type of control message
29527 * g_socket_control_message_get_size:
29528 * @message: a #GSocketControlMessage
29530 * Returns the space required for the control message, not including
29531 * headers or alignment.
29533 * Returns: The number of bytes required.
29539 * g_socket_control_message_serialize:
29540 * @message: a #GSocketControlMessage
29541 * @data: A buffer to write data to
29543 * Converts the data in the message to bytes placed in the
29546 * @data is guaranteed to have enough space to fit the size
29547 * returned by g_socket_control_message_get_size() on this
29555 * g_socket_create_source: (skip)
29556 * @socket: a #GSocket
29557 * @condition: a #GIOCondition mask to monitor
29558 * @cancellable: (allow-none): a %GCancellable or %NULL
29560 * Creates a %GSource that can be attached to a %GMainContext to monitor
29561 * for the availibility of the specified @condition on the socket.
29563 * The callback on the source is of the #GSocketSourceFunc type.
29565 * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
29566 * these conditions will always be reported output if they are true.
29568 * @cancellable if not %NULL can be used to cancel the source, which will
29569 * cause the source to trigger, reporting the current condition (which
29570 * is likely 0 unless cancellation happened at the same time as a
29571 * condition change). You can check for this in the callback using
29572 * g_cancellable_is_cancelled().
29574 * If @socket has a timeout set, and it is reached before @condition
29575 * occurs, the source will then trigger anyway, reporting %G_IO_IN or
29576 * %G_IO_OUT depending on @condition. However, @socket will have been
29577 * marked as having had a timeout, and so the next #GSocket I/O method
29578 * you call will then fail with a %G_IO_ERROR_TIMED_OUT.
29580 * Returns: (transfer full): a newly allocated %GSource, free with g_source_unref().
29586 * g_socket_get_available_bytes:
29587 * @socket: a #GSocket
29589 * Get the amount of data pending in the OS input buffer.
29591 * Returns: the number of bytes that can be read from the socket without blocking or -1 on error.
29597 * g_socket_get_blocking:
29598 * @socket: a #GSocket.
29600 * Gets the blocking mode of the socket. For details on blocking I/O,
29601 * see g_socket_set_blocking().
29603 * Returns: %TRUE if blocking I/O is used, %FALSE otherwise.
29609 * g_socket_get_broadcast:
29610 * @socket: a #GSocket.
29612 * Gets the broadcast setting on @socket; if %TRUE,
29613 * it is possible to send packets to broadcast
29614 * addresses or receive from broadcast addresses.
29616 * Returns: the broadcast setting on @socket
29622 * g_socket_get_credentials:
29623 * @socket: a #GSocket.
29624 * @error: #GError for error reporting, or %NULL to ignore.
29626 * Returns the credentials of the foreign process connected to this
29627 * socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
29630 * If this operation isn't supported on the OS, the method fails with
29631 * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
29632 * by reading the %SO_PEERCRED option on the underlying socket.
29634 * Other ways to obtain credentials from a foreign peer includes the
29635 * #GUnixCredentialsMessage type and
29636 * g_unix_connection_send_credentials() /
29637 * g_unix_connection_receive_credentials() functions.
29639 * Returns: (transfer full): %NULL if @error is set, otherwise a #GCredentials object that must be freed with g_object_unref().
29645 * g_socket_get_family:
29646 * @socket: a #GSocket.
29648 * Gets the socket family of the socket.
29650 * Returns: a #GSocketFamily
29657 * @socket: a #GSocket.
29659 * Returns the underlying OS socket object. On unix this
29660 * is a socket file descriptor, and on Windows this is
29661 * a Winsock2 SOCKET handle. This may be useful for
29662 * doing platform specific or otherwise unusual operations
29665 * Returns: the file descriptor of the socket.
29671 * g_socket_get_keepalive:
29672 * @socket: a #GSocket.
29674 * Gets the keepalive mode of the socket. For details on this,
29675 * see g_socket_set_keepalive().
29677 * Returns: %TRUE if keepalive is active, %FALSE otherwise.
29683 * g_socket_get_listen_backlog:
29684 * @socket: a #GSocket.
29686 * Gets the listen backlog setting of the socket. For details on this,
29687 * see g_socket_set_listen_backlog().
29689 * Returns: the maximum number of pending connections.
29695 * g_socket_get_local_address:
29696 * @socket: a #GSocket.
29697 * @error: #GError for error reporting, or %NULL to ignore.
29699 * Try to get the local address of a bound socket. This is only
29700 * useful if the socket has been bound to a local address,
29701 * either explicitly or implicitly when connecting.
29703 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29709 * g_socket_get_multicast_loopback:
29710 * @socket: a #GSocket.
29712 * Gets the multicast loopback setting on @socket; if %TRUE (the
29713 * default), outgoing multicast packets will be looped back to
29714 * multicast listeners on the same host.
29716 * Returns: the multicast loopback setting on @socket
29722 * g_socket_get_multicast_ttl:
29723 * @socket: a #GSocket.
29725 * Gets the multicast time-to-live setting on @socket; see
29726 * g_socket_set_multicast_ttl() for more details.
29728 * Returns: the multicast time-to-live setting on @socket
29734 * g_socket_get_protocol:
29735 * @socket: a #GSocket.
29737 * Gets the socket protocol id the socket was created with.
29738 * In case the protocol is unknown, -1 is returned.
29740 * Returns: a protocol id, or -1 if unknown
29746 * g_socket_get_remote_address:
29747 * @socket: a #GSocket.
29748 * @error: #GError for error reporting, or %NULL to ignore.
29750 * Try to get the remove address of a connected socket. This is only
29751 * useful for connection oriented sockets that have been connected.
29753 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29759 * g_socket_get_socket_type:
29760 * @socket: a #GSocket.
29762 * Gets the socket type of the socket.
29764 * Returns: a #GSocketType
29770 * g_socket_get_timeout:
29771 * @socket: a #GSocket.
29773 * Gets the timeout setting of the socket. For details on this, see
29774 * g_socket_set_timeout().
29776 * Returns: the timeout in seconds
29782 * g_socket_get_ttl:
29783 * @socket: a #GSocket.
29785 * Gets the unicast time-to-live setting on @socket; see
29786 * g_socket_set_ttl() for more details.
29788 * Returns: the time-to-live setting on @socket
29794 * g_socket_is_closed:
29795 * @socket: a #GSocket
29797 * Checks whether a socket is closed.
29799 * Returns: %TRUE if socket is closed, %FALSE otherwise
29805 * g_socket_is_connected:
29806 * @socket: a #GSocket.
29808 * Check whether the socket is connected. This is only useful for
29809 * connection-oriented sockets.
29811 * Returns: %TRUE if socket is connected, %FALSE otherwise.
29817 * g_socket_join_multicast_group:
29818 * @socket: a #GSocket.
29819 * @group: a #GInetAddress specifying the group address to join.
29820 * @iface: (allow-none): Name of the interface to use, or %NULL
29821 * @source_specific: %TRUE if source-specific multicast should be used
29822 * @error: #GError for error reporting, or %NULL to ignore.
29824 * Registers @socket to receive multicast messages sent to @group.
29825 * @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
29826 * been bound to an appropriate interface and port with
29829 * If @iface is %NULL, the system will automatically pick an interface
29830 * to bind to based on @group.
29832 * If @source_specific is %TRUE, source-specific multicast as defined
29833 * in RFC 4604 is used. Note that on older platforms this may fail
29834 * with a %G_IO_ERROR_NOT_SUPPORTED error.
29836 * Returns: %TRUE on success, %FALSE on error.
29842 * g_socket_leave_multicast_group:
29843 * @socket: a #GSocket.
29844 * @group: a #GInetAddress specifying the group address to leave.
29845 * @iface: (allow-none): Interface used
29846 * @source_specific: %TRUE if source-specific multicast was used
29847 * @error: #GError for error reporting, or %NULL to ignore.
29849 * Removes @socket from the multicast group defined by @group, @iface,
29850 * and @source_specific (which must all have the same values they had
29851 * when you joined the group).
29853 * @socket remains bound to its address and port, and can still receive
29854 * unicast messages after calling this.
29856 * Returns: %TRUE on success, %FALSE on error.
29863 * @socket: a #GSocket.
29864 * @error: #GError for error reporting, or %NULL to ignore.
29866 * Marks the socket as a server socket, i.e. a socket that is used
29867 * to accept incoming requests using g_socket_accept().
29869 * Before calling this the socket must be bound to a local address using
29872 * To set the maximum amount of outstanding clients, use
29873 * g_socket_set_listen_backlog().
29875 * Returns: %TRUE on success, %FALSE on error.
29881 * g_socket_listener_accept:
29882 * @listener: a #GSocketListener
29883 * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL
29884 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29885 * @error: #GError for error reporting, or %NULL to ignore.
29887 * Blocks waiting for a client to connect to any of the sockets added
29888 * to the listener. Returns a #GSocketConnection for the socket that was
29891 * If @source_object is not %NULL it will be filled out with the source
29892 * object specified when the corresponding socket or address was added
29895 * If @cancellable is not %NULL, then the operation can be cancelled by
29896 * triggering the cancellable object from another thread. If the operation
29897 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29899 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29905 * g_socket_listener_accept_async:
29906 * @listener: a #GSocketListener
29907 * @cancellable: (allow-none): a #GCancellable, or %NULL
29908 * @callback: (scope async): a #GAsyncReadyCallback
29909 * @user_data: (closure): user data for the callback
29911 * This is the asynchronous version of g_socket_listener_accept().
29913 * When the operation is finished @callback will be
29914 * called. You can then call g_socket_listener_accept_socket()
29915 * to get the result of the operation.
29922 * g_socket_listener_accept_finish:
29923 * @listener: a #GSocketListener
29924 * @result: a #GAsyncResult.
29925 * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29926 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29928 * Finishes an async accept operation. See g_socket_listener_accept_async()
29930 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29936 * g_socket_listener_accept_socket:
29937 * @listener: a #GSocketListener
29938 * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL.
29939 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29940 * @error: #GError for error reporting, or %NULL to ignore.
29942 * Blocks waiting for a client to connect to any of the sockets added
29943 * to the listener. Returns the #GSocket that was accepted.
29945 * If you want to accept the high-level #GSocketConnection, not a #GSocket,
29946 * which is often the case, then you should use g_socket_listener_accept()
29949 * If @source_object is not %NULL it will be filled out with the source
29950 * object specified when the corresponding socket or address was added
29953 * If @cancellable is not %NULL, then the operation can be cancelled by
29954 * triggering the cancellable object from another thread. If the operation
29955 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29957 * Returns: (transfer full): a #GSocket on success, %NULL on error.
29963 * g_socket_listener_accept_socket_async:
29964 * @listener: a #GSocketListener
29965 * @cancellable: (allow-none): a #GCancellable, or %NULL
29966 * @callback: (scope async): a #GAsyncReadyCallback
29967 * @user_data: (closure): user data for the callback
29969 * This is the asynchronous version of g_socket_listener_accept_socket().
29971 * When the operation is finished @callback will be
29972 * called. You can then call g_socket_listener_accept_socket_finish()
29973 * to get the result of the operation.
29980 * g_socket_listener_accept_socket_finish:
29981 * @listener: a #GSocketListener
29982 * @result: a #GAsyncResult.
29983 * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29984 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29986 * Finishes an async accept operation. See g_socket_listener_accept_socket_async()
29988 * Returns: (transfer full): a #GSocket on success, %NULL on error.
29994 * g_socket_listener_add_address:
29995 * @listener: a #GSocketListener
29996 * @address: a #GSocketAddress
29997 * @type: a #GSocketType
29998 * @protocol: a #GSocketProtocol
29999 * @source_object: (allow-none): Optional #GObject identifying this source
30000 * @effective_address: (out) (allow-none): location to store the address that was bound to, or %NULL.
30001 * @error: #GError for error reporting, or %NULL to ignore.
30003 * Creates a socket of type @type and protocol @protocol, binds
30004 * it to @address and adds it to the set of sockets we're accepting
30007 * Note that adding an IPv6 address, depending on the platform,
30008 * may or may not result in a listener that also accepts IPv4
30009 * connections. For more deterministic behavior, see
30010 * g_socket_listener_add_inet_port().
30012 * @source_object will be passed out in the various calls
30013 * to accept to identify this particular source, which is
30014 * useful if you're listening on multiple addresses and do
30015 * different things depending on what address is connected to.
30017 * If successful and @effective_address is non-%NULL then it will
30018 * be set to the address that the binding actually occurred at. This
30019 * is helpful for determining the port number that was used for when
30020 * requesting a binding to port 0 (ie: "any port"). This address, if
30021 * requested, belongs to the caller and must be freed.
30023 * Returns: %TRUE on success, %FALSE on error.
30029 * g_socket_listener_add_any_inet_port:
30030 * @listener: a #GSocketListener
30031 * @source_object: (allow-none): Optional #GObject identifying this source
30032 * @error: a #GError location to store the error occurring, or %NULL to ignore.
30034 * Listens for TCP connections on any available port number for both
30035 * IPv6 and IPv4 (if each is available).
30037 * This is useful if you need to have a socket for incoming connections
30038 * but don't care about the specific port number.
30040 * @source_object will be passed out in the various calls
30041 * to accept to identify this particular source, which is
30042 * useful if you're listening on multiple addresses and do
30043 * different things depending on what address is connected to.
30045 * Returns: the port number, or 0 in case of failure.
30051 * g_socket_listener_add_inet_port:
30052 * @listener: a #GSocketListener
30053 * @port: an IP port number (non-zero)
30054 * @source_object: (allow-none): Optional #GObject identifying this source
30055 * @error: #GError for error reporting, or %NULL to ignore.
30057 * Helper function for g_socket_listener_add_address() that
30058 * creates a TCP/IP socket listening on IPv4 and IPv6 (if
30059 * supported) on the specified port on all interfaces.
30061 * @source_object will be passed out in the various calls
30062 * to accept to identify this particular source, which is
30063 * useful if you're listening on multiple addresses and do
30064 * different things depending on what address is connected to.
30066 * Returns: %TRUE on success, %FALSE on error.
30072 * g_socket_listener_add_socket:
30073 * @listener: a #GSocketListener
30074 * @socket: a listening #GSocket
30075 * @source_object: (allow-none): Optional #GObject identifying this source
30076 * @error: #GError for error reporting, or %NULL to ignore.
30078 * Adds @socket to the set of sockets that we try to accept
30079 * new clients from. The socket must be bound to a local
30080 * address and listened to.
30082 * @source_object will be passed out in the various calls
30083 * to accept to identify this particular source, which is
30084 * useful if you're listening on multiple addresses and do
30085 * different things depending on what address is connected to.
30087 * Returns: %TRUE on success, %FALSE on error.
30093 * g_socket_listener_close:
30094 * @listener: a #GSocketListener
30096 * Closes all the sockets in the listener.
30103 * g_socket_listener_new:
30105 * Creates a new #GSocketListener with no sockets to listen for.
30106 * New listeners can be added with e.g. g_socket_listener_add_address()
30107 * or g_socket_listener_add_inet_port().
30109 * Returns: a new #GSocketListener.
30115 * g_socket_listener_set_backlog:
30116 * @listener: a #GSocketListener
30117 * @listen_backlog: an integer
30119 * Sets the listen backlog on the sockets in the listener.
30121 * See g_socket_set_listen_backlog() for details
30129 * @family: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
30130 * @type: the socket type to use.
30131 * @protocol: the id of the protocol to use, or 0 for default.
30132 * @error: #GError for error reporting, or %NULL to ignore.
30134 * Creates a new #GSocket with the defined family, type and protocol.
30135 * If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
30136 * for the family and type is used.
30138 * The @protocol is a family and type specific int that specifies what
30139 * kind of protocol to use. #GSocketProtocol lists several common ones.
30140 * Many families only support one protocol, and use 0 for this, others
30141 * support several and using 0 means to use the default protocol for
30142 * the family and type.
30144 * The protocol id is passed directly to the operating
30145 * system, so you can use protocols not listed in #GSocketProtocol if you
30146 * know the protocol number used for it.
30148 * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
30154 * g_socket_new_from_fd:
30155 * @fd: a native socket file descriptor.
30156 * @error: #GError for error reporting, or %NULL to ignore.
30158 * Creates a new #GSocket from a native file descriptor
30159 * or winsock SOCKET handle.
30161 * This reads all the settings from the file descriptor so that
30162 * all properties should work. Note that the file descriptor
30163 * will be set to non-blocking mode, independent on the blocking
30164 * mode of the #GSocket.
30166 * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
30172 * g_socket_receive:
30173 * @socket: a #GSocket
30174 * @buffer: a buffer to read data into (which should be at least @size bytes long).
30175 * @size: the number of bytes you want to read from the socket
30176 * @cancellable: (allow-none): a %GCancellable or %NULL
30177 * @error: #GError for error reporting, or %NULL to ignore.
30179 * Receive data (up to @size bytes) from a socket. This is mainly used by
30180 * connection-oriented sockets; it is identical to g_socket_receive_from()
30181 * with @address set to %NULL.
30183 * For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
30184 * g_socket_receive() will always read either 0 or 1 complete messages from
30185 * the socket. If the received message is too large to fit in @buffer, then
30186 * the data beyond @size bytes will be discarded, without any explicit
30187 * indication that this has occurred.
30189 * For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
30190 * number of bytes, up to @size. If more than @size bytes have been
30191 * received, the additional data will be returned in future calls to
30192 * g_socket_receive().
30194 * If the socket is in blocking mode the call will block until there
30195 * is some data to receive, the connection is closed, or there is an
30196 * error. If there is no data available and the socket is in
30197 * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
30198 * returned. To be notified when data is available, wait for the
30199 * %G_IO_IN condition.
30201 * On error -1 is returned and @error is set accordingly.
30203 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30209 * g_socket_receive_from:
30210 * @socket: a #GSocket
30211 * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
30212 * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
30213 * @size: the number of bytes you want to read from the socket
30214 * @cancellable: (allow-none): a %GCancellable or %NULL
30215 * @error: #GError for error reporting, or %NULL to ignore.
30217 * Receive data (up to @size bytes) from a socket.
30219 * If @address is non-%NULL then @address will be set equal to the
30220 * source address of the received packet.
30221 * @address is owned by the caller.
30223 * See g_socket_receive() for additional information.
30225 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30231 * g_socket_receive_message:
30232 * @socket: a #GSocket
30233 * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
30234 * @vectors: (array length=num_vectors): an array of #GInputVector structs
30235 * @num_vectors: the number of elements in @vectors, or -1
30236 * @messages: (array length=num_messages) (allow-none): a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
30237 * @num_messages: a pointer which will be filled with the number of elements in @messages, or %NULL
30238 * @flags: a pointer to an int containing #GSocketMsgFlags flags
30239 * @cancellable: (allow-none): a %GCancellable or %NULL
30240 * @error: a #GError pointer, or %NULL
30242 * Receive data from a socket. This is the most complicated and
30243 * fully-featured version of this call. For easier use, see
30244 * g_socket_receive() and g_socket_receive_from().
30246 * If @address is non-%NULL then @address will be set equal to the
30247 * source address of the received packet.
30248 * @address is owned by the caller.
30250 * @vector must point to an array of #GInputVector structs and
30251 * @num_vectors must be the length of this array. These structs
30252 * describe the buffers that received data will be scattered into.
30253 * If @num_vectors is -1, then @vectors is assumed to be terminated
30254 * by a #GInputVector with a %NULL buffer pointer.
30256 * As a special case, if @num_vectors is 0 (in which case, @vectors
30257 * may of course be %NULL), then a single byte is received and
30258 * discarded. This is to facilitate the common practice of sending a
30259 * single '\0' byte for the purposes of transferring ancillary data.
30261 * @messages, if non-%NULL, will be set to point to a newly-allocated
30262 * array of #GSocketControlMessage instances or %NULL if no such
30263 * messages was received. These correspond to the control messages
30264 * received from the kernel, one #GSocketControlMessage per message
30265 * from the kernel. This array is %NULL-terminated and must be freed
30266 * by the caller using g_free() after calling g_object_unref() on each
30267 * element. If @messages is %NULL, any control messages received will
30270 * @num_messages, if non-%NULL, will be set to the number of control
30271 * messages received.
30273 * If both @messages and @num_messages are non-%NULL, then
30274 * @num_messages gives the number of #GSocketControlMessage instances
30275 * in @messages (ie: not including the %NULL terminator).
30277 * @flags is an in/out parameter. The commonly available arguments
30278 * for this are available in the #GSocketMsgFlags enum, but the
30279 * values there are the same as the system values, and the flags
30280 * are passed in as-is, so you can pass in system-specific flags too
30281 * (and g_socket_receive_message() may pass system-specific flags out).
30283 * As with g_socket_receive(), data may be discarded if @socket is
30284 * %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
30285 * provide enough buffer space to read a complete message. You can pass
30286 * %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
30287 * removing it from the receive queue, but there is no portable way to find
30288 * out the length of the message other than by reading it into a
30289 * sufficiently-large buffer.
30291 * If the socket is in blocking mode the call will block until there
30292 * is some data to receive, the connection is closed, or there is an
30293 * error. If there is no data available and the socket is in
30294 * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
30295 * returned. To be notified when data is available, wait for the
30296 * %G_IO_IN condition.
30298 * On error -1 is returned and @error is set accordingly.
30300 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30306 * g_socket_receive_with_blocking:
30307 * @socket: a #GSocket
30308 * @buffer: a buffer to read data into (which should be at least @size bytes long).
30309 * @size: the number of bytes you want to read from the socket
30310 * @blocking: whether to do blocking or non-blocking I/O
30311 * @cancellable: (allow-none): a %GCancellable or %NULL
30312 * @error: #GError for error reporting, or %NULL to ignore.
30314 * This behaves exactly the same as g_socket_receive(), except that
30315 * the choice of blocking or non-blocking behavior is determined by
30316 * the @blocking argument rather than by @socket's properties.
30318 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30325 * @socket: a #GSocket
30326 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
30327 * @size: the number of bytes to send
30328 * @cancellable: (allow-none): a %GCancellable or %NULL
30329 * @error: #GError for error reporting, or %NULL to ignore.
30331 * Tries to send @size bytes from @buffer on the socket. This is
30332 * mainly used by connection-oriented sockets; it is identical to
30333 * g_socket_send_to() with @address set to %NULL.
30335 * If the socket is in blocking mode the call will block until there is
30336 * space for the data in the socket queue. If there is no space available
30337 * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
30338 * will be returned. To be notified when space is available, wait for the
30339 * %G_IO_OUT condition. Note though that you may still receive
30340 * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
30341 * notified of a %G_IO_OUT condition. (On Windows in particular, this is
30342 * very common due to the way the underlying APIs work.)
30344 * On error -1 is returned and @error is set accordingly.
30346 * Returns: Number of bytes written (which may be less than @size), or -1 on error
30352 * g_socket_send_message:
30353 * @socket: a #GSocket
30354 * @address: (allow-none): a #GSocketAddress, or %NULL
30355 * @vectors: (array length=num_vectors): an array of #GOutputVector structs
30356 * @num_vectors: the number of elements in @vectors, or -1
30357 * @messages: (array length=num_messages) (allow-none): a pointer to an array of #GSocketControlMessages, or %NULL.
30358 * @num_messages: number of elements in @messages, or -1.
30359 * @flags: an int containing #GSocketMsgFlags flags
30360 * @cancellable: (allow-none): a %GCancellable or %NULL
30361 * @error: #GError for error reporting, or %NULL to ignore.
30363 * Send data to @address on @socket. This is the most complicated and
30364 * fully-featured version of this call. For easier use, see
30365 * g_socket_send() and g_socket_send_to().
30367 * If @address is %NULL then the message is sent to the default receiver
30368 * (set by g_socket_connect()).
30370 * @vectors must point to an array of #GOutputVector structs and
30371 * @num_vectors must be the length of this array. (If @num_vectors is -1,
30372 * then @vectors is assumed to be terminated by a #GOutputVector with a
30373 * %NULL buffer pointer.) The #GOutputVector structs describe the buffers
30374 * that the sent data will be gathered from. Using multiple
30375 * #GOutputVector<!-- -->s is more memory-efficient than manually copying
30376 * data from multiple sources into a single buffer, and more
30377 * network-efficient than making multiple calls to g_socket_send().
30379 * @messages, if non-%NULL, is taken to point to an array of @num_messages
30380 * #GSocketControlMessage instances. These correspond to the control
30381 * messages to be sent on the socket.
30382 * If @num_messages is -1 then @messages is treated as a %NULL-terminated
30385 * @flags modify how the message is sent. The commonly available arguments
30386 * for this are available in the #GSocketMsgFlags enum, but the
30387 * values there are the same as the system values, and the flags
30388 * are passed in as-is, so you can pass in system-specific flags too.
30390 * If the socket is in blocking mode the call will block until there is
30391 * space for the data in the socket queue. If there is no space available
30392 * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
30393 * will be returned. To be notified when space is available, wait for the
30394 * %G_IO_OUT condition. Note though that you may still receive
30395 * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
30396 * notified of a %G_IO_OUT condition. (On Windows in particular, this is
30397 * very common due to the way the underlying APIs work.)
30399 * On error -1 is returned and @error is set accordingly.
30401 * Returns: Number of bytes written (which may be less than @size), or -1 on error
30407 * g_socket_send_to:
30408 * @socket: a #GSocket
30409 * @address: (allow-none): a #GSocketAddress, or %NULL
30410 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
30411 * @size: the number of bytes to send
30412 * @cancellable: (allow-none): a %GCancellable or %NULL
30413 * @error: #GError for error reporting, or %NULL to ignore.
30415 * Tries to send @size bytes from @buffer to @address. If @address is
30416 * %NULL then the message is sent to the default receiver (set by
30417 * g_socket_connect()).
30419 * See g_socket_send() for additional information.
30421 * Returns: Number of bytes written (which may be less than @size), or -1 on error
30427 * g_socket_send_with_blocking:
30428 * @socket: a #GSocket
30429 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
30430 * @size: the number of bytes to send
30431 * @blocking: whether to do blocking or non-blocking I/O
30432 * @cancellable: (allow-none): a %GCancellable or %NULL
30433 * @error: #GError for error reporting, or %NULL to ignore.
30435 * This behaves exactly the same as g_socket_send(), except that
30436 * the choice of blocking or non-blocking behavior is determined by
30437 * the @blocking argument rather than by @socket's properties.
30439 * Returns: Number of bytes written (which may be less than @size), or -1 on error
30445 * g_socket_service_is_active:
30446 * @service: a #GSocketService
30448 * Check whether the service is active or not. An active
30449 * service will accept new clients that connect, while
30450 * a non-active service will let connecting clients queue
30451 * up until the service is started.
30453 * Returns: %TRUE if the service is active, %FALSE otherwise
30459 * g_socket_service_new:
30461 * Creates a new #GSocketService with no sockets to listen for.
30462 * New listeners can be added with e.g. g_socket_listener_add_address()
30463 * or g_socket_listener_add_inet_port().
30465 * Returns: a new #GSocketService.
30471 * g_socket_service_start:
30472 * @service: a #GSocketService
30474 * Starts the service, i.e. start accepting connections
30475 * from the added sockets when the mainloop runs.
30477 * This call is thread-safe, so it may be called from a thread
30478 * handling an incoming client request.
30485 * g_socket_service_stop:
30486 * @service: a #GSocketService
30488 * Stops the service, i.e. stops accepting connections
30489 * from the added sockets when the mainloop runs.
30491 * This call is thread-safe, so it may be called from a thread
30492 * handling an incoming client request.
30499 * g_socket_set_blocking:
30500 * @socket: a #GSocket.
30501 * @blocking: Whether to use blocking I/O or not.
30503 * Sets the blocking mode of the socket. In blocking mode
30504 * all operations block until they succeed or there is an error. In
30505 * non-blocking mode all functions return results immediately or
30506 * with a %G_IO_ERROR_WOULD_BLOCK error.
30508 * All sockets are created in blocking mode. However, note that the
30509 * platform level socket is always non-blocking, and blocking mode
30510 * is a GSocket level feature.
30517 * g_socket_set_broadcast:
30518 * @socket: a #GSocket.
30519 * @broadcast: whether @socket should allow sending to and receiving from broadcast addresses
30521 * Sets whether @socket should allow sending to and receiving from
30522 * broadcast addresses. This is %FALSE by default.
30529 * g_socket_set_keepalive:
30530 * @socket: a #GSocket.
30531 * @keepalive: Value for the keepalive flag
30533 * Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
30534 * this flag is set on a socket, the system will attempt to verify that the
30535 * remote socket endpoint is still present if a sufficiently long period of
30536 * time passes with no data being exchanged. If the system is unable to
30537 * verify the presence of the remote endpoint, it will automatically close
30540 * This option is only functional on certain kinds of sockets. (Notably,
30541 * %G_SOCKET_PROTOCOL_TCP sockets.)
30543 * The exact time between pings is system- and protocol-dependent, but will
30544 * normally be at least two hours. Most commonly, you would set this flag
30545 * on a server socket if you want to allow clients to remain idle for long
30546 * periods of time, but also want to ensure that connections are eventually
30547 * garbage-collected if clients crash or become unreachable.
30554 * g_socket_set_listen_backlog:
30555 * @socket: a #GSocket.
30556 * @backlog: the maximum number of pending connections.
30558 * Sets the maximum number of outstanding connections allowed
30559 * when listening on this socket. If more clients than this are
30560 * connecting to the socket and the application is not handling them
30561 * on time then the new connections will be refused.
30563 * Note that this must be called before g_socket_listen() and has no
30564 * effect if called after that.
30571 * g_socket_set_multicast_loopback:
30572 * @socket: a #GSocket.
30573 * @loopback: whether @socket should receive messages sent to its multicast groups from the local host
30575 * Sets whether outgoing multicast packets will be received by sockets
30576 * listening on that multicast address on the same host. This is %TRUE
30584 * g_socket_set_multicast_ttl:
30585 * @socket: a #GSocket.
30586 * @ttl: the time-to-live value for all multicast datagrams on @socket
30588 * Sets the time-to-live for outgoing multicast datagrams on @socket.
30589 * By default, this is 1, meaning that multicast packets will not leave
30590 * the local network.
30597 * g_socket_set_timeout:
30598 * @socket: a #GSocket.
30599 * @timeout: the timeout for @socket, in seconds, or 0 for none
30601 * Sets the time in seconds after which I/O operations on @socket will
30602 * time out if they have not yet completed.
30604 * On a blocking socket, this means that any blocking #GSocket
30605 * operation will time out after @timeout seconds of inactivity,
30606 * returning %G_IO_ERROR_TIMED_OUT.
30608 * On a non-blocking socket, calls to g_socket_condition_wait() will
30609 * also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
30610 * created with g_socket_create_source() will trigger after
30611 * @timeout seconds of inactivity, with the requested condition
30612 * set, at which point calling g_socket_receive(), g_socket_send(),
30613 * g_socket_check_connect_result(), etc, will fail with
30614 * %G_IO_ERROR_TIMED_OUT.
30616 * If @timeout is 0 (the default), operations will never time out
30619 * Note that if an I/O operation is interrupted by a signal, this may
30620 * cause the timeout to be reset.
30627 * g_socket_set_ttl:
30628 * @socket: a #GSocket.
30629 * @ttl: the time-to-live value for all unicast packets on @socket
30631 * Sets the time-to-live for outgoing unicast packets on @socket.
30632 * By default the platform-specific default value is used.
30639 * g_socket_shutdown:
30640 * @socket: a #GSocket
30641 * @shutdown_read: whether to shut down the read side
30642 * @shutdown_write: whether to shut down the write side
30643 * @error: #GError for error reporting, or %NULL to ignore.
30645 * Shut down part of a full-duplex connection.
30647 * If @shutdown_read is %TRUE then the receiving side of the connection
30648 * is shut down, and further reading is disallowed.
30650 * If @shutdown_write is %TRUE then the sending side of the connection
30651 * is shut down, and further writing is disallowed.
30653 * It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
30655 * One example where this is used is graceful disconnect for TCP connections
30656 * where you close the sending side, then wait for the other side to close
30657 * the connection, thus ensuring that the other side saw all sent data.
30659 * Returns: %TRUE on success, %FALSE on error
30665 * g_socket_speaks_ipv4:
30666 * @socket: a #GSocket
30668 * Checks if a socket is capable of speaking IPv4.
30670 * IPv4 sockets are capable of speaking IPv4. On some operating systems
30671 * and under some combinations of circumstances IPv6 sockets are also
30672 * capable of speaking IPv4. See RFC 3493 section 3.7 for more
30675 * No other types of sockets are currently considered as being capable
30676 * of speaking IPv4.
30678 * Returns: %TRUE if this socket can be used with IPv4.
30684 * g_srv_target_copy:
30685 * @target: a #GSrvTarget
30689 * Returns: a copy of @target
30695 * g_srv_target_free:
30696 * @target: a #GSrvTarget
30705 * g_srv_target_get_hostname:
30706 * @target: a #GSrvTarget
30708 * Gets @target's hostname (in ASCII form; if you are going to present
30709 * this to the user, you should use g_hostname_is_ascii_encoded() to
30710 * check if it contains encoded Unicode segments, and use
30711 * g_hostname_to_unicode() to convert it if it does.)
30713 * Returns: @target's hostname
30719 * g_srv_target_get_port:
30720 * @target: a #GSrvTarget
30722 * Gets @target's port
30724 * Returns: @target's port
30730 * g_srv_target_get_priority:
30731 * @target: a #GSrvTarget
30733 * Gets @target's priority. You should not need to look at this;
30734 * #GResolver already sorts the targets according to the algorithm in
30737 * Returns: @target's priority
30743 * g_srv_target_get_weight:
30744 * @target: a #GSrvTarget
30746 * Gets @target's weight. You should not need to look at this;
30747 * #GResolver already sorts the targets according to the algorithm in
30750 * Returns: @target's weight
30756 * g_srv_target_list_sort: (skip)
30757 * @targets: a #GList of #GSrvTarget
30759 * Sorts @targets in place according to the algorithm in RFC 2782.
30761 * Returns: (transfer full): the head of the sorted list.
30767 * g_srv_target_new:
30768 * @hostname: the host that the service is running on
30769 * @port: the port that the service is running on
30770 * @priority: the target's priority
30771 * @weight: the target's weight
30773 * Creates a new #GSrvTarget with the given parameters.
30775 * You should not need to use this; normally #GSrvTarget<!-- -->s are
30776 * created by #GResolver.
30778 * Returns: a new #GSrvTarget.
30784 * g_static_resource_fini:
30785 * @static_resource: pointer to a static #GStaticResource
30787 * Finalized a GResource initialized by g_static_resource_init().
30789 * This is normally used by code generated by
30790 * <link linkend="glib-compile-resources">glib-compile-resources</link>
30791 * and is not typically used by other code.
30798 * g_static_resource_get_resource:
30799 * @static_resource: pointer to a static #GStaticResource
30801 * Gets the GResource that was registered by a call to g_static_resource_init().
30803 * This is normally used by code generated by
30804 * <link linkend="glib-compile-resources">glib-compile-resources</link>
30805 * and is not typically used by other code.
30807 * Returns: (transfer none): a #GResource
30813 * g_static_resource_init:
30814 * @static_resource: pointer to a static #GStaticResource
30816 * Initializes a GResource from static data using a
30819 * This is normally used by code generated by
30820 * <link linkend="glib-compile-resources">glib-compile-resources</link>
30821 * and is not typically used by other code.
30828 * g_task_attach_source:
30830 * @source: the source to attach
30831 * @callback: the callback to invoke when @source triggers
30833 * A utility function for dealing with async operations where you need
30834 * to wait for a #GSource to trigger. Attaches @source to @task's
30835 * #GMainContext with @task's <link
30836 * linkend="io-priority">priority</link>, and sets @source's callback
30837 * to @callback, with @task as the callback's
30838 * <literal>user_data</literal>.
30840 * This takes a reference on @task until @source is destroyed.
30847 * g_task_get_cancellable:
30850 * Gets @task's #GCancellable
30852 * Returns: (transfer none): @task's #GCancellable
30858 * g_task_get_check_cancellable:
30859 * @task: the #GTask
30861 * Gets @task's check-cancellable flag. See
30862 * g_task_set_check_cancellable() for more details.
30869 * g_task_get_context:
30872 * Gets the #GMainContext that @task will return its result in (that
30873 * is, the context that was the <link
30874 * linkend="g-main-context-push-thread-default">thread-default main
30875 * context</link> at the point when @task was created).
30877 * This will always return a non-%NULL value, even if the task's
30878 * context is the default #GMainContext.
30880 * Returns: (transfer none): @task's #GMainContext
30886 * g_task_get_priority:
30889 * Gets @task's priority
30891 * Returns: @task's priority
30897 * g_task_get_return_on_cancel:
30898 * @task: the #GTask
30900 * Gets @task's return-on-cancel flag. See
30901 * g_task_set_return_on_cancel() for more details.
30908 * g_task_get_source_object:
30911 * Gets the source object from @task. Like
30912 * g_async_result_get_source_object(), but does not ref the object.
30914 * Returns: (transfer none): @task's source object, or %NULL
30920 * g_task_get_source_tag:
30923 * Gets @task's source tag. See g_task_set_source_tag().
30925 * Returns: (transfer none): @task's source tag
30931 * g_task_get_task_data:
30934 * Gets @task's <literal>task_data</literal>.
30936 * Returns: (transfer none): @task's <literal>task_data</literal>.
30942 * g_task_had_error:
30945 * Tests if @task resulted in an error.
30947 * Returns: %TRUE if the task resulted in an error, %FALSE otherwise.
30954 * @result: (type Gio.AsyncResult): A #GAsyncResult
30955 * @source_object: (allow-none): the source object expected to be associated with the task
30957 * Checks that @result is a #GTask, and that @source_object is its
30958 * source object (or that @source_object is %NULL and @result has no
30959 * source object). This can be used in g_return_if_fail() checks.
30961 * Returns: %TRUE if @result and @source_object are valid, %FALSE if not
30968 * @source_object: (allow-none): the #GObject that owns this task, or %NULL.
30969 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
30970 * @callback: (scope async): a #GAsyncReadyCallback.
30971 * @callback_data: (closure): user data passed to @callback.
30973 * Creates a #GTask acting on @source_object, which will eventually be
30974 * used to invoke @callback in the current <link
30975 * linkend="g-main-context-push-thread-default">thread-default main
30978 * Call this in the "start" method of your asynchronous method, and
30979 * pass the #GTask around throughout the asynchronous operation. You
30980 * can use g_task_set_task_data() to attach task-specific data to the
30981 * object, which you can retrieve later via g_task_get_task_data().
30983 * By default, if @cancellable is cancelled, then the return value of
30984 * the task will always be %G_IO_ERROR_CANCELLED, even if the task had
30985 * already completed before the cancellation. This allows for
30986 * simplified handling in cases where cancellation may imply that
30987 * other objects that the task depends on have been destroyed. If you
30988 * do not want this behavior, you can use
30989 * g_task_set_check_cancellable() to change it.
30991 * Returns: a #GTask.
30997 * g_task_propagate_boolean:
30999 * @error: return location for a #GError
31001 * Gets the result of @task as a #gboolean.
31003 * If the task resulted in an error, or was cancelled, then this will
31004 * instead return %FALSE and set @error.
31006 * Since this method transfers ownership of the return value (or
31007 * error) to the caller, you may only call it once.
31009 * Returns: the task result, or %FALSE on error
31015 * g_task_propagate_int:
31017 * @error: return location for a #GError
31019 * Gets the result of @task as an integer (#gssize).
31021 * If the task resulted in an error, or was cancelled, then this will
31022 * instead return -1 and set @error.
31024 * Since this method transfers ownership of the return value (or
31025 * error) to the caller, you may only call it once.
31027 * Returns: the task result, or -1 on error
31033 * g_task_propagate_pointer:
31035 * @error: return location for a #GError
31037 * Gets the result of @task as a pointer, and transfers ownership
31038 * of that value to the caller.
31040 * If the task resulted in an error, or was cancelled, then this will
31041 * instead return %NULL and set @error.
31043 * Since this method transfers ownership of the return value (or
31044 * error) to the caller, you may only call it once.
31046 * Returns: (transfer full): the task result, or %NULL on error
31052 * g_task_report_error:
31053 * @source_object: (allow-none): the #GObject that owns this task, or %NULL.
31054 * @callback: (scope async): a #GAsyncReadyCallback.
31055 * @callback_data: (closure): user data passed to @callback.
31056 * @source_tag: an opaque pointer indicating the source of this task
31057 * @error: (transfer full): error to report
31059 * Creates a #GTask and then immediately calls g_task_return_error()
31060 * on it. Use this in the wrapper function of an asynchronous method
31061 * when you want to avoid even calling the virtual method. You can
31062 * then use g_async_result_is_tagged() in the finish method wrapper to
31063 * check if the result there is tagged as having been created by the
31064 * wrapper method, and deal with it appropriately if so.
31066 * See also g_task_report_new_error().
31073 * g_task_report_new_error:
31074 * @source_object: (allow-none): the #GObject that owns this task, or %NULL.
31075 * @callback: (scope async): a #GAsyncReadyCallback.
31076 * @callback_data: (closure): user data passed to @callback.
31077 * @source_tag: an opaque pointer indicating the source of this task
31078 * @domain: a #GQuark.
31079 * @code: an error code.
31080 * @format: a string with format characters.
31081 * @...: a list of values to insert into @format.
31083 * Creates a #GTask and then immediately calls
31084 * g_task_return_new_error() on it. Use this in the wrapper function
31085 * of an asynchronous method when you want to avoid even calling the
31086 * virtual method. You can then use g_async_result_is_tagged() in the
31087 * finish method wrapper to check if the result there is tagged as
31088 * having been created by the wrapper method, and deal with it
31089 * appropriately if so.
31091 * See also g_task_report_error().
31098 * g_task_return_boolean:
31100 * @result: the #gboolean result of a task function.
31102 * Sets @task's result to @result and completes the task (see
31103 * g_task_return_pointer() for more discussion of exactly what this
31111 * g_task_return_error:
31113 * @error: (transfer full): the #GError result of a task function.
31115 * Sets @task's result to @error (which @task assumes ownership of)
31116 * and completes the task (see g_task_return_pointer() for more
31117 * discussion of exactly what this means).
31119 * Note that since the task takes ownership of @error, and since the
31120 * task may be completed before returning from g_task_return_error(),
31121 * you cannot assume that @error is still valid after calling this.
31122 * Call g_error_copy() on the error if you need to keep a local copy
31125 * See also g_task_return_new_error().
31132 * g_task_return_error_if_cancelled:
31135 * Checks if @task's #GCancellable has been cancelled, and if so, sets
31136 * @task's error accordingly and completes the task (see
31137 * g_task_return_pointer() for more discussion of exactly what this
31140 * Returns: %TRUE if @task has been cancelled, %FALSE if not
31146 * g_task_return_int:
31148 * @result: the integer (#gssize) result of a task function.
31150 * Sets @task's result to @result and completes the task (see
31151 * g_task_return_pointer() for more discussion of exactly what this
31159 * g_task_return_new_error:
31161 * @domain: a #GQuark.
31162 * @code: an error code.
31163 * @format: a string with format characters.
31164 * @...: a list of values to insert into @format.
31166 * Sets @task's result to a new #GError created from @domain, @code,
31167 * @format, and the remaining arguments, and completes the task (see
31168 * g_task_return_pointer() for more discussion of exactly what this
31171 * See also g_task_return_error().
31178 * g_task_return_pointer:
31180 * @result: (allow-none) (transfer full): the pointer result of a task function
31181 * @result_destroy: (allow-none): a #GDestroyNotify function.
31183 * Sets @task's result to @result and completes the task. If @result
31184 * is not %NULL, then @result_destroy will be used to free @result if
31185 * the caller does not take ownership of it with
31186 * g_task_propagate_pointer().
31188 * "Completes the task" means that for an ordinary asynchronous task
31189 * it will either invoke the task's callback, or else queue that
31190 * callback to be invoked in the proper #GMainContext, or in the next
31191 * iteration of the current #GMainContext. For a task run via
31192 * g_task_run_in_thread() or g_task_run_in_thread_sync(), calling this
31193 * method will save @result to be returned to the caller later, but
31194 * the task will not actually be completed until the #GTaskThreadFunc
31197 * Note that since the task may be completed before returning from
31198 * g_task_return_pointer(), you cannot assume that @result is still
31199 * valid after calling this, unless you are still holding another
31207 * g_task_run_in_thread:
31209 * @task_func: a #GTaskThreadFunc
31211 * Runs @task_func in another thread. When @task_func returns, @task's
31212 * #GAsyncReadyCallback will be invoked in @task's #GMainContext.
31214 * This takes a ref on @task until the task completes.
31216 * See #GTaskThreadFunc for more details about how @task_func is handled.
31223 * g_task_run_in_thread_sync:
31225 * @task_func: a #GTaskThreadFunc
31227 * Runs @task_func in another thread, and waits for it to return or be
31228 * cancelled. You can use g_task_propagate_pointer(), etc, afterward
31229 * to get the result of @task_func.
31231 * See #GTaskThreadFunc for more details about how @task_func is handled.
31233 * Normally this is used with tasks created with a %NULL
31234 * <literal>callback</literal>, but note that even if the task does
31235 * have a callback, it will not be invoked when @task_func returns.
31242 * g_task_set_check_cancellable:
31243 * @task: the #GTask
31244 * @check_cancellable: whether #GTask will check the state of its #GCancellable for you.
31246 * Sets or clears @task's check-cancellable flag. If this is %TRUE
31247 * (the default), then g_task_propagate_pointer(), etc, and
31248 * g_task_had_error() will check the task's #GCancellable first, and
31249 * if it has been cancelled, then they will consider the task to have
31250 * returned an "Operation was cancelled" error
31251 * (%G_IO_ERROR_CANCELLED), regardless of any other error or return
31252 * value the task may have had.
31254 * If @check_cancellable is %FALSE, then the #GTask will not check the
31255 * cancellable itself, and it is up to @task's owner to do this (eg,
31256 * via g_task_return_error_if_cancelled()).
31258 * If you are using g_task_set_return_on_cancel() as well, then
31259 * you must leave check-cancellable set %TRUE.
31266 * g_task_set_priority:
31267 * @task: the #GTask
31268 * @priority: the <link linkend="io-priority">priority</link> of the request.
31270 * Sets @task's priority. If you do not call this, it will default to
31271 * %G_PRIORITY_DEFAULT.
31273 * This will affect the priority of #GSources created with
31274 * g_task_attach_source() and the scheduling of tasks run in threads,
31275 * and can also be explicitly retrieved later via
31276 * g_task_get_priority().
31283 * g_task_set_return_on_cancel:
31284 * @task: the #GTask
31285 * @return_on_cancel: whether the task returns automatically when it is cancelled.
31287 * Sets or clears @task's return-on-cancel flag. This is only
31288 * meaningful for tasks run via g_task_run_in_thread() or
31289 * g_task_run_in_thread_sync().
31291 * If @return_on_cancel is %TRUE, then cancelling @task's
31292 * #GCancellable will immediately cause it to return, as though the
31293 * task's #GTaskThreadFunc had called
31294 * g_task_return_error_if_cancelled() and then returned.
31296 * This allows you to create a cancellable wrapper around an
31297 * uninterruptable function. The #GTaskThreadFunc just needs to be
31298 * careful that it does not modify any externally-visible state after
31299 * it has been cancelled. To do that, the thread should call
31300 * g_task_set_return_on_cancel() again to (atomically) set
31301 * return-on-cancel %FALSE before making externally-visible changes;
31302 * if the task gets cancelled before the return-on-cancel flag could
31303 * be changed, g_task_set_return_on_cancel() will indicate this by
31304 * returning %FALSE.
31306 * You can disable and re-enable this flag multiple times if you wish.
31307 * If the task's #GCancellable is cancelled while return-on-cancel is
31308 * %FALSE, then calling g_task_set_return_on_cancel() to set it %TRUE
31309 * again will cause the task to be cancelled at that point.
31311 * If the task's #GCancellable is already cancelled before you call
31312 * g_task_run_in_thread()/g_task_run_in_thread_sync(), then the
31313 * #GTaskThreadFunc will still be run (for consistency), but the task
31314 * will also be completed right away.
31316 * Returns: %TRUE if @task's return-on-cancel flag was changed to match @return_on_cancel. %FALSE if @task has already been cancelled.
31322 * g_task_set_source_tag:
31323 * @task: the #GTask
31324 * @source_tag: an opaque pointer indicating the source of this task
31326 * Sets @task's source tag. You can use this to tag a task return
31327 * value with a particular pointer (usually a pointer to the function
31328 * doing the tagging) and then later check it using
31329 * g_task_get_source_tag() (or g_async_result_is_tagged()) in the
31330 * task's "finish" function, to figure out if the response came from a
31331 * particular place.
31338 * g_task_set_task_data:
31339 * @task: the #GTask
31340 * @task_data: (allow-none): task-specific data
31341 * @task_data_destroy: (allow-none): #GDestroyNotify for @task_data
31343 * Sets @task's task data (freeing the existing task data, if any).
31350 * g_tcp_connection_get_graceful_disconnect:
31351 * @connection: a #GTcpConnection
31353 * Checks if graceful disconnects are used. See
31354 * g_tcp_connection_set_graceful_disconnect().
31356 * Returns: %TRUE if graceful disconnect is used on close, %FALSE otherwise
31362 * g_tcp_connection_set_graceful_disconnect:
31363 * @connection: a #GTcpConnection
31364 * @graceful_disconnect: Whether to do graceful disconnects or not
31366 * This enabled graceful disconnects on close. A graceful disconnect
31367 * means that we signal the receiving end that the connection is terminated
31368 * and wait for it to close the connection before closing the connection.
31370 * A graceful disconnect means that we can be sure that we successfully sent
31371 * all the outstanding data to the other end, or get an error reported.
31372 * However, it also means we have to wait for all the data to reach the
31373 * other side and for it to acknowledge this by closing the socket, which may
31374 * take a while. For this reason it is disabled by default.
31381 * g_tcp_wrapper_connection_get_base_io_stream:
31382 * @conn: a #GTcpWrapperConnection
31384 * Get's @conn's base #GIOStream
31386 * Returns: (transfer none): @conn's base #GIOStream
31391 * g_tcp_wrapper_connection_new:
31392 * @base_io_stream: the #GIOStream to wrap
31393 * @socket: the #GSocket associated with @base_io_stream
31395 * Wraps @base_io_stream and @socket together as a #GSocketConnection.
31397 * Returns: the new #GSocketConnection.
31403 * g_test_dbus_add_service_dir:
31404 * @self: a #GTestDBus
31405 * @path: path to a directory containing .service files
31407 * Add a path where dbus-daemon will lookup for .services files. This can't be
31408 * called after g_test_dbus_up().
31413 * g_test_dbus_down:
31414 * @self: a #GTestDBus
31416 * Stop the session bus started by g_test_dbus_up().
31418 * This will wait for the singleton returned by g_bus_get() or g_bus_get_sync()
31419 * is destroyed. This is done to ensure that the next unit test won't get a
31420 * leaked singleton from this test.
31425 * g_test_dbus_get_bus_address:
31426 * @self: a #GTestDBus
31428 * Get the address on which dbus-daemon is running. if g_test_dbus_up() has not
31429 * been called yet, %NULL is returned. This can be used with
31430 * g_dbus_connection_new_for_address()
31432 * Returns: the address of the bus, or %NULL.
31437 * g_test_dbus_get_flags:
31438 * @self: a #GTestDBus
31440 * Gets the flags of the #GTestDBus object.
31442 * Returns: the value of #GTestDBus:flags property
31448 * @flags: a #GTestDBusFlags
31450 * Create a new #GTestDBus object.
31452 * Returns: (transfer full): a new #GTestDBus.
31457 * g_test_dbus_stop:
31458 * @self: a #GTestDBus
31460 * Stop the session bus started by g_test_dbus_up().
31462 * Unlike g_test_dbus_down(), this won't verify the #GDBusConnection
31463 * singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit
31464 * tests wanting to verify behaviour after the session bus has been stopped
31465 * can use this function but should still call g_test_dbus_down() when done.
31470 * g_test_dbus_unset:
31472 * Unset DISPLAY and DBUS_SESSION_BUS_ADDRESS env variables to ensure the test
31473 * won't use user's session bus.
31475 * This is useful for unit tests that want to verify behaviour when no session
31476 * bus is running. It is not necessary to call this if unit test already calls
31477 * g_test_dbus_up() before acquiring the session bus.
31483 * @self: a #GTestDBus
31485 * Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this
31486 * call, it is safe for unit tests to start sending messages on the session bus.
31488 * If this function is called from setup callback of g_test_add(),
31489 * g_test_dbus_down() must be called in its teardown callback.
31491 * If this function is called from unit test's main(), then g_test_dbus_down()
31492 * must be called after g_test_run().
31497 * g_themed_icon_append_name:
31498 * @icon: a #GThemedIcon
31499 * @iconname: name of icon to append to list of icons from within @icon.
31501 * Append a name to the list of icons from within @icon.
31504 * Note that doing so invalidates the hash computed by prior calls
31505 * to g_icon_hash().
31511 * g_themed_icon_get_names:
31512 * @icon: a #GThemedIcon.
31514 * Gets the names of icons from within @icon.
31516 * Returns: (transfer none): a list of icon names.
31521 * g_themed_icon_new:
31522 * @iconname: a string containing an icon name.
31524 * Creates a new themed icon for @iconname.
31526 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
31531 * g_themed_icon_new_from_names:
31532 * @iconnames: (array length=len): an array of strings containing icon names.
31533 * @len: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
31535 * Creates a new themed icon for @iconnames.
31537 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon
31542 * g_themed_icon_new_with_default_fallbacks:
31543 * @iconname: a string containing an icon name
31545 * Creates a new themed icon for @iconname, and all the names
31546 * that can be created by shortening @iconname at '-' characters.
31548 * In the following example, @icon1 and @icon2 are equivalent:
31550 * const char *names[] = {
31551 * "gnome-dev-cdrom-audio",
31552 * "gnome-dev-cdrom",
31557 * icon1 = g_themed_icon_new_from_names (names, 4);
31558 * icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
31561 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
31566 * g_themed_icon_prepend_name:
31567 * @icon: a #GThemedIcon
31568 * @iconname: name of icon to prepend to list of icons from within @icon.
31570 * Prepend a name to the list of icons from within @icon.
31573 * Note that doing so invalidates the hash computed by prior calls
31574 * to g_icon_hash().
31582 * g_threaded_socket_service_new:
31583 * @max_threads: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
31585 * Creates a new #GThreadedSocketService with no listeners. Listeners
31586 * must be added with one of the #GSocketListener "add" methods.
31588 * Returns: a new #GSocketService.
31594 * g_tls_backend_get_certificate_type:
31595 * @backend: the #GTlsBackend
31597 * Gets the #GType of @backend's #GTlsCertificate implementation.
31599 * Returns: the #GType of @backend's #GTlsCertificate implementation.
31605 * g_tls_backend_get_client_connection_type:
31606 * @backend: the #GTlsBackend
31608 * Gets the #GType of @backend's #GTlsClientConnection implementation.
31610 * Returns: the #GType of @backend's #GTlsClientConnection implementation.
31616 * g_tls_backend_get_default:
31618 * Gets the default #GTlsBackend for the system.
31620 * Returns: (transfer none): a #GTlsBackend
31626 * g_tls_backend_get_default_database:
31627 * @backend: the #GTlsBackend
31629 * Gets the default #GTlsDatabase used to verify TLS connections.
31631 * Returns: (transfer full): the default database, which should be unreffed when done.
31637 * g_tls_backend_get_file_database_type:
31638 * @backend: the #GTlsBackend
31640 * Gets the #GType of @backend's #GTlsFileDatabase implementation.
31642 * Returns: the #GType of backend's #GTlsFileDatabase implementation.
31648 * g_tls_backend_get_server_connection_type:
31649 * @backend: the #GTlsBackend
31651 * Gets the #GType of @backend's #GTlsServerConnection implementation.
31653 * Returns: the #GType of @backend's #GTlsServerConnection implementation.
31659 * g_tls_backend_supports_tls:
31660 * @backend: the #GTlsBackend
31662 * Checks if TLS is supported; if this returns %FALSE for the default
31663 * #GTlsBackend, it means no "real" TLS backend is available.
31665 * Returns: whether or not TLS is supported
31671 * g_tls_certificate_get_issuer:
31672 * @cert: a #GTlsCertificate
31674 * Gets the #GTlsCertificate representing @cert's issuer, if known
31676 * Returns: (transfer none): The certificate of @cert's issuer, or %NULL if @cert is self-signed or signed with an unknown certificate.
31682 * g_tls_certificate_is_same:
31683 * @cert_one: first certificate to compare
31684 * @cert_two: second certificate to compare
31686 * Check if two #GTlsCertificate objects represent the same certificate.
31687 * The raw DER byte data of the two certificates are checked for equality.
31688 * This has the effect that two certificates may compare equal even if
31689 * their #GTlsCertificate:issuer, #GTlsCertificate:private-key, or
31690 * #GTlsCertificate:private-key-pem properties differ.
31692 * Returns: whether the same or not
31698 * g_tls_certificate_list_new_from_file:
31699 * @file: file containing PEM-encoded certificates to import
31700 * @error: #GError for error reporting, or %NULL to ignore.
31702 * Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
31703 * data in @file. If @file cannot be read or parsed, the function will
31704 * return %NULL and set @error. If @file does not contain any
31705 * PEM-encoded certificates, this will return an empty list and not
31708 * Returns: (element-type Gio.TlsCertificate) (transfer full): a #GList containing #GTlsCertificate objects. You must free the list and its contents when you are done with it.
31714 * g_tls_certificate_new_from_file:
31715 * @file: file containing a PEM-encoded certificate to import
31716 * @error: #GError for error reporting, or %NULL to ignore.
31718 * Creates a #GTlsCertificate from the PEM-encoded data in @file. If
31719 * @file cannot be read or parsed, the function will return %NULL and
31720 * set @error. Otherwise, this behaves like
31721 * g_tls_certificate_new_from_pem().
31723 * Returns: the new certificate, or %NULL on error
31729 * g_tls_certificate_new_from_files:
31730 * @cert_file: file containing a PEM-encoded certificate to import
31731 * @key_file: file containing a PEM-encoded private key to import
31732 * @error: #GError for error reporting, or %NULL to ignore.
31734 * Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
31735 * and @key_file. If either file cannot be read or parsed, the
31736 * function will return %NULL and set @error. Otherwise, this behaves
31737 * like g_tls_certificate_new_from_pem().
31739 * Returns: the new certificate, or %NULL on error
31745 * g_tls_certificate_new_from_pem:
31746 * @data: PEM-encoded certificate data
31747 * @length: the length of @data, or -1 if it's 0-terminated.
31748 * @error: #GError for error reporting, or %NULL to ignore.
31750 * Creates a new #GTlsCertificate from the PEM-encoded data in @data.
31751 * If @data includes both a certificate and a private key, then the
31752 * returned certificate will include the private key data as well. (See
31753 * the #GTlsCertificate:private-key-pem property for information about
31754 * supported formats.)
31756 * If @data includes multiple certificates, only the first one will be
31759 * Returns: the new certificate, or %NULL if @data is invalid
31765 * g_tls_certificate_verify:
31766 * @cert: a #GTlsCertificate
31767 * @identity: (allow-none): the expected peer identity
31768 * @trusted_ca: (allow-none): the certificate of a trusted authority
31770 * This verifies @cert and returns a set of #GTlsCertificateFlags
31771 * indicating any problems found with it. This can be used to verify a
31772 * certificate outside the context of making a connection, or to
31773 * check a certificate against a CA that is not part of the system
31776 * If @identity is not %NULL, @cert's name(s) will be compared against
31777 * it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
31778 * value if it does not match. If @identity is %NULL, that bit will
31779 * never be set in the return value.
31781 * If @trusted_ca is not %NULL, then @cert (or one of the certificates
31782 * in its chain) must be signed by it, or else
31783 * %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
31784 * @trusted_ca is %NULL, that bit will never be set in the return
31787 * (All other #GTlsCertificateFlags values will always be set or unset
31790 * Returns: the appropriate #GTlsCertificateFlags
31796 * g_tls_client_connection_get_accepted_cas:
31797 * @conn: the #GTlsClientConnection
31799 * Gets the list of distinguished names of the Certificate Authorities
31800 * that the server will accept certificates from. This will be set
31801 * during the TLS handshake if the server requests a certificate.
31802 * Otherwise, it will be %NULL.
31804 * Each item in the list is a #GByteArray which contains the complete
31805 * subject DN of the certificate authority.
31807 * Returns: (element-type GByteArray) (transfer full): the list of CA DNs. You should unref each element with g_byte_array_unref() and then the free the list with g_list_free().
31813 * g_tls_client_connection_get_server_identity:
31814 * @conn: the #GTlsClientConnection
31816 * Gets @conn's expected server identity
31818 * Returns: (transfer none): a #GSocketConnectable describing the expected server identity, or %NULL if the expected identity is not known.
31824 * g_tls_client_connection_get_use_ssl3:
31825 * @conn: the #GTlsClientConnection
31827 * Gets whether @conn will use SSL 3.0 rather than the
31828 * highest-supported version of TLS; see
31829 * g_tls_client_connection_set_use_ssl3().
31831 * Returns: whether @conn will use SSL 3.0
31837 * g_tls_client_connection_get_validation_flags:
31838 * @conn: the #GTlsClientConnection
31840 * Gets @conn's validation flags
31842 * Returns: the validation flags
31848 * g_tls_client_connection_new:
31849 * @base_io_stream: the #GIOStream to wrap
31850 * @server_identity: (allow-none): the expected identity of the server
31851 * @error: #GError for error reporting, or %NULL to ignore.
31853 * Creates a new #GTlsClientConnection wrapping @base_io_stream (which
31854 * must have pollable input and output streams) which is assumed to
31855 * communicate with the server identified by @server_identity.
31857 * Returns: (transfer full) (type GTlsClientConnection): the new #GTlsClientConnection, or %NULL on error
31863 * g_tls_client_connection_set_server_identity:
31864 * @conn: the #GTlsClientConnection
31865 * @identity: a #GSocketConnectable describing the expected server identity
31867 * Sets @conn's expected server identity, which is used both to tell
31868 * servers on virtual hosts which certificate to present, and also
31869 * to let @conn know what name to look for in the certificate when
31870 * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
31877 * g_tls_client_connection_set_use_ssl3:
31878 * @conn: the #GTlsClientConnection
31879 * @use_ssl3: whether to use SSL 3.0
31881 * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
31882 * trying to properly negotiate the right version of TLS or SSL to use.
31883 * This can be used when talking to servers that do not implement the
31884 * fallbacks correctly and which will therefore fail to handshake with
31885 * a "modern" TLS handshake attempt.
31892 * g_tls_client_connection_set_validation_flags:
31893 * @conn: the #GTlsClientConnection
31894 * @flags: the #GTlsCertificateFlags to use
31896 * Sets @conn's validation flags, to override the default set of
31897 * checks performed when validating a server certificate. By default,
31898 * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
31905 * g_tls_connection_emit_accept_certificate:
31906 * @conn: a #GTlsConnection
31907 * @peer_cert: the peer's #GTlsCertificate
31908 * @errors: the problems with @peer_cert
31910 * Used by #GTlsConnection implementations to emit the
31911 * #GTlsConnection::accept-certificate signal.
31913 * Returns: %TRUE if one of the signal handlers has returned %TRUE to accept @peer_cert
31919 * g_tls_connection_get_certificate:
31920 * @conn: a #GTlsConnection
31922 * Gets @conn's certificate, as set by
31923 * g_tls_connection_set_certificate().
31925 * Returns: (transfer none): @conn's certificate, or %NULL
31931 * g_tls_connection_get_database:
31932 * @conn: a #GTlsConnection
31934 * Gets the certificate database that @conn uses to verify
31935 * peer certificates. See g_tls_connection_set_database().
31937 * Returns: (transfer none): the certificate database that @conn uses or %NULL
31943 * g_tls_connection_get_interaction:
31944 * @conn: a connection
31946 * Get the object that will be used to interact with the user. It will be used
31947 * for things like prompting the user for passwords. If %NULL is returned, then
31948 * no user interaction will occur for this connection.
31950 * Returns: (transfer none): The interaction object.
31956 * g_tls_connection_get_peer_certificate:
31957 * @conn: a #GTlsConnection
31959 * Gets @conn's peer's certificate after the handshake has completed.
31960 * (It is not set during the emission of
31961 * #GTlsConnection::accept-certificate.)
31963 * Returns: (transfer none): @conn's peer's certificate, or %NULL
31969 * g_tls_connection_get_peer_certificate_errors:
31970 * @conn: a #GTlsConnection
31972 * Gets the errors associated with validating @conn's peer's
31973 * certificate, after the handshake has completed. (It is not set
31974 * during the emission of #GTlsConnection::accept-certificate.)
31976 * Returns: @conn's peer's certificate errors
31982 * g_tls_connection_get_rehandshake_mode:
31983 * @conn: a #GTlsConnection
31985 * Gets @conn rehandshaking mode. See
31986 * g_tls_connection_set_rehandshake_mode() for details.
31988 * Returns: @conn's rehandshaking mode
31994 * g_tls_connection_get_require_close_notify:
31995 * @conn: a #GTlsConnection
31997 * Tests whether or not @conn expects a proper TLS close notification
31998 * when the connection is closed. See
31999 * g_tls_connection_set_require_close_notify() for details.
32001 * Returns: %TRUE if @conn requires a proper TLS close notification.
32007 * g_tls_connection_get_use_system_certdb:
32008 * @conn: a #GTlsConnection
32010 * Gets whether @conn uses the system certificate database to verify
32011 * peer certificates. See g_tls_connection_set_use_system_certdb().
32013 * Returns: whether @conn uses the system certificate database
32014 * Deprecated: 2.30: Use g_tls_connection_get_database() instead
32019 * g_tls_connection_handshake:
32020 * @conn: a #GTlsConnection
32021 * @cancellable: (allow-none): a #GCancellable, or %NULL
32022 * @error: a #GError, or %NULL
32024 * Attempts a TLS handshake on @conn.
32026 * On the client side, it is never necessary to call this method;
32027 * although the connection needs to perform a handshake after
32028 * connecting (or after sending a "STARTTLS"-type command) and may
32029 * need to rehandshake later if the server requests it,
32030 * #GTlsConnection will handle this for you automatically when you try
32031 * to send or receive data on the connection. However, you can call
32032 * g_tls_connection_handshake() manually if you want to know for sure
32033 * whether the initial handshake succeeded or failed (as opposed to
32034 * just immediately trying to write to @conn's output stream, in which
32035 * case if it fails, it may not be possible to tell if it failed
32036 * before or after completing the handshake).
32038 * Likewise, on the server side, although a handshake is necessary at
32039 * the beginning of the communication, you do not need to call this
32040 * function explicitly unless you want clearer error reporting.
32041 * However, you may call g_tls_connection_handshake() later on to
32042 * renegotiate parameters (encryption methods, etc) with the client.
32044 * #GTlsConnection::accept_certificate may be emitted during the
32047 * Returns: success or failure
32053 * g_tls_connection_handshake_async:
32054 * @conn: a #GTlsConnection
32055 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
32056 * @cancellable: (allow-none): a #GCancellable, or %NULL
32057 * @callback: callback to call when the handshake is complete
32058 * @user_data: the data to pass to the callback function
32060 * Asynchronously performs a TLS handshake on @conn. See
32061 * g_tls_connection_handshake() for more information.
32068 * g_tls_connection_handshake_finish:
32069 * @conn: a #GTlsConnection
32070 * @result: a #GAsyncResult.
32071 * @error: a #GError pointer, or %NULL
32073 * Finish an asynchronous TLS handshake operation. See
32074 * g_tls_connection_handshake() for more information.
32076 * Returns: %TRUE on success, %FALSE on failure, in which case @error will be set.
32082 * g_tls_connection_set_certificate:
32083 * @conn: a #GTlsConnection
32084 * @certificate: the certificate to use for @conn
32086 * This sets the certificate that @conn will present to its peer
32087 * during the TLS handshake. For a #GTlsServerConnection, it is
32088 * mandatory to set this, and that will normally be done at construct
32091 * For a #GTlsClientConnection, this is optional. If a handshake fails
32092 * with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
32093 * requires a certificate, and if you try connecting again, you should
32094 * call this method first. You can call
32095 * g_tls_client_connection_get_accepted_cas() on the failed connection
32096 * to get a list of Certificate Authorities that the server will
32097 * accept certificates from.
32099 * (It is also possible that a server will allow the connection with
32100 * or without a certificate; in that case, if you don't provide a
32101 * certificate, you can tell that the server requested one by the fact
32102 * that g_tls_client_connection_get_accepted_cas() will return
32110 * g_tls_connection_set_database:
32111 * @conn: a #GTlsConnection
32112 * @database: a #GTlsDatabase
32114 * Sets the certificate database that is used to verify peer certificates.
32115 * This is set to the default database by default. See
32116 * g_tls_backend_get_default_database(). If set to %NULL, then
32117 * peer certificate validation will always set the
32118 * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
32119 * #GTlsConnection::accept-certificate will always be emitted on
32120 * client-side connections, unless that bit is not set in
32121 * #GTlsClientConnection:validation-flags).
32128 * g_tls_connection_set_interaction:
32129 * @conn: a connection
32130 * @interaction: (allow-none): an interaction object, or %NULL
32132 * Set the object that will be used to interact with the user. It will be used
32133 * for things like prompting the user for passwords.
32135 * The @interaction argument will normally be a derived subclass of
32136 * #GTlsInteraction. %NULL can also be provided if no user interaction
32137 * should occur for this connection.
32144 * g_tls_connection_set_rehandshake_mode:
32145 * @conn: a #GTlsConnection
32146 * @mode: the rehandshaking mode
32148 * Sets how @conn behaves with respect to rehandshaking requests.
32150 * %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
32151 * rehandshake after the initial handshake is complete. (For a client,
32152 * this means it will refuse rehandshake requests from the server, and
32153 * for a server, this means it will close the connection with an error
32154 * if the client attempts to rehandshake.)
32156 * %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
32157 * rehandshake only if the other end of the connection supports the
32158 * TLS <literal>renegotiation_info</literal> extension. This is the
32159 * default behavior, but means that rehandshaking will not work
32160 * against older implementations that do not support that extension.
32162 * %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
32163 * rehandshaking even without the
32164 * <literal>renegotiation_info</literal> extension. On the server side
32165 * in particular, this is not recommended, since it leaves the server
32166 * open to certain attacks. However, this mode is necessary if you
32167 * need to allow renegotiation with older client software.
32174 * g_tls_connection_set_require_close_notify:
32175 * @conn: a #GTlsConnection
32176 * @require_close_notify: whether or not to require close notification
32178 * Sets whether or not @conn expects a proper TLS close notification
32179 * before the connection is closed. If this is %TRUE (the default),
32180 * then @conn will expect to receive a TLS close notification from its
32181 * peer before the connection is closed, and will return a
32182 * %G_TLS_ERROR_EOF error if the connection is closed without proper
32183 * notification (since this may indicate a network error, or
32184 * man-in-the-middle attack).
32186 * In some protocols, the application will know whether or not the
32187 * connection was closed cleanly based on application-level data
32188 * (because the application-level data includes a length field, or is
32189 * somehow self-delimiting); in this case, the close notify is
32190 * redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
32191 * in TLS 1.0 it is technically an error, but often done anyway.) You
32192 * can use g_tls_connection_set_require_close_notify() to tell @conn
32193 * to allow an "unannounced" connection close, in which case the close
32194 * will show up as a 0-length read, as in a non-TLS
32195 * #GSocketConnection, and it is up to the application to check that
32196 * the data has been fully received.
32198 * Note that this only affects the behavior when the peer closes the
32199 * connection; when the application calls g_io_stream_close() itself
32200 * on @conn, this will send a close notification regardless of the
32201 * setting of this property. If you explicitly want to do an unclean
32202 * close, you can close @conn's #GTlsConnection:base-io-stream rather
32203 * than closing @conn itself.
32210 * g_tls_connection_set_use_system_certdb:
32211 * @conn: a #GTlsConnection
32212 * @use_system_certdb: whether to use the system certificate database
32214 * Sets whether @conn uses the system certificate database to verify
32215 * peer certificates. This is %TRUE by default. If set to %FALSE, then
32216 * peer certificate validation will always set the
32217 * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
32218 * #GTlsConnection::accept-certificate will always be emitted on
32219 * client-side connections, unless that bit is not set in
32220 * #GTlsClientConnection:validation-flags).
32222 * Deprecated: 2.30: Use g_tls_connection_set_database() instead
32227 * g_tls_database_create_certificate_handle:
32228 * @self: a #GTlsDatabase
32229 * @certificate: certificate for which to create a handle.
32231 * Create a handle string for the certificate. The database will only be able
32232 * to create a handle for certificates that originate from the database. In
32233 * cases where the database cannot create a handle for a certificate, %NULL
32234 * will be returned.
32236 * This handle should be stable across various instances of the application,
32237 * and between applications. If a certificate is modified in the database,
32238 * then it is not guaranteed that this handle will continue to point to it.
32240 * Returns: (allow-none): a newly allocated string containing the handle.
32246 * g_tls_database_lookup_certificate_for_handle:
32247 * @self: a #GTlsDatabase
32248 * @handle: a certificate handle
32249 * @interaction: (allow-none): used to interact with the user if necessary
32250 * @flags: Flags which affect the lookup.
32251 * @cancellable: (allow-none): a #GCancellable, or %NULL
32252 * @error: (allow-none): a #GError, or %NULL
32254 * Lookup a certificate by its handle.
32256 * The handle should have been created by calling
32257 * g_tls_database_create_certificate_handle() on a #GTlsDatabase object of
32258 * the same TLS backend. The handle is designed to remain valid across
32259 * instantiations of the database.
32261 * If the handle is no longer valid, or does not point to a certificate in
32262 * this database, then %NULL will be returned.
32264 * This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
32265 * the lookup operation asynchronously.
32267 * Returns: (transfer full) (allow-none): a newly allocated #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
32273 * g_tls_database_lookup_certificate_for_handle_async:
32274 * @self: a #GTlsDatabase
32275 * @handle: a certificate handle
32276 * @interaction: (allow-none): used to interact with the user if necessary
32277 * @flags: Flags which affect the lookup.
32278 * @cancellable: (allow-none): a #GCancellable, or %NULL
32279 * @callback: callback to call when the operation completes
32280 * @user_data: the data to pass to the callback function
32282 * Asynchronously lookup a certificate by its handle in the database. See
32283 * g_tls_database_lookup_certificate_for_handle() for more information.
32290 * g_tls_database_lookup_certificate_for_handle_finish:
32291 * @self: a #GTlsDatabase
32292 * @result: a #GAsyncResult.
32293 * @error: a #GError pointer, or %NULL
32295 * Finish an asynchronous lookup of a certificate by its handle. See
32296 * g_tls_database_lookup_certificate_handle() for more information.
32298 * If the handle is no longer valid, or does not point to a certificate in
32299 * this database, then %NULL will be returned.
32301 * Returns: (transfer full): a newly allocated #GTlsCertificate object. Use g_object_unref() to release the certificate.
32307 * g_tls_database_lookup_certificate_issuer:
32308 * @self: a #GTlsDatabase
32309 * @certificate: a #GTlsCertificate
32310 * @interaction: (allow-none): used to interact with the user if necessary
32311 * @flags: flags which affect the lookup operation
32312 * @cancellable: (allow-none): a #GCancellable, or %NULL
32313 * @error: (allow-none): a #GError, or %NULL
32315 * Lookup the issuer of @certificate in the database.
32317 * The %issuer property
32318 * of @certificate is not modified, and the two certificates are not hooked
32321 * This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
32322 * the lookup operation asynchronously.
32324 * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
32330 * g_tls_database_lookup_certificate_issuer_async:
32331 * @self: a #GTlsDatabase
32332 * @certificate: a #GTlsCertificate
32333 * @interaction: (allow-none): used to interact with the user if necessary
32334 * @flags: flags which affect the lookup operation
32335 * @cancellable: (allow-none): a #GCancellable, or %NULL
32336 * @callback: callback to call when the operation completes
32337 * @user_data: the data to pass to the callback function
32339 * Asynchronously lookup the issuer of @certificate in the database. See
32340 * g_tls_database_lookup_certificate_issuer() for more information.
32347 * g_tls_database_lookup_certificate_issuer_finish:
32348 * @self: a #GTlsDatabase
32349 * @result: a #GAsyncResult.
32350 * @error: a #GError pointer, or %NULL
32352 * Finish an asynchronous lookup issuer operation. See
32353 * g_tls_database_lookup_certificate_issuer() for more information.
32355 * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
32361 * g_tls_database_lookup_certificates_issued_by:
32362 * @self: a #GTlsDatabase
32363 * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
32364 * @interaction: (allow-none): used to interact with the user if necessary
32365 * @flags: Flags which affect the lookup operation.
32366 * @cancellable: (allow-none): a #GCancellable, or %NULL
32367 * @error: (allow-none): a #GError, or %NULL
32369 * Lookup certificates issued by this issuer in the database.
32371 * This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
32372 * the lookup operation asynchronously.
32374 * Returns: (transfer full) (element-type GTlsCertificate): a newly allocated list of #GTlsCertificate objects. Use g_object_unref() on each certificate, and g_list_free() on the release the list.
32380 * g_tls_database_lookup_certificates_issued_by_async:
32381 * @self: a #GTlsDatabase
32382 * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
32383 * @interaction: (allow-none): used to interact with the user if necessary
32384 * @flags: Flags which affect the lookup operation.
32385 * @cancellable: (allow-none): a #GCancellable, or %NULL
32386 * @callback: callback to call when the operation completes
32387 * @user_data: the data to pass to the callback function
32389 * Asynchronously lookup certificates issued by this issuer in the database. See
32390 * g_tls_database_lookup_certificates_issued_by() for more information.
32392 * The database may choose to hold a reference to the issuer byte array for the duration
32393 * of of this asynchronous operation. The byte array should not be modified during
32401 * g_tls_database_lookup_certificates_issued_by_finish:
32402 * @self: a #GTlsDatabase
32403 * @result: a #GAsyncResult.
32404 * @error: a #GError pointer, or %NULL
32406 * Finish an asynchronous lookup of certificates. See
32407 * g_tls_database_lookup_certificates_issued_by() for more information.
32409 * Returns: (transfer full): a newly allocated list of #GTlsCertificate objects. Use g_object_unref() on each certificate, and g_list_free() on the release the list.
32415 * g_tls_database_verify_chain:
32416 * @self: a #GTlsDatabase
32417 * @chain: a #GTlsCertificate chain
32418 * @purpose: the purpose that this certificate chain will be used for.
32419 * @identity: (allow-none): the expected peer identity
32420 * @interaction: (allow-none): used to interact with the user if necessary
32421 * @flags: additional verify flags
32422 * @cancellable: (allow-none): a #GCancellable, or %NULL
32423 * @error: (allow-none): a #GError, or %NULL
32425 * Verify's a certificate chain after looking up and adding any missing
32426 * certificates to the chain.
32428 * @chain is a chain of #GTlsCertificate objects each pointing to the next
32429 * certificate in the chain by its %issuer property. The chain may initially
32430 * consist of one or more certificates. After the verification process is
32431 * complete, @chain may be modified by adding missing certificates, or removing
32432 * extra certificates. If a certificate anchor was found, then it is added to
32435 * @purpose describes the purpose (or usage) for which the certificate
32436 * is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
32437 * which means that the certificate is being used to authenticate a server
32438 * (and we are acting as the client).
32440 * The @identity is used to check for pinned certificates (trust exceptions)
32441 * in the database. These will override the normal verification process on a
32442 * host by host basis.
32444 * Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
32447 * This function can block, use g_tls_database_verify_chain_async() to perform
32448 * the verification operation asynchronously.
32450 * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
32456 * g_tls_database_verify_chain_async:
32457 * @self: a #GTlsDatabase
32458 * @chain: a #GTlsCertificate chain
32459 * @purpose: the purpose that this certificate chain will be used for.
32460 * @identity: (allow-none): the expected peer identity
32461 * @interaction: (allow-none): used to interact with the user if necessary
32462 * @flags: additional verify flags
32463 * @cancellable: (allow-none): a #GCancellable, or %NULL
32464 * @callback: callback to call when the operation completes
32465 * @user_data: the data to pass to the callback function
32467 * Asynchronously verify's a certificate chain after looking up and adding
32468 * any missing certificates to the chain. See g_tls_database_verify_chain()
32469 * for more information.
32476 * g_tls_database_verify_chain_finish:
32477 * @self: a #GTlsDatabase
32478 * @result: a #GAsyncResult.
32479 * @error: a #GError pointer, or %NULL
32481 * Finish an asynchronous verify chain operation. See
32482 * g_tls_database_verify_chain() for more information. *
32484 * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
32490 * g_tls_error_quark:
32492 * Gets the TLS error quark.
32494 * Returns: a #GQuark.
32500 * g_tls_file_database_new:
32501 * @anchors: filename of anchor certificate authorities.
32502 * @error: #GError for error reporting, or %NULL to ignore.
32504 * Creates a new #GTlsFileDatabase which uses anchor certificate authorities
32505 * in @anchors to verify certificate chains.
32507 * The certificates in @anchors must be PEM encoded.
32509 * Returns: (transfer full) (type GTlsFileDatabase): the new #GTlsFileDatabase, or %NULL on error
32515 * g_tls_interaction_ask_password:
32516 * @interaction: a #GTlsInteraction object
32517 * @password: a #GTlsPassword object
32518 * @cancellable: an optional #GCancellable cancellation object
32519 * @error: an optional location to place an error on failure
32521 * Run synchronous interaction to ask the user for a password. In general,
32522 * g_tls_interaction_invoke_ask_password() should be used instead of this
32525 * Derived subclasses usually implement a password prompt, although they may
32526 * also choose to provide a password from elsewhere. The @password value will
32527 * be filled in and then @callback will be called. Alternatively the user may
32528 * abort this password request, which will usually abort the TLS connection.
32530 * If the interaction is cancelled by the cancellation object, or by the
32531 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32532 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
32533 * not support immediate cancellation.
32535 * Returns: The status of the ask password interaction.
32541 * g_tls_interaction_ask_password_async:
32542 * @interaction: a #GTlsInteraction object
32543 * @password: a #GTlsPassword object
32544 * @cancellable: an optional #GCancellable cancellation object
32545 * @callback: (allow-none): will be called when the interaction completes
32546 * @user_data: (allow-none): data to pass to the @callback
32548 * Run asynchronous interaction to ask the user for a password. In general,
32549 * g_tls_interaction_invoke_ask_password() should be used instead of this
32552 * Derived subclasses usually implement a password prompt, although they may
32553 * also choose to provide a password from elsewhere. The @password value will
32554 * be filled in and then @callback will be called. Alternatively the user may
32555 * abort this password request, which will usually abort the TLS connection.
32557 * If the interaction is cancelled by the cancellation object, or by the
32558 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32559 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
32560 * not support immediate cancellation.
32562 * Certain implementations may not support immediate cancellation.
32569 * g_tls_interaction_ask_password_finish:
32570 * @interaction: a #GTlsInteraction object
32571 * @result: the result passed to the callback
32572 * @error: an optional location to place an error on failure
32574 * Complete an ask password user interaction request. This should be once
32575 * the g_tls_interaction_ask_password_async() completion callback is called.
32577 * If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
32578 * to g_tls_interaction_ask_password() will have its password filled in.
32580 * If the interaction is cancelled by the cancellation object, or by the
32581 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32582 * contains a %G_IO_ERROR_CANCELLED error code.
32584 * Returns: The status of the ask password interaction.
32590 * g_tls_interaction_invoke_ask_password:
32591 * @interaction: a #GTlsInteraction object
32592 * @password: a #GTlsPassword object
32593 * @cancellable: an optional #GCancellable cancellation object
32594 * @error: an optional location to place an error on failure
32596 * Invoke the interaction to ask the user for a password. It invokes this
32597 * interaction in the main loop, specifically the #GMainContext returned by
32598 * g_main_context_get_thread_default() when the interaction is created. This
32599 * is called by called by #GTlsConnection or #GTlsDatabase to ask the user
32602 * Derived subclasses usually implement a password prompt, although they may
32603 * also choose to provide a password from elsewhere. The @password value will
32604 * be filled in and then @callback will be called. Alternatively the user may
32605 * abort this password request, which will usually abort the TLS connection.
32607 * The implementation can either be a synchronous (eg: modal dialog) or an
32608 * asynchronous one (eg: modeless dialog). This function will take care of
32609 * calling which ever one correctly.
32611 * If the interaction is cancelled by the cancellation object, or by the
32612 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32613 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
32614 * not support immediate cancellation.
32616 * Returns: The status of the ask password interaction.
32622 * g_tls_password_get_description:
32623 * @password: a #GTlsPassword object
32625 * Get a description string about what the password will be used for.
32627 * Returns: The description of the password.
32633 * g_tls_password_get_flags:
32634 * @password: a #GTlsPassword object
32636 * Get flags about the password.
32638 * Returns: The flags about the password.
32644 * g_tls_password_get_value:
32645 * @password: a #GTlsPassword object
32646 * @length: (allow-none): location to place the length of the password.
32648 * Get the password value. If @length is not %NULL then it will be
32649 * filled in with the length of the password value. (Note that the
32650 * password value is not nul-terminated, so you can only pass %NULL
32651 * for @length in contexts where you know the password will have a
32652 * certain fixed length.)
32654 * Returns: The password value (owned by the password object).
32660 * g_tls_password_get_warning:
32661 * @password: a #GTlsPassword object
32663 * Get a user readable translated warning. Usually this warning is a
32664 * representation of the password flags returned from
32665 * g_tls_password_get_flags().
32667 * Returns: The warning.
32673 * g_tls_password_new:
32674 * @flags: the password flags
32675 * @description: description of what the password is for
32677 * Create a new #GTlsPassword object.
32679 * Returns: (transfer full): The newly allocated password object
32684 * g_tls_password_set_description:
32685 * @password: a #GTlsPassword object
32686 * @description: The description of the password
32688 * Set a description string about what the password will be used for.
32695 * g_tls_password_set_flags:
32696 * @password: a #GTlsPassword object
32697 * @flags: The flags about the password
32699 * Set flags about the password.
32706 * g_tls_password_set_value:
32707 * @password: a #GTlsPassword object
32708 * @value: the new password value
32709 * @length: the length of the password, or -1
32711 * Set the value for this password. The @value will be copied by the password
32714 * Specify the @length, for a non-nul-terminated password. Pass -1 as
32715 * @length if using a nul-terminated password, and @length will be
32716 * calculated automatically. (Note that the terminating nul is not
32717 * considered part of the password in this case.)
32724 * g_tls_password_set_value_full:
32725 * @password: a #GTlsPassword object
32726 * @value: the value for the password
32727 * @length: the length of the password, or -1
32728 * @destroy: (allow-none): a function to use to free the password.
32730 * Provide the value for this password.
32732 * The @value will be owned by the password object, and later freed using
32733 * the @destroy function callback.
32735 * Specify the @length, for a non-nul-terminated password. Pass -1 as
32736 * @length if using a nul-terminated password, and @length will be
32737 * calculated automatically. (Note that the terminating nul is not
32738 * considered part of the password in this case.)
32740 * Virtual: set_value
32746 * g_tls_password_set_warning:
32747 * @password: a #GTlsPassword object
32748 * @warning: The user readable warning
32750 * Set a user readable translated warning. Usually this warning is a
32751 * representation of the password flags returned from
32752 * g_tls_password_get_flags().
32759 * g_tls_server_connection_new:
32760 * @base_io_stream: the #GIOStream to wrap
32761 * @certificate: (allow-none): the default server certificate, or %NULL
32762 * @error: #GError for error reporting, or %NULL to ignore.
32764 * Creates a new #GTlsServerConnection wrapping @base_io_stream (which
32765 * must have pollable input and output streams).
32767 * Returns: (transfer full) (type GTlsServerConnection): the new #GTlsServerConnection, or %NULL on error
32773 * g_unix_connection_receive_credentials:
32774 * @connection: A #GUnixConnection.
32775 * @cancellable: (allow-none): A #GCancellable or %NULL.
32776 * @error: Return location for error or %NULL.
32778 * Receives credentials from the sending end of the connection. The
32779 * sending end has to call g_unix_connection_send_credentials() (or
32780 * similar) for this to work.
32782 * As well as reading the credentials this also reads (and discards) a
32783 * single byte from the stream, as this is required for credentials
32784 * passing to work on some implementations.
32786 * Other ways to exchange credentials with a foreign peer includes the
32787 * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
32789 * Returns: (transfer full): Received credentials on success (free with g_object_unref()), %NULL if @error is set.
32795 * g_unix_connection_receive_credentials_async:
32796 * @connection: A #GUnixConnection.
32797 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32798 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
32799 * @user_data: (closure): the data to pass to callback function
32801 * Asynchronously receive credentials.
32803 * For more details, see g_unix_connection_receive_credentials() which is
32804 * the synchronous version of this call.
32806 * When the operation is finished, @callback will be called. You can then call
32807 * g_unix_connection_receive_credentials_finish() to get the result of the operation.
32814 * g_unix_connection_receive_credentials_finish:
32815 * @connection: A #GUnixConnection.
32816 * @result: a #GAsyncResult.
32817 * @error: a #GError, or %NULL
32819 * Finishes an asynchronous receive credentials operation started with
32820 * g_unix_connection_receive_credentials_async().
32822 * Returns: (transfer full): a #GCredentials, or %NULL on error. Free the returned object with g_object_unref().
32828 * g_unix_connection_receive_fd:
32829 * @connection: a #GUnixConnection
32830 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
32831 * @error: (allow-none): #GError for error reporting, or %NULL to ignore
32833 * Receives a file descriptor from the sending end of the connection.
32834 * The sending end has to call g_unix_connection_send_fd() for this
32837 * As well as reading the fd this also reads a single byte from the
32838 * stream, as this is required for fd passing to work on some
32841 * Returns: a file descriptor on success, -1 on error.
32847 * g_unix_connection_send_credentials:
32848 * @connection: A #GUnixConnection.
32849 * @cancellable: (allow-none): A #GCancellable or %NULL.
32850 * @error: Return location for error or %NULL.
32852 * Passes the credentials of the current user the receiving side
32853 * of the connection. The receiving end has to call
32854 * g_unix_connection_receive_credentials() (or similar) to accept the
32857 * As well as sending the credentials this also writes a single NUL
32858 * byte to the stream, as this is required for credentials passing to
32859 * work on some implementations.
32861 * Other ways to exchange credentials with a foreign peer includes the
32862 * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
32864 * Returns: %TRUE on success, %FALSE if @error is set.
32870 * g_unix_connection_send_credentials_async:
32871 * @connection: A #GUnixConnection.
32872 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32873 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
32874 * @user_data: (closure): the data to pass to callback function
32876 * Asynchronously send credentials.
32878 * For more details, see g_unix_connection_send_credentials() which is
32879 * the synchronous version of this call.
32881 * When the operation is finished, @callback will be called. You can then call
32882 * g_unix_connection_send_credentials_finish() to get the result of the operation.
32889 * g_unix_connection_send_credentials_finish:
32890 * @connection: A #GUnixConnection.
32891 * @result: a #GAsyncResult.
32892 * @error: a #GError, or %NULL
32894 * Finishes an asynchronous send credentials operation started with
32895 * g_unix_connection_send_credentials_async().
32897 * Returns: %TRUE if the operation was successful, otherwise %FALSE.
32903 * g_unix_connection_send_fd:
32904 * @connection: a #GUnixConnection
32905 * @fd: a file descriptor
32906 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32907 * @error: (allow-none): #GError for error reporting, or %NULL to ignore.
32909 * Passes a file descriptor to the receiving side of the
32910 * connection. The receiving end has to call g_unix_connection_receive_fd()
32911 * to accept the file descriptor.
32913 * As well as sending the fd this also writes a single byte to the
32914 * stream, as this is required for fd passing to work on some
32917 * Returns: a %TRUE on success, %NULL on error.
32923 * g_unix_credentials_message_get_credentials:
32924 * @message: A #GUnixCredentialsMessage.
32926 * Gets the credentials stored in @message.
32928 * Returns: (transfer none): A #GCredentials instance. Do not free, it is owned by @message.
32934 * g_unix_credentials_message_is_supported:
32936 * Checks if passing #GCredentials on a #GSocket is supported on this platform.
32938 * Returns: %TRUE if supported, %FALSE otherwise
32944 * g_unix_credentials_message_new:
32946 * Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
32948 * Returns: a new #GUnixCredentialsMessage
32954 * g_unix_credentials_message_new_with_credentials:
32955 * @credentials: A #GCredentials object.
32957 * Creates a new #GUnixCredentialsMessage holding @credentials.
32959 * Returns: a new #GUnixCredentialsMessage
32965 * g_unix_fd_list_append:
32966 * @list: a #GUnixFDList
32967 * @fd: a valid open file descriptor
32968 * @error: a #GError pointer
32970 * Adds a file descriptor to @list.
32972 * The file descriptor is duplicated using dup(). You keep your copy
32973 * of the descriptor and the copy contained in @list will be closed
32974 * when @list is finalized.
32976 * A possible cause of failure is exceeding the per-process or
32977 * system-wide file descriptor limit.
32979 * The index of the file descriptor in the list is returned. If you use
32980 * this index with g_unix_fd_list_get() then you will receive back a
32981 * duplicated copy of the same file descriptor.
32983 * Returns: the index of the appended fd in case of success, else -1 (and @error is set)
32989 * g_unix_fd_list_get:
32990 * @list: a #GUnixFDList
32991 * @index_: the index into the list
32992 * @error: a #GError pointer
32994 * Gets a file descriptor out of @list.
32996 * @index_ specifies the index of the file descriptor to get. It is a
32997 * programmer error for @index_ to be out of range; see
32998 * g_unix_fd_list_get_length().
33000 * The file descriptor is duplicated using dup() and set as
33001 * close-on-exec before being returned. You must call close() on it
33002 * when you are done.
33004 * A possible cause of failure is exceeding the per-process or
33005 * system-wide file descriptor limit.
33007 * Returns: the file descriptor, or -1 in case of error
33013 * g_unix_fd_list_get_length:
33014 * @list: a #GUnixFDList
33016 * Gets the length of @list (ie: the number of file descriptors
33017 * contained within).
33019 * Returns: the length of @list
33025 * g_unix_fd_list_new:
33027 * Creates a new #GUnixFDList containing no file descriptors.
33029 * Returns: a new #GUnixFDList
33035 * g_unix_fd_list_new_from_array:
33036 * @fds: (array length=n_fds): the initial list of file descriptors
33037 * @n_fds: the length of #fds, or -1
33039 * Creates a new #GUnixFDList containing the file descriptors given in
33040 * @fds. The file descriptors become the property of the new list and
33041 * may no longer be used by the caller. The array itself is owned by
33044 * Each file descriptor in the array should be set to close-on-exec.
33046 * If @n_fds is -1 then @fds must be terminated with -1.
33048 * Returns: a new #GUnixFDList
33054 * g_unix_fd_list_peek_fds:
33055 * @list: a #GUnixFDList
33056 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
33058 * Returns the array of file descriptors that is contained in this
33061 * After this call, the descriptors remain the property of @list. The
33062 * caller must not close them and must not free the array. The array is
33063 * valid only until @list is changed in any way.
33065 * If @length is non-%NULL then it is set to the number of file
33066 * descriptors in the returned array. The returned array is also
33067 * terminated with -1.
33069 * This function never returns %NULL. In case there are no file
33070 * descriptors contained in @list, an empty array is returned.
33072 * Returns: (array length=length) (transfer none): an array of file descriptors
33078 * g_unix_fd_list_steal_fds:
33079 * @list: a #GUnixFDList
33080 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
33082 * Returns the array of file descriptors that is contained in this
33085 * After this call, the descriptors are no longer contained in
33086 * @list. Further calls will return an empty list (unless more
33087 * descriptors have been added).
33089 * The return result of this function must be freed with g_free().
33090 * The caller is also responsible for closing all of the file
33091 * descriptors. The file descriptors in the array are set to
33094 * If @length is non-%NULL then it is set to the number of file
33095 * descriptors in the returned array. The returned array is also
33096 * terminated with -1.
33098 * This function never returns %NULL. In case there are no file
33099 * descriptors contained in @list, an empty array is returned.
33101 * Returns: (array length=length) (transfer full): an array of file descriptors
33107 * g_unix_fd_message_append_fd:
33108 * @message: a #GUnixFDMessage
33109 * @fd: a valid open file descriptor
33110 * @error: a #GError pointer
33112 * Adds a file descriptor to @message.
33114 * The file descriptor is duplicated using dup(). You keep your copy
33115 * of the descriptor and the copy contained in @message will be closed
33116 * when @message is finalized.
33118 * A possible cause of failure is exceeding the per-process or
33119 * system-wide file descriptor limit.
33121 * Returns: %TRUE in case of success, else %FALSE (and @error is set)
33127 * g_unix_fd_message_get_fd_list:
33128 * @message: a #GUnixFDMessage
33130 * Gets the #GUnixFDList contained in @message. This function does not
33131 * return a reference to the caller, but the returned list is valid for
33132 * the lifetime of @message.
33134 * Returns: (transfer none): the #GUnixFDList from @message
33140 * g_unix_fd_message_new:
33142 * Creates a new #GUnixFDMessage containing an empty file descriptor
33145 * Returns: a new #GUnixFDMessage
33151 * g_unix_fd_message_new_with_fd_list:
33152 * @fd_list: a #GUnixFDList
33154 * Creates a new #GUnixFDMessage containing @list.
33156 * Returns: a new #GUnixFDMessage
33162 * g_unix_fd_message_steal_fds:
33163 * @message: a #GUnixFDMessage
33164 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
33166 * Returns the array of file descriptors that is contained in this
33169 * After this call, the descriptors are no longer contained in
33170 * @message. Further calls will return an empty list (unless more
33171 * descriptors have been added).
33173 * The return result of this function must be freed with g_free().
33174 * The caller is also responsible for closing all of the file
33177 * If @length is non-%NULL then it is set to the number of file
33178 * descriptors in the returned array. The returned array is also
33179 * terminated with -1.
33181 * This function never returns %NULL. In case there are no file
33182 * descriptors contained in @message, an empty array is returned.
33184 * Returns: (array length=length) (transfer full): an array of file descriptors
33190 * g_unix_input_stream_get_close_fd:
33191 * @stream: a #GUnixInputStream
33193 * Returns whether the file descriptor of @stream will be
33194 * closed when the stream is closed.
33196 * Returns: %TRUE if the file descriptor is closed when done
33202 * g_unix_input_stream_get_fd:
33203 * @stream: a #GUnixInputStream
33205 * Return the UNIX file descriptor that the stream reads from.
33207 * Returns: The file descriptor of @stream
33213 * g_unix_input_stream_new:
33214 * @fd: a UNIX file descriptor
33215 * @close_fd: %TRUE to close the file descriptor when done
33217 * Creates a new #GUnixInputStream for the given @fd.
33219 * If @close_fd is %TRUE, the file descriptor will be closed
33220 * when the stream is closed.
33222 * Returns: a new #GUnixInputStream
33227 * g_unix_input_stream_set_close_fd:
33228 * @stream: a #GUnixInputStream
33229 * @close_fd: %TRUE to close the file descriptor when done
33231 * Sets whether the file descriptor of @stream shall be closed
33232 * when the stream is closed.
33239 * g_unix_is_mount_path_system_internal:
33240 * @mount_path: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
33242 * Determines if @mount_path is considered an implementation of the
33243 * OS. This is primarily used for hiding mountable and mounted volumes
33244 * that only are used in the OS and has little to no relevance to the
33247 * Returns: %TRUE if @mount_path is considered an implementation detail of the OS.
33252 * g_unix_mount_at: (skip)
33253 * @mount_path: path for a possible unix mount.
33254 * @time_read: (out) (allow-none): guint64 to contain a timestamp.
33256 * Gets a #GUnixMountEntry for a given mount path. If @time_read
33257 * is set, it will be filled with a unix timestamp for checking
33258 * if the mounts have changed since with g_unix_mounts_changed_since().
33260 * Returns: (transfer full): a #GUnixMountEntry.
33265 * g_unix_mount_compare:
33266 * @mount1: first #GUnixMountEntry to compare.
33267 * @mount2: second #GUnixMountEntry to compare.
33269 * Compares two unix mounts.
33271 * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
33276 * g_unix_mount_free:
33277 * @mount_entry: a #GUnixMountEntry.
33279 * Frees a unix mount.
33284 * g_unix_mount_get_device_path:
33285 * @mount_entry: a #GUnixMount.
33287 * Gets the device path for a unix mount.
33289 * Returns: a string containing the device path.
33294 * g_unix_mount_get_fs_type:
33295 * @mount_entry: a #GUnixMount.
33297 * Gets the filesystem type for the unix mount.
33299 * Returns: a string containing the file system type.
33304 * g_unix_mount_get_mount_path:
33305 * @mount_entry: input #GUnixMountEntry to get the mount path for.
33307 * Gets the mount path for a unix mount.
33309 * Returns: the mount path for @mount_entry.
33314 * g_unix_mount_guess_can_eject:
33315 * @mount_entry: a #GUnixMountEntry
33317 * Guesses whether a Unix mount can be ejected.
33319 * Returns: %TRUE if @mount_entry is deemed to be ejectable.
33324 * g_unix_mount_guess_icon:
33325 * @mount_entry: a #GUnixMountEntry
33327 * Guesses the icon of a Unix mount.
33329 * Returns: (transfer full): a #GIcon
33334 * g_unix_mount_guess_name:
33335 * @mount_entry: a #GUnixMountEntry
33337 * Guesses the name of a Unix mount.
33338 * The result is a translated string.
33340 * Returns: A newly allocated string that must be freed with g_free()
33345 * g_unix_mount_guess_should_display:
33346 * @mount_entry: a #GUnixMountEntry
33348 * Guesses whether a Unix mount should be displayed in the UI.
33350 * Returns: %TRUE if @mount_entry is deemed to be displayable.
33355 * g_unix_mount_guess_symbolic_icon:
33356 * @mount_entry: a #GUnixMountEntry
33358 * Guesses the symbolic icon of a Unix mount.
33360 * Returns: (transfer full): a #GIcon
33366 * g_unix_mount_is_readonly:
33367 * @mount_entry: a #GUnixMount.
33369 * Checks if a unix mount is mounted read only.
33371 * Returns: %TRUE if @mount_entry is read only.
33376 * g_unix_mount_is_system_internal:
33377 * @mount_entry: a #GUnixMount.
33379 * Checks if a unix mount is a system path.
33381 * Returns: %TRUE if the unix mount is for a system path.
33386 * g_unix_mount_monitor_new:
33388 * Gets a new #GUnixMountMonitor. The default rate limit for which the
33389 * monitor will report consecutive changes for the mount and mount
33390 * point entry files is the default for a #GFileMonitor. Use
33391 * g_unix_mount_monitor_set_rate_limit() to change this.
33393 * Returns: a #GUnixMountMonitor.
33398 * g_unix_mount_monitor_set_rate_limit:
33399 * @mount_monitor: a #GUnixMountMonitor
33400 * @limit_msec: a integer with the limit in milliseconds to poll for changes.
33402 * Sets the rate limit to which the @mount_monitor will report
33403 * consecutive change events to the mount and mount point entry files.
33410 * g_unix_mount_point_compare:
33411 * @mount1: a #GUnixMount.
33412 * @mount2: a #GUnixMount.
33414 * Compares two unix mount points.
33416 * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
33421 * g_unix_mount_point_free:
33422 * @mount_point: unix mount point to free.
33424 * Frees a unix mount point.
33429 * g_unix_mount_point_get_device_path:
33430 * @mount_point: a #GUnixMountPoint.
33432 * Gets the device path for a unix mount point.
33434 * Returns: a string containing the device path.
33439 * g_unix_mount_point_get_fs_type:
33440 * @mount_point: a #GUnixMountPoint.
33442 * Gets the file system type for the mount point.
33444 * Returns: a string containing the file system type.
33449 * g_unix_mount_point_get_mount_path:
33450 * @mount_point: a #GUnixMountPoint.
33452 * Gets the mount path for a unix mount point.
33454 * Returns: a string containing the mount path.
33459 * g_unix_mount_point_get_options:
33460 * @mount_point: a #GUnixMountPoint.
33462 * Gets the options for the mount point.
33464 * Returns: a string containing the options.
33470 * g_unix_mount_point_guess_can_eject:
33471 * @mount_point: a #GUnixMountPoint
33473 * Guesses whether a Unix mount point can be ejected.
33475 * Returns: %TRUE if @mount_point is deemed to be ejectable.
33480 * g_unix_mount_point_guess_icon:
33481 * @mount_point: a #GUnixMountPoint
33483 * Guesses the icon of a Unix mount point.
33485 * Returns: (transfer full): a #GIcon
33490 * g_unix_mount_point_guess_name:
33491 * @mount_point: a #GUnixMountPoint
33493 * Guesses the name of a Unix mount point.
33494 * The result is a translated string.
33496 * Returns: A newly allocated string that must be freed with g_free()
33501 * g_unix_mount_point_guess_symbolic_icon:
33502 * @mount_point: a #GUnixMountPoint
33504 * Guesses the symbolic icon of a Unix mount point.
33506 * Returns: (transfer full): a #GIcon
33512 * g_unix_mount_point_is_loopback:
33513 * @mount_point: a #GUnixMountPoint.
33515 * Checks if a unix mount point is a loopback device.
33517 * Returns: %TRUE if the mount point is a loopback. %FALSE otherwise.
33522 * g_unix_mount_point_is_readonly:
33523 * @mount_point: a #GUnixMountPoint.
33525 * Checks if a unix mount point is read only.
33527 * Returns: %TRUE if a mount point is read only.
33532 * g_unix_mount_point_is_user_mountable:
33533 * @mount_point: a #GUnixMountPoint.
33535 * Checks if a unix mount point is mountable by the user.
33537 * Returns: %TRUE if the mount point is user mountable.
33542 * g_unix_mount_points_changed_since:
33543 * @time: guint64 to contain a timestamp.
33545 * Checks if the unix mount points have changed since a given unix time.
33547 * Returns: %TRUE if the mount points have changed since @time.
33552 * g_unix_mount_points_get: (skip)
33553 * @time_read: (out) (allow-none): guint64 to contain a timestamp.
33555 * Gets a #GList of #GUnixMountPoint containing the unix mount points.
33556 * If @time_read is set, it will be filled with the mount timestamp,
33557 * allowing for checking if the mounts have changed with
33558 * g_unix_mount_points_changed_since().
33560 * Returns: (element-type GUnixMountPoint) (transfer full): a #GList of the UNIX mountpoints.
33565 * g_unix_mounts_changed_since:
33566 * @time: guint64 to contain a timestamp.
33568 * Checks if the unix mounts have changed since a given unix time.
33570 * Returns: %TRUE if the mounts have changed since @time.
33575 * g_unix_mounts_get: (skip)
33576 * @time_read: (out) (allow-none): guint64 to contain a timestamp, or %NULL
33578 * Gets a #GList of #GUnixMountEntry containing the unix mounts.
33579 * If @time_read is set, it will be filled with the mount
33580 * timestamp, allowing for checking if the mounts have changed
33581 * with g_unix_mounts_changed_since().
33583 * Returns: (element-type GUnixMountEntry) (transfer full): a #GList of the UNIX mounts.
33588 * g_unix_output_stream_get_close_fd:
33589 * @stream: a #GUnixOutputStream
33591 * Returns whether the file descriptor of @stream will be
33592 * closed when the stream is closed.
33594 * Returns: %TRUE if the file descriptor is closed when done
33600 * g_unix_output_stream_get_fd:
33601 * @stream: a #GUnixOutputStream
33603 * Return the UNIX file descriptor that the stream writes to.
33605 * Returns: The file descriptor of @stream
33611 * g_unix_output_stream_new:
33612 * @fd: a UNIX file descriptor
33613 * @close_fd: %TRUE to close the file descriptor when done
33615 * Creates a new #GUnixOutputStream for the given @fd.
33617 * If @close_fd, is %TRUE, the file descriptor will be closed when
33618 * the output stream is destroyed.
33620 * Returns: a new #GOutputStream
33625 * g_unix_output_stream_set_close_fd:
33626 * @stream: a #GUnixOutputStream
33627 * @close_fd: %TRUE to close the file descriptor when done
33629 * Sets whether the file descriptor of @stream shall be closed
33630 * when the stream is closed.
33637 * g_unix_socket_address_abstract_names_supported:
33639 * Checks if abstract UNIX domain socket names are supported.
33641 * Returns: %TRUE if supported, %FALSE otherwise
33647 * g_unix_socket_address_get_address_type:
33648 * @address: a #GInetSocketAddress
33650 * Gets @address's type.
33652 * Returns: a #GUnixSocketAddressType
33658 * g_unix_socket_address_get_is_abstract:
33659 * @address: a #GInetSocketAddress
33661 * Tests if @address is abstract.
33663 * Returns: %TRUE if the address is abstract, %FALSE otherwise
33665 * Deprecated: Use g_unix_socket_address_get_address_type()
33670 * g_unix_socket_address_get_path:
33671 * @address: a #GInetSocketAddress
33673 * Gets @address's path, or for abstract sockets the "name".
33675 * Guaranteed to be zero-terminated, but an abstract socket
33676 * may contain embedded zeros, and thus you should use
33677 * g_unix_socket_address_get_path_len() to get the true length
33680 * Returns: the path for @address
33686 * g_unix_socket_address_get_path_len:
33687 * @address: a #GInetSocketAddress
33689 * Gets the length of @address's path.
33691 * For details, see g_unix_socket_address_get_path().
33693 * Returns: the length of the path
33699 * g_unix_socket_address_new:
33700 * @path: the socket path
33702 * Creates a new #GUnixSocketAddress for @path.
33704 * To create abstract socket addresses, on systems that support that,
33705 * use g_unix_socket_address_new_abstract().
33707 * Returns: a new #GUnixSocketAddress
33713 * g_unix_socket_address_new_abstract:
33714 * @path: (array length=path_len) (element-type gchar): the abstract name
33715 * @path_len: the length of @path, or -1
33717 * Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
33718 * #GUnixSocketAddress for @path.
33720 * Returns: a new #GUnixSocketAddress
33721 * Deprecated: Use g_unix_socket_address_new_with_type().
33726 * g_unix_socket_address_new_with_type:
33727 * @path: (array length=path_len) (element-type gchar): the name
33728 * @path_len: the length of @path, or -1
33729 * @type: a #GUnixSocketAddressType
33731 * Creates a new #GUnixSocketAddress of type @type with name @path.
33733 * If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
33734 * calling g_unix_socket_address_new().
33736 * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
33737 * bytes of @path will be copied to the socket's path, and only those
33738 * bytes will be considered part of the name. (If @path_len is -1,
33739 * then @path is assumed to be NUL-terminated.) For example, if @path
33740 * was "test", then calling g_socket_address_get_native_size() on the
33741 * returned socket would return 7 (2 bytes of overhead, 1 byte for the
33742 * abstract-socket indicator byte, and 4 bytes for the name "test").
33744 * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
33745 * @path_len bytes of @path will be copied to the socket's path, the
33746 * rest of the path will be padded with 0 bytes, and the entire
33747 * zero-padded buffer will be considered the name. (As above, if
33748 * @path_len is -1, then @path is assumed to be NUL-terminated.) In
33749 * this case, g_socket_address_get_native_size() will always return
33750 * the full size of a <literal>struct sockaddr_un</literal>, although
33751 * g_unix_socket_address_get_path_len() will still return just the
33754 * %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
33755 * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
33756 * when connecting to a server created by another process, you must
33757 * use the appropriate type corresponding to how that process created
33758 * its listening socket.
33760 * Returns: a new #GUnixSocketAddress
33766 * g_vfs_get_default:
33768 * Gets the default #GVfs for the system.
33770 * Returns: (transfer none): a #GVfs.
33775 * g_vfs_get_file_for_path:
33777 * @path: a string containing a VFS path.
33779 * Gets a #GFile for @path.
33781 * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
33786 * g_vfs_get_file_for_uri:
33788 * @uri: a string containing a URI
33790 * Gets a #GFile for @uri.
33792 * This operation never fails, but the returned object
33793 * might not support any I/O operation if the URI
33794 * is malformed or if the URI scheme is not supported.
33796 * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
33803 * Gets the local #GVfs for the system.
33805 * Returns: (transfer none): a #GVfs.
33810 * g_vfs_get_supported_uri_schemes:
33813 * Gets a list of URI schemes supported by @vfs.
33815 * Returns: (transfer none): a %NULL-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
33823 * Checks if the VFS is active.
33825 * Returns: %TRUE if construction of the @vfs was successful and it is now active.
33830 * g_vfs_parse_name:
33832 * @parse_name: a string to be parsed by the VFS module.
33834 * This operation never fails, but the returned object might
33835 * not support any I/O operations if the @parse_name cannot
33836 * be parsed by the #GVfs module.
33838 * Returns: (transfer full): a #GFile for the given @parse_name. Free the returned object with g_object_unref().
33843 * g_volume_can_eject:
33844 * @volume: a #GVolume.
33846 * Checks if a volume can be ejected.
33848 * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise.
33853 * g_volume_can_mount:
33854 * @volume: a #GVolume.
33856 * Checks if a volume can be mounted.
33858 * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise.
33864 * @volume: a #GVolume.
33865 * @flags: flags affecting the unmount if required for eject
33866 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33867 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33868 * @user_data: user data that gets passed to @callback
33870 * Ejects a volume. This is an asynchronous operation, and is
33871 * finished by calling g_volume_eject_finish() with the @volume
33872 * and #GAsyncResult returned in the @callback.
33874 * Deprecated: 2.22: Use g_volume_eject_with_operation() instead.
33879 * g_volume_eject_finish:
33880 * @volume: pointer to a #GVolume.
33881 * @result: a #GAsyncResult.
33882 * @error: a #GError location to store an error, or %NULL to ignore
33884 * Finishes ejecting a volume. If any errors occurred during the operation,
33885 * @error will be set to contain the errors and %FALSE will be returned.
33887 * Returns: %TRUE, %FALSE if operation failed.
33888 * Deprecated: 2.22: Use g_volume_eject_with_operation_finish() instead.
33893 * g_volume_eject_with_operation:
33894 * @volume: a #GVolume.
33895 * @flags: flags affecting the unmount if required for eject
33896 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
33897 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33898 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33899 * @user_data: user data passed to @callback.
33901 * Ejects a volume. This is an asynchronous operation, and is
33902 * finished by calling g_volume_eject_with_operation_finish() with the @volume
33903 * and #GAsyncResult data returned in the @callback.
33910 * g_volume_eject_with_operation_finish:
33911 * @volume: a #GVolume.
33912 * @result: a #GAsyncResult.
33913 * @error: a #GError location to store the error occurring, or %NULL to ignore.
33915 * Finishes ejecting a volume. If any errors occurred during the operation,
33916 * @error will be set to contain the errors and %FALSE will be returned.
33918 * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise.
33924 * g_volume_enumerate_identifiers:
33925 * @volume: a #GVolume
33927 * Gets the kinds of <link linkend="volume-identifier">identifiers</link>
33928 * that @volume has. Use g_volume_get_identifier() to obtain
33929 * the identifiers themselves.
33931 * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
33936 * g_volume_get_activation_root:
33937 * @volume: a #GVolume
33939 * Gets the activation root for a #GVolume if it is known ahead of
33940 * mount time. Returns %NULL otherwise. If not %NULL and if @volume
33941 * is mounted, then the result of g_mount_get_root() on the
33942 * #GMount object obtained from g_volume_get_mount() will always
33943 * either be equal or a prefix of what this function returns. In
33944 * other words, in code
33948 * GFile *mount_root
33949 * GFile *volume_activation_root;
33951 * mount = g_volume_get_mount (volume); /* mounted, so never NULL */
33952 * mount_root = g_mount_get_root (mount);
33953 * volume_activation_root = g_volume_get_activation_root(volume); /* assume not NULL */
33954 * </programlisting>
33956 * then the expression
33959 * (g_file_has_prefix (volume_activation_root, mount_root) ||
33960 * g_file_equal (volume_activation_root, mount_root))
33961 * </programlisting>
33963 * will always be %TRUE.
33965 * Activation roots are typically used in #GVolumeMonitor
33966 * implementations to find the underlying mount to shadow, see
33967 * g_mount_is_shadowed() for more details.
33969 * Returns: (transfer full): the activation root of @volume or %NULL. Use g_object_unref() to free.
33975 * g_volume_get_drive:
33976 * @volume: a #GVolume.
33978 * Gets the drive for the @volume.
33980 * Returns: (transfer full): a #GDrive or %NULL if @volume is not associated with a drive. The returned object should be unreffed with g_object_unref() when no longer needed.
33985 * g_volume_get_icon:
33986 * @volume: a #GVolume.
33988 * Gets the icon for @volume.
33990 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
33995 * g_volume_get_identifier:
33996 * @volume: a #GVolume
33997 * @kind: the kind of identifier to return
33999 * Gets the identifier of the given kind for @volume.
34000 * See the <link linkend="volume-identifier">introduction</link>
34001 * for more information about volume identifiers.
34003 * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GVolume doesn't have this kind of identifier
34008 * g_volume_get_mount:
34009 * @volume: a #GVolume.
34011 * Gets the mount for the @volume.
34013 * Returns: (transfer full): a #GMount or %NULL if @volume isn't mounted. The returned object should be unreffed with g_object_unref() when no longer needed.
34018 * g_volume_get_name:
34019 * @volume: a #GVolume.
34021 * Gets the name of @volume.
34023 * Returns: the name for the given @volume. The returned string should be freed with g_free() when no longer needed.
34028 * g_volume_get_sort_key:
34029 * @volume: A #GVolume.
34031 * Gets the sort key for @volume, if any.
34033 * Returns: Sorting key for @volume or %NULL if no such key is available.
34039 * g_volume_get_symbolic_icon:
34040 * @volume: a #GVolume.
34042 * Gets the symbolic icon for @volume.
34044 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
34050 * g_volume_get_uuid:
34051 * @volume: a #GVolume.
34053 * Gets the UUID for the @volume. The reference is typically based on
34054 * the file system UUID for the volume in question and should be
34055 * considered an opaque string. Returns %NULL if there is no UUID
34058 * Returns: the UUID for @volume or %NULL if no UUID can be computed. The returned string should be freed with g_free() when no longer needed.
34063 * g_volume_monitor_adopt_orphan_mount:
34064 * @mount: a #GMount object to find a parent for
34066 * This function should be called by any #GVolumeMonitor
34067 * implementation when a new #GMount object is created that is not
34068 * associated with a #GVolume object. It must be called just before
34069 * emitting the @mount_added signal.
34071 * If the return value is not %NULL, the caller must associate the
34072 * returned #GVolume object with the #GMount. This involves returning
34073 * it in its g_mount_get_volume() implementation. The caller must
34074 * also listen for the "removed" signal on the returned object
34075 * and give up its reference when handling that signal
34077 * Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
34078 * the implementor must take a reference to @mount and return it in
34079 * its g_volume_get_mount() implemented. Also, the implementor must
34080 * listen for the "unmounted" signal on @mount and give up its
34081 * reference upon handling that signal.
34083 * There are two main use cases for this function.
34085 * One is when implementing a user space file system driver that reads
34086 * blocks of a block device that is already represented by the native
34087 * volume monitor (for example a CD Audio file system driver). Such
34088 * a driver will generate its own #GMount object that needs to be
34089 * associated with the #GVolume object that represents the volume.
34091 * The other is for implementing a #GVolumeMonitor whose sole purpose
34092 * is to return #GVolume objects representing entries in the users
34093 * "favorite servers" list or similar.
34095 * Returns: (transfer full): the #GVolume object that is the parent for @mount or %NULL if no wants to adopt the #GMount.
34096 * Deprecated: 2.20: Instead of using this function, #GVolumeMonitor implementations should instead create shadow mounts with the URI of the mount they intend to adopt. See the proxy volume monitor in gvfs for an example of this. Also see g_mount_is_shadowed(), g_mount_shadow() and g_mount_unshadow() functions.
34101 * g_volume_monitor_get:
34103 * Gets the volume monitor used by gio.
34105 * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call g_object_unref() when done with it.
34110 * g_volume_monitor_get_connected_drives:
34111 * @volume_monitor: a #GVolumeMonitor.
34113 * Gets a list of drives connected to the system.
34115 * The returned list should be freed with g_list_free(), after
34116 * its elements have been unreffed with g_object_unref().
34118 * Returns: (element-type GDrive) (transfer full): a #GList of connected #GDrive objects.
34123 * g_volume_monitor_get_mount_for_uuid:
34124 * @volume_monitor: a #GVolumeMonitor.
34125 * @uuid: the UUID to look for
34127 * Finds a #GMount object by its UUID (see g_mount_get_uuid())
34129 * Returns: (transfer full): a #GMount or %NULL if no such mount is available. Free the returned object with g_object_unref().
34134 * g_volume_monitor_get_mounts:
34135 * @volume_monitor: a #GVolumeMonitor.
34137 * Gets a list of the mounts on the system.
34139 * The returned list should be freed with g_list_free(), after
34140 * its elements have been unreffed with g_object_unref().
34142 * Returns: (element-type GMount) (transfer full): a #GList of #GMount objects.
34147 * g_volume_monitor_get_volume_for_uuid:
34148 * @volume_monitor: a #GVolumeMonitor.
34149 * @uuid: the UUID to look for
34151 * Finds a #GVolume object by its UUID (see g_volume_get_uuid())
34153 * Returns: (transfer full): a #GVolume or %NULL if no such volume is available. Free the returned object with g_object_unref().
34158 * g_volume_monitor_get_volumes:
34159 * @volume_monitor: a #GVolumeMonitor.
34161 * Gets a list of the volumes on the system.
34163 * The returned list should be freed with g_list_free(), after
34164 * its elements have been unreffed with g_object_unref().
34166 * Returns: (element-type GVolume) (transfer full): a #GList of #GVolume objects.
34172 * @volume: a #GVolume.
34173 * @flags: flags affecting the operation
34174 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
34175 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
34176 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
34177 * @user_data: user data that gets passed to @callback
34179 * Mounts a volume. This is an asynchronous operation, and is
34180 * finished by calling g_volume_mount_finish() with the @volume
34181 * and #GAsyncResult returned in the @callback.
34183 * Virtual: mount_fn
34188 * g_volume_mount_finish:
34189 * @volume: a #GVolume
34190 * @result: a #GAsyncResult
34191 * @error: a #GError location to store an error, or %NULL to ignore
34193 * Finishes mounting a volume. If any errors occurred during the operation,
34194 * @error will be set to contain the errors and %FALSE will be returned.
34196 * If the mount operation succeeded, g_volume_get_mount() on @volume
34197 * is guaranteed to return the mount right after calling this
34198 * function; there's no need to listen for the 'mount-added' signal on
34201 * Returns: %TRUE, %FALSE if operation failed.
34206 * g_volume_should_automount:
34207 * @volume: a #GVolume
34209 * Returns whether the volume should be automatically mounted.
34211 * Returns: %TRUE if the volume should be automatically mounted.
34216 * g_win32_input_stream_get_close_handle:
34217 * @stream: a #GWin32InputStream
34219 * Returns whether the handle of @stream will be
34220 * closed when the stream is closed.
34222 * Returns: %TRUE if the handle is closed when done
34228 * g_win32_input_stream_get_handle:
34229 * @stream: a #GWin32InputStream
34231 * Return the Windows file handle that the stream reads from.
34233 * Returns: The file handle of @stream
34239 * g_win32_input_stream_new:
34240 * @handle: a Win32 file handle
34241 * @close_handle: %TRUE to close the handle when done
34243 * Creates a new #GWin32InputStream for the given @handle.
34245 * If @close_handle is %TRUE, the handle will be closed
34246 * when the stream is closed.
34248 * Note that "handle" here means a Win32 HANDLE, not a "file descriptor"
34249 * as used in the Windows C libraries.
34251 * Returns: a new #GWin32InputStream
34256 * g_win32_input_stream_set_close_handle:
34257 * @stream: a #GWin32InputStream
34258 * @close_handle: %TRUE to close the handle when done
34260 * Sets whether the handle of @stream shall be closed
34261 * when the stream is closed.
34268 * g_win32_output_stream_get_close_handle:
34269 * @stream: a #GWin32OutputStream
34271 * Returns whether the handle of @stream will be closed when the
34272 * stream is closed.
34274 * Returns: %TRUE if the handle is closed when done
34280 * g_win32_output_stream_get_handle:
34281 * @stream: a #GWin32OutputStream
34283 * Return the Windows handle that the stream writes to.
34285 * Returns: The handle descriptor of @stream
34291 * g_win32_output_stream_new:
34292 * @handle: a Win32 file handle
34293 * @close_handle: %TRUE to close the handle when done
34295 * Creates a new #GWin32OutputStream for the given @handle.
34297 * If @close_handle, is %TRUE, the handle will be closed when the
34298 * output stream is destroyed.
34300 * Returns: a new #GOutputStream
34306 * g_win32_output_stream_set_close_handle:
34307 * @stream: a #GWin32OutputStream
34308 * @close_handle: %TRUE to close the handle when done
34310 * Sets whether the handle of @stream shall be closed when the stream
34318 * g_zlib_compressor_get_file_info:
34319 * @compressor: a #GZlibCompressor
34321 * Returns the #GZlibCompressor:file-info property.
34323 * Returns: (transfer none): a #GFileInfo, or %NULL
34329 * g_zlib_compressor_new:
34330 * @format: The format to use for the compressed data
34331 * @level: compression level (0-9), -1 for default
34333 * Creates a new #GZlibCompressor.
34335 * Returns: a new #GZlibCompressor
34341 * g_zlib_compressor_set_file_info:
34342 * @compressor: a #GZlibCompressor
34343 * @file_info: (allow-none): a #GFileInfo
34345 * Sets @file_info in @compressor. If non-%NULL, and @compressor's
34346 * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
34347 * it will be used to set the file name and modification time in
34348 * the GZIP header of the compressed data.
34350 * Note: it is an error to call this function while a compression is in
34351 * progress; it may only be called immediately after creation of @compressor,
34352 * or after resetting it with g_converter_reset().
34359 * g_zlib_decompressor_get_file_info:
34360 * @decompressor: a #GZlibDecompressor
34362 * Retrieves the #GFileInfo constructed from the GZIP header data
34363 * of compressed data processed by @compressor, or %NULL if @decompressor's
34364 * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
34365 * or the header data was not fully processed yet, or it not present in the
34366 * data stream at all.
34368 * Returns: (transfer none): a #GFileInfo, or %NULL
34374 * g_zlib_decompressor_new:
34375 * @format: The format to use for the compressed data
34377 * Creates a new #GZlibDecompressor.
34379 * Returns: a new #GZlibDecompressor
34385 * get_all_desktop_entries_for_mime_type:
34386 * @mime_type: a mime type.
34387 * @except: NULL or a strv list
34389 * Returns all the desktop ids for @mime_type. The desktop files
34390 * are listed in an order so that default applications are listed before
34391 * non-default ones, and handlers for inherited mimetypes are listed
34392 * after the base ones.
34394 * Optionally doesn't list the desktop ids given in the @except
34396 * Returns: a #GList containing the desktop ids which claim to handle @mime_type.
34401 * mime_info_cache_reload:
34402 * @dir: directory path which needs reloading.
34404 * Reload the mime information for the @dir.
34409 /************************************************************/
34410 /* THIS FILE IS GENERATED DO NOT EDIT */
34411 /************************************************************/