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>.
4252 * If the other peer is using GDBus, and has registered the association with
4253 * g_dbus_error_register_error_domain() in advance (e.g. by invoking the %FOO_BAR_ERROR quark
4254 * generation itself in the previous example) the peer will see also %FOO_BAR_ERROR_ANOTHER_ERROR instead
4255 * of %G_IO_ERROR_DBUS_ERROR. Note that GDBus clients can still recover
4256 * <literal>org.project.Foo.Bar.Error.AnotherError</literal> using g_dbus_error_get_remote_error().
4258 * Note that errors in the %G_DBUS_ERROR error domain is intended only
4259 * for returning errors from a remote message bus process. Errors
4260 * generated locally in-process by e.g. #GDBusConnection is from the
4261 * %G_IO_ERROR domain.
4266 * SECTION:gdbusinterface
4267 * @short_description: Base type for D-Bus interfaces
4268 * @include: gio/gio.h
4270 * The #GDBusInterface type is the base type for D-Bus interfaces both
4271 * on the service side (see #GDBusInterfaceSkeleton) and client side
4272 * (see #GDBusProxy).
4277 * SECTION:gdbusinterfaceskeleton
4278 * @short_description: Service-side D-Bus interface
4279 * @include: gio/gio.h
4281 * Abstract base class for D-Bus interfaces on the service side.
4286 * SECTION:gdbusintrospection
4287 * @title: D-Bus Introspection Data
4288 * @short_description: Node and interface description data structures
4289 * @include: gio/gio.h
4291 * Various data structures and convenience routines to parse and
4292 * generate D-Bus introspection XML. Introspection information is
4293 * used when registering objects with g_dbus_connection_register_object().
4295 * The format of D-Bus introspection XML is specified in the
4296 * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format">D-Bus specification</ulink>.
4301 * SECTION:gdbusmenumodel
4302 * @title: GDBusMenuModel
4303 * @short_description: A D-Bus GMenuModel implementation
4304 * @see_also: <link linkend="gio-GMenuModel-exporter">GMenuModel Exporter</link>
4306 * #GDBusMenuModel is an implementation of #GMenuModel that can be used
4307 * as a proxy for a menu model that is exported over D-Bus with
4308 * g_dbus_connection_export_menu_model().
4313 * SECTION:gdbusmessage
4314 * @short_description: D-Bus Message
4315 * @include: gio/gio.h
4317 * A type for representing D-Bus messages that can be sent or received
4318 * on a #GDBusConnection.
4323 * SECTION:gdbusmethodinvocation
4324 * @short_description: Object for handling remote calls
4325 * @include: gio/gio.h
4327 * Instances of the #GDBusMethodInvocation class are used when
4328 * handling D-Bus method calls. It provides a way to asynchronously
4329 * return results and errors.
4331 * The normal way to obtain a #GDBusMethodInvocation object is to receive
4332 * it as an argument to the handle_method_call() function in a
4333 * #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
4338 * SECTION:gdbusnameowning
4339 * @title: Owning Bus Names
4340 * @short_description: Simple API for owning bus names
4341 * @include: gio/gio.h
4343 * Convenience API for owning bus names.
4345 * <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>
4350 * SECTION:gdbusnamewatching
4351 * @title: Watching Bus Names
4352 * @short_description: Simple API for watching bus names
4353 * @include: gio/gio.h
4355 * Convenience API for watching bus names.
4357 * <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>
4362 * SECTION:gdbusobject
4363 * @short_description: Base type for D-Bus objects
4364 * @include: gio/gio.h
4366 * The #GDBusObject type is the base type for D-Bus objects on both
4367 * the service side (see #GDBusObjectSkeleton) and the client side
4368 * (see #GDBusObjectProxy). It is essentially just a container of
4374 * SECTION:gdbusobjectmanager
4375 * @short_description: Base type for D-Bus object managers
4376 * @include: gio/gio.h
4378 * The #GDBusObjectManager type is the base type for service- and
4379 * client-side implementations of the standardized <ulink
4380 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4383 * See #GDBusObjectManagerClient for the client-side implementation
4384 * and #GDBusObjectManagerServer for the service-side implementation.
4389 * SECTION:gdbusobjectmanagerclient
4390 * @short_description: Client-side object manager
4391 * @include: gio/gio.h
4393 * #GDBusObjectManagerClient is used to create, monitor and delete object
4394 * proxies for remote objects exported by a #GDBusObjectManagerServer (or any
4395 * code implementing the <ulink
4396 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4399 * Once an instance of this type has been created, you can connect to
4400 * the #GDBusObjectManager::object-added and
4401 * #GDBusObjectManager::object-removed signals and inspect the
4402 * #GDBusObjectProxy objects returned by
4403 * g_dbus_object_manager_get_objects().
4405 * If the name for a #GDBusObjectManagerClient is not owned by anyone at
4406 * object construction time, the default behavior is to request the
4407 * message bus to launch an owner for the name. This behavior can be
4408 * disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
4409 * flag. It's also worth noting that this only works if the name of
4410 * interest is activatable in the first place. E.g. in some cases it
4411 * is not possible to launch an owner for the requested name. In this
4412 * case, #GDBusObjectManagerClient object construction still succeeds but
4413 * there will be no object proxies
4414 * (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
4415 * the #GDBusObjectManagerClient:name-owner property is %NULL.
4417 * The owner of the requested name can come and go (for example
4418 * consider a system service being restarted) – #GDBusObjectManagerClient
4419 * handles this case too; simply connect to the #GObject::notify
4420 * signal to watch for changes on the #GDBusObjectManagerClient:name-owner
4421 * property. When the name owner vanishes, the behavior is that
4422 * #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
4423 * emission of the #GObject::notify signal) and then
4424 * #GDBusObjectManager::object-removed signals are synthesized
4425 * for all currently existing object proxies. Since
4426 * #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
4427 * use this information to disambiguate a synthesized signal from a
4428 * genuine signal caused by object removal on the remote
4429 * #GDBusObjectManager. Similarly, when a new name owner appears,
4430 * #GDBusObjectManager::object-added signals are synthesized
4431 * while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
4432 * object proxies have been added, the #GDBusObjectManagerClient:name-owner
4433 * is set to the new name owner (this includes emission of the
4434 * #GObject::notify signal). Furthermore, you are guaranteed that
4435 * #GDBusObjectManagerClient:name-owner will alternate between a name owner
4436 * (e.g. <literal>:1.42</literal>) and %NULL even in the case where
4437 * the name of interest is atomically replaced
4439 * Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
4440 * instances. All signals (including the
4441 * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
4442 * signal) delivered to #GDBusProxy instances are guaranteed to
4443 * originate from the name owner. This guarantee along with the
4444 * behavior described above, means that certain race conditions
4445 * including the <emphasis><quote>half the proxy is from the old owner
4446 * and the other half is from the new owner</quote></emphasis> problem
4449 * To avoid having the application connect to signals on the returned
4450 * #GDBusObjectProxy and #GDBusProxy objects, the
4451 * #GDBusObject::interface-added,
4452 * #GDBusObject::interface-removed,
4453 * #GDBusProxy::g-properties-changed and
4454 * #GDBusProxy::g-signal signals
4455 * are also emitted on the #GDBusObjectManagerClient instance managing these
4456 * objects. The signals emitted are
4457 * #GDBusObjectManager::interface-added,
4458 * #GDBusObjectManager::interface-removed,
4459 * #GDBusObjectManagerClient::interface-proxy-properties-changed and
4460 * #GDBusObjectManagerClient::interface-proxy-signal.
4462 * Note that all callbacks and signals are emitted in the
4463 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4464 * that the #GDBusObjectManagerClient object was constructed
4465 * in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
4466 * originating from the #GDBusObjectManagerClient object will be created in
4467 * the same context and, consequently, will deliver signals in the
4473 * SECTION:gdbusobjectmanagerserver
4474 * @short_description: Service-side object manager
4475 * @include: gio/gio.h
4477 * #GDBusObjectManagerServer is used to export #GDBusObject instances using
4478 * the standardized <ulink
4479 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4480 * interface. For example, remote D-Bus clients can get all objects
4481 * and properties in a single call. Additionally, any change in the
4482 * object hierarchy is broadcast using signals. This means that D-Bus
4483 * clients can keep caches up to date by only listening to D-Bus
4486 * See #GDBusObjectManagerClient for the client-side code that is
4487 * intended to be used with #GDBusObjectManagerServer or any D-Bus
4488 * object implementing the org.freedesktop.DBus.ObjectManager
4494 * SECTION:gdbusobjectproxy
4495 * @short_description: Client-side D-Bus object
4496 * @include: gio/gio.h
4498 * A #GDBusObjectProxy is an object used to represent a remote object
4499 * with one or more D-Bus interfaces. Normally, you don't instantiate
4500 * a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
4501 * is used to obtain it.
4508 * SECTION:gdbusobjectskeleton
4509 * @short_description: Service-side D-Bus object
4510 * @include: gio/gio.h
4512 * A #GDBusObjectSkeleton instance is essentially a group of D-Bus
4513 * interfaces. The set of exported interfaces on the object may be
4514 * dynamic and change at runtime.
4516 * This type is intended to be used with #GDBusObjectManager.
4521 * SECTION:gdbusproxy
4522 * @short_description: Client-side D-Bus interface proxy
4523 * @include: gio/gio.h
4525 * #GDBusProxy is a base class used for proxies to access a D-Bus
4526 * interface on a remote object. A #GDBusProxy can be constructed for
4527 * both well-known and unique names.
4529 * By default, #GDBusProxy will cache all properties (and listen to
4530 * changes) of the remote object, and proxy all signals that gets
4531 * emitted. This behaviour can be changed by passing suitable
4532 * #GDBusProxyFlags when the proxy is created. If the proxy is for a
4533 * well-known name, the property cache is flushed when the name owner
4534 * vanishes and reloaded when a name owner appears.
4536 * If a #GDBusProxy is used for a well-known name, the owner of the
4537 * name is tracked and can be read from
4538 * #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
4539 * get notified of changes. Additionally, only signals and property
4540 * changes emitted from the current name owner are considered and
4541 * calls are always sent to the current name owner. This avoids a
4542 * number of race conditions when the name is lost by one owner and
4543 * claimed by another. However, if no name owner currently exists,
4544 * then calls will be sent to the well-known name which may result in
4545 * the message bus launching an owner (unless
4546 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
4548 * The generic #GDBusProxy::g-properties-changed and
4549 * #GDBusProxy::g-signal signals are not very convenient to work
4550 * with. Therefore, the recommended way of working with proxies is to
4551 * subclass #GDBusProxy, and have more natural properties and signals
4552 * in your derived class. See <xref linkend="gdbus-example-gdbus-codegen"/>
4553 * for how this can easily be done using the
4554 * <command><link linkend="gdbus-codegen">gdbus-codegen</link></command>
4557 * A #GDBusProxy instance can be used from multiple threads but note
4558 * that all signals (e.g. #GDBusProxy::g-signal, #GDBusProxy::g-properties-changed
4559 * and #GObject::notify) are emitted in the
4560 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4561 * of the thread where the instance was constructed.
4563 * <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>
4568 * SECTION:gdbusserver
4569 * @short_description: Helper for accepting connections
4570 * @include: gio/gio.h
4572 * #GDBusServer is a helper for listening to and accepting D-Bus
4573 * connections. This can be used to create a new D-Bus server, allowing two
4574 * peers to use the D-Bus protocol for their own specialized communication.
4575 * A server instance provided in this way will not perform message routing or
4576 * implement the org.freedesktop.DBus interface.
4578 * To just export an object on a well-known name on a message bus, such as the
4579 * session or system bus, you should instead use g_bus_own_name().
4581 * <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>
4586 * SECTION:gdbusutils
4587 * @title: D-Bus Utilities
4588 * @short_description: Various utilities related to D-Bus.
4589 * @include: gio/gio.h
4591 * Various utility routines related to D-Bus.
4596 * SECTION:gdesktopappinfo
4597 * @title: GDesktopAppInfo
4598 * @short_description: Application information from desktop files
4599 * @include: gio/gdesktopappinfo.h
4601 * #GDesktopAppInfo is an implementation of #GAppInfo based on
4604 * Note that <filename><gio/gdesktopappinfo.h></filename> belongs to
4605 * the UNIX-specific GIO interfaces, thus you have to use the
4606 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4612 * @short_description: Drive management
4613 * @include: gio/gio.h
4615 * #GDrive - this represent a piece of hardware connected to the machine.
4616 * It's generally only created for removable hardware or hardware with
4619 * #GDrive is a container class for #GVolume objects that stem from
4620 * the same piece of media. As such, #GDrive abstracts a drive with
4621 * (or without) removable media and provides operations for querying
4622 * whether media is available, determining whether media change is
4623 * automatically detected and ejecting the media.
4625 * If the #GDrive reports that media isn't automatically detected, one
4626 * can poll for media; typically one should not do this periodically
4627 * as a poll for media operation is potententially expensive and may
4628 * spin up the drive creating noise.
4630 * #GDrive supports starting and stopping drives with authentication
4631 * support for the former. This can be used to support a diverse set
4632 * of use cases including connecting/disconnecting iSCSI devices,
4633 * powering down external disk enclosures and starting/stopping
4634 * multi-disk devices such as RAID devices. Note that the actual
4635 * semantics and side-effects of starting/stopping a #GDrive may vary
4636 * according to implementation. To choose the correct verbs in e.g. a
4637 * file manager, use g_drive_get_start_stop_type().
4639 * For porting from GnomeVFS note that there is no equivalent of
4640 * #GDrive in that API.
4646 * @short_description: An object for emblems
4647 * @include: gio/gio.h
4648 * @see_also: #GIcon, #GEmblemedIcon, #GLoadableIcon, #GThemedIcon
4650 * #GEmblem is an implementation of #GIcon that supports
4651 * having an emblem, which is an icon with additional properties.
4652 * It can than be added to a #GEmblemedIcon.
4654 * Currently, only metainformation about the emblem's origin is
4655 * supported. More may be added in the future.
4660 * SECTION:gemblemedicon
4661 * @short_description: Icon with emblems
4662 * @include: gio/gio.h
4663 * @see_also: #GIcon, #GLoadableIcon, #GThemedIcon, #GEmblem
4665 * #GEmblemedIcon is an implementation of #GIcon that supports
4666 * adding an emblem to an icon. Adding multiple emblems to an
4667 * icon is ensured via g_emblemed_icon_add_emblem().
4669 * Note that #GEmblemedIcon allows no control over the position
4670 * of the emblems. See also #GEmblem for more information.
4676 * @short_description: File and Directory Handling
4677 * @include: gio/gio.h
4678 * @see_also: #GFileInfo, #GFileEnumerator
4680 * #GFile is a high level abstraction for manipulating files on a
4681 * virtual file system. #GFiles are lightweight, immutable objects
4682 * that do no I/O upon creation. It is necessary to understand that
4683 * #GFile objects do not represent files, merely an identifier for a
4684 * file. All file content I/O is implemented as streaming operations
4685 * (see #GInputStream and #GOutputStream).
4687 * To construct a #GFile, you can use:
4689 * <member>g_file_new_for_path() if you have a path.</member>
4690 * <member>g_file_new_for_uri() if you have a URI.</member>
4691 * <member>g_file_new_for_commandline_arg() for a command line argument.</member>
4692 * <member>g_file_new_tmp() to create a temporary file from a template.</member>
4693 * <member>g_file_parse_name() from a UTF-8 string gotten from g_file_get_parse_name().</member>
4696 * One way to think of a #GFile is as an abstraction of a pathname. For
4697 * normal files the system pathname is what is stored internally, but as
4698 * #GFiles are extensible it could also be something else that corresponds
4699 * to a pathname in a userspace implementation of a filesystem.
4701 * #GFiles make up hierarchies of directories and files that correspond to
4702 * the files on a filesystem. You can move through the file system with
4703 * #GFile using g_file_get_parent() to get an identifier for the parent
4704 * directory, g_file_get_child() to get a child within a directory,
4705 * g_file_resolve_relative_path() to resolve a relative path between two
4706 * #GFiles. There can be multiple hierarchies, so you may not end up at
4707 * the same root if you repeatedly call g_file_get_parent() on two different
4710 * All #GFiles have a basename (get with g_file_get_basename()). These names
4711 * are byte strings that are used to identify the file on the filesystem
4712 * (relative to its parent directory) and there is no guarantees that they
4713 * have any particular charset encoding or even make any sense at all. If
4714 * you want to use filenames in a user interface you should use the display
4715 * name that you can get by requesting the
4716 * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
4717 * This is guaranteed to be in UTF-8 and can be used in a user interface.
4718 * But always store the real basename or the #GFile to use to actually
4719 * access the file, because there is no way to go from a display name to
4722 * Using #GFile as an identifier has the same weaknesses as using a path
4723 * in that there may be multiple aliases for the same file. For instance,
4724 * hard or soft links may cause two different #GFiles to refer to the same
4725 * file. Other possible causes for aliases are: case insensitive filesystems,
4726 * short and long names on FAT/NTFS, or bind mounts in Linux. If you want to
4727 * check if two #GFiles point to the same file you can query for the
4728 * %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
4729 * canonicalization of pathnames passed in, so that trivial differences in
4730 * the path string used at creation (duplicated slashes, slash at end of
4731 * path, "." or ".." path segments, etc) does not create different #GFiles.
4733 * Many #GFile operations have both synchronous and asynchronous versions
4734 * to suit your application. Asynchronous versions of synchronous functions
4735 * simply have _async() appended to their function names. The asynchronous
4736 * I/O functions call a #GAsyncReadyCallback which is then used to finalize
4737 * the operation, producing a GAsyncResult which is then passed to the
4738 * function's matching _finish() operation.
4740 * Some #GFile operations do not have synchronous analogs, as they may
4741 * take a very long time to finish, and blocking may leave an application
4742 * unusable. Notable cases include:
4744 * <member>g_file_mount_mountable() to mount a mountable file.</member>
4745 * <member>g_file_unmount_mountable_with_operation() to unmount a mountable file.</member>
4746 * <member>g_file_eject_mountable_with_operation() to eject a mountable file.</member>
4749 * <para id="gfile-etag"><indexterm><primary>entity tag</primary></indexterm>
4750 * One notable feature of #GFiles are entity tags, or "etags" for
4751 * short. Entity tags are somewhat like a more abstract version of the
4752 * traditional mtime, and can be used to quickly determine if the file has
4753 * been modified from the version on the file system. See the HTTP 1.1
4754 * <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">specification</ulink>
4755 * for HTTP Etag headers, which are a very similar concept.
4761 * SECTION:gfileattribute
4762 * @short_description: Key-Value Paired File Attributes
4763 * @include: gio/gio.h
4764 * @see_also: #GFile, #GFileInfo
4766 * File attributes in GIO consist of a list of key-value pairs.
4768 * Keys are strings that contain a key namespace and a key name, separated
4769 * by a colon, e.g. "namespace:keyname". Namespaces are included to sort
4770 * key-value pairs by namespaces for relevance. Keys can be retrived
4771 * using wildcards, e.g. "standard::*" will return all of the keys in the
4772 * "standard" namespace.
4774 * The list of possible attributes for a filesystem (pointed to by a #GFile) is
4775 * available as a #GFileAttributeInfoList. This list is queryable by key names
4776 * as indicated earlier.
4778 * Information is stored within the list in #GFileAttributeInfo structures.
4779 * The info structure can store different types, listed in the enum
4780 * #GFileAttributeType. Upon creation of a #GFileAttributeInfo, the type will
4781 * be set to %G_FILE_ATTRIBUTE_TYPE_INVALID.
4783 * Classes that implement #GFileIface will create a #GFileAttributeInfoList and
4784 * install default keys and values for their given file system, architecture,
4785 * and other possible implementation details (e.g., on a UNIX system, a file
4786 * attribute key will be registered for the user id for a given file).
4790 * <title>GFileAttributes Default Namespaces</title>
4791 * <tgroup cols='2' align='left'><thead>
4792 * <row><entry>Namspace</entry><entry>Description</entry></row>
4795 * <row><entry>"standard"</entry><entry>The "Standard" namespace. General file
4796 * information that any application may need should be put in this namespace.
4797 * Examples include the file's name, type, and size.</entry></row>
4798 * <row><entry>"etag"</entry><entry>The <link linkend="gfile-etag">"Entity Tag"</link>
4799 * namespace. Currently, the only key in this namespace is "value", which contains
4800 * the value of the current entity tag.</entry></row>
4801 * <row><entry>"id"</entry><entry>The "Identification" namespace. This
4802 * namespace is used by file managers and applications that list directories
4803 * to check for loops and to uniquely identify files.</entry></row>
4804 * <row><entry>"access"</entry><entry>The "Access" namespace. Used to check
4805 * if a user has the proper privilidges to access files and perform
4806 * file operations. Keys in this namespace are made to be generic
4807 * and easily understood, e.g. the "can_read" key is %TRUE if
4808 * the current user has permission to read the file. UNIX permissions and
4809 * NTFS ACLs in Windows should be mapped to these values.</entry></row>
4810 * <row><entry>"mountable"</entry><entry>The "Mountable" namespace. Includes
4811 * simple boolean keys for checking if a file or path supports mount operations, e.g.
4812 * mount, unmount, eject. These are used for files of type %G_FILE_TYPE_MOUNTABLE.</entry></row>
4813 * <row><entry>"time"</entry><entry>The "Time" namespace. Includes file
4814 * access, changed, created times. </entry></row>
4815 * <row><entry>"unix"</entry><entry>The "Unix" namespace. Includes UNIX-specific
4816 * information and may not be available for all files. Examples include
4817 * the UNIX "UID", "GID", etc.</entry></row>
4818 * <row><entry>"dos"</entry><entry>The "DOS" namespace. Includes DOS-specific
4819 * information and may not be available for all files. Examples include
4820 * "is_system" for checking if a file is marked as a system file, and "is_archive"
4821 * for checking if a file is marked as an archive file.</entry></row>
4822 * <row><entry>"owner"</entry><entry>The "Owner" namespace. Includes information
4823 * about who owns a file. May not be available for all file systems. Examples include
4824 * "user" for getting the user name of the file owner. This information is often mapped from
4825 * some backend specific data such as a unix UID.</entry></row>
4826 * <row><entry>"thumbnail"</entry><entry>The "Thumbnail" namespace. Includes
4827 * information about file thumbnails and their location within the file system. Examples of
4828 * keys in this namespace include "path" to get the location of a thumbnail, and "failed"
4829 * to check if thumbnailing of the file failed.</entry></row>
4830 * <row><entry>"filesystem"</entry><entry>The "Filesystem" namespace. Gets information
4831 * about the file system where a file is located, such as its type, how much
4832 * space is left available, and the overall size of the file system.</entry></row>
4833 * <row><entry>"gvfs"</entry><entry>The "GVFS" namespace. Keys in this namespace
4834 * contain information about the current GVFS backend in use. </entry></row>
4835 * <row><entry>"xattr"</entry><entry>The "xattr" namespace. Gets information
4836 * about extended user attributes. See attr(5). The "user." prefix of the
4837 * extended user attribute name is stripped away when constructing keys in
4838 * this namespace, e.g. "xattr::mime_type" for the extended attribute with
4839 * the name "user.mime_type". Note that this information is only available
4840 * if GLib has been built with extended attribute support.</entry></row>
4841 * <row><entry>"xattr-sys"</entry><entry>The "xattr-sys" namespace.
4842 * Gets information about extended attributes which are not user-specific.
4843 * See attr(5). Note that this information is only available if GLib
4844 * has been built with extended attribute support.</entry></row>
4845 * <row><entry>"selinux"</entry><entry>The "SELinux" namespace. Includes
4846 * information about the SELinux context of files. Note that this information
4847 * is only available if GLib has been built with SELinux support.</entry></row>
4853 * Please note that these are not all of the possible namespaces.
4854 * More namespaces can be added from GIO modules or by individual applications.
4855 * For more information about writing GIO modules, see #GIOModule.
4857 * <!-- TODO: Implementation note about using extended attributes on supported
4861 * <title>GFileAttributes Built-in Keys and Value Types</title>
4862 * <tgroup cols='3' align='left'><thead>
4863 * <row><entry>Enum Value</entry><entry>Namespace:Key</entry><entry>Value Type</entry></row>
4865 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TYPE</entry><entry>standard::type</entry><entry>uint32 (#GFileType)</entry></row>
4866 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN</entry><entry>standard::is-hidden</entry><entry>boolean</entry></row>
4867 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP</entry><entry>standard::is-backup</entry><entry>boolean</entry></row>
4868 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK</entry><entry>standard::is-symlink</entry><entry>boolean</entry></row>
4869 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL</entry><entry>standard::is-virtual</entry><entry>boolean</entry></row>
4870 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_NAME</entry><entry>standard::name</entry><entry>byte string</entry></row>
4871 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</entry><entry>standard::display-name</entry><entry>string</entry></row>
4872 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME</entry><entry>standard::edit-name</entry><entry>string</entry></row>
4873 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ICON</entry><entry>standard::icon</entry><entry>object (#GIcon)</entry></row>
4874 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE</entry><entry>standard::content-type</entry><entry>string</entry></row>
4875 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE</entry><entry>standard::fast-content-type</entry><entry>string</entry></row>
4876 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SIZE</entry><entry>standard::size</entry><entry>uint64</entry></row>
4877 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE</entry><entry>standard::allocated-size</entry><entry>uint64</entry></row>
4878 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET</entry><entry>standard::symlink-target</entry><entry>byte string</entry></row>
4879 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TARGET_URI</entry><entry>standard::target-uri</entry><entry>string</entry></row>
4880 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER</entry><entry>standard::sort-order</entry><entry>int32</entry></row>
4881 * <row><entry>%G_FILE_ATTRIBUTE_ETAG_VALUE</entry><entry>etag::value</entry><entry>string</entry></row>
4882 * <row><entry>%G_FILE_ATTRIBUTE_ID_FILE</entry><entry>id::file</entry><entry>string</entry></row>
4883 * <row><entry>%G_FILE_ATTRIBUTE_ID_FILESYSTEM</entry><entry>id::filesystem</entry><entry>string</entry></row>
4884 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_READ</entry><entry>access::can-read</entry><entry>boolean</entry></row>
4885 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE</entry><entry>access::can-write</entry><entry>boolean</entry></row>
4886 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE</entry><entry>access::can-execute</entry><entry>boolean</entry></row>
4887 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE</entry><entry>access::can-delete</entry><entry>boolean</entry></row>
4888 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH</entry><entry>access::can-trash</entry><entry>boolean</entry></row>
4889 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME</entry><entry>access::can-rename</entry><entry>boolean</entry></row>
4890 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT</entry><entry>mountable::can-mount</entry><entry>boolean</entry></row>
4891 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT</entry><entry>mountable::can-unmount</entry><entry>boolean</entry></row>
4892 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT</entry><entry>mountable::can-eject</entry><entry>boolean</entry></row>
4893 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE</entry><entry>mountable::unix-device</entry><entry>uint32</entry></row>
4894 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE</entry><entry>mountable::unix-device-file</entry><entry>string</entry></row>
4895 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI</entry><entry>mountable::hal-udi</entry><entry>string</entry></row>
4896 * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED</entry><entry>time::modified</entry><entry>uint64</entry></row>
4897 * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC</entry><entry>time::modified-usec</entry><entry>uint32</entry></row>
4898 * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS</entry><entry>time::access</entry><entry>uint64</entry></row>
4899 * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS_USEC</entry><entry>time::access-usec</entry><entry>uint32</entry></row>
4900 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED</entry><entry>time::changed</entry><entry>uint64</entry></row>
4901 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED_USEC</entry><entry>time::changed-usec</entry><entry>uint32</entry></row>
4902 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED</entry><entry>time::created</entry><entry>uint64</entry></row>
4903 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED_USEC</entry><entry>time::created-usec</entry><entry>uint32</entry></row>
4904 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_DEVICE</entry><entry>unix::device</entry><entry>uint32</entry></row>
4905 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_INODE</entry><entry>unix::inode</entry><entry>uint64</entry></row>
4906 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_MODE</entry><entry>unix::mode</entry><entry>uint32</entry></row>
4907 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_NLINK</entry><entry>unix::nlink</entry><entry>uint32</entry></row>
4908 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_UID</entry><entry>unix::uid</entry><entry>uint32</entry></row>
4909 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_GID</entry><entry>unix::gid</entry><entry>uint32</entry></row>
4910 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_RDEV</entry><entry>unix::rdev</entry><entry>uint32</entry></row>
4911 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE</entry><entry>unix::block-size</entry><entry>uint32</entry></row>
4912 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCKS</entry><entry>unix::blocks</entry><entry>uint64</entry></row>
4913 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT</entry><entry>unix::is-mountpoint</entry><entry>boolean</entry></row>
4914 * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE</entry><entry>dos::is-archive</entry><entry>boolean</entry></row>
4915 * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_SYSTEM</entry><entry>dos::is-system</entry><entry>boolean</entry></row>
4916 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER</entry><entry>owner::user</entry><entry>string</entry></row>
4917 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER_REAL</entry><entry>owner::user-real</entry><entry>string</entry></row>
4918 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_GROUP</entry><entry>owner::group</entry><entry>string</entry></row>
4919 * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAIL_PATH</entry><entry>thumbnail::path</entry><entry>bytestring</entry></row>
4920 * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAILING_FAILED</entry><entry>thumbnail::failed</entry><entry>boolean</entry></row>
4921 * <row><entry>%G_FILE_ATTRIBUTE_PREVIEW_ICON</entry><entry>preview::icon</entry><entry>object (#GIcon)</entry></row>
4922 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_SIZE</entry><entry>filesystem::size</entry><entry>uint64</entry></row>
4923 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_FREE</entry><entry>filesystem::free</entry><entry>uint64</entry></row>
4924 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_USED</entry><entry>filesystem::used</entry><entry>uint64</entry></row>
4925 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_TYPE</entry><entry>filesystem::type</entry><entry>string</entry></row>
4926 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_READONLY</entry><entry>filesystem::readonly</entry><entry>boolean</entry></row>
4927 * <row><entry>%G_FILE_ATTRIBUTE_GVFS_BACKEND</entry><entry>gvfs::backend</entry><entry>string</entry></row>
4928 * <row><entry>%G_FILE_ATTRIBUTE_SELINUX_CONTEXT</entry><entry>selinux::context</entry><entry>string</entry></row>
4929 * </tbody></tgroup></table></para>
4931 * Note that there are no predefined keys in the "xattr" and "xattr-sys"
4932 * namespaces. Keys for the "xattr" namespace are constructed by stripping
4933 * away the "user." prefix from the extended user attribute, and prepending
4934 * "xattr::". Keys for the "xattr-sys" namespace are constructed by
4935 * concatenating "xattr-sys::" with the extended attribute name. All extended
4936 * attribute values are returned as hex-encoded strings in which bytes outside
4937 * the ASCII range are encoded as hexadecimal escape sequences of the form
4938 * \x<replaceable>nn</replaceable>.
4943 * SECTION:gfiledescriptorbased
4944 * @short_description: Interface for file descriptor based IO
4945 * @include: gio/gfiledescriptorbased.h
4946 * @see_also: #GInputStream, #GOutputStream
4948 * #GFileDescriptorBased is implemented by streams (implementations of
4949 * #GInputStream or #GOutputStream) that are based on file descriptors.
4951 * Note that <filename><gio/gfiledescriptorbased.h></filename> belongs to
4952 * the UNIX-specific GIO interfaces, thus you have to use the
4953 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4960 * SECTION:gfileenumerator
4961 * @short_description: Enumerated Files Routines
4962 * @include: gio/gio.h
4964 * #GFileEnumerator allows you to operate on a set of #GFile<!-- -->s,
4965 * returning a #GFileInfo structure for each file enumerated (e.g.
4966 * g_file_enumerate_children() will return a #GFileEnumerator for each
4967 * of the children within a directory).
4969 * To get the next file's information from a #GFileEnumerator, use
4970 * g_file_enumerator_next_file() or its asynchronous version,
4971 * g_file_enumerator_next_files_async(). Note that the asynchronous
4972 * version will return a list of #GFileInfo<!---->s, whereas the
4973 * synchronous will only return the next file in the enumerator.
4975 * To close a #GFileEnumerator, use g_file_enumerator_close(), or
4976 * its asynchronous version, g_file_enumerator_close_async(). Once
4977 * a #GFileEnumerator is closed, no further actions may be performed
4978 * on it, and it should be freed with g_object_unref().
4984 * @short_description: Icons pointing to an image file
4985 * @include: gio/gio.h
4986 * @see_also: #GIcon, #GLoadableIcon
4988 * #GFileIcon specifies an icon by pointing to an image file
4989 * to be used as icon.
4995 * @short_description: File Information and Attributes
4996 * @include: gio/gio.h
4997 * @see_also: #GFile, <link linkend="gio-GFileAttribute">GFileAttribute</link>
4999 * Functionality for manipulating basic metadata for files. #GFileInfo
5000 * implements methods for getting information that all files should
5001 * contain, and allows for manipulation of extended attributes.
5003 * See <link linkend="gio-GFileAttribute">GFileAttribute</link> for more
5004 * information on how GIO handles file attributes.
5006 * To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
5007 * async variant). To obtain a #GFileInfo for a file input or output
5008 * stream, use g_file_input_stream_query_info() or
5009 * g_file_output_stream_query_info() (or their async variants).
5011 * To change the actual attributes of a file, you should then set the
5012 * attribute in the #GFileInfo and call g_file_set_attributes_from_info()
5013 * or g_file_set_attributes_async() on a GFile.
5015 * However, not all attributes can be changed in the file. For instance,
5016 * the actual size of a file cannot be changed via g_file_info_set_size().
5017 * You may call g_file_query_settable_attributes() and
5018 * g_file_query_writable_namespaces() to discover the settable attributes
5019 * of a particular file at runtime.
5021 * #GFileAttributeMatcher allows for searching through a #GFileInfo for
5027 * SECTION:gfileinputstream
5028 * @short_description: File input streaming operations
5029 * @include: gio/gio.h
5030 * @see_also: #GInputStream, #GDataInputStream, #GSeekable
5032 * GFileInputStream provides input streams that take their
5033 * content from a file.
5035 * GFileInputStream implements #GSeekable, which allows the input
5036 * stream to jump to arbitrary positions in the file, provided the
5037 * filesystem of the file allows it. To find the position of a file
5038 * input stream, use g_seekable_tell(). To find out if a file input
5039 * stream supports seeking, use g_seekable_can_seek().
5040 * To position a file input stream, use g_seekable_seek().
5045 * SECTION:gfileiostream
5046 * @short_description: File read and write streaming operations
5047 * @include: gio/gio.h
5048 * @see_also: #GIOStream, #GFileInputStream, #GFileOutputStream, #GSeekable
5050 * GFileIOStream provides io streams that both read and write to the same
5053 * GFileIOStream implements #GSeekable, which allows the io
5054 * stream to jump to arbitrary positions in the file and to truncate
5055 * the file, provided the filesystem of the file supports these
5058 * To find the position of a file io stream, use
5059 * g_seekable_tell().
5061 * To find out if a file io stream supports seeking, use g_seekable_can_seek().
5062 * To position a file io stream, use g_seekable_seek().
5063 * To find out if a file io stream supports truncating, use
5064 * g_seekable_can_truncate(). To truncate a file io
5065 * stream, use g_seekable_truncate().
5067 * The default implementation of all the #GFileIOStream operations
5068 * and the implementation of #GSeekable just call into the same operations
5069 * on the output stream.
5076 * SECTION:gfilemonitor
5077 * @short_description: File Monitor
5078 * @include: gio/gio.h
5080 * Monitors a file or directory for changes.
5082 * To obtain a #GFileMonitor for a file or directory, use
5083 * g_file_monitor(), g_file_monitor_file(), or
5084 * g_file_monitor_directory().
5086 * To get informed about changes to the file or directory you are
5087 * monitoring, connect to the #GFileMonitor::changed signal. The
5088 * signal will be emitted in the <link
5089 * linkend="g-main-context-push-thread-default">thread-default main
5090 * context</link> of the thread that the monitor was created in
5091 * (though if the global default main context is blocked, this may
5092 * cause notifications to be blocked even if the thread-default
5093 * context is still running).
5098 * SECTION:gfilenamecompleter
5099 * @short_description: Filename Completer
5100 * @include: gio/gio.h
5102 * Completes partial file and directory names given a partial string by
5103 * looking in the file system for clues. Can return a list of possible
5104 * completion strings for widget implementations.
5109 * SECTION:gfileoutputstream
5110 * @short_description: File output streaming operations
5111 * @include: gio/gio.h
5112 * @see_also: #GOutputStream, #GDataOutputStream, #GSeekable
5114 * GFileOutputStream provides output streams that write their
5115 * content to a file.
5117 * GFileOutputStream implements #GSeekable, which allows the output
5118 * stream to jump to arbitrary positions in the file and to truncate
5119 * the file, provided the filesystem of the file supports these
5122 * To find the position of a file output stream, use g_seekable_tell().
5123 * To find out if a file output stream supports seeking, use
5124 * g_seekable_can_seek().To position a file output stream, use
5125 * g_seekable_seek(). To find out if a file output stream supports
5126 * truncating, use g_seekable_can_truncate(). To truncate a file output
5127 * stream, use g_seekable_truncate().
5132 * SECTION:gfilterinputstream
5133 * @short_description: Filter Input Stream
5134 * @include: gio/gio.h
5136 * Base class for input stream implementations that perform some
5137 * kind of filtering operation on a base stream. Typical examples
5138 * of filtering operations are character set conversion, compression
5139 * and byte order flipping.
5144 * SECTION:gfilteroutputstream
5145 * @short_description: Filter Output Stream
5146 * @include: gio/gio.h
5148 * Base class for output stream implementations that perform some
5149 * kind of filtering operation on a base stream. Typical examples
5150 * of filtering operations are character set conversion, compression
5151 * and byte order flipping.
5157 * @short_description: Interface for icons
5158 * @include: gio/gio.h
5160 * #GIcon is a very minimal interface for icons. It provides functions
5161 * for checking the equality of two icons, hashing of icons and
5162 * serializing an icon to and from strings.
5164 * #GIcon does not provide the actual pixmap for the icon as this is out
5165 * of GIO's scope, however implementations of #GIcon may contain the name
5166 * of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
5168 * To obtain a hash of a #GIcon, see g_icon_hash().
5170 * To check if two #GIcons are equal, see g_icon_equal().
5172 * For serializing a #GIcon, use g_icon_to_string() and
5173 * g_icon_new_for_string().
5175 * If your application or library provides one or more #GIcon
5176 * implementations you need to ensure that each #GType is registered
5177 * with the type system prior to calling g_icon_new_for_string().
5182 * SECTION:ginetaddress
5183 * @short_description: An IPv4/IPv6 address
5185 * #GInetAddress represents an IPv4 or IPv6 internet address. Use
5186 * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
5187 * look up the #GInetAddress for a hostname. Use
5188 * g_resolver_lookup_by_address() or
5189 * g_resolver_lookup_by_address_async() to look up the hostname for a
5192 * To actually connect to a remote host, you will need a
5193 * #GInetSocketAddress (which includes a #GInetAddress as well as a
5199 * SECTION:ginetaddressmask
5200 * @short_description: An IPv4/IPv6 address mask
5202 * #GInetAddressMask represents a range of IPv4 or IPv6 addresses
5203 * described by a base address and a length indicating how many bits
5204 * of the base address are relevant for matching purposes. These are
5205 * often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".
5210 * SECTION:ginetsocketaddress
5211 * @short_description: Internet GSocketAddress
5213 * An IPv4 or IPv6 socket address; that is, the combination of a
5214 * #GInetAddress and a port number.
5220 * @short_description: Failable object initialization interface
5221 * @include: gio/gio.h
5222 * @see_also: #GAsyncInitable
5224 * #GInitable is implemented by objects that can fail during
5225 * initialization. If an object implements this interface then
5226 * it must be initialized as the first thing after construction,
5227 * either via g_initable_init() or g_async_initable_init_async()
5228 * (the latter is only available if it also implements #GAsyncInitable).
5230 * If the object is not initialized, or initialization returns with an
5231 * error, then all operations on the object except g_object_ref() and
5232 * g_object_unref() are considered to be invalid, and have undefined
5233 * behaviour. They will often fail with g_critical() or g_warning(), but
5234 * this must not be relied on.
5236 * Users of objects implementing this are not intended to use
5237 * the interface method directly, instead it will be used automatically
5238 * in various ways. For C applications you generally just call
5239 * g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
5240 * This will call g_initable_init() under the cover, returning %NULL and
5241 * setting a #GError on failure (at which point the instance is
5244 * For bindings in languages where the native constructor supports
5245 * exceptions the binding could check for objects implemention %GInitable
5246 * during normal construction and automatically initialize them, throwing
5247 * an exception on failure.
5252 * SECTION:ginputstream
5253 * @short_description: Base class for implementing streaming input
5254 * @include: gio/gio.h
5256 * #GInputStream has functions to read from a stream (g_input_stream_read()),
5257 * to close a stream (g_input_stream_close()) and to skip some content
5258 * (g_input_stream_skip()).
5260 * To copy the content of an input stream to an output stream without
5261 * manually handling the reads and writes, use g_output_stream_splice().
5263 * All of these functions have async variants too.
5269 * @short_description: Error helper functions
5270 * @include: gio/gio.h
5272 * Contains helper functions for reporting errors to the user.
5278 * @short_description: Loadable GIO Modules
5279 * @include: gio/gio.h
5281 * Provides an interface and default functions for loading and unloading
5282 * modules. This is used internally to make GIO extensible, but can also
5283 * be used by others to implement module loading.
5288 * SECTION:gioscheduler
5289 * @short_description: I/O Scheduler
5290 * @include: gio/gio.h
5293 * As of GLib 2.36, the <literal>g_io_scheduler</literal> methods
5294 * are deprecated in favor of #GThreadPool and #GTask.
5297 * Schedules asynchronous I/O operations. #GIOScheduler integrates
5298 * into the main event loop (#GMainLoop) and uses threads.
5304 * @short_description: Base class for implementing read/write streams
5305 * @include: gio/gio.h
5306 * @see_also: #GInputStream, #GOutputStream
5308 * GIOStream represents an object that has both read and write streams.
5309 * Generally the two streams acts as separate input and output streams,
5310 * but they share some common resources and state. For instance, for
5311 * seekable streams they may use the same position in both streams.
5313 * Examples of #GIOStream objects are #GSocketConnection which represents
5314 * a two-way network connection, and #GFileIOStream which represent a
5315 * file handle opened in read-write mode.
5317 * To do the actual reading and writing you need to get the substreams
5318 * with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
5320 * The #GIOStream object owns the input and the output streams, not the other
5321 * way around, so keeping the substreams alive will not keep the #GIOStream
5322 * object alive. If the #GIOStream object is freed it will be closed, thus
5323 * closing the substream, so even if the substreams stay alive they will
5324 * always just return a %G_IO_ERROR_CLOSED for all operations.
5326 * To close a stream use g_io_stream_close() which will close the common
5327 * stream object and also the individual substreams. You can also close
5328 * the substreams themselves. In most cases this only marks the
5329 * substream as closed, so further I/O on it fails. However, some streams
5330 * may support "half-closed" states where one direction of the stream
5331 * is actually shut down.
5338 * SECTION:gloadableicon
5339 * @short_description: Loadable Icons
5340 * @include: gio/gio.h
5341 * @see_also: #GIcon, #GThemedIcon
5343 * Extends the #GIcon interface and adds the ability to
5344 * load icons from streams.
5349 * SECTION:gmemoryinputstream
5350 * @short_description: Streaming input operations on memory chunks
5351 * @include: gio/gio.h
5352 * @see_also: #GMemoryOutputStream
5354 * #GMemoryInputStream is a class for using arbitrary
5355 * memory chunks as input for GIO streaming input operations.
5357 * As of GLib 2.34, #GMemoryInputStream implements
5358 * #GPollableInputStream.
5363 * SECTION:gmemoryoutputstream
5364 * @short_description: Streaming output operations on memory chunks
5365 * @include: gio/gio.h
5366 * @see_also: #GMemoryInputStream
5368 * #GMemoryOutputStream is a class for using arbitrary
5369 * memory chunks as output for GIO streaming output operations.
5371 * As of GLib 2.34, #GMemoryOutputStream implements
5372 * #GPollableOutputStream.
5379 * @short_description: A simple implementation of GMenuModel
5381 * #GMenu is a simple implementation of #GMenuModel.
5382 * You populate a #GMenu by adding #GMenuItem instances to it.
5384 * There are some convenience functions to allow you to directly
5385 * add items (avoiding #GMenuItem) for the common cases. To add
5386 * a regular item, use g_menu_insert(). To add a section, use
5387 * g_menu_insert_section(). To add a submenu, use
5388 * g_menu_insert_submenu().
5393 * SECTION:gmenuexporter
5394 * @title: GMenuModel exporter
5395 * @short_description: Export GMenuModels on D-Bus
5396 * @see_also: #GMenuModel, #GDBusMenuModel
5398 * These functions support exporting a #GMenuModel on D-Bus.
5399 * The D-Bus interface that is used is a private implementation
5402 * To access an exported #GMenuModel remotely, use
5403 * g_dbus_menu_model_get() to obtain a #GDBusMenuModel.
5408 * SECTION:gmenumodel
5409 * @title: GMenuModel
5410 * @short_description: An abstract class representing the contents of a menu
5411 * @see_also: #GActionGroup
5413 * #GMenuModel represents the contents of a menu -- an ordered list of
5414 * menu items. The items are associated with actions, which can be
5415 * activated through them. Items can be grouped in sections, and may
5416 * have submenus associated with them. Both items and sections usually
5417 * have some representation data, such as labels or icons. The type of
5418 * the associated action (ie whether it is stateful, and what kind of
5419 * state it has) can influence the representation of the item.
5421 * The conceptual model of menus in #GMenuModel is hierarchical:
5422 * sections and submenus are again represented by #GMenuModels.
5423 * Menus themselves do not define their own roles. Rather, the role
5424 * of a particular #GMenuModel is defined by the item that references
5425 * it (or, in the case of the 'root' menu, is defined by the context
5426 * in which it is used).
5428 * As an example, consider the visible portions of the menu in
5429 * <xref linkend="menu-example"/>.
5431 * <figure id="menu-example">
5432 * <title>An example menu</title>
5433 * <graphic fileref="menu-example.png" format="PNG"></graphic>
5436 * There are 8 "menus" visible in the screenshot: one menubar, two
5437 * submenus and 5 sections:
5439 * <listitem>the toplevel menubar (containing 4 items)</listitem>
5440 * <listitem>the View submenu (containing 3 sections)</listitem>
5441 * <listitem>the first section of the View submenu (containing 2 items)</listitem>
5442 * <listitem>the second section of the View submenu (containing 1 item)</listitem>
5443 * <listitem>the final section of the View submenu (containing 1 item)</listitem>
5444 * <listitem>the Highlight Mode submenu (containing 2 sections)</listitem>
5445 * <listitem>the Sources section (containing 2 items)</listitem>
5446 * <listitem>the Markup section (containing 2 items)</listitem>
5449 * <xref linkend="menu-model"/> illustrates the conceptual connection between
5450 * these 8 menus. Each large block in the figure represents a menu and the
5451 * smaller blocks within the large block represent items in that menu. Some
5452 * items contain references to other menus.
5454 * <figure id="menu-model">
5455 * <title>A menu model</title>
5456 * <graphic fileref="menu-model.png" format="PNG"></graphic>
5459 * Notice that the separators visible in <xref linkend="menu-example"/>
5460 * appear nowhere in <xref linkend="menu-model"/>. This is because
5461 * separators are not explicitly represented in the menu model. Instead,
5462 * a separator is inserted between any two non-empty sections of a menu.
5463 * Section items can have labels just like any other item. In that case,
5464 * a display system may show a section header instead of a separator.
5466 * The motivation for this abstract model of application controls is
5467 * that modern user interfaces tend to make these controls available
5468 * outside the application. Examples include global menus, jumplists,
5469 * dash boards, etc. To support such uses, it is necessary to 'export'
5470 * information about actions and their representation in menus, which
5471 * is exactly what the
5472 * <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
5474 * <link linkend="gio-GMenuModel-exporter">GMenuModel exporter</link>
5475 * do for #GActionGroup and #GMenuModel. The client-side counterparts
5476 * to make use of the exported information are #GDBusActionGroup and
5479 * The API of #GMenuModel is very generic, with iterators for the
5480 * attributes and links of an item, see g_menu_model_iterate_item_attributes()
5481 * and g_menu_model_iterate_item_links(). The 'standard' attributes and
5482 * link types have predefined names: %G_MENU_ATTRIBUTE_LABEL,
5483 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, %G_MENU_LINK_SECTION
5484 * and %G_MENU_LINK_SUBMENU.
5486 * Items in a #GMenuModel represent active controls if they refer to
5487 * an action that can get activated when the user interacts with the
5488 * menu item. The reference to the action is encoded by the string id
5489 * in the %G_MENU_ATTRIBUTE_ACTION attribute. An action id uniquely
5490 * identifies an action in an action group. Which action group(s) provide
5491 * actions depends on the context in which the menu model is used.
5492 * E.g. when the model is exported as the application menu of a
5493 * #GtkApplication, actions can be application-wide or window-specific
5494 * (and thus come from two different action groups). By convention, the
5495 * application-wide actions have names that start with "app.", while the
5496 * names of window-specific actions start with "win.".
5498 * While a wide variety of stateful actions is possible, the following
5499 * is the minimum that is expected to be supported by all users of exported
5502 * <listitem>an action with no parameter type and no state</listitem>
5503 * <listitem>an action with no parameter type and boolean state</listitem>
5504 * <listitem>an action with string parameter type and string state</listitem>
5507 * <formalpara><title>Stateless</title>
5509 * A stateless action typically corresponds to an ordinary menu item.
5512 * Selecting such a menu item will activate the action (with no parameter).
5516 * <formalpara><title>Boolean State</title>
5518 * An action with a boolean state will most typically be used with a "toggle"
5519 * or "switch" menu item. The state can be set directly, but activating the
5520 * action (with no parameter) results in the state being toggled.
5523 * Selecting a toggle menu item will activate the action. The menu item should
5524 * be rendered as "checked" when the state is true.
5528 * <formalpara><title>String Parameter and State</title>
5530 * Actions with string parameters and state will most typically be used to
5531 * represent an enumerated choice over the items available for a group of
5532 * radio menu items. Activating the action with a string parameter is
5533 * equivalent to setting that parameter as the state.
5536 * Radio menu items, in addition to being associated with the action, will
5537 * have a target value. Selecting that menu item will result in activation
5538 * of the action with the target value as the parameter. The menu item should
5539 * be rendered as "selected" when the state of the action is equal to the
5540 * target value of the menu item.
5548 * @short_description: Mount management
5549 * @include: gio/gio.h
5550 * @see_also: GVolume, GUnixMountEntry, GUnixMountPoint
5552 * The #GMount interface represents user-visible mounts. Note, when
5553 * porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
5555 * #GMount is a "mounted" filesystem that you can access. Mounted is in
5556 * quotes because it's not the same as a unix mount, it might be a gvfs
5557 * mount, but you can still access the files on it if you use GIO. Might or
5558 * might not be related to a volume object.
5560 * Unmounting a #GMount instance is an asynchronous operation. For
5561 * more information about asynchronous operations, see #GAsyncResult
5562 * and #GSimpleAsyncResult. To unmount a #GMount instance, first call
5563 * g_mount_unmount_with_operation() with (at least) the #GMount instance and a
5564 * #GAsyncReadyCallback. The callback will be fired when the
5565 * operation has resolved (either with success or failure), and a
5566 * #GAsyncReady structure will be passed to the callback. That
5567 * callback should then call g_mount_unmount_with_operation_finish() with the #GMount
5568 * and the #GAsyncReady data to see if the operation was completed
5569 * successfully. If an @error is present when g_mount_unmount_with_operation_finish()
5570 * is called, then it will be filled with any error information.
5575 * SECTION:gmountoperation
5576 * @short_description: Object used for authentication and user interaction
5577 * @include: gio/gio.h
5579 * #GMountOperation provides a mechanism for interacting with the user.
5580 * It can be used for authenticating mountable operations, such as loop
5581 * mounting files, hard drive partitions or server locations. It can
5582 * also be used to ask the user questions or show a list of applications
5583 * preventing unmount or eject operations from completing.
5585 * Note that #GMountOperation is used for more than just #GMount
5586 * objects – for example it is also used in g_drive_start() and
5589 * Users should instantiate a subclass of this that implements all the
5590 * various callbacks to show the required dialogs, such as
5591 * #GtkMountOperation. If no user interaction is desired (for example
5592 * when automounting filesystems at login time), usually %NULL can be
5593 * passed, see each method taking a #GMountOperation for details.
5598 * SECTION:gnetworkaddress
5599 * @short_description: A GSocketConnectable for resolving hostnames
5600 * @include: gio/gio.h
5602 * #GNetworkAddress provides an easy way to resolve a hostname and
5603 * then attempt to connect to that host, handling the possibility of
5604 * multiple IP addresses and multiple address families.
5606 * See #GSocketConnectable for and example of using the connectable
5612 * SECTION:gnetworkmonitor
5613 * @title: GNetworkMonitor
5614 * @short_description: Network status monitor
5615 * @include: gio/gio.h
5617 * #GNetworkMonitor provides an easy-to-use cross-platform API
5618 * for monitoring network connectivity. On Linux, the implementation
5619 * is based on the kernel's netlink interface.
5624 * SECTION:gnetworkservice
5625 * @short_description: A GSocketConnectable for resolving SRV records
5626 * @include: gio/gio.h
5628 * Like #GNetworkAddress does with hostnames, #GNetworkService
5629 * provides an easy way to resolve a SRV record, and then attempt to
5630 * connect to one of the hosts that implements that service, handling
5631 * service priority/weighting, multiple IP addresses, and multiple
5634 * See #GSrvTarget for more information about SRV records, and see
5635 * #GSocketConnectable for and example of using the connectable
5641 * SECTION:goutputstream
5642 * @short_description: Base class for implementing streaming output
5643 * @include: gio/gio.h
5645 * #GOutputStream has functions to write to a stream (g_output_stream_write()),
5646 * to close a stream (g_output_stream_close()) and to flush pending writes
5647 * (g_output_stream_flush()).
5649 * To copy the content of an input stream to an output stream without
5650 * manually handling the reads and writes, use g_output_stream_splice().
5652 * All of these functions have async variants too.
5657 * SECTION:gpermission
5658 * @title: GPermission
5659 * @short_description: An object representing the permission to perform a certain action
5661 * A #GPermission represents the status of the caller's permission to
5662 * perform a certain action.
5664 * You can query if the action is currently allowed and if it is
5665 * possible to acquire the permission so that the action will be allowed
5668 * There is also an API to actually acquire the permission and one to
5671 * As an example, a #GPermission might represent the ability for the
5672 * user to write to a #GSettings object. This #GPermission object could
5673 * then be used to decide if it is appropriate to show a "Click here to
5674 * unlock" button in a dialog and to provide the mechanism to invoke
5675 * when that button is clicked.
5680 * SECTION:gpollableinputstream
5681 * @short_description: Interface for pollable input streams
5682 * @include: gio/gio.h
5683 * @see_also: #GInputStream, #GPollableOutputStream, #GFileDescriptorBased
5685 * #GPollableInputStream is implemented by #GInputStreams that
5686 * can be polled for readiness to read. This can be used when
5687 * interfacing with a non-GIO API that expects
5688 * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5695 * SECTION:gpollableoutputstream
5696 * @short_description: Interface for pollable output streams
5697 * @include: gio/gio.h
5698 * @see_also: #GOutputStream, #GFileDescriptorBased, #GPollableInputStream
5700 * #GPollableOutputStream is implemented by #GOutputStreams that
5701 * can be polled for readiness to write. This can be used when
5702 * interfacing with a non-GIO API that expects
5703 * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5710 * SECTION:gpollableutils
5711 * @short_description: #GPollableInputStream / #GPollableOutputStream utilities
5712 * @include: gio/gio.h
5714 * Utility functions for #GPollableInputStream and
5715 * #GPollableOutputStream implementations.
5721 * @short_description: Interface for proxy handling
5723 * A #GProxy handles connecting to a remote host via a given type of
5724 * proxy server. It is implemented by the 'gio-proxy' extension point.
5725 * The extensions are named after their proxy protocol name. As an
5726 * example, a SOCKS5 proxy implementation can be retrieved with the
5727 * name 'socks5' using the function
5728 * g_io_extension_point_get_extension_by_name().
5735 * SECTION:gproxyaddress
5736 * @short_description: An internet address with proxy information
5738 * Support for proxied #GInetSocketAddress.
5743 * SECTION:gproxyresolver
5744 * @short_description: Asynchronous and cancellable network proxy resolver
5745 * @include: gio/gio.h
5747 * #GProxyResolver provides synchronous and asynchronous network proxy
5748 * resolution. #GProxyResolver is used within #GSocketClient through
5749 * the method g_socket_connectable_proxy_enumerate().
5754 * SECTION:gremoteactiongroup
5755 * @title: GRemoteActionGroup
5756 * @short_description: a #GActionGroup that interacts with other processes
5758 * The GRemoteActionGroup interface is implemented by #GActionGroup
5759 * instances that either transmit action invocations to other processes
5760 * or receive action invocations in the local process from other
5763 * The interface has <literal>_full</literal> variants of the two
5764 * methods on #GActionGroup used to activate actions:
5765 * g_action_group_activate_action() and
5766 * g_action_group_change_action_state(). These variants allow a
5767 * "platform data" #GVariant to be specified: a dictionary providing
5768 * context for the action invocation (for example: timestamps, startup
5769 * notification IDs, etc).
5771 * #GDBusActionGroup implements #GRemoteActionGroup. This provides a
5772 * mechanism to send platform data for action invocations over D-Bus.
5774 * Additionally, g_dbus_connection_export_action_group() will check if
5775 * the exported #GActionGroup implements #GRemoteActionGroup and use the
5776 * <literal>_full</literal> variants of the calls if available. This
5777 * provides a mechanism by which to receive platform data for action
5778 * invocations that arrive by way of D-Bus.
5786 * @short_description: Asynchronous and cancellable DNS resolver
5787 * @include: gio/gio.h
5789 * #GResolver provides cancellable synchronous and asynchronous DNS
5790 * resolution, for hostnames (g_resolver_lookup_by_address(),
5791 * g_resolver_lookup_by_name() and their async variants) and SRV
5792 * (service) records (g_resolver_lookup_service()).
5794 * #GNetworkAddress and #GNetworkService provide wrappers around
5795 * #GResolver functionality that also implement #GSocketConnectable,
5796 * making it easy to connect to a remote host/service.
5802 * @short_description: Resource framework
5803 * @include: gio/gio.h
5805 * Applications and libraries often contain binary or textual data that is really part of the
5806 * application, rather than user data. For instance #GtkBuilder .ui files, splashscreen images,
5807 * GMenu markup xml, CSS files, icons, etc. These are often shipped as files in <filename>$datadir/appname</filename>, or
5808 * manually included as literal strings in the code.
5810 * The #GResource API and the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5811 * provide a convenient and efficient alternative to this which has some nice properties. You
5812 * maintain the files as normal files, so its easy to edit them, but during the build the files
5813 * are combined into a binary bundle that is linked into the executable. This means that loading
5814 * the resource files are efficient (as they are already in memory, shared with other instances) and
5815 * simple (no need to check for things like I/O errors or locate the files in the filesystem). It
5816 * also makes it easier to create relocatable applications.
5818 * Resource files can also be marked as compressed. Such files will be included in the resource bundle
5819 * in a compressed form, but will be automatically uncompressed when the resource is used. This
5820 * is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away.
5822 * Resource files can also be marked to be preprocessed, by setting the value of the
5823 * <literal>preprocess</literal> attribute to a comma-separated list of preprocessing options.
5824 * The only options currently supported are:
5826 * <literal>xml-stripblanks</literal> which will use <command>xmllint</command> to strip
5827 * ignorable whitespace from the xml file. For this to work, the <envar>XMLLINT</envar>
5828 * environment variable must be set to the full path to the xmllint executable, or xmllint
5829 * must be in the PATH; otherwise the preprocessing step is skipped.
5831 * <literal>to-pixdata</literal> which will use <command>gdk-pixbuf-pixdata</command> to convert
5832 * images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside
5833 * the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata
5834 * program must be in the PATH, or the <envar>GDK_PIXBUF_PIXDATA</envar> environment variable must be
5835 * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will
5838 * Resource bundles are created by the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5839 * which takes an xml file that describes the bundle, and a set of files that the xml references. These
5840 * are combined into a binary resource bundle.
5842 * <example id="resource-example"><title>Example resource description</title>
5843 * <programlisting><![CDATA[
5844 * <?xml version="1.0" encoding="UTF-8"?>
5846 * <gresource prefix="/org/gtk/Example">
5847 * <file>data/splashscreen.png</file>
5848 * <file compressed="true">dialog.ui</file>
5849 * <file preprocess="xml-stripblanks">menumarkup.xml</file>
5852 * ]]></programlisting></example>
5854 * This will create a resource bundle with the following files:
5855 * <programlisting><![CDATA[
5856 * /org/gtk/Example/data/splashscreen.png
5857 * /org/gtk/Example/dialog.ui
5858 * /org/gtk/Example/menumarkup.xml
5859 * ]]></programlisting>
5861 * Note that all resources in the process share the same namespace, so use java-style
5862 * path prefixes (like in the above example) to avoid conflicts.
5864 * You can then use <link linkend="glib-compile-resources">glib-compile-resources</link> to compile the xml to a
5865 * binary bundle that you can load with g_resource_load(). However, its more common to use the --generate-source and
5866 * --generate-header arguments to create a source file and header to link directly into your application.
5868 * Once a #GResource has been created and registered all the data in it can be accessed globally in the process by
5869 * using API calls like g_resources_open_stream() to stream the data or g_resources_lookup_data() to get a direct pointer
5870 * to the data. You can also use uris like "resource:///org/gtk/Example/data/splashscreen.png" with #GFile to access
5871 * the resource data.
5873 * There are two forms of the generated source, the default version uses the compiler support for constructor
5874 * and destructor functions (where available) to automatically create and register the #GResource on startup
5875 * or library load time. If you pass --manual-register two functions to register/unregister the resource is instead
5876 * created. This requires an explicit initialization call in your application/library, but it works on all platforms,
5877 * even on the minor ones where this is not available. (Constructor support is available for at least Win32, MacOS and Linux.)
5879 * Note that resource data can point directly into the data segment of e.g. a library, so if you are unloading libraries
5880 * during runtime you need to be very careful with keeping around pointers to data from a resource, as this goes away
5881 * when the library is unloaded. However, in practice this is not generally a problem, since most resource accesses
5882 * is for your own resources, and resource data is often used once, during parsing, and then released.
5890 * @short_description: Stream seeking interface
5891 * @include: gio/gio.h
5892 * @see_also: #GInputStream, #GOutputStream
5894 * #GSeekable is implemented by streams (implementations of
5895 * #GInputStream or #GOutputStream) that support seeking.
5901 * @short_description: High-level API for application settings
5903 * The #GSettings class provides a convenient API for storing and retrieving
5904 * application settings.
5906 * Reads and writes can be considered to be non-blocking. Reading
5907 * settings with #GSettings is typically extremely fast: on
5908 * approximately the same order of magnitude (but slower than) a
5909 * #GHashTable lookup. Writing settings is also extremely fast in terms
5910 * of time to return to your application, but can be extremely expensive
5911 * for other threads and other processes. Many settings backends
5912 * (including dconf) have lazy initialisation which means in the common
5913 * case of the user using their computer without modifying any settings
5914 * a lot of work can be avoided. For dconf, the D-Bus service doesn't
5915 * even need to be started in this case. For this reason, you should
5916 * only ever modify #GSettings keys in response to explicit user action.
5917 * Particular care should be paid to ensure that modifications are not
5918 * made during startup -- for example, when setting the initial value
5919 * of preferences widgets. The built-in g_settings_bind() functionality
5920 * is careful not to write settings in response to notify signals as a
5921 * result of modifications that it makes to widgets.
5923 * When creating a GSettings instance, you have to specify a schema
5924 * that describes the keys in your settings and their types and default
5925 * values, as well as some other information.
5927 * Normally, a schema has as fixed path that determines where the settings
5928 * are stored in the conceptual global tree of settings. However, schemas
5929 * can also be 'relocatable', i.e. not equipped with a fixed path. This is
5930 * useful e.g. when the schema describes an 'account', and you want to be
5931 * able to store a arbitrary number of accounts.
5933 * Paths must start with and end with a forward slash character ('/')
5934 * and must not contain two sequential slash characters. Paths should
5935 * be chosen based on a domain name associated with the program or
5936 * library to which the settings belong. Examples of paths are
5937 * "/org/gtk/settings/file-chooser/" and "/ca/desrt/dconf-editor/".
5938 * Paths should not start with "/apps/", "/desktop/" or "/system/" as
5939 * they often did in GConf.
5941 * Unlike other configuration systems (like GConf), GSettings does not
5942 * restrict keys to basic types like strings and numbers. GSettings stores
5943 * values as #GVariant, and allows any #GVariantType for keys. Key names
5944 * are restricted to lowercase characters, numbers and '-'. Furthermore,
5945 * the names must begin with a lowercase character, must not end
5946 * with a '-', and must not contain consecutive dashes.
5948 * Similar to GConf, the default values in GSettings schemas can be
5949 * localized, but the localized values are stored in gettext catalogs
5950 * and looked up with the domain that is specified in the
5951 * <tag class="attribute">gettext-domain</tag> attribute of the
5952 * <tag class="starttag">schemalist</tag> or <tag class="starttag">schema</tag>
5953 * elements and the category that is specified in the l10n attribute of the
5954 * <tag class="starttag">key</tag> element.
5956 * GSettings uses schemas in a compact binary form that is created
5957 * by the <link linkend="glib-compile-schemas">glib-compile-schemas</link>
5958 * utility. The input is a schema description in an XML format that can be
5959 * described by the following DTD:
5960 * |[<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>]|
5962 * glib-compile-schemas expects schema files to have the extension <filename>.gschema.xml</filename>
5964 * At runtime, schemas are identified by their id (as specified
5965 * in the <tag class="attribute">id</tag> attribute of the
5966 * <tag class="starttag">schema</tag> element). The
5967 * convention for schema ids is to use a dotted name, similar in
5968 * style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
5969 * if the settings are for a specific service that owns a D-Bus bus name,
5970 * the D-Bus bus name and schema id should match. For schemas which deal
5971 * with settings not associated with one named application, the id should
5972 * not use StudlyCaps, e.g. "org.gnome.font-rendering".
5974 * In addition to #GVariant types, keys can have types that have enumerated
5975 * types. These can be described by a <tag class="starttag">choice</tag>,
5976 * <tag class="starttag">enum</tag> or <tag class="starttag">flags</tag> element, see
5977 * <xref linkend="schema-enumerated"/>. The underlying type of
5978 * such a key is string, but you can use g_settings_get_enum(),
5979 * g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags()
5980 * access the numeric values corresponding to the string value of enum
5983 * <example id="schema-default-values"><title>Default values</title>
5984 * <programlisting><![CDATA[
5986 * <schema id="org.gtk.Test" path="/org/gtk/Test/" gettext-domain="test">
5988 * <key name="greeting" type="s">
5989 * <default l10n="messages">"Hello, earthlings"</default>
5990 * <summary>A greeting</summary>
5992 * Greeting of the invading martians
5996 * <key name="box" type="(ii)">
5997 * <default>(20,30)</default>
6002 * ]]></programlisting></example>
6004 * <example id="schema-enumerated"><title>Ranges, choices and enumerated types</title>
6005 * <programlisting><![CDATA[
6008 * <enum id="org.gtk.Test.myenum">
6009 * <value nick="first" value="1"/>
6010 * <value nick="second" value="2"/>
6013 * <flags id="org.gtk.Test.myflags">
6014 * <value nick="flag1" value="1"/>
6015 * <value nick="flag2" value="2"/>
6016 * <value nick="flag3" value="4"/>
6019 * <schema id="org.gtk.Test">
6021 * <key name="key-with-range" type="i">
6022 * <range min="1" max="100"/>
6023 * <default>10</default>
6026 * <key name="key-with-choices" type="s">
6028 * <choice value='Elisabeth'/>
6029 * <choice value='Annabeth'/>
6030 * <choice value='Joe'/>
6033 * <alias value='Anna' target='Annabeth'/>
6034 * <alias value='Beth' target='Elisabeth'/>
6036 * <default>'Joe'</default>
6039 * <key name='enumerated-key' enum='org.gtk.Test.myenum'>
6040 * <default>'first'</default>
6043 * <key name='flags-key' flags='org.gtk.Test.myflags'>
6044 * <default>["flag1",flag2"]</default>
6048 * ]]></programlisting></example>
6051 * <title>Vendor overrides</title>
6053 * Default values are defined in the schemas that get installed by
6054 * an application. Sometimes, it is necessary for a vendor or distributor
6055 * to adjust these defaults. Since patching the XML source for the schema
6056 * is inconvenient and error-prone,
6057 * <link linkend="glib-compile-schemas">glib-compile-schemas</link> reads
6058 * so-called 'vendor override' files. These are keyfiles in the same
6059 * directory as the XML schema sources which can override default values.
6060 * The schema id serves as the group name in the key file, and the values
6061 * are expected in serialized GVariant form, as in the following example:
6062 * <informalexample><programlisting>
6066 * </programlisting></informalexample>
6069 * glib-compile-schemas expects schema files to have the extension
6070 * <filename>.gschema.override</filename>
6075 * <title>Binding</title>
6077 * A very convenient feature of GSettings lets you bind #GObject properties
6078 * directly to settings, using g_settings_bind(). Once a GObject property
6079 * has been bound to a setting, changes on either side are automatically
6080 * propagated to the other side. GSettings handles details like
6081 * mapping between GObject and GVariant types, and preventing infinite
6085 * This makes it very easy to hook up a preferences dialog to the
6086 * underlying settings. To make this even more convenient, GSettings
6087 * looks for a boolean property with the name "sensitivity" and
6088 * automatically binds it to the writability of the bound setting.
6089 * If this 'magic' gets in the way, it can be suppressed with the
6090 * #G_SETTINGS_BIND_NO_SENSITIVITY flag.
6097 * SECTION:gsettingsbackend
6098 * @title: GSettingsBackend
6099 * @short_description: Interface for settings backend implementations
6100 * @include: gio/gsettingsbackend.h
6101 * @see_also: #GSettings, #GIOExtensionPoint
6103 * The #GSettingsBackend interface defines a generic interface for
6104 * non-strictly-typed data that is stored in a hierarchy. To implement
6105 * an alternative storage backend for #GSettings, you need to implement
6106 * the #GSettingsBackend interface and then make it implement the
6107 * extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.
6109 * The interface defines methods for reading and writing values, a
6110 * method for determining if writing of certain values will fail
6111 * (lockdown) and a change notification mechanism.
6113 * The semantics of the interface are very precisely defined and
6114 * implementations must carefully adhere to the expectations of
6115 * callers that are documented on each of the interface methods.
6117 * Some of the GSettingsBackend functions accept or return a #GTree.
6118 * These trees always have strings as keys and #GVariant as values.
6119 * g_settings_backend_create_tree() is a convenience function to create
6123 * The #GSettingsBackend API is exported to allow third-party
6124 * implementations, but does not carry the same stability guarantees
6125 * as the public GIO API. For this reason, you have to define the
6126 * C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including
6127 * <filename>gio/gsettingsbackend.h</filename>
6133 * SECTION:gsettingsschema
6134 * @short_description: introspecting and controlling the loading of GSettings schemas
6136 * The #GSettingsSchemaSource and #GSettingsSchema APIs provide a
6137 * mechanism for advanced control over the loading of schemas and a
6138 * mechanism for introspecting their content.
6140 * Plugin loading systems that wish to provide plugins a way to access
6141 * settings face the problem of how to make the schemas for these
6142 * settings visible to GSettings. Typically, a plugin will want to ship
6143 * the schema along with itself and it won't be installed into the
6144 * standard system directories for schemas.
6146 * #GSettingsSchemaSource provides a mechanism for dealing with this by
6147 * allowing the creation of a new 'schema source' from which schemas can
6148 * be acquired. This schema source can then become part of the metadata
6149 * associated with the plugin and queried whenever the plugin requires
6150 * access to some settings.
6152 * Consider the following example:
6158 * GSettingsSchemaSource *schema_source;
6163 * initialise_plugin (const gchar *dir)
6169 * plugin->schema_source =
6170 * g_settings_new_schema_source_from_directory (dir,
6171 * g_settings_schema_source_get_default (), FALSE, NULL);
6181 * plugin_get_settings (Plugin *plugin,
6182 * const gchar *schema_id)
6184 * GSettingsSchema *schema;
6186 * if (schema_id == NULL)
6187 * schema_id = plugin->identifier;
6189 * schema = g_settings_schema_source_lookup (plugin->schema_source,
6190 * schema_id, FALSE);
6192 * if (schema == NULL)
6194 * ... disable the plugin or abort, etc ...
6197 * return g_settings_new_full (schema, NULL, NULL);
6201 * The code above shows how hooks should be added to the code that
6202 * initialises (or enables) the plugin to create the schema source and
6203 * how an API can be added to the plugin system to provide a convenient
6204 * way for the plugin to access its settings, using the schemas that it
6207 * From the standpoint of the plugin, it would need to ensure that it
6208 * ships a gschemas.compiled file as part of itself, and then simply do
6213 * GSettings *settings;
6216 * settings = plugin_get_settings (self, NULL);
6217 * some_value = g_settings_get_int (settings, "some-value");
6222 * It's also possible that the plugin system expects the schema source
6223 * files (ie: .gschema.xml files) instead of a gschemas.compiled file.
6224 * In that case, the plugin loading system must compile the schemas for
6225 * itself before attempting to create the settings source.
6232 * SECTION:gsimpleaction
6233 * @title: GSimpleAction
6234 * @short_description: A simple GAction implementation
6236 * A #GSimpleAction is the obvious simple implementation of the #GAction
6237 * interface. This is the easiest way to create an action for purposes of
6238 * adding it to a #GSimpleActionGroup.
6240 * See also #GtkAction.
6245 * SECTION:gsimpleactiongroup
6246 * @title: GSimpleActionGroup
6247 * @short_description: A simple GActionGroup implementation
6249 * #GSimpleActionGroup is a hash table filled with #GAction objects,
6250 * implementing the #GActionGroup and #GActionMap interfaces.
6255 * SECTION:gsimpleasyncresult
6256 * @short_description: Simple asynchronous results implementation
6257 * @include: gio/gio.h
6258 * @see_also: #GAsyncResult
6261 * As of GLib 2.36, #GSimpleAsyncResult is deprecated in favor of
6262 * #GTask, which provides a simpler API.
6265 * #GSimpleAsyncResult implements #GAsyncResult.
6267 * GSimpleAsyncResult handles #GAsyncReadyCallback<!-- -->s, error
6268 * reporting, operation cancellation and the final state of an operation,
6269 * completely transparent to the application. Results can be returned
6270 * as a pointer e.g. for functions that return data that is collected
6271 * asynchronously, a boolean value for checking the success or failure
6272 * of an operation, or a #gssize for operations which return the number
6273 * of bytes modified by the operation; all of the simple return cases
6276 * Most of the time, an application will not need to know of the details
6277 * of this API; it is handled transparently, and any necessary operations
6278 * are handled by #GAsyncResult's interface. However, if implementing a
6279 * new GIO module, for writing language bindings, or for complex
6280 * applications that need better control of how asynchronous operations
6281 * are completed, it is important to understand this functionality.
6283 * GSimpleAsyncResults are tagged with the calling function to ensure
6284 * that asynchronous functions and their finishing functions are used
6285 * together correctly.
6287 * To create a new #GSimpleAsyncResult, call g_simple_async_result_new().
6288 * If the result needs to be created for a #GError, use
6289 * g_simple_async_result_new_from_error() or
6290 * g_simple_async_result_new_take_error(). If a #GError is not available
6291 * (e.g. the asynchronous operation's doesn't take a #GError argument),
6292 * but the result still needs to be created for an error condition, use
6293 * g_simple_async_result_new_error() (or g_simple_async_result_set_error_va()
6294 * if your application or binding requires passing a variable argument list
6295 * directly), and the error can then be propagated through the use of
6296 * g_simple_async_result_propagate_error().
6298 * An asynchronous operation can be made to ignore a cancellation event by
6299 * calling g_simple_async_result_set_handle_cancellation() with a
6300 * #GSimpleAsyncResult for the operation and %FALSE. This is useful for
6301 * operations that are dangerous to cancel, such as close (which would
6302 * cause a leak if cancelled before being run).
6304 * GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
6305 * or it can use #GThread<!-- -->s.
6306 * g_simple_async_result_complete() will finish an I/O task directly
6307 * from the point where it is called. g_simple_async_result_complete_in_idle()
6308 * will finish it from an idle handler in the <link
6309 * linkend="g-main-context-push-thread-default">thread-default main
6310 * context</link>. g_simple_async_result_run_in_thread() will run the
6311 * job in a separate thread and then deliver the result to the
6312 * thread-default main context.
6314 * To set the results of an asynchronous function,
6315 * g_simple_async_result_set_op_res_gpointer(),
6316 * g_simple_async_result_set_op_res_gboolean(), and
6317 * g_simple_async_result_set_op_res_gssize()
6318 * are provided, setting the operation's result to a gpointer, gboolean, or
6319 * gssize, respectively.
6321 * Likewise, to get the result of an asynchronous function,
6322 * g_simple_async_result_get_op_res_gpointer(),
6323 * g_simple_async_result_get_op_res_gboolean(), and
6324 * g_simple_async_result_get_op_res_gssize() are
6325 * provided, getting the operation's result as a gpointer, gboolean, and
6326 * gssize, respectively.
6328 * For the details of the requirements implementations must respect, see
6329 * #GAsyncResult. A typical implementation of an asynchronous operation
6330 * using GSimpleAsyncResult looks something like this:
6334 * baked_cb (Cake *cake,
6335 * gpointer user_data)
6337 * /* In this example, this callback is not given a reference to the cake, so
6338 * * the GSimpleAsyncResult has to take a reference to it.
6340 * GSimpleAsyncResult *result = user_data;
6343 * g_simple_async_result_set_error (result,
6345 * BAKER_ERROR_NO_FLOUR,
6346 * "Go to the supermarket");
6348 * g_simple_async_result_set_op_res_gpointer (result,
6349 * g_object_ref (cake),
6353 * /* In this example, we assume that baked_cb is called as a callback from
6354 * * the mainloop, so it's safe to complete the operation synchronously here.
6355 * * If, however, _baker_prepare_cake () might call its callback without
6356 * * first returning to the mainloop — inadvisable, but some APIs do so —
6357 * * we would need to use g_simple_async_result_complete_in_idle().
6359 * g_simple_async_result_complete (result);
6360 * g_object_unref (result);
6364 * baker_bake_cake_async (Baker *self,
6366 * GAsyncReadyCallback callback,
6367 * gpointer user_data)
6369 * GSimpleAsyncResult *simple;
6374 * g_simple_async_report_error_in_idle (G_OBJECT (self),
6378 * BAKER_ERROR_TOO_SMALL,
6379 * "%ucm radius cakes are silly",
6384 * simple = g_simple_async_result_new (G_OBJECT (self),
6387 * baker_bake_cake_async);
6388 * cake = _baker_get_cached_cake (self, radius);
6392 * g_simple_async_result_set_op_res_gpointer (simple,
6393 * g_object_ref (cake),
6395 * g_simple_async_result_complete_in_idle (simple);
6396 * g_object_unref (simple);
6397 * /* Drop the reference returned by _baker_get_cached_cake(); the
6398 * * GSimpleAsyncResult has taken its own reference.
6400 * g_object_unref (cake);
6404 * _baker_prepare_cake (self, radius, baked_cb, simple);
6408 * baker_bake_cake_finish (Baker *self,
6409 * GAsyncResult *result,
6412 * GSimpleAsyncResult *simple;
6415 * g_return_val_if_fail (g_simple_async_result_is_valid (result,
6417 * baker_bake_cake_async),
6420 * simple = (GSimpleAsyncResult *) result;
6422 * if (g_simple_async_result_propagate_error (simple, error))
6425 * cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
6426 * return g_object_ref (cake);
6433 * SECTION:gsimplepermission
6434 * @title: GSimplePermission
6435 * @short_description: A GPermission that doesn't change value
6437 * #GSimplePermission is a trivial implementation of #GPermission that
6438 * represents a permission that is either always or never allowed. The
6439 * value is given at construction and doesn't change.
6441 * Calling request or release will result in errors.
6447 * @short_description: Low-level socket object
6448 * @include: gio/gio.h
6449 * @see_also: #GInitable
6451 * A #GSocket is a low-level networking primitive. It is a more or less
6452 * direct mapping of the BSD socket API in a portable GObject based API.
6453 * It supports both the UNIX socket implementations and winsock2 on Windows.
6455 * #GSocket is the platform independent base upon which the higher level
6456 * network primitives are based. Applications are not typically meant to
6457 * use it directly, but rather through classes like #GSocketClient,
6458 * #GSocketService and #GSocketConnection. However there may be cases where
6459 * direct use of #GSocket is useful.
6461 * #GSocket implements the #GInitable interface, so if it is manually constructed
6462 * by e.g. g_object_new() you must call g_initable_init() and check the
6463 * results before using the object. This is done automatically in
6464 * g_socket_new() and g_socket_new_from_fd(), so these functions can return
6467 * Sockets operate in two general modes, blocking or non-blocking. When
6468 * in blocking mode all operations block until the requested operation
6469 * is finished or there is an error. In non-blocking mode all calls that
6470 * would block return immediately with a %G_IO_ERROR_WOULD_BLOCK error.
6471 * To know when a call would successfully run you can call g_socket_condition_check(),
6472 * or g_socket_condition_wait(). You can also use g_socket_create_source() and
6473 * attach it to a #GMainContext to get callbacks when I/O is possible.
6474 * Note that all sockets are always set to non blocking mode in the system, and
6475 * blocking mode is emulated in GSocket.
6477 * When working in non-blocking mode applications should always be able to
6478 * handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other
6479 * function said that I/O was possible. This can easily happen in case
6480 * of a race condition in the application, but it can also happen for other
6481 * reasons. For instance, on Windows a socket is always seen as writable
6482 * until a write returns %G_IO_ERROR_WOULD_BLOCK.
6484 * #GSocket<!-- -->s can be either connection oriented or datagram based.
6485 * For connection oriented types you must first establish a connection by
6486 * either connecting to an address or accepting a connection from another
6487 * address. For connectionless socket types the target/source address is
6488 * specified or received in each I/O operation.
6490 * All socket file descriptors are set to be close-on-exec.
6492 * Note that creating a #GSocket causes the signal %SIGPIPE to be
6493 * ignored for the remainder of the program. If you are writing a
6494 * command-line utility that uses #GSocket, you may need to take into
6495 * account the fact that your program will not automatically be killed
6496 * if it tries to write to %stdout after it has been closed.
6503 * SECTION:gsocketaddress
6504 * @short_description: Abstract base class representing endpoints for socket communication
6506 * #GSocketAddress is the equivalent of <type>struct sockaddr</type>
6507 * in the BSD sockets API. This is an abstract class; use
6508 * #GInetSocketAddress for internet sockets, or #GUnixSocketAddress
6509 * for UNIX domain sockets.
6514 * SECTION:gsocketclient
6515 * @short_description: Helper for connecting to a network service
6516 * @include: gio/gio.h
6517 * @see_also: #GSocketConnection, #GSocketListener
6519 * #GSocketClient is a lightweight high-level utility class for connecting to
6520 * a network host using a connection oriented socket type.
6522 * You create a #GSocketClient object, set any options you want, and then
6523 * call a sync or async connect operation, which returns a #GSocketConnection
6524 * subclass on success.
6526 * The type of the #GSocketConnection object returned depends on the type of
6527 * the underlying socket that is in use. For instance, for a TCP/IP connection
6528 * it will be a #GTcpConnection.
6530 * As #GSocketClient is a lightweight object, you don't need to cache it. You
6531 * can just create a new one any time you need one.
6538 * SECTION:gsocketconnectable
6539 * @short_description: Interface for potential socket endpoints
6541 * Objects that describe one or more potential socket endpoints
6542 * implement #GSocketConnectable. Callers can then use
6543 * g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator
6544 * to try out each socket address in turn until one succeeds, as shown
6545 * in the sample code below.
6548 * MyConnectionType *
6549 * connect_to_host (const char *hostname,
6551 * GCancellable *cancellable,
6554 * MyConnection *conn = NULL;
6555 * GSocketConnectable *addr;
6556 * GSocketAddressEnumerator *enumerator;
6557 * GSocketAddress *sockaddr;
6558 * GError *conn_error = NULL;
6560 * addr = g_network_address_new ("www.gnome.org", 80);
6561 * enumerator = g_socket_connectable_enumerate (addr);
6562 * g_object_unref (addr);
6564 * /<!-- -->* Try each sockaddr until we succeed. Record the first
6565 * * connection error, but not any further ones (since they'll probably
6566 * * be basically the same as the first).
6568 * while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error))
6570 * conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error);
6571 * g_object_unref (sockaddr);
6573 * g_object_unref (enumerator);
6579 * /<!-- -->* We couldn't connect to the first address, but we succeeded
6580 * * in connecting to a later address.
6582 * g_error_free (conn_error);
6588 * /<!-- -->* Either the initial lookup failed, or else the caller
6592 * g_error_free (conn_error);
6597 * g_error_propagate (error, conn_error);
6606 * SECTION:gsocketconnection
6607 * @short_description: A socket connection
6608 * @include: gio/gio.h
6609 * @see_also: #GIOStream, #GSocketClient, #GSocketListener
6611 * #GSocketConnection is a #GIOStream for a connected socket. They
6612 * can be created either by #GSocketClient when connecting to a host,
6613 * or by #GSocketListener when accepting a new client.
6615 * The type of the #GSocketConnection object returned from these calls
6616 * depends on the type of the underlying socket that is in use. For
6617 * instance, for a TCP/IP connection it will be a #GTcpConnection.
6619 * Choosing what type of object to construct is done with the socket
6620 * connection factory, and it is possible for 3rd parties to register
6621 * custom socket connection types for specific combination of socket
6622 * family/type/protocol using g_socket_connection_factory_register_type().
6629 * SECTION:gsocketcontrolmessage
6630 * @title: GSocketControlMessage
6631 * @short_description: A GSocket control message
6632 * @see_also: #GSocket.
6634 * A #GSocketControlMessage is a special-purpose utility message that
6635 * can be sent to or received from a #GSocket. These types of
6636 * messages are often called "ancillary data".
6638 * The message can represent some sort of special instruction to or
6639 * information from the socket or can represent a special kind of
6640 * transfer to the peer (for example, sending a file description over
6643 * These messages are sent with g_socket_send_message() and received
6644 * with g_socket_receive_message().
6646 * To extend the set of control message that can be sent, subclass this
6647 * class and override the get_size, get_level, get_type and serialize
6650 * To extend the set of control messages that can be received, subclass
6651 * this class and implement the deserialize method. Also, make sure your
6652 * class is registered with the GType typesystem before calling
6653 * g_socket_receive_message() to read such a message.
6660 * SECTION:gsocketlistener
6661 * @title: GSocketListener
6662 * @short_description: Helper for accepting network client connections
6663 * @see_also: #GThreadedSocketService, #GSocketService.
6665 * A #GSocketListener is an object that keeps track of a set
6666 * of server sockets and helps you accept sockets from any of the
6667 * socket, either sync or async.
6669 * If you want to implement a network server, also look at #GSocketService
6670 * and #GThreadedSocketService which are subclass of #GSocketListener
6671 * that makes this even easier.
6678 * SECTION:gsocketservice
6679 * @title: GSocketService
6680 * @short_description: Make it easy to implement a network service
6681 * @see_also: #GThreadedSocketService, #GSocketListener.
6683 * A #GSocketService is an object that represents a service that
6684 * is provided to the network or over local sockets. When a new
6685 * connection is made to the service the #GSocketService::incoming
6686 * signal is emitted.
6688 * A #GSocketService is a subclass of #GSocketListener and you need
6689 * to add the addresses you want to accept connections on with the
6690 * #GSocketListener APIs.
6692 * There are two options for implementing a network service based on
6693 * #GSocketService. The first is to create the service using
6694 * g_socket_service_new() and to connect to the #GSocketService::incoming
6695 * signal. The second is to subclass #GSocketService and override the
6696 * default signal handler implementation.
6698 * In either case, the handler must immediately return, or else it
6699 * will block additional incoming connections from being serviced.
6700 * If you are interested in writing connection handlers that contain
6701 * blocking code then see #GThreadedSocketService.
6703 * The socket service runs on the main loop of the <link
6704 * linkend="g-main-context-push-thread-default-context">thread-default
6705 * context</link> of the thread it is created in, and is not
6706 * threadsafe in general. However, the calls to start and stop the
6707 * service are thread-safe so these can be used from threads that
6708 * handle incoming clients.
6715 * SECTION:gsrvtarget
6716 * @short_description: DNS SRV record target
6717 * @include: gio/gio.h
6719 * SRV (service) records are used by some network protocols to provide
6720 * service-specific aliasing and load-balancing. For example, XMPP
6721 * (Jabber) uses SRV records to locate the XMPP server for a domain;
6722 * rather than connecting directly to "example.com" or assuming a
6723 * specific server hostname like "xmpp.example.com", an XMPP client
6724 * would look up the "xmpp-client" SRV record for "example.com", and
6725 * then connect to whatever host was pointed to by that record.
6727 * You can use g_resolver_lookup_service() or
6728 * g_resolver_lookup_service_async() to find the #GSrvTarget<!-- -->s
6729 * for a given service. However, if you are simply planning to connect
6730 * to the remote service, you can use #GNetworkService's
6731 * #GSocketConnectable interface and not need to worry about
6732 * #GSrvTarget at all.
6738 * @short_description: Cancellable synchronous or asynchronous task and result
6739 * @include: gio/gio.h
6740 * @see_also: #GAsyncResult
6743 * A #GTask represents and manages a cancellable "task".
6746 * <title>Asynchronous operations</title>
6748 * The most common usage of #GTask is as a #GAsyncResult, to
6749 * manage data during an asynchronous operation. You call
6750 * g_task_new() in the "start" method, followed by
6751 * g_task_set_task_data() and the like if you need to keep some
6752 * additional data associated with the task, and then pass the
6753 * task object around through your asynchronous operation.
6754 * Eventually, you will call a method such as
6755 * g_task_return_pointer() or g_task_return_error(), which will
6756 * save the value you give it and then invoke the task's callback
6757 * function (waiting until the next next iteration of the main
6758 * loop first, if necessary). The caller will pass the #GTask back
6759 * to the operation's finish function (as a #GAsyncResult), and
6760 * you can use g_task_propagate_pointer() or the like to extract
6763 * <example id="gtask-async"><title>GTask as a GAsyncResult</title>
6766 * CakeFrostingType frosting;
6771 * decoration_data_free (DecorationData *decoration)
6773 * g_free (decoration->message);
6774 * g_slice_free (DecorationData, decoration);
6778 * baked_cb (Cake *cake,
6779 * gpointer user_data)
6781 * GTask *task = user_data;
6782 * DecorationData *decoration = g_task_get_task_data (task);
6783 * GError *error = NULL;
6787 * g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_NO_FLOUR,
6788 * "Go to the supermarket");
6789 * g_object_unref (task);
6793 * if (!cake_decorate (cake, decoration->frosting, decoration->message, &error))
6795 * g_object_unref (cake);
6796 * /* g_task_return_error() takes ownership of error */
6797 * g_task_return_error (task, error);
6798 * g_object_unref (task);
6802 * g_task_return_pointer (result, cake, g_object_unref);
6803 * g_object_unref (task);
6807 * baker_bake_cake_async (Baker *self,
6809 * CakeFlavor flavor,
6810 * CakeFrostingType frosting,
6811 * const char *message,
6812 * GCancellable *cancellable,
6813 * GAsyncReadyCallback callback,
6814 * gpointer user_data)
6817 * DecorationData *decoration;
6820 * task = g_task_new (self, cancellable, callback, user_data);
6823 * g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_TOO_SMALL,
6824 * "%ucm radius cakes are silly",
6826 * g_object_unref (task);
6830 * cake = _baker_get_cached_cake (self, radius, flavor, frosting, message);
6833 * /* _baker_get_cached_cake() returns a reffed cake */
6834 * g_task_return_pointer (task, cake, g_object_unref);
6835 * g_object_unref (task);
6839 * decoration = g_slice_new (DecorationData);
6840 * decoration->frosting = frosting;
6841 * decoration->message = g_strdup (message);
6842 * g_task_set_task_data (task, decoration, (GDestroyNotify) decoration_data_free);
6844 * _baker_begin_cake (self, radius, flavor, cancellable, baked_cb, task);
6848 * baker_bake_cake_finish (Baker *self,
6849 * GAsyncResult *result,
6852 * g_return_val_if_fail (g_task_is_valid (result, self), NULL);
6854 * return g_task_propagate_pointer (G_TASK (result), error);
6860 * <title>Chained asynchronous operations</title>
6862 * #GTask also tries to simplify asynchronous operations that
6863 * internally chain together several smaller asynchronous
6864 * operations. g_task_get_cancellable(), g_task_get_context(), and
6865 * g_task_get_priority() allow you to get back the task's
6866 * #GCancellable, #GMainContext, and <link
6867 * linkend="io-priority">I/O priority</link> when starting a new
6868 * subtask, so you don't have to keep track of them yourself.
6869 * g_task_attach_source() simplifies the case of waiting for a
6870 * source to fire (automatically using the correct #GMainContext
6873 * <example id="gtask-chained"><title>Chained asynchronous operations</title>
6877 * CakeFrostingType frosting;
6882 * decoration_data_free (BakingData *bd)
6885 * g_object_unref (bd->cake);
6886 * g_free (bd->message);
6887 * g_slice_free (BakingData, bd);
6891 * decorated_cb (Cake *cake,
6892 * GAsyncResult *result,
6893 * gpointer user_data)
6895 * GTask *task = user_data;
6896 * GError *error = NULL;
6898 * if (!cake_decorate_finish (cake, result, &error))
6900 * g_object_unref (cake);
6901 * g_task_return_error (task, error);
6902 * g_object_unref (task);
6906 * /* baking_data_free() will drop its ref on the cake, so
6907 * * we have to take another here to give to the caller.
6909 * g_task_return_pointer (result, g_object_ref (cake), g_object_unref);
6910 * g_object_unref (task);
6914 * decorator_ready (gpointer user_data)
6916 * GTask *task = user_data;
6917 * BakingData *bd = g_task_get_task_data (task);
6919 * cake_decorate_async (bd->cake, bd->frosting, bd->message,
6920 * g_task_get_cancellable (task),
6921 * decorated_cb, task);
6925 * baked_cb (Cake *cake,
6926 * gpointer user_data)
6928 * GTask *task = user_data;
6929 * BakingData *bd = g_task_get_task_data (task);
6930 * GError *error = NULL;
6934 * g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_NO_FLOUR,
6935 * "Go to the supermarket");
6936 * g_object_unref (task);
6942 * /* Bail out now if the user has already cancelled */
6943 * if (g_task_return_error_if_cancelled (g_task_get_cancellable (task)))
6945 * g_object_unref (task);
6949 * if (cake_decorator_available (cake))
6950 * decorator_ready (task);
6955 * source = cake_decorator_wait_source_new (cake);
6956 * /* Attach @source to @task's GMainContext and have it call
6957 * * decorator_ready() when it is ready.
6959 * g_task_attach_source (task, source,
6960 * G_CALLBACK (decorator_ready));
6961 * g_source_unref (source);
6966 * baker_bake_cake_async (Baker *self,
6968 * CakeFlavor flavor,
6969 * CakeFrostingType frosting,
6970 * const char *message,
6972 * GCancellable *cancellable,
6973 * GAsyncReadyCallback callback,
6974 * gpointer user_data)
6979 * task = g_task_new (self, cancellable, callback, user_data);
6980 * g_task_set_priority (task, priority);
6982 * bd = g_slice_new0 (BakingData);
6983 * bd->frosting = frosting;
6984 * bd->message = g_strdup (message);
6985 * g_task_set_task_data (task, bd, (GDestroyNotify) baking_data_free);
6987 * _baker_begin_cake (self, radius, flavor, cancellable, baked_cb, task);
6991 * baker_bake_cake_finish (Baker *self,
6992 * GAsyncResult *result,
6995 * g_return_val_if_fail (g_task_is_valid (result, self), NULL);
6997 * return g_task_propagate_pointer (G_TASK (result), error);
7003 * <title>Asynchronous operations from synchronous ones</title>
7005 * You can use g_task_run_in_thread() to turn a synchronous
7006 * operation into an asynchronous one, by running it in a thread
7007 * which will then dispatch the result back to the caller's
7008 * #GMainContext when it completes.
7010 * <example id="gtask-run-in-thread"><title>g_task_run_in_thread()</title>
7014 * CakeFlavor flavor;
7015 * CakeFrostingType frosting;
7020 * cake_data_free (CakeData *cake_data)
7022 * g_free (cake_data->message);
7023 * g_slice_free (CakeData, cake_data);
7027 * bake_cake_thread (GTask *task,
7028 * gpointer source_object,
7029 * gpointer task_data,
7030 * GCancellable *cancellable)
7032 * Baker *self = source_object;
7033 * CakeData *cake_data = task_data;
7035 * GError *error = NULL;
7037 * cake = bake_cake (baker, cake_data->radius, cake_data->flavor,
7038 * cake_data->frosting, cake_data->message,
7039 * cancellable, &error);
7041 * g_task_return_pointer (task, cake, g_object_unref);
7043 * g_task_return_error (task, error);
7047 * baker_bake_cake_async (Baker *self,
7049 * CakeFlavor flavor,
7050 * CakeFrostingType frosting,
7051 * const char *message,
7052 * GCancellable *cancellable,
7053 * GAsyncReadyCallback callback,
7054 * gpointer user_data)
7056 * CakeData *cake_data;
7059 * cake_data = g_slice_new (CakeData);
7060 * cake_data->radius = radius;
7061 * cake_data->flavor = flavor;
7062 * cake_data->frosting = frosting;
7063 * cake_data->message = g_strdup (message);
7064 * task = g_task_new (self, cancellable, callback, user_data);
7065 * g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7066 * g_task_run_in_thread (task, bake_cake_thread);
7070 * baker_bake_cake_finish (Baker *self,
7071 * GAsyncResult *result,
7074 * g_return_val_if_fail (g_task_is_valid (result, self), NULL);
7076 * return g_task_propagate_pointer (G_TASK (result), error);
7082 * <title>Adding cancellability to uncancellable tasks</title>
7084 * Finally, g_task_run_in_thread() and g_task_run_in_thread_sync()
7085 * can be used to turn an uncancellable operation into a
7086 * cancellable one. If you call g_task_set_return_on_cancel(),
7087 * passing %TRUE, then if the task's #GCancellable is cancelled,
7088 * it will return control back to the caller immediately, while
7089 * allowing the task thread to continue running in the background
7090 * (and simply discarding its result when it finally does finish).
7091 * Provided that the task thread is careful about how it uses
7092 * locks and other externally-visible resources, this allows you
7093 * to make "GLib-friendly" asynchronous and cancellable
7094 * synchronous variants of blocking APIs.
7096 * <example id="gtask-cancellable"><title>g_task_set_return_on_cancel()</title>
7099 * bake_cake_thread (GTask *task,
7100 * gpointer source_object,
7101 * gpointer task_data,
7102 * GCancellable *cancellable)
7104 * Baker *self = source_object;
7105 * CakeData *cake_data = task_data;
7107 * GError *error = NULL;
7109 * cake = bake_cake (baker, cake_data->radius, cake_data->flavor,
7110 * cake_data->frosting, cake_data->message,
7114 * g_task_return_error (task, error);
7118 * /* If the task has already been cancelled, then we don't
7119 * * want to add the cake to the cake cache. Likewise, we don't
7120 * * want to have the task get cancelled in the middle of
7121 * * updating the cache. g_task_set_return_on_cancel() will
7122 * * return %TRUE here if it managed to disable return-on-cancel,
7123 * * or %FALSE if the task was cancelled before it could.
7125 * if (g_task_set_return_on_cancel (task, FALSE))
7127 * /* If the caller cancels at this point, their
7128 * * GAsyncReadyCallback won't be invoked until we return,
7129 * * so we don't have to worry that this code will run at
7130 * * the same time as that code does. But if there were
7131 * * other functions that might look at the cake cache,
7132 * * then we'd probably need a GMutex here as well.
7134 * baker_add_cake_to_cache (baker, cake);
7135 * g_task_return_pointer (task, cake, g_object_unref);
7140 * baker_bake_cake_async (Baker *self,
7142 * CakeFlavor flavor,
7143 * CakeFrostingType frosting,
7144 * const char *message,
7145 * GCancellable *cancellable,
7146 * GAsyncReadyCallback callback,
7147 * gpointer user_data)
7149 * CakeData *cake_data;
7152 * cake_data = g_slice_new (CakeData);
7155 * task = g_task_new (self, cancellable, callback, user_data);
7156 * g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7157 * g_task_set_return_on_cancel (task, TRUE);
7158 * g_task_run_in_thread (task, bake_cake_thread);
7162 * baker_bake_cake_sync (Baker *self,
7164 * CakeFlavor flavor,
7165 * CakeFrostingType frosting,
7166 * const char *message,
7167 * GCancellable *cancellable,
7170 * CakeData *cake_data;
7174 * cake_data = g_slice_new (CakeData);
7177 * task = g_task_new (self, cancellable, NULL, NULL);
7178 * g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7179 * g_task_set_return_on_cancel (task, TRUE);
7180 * g_task_run_in_thread_sync (task, bake_cake_thread);
7182 * cake = g_task_propagate_pointer (task, error);
7183 * g_object_unref (task);
7190 * <title>Porting from <literal>GSimpleAsyncResult</literal></title>
7192 * #GTask's API attempts to be simpler than #GSimpleAsyncResult's
7197 * You can save task-specific data with g_task_set_task_data(), and
7198 * retrieve it later with g_task_get_task_data(). This replaces the
7199 * abuse of g_simple_async_result_set_op_res_gpointer() for the same
7200 * purpose with #GSimpleAsyncResult.
7201 * </para></listitem>
7203 * In addition to the task data, #GTask also keeps track of the
7204 * <link linkend="io-priority">priority</link>, #GCancellable, and
7205 * #GMainContext associated with the task, so tasks that consist of
7206 * a chain of simpler asynchronous operations will have easy access
7207 * to those values when starting each sub-task.
7208 * </para></listitem>
7210 * g_task_return_error_if_cancelled() provides simplified
7211 * handling for cancellation. In addition, cancellation
7212 * overrides any other #GTask return value by default, like
7213 * #GSimpleAsyncResult does when
7214 * g_simple_async_result_set_check_cancellable() is called.
7215 * (You can use g_task_set_check_cancellable() to turn off that
7216 * behavior.) On the other hand, g_task_run_in_thread()
7217 * guarantees that it will always run your
7218 * <literal>task_func</literal>, even if the task's #GCancellable
7219 * is already cancelled before the task gets a chance to run;
7220 * you can start your <literal>task_func</literal> with a
7221 * g_task_return_error_if_cancelled() check if you need the
7223 * </para></listitem>
7225 * The "return" methods (eg, g_task_return_pointer())
7226 * automatically cause the task to be "completed" as well, and
7227 * there is no need to worry about the "complete" vs "complete
7228 * in idle" distinction. (#GTask automatically figures out
7229 * whether the task's callback can be invoked directly, or
7230 * if it needs to be sent to another #GMainContext, or delayed
7231 * until the next iteration of the current #GMainContext.)
7232 * </para></listitem>
7234 * The "finish" functions for #GTask-based operations are generally
7235 * much simpler than #GSimpleAsyncResult ones, normally consisting
7236 * of only a single call to g_task_propagate_pointer() or the like.
7237 * Since g_task_propagate_pointer() "steals" the return value from
7238 * the #GTask, it is not necessary to juggle pointers around to
7239 * prevent it from being freed twice.
7240 * </para></listitem>
7242 * With #GSimpleAsyncResult, it was common to call
7243 * g_simple_async_result_propagate_error() from the
7244 * <literal>_finish()</literal> wrapper function, and have
7245 * virtual method implementations only deal with successful
7246 * returns. This behavior is deprecated, because it makes it
7247 * difficult for a subclass to chain to a parent class's async
7248 * methods. Instead, the wrapper function should just be a
7249 * simple wrapper, and the virtual method should call an
7250 * appropriate <literal>g_task_propagate_</literal> function.
7251 * Note that wrapper methods can now use
7252 * g_async_result_legacy_propagate_error() to do old-style
7253 * #GSimpleAsyncResult error-returning behavior, and
7254 * g_async_result_is_tagged() to check if a result is tagged as
7255 * having come from the <literal>_async()</literal> wrapper
7256 * function (for "short-circuit" results, such as when passing
7257 * 0 to g_input_stream_read_async()).
7258 * </para></listitem>
7265 * SECTION:gtcpconnection
7266 * @title: GTcpConnection
7267 * @short_description: A TCP GSocketConnection
7268 * @see_also: #GSocketConnection.
7270 * This is the subclass of #GSocketConnection that is created
7271 * for TCP/IP sockets.
7278 * SECTION:gtcpwrapperconnection
7279 * @title: GTcpWrapperConnection
7280 * @short_description: wrapper for non-GSocketConnection-based, GSocket-based GIOStreams
7281 * @see_also: #GSocketConnection.
7283 * A #GTcpWrapperConnection can be used to wrap a #GIOStream that is
7284 * based on a #GSocket, but which is not actually a
7285 * #GSocketConnection. This is used by #GSocketClient so that it can
7286 * always return a #GSocketConnection, even when the connection it has
7287 * actually created is not directly a #GSocketConnection.
7295 * @short_description: D-Bus testing helper
7296 * @include: gio/gio.h
7298 * A helper class for testing code which uses D-Bus without touching the user's
7304 * SECTION:gthemedicon
7305 * @short_description: Icon theming support
7306 * @include: gio/gio.h
7307 * @see_also: #GIcon, #GLoadableIcon
7309 * #GThemedIcon is an implementation of #GIcon that supports icon themes.
7310 * #GThemedIcon contains a list of all of the icons present in an icon
7311 * theme, so that icons can be looked up quickly. #GThemedIcon does
7312 * not provide actual pixmaps for icons, just the icon names.
7313 * Ideally something like gtk_icon_theme_choose_icon() should be used to
7314 * resolve the list of names so that fallback icons work nicely with
7315 * themes that inherit other themes.
7320 * SECTION:gthreadedsocketservice
7321 * @title: GThreadedSocketService
7322 * @short_description: A threaded GSocketService
7323 * @see_also: #GSocketService.
7325 * A #GThreadedSocketService is a simple subclass of #GSocketService
7326 * that handles incoming connections by creating a worker thread and
7327 * dispatching the connection to it by emitting the
7328 * #GThreadedSocketService::run signal in the new thread.
7330 * The signal handler may perform blocking IO and need not return
7331 * until the connection is closed.
7333 * The service is implemented using a thread pool, so there is a
7334 * limited amount of threads available to serve incoming requests.
7335 * The service automatically stops the #GSocketService from accepting
7336 * new connections when all threads are busy.
7338 * As with #GSocketService, you may connect to #GThreadedSocketService::run,
7339 * or subclass and override the default handler.
7345 * @title: TLS Overview
7346 * @short_description: TLS (aka SSL) support for GSocketConnection
7347 * @include: gio/gio.h
7349 * #GTlsConnection and related classes provide TLS (Transport Layer
7350 * Security, previously known as SSL, Secure Sockets Layer) support for
7351 * gio-based network streams.
7353 * In the simplest case, for a client connection, you can just set the
7354 * #GSocketClient:tls flag on a #GSocketClient, and then any
7355 * connections created by that client will have TLS negotiated
7356 * automatically, using appropriate default settings, and rejecting
7357 * any invalid or self-signed certificates (unless you change that
7358 * default by setting the #GSocketClient:tls-validation-flags
7359 * property). The returned object will be a #GTcpWrapperConnection,
7360 * which wraps the underlying #GTlsClientConnection.
7362 * For greater control, you can create your own #GTlsClientConnection,
7363 * wrapping a #GSocketConnection (or an arbitrary #GIOStream with
7364 * pollable input and output streams) and then connect to its signals,
7365 * such as #GTlsConnection::accept-certificate, before starting the
7368 * Server-side TLS is similar, using #GTlsServerConnection. At the
7369 * moment, there is no support for automatically wrapping server-side
7370 * connections in the way #GSocketClient does for client-side
7376 * SECTION:gtlsbackend
7377 * @title: GTlsBackend
7378 * @short_description: TLS backend implementation
7379 * @include: gio/gio.h
7384 * SECTION:gtlscertificate
7385 * @title: GTlsCertificate
7386 * @short_description: TLS certificate
7387 * @see_also: #GTlsConnection
7389 * A certificate used for TLS authentication and encryption.
7390 * This can represent either a certificate only (eg, the certificate
7391 * received by a client from a server), or the combination of
7392 * a certificate and a private key (which is needed when acting as a
7393 * #GTlsServerConnection).
7400 * SECTION:gtlsclientconnection
7401 * @short_description: TLS client-side connection
7402 * @include: gio/gio.h
7404 * #GTlsClientConnection is the client-side subclass of
7405 * #GTlsConnection, representing a client-side TLS connection.
7410 * SECTION:gtlsconnection
7411 * @short_description: TLS connection type
7412 * @include: gio/gio.h
7414 * #GTlsConnection is the base TLS connection class type, which wraps
7415 * a #GIOStream and provides TLS encryption on top of it. Its
7416 * subclasses, #GTlsClientConnection and #GTlsServerConnection,
7417 * implement client-side and server-side TLS, respectively.
7424 * SECTION:gtlsdatabase
7425 * @short_description: TLS database type
7426 * @include: gio/gio.h
7428 * #GTlsDatabase is used to lookup certificates and other information
7429 * from a certificate or key store. It is an abstract base class which
7430 * TLS library specific subtypes override.
7432 * Most common client applications will not directly interact with
7433 * #GTlsDatabase. It is used internally by #GTlsConnection.
7440 * SECTION:gtlsfiledatabase
7441 * @short_description: TLS file based database type
7442 * @include: gio/gio.h
7444 * #GTlsFileDatabase is implemented by #GTlsDatabase objects which load
7445 * their certificate information from a file. It is in interface which
7446 * TLS library specific subtypes implement.
7453 * SECTION:gtlsinteraction
7454 * @short_description: Interaction with the user during TLS operations.
7455 * @include: gio/gio.h
7457 * #GTlsInteraction provides a mechanism for the TLS connection and database
7458 * code to interact with the user. It can be used to ask the user for passwords.
7460 * To use a #GTlsInteraction with a TLS connection use
7461 * g_tls_connection_set_interaction().
7463 * Callers should instantiate a derived class that implements the various
7464 * interaction methods to show the required dialogs.
7466 * Callers should use the 'invoke' functions like
7467 * g_tls_interaction_invoke_ask_password() to run interaction methods. These
7468 * functions make sure that the interaction is invoked in the main loop
7469 * and not in the current thread, if the current thread is not running the
7472 * Derived classes can choose to implement whichever interactions methods they'd
7473 * like to support by overriding those virtual methods in their class
7474 * initialization function. Any interactions not implemented will return
7475 * %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
7476 * it must also implement the corresponding finish method.
7481 * SECTION:gtlspassword
7482 * @title: GTlsPassword
7483 * @short_description: TLS Passwords for prompting
7484 * @include: gio/gio.h
7486 * Holds a password used in TLS.
7491 * SECTION:gtlsserverconnection
7492 * @short_description: TLS server-side connection
7493 * @include: gio/gio.h
7495 * #GTlsServerConnection is the server-side subclass of #GTlsConnection,
7496 * representing a server-side TLS connection.
7503 * SECTION:gunixconnection
7504 * @title: GUnixConnection
7505 * @short_description: A UNIX domain GSocketConnection
7506 * @include: gio/gunixconnection.h
7507 * @see_also: #GSocketConnection.
7509 * This is the subclass of #GSocketConnection that is created
7510 * for UNIX domain sockets.
7512 * It contains functions to do some of the UNIX socket specific
7513 * functionality like passing file descriptors.
7515 * Note that <filename><gio/gunixconnection.h></filename> belongs to
7516 * the UNIX-specific GIO interfaces, thus you have to use the
7517 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7524 * SECTION:gunixcredentialsmessage
7525 * @title: GUnixCredentialsMessage
7526 * @short_description: A GSocketControlMessage containing credentials
7527 * @include: gio/gunixcredentialsmessage.h
7528 * @see_also: #GUnixConnection, #GSocketControlMessage
7530 * This #GSocketControlMessage contains a #GCredentials instance. It
7531 * may be sent using g_socket_send_message() and received using
7532 * g_socket_receive_message() over UNIX sockets (ie: sockets in the
7533 * %G_SOCKET_FAMILY_UNIX family).
7535 * For an easier way to send and receive credentials over
7536 * stream-oriented UNIX sockets, see
7537 * g_unix_connection_send_credentials() and
7538 * g_unix_connection_receive_credentials(). To receive credentials of
7539 * a foreign process connected to a socket, use
7540 * g_socket_get_credentials().
7545 * SECTION:gunixfdlist
7546 * @title: GUnixFDList
7547 * @short_description: An object containing a set of UNIX file descriptors
7548 * @include: gio/gunixfdlist.h
7549 * @see_also: #GUnixFDMessage
7551 * A #GUnixFDList contains a list of file descriptors. It owns the file
7552 * descriptors that it contains, closing them when finalized.
7554 * It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
7555 * the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
7556 * and received using g_socket_receive_message().
7558 * Note that <filename><gio/gunixfdlist.h></filename> belongs to
7559 * the UNIX-specific GIO interfaces, thus you have to use the
7560 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7565 * SECTION:gunixfdmessage
7566 * @title: GUnixFDMessage
7567 * @short_description: A GSocketControlMessage containing a GUnixFDList
7568 * @include: gio/gunixfdmessage.h
7569 * @see_also: #GUnixConnection, #GUnixFDList, #GSocketControlMessage
7571 * This #GSocketControlMessage contains a #GUnixFDList.
7572 * It may be sent using g_socket_send_message() and received using
7573 * g_socket_receive_message() over UNIX sockets (ie: sockets in the
7574 * %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied
7575 * between processes by the kernel.
7577 * For an easier way to send and receive file descriptors over
7578 * stream-oriented UNIX sockets, see g_unix_connection_send_fd() and
7579 * g_unix_connection_receive_fd().
7581 * Note that <filename><gio/gunixfdmessage.h></filename> belongs to
7582 * the UNIX-specific GIO interfaces, thus you have to use the
7583 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7588 * SECTION:gunixinputstream
7589 * @short_description: Streaming input operations for UNIX file descriptors
7590 * @include: gio/gunixinputstream.h
7591 * @see_also: #GInputStream
7593 * #GUnixInputStream implements #GInputStream for reading from a UNIX
7594 * file descriptor, including asynchronous operations. (If the file
7595 * descriptor refers to a socket or pipe, this will use poll() to do
7596 * asynchronous I/O. If it refers to a regular file, it will fall back
7597 * to doing asynchronous I/O in another thread.)
7599 * Note that <filename><gio/gunixinputstream.h></filename> belongs
7600 * to the UNIX-specific GIO interfaces, thus you have to use the
7601 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7606 * SECTION:gunixmounts
7607 * @include: gio/gunixmounts.h
7608 * @short_description: UNIX mounts
7610 * Routines for managing mounted UNIX mount points and paths.
7612 * Note that <filename><gio/gunixmounts.h></filename> belongs to the
7613 * UNIX-specific GIO interfaces, thus you have to use the
7614 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7619 * SECTION:gunixoutputstream
7620 * @short_description: Streaming output operations for UNIX file descriptors
7621 * @include: gio/gunixoutputstream.h
7622 * @see_also: #GOutputStream
7624 * #GUnixOutputStream implements #GOutputStream for writing to a UNIX
7625 * file descriptor, including asynchronous operations. (If the file
7626 * descriptor refers to a socket or pipe, this will use poll() to do
7627 * asynchronous I/O. If it refers to a regular file, it will fall back
7628 * to doing asynchronous I/O in another thread.)
7630 * Note that <filename><gio/gunixoutputstream.h></filename> belongs
7631 * to the UNIX-specific GIO interfaces, thus you have to use the
7632 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7637 * SECTION:gunixsocketaddress
7638 * @short_description: UNIX GSocketAddress
7639 * @include: gio/gunixsocketaddress.h
7641 * Support for UNIX-domain (also known as local) sockets.
7643 * UNIX domain sockets are generally visible in the filesystem.
7644 * However, some systems support abstract socket names which are not
7645 * visible in the filesystem and not affected by the filesystem
7646 * permissions, visibility, etc. Currently this is only supported
7647 * under Linux. If you attempt to use abstract sockets on other
7648 * systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED
7649 * errors. You can use g_unix_socket_address_abstract_names_supported()
7650 * to see if abstract names are supported.
7652 * Note that <filename><gio/gunixsocketaddress.h></filename> belongs to
7653 * the UNIX-specific GIO interfaces, thus you have to use the
7654 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7660 * @short_description: Virtual File System
7661 * @include: gio/gio.h
7663 * Entry point for using GIO functionality.
7669 * @short_description: Volume management
7670 * @include: gio/gio.h
7672 * The #GVolume interface represents user-visible objects that can be
7673 * mounted. Note, when porting from GnomeVFS, #GVolume is the moral
7674 * equivalent of #GnomeVFSDrive.
7676 * Mounting a #GVolume instance is an asynchronous operation. For more
7677 * information about asynchronous operations, see #GAsyncResult and
7678 * #GSimpleAsyncResult. To mount a #GVolume, first call
7679 * g_volume_mount() with (at least) the #GVolume instance, optionally
7680 * a #GMountOperation object and a #GAsyncReadyCallback.
7682 * Typically, one will only want to pass %NULL for the
7683 * #GMountOperation if automounting all volumes when a desktop session
7684 * starts since it's not desirable to put up a lot of dialogs asking
7687 * The callback will be fired when the operation has resolved (either
7688 * with success or failure), and a #GAsyncReady structure will be
7689 * passed to the callback. That callback should then call
7690 * g_volume_mount_finish() with the #GVolume instance and the
7691 * #GAsyncReady data to see if the operation was completed
7692 * successfully. If an @error is present when g_volume_mount_finish()
7693 * is called, then it will be filled with any error information.
7695 * <para id="volume-identifier">
7696 * It is sometimes necessary to directly access the underlying
7697 * operating system object behind a volume (e.g. for passing a volume
7698 * to an application via the commandline). For this purpose, GIO
7699 * allows to obtain an 'identifier' for the volume. There can be
7700 * different kinds of identifiers, such as Hal UDIs, filesystem labels,
7701 * traditional Unix devices (e.g. <filename>/dev/sda2</filename>),
7702 * uuids. GIO uses predefind strings as names for the different kinds
7703 * of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
7704 * #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
7705 * to obtain an identifier for a volume.
7708 * Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
7709 * when the gvfs hal volume monitor is in use. Other volume monitors
7710 * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
7711 * identifier, which can be used to obtain a hal device by means of
7712 * libhal_manager_find_device_string_match().
7717 * SECTION:gvolumemonitor
7718 * @short_description: Volume Monitor
7719 * @include: gio/gio.h
7720 * @see_also: #GFileMonitor
7722 * #GVolumeMonitor is for listing the user interesting devices and volumes
7723 * on the computer. In other words, what a file selector or file manager
7724 * would show in a sidebar.
7726 * #GVolumeMonitor is not <link
7727 * linkend="g-main-context-push-thread-default">thread-default-context
7728 * aware</link>, and so should not be used other than from the main
7729 * thread, with no thread-default-context active.
7734 * SECTION:gwin32inputstream
7735 * @short_description: Streaming input operations for Windows file handles
7736 * @include: gio/gwin32inputstream.h
7737 * @see_also: #GInputStream
7739 * #GWin32InputStream implements #GInputStream for reading from a
7740 * Windows file handle.
7742 * Note that <filename><gio/gwin32inputstream.h></filename> belongs
7743 * to the Windows-specific GIO interfaces, thus you have to use the
7744 * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7749 * SECTION:gwin32outputstream
7750 * @short_description: Streaming output operations for Windows file handles
7751 * @include: gio/gwin32outputstream.h
7752 * @see_also: #GOutputStream
7754 * #GWin32OutputStream implements #GOutputStream for writing to a
7755 * Windows file handle.
7757 * Note that <filename><gio/gwin32outputstream.h></filename> belongs
7758 * to the Windows-specific GIO interfaces, thus you have to use the
7759 * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7764 * SECTION:gzcompressor
7765 * @short_description: Zlib compressor
7766 * @include: gio/gio.h
7768 * #GZlibCompressor is an implementation of #GConverter that
7769 * compresses data using zlib.
7774 * SECTION:gzdecompressor
7775 * @short_description: Zlib decompressor
7776 * @include: gio/gio.h
7778 * #GZlibDecompressor is an implementation of #GConverter that
7779 * decompresses data compressed with zlib.
7784 * _GFreedesktopDBus:
7786 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
7791 * _GFreedesktopDBus::handle-add-match:
7792 * @object: A #_GFreedesktopDBus.
7793 * @invocation: A #GDBusMethodInvocation.
7794 * @arg_rule: Argument passed by remote caller.
7796 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method.
7798 * 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.
7800 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7805 * _GFreedesktopDBus::handle-get-connection-selinux-security-context:
7806 * @object: A #_GFreedesktopDBus.
7807 * @invocation: A #GDBusMethodInvocation.
7808 * @arg_name: Argument passed by remote caller.
7810 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method.
7812 * 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.
7814 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7819 * _GFreedesktopDBus::handle-get-connection-unix-process-id:
7820 * @object: A #_GFreedesktopDBus.
7821 * @invocation: A #GDBusMethodInvocation.
7822 * @arg_name: Argument passed by remote caller.
7824 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method.
7826 * 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.
7828 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7833 * _GFreedesktopDBus::handle-get-connection-unix-user:
7834 * @object: A #_GFreedesktopDBus.
7835 * @invocation: A #GDBusMethodInvocation.
7836 * @arg_name: Argument passed by remote caller.
7838 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method.
7840 * 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.
7842 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7847 * _GFreedesktopDBus::handle-get-id:
7848 * @object: A #_GFreedesktopDBus.
7849 * @invocation: A #GDBusMethodInvocation.
7851 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method.
7853 * 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.
7855 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7860 * _GFreedesktopDBus::handle-get-name-owner:
7861 * @object: A #_GFreedesktopDBus.
7862 * @invocation: A #GDBusMethodInvocation.
7863 * @arg_name: Argument passed by remote caller.
7865 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method.
7867 * 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.
7869 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7874 * _GFreedesktopDBus::handle-hello:
7875 * @object: A #_GFreedesktopDBus.
7876 * @invocation: A #GDBusMethodInvocation.
7878 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method.
7880 * 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.
7882 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7887 * _GFreedesktopDBus::handle-list-activatable-names:
7888 * @object: A #_GFreedesktopDBus.
7889 * @invocation: A #GDBusMethodInvocation.
7891 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method.
7893 * 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.
7895 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7900 * _GFreedesktopDBus::handle-list-names:
7901 * @object: A #_GFreedesktopDBus.
7902 * @invocation: A #GDBusMethodInvocation.
7904 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method.
7906 * 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.
7908 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7913 * _GFreedesktopDBus::handle-list-queued-owners:
7914 * @object: A #_GFreedesktopDBus.
7915 * @invocation: A #GDBusMethodInvocation.
7916 * @arg_name: Argument passed by remote caller.
7918 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method.
7920 * 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.
7922 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7927 * _GFreedesktopDBus::handle-name-has-owner:
7928 * @object: A #_GFreedesktopDBus.
7929 * @invocation: A #GDBusMethodInvocation.
7930 * @arg_name: Argument passed by remote caller.
7932 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method.
7934 * 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.
7936 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7941 * _GFreedesktopDBus::handle-release-name:
7942 * @object: A #_GFreedesktopDBus.
7943 * @invocation: A #GDBusMethodInvocation.
7944 * @arg_name: Argument passed by remote caller.
7946 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method.
7948 * 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.
7950 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7955 * _GFreedesktopDBus::handle-reload-config:
7956 * @object: A #_GFreedesktopDBus.
7957 * @invocation: A #GDBusMethodInvocation.
7959 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method.
7961 * 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.
7963 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7968 * _GFreedesktopDBus::handle-remove-match:
7969 * @object: A #_GFreedesktopDBus.
7970 * @invocation: A #GDBusMethodInvocation.
7971 * @arg_rule: Argument passed by remote caller.
7973 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method.
7975 * 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.
7977 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7982 * _GFreedesktopDBus::handle-request-name:
7983 * @object: A #_GFreedesktopDBus.
7984 * @invocation: A #GDBusMethodInvocation.
7985 * @arg_name: Argument passed by remote caller.
7986 * @arg_flags: Argument passed by remote caller.
7988 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method.
7990 * 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.
7992 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7997 * _GFreedesktopDBus::handle-start-service-by-name:
7998 * @object: A #_GFreedesktopDBus.
7999 * @invocation: A #GDBusMethodInvocation.
8000 * @arg_name: Argument passed by remote caller.
8001 * @arg_flags: Argument passed by remote caller.
8003 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method.
8005 * 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.
8007 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
8012 * _GFreedesktopDBus::handle-update-activation-environment:
8013 * @object: A #_GFreedesktopDBus.
8014 * @invocation: A #GDBusMethodInvocation.
8015 * @arg_environment: Argument passed by remote caller.
8017 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method.
8019 * 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.
8021 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
8026 * _GFreedesktopDBus::name-acquired:
8027 * @object: A #_GFreedesktopDBus.
8028 * @arg_name: Argument.
8030 * 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.
8032 * 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.
8037 * _GFreedesktopDBus::name-lost:
8038 * @object: A #_GFreedesktopDBus.
8039 * @arg_name: Argument.
8041 * 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.
8043 * 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.
8048 * _GFreedesktopDBus::name-owner-changed:
8049 * @object: A #_GFreedesktopDBus.
8050 * @arg_name: Argument.
8051 * @arg_old_owner: Argument.
8052 * @arg_new_owner: Argument.
8054 * 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.
8056 * 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.
8061 * _GFreedesktopDBusIface:
8062 * @parent_iface: The parent interface.
8063 * @handle_add_match: Handler for the #_GFreedesktopDBus::handle-add-match signal.
8064 * @handle_get_connection_selinux_security_context: Handler for the #_GFreedesktopDBus::handle-get-connection-selinux-security-context signal.
8065 * @handle_get_connection_unix_process_id: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-process-id signal.
8066 * @handle_get_connection_unix_user: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-user signal.
8067 * @handle_get_id: Handler for the #_GFreedesktopDBus::handle-get-id signal.
8068 * @handle_get_name_owner: Handler for the #_GFreedesktopDBus::handle-get-name-owner signal.
8069 * @handle_hello: Handler for the #_GFreedesktopDBus::handle-hello signal.
8070 * @handle_list_activatable_names: Handler for the #_GFreedesktopDBus::handle-list-activatable-names signal.
8071 * @handle_list_names: Handler for the #_GFreedesktopDBus::handle-list-names signal.
8072 * @handle_list_queued_owners: Handler for the #_GFreedesktopDBus::handle-list-queued-owners signal.
8073 * @handle_name_has_owner: Handler for the #_GFreedesktopDBus::handle-name-has-owner signal.
8074 * @handle_release_name: Handler for the #_GFreedesktopDBus::handle-release-name signal.
8075 * @handle_reload_config: Handler for the #_GFreedesktopDBus::handle-reload-config signal.
8076 * @handle_remove_match: Handler for the #_GFreedesktopDBus::handle-remove-match signal.
8077 * @handle_request_name: Handler for the #_GFreedesktopDBus::handle-request-name signal.
8078 * @handle_start_service_by_name: Handler for the #_GFreedesktopDBus::handle-start-service-by-name signal.
8079 * @handle_update_activation_environment: Handler for the #_GFreedesktopDBus::handle-update-activation-environment signal.
8080 * @name_acquired: Handler for the #_GFreedesktopDBus::name-acquired signal.
8081 * @name_lost: Handler for the #_GFreedesktopDBus::name-lost signal.
8082 * @name_owner_changed: Handler for the #_GFreedesktopDBus::name-owner-changed signal.
8084 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
8089 * _GFreedesktopDBusProxy:
8091 * The #_GFreedesktopDBusProxy structure contains only private data and should only be accessed using the provided API.
8096 * _GFreedesktopDBusProxyClass:
8097 * @parent_class: The parent class.
8099 * Class structure for #_GFreedesktopDBusProxy.
8104 * _GFreedesktopDBusSkeleton:
8106 * The #_GFreedesktopDBusSkeleton structure contains only private data and should only be accessed using the provided API.
8111 * _GFreedesktopDBusSkeletonClass:
8112 * @parent_class: The parent class.
8114 * Class structure for #_GFreedesktopDBusSkeleton.
8119 * _g_freedesktop_dbus_call_add_match:
8120 * @proxy: A #_GFreedesktopDBusProxy.
8121 * @arg_rule: Argument to pass with the method invocation.
8122 * @cancellable: (allow-none): A #GCancellable or %NULL.
8123 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8124 * @user_data: User data to pass to @callback.
8126 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method on @proxy.
8127 * 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.
8128 * You can then call _g_freedesktop_dbus_call_add_match_finish() to get the result of the operation.
8130 * See _g_freedesktop_dbus_call_add_match_sync() for the synchronous, blocking version of this method.
8135 * _g_freedesktop_dbus_call_add_match_finish:
8136 * @proxy: A #_GFreedesktopDBusProxy.
8137 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_add_match().
8138 * @error: Return location for error or %NULL.
8140 * Finishes an operation started with _g_freedesktop_dbus_call_add_match().
8142 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8147 * _g_freedesktop_dbus_call_add_match_sync:
8148 * @proxy: A #_GFreedesktopDBusProxy.
8149 * @arg_rule: Argument to pass with the method invocation.
8150 * @cancellable: (allow-none): A #GCancellable or %NULL.
8151 * @error: Return location for error or %NULL.
8153 * 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.
8155 * See _g_freedesktop_dbus_call_add_match() for the asynchronous version of this method.
8157 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8162 * _g_freedesktop_dbus_call_get_connection_selinux_security_context:
8163 * @proxy: A #_GFreedesktopDBusProxy.
8164 * @arg_name: Argument to pass with the method invocation.
8165 * @cancellable: (allow-none): A #GCancellable or %NULL.
8166 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8167 * @user_data: User data to pass to @callback.
8169 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method on @proxy.
8170 * 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.
8171 * You can then call _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish() to get the result of the operation.
8173 * See _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync() for the synchronous, blocking version of this method.
8178 * _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish:
8179 * @proxy: A #_GFreedesktopDBusProxy.
8180 * @out_security_context: (out): Return location for return parameter or %NULL to ignore.
8181 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_selinux_security_context().
8182 * @error: Return location for error or %NULL.
8184 * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_selinux_security_context().
8186 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8191 * _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync:
8192 * @proxy: A #_GFreedesktopDBusProxy.
8193 * @arg_name: Argument to pass with the method invocation.
8194 * @out_security_context: (out): Return location for return parameter or %NULL to ignore.
8195 * @cancellable: (allow-none): A #GCancellable or %NULL.
8196 * @error: Return location for error or %NULL.
8198 * 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.
8200 * See _g_freedesktop_dbus_call_get_connection_selinux_security_context() for the asynchronous version of this method.
8202 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8207 * _g_freedesktop_dbus_call_get_connection_unix_process_id:
8208 * @proxy: A #_GFreedesktopDBusProxy.
8209 * @arg_name: Argument to pass with the method invocation.
8210 * @cancellable: (allow-none): A #GCancellable or %NULL.
8211 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8212 * @user_data: User data to pass to @callback.
8214 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method on @proxy.
8215 * 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.
8216 * You can then call _g_freedesktop_dbus_call_get_connection_unix_process_id_finish() to get the result of the operation.
8218 * See _g_freedesktop_dbus_call_get_connection_unix_process_id_sync() for the synchronous, blocking version of this method.
8223 * _g_freedesktop_dbus_call_get_connection_unix_process_id_finish:
8224 * @proxy: A #_GFreedesktopDBusProxy.
8225 * @out_pid: (out): Return location for return parameter or %NULL to ignore.
8226 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_process_id().
8227 * @error: Return location for error or %NULL.
8229 * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_process_id().
8231 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8236 * _g_freedesktop_dbus_call_get_connection_unix_process_id_sync:
8237 * @proxy: A #_GFreedesktopDBusProxy.
8238 * @arg_name: Argument to pass with the method invocation.
8239 * @out_pid: (out): Return location for return parameter or %NULL to ignore.
8240 * @cancellable: (allow-none): A #GCancellable or %NULL.
8241 * @error: Return location for error or %NULL.
8243 * 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.
8245 * See _g_freedesktop_dbus_call_get_connection_unix_process_id() for the asynchronous version of this method.
8247 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8252 * _g_freedesktop_dbus_call_get_connection_unix_user:
8253 * @proxy: A #_GFreedesktopDBusProxy.
8254 * @arg_name: Argument to pass with the method invocation.
8255 * @cancellable: (allow-none): A #GCancellable or %NULL.
8256 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8257 * @user_data: User data to pass to @callback.
8259 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method on @proxy.
8260 * 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.
8261 * You can then call _g_freedesktop_dbus_call_get_connection_unix_user_finish() to get the result of the operation.
8263 * See _g_freedesktop_dbus_call_get_connection_unix_user_sync() for the synchronous, blocking version of this method.
8268 * _g_freedesktop_dbus_call_get_connection_unix_user_finish:
8269 * @proxy: A #_GFreedesktopDBusProxy.
8270 * @out_uid: (out): Return location for return parameter or %NULL to ignore.
8271 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_user().
8272 * @error: Return location for error or %NULL.
8274 * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_user().
8276 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8281 * _g_freedesktop_dbus_call_get_connection_unix_user_sync:
8282 * @proxy: A #_GFreedesktopDBusProxy.
8283 * @arg_name: Argument to pass with the method invocation.
8284 * @out_uid: (out): Return location for return parameter or %NULL to ignore.
8285 * @cancellable: (allow-none): A #GCancellable or %NULL.
8286 * @error: Return location for error or %NULL.
8288 * 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.
8290 * See _g_freedesktop_dbus_call_get_connection_unix_user() for the asynchronous version of this method.
8292 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8297 * _g_freedesktop_dbus_call_get_id:
8298 * @proxy: A #_GFreedesktopDBusProxy.
8299 * @cancellable: (allow-none): A #GCancellable or %NULL.
8300 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8301 * @user_data: User data to pass to @callback.
8303 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method on @proxy.
8304 * 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.
8305 * You can then call _g_freedesktop_dbus_call_get_id_finish() to get the result of the operation.
8307 * See _g_freedesktop_dbus_call_get_id_sync() for the synchronous, blocking version of this method.
8312 * _g_freedesktop_dbus_call_get_id_finish:
8313 * @proxy: A #_GFreedesktopDBusProxy.
8314 * @out_unique_id: (out): Return location for return parameter or %NULL to ignore.
8315 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_id().
8316 * @error: Return location for error or %NULL.
8318 * Finishes an operation started with _g_freedesktop_dbus_call_get_id().
8320 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8325 * _g_freedesktop_dbus_call_get_id_sync:
8326 * @proxy: A #_GFreedesktopDBusProxy.
8327 * @out_unique_id: (out): Return location for return parameter or %NULL to ignore.
8328 * @cancellable: (allow-none): A #GCancellable or %NULL.
8329 * @error: Return location for error or %NULL.
8331 * 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.
8333 * See _g_freedesktop_dbus_call_get_id() for the asynchronous version of this method.
8335 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8340 * _g_freedesktop_dbus_call_get_name_owner:
8341 * @proxy: A #_GFreedesktopDBusProxy.
8342 * @arg_name: Argument to pass with the method invocation.
8343 * @cancellable: (allow-none): A #GCancellable or %NULL.
8344 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8345 * @user_data: User data to pass to @callback.
8347 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method on @proxy.
8348 * 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.
8349 * You can then call _g_freedesktop_dbus_call_get_name_owner_finish() to get the result of the operation.
8351 * See _g_freedesktop_dbus_call_get_name_owner_sync() for the synchronous, blocking version of this method.
8356 * _g_freedesktop_dbus_call_get_name_owner_finish:
8357 * @proxy: A #_GFreedesktopDBusProxy.
8358 * @out_unique_name: (out): Return location for return parameter or %NULL to ignore.
8359 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_name_owner().
8360 * @error: Return location for error or %NULL.
8362 * Finishes an operation started with _g_freedesktop_dbus_call_get_name_owner().
8364 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8369 * _g_freedesktop_dbus_call_get_name_owner_sync:
8370 * @proxy: A #_GFreedesktopDBusProxy.
8371 * @arg_name: Argument to pass with the method invocation.
8372 * @out_unique_name: (out): Return location for return parameter or %NULL to ignore.
8373 * @cancellable: (allow-none): A #GCancellable or %NULL.
8374 * @error: Return location for error or %NULL.
8376 * 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.
8378 * See _g_freedesktop_dbus_call_get_name_owner() for the asynchronous version of this method.
8380 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8385 * _g_freedesktop_dbus_call_hello:
8386 * @proxy: A #_GFreedesktopDBusProxy.
8387 * @cancellable: (allow-none): A #GCancellable or %NULL.
8388 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8389 * @user_data: User data to pass to @callback.
8391 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method on @proxy.
8392 * 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.
8393 * You can then call _g_freedesktop_dbus_call_hello_finish() to get the result of the operation.
8395 * See _g_freedesktop_dbus_call_hello_sync() for the synchronous, blocking version of this method.
8400 * _g_freedesktop_dbus_call_hello_finish:
8401 * @proxy: A #_GFreedesktopDBusProxy.
8402 * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore.
8403 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_hello().
8404 * @error: Return location for error or %NULL.
8406 * Finishes an operation started with _g_freedesktop_dbus_call_hello().
8408 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8413 * _g_freedesktop_dbus_call_hello_sync:
8414 * @proxy: A #_GFreedesktopDBusProxy.
8415 * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore.
8416 * @cancellable: (allow-none): A #GCancellable or %NULL.
8417 * @error: Return location for error or %NULL.
8419 * 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.
8421 * See _g_freedesktop_dbus_call_hello() for the asynchronous version of this method.
8423 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8428 * _g_freedesktop_dbus_call_list_activatable_names:
8429 * @proxy: A #_GFreedesktopDBusProxy.
8430 * @cancellable: (allow-none): A #GCancellable or %NULL.
8431 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8432 * @user_data: User data to pass to @callback.
8434 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method on @proxy.
8435 * 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.
8436 * You can then call _g_freedesktop_dbus_call_list_activatable_names_finish() to get the result of the operation.
8438 * See _g_freedesktop_dbus_call_list_activatable_names_sync() for the synchronous, blocking version of this method.
8443 * _g_freedesktop_dbus_call_list_activatable_names_finish:
8444 * @proxy: A #_GFreedesktopDBusProxy.
8445 * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore.
8446 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_activatable_names().
8447 * @error: Return location for error or %NULL.
8449 * Finishes an operation started with _g_freedesktop_dbus_call_list_activatable_names().
8451 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8456 * _g_freedesktop_dbus_call_list_activatable_names_sync:
8457 * @proxy: A #_GFreedesktopDBusProxy.
8458 * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore.
8459 * @cancellable: (allow-none): A #GCancellable or %NULL.
8460 * @error: Return location for error or %NULL.
8462 * 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.
8464 * See _g_freedesktop_dbus_call_list_activatable_names() for the asynchronous version of this method.
8466 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8471 * _g_freedesktop_dbus_call_list_names:
8472 * @proxy: A #_GFreedesktopDBusProxy.
8473 * @cancellable: (allow-none): A #GCancellable or %NULL.
8474 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8475 * @user_data: User data to pass to @callback.
8477 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method on @proxy.
8478 * 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.
8479 * You can then call _g_freedesktop_dbus_call_list_names_finish() to get the result of the operation.
8481 * See _g_freedesktop_dbus_call_list_names_sync() for the synchronous, blocking version of this method.
8486 * _g_freedesktop_dbus_call_list_names_finish:
8487 * @proxy: A #_GFreedesktopDBusProxy.
8488 * @out_names: (out): Return location for return parameter or %NULL to ignore.
8489 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_names().
8490 * @error: Return location for error or %NULL.
8492 * Finishes an operation started with _g_freedesktop_dbus_call_list_names().
8494 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8499 * _g_freedesktop_dbus_call_list_names_sync:
8500 * @proxy: A #_GFreedesktopDBusProxy.
8501 * @out_names: (out): Return location for return parameter or %NULL to ignore.
8502 * @cancellable: (allow-none): A #GCancellable or %NULL.
8503 * @error: Return location for error or %NULL.
8505 * 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.
8507 * See _g_freedesktop_dbus_call_list_names() for the asynchronous version of this method.
8509 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8514 * _g_freedesktop_dbus_call_list_queued_owners:
8515 * @proxy: A #_GFreedesktopDBusProxy.
8516 * @arg_name: Argument to pass with the method invocation.
8517 * @cancellable: (allow-none): A #GCancellable or %NULL.
8518 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8519 * @user_data: User data to pass to @callback.
8521 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method on @proxy.
8522 * 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.
8523 * You can then call _g_freedesktop_dbus_call_list_queued_owners_finish() to get the result of the operation.
8525 * See _g_freedesktop_dbus_call_list_queued_owners_sync() for the synchronous, blocking version of this method.
8530 * _g_freedesktop_dbus_call_list_queued_owners_finish:
8531 * @proxy: A #_GFreedesktopDBusProxy.
8532 * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore.
8533 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_queued_owners().
8534 * @error: Return location for error or %NULL.
8536 * Finishes an operation started with _g_freedesktop_dbus_call_list_queued_owners().
8538 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8543 * _g_freedesktop_dbus_call_list_queued_owners_sync:
8544 * @proxy: A #_GFreedesktopDBusProxy.
8545 * @arg_name: Argument to pass with the method invocation.
8546 * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore.
8547 * @cancellable: (allow-none): A #GCancellable or %NULL.
8548 * @error: Return location for error or %NULL.
8550 * 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.
8552 * See _g_freedesktop_dbus_call_list_queued_owners() for the asynchronous version of this method.
8554 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8559 * _g_freedesktop_dbus_call_name_has_owner:
8560 * @proxy: A #_GFreedesktopDBusProxy.
8561 * @arg_name: Argument to pass with the method invocation.
8562 * @cancellable: (allow-none): A #GCancellable or %NULL.
8563 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8564 * @user_data: User data to pass to @callback.
8566 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method on @proxy.
8567 * 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.
8568 * You can then call _g_freedesktop_dbus_call_name_has_owner_finish() to get the result of the operation.
8570 * See _g_freedesktop_dbus_call_name_has_owner_sync() for the synchronous, blocking version of this method.
8575 * _g_freedesktop_dbus_call_name_has_owner_finish:
8576 * @proxy: A #_GFreedesktopDBusProxy.
8577 * @out_has_owner: (out): Return location for return parameter or %NULL to ignore.
8578 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_name_has_owner().
8579 * @error: Return location for error or %NULL.
8581 * Finishes an operation started with _g_freedesktop_dbus_call_name_has_owner().
8583 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8588 * _g_freedesktop_dbus_call_name_has_owner_sync:
8589 * @proxy: A #_GFreedesktopDBusProxy.
8590 * @arg_name: Argument to pass with the method invocation.
8591 * @out_has_owner: (out): Return location for return parameter or %NULL to ignore.
8592 * @cancellable: (allow-none): A #GCancellable or %NULL.
8593 * @error: Return location for error or %NULL.
8595 * 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.
8597 * See _g_freedesktop_dbus_call_name_has_owner() for the asynchronous version of this method.
8599 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8604 * _g_freedesktop_dbus_call_release_name:
8605 * @proxy: A #_GFreedesktopDBusProxy.
8606 * @arg_name: Argument to pass with the method invocation.
8607 * @cancellable: (allow-none): A #GCancellable or %NULL.
8608 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8609 * @user_data: User data to pass to @callback.
8611 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method on @proxy.
8612 * 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.
8613 * You can then call _g_freedesktop_dbus_call_release_name_finish() to get the result of the operation.
8615 * See _g_freedesktop_dbus_call_release_name_sync() for the synchronous, blocking version of this method.
8620 * _g_freedesktop_dbus_call_release_name_finish:
8621 * @proxy: A #_GFreedesktopDBusProxy.
8622 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8623 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_release_name().
8624 * @error: Return location for error or %NULL.
8626 * Finishes an operation started with _g_freedesktop_dbus_call_release_name().
8628 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8633 * _g_freedesktop_dbus_call_release_name_sync:
8634 * @proxy: A #_GFreedesktopDBusProxy.
8635 * @arg_name: Argument to pass with the method invocation.
8636 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8637 * @cancellable: (allow-none): A #GCancellable or %NULL.
8638 * @error: Return location for error or %NULL.
8640 * 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.
8642 * See _g_freedesktop_dbus_call_release_name() for the asynchronous version of this method.
8644 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8649 * _g_freedesktop_dbus_call_reload_config:
8650 * @proxy: A #_GFreedesktopDBusProxy.
8651 * @cancellable: (allow-none): A #GCancellable or %NULL.
8652 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8653 * @user_data: User data to pass to @callback.
8655 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method on @proxy.
8656 * 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.
8657 * You can then call _g_freedesktop_dbus_call_reload_config_finish() to get the result of the operation.
8659 * See _g_freedesktop_dbus_call_reload_config_sync() for the synchronous, blocking version of this method.
8664 * _g_freedesktop_dbus_call_reload_config_finish:
8665 * @proxy: A #_GFreedesktopDBusProxy.
8666 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_reload_config().
8667 * @error: Return location for error or %NULL.
8669 * Finishes an operation started with _g_freedesktop_dbus_call_reload_config().
8671 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8676 * _g_freedesktop_dbus_call_reload_config_sync:
8677 * @proxy: A #_GFreedesktopDBusProxy.
8678 * @cancellable: (allow-none): A #GCancellable or %NULL.
8679 * @error: Return location for error or %NULL.
8681 * 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.
8683 * See _g_freedesktop_dbus_call_reload_config() for the asynchronous version of this method.
8685 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8690 * _g_freedesktop_dbus_call_remove_match:
8691 * @proxy: A #_GFreedesktopDBusProxy.
8692 * @arg_rule: Argument to pass with the method invocation.
8693 * @cancellable: (allow-none): A #GCancellable or %NULL.
8694 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8695 * @user_data: User data to pass to @callback.
8697 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method on @proxy.
8698 * 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.
8699 * You can then call _g_freedesktop_dbus_call_remove_match_finish() to get the result of the operation.
8701 * See _g_freedesktop_dbus_call_remove_match_sync() for the synchronous, blocking version of this method.
8706 * _g_freedesktop_dbus_call_remove_match_finish:
8707 * @proxy: A #_GFreedesktopDBusProxy.
8708 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_remove_match().
8709 * @error: Return location for error or %NULL.
8711 * Finishes an operation started with _g_freedesktop_dbus_call_remove_match().
8713 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8718 * _g_freedesktop_dbus_call_remove_match_sync:
8719 * @proxy: A #_GFreedesktopDBusProxy.
8720 * @arg_rule: Argument to pass with the method invocation.
8721 * @cancellable: (allow-none): A #GCancellable or %NULL.
8722 * @error: Return location for error or %NULL.
8724 * 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.
8726 * See _g_freedesktop_dbus_call_remove_match() for the asynchronous version of this method.
8728 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8733 * _g_freedesktop_dbus_call_request_name:
8734 * @proxy: A #_GFreedesktopDBusProxy.
8735 * @arg_name: Argument to pass with the method invocation.
8736 * @arg_flags: Argument to pass with the method invocation.
8737 * @cancellable: (allow-none): A #GCancellable or %NULL.
8738 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8739 * @user_data: User data to pass to @callback.
8741 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method on @proxy.
8742 * 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.
8743 * You can then call _g_freedesktop_dbus_call_request_name_finish() to get the result of the operation.
8745 * See _g_freedesktop_dbus_call_request_name_sync() for the synchronous, blocking version of this method.
8750 * _g_freedesktop_dbus_call_request_name_finish:
8751 * @proxy: A #_GFreedesktopDBusProxy.
8752 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8753 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_request_name().
8754 * @error: Return location for error or %NULL.
8756 * Finishes an operation started with _g_freedesktop_dbus_call_request_name().
8758 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8763 * _g_freedesktop_dbus_call_request_name_sync:
8764 * @proxy: A #_GFreedesktopDBusProxy.
8765 * @arg_name: Argument to pass with the method invocation.
8766 * @arg_flags: Argument to pass with the method invocation.
8767 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8768 * @cancellable: (allow-none): A #GCancellable or %NULL.
8769 * @error: Return location for error or %NULL.
8771 * 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.
8773 * See _g_freedesktop_dbus_call_request_name() for the asynchronous version of this method.
8775 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8780 * _g_freedesktop_dbus_call_start_service_by_name:
8781 * @proxy: A #_GFreedesktopDBusProxy.
8782 * @arg_name: Argument to pass with the method invocation.
8783 * @arg_flags: Argument to pass with the method invocation.
8784 * @cancellable: (allow-none): A #GCancellable or %NULL.
8785 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8786 * @user_data: User data to pass to @callback.
8788 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method on @proxy.
8789 * 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.
8790 * You can then call _g_freedesktop_dbus_call_start_service_by_name_finish() to get the result of the operation.
8792 * See _g_freedesktop_dbus_call_start_service_by_name_sync() for the synchronous, blocking version of this method.
8797 * _g_freedesktop_dbus_call_start_service_by_name_finish:
8798 * @proxy: A #_GFreedesktopDBusProxy.
8799 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8800 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_start_service_by_name().
8801 * @error: Return location for error or %NULL.
8803 * Finishes an operation started with _g_freedesktop_dbus_call_start_service_by_name().
8805 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8810 * _g_freedesktop_dbus_call_start_service_by_name_sync:
8811 * @proxy: A #_GFreedesktopDBusProxy.
8812 * @arg_name: Argument to pass with the method invocation.
8813 * @arg_flags: Argument to pass with the method invocation.
8814 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8815 * @cancellable: (allow-none): A #GCancellable or %NULL.
8816 * @error: Return location for error or %NULL.
8818 * 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.
8820 * See _g_freedesktop_dbus_call_start_service_by_name() for the asynchronous version of this method.
8822 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8827 * _g_freedesktop_dbus_call_update_activation_environment:
8828 * @proxy: A #_GFreedesktopDBusProxy.
8829 * @arg_environment: Argument to pass with the method invocation.
8830 * @cancellable: (allow-none): A #GCancellable or %NULL.
8831 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8832 * @user_data: User data to pass to @callback.
8834 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method on @proxy.
8835 * 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.
8836 * You can then call _g_freedesktop_dbus_call_update_activation_environment_finish() to get the result of the operation.
8838 * See _g_freedesktop_dbus_call_update_activation_environment_sync() for the synchronous, blocking version of this method.
8843 * _g_freedesktop_dbus_call_update_activation_environment_finish:
8844 * @proxy: A #_GFreedesktopDBusProxy.
8845 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_update_activation_environment().
8846 * @error: Return location for error or %NULL.
8848 * Finishes an operation started with _g_freedesktop_dbus_call_update_activation_environment().
8850 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8855 * _g_freedesktop_dbus_call_update_activation_environment_sync:
8856 * @proxy: A #_GFreedesktopDBusProxy.
8857 * @arg_environment: Argument to pass with the method invocation.
8858 * @cancellable: (allow-none): A #GCancellable or %NULL.
8859 * @error: Return location for error or %NULL.
8861 * 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.
8863 * See _g_freedesktop_dbus_call_update_activation_environment() for the asynchronous version of this method.
8865 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8870 * _g_freedesktop_dbus_complete_add_match:
8871 * @object: A #_GFreedesktopDBus.
8872 * @invocation: (transfer full): A #GDBusMethodInvocation.
8874 * 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.
8876 * This method will free @invocation, you cannot use it afterwards.
8881 * _g_freedesktop_dbus_complete_get_connection_selinux_security_context:
8882 * @object: A #_GFreedesktopDBus.
8883 * @invocation: (transfer full): A #GDBusMethodInvocation.
8884 * @security_context: Parameter to return.
8886 * 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.
8888 * This method will free @invocation, you cannot use it afterwards.
8893 * _g_freedesktop_dbus_complete_get_connection_unix_process_id:
8894 * @object: A #_GFreedesktopDBus.
8895 * @invocation: (transfer full): A #GDBusMethodInvocation.
8896 * @pid: Parameter to return.
8898 * 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.
8900 * This method will free @invocation, you cannot use it afterwards.
8905 * _g_freedesktop_dbus_complete_get_connection_unix_user:
8906 * @object: A #_GFreedesktopDBus.
8907 * @invocation: (transfer full): A #GDBusMethodInvocation.
8908 * @uid: Parameter to return.
8910 * 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.
8912 * This method will free @invocation, you cannot use it afterwards.
8917 * _g_freedesktop_dbus_complete_get_id:
8918 * @object: A #_GFreedesktopDBus.
8919 * @invocation: (transfer full): A #GDBusMethodInvocation.
8920 * @unique_id: Parameter to return.
8922 * 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.
8924 * This method will free @invocation, you cannot use it afterwards.
8929 * _g_freedesktop_dbus_complete_get_name_owner:
8930 * @object: A #_GFreedesktopDBus.
8931 * @invocation: (transfer full): A #GDBusMethodInvocation.
8932 * @unique_name: Parameter to return.
8934 * 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.
8936 * This method will free @invocation, you cannot use it afterwards.
8941 * _g_freedesktop_dbus_complete_hello:
8942 * @object: A #_GFreedesktopDBus.
8943 * @invocation: (transfer full): A #GDBusMethodInvocation.
8944 * @assigned_name: Parameter to return.
8946 * 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.
8948 * This method will free @invocation, you cannot use it afterwards.
8953 * _g_freedesktop_dbus_complete_list_activatable_names:
8954 * @object: A #_GFreedesktopDBus.
8955 * @invocation: (transfer full): A #GDBusMethodInvocation.
8956 * @activatable_names: Parameter to return.
8958 * 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.
8960 * This method will free @invocation, you cannot use it afterwards.
8965 * _g_freedesktop_dbus_complete_list_names:
8966 * @object: A #_GFreedesktopDBus.
8967 * @invocation: (transfer full): A #GDBusMethodInvocation.
8968 * @names: Parameter to return.
8970 * 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.
8972 * This method will free @invocation, you cannot use it afterwards.
8977 * _g_freedesktop_dbus_complete_list_queued_owners:
8978 * @object: A #_GFreedesktopDBus.
8979 * @invocation: (transfer full): A #GDBusMethodInvocation.
8980 * @queued_owners: Parameter to return.
8982 * 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.
8984 * This method will free @invocation, you cannot use it afterwards.
8989 * _g_freedesktop_dbus_complete_name_has_owner:
8990 * @object: A #_GFreedesktopDBus.
8991 * @invocation: (transfer full): A #GDBusMethodInvocation.
8992 * @has_owner: Parameter to return.
8994 * 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.
8996 * This method will free @invocation, you cannot use it afterwards.
9001 * _g_freedesktop_dbus_complete_release_name:
9002 * @object: A #_GFreedesktopDBus.
9003 * @invocation: (transfer full): A #GDBusMethodInvocation.
9004 * @value: Parameter to return.
9006 * 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.
9008 * This method will free @invocation, you cannot use it afterwards.
9013 * _g_freedesktop_dbus_complete_reload_config:
9014 * @object: A #_GFreedesktopDBus.
9015 * @invocation: (transfer full): A #GDBusMethodInvocation.
9017 * 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.
9019 * This method will free @invocation, you cannot use it afterwards.
9024 * _g_freedesktop_dbus_complete_remove_match:
9025 * @object: A #_GFreedesktopDBus.
9026 * @invocation: (transfer full): A #GDBusMethodInvocation.
9028 * 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.
9030 * This method will free @invocation, you cannot use it afterwards.
9035 * _g_freedesktop_dbus_complete_request_name:
9036 * @object: A #_GFreedesktopDBus.
9037 * @invocation: (transfer full): A #GDBusMethodInvocation.
9038 * @value: Parameter to return.
9040 * 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.
9042 * This method will free @invocation, you cannot use it afterwards.
9047 * _g_freedesktop_dbus_complete_start_service_by_name:
9048 * @object: A #_GFreedesktopDBus.
9049 * @invocation: (transfer full): A #GDBusMethodInvocation.
9050 * @value: Parameter to return.
9052 * 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.
9054 * This method will free @invocation, you cannot use it afterwards.
9059 * _g_freedesktop_dbus_complete_update_activation_environment:
9060 * @object: A #_GFreedesktopDBus.
9061 * @invocation: (transfer full): A #GDBusMethodInvocation.
9063 * 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.
9065 * This method will free @invocation, you cannot use it afterwards.
9070 * _g_freedesktop_dbus_emit_name_acquired:
9071 * @object: A #_GFreedesktopDBus.
9072 * @arg_name: Argument to pass with the signal.
9074 * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameAcquired">"NameAcquired"</link> D-Bus signal.
9079 * _g_freedesktop_dbus_emit_name_lost:
9080 * @object: A #_GFreedesktopDBus.
9081 * @arg_name: Argument to pass with the signal.
9083 * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameLost">"NameLost"</link> D-Bus signal.
9088 * _g_freedesktop_dbus_emit_name_owner_changed:
9089 * @object: A #_GFreedesktopDBus.
9090 * @arg_name: Argument to pass with the signal.
9091 * @arg_old_owner: Argument to pass with the signal.
9092 * @arg_new_owner: Argument to pass with the signal.
9094 * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameOwnerChanged">"NameOwnerChanged"</link> D-Bus signal.
9099 * _g_freedesktop_dbus_interface_info:
9101 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link> D-Bus interface.
9103 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
9108 * _g_freedesktop_dbus_override_properties:
9109 * @klass: The class structure for a #GObject<!-- -->-derived class.
9110 * @property_id_begin: The property id to assign to the first overridden property.
9112 * Overrides all #GObject properties in the #_GFreedesktopDBus interface for a concrete class.
9113 * The properties are overridden in the order they are defined.
9115 * Returns: The last property id.
9120 * _g_freedesktop_dbus_proxy_new:
9121 * @connection: A #GDBusConnection.
9122 * @flags: Flags from the #GDBusProxyFlags enumeration.
9123 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
9124 * @object_path: An object path.
9125 * @cancellable: (allow-none): A #GCancellable or %NULL.
9126 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
9127 * @user_data: User data to pass to @callback.
9129 * 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.
9131 * 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.
9132 * You can then call _g_freedesktop_dbus_proxy_new_finish() to get the result of the operation.
9134 * See _g_freedesktop_dbus_proxy_new_sync() for the synchronous, blocking version of this constructor.
9139 * _g_freedesktop_dbus_proxy_new_finish:
9140 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new().
9141 * @error: Return location for error or %NULL
9143 * Finishes an operation started with _g_freedesktop_dbus_proxy_new().
9145 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
9150 * _g_freedesktop_dbus_proxy_new_for_bus:
9151 * @bus_type: A #GBusType.
9152 * @flags: Flags from the #GDBusProxyFlags enumeration.
9153 * @name: A bus name (well-known or unique).
9154 * @object_path: An object path.
9155 * @cancellable: (allow-none): A #GCancellable or %NULL.
9156 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
9157 * @user_data: User data to pass to @callback.
9159 * Like _g_freedesktop_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
9161 * 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.
9162 * You can then call _g_freedesktop_dbus_proxy_new_for_bus_finish() to get the result of the operation.
9164 * See _g_freedesktop_dbus_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
9169 * _g_freedesktop_dbus_proxy_new_for_bus_finish:
9170 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new_for_bus().
9171 * @error: Return location for error or %NULL
9173 * Finishes an operation started with _g_freedesktop_dbus_proxy_new_for_bus().
9175 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
9180 * _g_freedesktop_dbus_proxy_new_for_bus_sync:
9181 * @bus_type: A #GBusType.
9182 * @flags: Flags from the #GDBusProxyFlags enumeration.
9183 * @name: A bus name (well-known or unique).
9184 * @object_path: An object path.
9185 * @cancellable: (allow-none): A #GCancellable or %NULL.
9186 * @error: Return location for error or %NULL
9188 * Like _g_freedesktop_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
9190 * The calling thread is blocked until a reply is received.
9192 * See _g_freedesktop_dbus_proxy_new_for_bus() for the asynchronous version of this constructor.
9194 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
9199 * _g_freedesktop_dbus_proxy_new_sync:
9200 * @connection: A #GDBusConnection.
9201 * @flags: Flags from the #GDBusProxyFlags enumeration.
9202 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
9203 * @object_path: An object path.
9204 * @cancellable: (allow-none): A #GCancellable or %NULL.
9205 * @error: Return location for error or %NULL
9207 * 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.
9209 * The calling thread is blocked until a reply is received.
9211 * See _g_freedesktop_dbus_proxy_new() for the asynchronous version of this constructor.
9213 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
9218 * _g_freedesktop_dbus_skeleton_new:
9220 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
9222 * Returns: (transfer full) (type _GFreedesktopDBusSkeleton): The skeleton object.
9227 * _g_io_module_get_default:
9228 * @extension_point: the name of an extension point
9229 * @envvar: (allow-none): the name of an environment variable to override the default implementation.
9230 * @verify_func: (allow-none): a function to call to verify that a given implementation is usable in the current environment.
9232 * Retrieves the default object implementing @extension_point.
9234 * If @envvar is not %NULL, and the environment variable with that
9235 * name is set, then the implementation it specifies will be tried
9236 * first. After that, or if @envvar is not set, all other
9237 * implementations will be tried in order of decreasing priority.
9239 * If an extension point implementation implements #GInitable, then
9240 * that implementation will only be used if it initializes
9241 * successfully. Otherwise, if @verify_func is not %NULL, then it will
9242 * be called on each candidate implementation after construction, to
9243 * check if it is actually usable or not.
9245 * The result is cached after it is generated the first time, and
9246 * the function is thread-safe.
9248 * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
9253 * g_action_activate:
9254 * @action: a #GAction
9255 * @parameter: (allow-none): the parameter to the activation
9257 * Activates the action.
9259 * @parameter must be the correct type of parameter for the action (ie:
9260 * the parameter type given at construction time). If the parameter
9261 * type was %NULL then @parameter must also be %NULL.
9268 * g_action_change_state:
9269 * @action: a #GAction
9270 * @value: the new state
9272 * Request for the state of @action to be changed to @value.
9274 * The action must be stateful and @value must be of the correct type.
9275 * See g_action_get_state_type().
9277 * This call merely requests a change. The action may refuse to change
9278 * its state or may change its state to something other than @value.
9279 * See g_action_get_state_hint().
9281 * If the @value GVariant is floating, it is consumed.
9288 * g_action_get_enabled:
9289 * @action: a #GAction
9291 * Checks if @action is currently enabled.
9293 * An action must be enabled in order to be activated or in order to
9294 * have its state changed from outside callers.
9296 * Returns: whether the action is enabled
9302 * g_action_get_name:
9303 * @action: a #GAction
9305 * Queries the name of @action.
9307 * Returns: the name of the action
9313 * g_action_get_parameter_type:
9314 * @action: a #GAction
9316 * Queries the type of the parameter that must be given when activating
9319 * When activating the action using g_action_activate(), the #GVariant
9320 * given to that function must be of the type returned by this function.
9322 * In the case that this function returns %NULL, you must not give any
9323 * #GVariant, but %NULL instead.
9325 * Returns: (allow-none): the parameter type
9331 * g_action_get_state:
9332 * @action: a #GAction
9334 * Queries the current state of @action.
9336 * If the action is not stateful then %NULL will be returned. If the
9337 * action is stateful then the type of the return value is the type
9338 * given by g_action_get_state_type().
9340 * The return value (if non-%NULL) should be freed with
9341 * g_variant_unref() when it is no longer required.
9343 * Returns: (transfer full): the current state of the action
9349 * g_action_get_state_hint:
9350 * @action: a #GAction
9352 * Requests a hint about the valid range of values for the state of
9355 * If %NULL is returned it either means that the action is not stateful
9356 * or that there is no hint about the valid range of values for the
9357 * state of the action.
9359 * If a #GVariant array is returned then each item in the array is a
9360 * possible value for the state. If a #GVariant pair (ie: two-tuple) is
9361 * returned then the tuple specifies the inclusive lower and upper bound
9362 * of valid values for the state.
9364 * In any case, the information is merely a hint. It may be possible to
9365 * have a state value outside of the hinted range and setting a value
9366 * within the range may fail.
9368 * The return value (if non-%NULL) should be freed with
9369 * g_variant_unref() when it is no longer required.
9371 * Returns: (transfer full): the state range hint
9377 * g_action_get_state_type:
9378 * @action: a #GAction
9380 * Queries the type of the state of @action.
9382 * If the action is stateful (e.g. created with
9383 * g_simple_action_new_stateful()) then this function returns the
9384 * #GVariantType of the state. This is the type of the initial value
9385 * given as the state. All calls to g_action_change_state() must give a
9386 * #GVariant of this type and g_action_get_state() will return a
9387 * #GVariant of the same type.
9389 * If the action is not stateful (e.g. created with g_simple_action_new())
9390 * then this function will return %NULL. In that case, g_action_get_state()
9391 * will return %NULL and you must not call g_action_change_state().
9393 * Returns: (allow-none): the state type, if the action is stateful
9399 * g_action_group_action_added:
9400 * @action_group: a #GActionGroup
9401 * @action_name: the name of an action in the group
9403 * Emits the #GActionGroup::action-added signal on @action_group.
9405 * This function should only be called by #GActionGroup implementations.
9412 * g_action_group_action_enabled_changed:
9413 * @action_group: a #GActionGroup
9414 * @action_name: the name of an action in the group
9415 * @enabled: whether or not the action is now enabled
9417 * Emits the #GActionGroup::action-enabled-changed signal on @action_group.
9419 * This function should only be called by #GActionGroup implementations.
9426 * g_action_group_action_removed:
9427 * @action_group: a #GActionGroup
9428 * @action_name: the name of an action in the group
9430 * Emits the #GActionGroup::action-removed signal on @action_group.
9432 * This function should only be called by #GActionGroup implementations.
9439 * g_action_group_action_state_changed:
9440 * @action_group: a #GActionGroup
9441 * @action_name: the name of an action in the group
9442 * @state: the new state of the named action
9444 * Emits the #GActionGroup::action-state-changed signal on @action_group.
9446 * This function should only be called by #GActionGroup implementations.
9453 * g_action_group_activate_action:
9454 * @action_group: a #GActionGroup
9455 * @action_name: the name of the action to activate
9456 * @parameter: (allow-none): parameters to the activation
9458 * Activate the named action within @action_group.
9460 * If the action is expecting a parameter, then the correct type of
9461 * parameter must be given as @parameter. If the action is expecting no
9462 * parameters then @parameter must be %NULL. See
9463 * g_action_group_get_action_parameter_type().
9470 * g_action_group_change_action_state:
9471 * @action_group: a #GActionGroup
9472 * @action_name: the name of the action to request the change on
9473 * @value: the new state
9475 * Request for the state of the named action within @action_group to be
9476 * changed to @value.
9478 * The action must be stateful and @value must be of the correct type.
9479 * See g_action_group_get_action_state_type().
9481 * This call merely requests a change. The action may refuse to change
9482 * its state or may change its state to something other than @value.
9483 * See g_action_group_get_action_state_hint().
9485 * If the @value GVariant is floating, it is consumed.
9492 * g_action_group_get_action_enabled:
9493 * @action_group: a #GActionGroup
9494 * @action_name: the name of the action to query
9496 * Checks if the named action within @action_group is currently enabled.
9498 * An action must be enabled in order to be activated or in order to
9499 * have its state changed from outside callers.
9501 * Returns: whether or not the action is currently enabled
9507 * g_action_group_get_action_parameter_type:
9508 * @action_group: a #GActionGroup
9509 * @action_name: the name of the action to query
9511 * Queries the type of the parameter that must be given when activating
9512 * the named action within @action_group.
9514 * When activating the action using g_action_group_activate_action(),
9515 * the #GVariant given to that function must be of the type returned
9518 * In the case that this function returns %NULL, you must not give any
9519 * #GVariant, but %NULL instead.
9521 * The parameter type of a particular action will never change but it is
9522 * possible for an action to be removed and for a new action to be added
9523 * with the same name but a different parameter type.
9525 * Returns: the parameter type
9531 * g_action_group_get_action_state:
9532 * @action_group: a #GActionGroup
9533 * @action_name: the name of the action to query
9535 * Queries the current state of the named action within @action_group.
9537 * If the action is not stateful then %NULL will be returned. If the
9538 * action is stateful then the type of the return value is the type
9539 * given by g_action_group_get_action_state_type().
9541 * The return value (if non-%NULL) should be freed with
9542 * g_variant_unref() when it is no longer required.
9544 * Returns: (allow-none): the current state of the action
9550 * g_action_group_get_action_state_hint:
9551 * @action_group: a #GActionGroup
9552 * @action_name: the name of the action to query
9554 * Requests a hint about the valid range of values for the state of the
9555 * named action within @action_group.
9557 * If %NULL is returned it either means that the action is not stateful
9558 * or that there is no hint about the valid range of values for the
9559 * state of the action.
9561 * If a #GVariant array is returned then each item in the array is a
9562 * possible value for the state. If a #GVariant pair (ie: two-tuple) is
9563 * returned then the tuple specifies the inclusive lower and upper bound
9564 * of valid values for the state.
9566 * In any case, the information is merely a hint. It may be possible to
9567 * have a state value outside of the hinted range and setting a value
9568 * within the range may fail.
9570 * The return value (if non-%NULL) should be freed with
9571 * g_variant_unref() when it is no longer required.
9573 * Returns: (transfer full): the state range hint
9579 * g_action_group_get_action_state_type:
9580 * @action_group: a #GActionGroup
9581 * @action_name: the name of the action to query
9583 * Queries the type of the state of the named action within
9586 * If the action is stateful then this function returns the
9587 * #GVariantType of the state. All calls to
9588 * g_action_group_change_action_state() must give a #GVariant of this
9589 * type and g_action_group_get_action_state() will return a #GVariant
9592 * If the action is not stateful then this function will return %NULL.
9593 * In that case, g_action_group_get_action_state() will return %NULL
9594 * and you must not call g_action_group_change_action_state().
9596 * The state type of a particular action will never change but it is
9597 * possible for an action to be removed and for a new action to be added
9598 * with the same name but a different state type.
9600 * Returns: (transfer full): the state type, if the action is stateful
9606 * g_action_group_has_action:
9607 * @action_group: a #GActionGroup
9608 * @action_name: the name of the action to check for
9610 * Checks if the named action exists within @action_group.
9612 * Returns: whether the named action exists
9618 * g_action_group_list_actions:
9619 * @action_group: a #GActionGroup
9621 * Lists the actions contained within @action_group.
9623 * The caller is responsible for freeing the list with g_strfreev() when
9624 * it is no longer required.
9626 * Returns: (transfer full): a %NULL-terminated array of the names of the actions in the groupb
9632 * g_action_group_query_action:
9633 * @action_group: a #GActionGroup
9634 * @action_name: the name of an action in the group
9635 * @enabled: (out): if the action is presently enabled
9636 * @parameter_type: (out) (allow-none): the parameter type, or %NULL if none needed
9637 * @state_type: (out) (allow-none): the state type, or %NULL if stateless
9638 * @state_hint: (out) (allow-none): the state hint, or %NULL if none
9639 * @state: (out) (allow-none): the current state, or %NULL if stateless
9641 * Queries all aspects of the named action within an @action_group.
9643 * This function acquires the information available from
9644 * g_action_group_has_action(), g_action_group_get_action_enabled(),
9645 * g_action_group_get_action_parameter_type(),
9646 * g_action_group_get_action_state_type(),
9647 * g_action_group_get_action_state_hint() and
9648 * g_action_group_get_action_state() with a single function call.
9650 * This provides two main benefits.
9652 * The first is the improvement in efficiency that comes with not having
9653 * to perform repeated lookups of the action in order to discover
9654 * different things about it. The second is that implementing
9655 * #GActionGroup can now be done by only overriding this one virtual
9658 * The interface provides a default implementation of this function that
9659 * calls the individual functions, as required, to fetch the
9660 * information. The interface also provides default implementations of
9661 * those functions that call this function. All implementations,
9662 * therefore, must override either this function or all of the others.
9664 * If the action exists, %TRUE is returned and any of the requested
9665 * fields (as indicated by having a non-%NULL reference passed in) are
9666 * filled. If the action doesn't exist, %FALSE is returned and the
9667 * fields may or may not have been modified.
9669 * Returns: %TRUE if the action exists, else %FALSE
9675 * g_action_map_add_action:
9676 * @action_map: a #GActionMap
9677 * @action: a #GAction
9679 * Adds an action to the @action_map.
9681 * If the action map already contains an action with the same name
9682 * as @action then the old action is dropped from the action map.
9684 * The action map takes its own reference on @action.
9691 * g_action_map_add_action_entries:
9692 * @action_map: a #GActionMap
9693 * @entries: a pointer to the first item in an array of #GActionEntry structs
9694 * @n_entries: the length of @entries, or -1 if @entries is %NULL-terminated
9695 * @user_data: the user data for signal connections
9697 * A convenience function for creating multiple #GSimpleAction instances
9698 * and adding them to a #GActionMap.
9700 * Each action is constructed as per one #GActionEntry.
9703 * <title>Using g_action_map_add_action_entries()</title>
9706 * activate_quit (GSimpleAction *simple,
9707 * GVariant *parameter,
9708 * gpointer user_data)
9714 * activate_print_string (GSimpleAction *simple,
9715 * GVariant *parameter,
9716 * gpointer user_data)
9718 * g_print ("%s\n", g_variant_get_string (parameter, NULL));
9721 * static GActionGroup *
9722 * create_action_group (void)
9724 * const GActionEntry entries[] = {
9725 * { "quit", activate_quit },
9726 * { "print-string", activate_print_string, "s" }
9728 * GSimpleActionGroup *group;
9730 * group = g_simple_action_group_new ();
9731 * g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
9733 * return G_ACTION_GROUP (group);
9743 * g_action_map_lookup_action:
9744 * @action_map: a #GActionMap
9745 * @action_name: the name of an action
9747 * Looks up the action with the name @action_name in @action_map.
9749 * If no such action exists, returns %NULL.
9751 * Returns: (transfer none): a #GAction, or %NULL
9757 * g_action_map_remove_action:
9758 * @action_map: a #GActionMap
9759 * @action_name: the name of the action
9761 * Removes the named action from the action map.
9763 * If no action of this name is in the map then nothing happens.
9770 * g_app_info_add_supports_type:
9771 * @appinfo: a #GAppInfo.
9772 * @content_type: a string.
9773 * @error: a #GError.
9775 * Adds a content type to the application information to indicate the
9776 * application is capable of opening files with the given content type.
9778 * Returns: %TRUE on success, %FALSE on error.
9783 * g_app_info_can_delete:
9784 * @appinfo: a #GAppInfo
9786 * Obtains the information whether the #GAppInfo can be deleted.
9787 * See g_app_info_delete().
9789 * Returns: %TRUE if @appinfo can be deleted
9795 * g_app_info_can_remove_supports_type:
9796 * @appinfo: a #GAppInfo.
9798 * Checks if a supported content type can be removed from an application.
9800 * Returns: %TRUE if it is possible to remove supported content types from a given @appinfo, %FALSE if not.
9805 * g_app_info_create_from_commandline:
9806 * @commandline: the commandline to use
9807 * @application_name: (allow-none): the application name, or %NULL to use @commandline
9808 * @flags: flags that can specify details of the created #GAppInfo
9809 * @error: a #GError location to store the error occurring, %NULL to ignore.
9811 * Creates a new #GAppInfo from the given information.
9813 * Note that for @commandline, the quoting rules of the Exec key of the
9814 * <ulink url="http://freedesktop.org/Standards/desktop-entry-spec">freedesktop.org Desktop
9815 * Entry Specification</ulink> are applied. For example, if the @commandline contains
9816 * percent-encoded URIs, the percent-character must be doubled in order to prevent it from
9817 * being swallowed by Exec key unquoting. See the specification for exact quoting rules.
9819 * Returns: (transfer full): new #GAppInfo for given command.
9824 * g_app_info_delete:
9825 * @appinfo: a #GAppInfo
9827 * Tries to delete a #GAppInfo.
9829 * On some platforms, there may be a difference between user-defined
9830 * #GAppInfo<!-- -->s which can be deleted, and system-wide ones which
9831 * cannot. See g_app_info_can_delete().
9833 * Virtual: do_delete
9834 * Returns: %TRUE if @appinfo has been deleted
9841 * @appinfo: a #GAppInfo.
9843 * Creates a duplicate of a #GAppInfo.
9845 * Returns: (transfer full): a duplicate of @appinfo.
9851 * @appinfo1: the first #GAppInfo.
9852 * @appinfo2: the second #GAppInfo.
9854 * Checks if two #GAppInfo<!-- -->s are equal.
9856 * Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
9861 * g_app_info_get_all:
9863 * Gets a list of all of the applications currently registered
9866 * For desktop files, this includes applications that have
9867 * <literal>NoDisplay=true</literal> set or are excluded from
9868 * display by means of <literal>OnlyShowIn</literal> or
9869 * <literal>NotShowIn</literal>. See g_app_info_should_show().
9870 * The returned list does not include applications which have
9871 * the <literal>Hidden</literal> key set.
9873 * Returns: (element-type GAppInfo) (transfer full): a newly allocated #GList of references to #GAppInfo<!---->s.
9878 * g_app_info_get_all_for_type:
9879 * @content_type: the content type to find a #GAppInfo for
9881 * Gets a list of all #GAppInfos for a given content type,
9882 * including the recommended and fallback #GAppInfos. See
9883 * g_app_info_get_recommended_for_type() and
9884 * g_app_info_get_fallback_for_type().
9886 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9891 * g_app_info_get_commandline:
9892 * @appinfo: a #GAppInfo
9894 * Gets the commandline with which the application will be
9897 * Returns: a string containing the @appinfo's commandline, or %NULL if this information is not available
9903 * g_app_info_get_default_for_type:
9904 * @content_type: the content type to find a #GAppInfo for
9905 * @must_support_uris: if %TRUE, the #GAppInfo is expected to support URIs
9907 * Gets the default #GAppInfo for a given content type.
9909 * Returns: (transfer full): #GAppInfo for given @content_type or %NULL on error.
9914 * g_app_info_get_default_for_uri_scheme:
9915 * @uri_scheme: a string containing a URI scheme.
9917 * Gets the default application for handling URIs with
9918 * the given URI scheme. A URI scheme is the initial part
9919 * of the URI, up to but not including the ':', e.g. "http",
9922 * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
9927 * g_app_info_get_description:
9928 * @appinfo: a #GAppInfo.
9930 * Gets a human-readable description of an installed application.
9932 * Returns: a string containing a description of the application @appinfo, or %NULL if none.
9937 * g_app_info_get_display_name:
9938 * @appinfo: a #GAppInfo.
9940 * Gets the display name of the application. The display name is often more
9941 * descriptive to the user than the name itself.
9943 * Returns: the display name of the application for @appinfo, or the name if no display name is available.
9949 * g_app_info_get_executable:
9950 * @appinfo: a #GAppInfo
9952 * Gets the executable's name for the installed application.
9954 * Returns: a string containing the @appinfo's application binaries name
9959 * g_app_info_get_fallback_for_type:
9960 * @content_type: the content type to find a #GAppInfo for
9962 * Gets a list of fallback #GAppInfos for a given content type, i.e.
9963 * those applications which claim to support the given content type
9964 * by MIME type subclassing and not directly.
9966 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9972 * g_app_info_get_icon:
9973 * @appinfo: a #GAppInfo.
9975 * Gets the icon for the application.
9977 * Returns: (transfer none): the default #GIcon for @appinfo or %NULL if there is no default icon.
9982 * g_app_info_get_id:
9983 * @appinfo: a #GAppInfo.
9985 * Gets the ID of an application. An id is a string that
9986 * identifies the application. The exact format of the id is
9987 * platform dependent. For instance, on Unix this is the
9988 * desktop file id from the xdg menu specification.
9990 * Note that the returned ID may be %NULL, depending on how
9991 * the @appinfo has been constructed.
9993 * Returns: a string containing the application's ID.
9998 * g_app_info_get_name:
9999 * @appinfo: a #GAppInfo.
10001 * Gets the installed name of the application.
10003 * Returns: the name of the application for @appinfo.
10008 * g_app_info_get_recommended_for_type:
10009 * @content_type: the content type to find a #GAppInfo for
10011 * Gets a list of recommended #GAppInfos for a given content type, i.e.
10012 * those applications which claim to support the given content type exactly,
10013 * and not by MIME type subclassing.
10014 * Note that the first application of the list is the last used one, i.e.
10015 * the last one for which g_app_info_set_as_last_used_for_type() has been
10018 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
10024 * g_app_info_get_supported_types:
10025 * @appinfo: a #GAppInfo that can handle files
10027 * Retrieves the list of content types that @app_info claims to support.
10028 * If this information is not provided by the environment, this function
10029 * will return %NULL.
10030 * This function does not take in consideration associations added with
10031 * g_app_info_add_supports_type(), but only those exported directly by
10034 * Returns: (transfer none) (array zero-terminated=1) (element-type utf8): a list of content types.
10040 * g_app_info_launch:
10041 * @appinfo: a #GAppInfo
10042 * @files: (allow-none) (element-type GFile): a #GList of #GFile objects
10043 * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
10044 * @error: a #GError
10046 * Launches the application. Passes @files to the launched application
10047 * as arguments, using the optional @launch_context to get information
10048 * about the details of the launcher (like what screen it is on).
10049 * On error, @error will be set accordingly.
10051 * To launch the application without arguments pass a %NULL @files list.
10053 * Note that even if the launch is successful the application launched
10054 * can fail to start if it runs into problems during startup. There is
10055 * no way to detect this.
10057 * Some URIs can be changed when passed through a GFile (for instance
10058 * unsupported URIs with strange formats like mailto:), so if you have
10059 * a textual URI you want to pass in as argument, consider using
10060 * g_app_info_launch_uris() instead.
10062 * The launched application inherits the environment of the launching
10063 * process, but it can be modified with g_app_launch_context_setenv() and
10064 * g_app_launch_context_unsetenv().
10066 * On UNIX, this function sets the <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>
10067 * environment variable with the path of the launched desktop file and
10068 * <envar>GIO_LAUNCHED_DESKTOP_FILE_PID</envar> to the process
10069 * id of the launched process. This can be used to ignore
10070 * <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>, should it be inherited
10071 * by further processes. The <envar>DISPLAY</envar> and
10072 * <envar>DESKTOP_STARTUP_ID</envar> environment variables are also
10073 * set, based on information provided in @launch_context.
10075 * Returns: %TRUE on successful launch, %FALSE otherwise.
10080 * g_app_info_launch_default_for_uri:
10081 * @uri: the uri to show
10082 * @launch_context: (allow-none): an optional #GAppLaunchContext.
10083 * @error: a #GError.
10085 * Utility function that launches the default application
10086 * registered to handle the specified uri. Synchronous I/O
10087 * is done on the uri to detect the type of the file if
10090 * Returns: %TRUE on success, %FALSE on error.
10095 * g_app_info_launch_uris:
10096 * @appinfo: a #GAppInfo
10097 * @uris: (allow-none) (element-type utf8): a #GList containing URIs to launch.
10098 * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
10099 * @error: a #GError
10101 * Launches the application. This passes the @uris to the launched application
10102 * as arguments, using the optional @launch_context to get information
10103 * about the details of the launcher (like what screen it is on).
10104 * On error, @error will be set accordingly.
10106 * To launch the application without arguments pass a %NULL @uris list.
10108 * Note that even if the launch is successful the application launched
10109 * can fail to start if it runs into problems during startup. There is
10110 * no way to detect this.
10112 * Returns: %TRUE on successful launch, %FALSE otherwise.
10117 * g_app_info_remove_supports_type:
10118 * @appinfo: a #GAppInfo.
10119 * @content_type: a string.
10120 * @error: a #GError.
10122 * Removes a supported type from an application, if possible.
10124 * Returns: %TRUE on success, %FALSE on error.
10129 * g_app_info_reset_type_associations:
10130 * @content_type: a content type
10132 * Removes all changes to the type associations done by
10133 * g_app_info_set_as_default_for_type(),
10134 * g_app_info_set_as_default_for_extension(),
10135 * g_app_info_add_supports_type() or
10136 * g_app_info_remove_supports_type().
10143 * g_app_info_set_as_default_for_extension:
10144 * @appinfo: a #GAppInfo.
10145 * @extension: a string containing the file extension (without the dot).
10146 * @error: a #GError.
10148 * Sets the application as the default handler for the given file extension.
10150 * Returns: %TRUE on success, %FALSE on error.
10155 * g_app_info_set_as_default_for_type:
10156 * @appinfo: a #GAppInfo.
10157 * @content_type: the content type.
10158 * @error: a #GError.
10160 * Sets the application as the default handler for a given type.
10162 * Returns: %TRUE on success, %FALSE on error.
10167 * g_app_info_set_as_last_used_for_type:
10168 * @appinfo: a #GAppInfo.
10169 * @content_type: the content type.
10170 * @error: a #GError.
10172 * Sets the application as the last used application for a given type.
10173 * This will make the application appear as first in the list returned
10174 * by g_app_info_get_recommended_for_type(), regardless of the default
10175 * application for that content type.
10177 * Returns: %TRUE on success, %FALSE on error.
10182 * g_app_info_should_show:
10183 * @appinfo: a #GAppInfo.
10185 * Checks if the application info should be shown in menus that
10186 * list available applications.
10188 * Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
10193 * g_app_info_supports_files:
10194 * @appinfo: a #GAppInfo.
10196 * Checks if the application accepts files as arguments.
10198 * Returns: %TRUE if the @appinfo supports files.
10203 * g_app_info_supports_uris:
10204 * @appinfo: a #GAppInfo.
10206 * Checks if the application supports reading files and directories from URIs.
10208 * Returns: %TRUE if the @appinfo supports URIs.
10213 * g_app_launch_context_get_display:
10214 * @context: a #GAppLaunchContext
10215 * @info: a #GAppInfo
10216 * @files: (element-type GFile): a #GList of #GFile objects
10218 * Gets the display string for the @context. This is used to ensure new
10219 * applications are started on the same display as the launching
10220 * application, by setting the <envar>DISPLAY</envar> environment variable.
10222 * Returns: a display string for the display.
10227 * g_app_launch_context_get_environment:
10228 * @context: a #GAppLaunchContext
10230 * Gets the complete environment variable list to be passed to
10231 * the child process when @context is used to launch an application.
10232 * This is a %NULL-terminated array of strings, where each string has
10233 * the form <literal>KEY=VALUE</literal>.
10235 * Returns: (array zero-terminated=1) (transfer full): the child's environment
10241 * g_app_launch_context_get_startup_notify_id:
10242 * @context: a #GAppLaunchContext
10243 * @info: a #GAppInfo
10244 * @files: (element-type GFile): a #GList of of #GFile objects
10246 * Initiates startup notification for the application and returns the
10247 * <envar>DESKTOP_STARTUP_ID</envar> for the launched operation,
10250 * Startup notification IDs are defined in the <ulink
10251 * url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
10252 * FreeDesktop.Org Startup Notifications standard</ulink>.
10254 * Returns: a startup notification ID for the application, or %NULL if not supported.
10259 * g_app_launch_context_launch_failed:
10260 * @context: a #GAppLaunchContext.
10261 * @startup_notify_id: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
10263 * Called when an application has failed to launch, so that it can cancel
10264 * the application startup notification started in g_app_launch_context_get_startup_notify_id().
10269 * g_app_launch_context_new:
10271 * Creates a new application launch context. This is not normally used,
10272 * instead you instantiate a subclass of this, such as #GdkAppLaunchContext.
10274 * Returns: a #GAppLaunchContext.
10279 * g_app_launch_context_setenv:
10280 * @context: a #GAppLaunchContext
10281 * @variable: the environment variable to set
10282 * @value: the value for to set the variable to.
10284 * Arranges for @variable to be set to @value in the child's
10285 * environment when @context is used to launch an application.
10292 * g_app_launch_context_unsetenv:
10293 * @context: a #GAppLaunchContext
10294 * @variable: the environment variable to remove
10296 * Arranges for @variable to be unset in the child's environment
10297 * when @context is used to launch an application.
10304 * g_application_activate:
10305 * @application: a #GApplication
10307 * Activates the application.
10309 * In essence, this results in the #GApplication::activate signal being
10310 * emitted in the primary instance.
10312 * The application must be registered before calling this function.
10319 * g_application_command_line_get_arguments:
10320 * @cmdline: a #GApplicationCommandLine
10321 * @argc: (out) (allow-none): the length of the arguments array, or %NULL
10323 * Gets the list of arguments that was passed on the command line.
10325 * The strings in the array may contain non-utf8 data.
10327 * The return value is %NULL-terminated and should be freed using
10330 * Returns: (array length=argc) (transfer full): the string array containing the arguments (the argv)
10336 * g_application_command_line_get_cwd:
10337 * @cmdline: a #GApplicationCommandLine
10339 * Gets the working directory of the command line invocation.
10340 * The string may contain non-utf8 data.
10342 * It is possible that the remote application did not send a working
10343 * directory, so this may be %NULL.
10345 * The return value should not be modified or freed and is valid for as
10346 * long as @cmdline exists.
10348 * Returns: the current directory, or %NULL
10354 * g_application_command_line_get_environ:
10355 * @cmdline: a #GApplicationCommandLine
10357 * Gets the contents of the 'environ' variable of the command line
10358 * invocation, as would be returned by g_get_environ(), ie as a
10359 * %NULL-terminated list of strings in the form 'NAME=VALUE'.
10360 * The strings may contain non-utf8 data.
10362 * The remote application usually does not send an environment. Use
10363 * %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
10364 * set it is possible that the environment is still not available (due
10365 * to invocation messages from other applications).
10367 * The return value should not be modified or freed and is valid for as
10368 * long as @cmdline exists.
10370 * See g_application_command_line_getenv() if you are only interested
10371 * in the value of a single environment variable.
10373 * Returns: (array zero-terminated=1) (transfer none): the environment strings, or %NULL if they were not sent
10379 * g_application_command_line_get_exit_status:
10380 * @cmdline: a #GApplicationCommandLine
10382 * Gets the exit status of @cmdline. See
10383 * g_application_command_line_set_exit_status() for more information.
10385 * Returns: the exit status
10391 * g_application_command_line_get_is_remote:
10392 * @cmdline: a #GApplicationCommandLine
10394 * Determines if @cmdline represents a remote invocation.
10396 * Returns: %TRUE if the invocation was remote
10402 * g_application_command_line_get_platform_data:
10403 * @cmdline: #GApplicationCommandLine
10405 * Gets the platform data associated with the invocation of @cmdline.
10407 * This is a #GVariant dictionary containing information about the
10408 * context in which the invocation occurred. It typically contains
10409 * information like the current working directory and the startup
10412 * For local invocation, it will be %NULL.
10414 * Returns: (allow-none): the platform data, or %NULL
10420 * g_application_command_line_getenv:
10421 * @cmdline: a #GApplicationCommandLine
10422 * @name: the environment variable to get
10424 * Gets the value of a particular environment variable of the command
10425 * line invocation, as would be returned by g_getenv(). The strings may
10426 * contain non-utf8 data.
10428 * The remote application usually does not send an environment. Use
10429 * %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
10430 * set it is possible that the environment is still not available (due
10431 * to invocation messages from other applications).
10433 * The return value should not be modified or freed and is valid for as
10434 * long as @cmdline exists.
10436 * Returns: the value of the variable, or %NULL if unset or unsent
10442 * g_application_command_line_print:
10443 * @cmdline: a #GApplicationCommandLine
10444 * @format: a printf-style format string
10445 * @...: arguments, as per @format
10447 * Formats a message and prints it using the stdout print handler in the
10448 * invoking process.
10450 * If @cmdline is a local invocation then this is exactly equivalent to
10451 * g_print(). If @cmdline is remote then this is equivalent to calling
10452 * g_print() in the invoking process.
10459 * g_application_command_line_printerr:
10460 * @cmdline: a #GApplicationCommandLine
10461 * @format: a printf-style format string
10462 * @...: arguments, as per @format
10464 * Formats a message and prints it using the stderr print handler in the
10465 * invoking process.
10467 * If @cmdline is a local invocation then this is exactly equivalent to
10468 * g_printerr(). If @cmdline is remote then this is equivalent to
10469 * calling g_printerr() in the invoking process.
10476 * g_application_command_line_set_exit_status:
10477 * @cmdline: a #GApplicationCommandLine
10478 * @exit_status: the exit status
10480 * Sets the exit status that will be used when the invoking process
10483 * The return value of the #GApplication::command-line signal is
10484 * passed to this function when the handler returns. This is the usual
10485 * way of setting the exit status.
10487 * In the event that you want the remote invocation to continue running
10488 * and want to decide on the exit status in the future, you can use this
10489 * call. For the case of a remote invocation, the remote process will
10490 * typically exit when the last reference is dropped on @cmdline. The
10491 * exit status of the remote process will be equal to the last value
10492 * that was set with this function.
10494 * In the case that the commandline invocation is local, the situation
10495 * is slightly more complicated. If the commandline invocation results
10496 * in the mainloop running (ie: because the use-count of the application
10497 * increased to a non-zero value) then the application is considered to
10498 * have been 'successful' in a certain sense, and the exit status is
10499 * always zero. If the application use count is zero, though, the exit
10500 * status of the local #GApplicationCommandLine is used.
10507 * g_application_get_application_id:
10508 * @application: a #GApplication
10510 * Gets the unique identifier for @application.
10512 * Returns: the identifier for @application, owned by @application
10518 * g_application_get_dbus_connection:
10519 * @application: a #GApplication
10521 * Gets the #GDBusConnection being used by the application, or %NULL.
10523 * If #GApplication is using its D-Bus backend then this function will
10524 * return the #GDBusConnection being used for uniqueness and
10525 * communication with the desktop environment and other instances of the
10528 * If #GApplication is not using D-Bus then this function will return
10529 * %NULL. This includes the situation where the D-Bus backend would
10530 * normally be in use but we were unable to connect to the bus.
10532 * This function must not be called before the application has been
10533 * registered. See g_application_get_is_registered().
10535 * Returns: (transfer none): a #GDBusConnection, or %NULL
10541 * g_application_get_dbus_object_path:
10542 * @application: a #GApplication
10544 * Gets the D-Bus object path being used by the application, or %NULL.
10546 * If #GApplication is using its D-Bus backend then this function will
10547 * return the D-Bus object path that #GApplication is using. If the
10548 * application is the primary instance then there is an object published
10549 * at this path. If the application is not the primary instance then
10550 * the result of this function is undefined.
10552 * If #GApplication is not using D-Bus then this function will return
10553 * %NULL. This includes the situation where the D-Bus backend would
10554 * normally be in use but we were unable to connect to the bus.
10556 * This function must not be called before the application has been
10557 * registered. See g_application_get_is_registered().
10559 * Returns: the object path, or %NULL
10565 * g_application_get_default:
10567 * Returns the default #GApplication instance for this process.
10569 * Normally there is only one #GApplication per process and it becomes
10570 * the default when it is created. You can exercise more control over
10571 * this by using g_application_set_default().
10573 * If there is no default application then %NULL is returned.
10575 * Returns: (transfer none): the default application for this process, or %NULL
10581 * g_application_get_flags:
10582 * @application: a #GApplication
10584 * Gets the flags for @application.
10586 * See #GApplicationFlags.
10588 * Returns: the flags for @application
10594 * g_application_get_inactivity_timeout:
10595 * @application: a #GApplication
10597 * Gets the current inactivity timeout for the application.
10599 * This is the amount of time (in milliseconds) after the last call to
10600 * g_application_release() before the application stops running.
10602 * Returns: the timeout, in milliseconds
10608 * g_application_get_is_registered:
10609 * @application: a #GApplication
10611 * Checks if @application is registered.
10613 * An application is registered if g_application_register() has been
10614 * successfully called.
10616 * Returns: %TRUE if @application is registered
10622 * g_application_get_is_remote:
10623 * @application: a #GApplication
10625 * Checks if @application is remote.
10627 * If @application is remote then it means that another instance of
10628 * application already exists (the 'primary' instance). Calls to
10629 * perform actions on @application will result in the actions being
10630 * performed by the primary instance.
10632 * The value of this property cannot be accessed before
10633 * g_application_register() has been called. See
10634 * g_application_get_is_registered().
10636 * Returns: %TRUE if @application is remote
10642 * g_application_hold:
10643 * @application: a #GApplication
10645 * Increases the use count of @application.
10647 * Use this function to indicate that the application has a reason to
10648 * continue to run. For example, g_application_hold() is called by GTK+
10649 * when a toplevel window is on the screen.
10651 * To cancel the hold, call g_application_release().
10656 * g_application_id_is_valid:
10657 * @application_id: a potential application identifier
10659 * Checks if @application_id is a valid application identifier.
10661 * A valid ID is required for calls to g_application_new() and
10662 * g_application_set_application_id().
10664 * For convenience, the restrictions on application identifiers are
10667 * <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-." and must not begin with a digit.</listitem>
10668 * <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least three elements).</listitem>
10669 * <listitem>Application identifiers must not begin or end with a '.' (period) character.</listitem>
10670 * <listitem>Application identifiers must not contain consecutive '.' (period) characters.</listitem>
10671 * <listitem>Application identifiers must not exceed 255 characters.</listitem>
10674 * Returns: %TRUE if @application_id is valid
10679 * g_application_new:
10680 * @application_id: (allow-none): the application id
10681 * @flags: the application flags
10683 * Creates a new #GApplication instance.
10685 * If non-%NULL, the application id must be valid. See
10686 * g_application_id_is_valid().
10688 * If no application ID is given then some features of #GApplication
10689 * (most notably application uniqueness) will be disabled.
10691 * Returns: a new #GApplication instance
10696 * g_application_open:
10697 * @application: a #GApplication
10698 * @files: (array length=n_files): an array of #GFiles to open
10699 * @n_files: the length of the @files array
10700 * @hint: a hint (or ""), but never %NULL
10702 * Opens the given files.
10704 * In essence, this results in the #GApplication::open signal being emitted
10705 * in the primary instance.
10707 * @n_files must be greater than zero.
10709 * @hint is simply passed through to the ::open signal. It is
10710 * intended to be used by applications that have multiple modes for
10711 * opening files (eg: "view" vs "edit", etc). Unless you have a need
10712 * for this functionality, you should use "".
10714 * The application must be registered before calling this function
10715 * and it must have the %G_APPLICATION_HANDLES_OPEN flag set.
10722 * g_application_quit:
10723 * @application: a #GApplication
10725 * Immediately quits the application.
10727 * Upon return to the mainloop, g_application_run() will return,
10728 * calling only the 'shutdown' function before doing so.
10730 * The hold count is ignored.
10732 * The result of calling g_application_run() again after it returns is
10740 * g_application_register:
10741 * @application: a #GApplication
10742 * @cancellable: (allow-none): a #GCancellable, or %NULL
10743 * @error: a pointer to a NULL #GError, or %NULL
10745 * Attempts registration of the application.
10747 * This is the point at which the application discovers if it is the
10748 * primary instance or merely acting as a remote for an already-existing
10749 * primary instance. This is implemented by attempting to acquire the
10750 * application identifier as a unique bus name on the session bus using
10753 * If there is no application ID or if %G_APPLICATION_NON_UNIQUE was
10754 * given, then this process will always become the primary instance.
10756 * Due to the internal architecture of GDBus, method calls can be
10757 * dispatched at any time (even if a main loop is not running). For
10758 * this reason, you must ensure that any object paths that you wish to
10759 * register are registered before calling this function.
10761 * If the application has already been registered then %TRUE is
10762 * returned with no work performed.
10764 * The #GApplication::startup signal is emitted if registration succeeds
10765 * and @application is the primary instance (including the non-unique
10768 * In the event of an error (such as @cancellable being cancelled, or a
10769 * failure to connect to the session bus), %FALSE is returned and @error
10770 * is set appropriately.
10772 * Note: the return value of this function is not an indicator that this
10773 * instance is or is not the primary instance of the application. See
10774 * g_application_get_is_remote() for that.
10776 * Returns: %TRUE if registration succeeded
10782 * g_application_release:
10783 * @application: a #GApplication
10785 * Decrease the use count of @application.
10787 * When the use count reaches zero, the application will stop running.
10789 * Never call this function except to cancel the effect of a previous
10790 * call to g_application_hold().
10795 * g_application_run:
10796 * @application: a #GApplication
10797 * @argc: the argc from main() (or 0 if @argv is %NULL)
10798 * @argv: (array length=argc) (allow-none): the argv from main(), or %NULL
10800 * Runs the application.
10802 * This function is intended to be run from main() and its return value
10803 * is intended to be returned by main(). Although you are expected to pass
10804 * the @argc, @argv parameters from main() to this function, it is possible
10805 * to pass %NULL if @argv is not available or commandline handling is not
10808 * First, the local_command_line() virtual function is invoked.
10809 * This function always runs on the local instance. It gets passed a pointer
10810 * to a %NULL-terminated copy of @argv and is expected to remove the arguments
10811 * that it handled (shifting up remaining arguments). See
10812 * <xref linkend="gapplication-example-cmdline2"/> for an example of
10813 * parsing @argv manually. Alternatively, you may use the #GOptionContext API,
10814 * after setting <literal>argc = g_strv_length (argv);</literal>.
10816 * The last argument to local_command_line() is a pointer to the @status
10817 * variable which can used to set the exit status that is returned from
10818 * g_application_run().
10820 * If local_command_line() returns %TRUE, the command line is expected
10821 * to be completely handled, including possibly registering as the primary
10822 * instance, calling g_application_activate() or g_application_open(), etc.
10824 * If local_command_line() returns %FALSE then the application is registered
10825 * and the #GApplication::command-line signal is emitted in the primary
10826 * instance (which may or may not be this instance). The signal handler
10827 * gets passed a #GApplicationCommandLine object that (among other things)
10828 * contains the remaining commandline arguments that have not been handled
10829 * by local_command_line().
10831 * If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE
10832 * flag set then the default implementation of local_command_line()
10833 * always returns %FALSE immediately, resulting in the commandline
10834 * always being handled in the primary instance.
10836 * Otherwise, the default implementation of local_command_line() tries
10837 * to do a couple of things that are probably reasonable for most
10838 * applications. First, g_application_register() is called to attempt
10839 * to register the application. If that works, then the command line
10840 * arguments are inspected. If no commandline arguments are given, then
10841 * g_application_activate() is called. If commandline arguments are
10842 * given and the %G_APPLICATION_HANDLES_OPEN flag is set then they
10843 * are assumed to be filenames and g_application_open() is called.
10845 * If you need to handle commandline arguments that are not filenames,
10846 * and you don't mind commandline handling to happen in the primary
10847 * instance, you should set %G_APPLICATION_HANDLES_COMMAND_LINE and
10848 * process the commandline arguments in your #GApplication::command-line
10849 * signal handler, either manually or using the #GOptionContext API.
10851 * If you are interested in doing more complicated local handling of the
10852 * commandline then you should implement your own #GApplication subclass
10853 * and override local_command_line(). In this case, you most likely want
10854 * to return %TRUE from your local_command_line() implementation to
10855 * suppress the default handling. See
10856 * <xref linkend="gapplication-example-cmdline2"/> for an example.
10858 * If, after the above is done, the use count of the application is zero
10859 * then the exit status is returned immediately. If the use count is
10860 * non-zero then the default main context is iterated until the use count
10861 * falls to zero, at which point 0 is returned.
10863 * If the %G_APPLICATION_IS_SERVICE flag is set, then the exiting at
10864 * use count of zero is delayed for a while (ie: the instance stays
10865 * around to provide its <emphasis>service</emphasis> to others).
10867 * Returns: the exit status
10873 * g_application_set_action_group:
10874 * @application: a #GApplication
10875 * @action_group: (allow-none): a #GActionGroup, or %NULL
10877 * This used to be how actions were associated with a #GApplication.
10878 * Now there is #GActionMap for that.
10881 * 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.
10886 * g_application_set_application_id:
10887 * @application: a #GApplication
10888 * @application_id: (allow-none): the identifier for @application
10890 * Sets the unique identifier for @application.
10892 * The application id can only be modified if @application has not yet
10895 * If non-%NULL, the application id must be valid. See
10896 * g_application_id_is_valid().
10903 * g_application_set_default:
10904 * @application: (allow-none): the application to set as default, or %NULL
10906 * Sets or unsets the default application for the process, as returned
10907 * by g_application_get_default().
10909 * This function does not take its own reference on @application. If
10910 * @application is destroyed then the default application will revert
10918 * g_application_set_flags:
10919 * @application: a #GApplication
10920 * @flags: the flags for @application
10922 * Sets the flags for @application.
10924 * The flags can only be modified if @application has not yet been
10927 * See #GApplicationFlags.
10934 * g_application_set_inactivity_timeout:
10935 * @application: a #GApplication
10936 * @inactivity_timeout: the timeout, in milliseconds
10938 * Sets the current inactivity timeout for the application.
10940 * This is the amount of time (in milliseconds) after the last call to
10941 * g_application_release() before the application stops running.
10943 * This call has no side effects of its own. The value set here is only
10944 * used for next time g_application_release() drops the use count to
10945 * zero. Any timeouts currently in progress are not impacted.
10952 * g_async_initable_init_async:
10953 * @initable: a #GAsyncInitable.
10954 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10955 * @cancellable: optional #GCancellable object, %NULL to ignore.
10956 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
10957 * @user_data: the data to pass to callback function
10959 * Starts asynchronous initialization of the object implementing the
10960 * interface. This must be done before any real use of the object after
10961 * initial construction. If the object also implements #GInitable you can
10962 * optionally call g_initable_init() instead.
10964 * When the initialization is finished, @callback will be called. You can
10965 * then call g_async_initable_init_finish() to get the result of the
10968 * Implementations may also support cancellation. If @cancellable is not
10969 * %NULL, then initialization can be cancelled by triggering the cancellable
10970 * object from another thread. If the operation was cancelled, the error
10971 * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
10972 * the object doesn't support cancellable initialization, the error
10973 * %G_IO_ERROR_NOT_SUPPORTED will be returned.
10975 * As with #GInitable, if the object is not initialized, or initialization
10976 * returns with an error, then all operations on the object except
10977 * g_object_ref() and g_object_unref() are considered to be invalid, and
10978 * have undefined behaviour. They will often fail with g_critical() or
10979 * g_warning(), but this must not be relied on.
10981 * Implementations of this method must be idempotent: i.e. multiple calls
10982 * to this function with the same argument should return the same results.
10983 * Only the first call initializes the object; further calls return the result
10984 * of the first call. This is so that it's safe to implement the singleton
10985 * pattern in the GObject constructor function.
10987 * For classes that also support the #GInitable interface, the default
10988 * implementation of this method will run the g_initable_init() function
10989 * in a thread, so if you want to support asynchronous initialization via
10990 * threads, just implement the #GAsyncInitable interface without overriding
10991 * any interface methods.
10998 * g_async_initable_init_finish:
10999 * @initable: a #GAsyncInitable.
11000 * @res: a #GAsyncResult.
11001 * @error: a #GError location to store the error occurring, or %NULL to ignore.
11003 * Finishes asynchronous initialization and returns the result.
11004 * See g_async_initable_init_async().
11006 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
11012 * g_async_initable_new_async:
11013 * @object_type: a #GType supporting #GAsyncInitable.
11014 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
11015 * @cancellable: optional #GCancellable object, %NULL to ignore.
11016 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
11017 * @user_data: the data to pass to callback function
11018 * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
11019 * @...: the value of the first property, followed by other property value pairs, and ended by %NULL.
11021 * Helper function for constructing #GAsyncInitable object. This is
11022 * similar to g_object_new() but also initializes the object asynchronously.
11024 * When the initialization is finished, @callback will be called. You can
11025 * then call g_async_initable_new_finish() to get the new object and check
11033 * g_async_initable_new_finish:
11034 * @initable: the #GAsyncInitable from the callback
11035 * @res: the #GAsyncResult from the callback
11036 * @error: return location for errors, or %NULL to ignore
11038 * Finishes the async construction for the various g_async_initable_new
11039 * calls, returning the created object or %NULL on error.
11041 * Returns: (transfer full): a newly created #GObject, or %NULL on error. Free with g_object_unref().
11047 * g_async_initable_new_valist_async:
11048 * @object_type: a #GType supporting #GAsyncInitable.
11049 * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
11050 * @var_args: The var args list generated from @first_property_name.
11051 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
11052 * @cancellable: optional #GCancellable object, %NULL to ignore.
11053 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
11054 * @user_data: the data to pass to callback function
11056 * Helper function for constructing #GAsyncInitable object. This is
11057 * similar to g_object_new_valist() but also initializes the object
11060 * When the initialization is finished, @callback will be called. You can
11061 * then call g_async_initable_new_finish() to get the new object and check
11069 * g_async_initable_newv_async:
11070 * @object_type: a #GType supporting #GAsyncInitable.
11071 * @n_parameters: the number of parameters in @parameters
11072 * @parameters: the parameters to use to construct the object
11073 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
11074 * @cancellable: optional #GCancellable object, %NULL to ignore.
11075 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
11076 * @user_data: the data to pass to callback function
11078 * Helper function for constructing #GAsyncInitable object. This is
11079 * similar to g_object_newv() but also initializes the object asynchronously.
11081 * When the initialization is finished, @callback will be called. You can
11082 * then call g_async_initable_new_finish() to get the new object and check
11090 * g_async_result_get_source_object:
11091 * @res: a #GAsyncResult
11093 * Gets the source object from a #GAsyncResult.
11095 * Returns: (transfer full): a new reference to the source object for the @res, or %NULL if there is none.
11100 * g_async_result_get_user_data:
11101 * @res: a #GAsyncResult.
11103 * Gets the user data from a #GAsyncResult.
11105 * Returns: (transfer full): the user data for @res.
11110 * g_async_result_is_tagged:
11111 * @res: a #GAsyncResult
11112 * @source_tag: an application-defined tag
11114 * Checks if @res has the given @source_tag (generally a function
11115 * pointer indicating the function @res was created by).
11117 * Returns: %TRUE if @res has the indicated @source_tag, %FALSE if not.
11123 * g_async_result_legacy_propagate_error:
11124 * @res: a #GAsyncResult
11125 * @error: (out): a location to propagate the error to.
11127 * If @res is a #GSimpleAsyncResult, this is equivalent to
11128 * g_simple_async_result_propagate_error(). Otherwise it returns
11131 * This can be used for legacy error handling in async
11132 * <literal>_finish ()</literal> wrapper functions that traditionally
11133 * handled #GSimpleAsyncResult error returns themselves rather than
11134 * calling into the virtual method. This should not be used in new
11135 * code; #GAsyncResult errors that are set by virtual methods should
11136 * also be extracted by virtual methods, to enable subclasses to chain
11139 * Returns: %TRUE if @error is has been filled in with an error from @res, %FALSE if not.
11145 * g_buffered_input_stream_fill:
11146 * @stream: a #GBufferedInputStream
11147 * @count: the number of bytes that will be read from the stream
11148 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
11149 * @error: location to store the error occurring, or %NULL to ignore
11151 * Tries to read @count bytes from the stream into the buffer.
11152 * Will block during this read.
11154 * If @count is zero, returns zero and does nothing. A value of @count
11155 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
11157 * On success, the number of bytes read into the buffer is returned.
11158 * It is not an error if this is not the same as the requested size, as it
11159 * can happen e.g. near the end of a file. Zero is returned on end of file
11160 * (or if @count is zero), but never otherwise.
11162 * If @count is -1 then the attempted read size is equal to the number of
11163 * bytes that are required to fill the buffer.
11165 * If @cancellable is not %NULL, then the operation can be cancelled by
11166 * triggering the cancellable object from another thread. If the operation
11167 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
11168 * operation was partially finished when the operation was cancelled the
11169 * partial result will be returned, without an error.
11171 * On error -1 is returned and @error is set accordingly.
11173 * For the asynchronous, non-blocking, version of this function, see
11174 * g_buffered_input_stream_fill_async().
11176 * Returns: the number of bytes read into @stream's buffer, up to @count, or -1 on error.
11181 * g_buffered_input_stream_fill_async:
11182 * @stream: a #GBufferedInputStream
11183 * @count: the number of bytes that will be read from the stream
11184 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
11185 * @cancellable: (allow-none): optional #GCancellable object
11186 * @callback: (scope async): a #GAsyncReadyCallback
11187 * @user_data: (closure): a #gpointer
11189 * Reads data into @stream's buffer asynchronously, up to @count size.
11190 * @io_priority can be used to prioritize reads. For the synchronous
11191 * version of this function, see g_buffered_input_stream_fill().
11193 * If @count is -1 then the attempted read size is equal to the number
11194 * of bytes that are required to fill the buffer.
11199 * g_buffered_input_stream_fill_finish:
11200 * @stream: a #GBufferedInputStream
11201 * @result: a #GAsyncResult
11202 * @error: a #GError
11204 * Finishes an asynchronous read.
11206 * Returns: a #gssize of the read stream, or %-1 on an error.
11211 * g_buffered_input_stream_get_available:
11212 * @stream: #GBufferedInputStream
11214 * Gets the size of the available data within the stream.
11216 * Returns: size of the available stream.
11221 * g_buffered_input_stream_get_buffer_size:
11222 * @stream: a #GBufferedInputStream
11224 * Gets the size of the input buffer.
11226 * Returns: the current buffer size.
11231 * g_buffered_input_stream_new:
11232 * @base_stream: a #GInputStream
11234 * Creates a new #GInputStream from the given @base_stream, with
11235 * a buffer set to the default size (4 kilobytes).
11237 * Returns: a #GInputStream for the given @base_stream.
11242 * g_buffered_input_stream_new_sized:
11243 * @base_stream: a #GInputStream
11246 * Creates a new #GBufferedInputStream from the given @base_stream,
11247 * with a buffer set to @size.
11249 * Returns: a #GInputStream.
11254 * g_buffered_input_stream_peek:
11255 * @stream: a #GBufferedInputStream
11256 * @buffer: (array length=count) (element-type guint8): a pointer to an allocated chunk of memory
11257 * @offset: a #gsize
11260 * Peeks in the buffer, copying data of size @count into @buffer,
11261 * offset @offset bytes.
11263 * Returns: a #gsize of the number of bytes peeked, or -1 on error.
11268 * g_buffered_input_stream_peek_buffer:
11269 * @stream: a #GBufferedInputStream
11270 * @count: (out): a #gsize to get the number of bytes available in the buffer
11272 * Returns the buffer with the currently available bytes. The returned
11273 * buffer must not be modified and will become invalid when reading from
11274 * the stream or filling the buffer.
11276 * Returns: (array length=count) (element-type guint8) (transfer none): read-only buffer
11281 * g_buffered_input_stream_read_byte:
11282 * @stream: a #GBufferedInputStream
11283 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
11284 * @error: location to store the error occurring, or %NULL to ignore
11286 * Tries to read a single byte from the stream or the buffer. Will block
11287 * during this read.
11289 * On success, the byte read from the stream is returned. On end of stream
11290 * -1 is returned but it's not an exceptional error and @error is not set.
11292 * If @cancellable is not %NULL, then the operation can be cancelled by
11293 * triggering the cancellable object from another thread. If the operation
11294 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
11295 * operation was partially finished when the operation was cancelled the
11296 * partial result will be returned, without an error.
11298 * On error -1 is returned and @error is set accordingly.
11300 * Returns: the byte read from the @stream, or -1 on end of stream or error.
11305 * g_buffered_input_stream_set_buffer_size:
11306 * @stream: a #GBufferedInputStream
11309 * Sets the size of the internal buffer of @stream to @size, or to the
11310 * size of the contents of the buffer. The buffer can never be resized
11311 * smaller than its current contents.
11316 * g_buffered_output_stream_get_auto_grow:
11317 * @stream: a #GBufferedOutputStream.
11319 * Checks if the buffer automatically grows as data is added.
11321 * Returns: %TRUE if the @stream's buffer automatically grows, %FALSE otherwise.
11326 * g_buffered_output_stream_get_buffer_size:
11327 * @stream: a #GBufferedOutputStream.
11329 * Gets the size of the buffer in the @stream.
11331 * Returns: the current size of the buffer.
11336 * g_buffered_output_stream_new:
11337 * @base_stream: a #GOutputStream.
11339 * Creates a new buffered output stream for a base stream.
11341 * Returns: a #GOutputStream for the given @base_stream.
11346 * g_buffered_output_stream_new_sized:
11347 * @base_stream: a #GOutputStream.
11350 * Creates a new buffered output stream with a given buffer size.
11352 * Returns: a #GOutputStream with an internal buffer set to @size.
11357 * g_buffered_output_stream_set_auto_grow:
11358 * @stream: a #GBufferedOutputStream.
11359 * @auto_grow: a #gboolean.
11361 * Sets whether or not the @stream's buffer should automatically grow.
11362 * If @auto_grow is true, then each write will just make the buffer
11363 * larger, and you must manually flush the buffer to actually write out
11364 * the data to the underlying stream.
11369 * g_buffered_output_stream_set_buffer_size:
11370 * @stream: a #GBufferedOutputStream.
11373 * Sets the size of the internal buffer to @size.
11379 * @bus_type: A #GBusType.
11380 * @cancellable: (allow-none): A #GCancellable or %NULL.
11381 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
11382 * @user_data: The data to pass to @callback.
11384 * Asynchronously connects to the message bus specified by @bus_type.
11386 * When the operation is finished, @callback will be invoked. You can
11387 * then call g_bus_get_finish() to get the result of the operation.
11389 * This is a asynchronous failable function. See g_bus_get_sync() for
11390 * the synchronous version.
11397 * g_bus_get_finish:
11398 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
11399 * @error: Return location for error or %NULL.
11401 * Finishes an operation started with g_bus_get().
11403 * The returned object is a singleton, that is, shared with other
11404 * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
11405 * event that you need a private message bus connection, use
11406 * g_dbus_address_get_for_bus_sync() and
11407 * g_dbus_connection_new_for_address().
11409 * Note that the returned #GDBusConnection object will (usually) have
11410 * the #GDBusConnection:exit-on-close property set to %TRUE.
11412 * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
11419 * @bus_type: A #GBusType.
11420 * @cancellable: (allow-none): A #GCancellable or %NULL.
11421 * @error: Return location for error or %NULL.
11423 * Synchronously connects to the message bus specified by @bus_type.
11424 * Note that the returned object may shared with other callers,
11425 * e.g. if two separate parts of a process calls this function with
11426 * the same @bus_type, they will share the same object.
11428 * This is a synchronous failable function. See g_bus_get() and
11429 * g_bus_get_finish() for the asynchronous version.
11431 * The returned object is a singleton, that is, shared with other
11432 * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
11433 * event that you need a private message bus connection, use
11434 * g_dbus_address_get_for_bus_sync() and
11435 * g_dbus_connection_new_for_address().
11437 * Note that the returned #GDBusConnection object will (usually) have
11438 * the #GDBusConnection:exit-on-close property set to %TRUE.
11440 * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
11447 * @bus_type: The type of bus to own a name on.
11448 * @name: The well-known name to own.
11449 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
11450 * @bus_acquired_handler: (allow-none): Handler to invoke when connected to the bus of type @bus_type or %NULL.
11451 * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
11452 * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
11453 * @user_data: User data to pass to handlers.
11454 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11456 * Starts acquiring @name on the bus specified by @bus_type and calls
11457 * @name_acquired_handler and @name_lost_handler when the name is
11458 * acquired respectively lost. Callbacks will be invoked in the <link
11459 * linkend="g-main-context-push-thread-default">thread-default main
11460 * loop</link> of the thread you are calling this function from.
11462 * You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
11463 * callbacks will be invoked after calling this function - there are three
11467 * @name_lost_handler with a %NULL connection (if a connection to the bus can't be made).
11468 * </para></listitem>
11470 * @bus_acquired_handler then @name_lost_handler (if the name can't be obtained)
11471 * </para></listitem>
11473 * @bus_acquired_handler then @name_acquired_handler (if the name was obtained).
11474 * </para></listitem>
11476 * When you are done owning the name, just call g_bus_unown_name()
11477 * with the owner id this function returns.
11479 * If the name is acquired or lost (for example another application
11480 * could acquire the name if you allow replacement or the application
11481 * currently owning the name exits), the handlers are also invoked. If the
11482 * #GDBusConnection that is used for attempting to own the name
11483 * closes, then @name_lost_handler is invoked since it is no
11484 * longer possible for other processes to access the process.
11486 * You cannot use g_bus_own_name() several times for the same name (unless
11487 * interleaved with calls to g_bus_unown_name()) - only the first call
11490 * Another guarantee is that invocations of @name_acquired_handler
11491 * and @name_lost_handler are guaranteed to alternate; that
11492 * is, if @name_acquired_handler is invoked then you are
11493 * guaranteed that the next time one of the handlers is invoked, it
11494 * will be @name_lost_handler. The reverse is also true.
11496 * If you plan on exporting objects (using e.g.
11497 * g_dbus_connection_register_object()), note that it is generally too late
11498 * to export the objects in @name_acquired_handler. Instead, you can do this
11499 * in @bus_acquired_handler since you are guaranteed that this will run
11500 * before @name is requested from the bus.
11502 * This behavior makes it very simple to write applications that wants
11503 * to own names and export objects, see <xref linkend="gdbus-owning-names"/>.
11504 * Simply register objects to be exported in @bus_acquired_handler and
11505 * unregister the objects (if any) in @name_lost_handler.
11507 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
11513 * g_bus_own_name_on_connection:
11514 * @connection: A #GDBusConnection.
11515 * @name: The well-known name to own.
11516 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
11517 * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
11518 * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
11519 * @user_data: User data to pass to handlers.
11520 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11522 * Like g_bus_own_name() but takes a #GDBusConnection instead of a
11525 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
11531 * g_bus_own_name_on_connection_with_closures:
11532 * @connection: A #GDBusConnection.
11533 * @name: The well-known name to own.
11534 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
11535 * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
11536 * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
11538 * Version of g_bus_own_name_on_connection() using closures instead of callbacks for
11539 * easier binding in other languages.
11541 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
11542 * Rename to: g_bus_own_name_on_connection
11548 * g_bus_own_name_with_closures:
11549 * @bus_type: The type of bus to own a name on.
11550 * @name: The well-known name to own.
11551 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
11552 * @bus_acquired_closure: (allow-none): #GClosure to invoke when connected to the bus of type @bus_type or %NULL.
11553 * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
11554 * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
11556 * Version of g_bus_own_name() using closures instead of callbacks for
11557 * easier binding in other languages.
11559 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
11560 * Rename to: g_bus_own_name
11566 * g_bus_unown_name:
11567 * @owner_id: An identifier obtained from g_bus_own_name()
11569 * Stops owning a name.
11576 * g_bus_unwatch_name:
11577 * @watcher_id: An identifier obtained from g_bus_watch_name()
11579 * Stops watching a name.
11586 * g_bus_watch_name:
11587 * @bus_type: The type of bus to watch a name on.
11588 * @name: The name (well-known or unique) to watch.
11589 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11590 * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
11591 * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
11592 * @user_data: User data to pass to handlers.
11593 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11595 * Starts watching @name on the bus specified by @bus_type and calls
11596 * @name_appeared_handler and @name_vanished_handler when the name is
11597 * known to have a owner respectively known to lose its
11598 * owner. Callbacks will be invoked in the <link
11599 * linkend="g-main-context-push-thread-default">thread-default main
11600 * loop</link> of the thread you are calling this function from.
11602 * You are guaranteed that one of the handlers will be invoked after
11603 * calling this function. When you are done watching the name, just
11604 * call g_bus_unwatch_name() with the watcher id this function
11607 * If the name vanishes or appears (for example the application owning
11608 * the name could restart), the handlers are also invoked. If the
11609 * #GDBusConnection that is used for watching the name disconnects, then
11610 * @name_vanished_handler is invoked since it is no longer
11611 * possible to access the name.
11613 * Another guarantee is that invocations of @name_appeared_handler
11614 * and @name_vanished_handler are guaranteed to alternate; that
11615 * is, if @name_appeared_handler is invoked then you are
11616 * guaranteed that the next time one of the handlers is invoked, it
11617 * will be @name_vanished_handler. The reverse is also true.
11619 * This behavior makes it very simple to write applications that wants
11620 * to take action when a certain name exists, see <xref
11621 * linkend="gdbus-watching-names"/>. Basically, the application
11622 * should create object proxies in @name_appeared_handler and destroy
11623 * them again (if any) in @name_vanished_handler.
11625 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11631 * g_bus_watch_name_on_connection:
11632 * @connection: A #GDBusConnection.
11633 * @name: The name (well-known or unique) to watch.
11634 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11635 * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
11636 * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
11637 * @user_data: User data to pass to handlers.
11638 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11640 * Like g_bus_watch_name() but takes a #GDBusConnection instead of a
11643 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11649 * g_bus_watch_name_on_connection_with_closures:
11650 * @connection: A #GDBusConnection.
11651 * @name: The name (well-known or unique) to watch.
11652 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11653 * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
11654 * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
11656 * Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
11657 * easier binding in other languages.
11659 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11660 * Rename to: g_bus_watch_name_on_connection
11666 * g_bus_watch_name_with_closures:
11667 * @bus_type: The type of bus to watch a name on.
11668 * @name: The name (well-known or unique) to watch.
11669 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11670 * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
11671 * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
11673 * Version of g_bus_watch_name() using closures instead of callbacks for
11674 * easier binding in other languages.
11676 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11677 * Rename to: g_bus_watch_name
11683 * g_cancellable_cancel:
11684 * @cancellable: a #GCancellable object.
11686 * Will set @cancellable to cancelled, and will emit the
11687 * #GCancellable::cancelled signal. (However, see the warning about
11688 * race conditions in the documentation for that signal if you are
11689 * planning to connect to it.)
11691 * This function is thread-safe. In other words, you can safely call
11692 * it from a thread other than the one running the operation that was
11693 * passed the @cancellable.
11695 * The convention within gio is that cancelling an asynchronous
11696 * operation causes it to complete asynchronously. That is, if you
11697 * cancel the operation from the same thread in which it is running,
11698 * then the operation's #GAsyncReadyCallback will not be invoked until
11699 * the application returns to the main loop.
11704 * g_cancellable_connect:
11705 * @cancellable: A #GCancellable.
11706 * @callback: The #GCallback to connect.
11707 * @data: Data to pass to @callback.
11708 * @data_destroy_func: (allow-none): Free function for @data or %NULL.
11710 * Convenience function to connect to the #GCancellable::cancelled
11711 * signal. Also handles the race condition that may happen
11712 * if the cancellable is cancelled right before connecting.
11714 * @callback is called at most once, either directly at the
11715 * time of the connect if @cancellable is already cancelled,
11716 * or when @cancellable is cancelled in some thread.
11718 * @data_destroy_func will be called when the handler is
11719 * disconnected, or immediately if the cancellable is already
11722 * See #GCancellable::cancelled for details on how to use this.
11724 * Returns: The id of the signal handler or 0 if @cancellable has already been cancelled.
11730 * g_cancellable_disconnect:
11731 * @cancellable: (allow-none): A #GCancellable or %NULL.
11732 * @handler_id: Handler id of the handler to be disconnected, or %0.
11734 * Disconnects a handler from a cancellable instance similar to
11735 * g_signal_handler_disconnect(). Additionally, in the event that a
11736 * signal handler is currently running, this call will block until the
11737 * handler has finished. Calling this function from a
11738 * #GCancellable::cancelled signal handler will therefore result in a
11741 * This avoids a race condition where a thread cancels at the
11742 * same time as the cancellable operation is finished and the
11743 * signal handler is removed. See #GCancellable::cancelled for
11744 * details on how to use this.
11746 * If @cancellable is %NULL or @handler_id is %0 this function does
11754 * g_cancellable_get_current:
11756 * Gets the top cancellable from the stack.
11758 * Returns: (transfer none): a #GCancellable from the top of the stack, or %NULL if the stack is empty.
11763 * g_cancellable_get_fd:
11764 * @cancellable: a #GCancellable.
11766 * Gets the file descriptor for a cancellable job. This can be used to
11767 * implement cancellable operations on Unix systems. The returned fd will
11768 * turn readable when @cancellable is cancelled.
11770 * You are not supposed to read from the fd yourself, just check for
11771 * readable status. Reading to unset the readable status is done
11772 * with g_cancellable_reset().
11774 * After a successful return from this function, you should use
11775 * g_cancellable_release_fd() to free up resources allocated for
11776 * the returned file descriptor.
11778 * See also g_cancellable_make_pollfd().
11780 * Returns: A valid file descriptor. %-1 if the file descriptor is not supported, or on errors.
11785 * g_cancellable_is_cancelled:
11786 * @cancellable: (allow-none): a #GCancellable or %NULL
11788 * Checks if a cancellable job has been cancelled.
11790 * Returns: %TRUE if @cancellable is cancelled, FALSE if called with %NULL or if item is not cancelled.
11795 * g_cancellable_make_pollfd:
11796 * @cancellable: (allow-none): a #GCancellable or %NULL
11797 * @pollfd: a pointer to a #GPollFD
11799 * Creates a #GPollFD corresponding to @cancellable; this can be passed
11800 * to g_poll() and used to poll for cancellation. This is useful both
11801 * for unix systems without a native poll and for portability to
11804 * When this function returns %TRUE, you should use
11805 * g_cancellable_release_fd() to free up resources allocated for the
11806 * @pollfd. After a %FALSE return, do not call g_cancellable_release_fd().
11808 * If this function returns %FALSE, either no @cancellable was given or
11809 * resource limits prevent this function from allocating the necessary
11810 * structures for polling. (On Linux, you will likely have reached
11811 * the maximum number of file descriptors.) The suggested way to handle
11812 * these cases is to ignore the @cancellable.
11814 * You are not supposed to read from the fd yourself, just check for
11815 * readable status. Reading to unset the readable status is done
11816 * with g_cancellable_reset().
11818 * Returns: %TRUE if @pollfd was successfully initialized, %FALSE on failure to prepare the cancellable.
11824 * g_cancellable_new:
11826 * Creates a new #GCancellable object.
11828 * Applications that want to start one or more operations
11829 * that should be cancellable should create a #GCancellable
11830 * and pass it to the operations.
11832 * One #GCancellable can be used in multiple consecutive
11833 * operations or in multiple concurrent operations.
11835 * Returns: a #GCancellable.
11840 * g_cancellable_pop_current:
11841 * @cancellable: a #GCancellable object
11843 * Pops @cancellable off the cancellable stack (verifying that @cancellable
11844 * is on the top of the stack).
11849 * g_cancellable_push_current:
11850 * @cancellable: a #GCancellable object
11852 * Pushes @cancellable onto the cancellable stack. The current
11853 * cancellable can then be received using g_cancellable_get_current().
11855 * This is useful when implementing cancellable operations in
11856 * code that does not allow you to pass down the cancellable object.
11858 * This is typically called automatically by e.g. #GFile operations,
11859 * so you rarely have to call this yourself.
11864 * g_cancellable_release_fd:
11865 * @cancellable: a #GCancellable
11867 * Releases a resources previously allocated by g_cancellable_get_fd()
11868 * or g_cancellable_make_pollfd().
11870 * For compatibility reasons with older releases, calling this function
11871 * is not strictly required, the resources will be automatically freed
11872 * when the @cancellable is finalized. However, the @cancellable will
11873 * block scarce file descriptors until it is finalized if this function
11874 * is not called. This can cause the application to run out of file
11875 * descriptors when many #GCancellables are used at the same time.
11882 * g_cancellable_reset:
11883 * @cancellable: a #GCancellable object.
11885 * Resets @cancellable to its uncancelled state.
11887 * If cancellable is currently in use by any cancellable operation
11888 * then the behavior of this function is undefined.
11893 * g_cancellable_set_error_if_cancelled:
11894 * @cancellable: (allow-none): a #GCancellable or %NULL
11895 * @error: #GError to append error state to
11897 * If the @cancellable is cancelled, sets the error to notify
11898 * that the operation was cancelled.
11900 * Returns: %TRUE if @cancellable was cancelled, %FALSE if it was not
11905 * g_cancellable_source_new: (skip)
11906 * @cancellable: (allow-none): a #GCancellable, or %NULL
11908 * Creates a source that triggers if @cancellable is cancelled and
11909 * calls its callback of type #GCancellableSourceFunc. This is
11910 * primarily useful for attaching to another (non-cancellable) source
11911 * with g_source_add_child_source() to add cancellability to it.
11913 * For convenience, you can call this with a %NULL #GCancellable,
11914 * in which case the source will never trigger.
11916 * Returns: (transfer full): the new #GSource.
11922 * g_charset_converter_get_num_fallbacks:
11923 * @converter: a #GCharsetConverter
11925 * Gets the number of fallbacks that @converter has applied so far.
11927 * Returns: the number of fallbacks that @converter has applied
11933 * g_charset_converter_get_use_fallback:
11934 * @converter: a #GCharsetConverter
11936 * Gets the #GCharsetConverter:use-fallback property.
11938 * Returns: %TRUE if fallbacks are used by @converter
11944 * g_charset_converter_new:
11945 * @to_charset: destination charset
11946 * @from_charset: source charset
11947 * @error: #GError for error reporting, or %NULL to ignore.
11949 * Creates a new #GCharsetConverter.
11951 * Returns: a new #GCharsetConverter or %NULL on error.
11957 * g_charset_converter_set_use_fallback:
11958 * @converter: a #GCharsetConverter
11959 * @use_fallback: %TRUE to use fallbacks
11961 * Sets the #GCharsetConverter:use-fallback property.
11968 * g_content_type_can_be_executable:
11969 * @type: a content type string
11971 * Checks if a content type can be executable. Note that for instance
11972 * things like text files can be executables (i.e. scripts and batch files).
11974 * Returns: %TRUE if the file type corresponds to a type that can be executable, %FALSE otherwise.
11979 * g_content_type_equals:
11980 * @type1: a content type string
11981 * @type2: a content type string
11983 * Compares two content types for equality.
11985 * Returns: %TRUE if the two strings are identical or equivalent, %FALSE otherwise.
11990 * g_content_type_from_mime_type:
11991 * @mime_type: a mime type string
11993 * Tries to find a content type based on the mime type name.
11995 * Returns: (allow-none): Newly allocated string with content type or %NULL. Free with g_free()
12001 * g_content_type_get_description:
12002 * @type: a content type string
12004 * Gets the human readable description of the content type.
12006 * Returns: a short description of the content type @type. Free the returned string with g_free()
12011 * g_content_type_get_generic_icon_name:
12012 * @type: a content type string
12014 * Gets the generic icon name for a content type.
12016 * See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
12017 * specification for more on the generic icon name.
12019 * Returns: (allow-none): the registered generic icon name for the given @type, or %NULL if unknown. Free with g_free()
12025 * g_content_type_get_icon:
12026 * @type: a content type string
12028 * Gets the icon for a content type.
12030 * Returns: (transfer full): #GIcon corresponding to the content type. Free the returned object with g_object_unref()
12035 * g_content_type_get_mime_type:
12036 * @type: a content type string
12038 * Gets the mime type for the content type, if one is registered.
12040 * Returns: (allow-none): the registered mime type for the given @type, or %NULL if unknown.
12045 * g_content_type_get_symbolic_icon:
12046 * @type: a content type string
12048 * Gets the symbolic icon for a content type.
12050 * Returns: (transfer full): symbolic #GIcon corresponding to the content type. Free the returned object with g_object_unref()
12056 * g_content_type_guess:
12057 * @filename: (allow-none): a string, or %NULL
12058 * @data: (allow-none) (array length=data_size): a stream of data, or %NULL
12059 * @data_size: the size of @data
12060 * @result_uncertain: (allow-none) (out): return location for the certainty of the result, or %NULL
12062 * Guesses the content type based on example data. If the function is
12063 * uncertain, @result_uncertain will be set to %TRUE. Either @filename
12064 * or @data may be %NULL, in which case the guess will be based solely
12065 * on the other argument.
12067 * Returns: a string indicating a guessed content type for the given data. Free with g_free()
12072 * g_content_type_guess_for_tree:
12073 * @root: the root of the tree to guess a type for
12075 * Tries to guess the type of the tree with root @root, by
12076 * looking at the files it contains. The result is an array
12077 * of content types, with the best guess coming first.
12079 * The types returned all have the form x-content/foo, e.g.
12080 * x-content/audio-cdda (for audio CDs) or x-content/image-dcf
12081 * (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
12082 * specification for more on x-content types.
12084 * This function is useful in the implementation of
12085 * g_mount_guess_content_type().
12087 * Returns: (transfer full) (array zero-terminated=1): an %NULL-terminated array of zero or more content types. Free with g_strfreev()
12093 * g_content_type_is_a:
12094 * @type: a content type string
12095 * @supertype: a content type string
12097 * Determines if @type is a subset of @supertype.
12099 * Returns: %TRUE if @type is a kind of @supertype, %FALSE otherwise.
12104 * g_content_type_is_unknown:
12105 * @type: a content type string
12107 * Checks if the content type is the generic "unknown" type.
12108 * On UNIX this is the "application/octet-stream" mimetype,
12109 * while on win32 it is "*".
12111 * Returns: %TRUE if the type is the unknown type.
12116 * g_content_types_get_registered:
12118 * Gets a list of strings containing all the registered content types
12119 * known to the system. The list and its data should be freed using
12121 * g_list_free_full (list, g_free);
12122 * </programlisting>
12124 * Returns: (element-type utf8) (transfer full): #GList of the registered content types
12129 * g_converter_convert:
12130 * @converter: a #GConverter.
12131 * @inbuf: (array length=inbuf_size) (element-type guint8): the buffer containing the data to convert.
12132 * @inbuf_size: the number of bytes in @inbuf
12133 * @outbuf: a buffer to write converted data in.
12134 * @outbuf_size: the number of bytes in @outbuf, must be at least one
12135 * @flags: a #GConverterFlags controlling the conversion details
12136 * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success
12137 * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success
12138 * @error: location to store the error occurring, or %NULL to ignore
12140 * This is the main operation used when converting data. It is to be called
12141 * multiple times in a loop, and each time it will do some work, i.e.
12142 * producing some output (in @outbuf) or consuming some input (from @inbuf) or
12143 * both. If its not possible to do any work an error is returned.
12145 * Note that a single call may not consume all input (or any input at all).
12146 * Also a call may produce output even if given no input, due to state stored
12147 * in the converter producing output.
12149 * If any data was either produced or consumed, and then an error happens, then
12150 * only the successful conversion is reported and the error is returned on the
12153 * A full conversion loop involves calling this method repeatedly, each time
12154 * giving it new input and space output space. When there is no more input
12155 * data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
12156 * The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
12157 * each time until all data is consumed and all output is produced, then
12158 * %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
12159 * may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
12160 * in a decompression converter where the end of data is detectable from the
12161 * data (and there might even be other data after the end of the compressed data).
12163 * When some data has successfully been converted @bytes_read and is set to
12164 * the number of bytes read from @inbuf, and @bytes_written is set to indicate
12165 * how many bytes was written to @outbuf. If there are more data to output
12166 * or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
12167 * %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
12168 * then %G_CONVERTER_FINISHED is returned.
12170 * On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
12171 * Some errors need special handling:
12173 * %G_IO_ERROR_NO_SPACE is returned if there is not enough space
12174 * to write the resulting converted data, the application should
12175 * call the function again with a larger @outbuf to continue.
12177 * %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
12178 * input to fully determine what the conversion should produce,
12179 * and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
12180 * example with an incomplete multibyte sequence when converting text,
12181 * or when a regexp matches up to the end of the input (and may match
12182 * further input). It may also happen when @inbuf_size is zero and
12183 * there is no more data to produce.
12185 * When this happens the application should read more input and then
12186 * call the function again. If further input shows that there is no
12187 * more data call the function again with the same data but with
12188 * the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
12189 * to finish as e.g. in the regexp match case (or, to fail again with
12190 * %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
12191 * input is actually partial).
12193 * After g_converter_convert() has returned %G_CONVERTER_FINISHED the
12194 * converter object is in an invalid state where its not allowed
12195 * to call g_converter_convert() anymore. At this time you can only
12196 * free the object or call g_converter_reset() to reset it to the
12199 * If the flag %G_CONVERTER_FLUSH is set then conversion is modified
12200 * to try to write out all internal state to the output. The application
12201 * has to call the function multiple times with the flag set, and when
12202 * the available input has been consumed and all internal state has
12203 * been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
12204 * really at the end) is returned instead of %G_CONVERTER_CONVERTED.
12205 * This is somewhat similar to what happens at the end of the input stream,
12206 * but done in the middle of the data.
12208 * This has different meanings for different conversions. For instance
12209 * in a compression converter it would mean that we flush all the
12210 * compression state into output such that if you uncompress the
12211 * compressed data you get back all the input data. Doing this may
12212 * make the final file larger due to padding though. Another example
12213 * is a regexp conversion, where if you at the end of the flushed data
12214 * have a match, but there is also a potential longer match. In the
12215 * non-flushed case we would ask for more input, but when flushing we
12216 * treat this as the end of input and do the match.
12218 * Flushing is not always possible (like if a charset converter flushes
12219 * at a partial multibyte sequence). Converters are supposed to try
12220 * to produce as much output as possible and then return an error
12221 * (typically %G_IO_ERROR_PARTIAL_INPUT).
12223 * Returns: a #GConverterResult, %G_CONVERTER_ERROR on error.
12229 * g_converter_input_stream_get_converter:
12230 * @converter_stream: a #GConverterInputStream
12232 * Gets the #GConverter that is used by @converter_stream.
12234 * Returns: (transfer none): the converter of the converter input stream
12240 * g_converter_input_stream_new:
12241 * @base_stream: a #GInputStream
12242 * @converter: a #GConverter
12244 * Creates a new converter input stream for the @base_stream.
12246 * Returns: a new #GInputStream.
12251 * g_converter_output_stream_get_converter:
12252 * @converter_stream: a #GConverterOutputStream
12254 * Gets the #GConverter that is used by @converter_stream.
12256 * Returns: (transfer none): the converter of the converter output stream
12262 * g_converter_output_stream_new:
12263 * @base_stream: a #GOutputStream
12264 * @converter: a #GConverter
12266 * Creates a new converter output stream for the @base_stream.
12268 * Returns: a new #GOutputStream.
12273 * g_converter_reset:
12274 * @converter: a #GConverter.
12276 * Resets all internal state in the converter, making it behave
12277 * as if it was just created. If the converter has any internal
12278 * state that would produce output then that output is lost.
12285 * g_credentials_get_native: (skip)
12286 * @credentials: A #GCredentials.
12287 * @native_type: The type of native credentials to get.
12289 * Gets a pointer to native credentials of type @native_type from
12292 * It is a programming error (which will cause an warning to be
12293 * logged) to use this method if there is no #GCredentials support for
12294 * the OS or if @native_type isn't supported by the OS.
12296 * 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.
12302 * g_credentials_get_unix_user:
12303 * @credentials: A #GCredentials
12304 * @error: Return location for error or %NULL.
12306 * Tries to get the UNIX user identifier from @credentials. This
12307 * method is only available on UNIX platforms.
12309 * This operation can fail if #GCredentials is not supported on the
12310 * OS or if the native credentials type does not contain information
12311 * about the UNIX user.
12313 * Returns: The UNIX user identifier or -1 if @error is set.
12319 * g_credentials_is_same_user:
12320 * @credentials: A #GCredentials.
12321 * @other_credentials: A #GCredentials.
12322 * @error: Return location for error or %NULL.
12324 * Checks if @credentials and @other_credentials is the same user.
12326 * This operation can fail if #GCredentials is not supported on the
12329 * Returns: %TRUE if @credentials and @other_credentials has the same user, %FALSE otherwise or if @error is set.
12335 * g_credentials_new:
12337 * Creates a new #GCredentials object with credentials matching the
12338 * the current process.
12340 * Returns: A #GCredentials. Free with g_object_unref().
12346 * g_credentials_set_native:
12347 * @credentials: A #GCredentials.
12348 * @native_type: The type of native credentials to set.
12349 * @native: A pointer to native credentials.
12351 * Copies the native credentials of type @native_type from @native
12352 * into @credentials.
12354 * It is a programming error (which will cause an warning to be
12355 * logged) to use this method if there is no #GCredentials support for
12356 * the OS or if @native_type isn't supported by the OS.
12363 * g_credentials_set_unix_user:
12364 * @credentials: A #GCredentials.
12365 * @uid: The UNIX user identifier to set.
12366 * @error: Return location for error or %NULL.
12368 * Tries to set the UNIX user identifier on @credentials. This method
12369 * is only available on UNIX platforms.
12371 * This operation can fail if #GCredentials is not supported on the
12372 * OS or if the native credentials type does not contain information
12373 * about the UNIX user.
12375 * Returns: %TRUE if @uid was set, %FALSE if error is set.
12381 * g_credentials_to_string:
12382 * @credentials: A #GCredentials object.
12384 * Creates a human-readable textual representation of @credentials
12385 * that can be used in logging and debug messages. The format of the
12386 * returned string may change in future GLib release.
12388 * Returns: A string that should be freed with g_free().
12394 * g_data_input_stream_get_byte_order:
12395 * @stream: a given #GDataInputStream.
12397 * Gets the byte order for the data input stream.
12399 * Returns: the @stream's current #GDataStreamByteOrder.
12404 * g_data_input_stream_get_newline_type:
12405 * @stream: a given #GDataInputStream.
12407 * Gets the current newline type for the @stream.
12409 * Returns: #GDataStreamNewlineType for the given @stream.
12414 * g_data_input_stream_new:
12415 * @base_stream: a #GInputStream.
12417 * Creates a new data input stream for the @base_stream.
12419 * Returns: a new #GDataInputStream.
12424 * g_data_input_stream_read_byte:
12425 * @stream: a given #GDataInputStream.
12426 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12427 * @error: #GError for error reporting.
12429 * Reads an unsigned 8-bit/1-byte value from @stream.
12431 * Returns: an unsigned 8-bit/1-byte value read from the @stream or %0 if an error occurred.
12436 * g_data_input_stream_read_int16:
12437 * @stream: a given #GDataInputStream.
12438 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12439 * @error: #GError for error reporting.
12441 * Reads a 16-bit/2-byte value from @stream.
12443 * In order to get the correct byte order for this read operation,
12444 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12446 * Returns: a signed 16-bit/2-byte value read from @stream or %0 if an error occurred.
12451 * g_data_input_stream_read_int32:
12452 * @stream: a given #GDataInputStream.
12453 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12454 * @error: #GError for error reporting.
12456 * Reads a signed 32-bit/4-byte value from @stream.
12458 * In order to get the correct byte order for this read operation,
12459 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12461 * If @cancellable is not %NULL, then the operation can be cancelled by
12462 * triggering the cancellable object from another thread. If the operation
12463 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12465 * Returns: a signed 32-bit/4-byte value read from the @stream or %0 if an error occurred.
12470 * g_data_input_stream_read_int64:
12471 * @stream: a given #GDataInputStream.
12472 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12473 * @error: #GError for error reporting.
12475 * Reads a 64-bit/8-byte value from @stream.
12477 * In order to get the correct byte order for this read operation,
12478 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12480 * If @cancellable is not %NULL, then the operation can be cancelled by
12481 * triggering the cancellable object from another thread. If the operation
12482 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12484 * Returns: a signed 64-bit/8-byte value read from @stream or %0 if an error occurred.
12489 * g_data_input_stream_read_line:
12490 * @stream: a given #GDataInputStream.
12491 * @length: (out): a #gsize to get the length of the data read in.
12492 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12493 * @error: #GError for error reporting.
12495 * Reads a line from the data input stream. Note that no encoding
12496 * checks or conversion is performed; the input is not guaranteed to
12497 * be UTF-8, and may in fact have embedded NUL characters.
12499 * If @cancellable is not %NULL, then the operation can be cancelled by
12500 * triggering the cancellable object from another thread. If the operation
12501 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12503 * 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.
12508 * g_data_input_stream_read_line_async:
12509 * @stream: a given #GDataInputStream.
12510 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12511 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12512 * @callback: (scope async): callback to call when the request is satisfied.
12513 * @user_data: (closure): the data to pass to callback function.
12515 * The asynchronous version of g_data_input_stream_read_line(). It is
12516 * an error to have two outstanding calls to this function.
12518 * When the operation is finished, @callback will be called. You
12519 * can then call g_data_input_stream_read_line_finish() to get
12520 * the result of the operation.
12527 * g_data_input_stream_read_line_finish:
12528 * @stream: a given #GDataInputStream.
12529 * @result: the #GAsyncResult that was provided to the callback.
12530 * @length: (out): a #gsize to get the length of the data read in.
12531 * @error: #GError for error reporting.
12533 * Finish an asynchronous call started by
12534 * g_data_input_stream_read_line_async(). Note the warning about
12535 * string encoding in g_data_input_stream_read_line() applies here as
12538 * 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.
12544 * g_data_input_stream_read_line_finish_utf8:
12545 * @stream: a given #GDataInputStream.
12546 * @result: the #GAsyncResult that was provided to the callback.
12547 * @length: (out): a #gsize to get the length of the data read in.
12548 * @error: #GError for error reporting.
12550 * Finish an asynchronous call started by
12551 * g_data_input_stream_read_line_async().
12553 * 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.
12559 * g_data_input_stream_read_line_utf8:
12560 * @stream: a given #GDataInputStream.
12561 * @length: (out): a #gsize to get the length of the data read in.
12562 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12563 * @error: #GError for error reporting.
12565 * Reads a UTF-8 encoded line from the data input stream.
12567 * If @cancellable is not %NULL, then the operation can be cancelled by
12568 * triggering the cancellable object from another thread. If the operation
12569 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12571 * 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.
12577 * g_data_input_stream_read_uint16:
12578 * @stream: a given #GDataInputStream.
12579 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12580 * @error: #GError for error reporting.
12582 * Reads an unsigned 16-bit/2-byte value from @stream.
12584 * In order to get the correct byte order for this read operation,
12585 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12587 * Returns: an unsigned 16-bit/2-byte value read from the @stream or %0 if an error occurred.
12592 * g_data_input_stream_read_uint32:
12593 * @stream: a given #GDataInputStream.
12594 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12595 * @error: #GError for error reporting.
12597 * Reads an unsigned 32-bit/4-byte value from @stream.
12599 * In order to get the correct byte order for this read operation,
12600 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12602 * If @cancellable is not %NULL, then the operation can be cancelled by
12603 * triggering the cancellable object from another thread. If the operation
12604 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12606 * Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred.
12611 * g_data_input_stream_read_uint64:
12612 * @stream: a given #GDataInputStream.
12613 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12614 * @error: #GError for error reporting.
12616 * Reads an unsigned 64-bit/8-byte value from @stream.
12618 * In order to get the correct byte order for this read operation,
12619 * see g_data_input_stream_get_byte_order().
12621 * If @cancellable is not %NULL, then the operation can be cancelled by
12622 * triggering the cancellable object from another thread. If the operation
12623 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12625 * Returns: an unsigned 64-bit/8-byte read from @stream or %0 if an error occurred.
12630 * g_data_input_stream_read_until:
12631 * @stream: a given #GDataInputStream.
12632 * @stop_chars: characters to terminate the read.
12633 * @length: (out): a #gsize to get the length of the data read in.
12634 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12635 * @error: #GError for error reporting.
12637 * Reads a string from the data input stream, up to the first
12638 * occurrence of any of the stop characters.
12640 * Note that, in contrast to g_data_input_stream_read_until_async(),
12641 * this function consumes the stop character that it finds.
12643 * Don't use this function in new code. Its functionality is
12644 * inconsistent with g_data_input_stream_read_until_async(). Both
12645 * functions will be marked as deprecated in a future release. Use
12646 * g_data_input_stream_read_upto() instead, but note that that function
12647 * does not consume the stop character.
12649 * 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.
12654 * g_data_input_stream_read_until_async:
12655 * @stream: a given #GDataInputStream.
12656 * @stop_chars: characters to terminate the read.
12657 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12658 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12659 * @callback: (scope async): callback to call when the request is satisfied.
12660 * @user_data: (closure): the data to pass to callback function.
12662 * The asynchronous version of g_data_input_stream_read_until().
12663 * It is an error to have two outstanding calls to this function.
12665 * Note that, in contrast to g_data_input_stream_read_until(),
12666 * this function does not consume the stop character that it finds. You
12667 * must read it for yourself.
12669 * When the operation is finished, @callback will be called. You
12670 * can then call g_data_input_stream_read_until_finish() to get
12671 * the result of the operation.
12673 * Don't use this function in new code. Its functionality is
12674 * inconsistent with g_data_input_stream_read_until(). Both functions
12675 * will be marked as deprecated in a future release. Use
12676 * g_data_input_stream_read_upto_async() instead.
12683 * g_data_input_stream_read_until_finish:
12684 * @stream: a given #GDataInputStream.
12685 * @result: the #GAsyncResult that was provided to the callback.
12686 * @length: (out): a #gsize to get the length of the data read in.
12687 * @error: #GError for error reporting.
12689 * Finish an asynchronous call started by
12690 * g_data_input_stream_read_until_async().
12693 * 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.
12698 * g_data_input_stream_read_upto:
12699 * @stream: a #GDataInputStream
12700 * @stop_chars: characters to terminate the read
12701 * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12702 * @length: (out): a #gsize to get the length of the data read in
12703 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12704 * @error: #GError for error reporting
12706 * Reads a string from the data input stream, up to the first
12707 * occurrence of any of the stop characters.
12709 * In contrast to g_data_input_stream_read_until(), this function
12710 * does <emphasis>not</emphasis> consume the stop character. You have
12711 * to use g_data_input_stream_read_byte() to get it before calling
12712 * g_data_input_stream_read_upto() again.
12714 * Note that @stop_chars may contain '\0' if @stop_chars_len is
12717 * 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
12723 * g_data_input_stream_read_upto_async:
12724 * @stream: a #GDataInputStream
12725 * @stop_chars: characters to terminate the read
12726 * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12727 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12728 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12729 * @callback: (scope async): callback to call when the request is satisfied
12730 * @user_data: (closure): the data to pass to callback function
12732 * The asynchronous version of g_data_input_stream_read_upto().
12733 * It is an error to have two outstanding calls to this function.
12735 * In contrast to g_data_input_stream_read_until(), this function
12736 * does <emphasis>not</emphasis> consume the stop character. You have
12737 * to use g_data_input_stream_read_byte() to get it before calling
12738 * g_data_input_stream_read_upto() again.
12740 * Note that @stop_chars may contain '\0' if @stop_chars_len is
12743 * When the operation is finished, @callback will be called. You
12744 * can then call g_data_input_stream_read_upto_finish() to get
12745 * the result of the operation.
12752 * g_data_input_stream_read_upto_finish:
12753 * @stream: a #GDataInputStream
12754 * @result: the #GAsyncResult that was provided to the callback
12755 * @length: (out): a #gsize to get the length of the data read in
12756 * @error: #GError for error reporting
12758 * Finish an asynchronous call started by
12759 * g_data_input_stream_read_upto_async().
12761 * Note that this function does <emphasis>not</emphasis> consume the
12762 * stop character. You have to use g_data_input_stream_read_byte() to
12763 * get it before calling g_data_input_stream_read_upto_async() again.
12765 * 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.
12771 * g_data_input_stream_set_byte_order:
12772 * @stream: a given #GDataInputStream.
12773 * @order: a #GDataStreamByteOrder to set.
12775 * This function sets the byte order for the given @stream. All subsequent
12776 * reads from the @stream will be read in the given @order.
12781 * g_data_input_stream_set_newline_type:
12782 * @stream: a #GDataInputStream.
12783 * @type: the type of new line return as #GDataStreamNewlineType.
12785 * Sets the newline type for the @stream.
12787 * Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
12788 * chunk ends in "CR" we must read an additional byte to know if this is "CR" or
12789 * "CR LF", and this might block if there is no more data available.
12794 * g_data_output_stream_get_byte_order:
12795 * @stream: a #GDataOutputStream.
12797 * Gets the byte order for the stream.
12799 * Returns: the #GDataStreamByteOrder for the @stream.
12804 * g_data_output_stream_new:
12805 * @base_stream: a #GOutputStream.
12807 * Creates a new data output stream for @base_stream.
12809 * Returns: #GDataOutputStream.
12814 * g_data_output_stream_put_byte:
12815 * @stream: a #GDataOutputStream.
12816 * @data: a #guchar.
12817 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12818 * @error: a #GError, %NULL to ignore.
12820 * Puts a byte into the output stream.
12822 * Returns: %TRUE if @data was successfully added to the @stream.
12827 * g_data_output_stream_put_int16:
12828 * @stream: a #GDataOutputStream.
12829 * @data: a #gint16.
12830 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12831 * @error: a #GError, %NULL to ignore.
12833 * Puts a signed 16-bit integer into the output stream.
12835 * Returns: %TRUE if @data was successfully added to the @stream.
12840 * g_data_output_stream_put_int32:
12841 * @stream: a #GDataOutputStream.
12842 * @data: a #gint32.
12843 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12844 * @error: a #GError, %NULL to ignore.
12846 * Puts a signed 32-bit integer into the output stream.
12848 * Returns: %TRUE if @data was successfully added to the @stream.
12853 * g_data_output_stream_put_int64:
12854 * @stream: a #GDataOutputStream.
12855 * @data: a #gint64.
12856 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12857 * @error: a #GError, %NULL to ignore.
12859 * Puts a signed 64-bit integer into the stream.
12861 * Returns: %TRUE if @data was successfully added to the @stream.
12866 * g_data_output_stream_put_string:
12867 * @stream: a #GDataOutputStream.
12869 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12870 * @error: a #GError, %NULL to ignore.
12872 * Puts a string into the output stream.
12874 * Returns: %TRUE if @string was successfully added to the @stream.
12879 * g_data_output_stream_put_uint16:
12880 * @stream: a #GDataOutputStream.
12881 * @data: a #guint16.
12882 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12883 * @error: a #GError, %NULL to ignore.
12885 * Puts an unsigned 16-bit integer into the output stream.
12887 * Returns: %TRUE if @data was successfully added to the @stream.
12892 * g_data_output_stream_put_uint32:
12893 * @stream: a #GDataOutputStream.
12894 * @data: a #guint32.
12895 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12896 * @error: a #GError, %NULL to ignore.
12898 * Puts an unsigned 32-bit integer into the stream.
12900 * Returns: %TRUE if @data was successfully added to the @stream.
12905 * g_data_output_stream_put_uint64:
12906 * @stream: a #GDataOutputStream.
12907 * @data: a #guint64.
12908 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12909 * @error: a #GError, %NULL to ignore.
12911 * Puts an unsigned 64-bit integer into the stream.
12913 * Returns: %TRUE if @data was successfully added to the @stream.
12918 * g_data_output_stream_set_byte_order:
12919 * @stream: a #GDataOutputStream.
12920 * @order: a %GDataStreamByteOrder.
12922 * Sets the byte order of the data output stream to @order.
12927 * g_dbus_action_group_get:
12928 * @connection: A #GDBusConnection
12929 * @bus_name: the bus name which exports the action group
12930 * @object_path: the object path at which the action group is exported
12932 * Obtains a #GDBusActionGroup for the action group which is exported at
12933 * the given @bus_name and @object_path.
12935 * The thread default main context is taken at the time of this call.
12936 * All signals on the menu model (and any linked models) are reported
12937 * with respect to this context. All calls on the returned menu model
12938 * (and linked models) must also originate from this same context, with
12939 * the thread default main context unchanged.
12941 * This call is non-blocking. The returned action group may or may not
12942 * already be filled in. The correct thing to do is connect the signals
12943 * for the action group to monitor for changes and then to call
12944 * g_action_group_list_actions() to get the initial list.
12946 * Returns: (transfer full): a #GDBusActionGroup
12952 * g_dbus_address_get_for_bus_sync:
12953 * @bus_type: A #GBusType.
12954 * @cancellable: (allow-none): A #GCancellable or %NULL.
12955 * @error: Return location for error or %NULL.
12957 * Synchronously looks up the D-Bus address for the well-known message
12958 * bus instance specified by @bus_type. This may involve using various
12959 * platform specific mechanisms.
12961 * Returns: A valid D-Bus address string for @bus_type or %NULL if @error is set.
12967 * g_dbus_address_get_stream:
12968 * @address: A valid D-Bus address.
12969 * @cancellable: (allow-none): A #GCancellable or %NULL.
12970 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12971 * @user_data: Data to pass to @callback.
12973 * Asynchronously connects to an endpoint specified by @address and
12974 * sets up the connection so it is in a state to run the client-side
12975 * of the D-Bus authentication conversation.
12977 * When the operation is finished, @callback will be invoked. You can
12978 * then call g_dbus_address_get_stream_finish() to get the result of
12981 * This is an asynchronous failable function. See
12982 * g_dbus_address_get_stream_sync() for the synchronous version.
12989 * g_dbus_address_get_stream_finish:
12990 * @res: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
12991 * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12992 * @error: Return location for error or %NULL.
12994 * Finishes an operation started with g_dbus_address_get_stream().
12996 * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
13002 * g_dbus_address_get_stream_sync:
13003 * @address: A valid D-Bus address.
13004 * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
13005 * @cancellable: (allow-none): A #GCancellable or %NULL.
13006 * @error: Return location for error or %NULL.
13008 * Synchronously connects to an endpoint specified by @address and
13009 * sets up the connection so it is in a state to run the client-side
13010 * of the D-Bus authentication conversation.
13012 * This is a synchronous failable function. See
13013 * g_dbus_address_get_stream() for the asynchronous version.
13015 * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
13021 * g_dbus_annotation_info_lookup:
13022 * @annotations: (array zero-terminated=1) (allow-none): A %NULL-terminated array of annotations or %NULL.
13023 * @name: The name of the annotation to look up.
13025 * Looks up the value of an annotation.
13027 * The cost of this function is O(n) in number of annotations.
13029 * Returns: The value or %NULL if not found. Do not free, it is owned by @annotations.
13035 * g_dbus_annotation_info_ref:
13036 * @info: A #GDBusNodeInfo
13038 * If @info is statically allocated does nothing. Otherwise increases
13039 * the reference count.
13041 * Returns: The same @info.
13047 * g_dbus_annotation_info_unref:
13048 * @info: A #GDBusAnnotationInfo.
13050 * If @info is statically allocated, does nothing. Otherwise decreases
13051 * the reference count of @info. When its reference count drops to 0,
13052 * the memory used is freed.
13059 * g_dbus_arg_info_ref:
13060 * @info: A #GDBusArgInfo
13062 * If @info is statically allocated does nothing. Otherwise increases
13063 * the reference count.
13065 * Returns: The same @info.
13071 * g_dbus_arg_info_unref:
13072 * @info: A #GDBusArgInfo.
13074 * If @info is statically allocated, does nothing. Otherwise decreases
13075 * the reference count of @info. When its reference count drops to 0,
13076 * the memory used is freed.
13083 * g_dbus_auth_observer_allow_mechanism:
13084 * @observer: A #GDBusAuthObserver.
13085 * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
13087 * Emits the #GDBusAuthObserver::allow-mechanism signal on @observer.
13089 * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
13095 * g_dbus_auth_observer_authorize_authenticated_peer:
13096 * @observer: A #GDBusAuthObserver.
13097 * @stream: A #GIOStream for the #GDBusConnection.
13098 * @credentials: (allow-none): Credentials received from the peer or %NULL.
13100 * Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
13102 * Returns: %TRUE if the peer is authorized, %FALSE if not.
13108 * g_dbus_auth_observer_new:
13110 * Creates a new #GDBusAuthObserver object.
13112 * Returns: A #GDBusAuthObserver. Free with g_object_unref().
13118 * g_dbus_connection_add_filter:
13119 * @connection: A #GDBusConnection.
13120 * @filter_function: A filter function.
13121 * @user_data: User data to pass to @filter_function.
13122 * @user_data_free_func: Function to free @user_data with when filter is removed or %NULL.
13124 * Adds a message filter. Filters are handlers that are run on all
13125 * incoming and outgoing messages, prior to standard dispatch. Filters
13126 * are run in the order that they were added. The same handler can be
13127 * added as a filter more than once, in which case it will be run more
13128 * than once. Filters added during a filter callback won't be run on
13129 * the message being processed. Filter functions are allowed to modify
13130 * and even drop messages.
13132 * Note that filters are run in a dedicated message handling thread so
13133 * they can't block and, generally, can't do anything but signal a
13134 * worker thread. Also note that filters are rarely needed - use API
13135 * such as g_dbus_connection_send_message_with_reply(),
13136 * g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
13138 * If a filter consumes an incoming message the message is not
13139 * dispatched anywhere else - not even the standard dispatch machinery
13140 * (that API such as g_dbus_connection_signal_subscribe() and
13141 * g_dbus_connection_send_message_with_reply() relies on) will see the
13142 * message. Similary, if a filter consumes an outgoing message, the
13143 * message will not be sent to the other peer.
13145 * Returns: A filter identifier that can be used with g_dbus_connection_remove_filter().
13151 * g_dbus_connection_call:
13152 * @connection: A #GDBusConnection.
13153 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
13154 * @object_path: Path of remote object.
13155 * @interface_name: D-Bus interface to invoke method on.
13156 * @method_name: The name of the method to invoke.
13157 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
13158 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
13159 * @flags: Flags from the #GDBusCallFlags enumeration.
13160 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13161 * @cancellable: (allow-none): A #GCancellable or %NULL.
13162 * @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.
13163 * @user_data: The data to pass to @callback.
13165 * Asynchronously invokes the @method_name method on the
13166 * @interface_name D-Bus interface on the remote object at
13167 * @object_path owned by @bus_name.
13169 * If @connection is closed then the operation will fail with
13170 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13171 * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
13172 * not compatible with the D-Bus protocol, the operation fails with
13173 * %G_IO_ERROR_INVALID_ARGUMENT.
13175 * If @reply_type is non-%NULL then the reply will be checked for having this type and an
13176 * error will be raised if it does not match. Said another way, if you give a @reply_type
13177 * then any non-%NULL return value will be of this type.
13179 * If the @parameters #GVariant is floating, it is consumed. This allows
13180 * convenient 'inline' use of g_variant_new(), e.g.:
13182 * g_dbus_connection_call (connection,
13183 * "org.freedesktop.StringThings",
13184 * "/org/freedesktop/StringThings",
13185 * "org.freedesktop.StringThings",
13187 * g_variant_new ("(ss)",
13191 * G_DBUS_CALL_FLAGS_NONE,
13194 * (GAsyncReadyCallback) two_strings_done,
13198 * This is an asynchronous method. When the operation is finished, @callback will be invoked
13199 * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13200 * of the thread you are calling this method from. You can then call
13201 * g_dbus_connection_call_finish() to get the result of the operation.
13202 * See g_dbus_connection_call_sync() for the synchronous version of this
13205 * If @callback is %NULL then the D-Bus method call message will be sent with
13206 * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
13213 * g_dbus_connection_call_finish:
13214 * @connection: A #GDBusConnection.
13215 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
13216 * @error: Return location for error or %NULL.
13218 * Finishes an operation started with g_dbus_connection_call().
13220 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
13226 * g_dbus_connection_call_sync:
13227 * @connection: A #GDBusConnection.
13228 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
13229 * @object_path: Path of remote object.
13230 * @interface_name: D-Bus interface to invoke method on.
13231 * @method_name: The name of the method to invoke.
13232 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
13233 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
13234 * @flags: Flags from the #GDBusCallFlags enumeration.
13235 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13236 * @cancellable: (allow-none): A #GCancellable or %NULL.
13237 * @error: Return location for error or %NULL.
13239 * Synchronously invokes the @method_name method on the
13240 * @interface_name D-Bus interface on the remote object at
13241 * @object_path owned by @bus_name.
13243 * If @connection is closed then the operation will fail with
13244 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
13245 * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
13246 * contains a value not compatible with the D-Bus protocol, the operation
13247 * fails with %G_IO_ERROR_INVALID_ARGUMENT.
13249 * If @reply_type is non-%NULL then the reply will be checked for having
13250 * this type and an error will be raised if it does not match. Said
13251 * another way, if you give a @reply_type then any non-%NULL return
13252 * value will be of this type.
13254 * If the @parameters #GVariant is floating, it is consumed.
13255 * This allows convenient 'inline' use of g_variant_new(), e.g.:
13257 * g_dbus_connection_call_sync (connection,
13258 * "org.freedesktop.StringThings",
13259 * "/org/freedesktop/StringThings",
13260 * "org.freedesktop.StringThings",
13262 * g_variant_new ("(ss)",
13266 * G_DBUS_CALL_FLAGS_NONE,
13272 * The calling thread is blocked until a reply is received. See
13273 * g_dbus_connection_call() for the asynchronous version of
13276 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
13282 * g_dbus_connection_call_with_unix_fd_list:
13283 * @connection: A #GDBusConnection.
13284 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
13285 * @object_path: Path of remote object.
13286 * @interface_name: D-Bus interface to invoke method on.
13287 * @method_name: The name of the method to invoke.
13288 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
13289 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
13290 * @flags: Flags from the #GDBusCallFlags enumeration.
13291 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13292 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
13293 * @cancellable: (allow-none): A #GCancellable or %NULL.
13294 * @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.
13295 * @user_data: The data to pass to @callback.
13297 * Like g_dbus_connection_call() but also takes a #GUnixFDList object.
13299 * This method is only available on UNIX.
13306 * g_dbus_connection_call_with_unix_fd_list_finish:
13307 * @connection: A #GDBusConnection.
13308 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
13309 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
13310 * @error: Return location for error or %NULL.
13312 * Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
13314 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
13320 * g_dbus_connection_call_with_unix_fd_list_sync:
13321 * @connection: A #GDBusConnection.
13322 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
13323 * @object_path: Path of remote object.
13324 * @interface_name: D-Bus interface to invoke method on.
13325 * @method_name: The name of the method to invoke.
13326 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
13327 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
13328 * @flags: Flags from the #GDBusCallFlags enumeration.
13329 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13330 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
13331 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
13332 * @cancellable: (allow-none): A #GCancellable or %NULL.
13333 * @error: Return location for error or %NULL.
13335 * Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
13337 * This method is only available on UNIX.
13339 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
13345 * g_dbus_connection_close:
13346 * @connection: A #GDBusConnection.
13347 * @cancellable: (allow-none): A #GCancellable or %NULL.
13348 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13349 * @user_data: The data to pass to @callback.
13351 * Closes @connection. Note that this never causes the process to
13352 * exit (this might only happen if the other end of a shared message
13353 * bus connection disconnects, see #GDBusConnection:exit-on-close).
13355 * Once the connection is closed, operations such as sending a message
13356 * will return with the error %G_IO_ERROR_CLOSED. Closing a connection
13357 * will not automatically flush the connection so queued messages may
13358 * be lost. Use g_dbus_connection_flush() if you need such guarantees.
13360 * If @connection is already closed, this method fails with
13361 * %G_IO_ERROR_CLOSED.
13363 * When @connection has been closed, the #GDBusConnection::closed
13364 * signal is emitted in the <link
13365 * linkend="g-main-context-push-thread-default">thread-default main
13366 * loop</link> of the thread that @connection was constructed in.
13368 * This is an asynchronous method. When the operation is finished,
13369 * @callback will be invoked in the <link
13370 * linkend="g-main-context-push-thread-default">thread-default main
13371 * loop</link> of the thread you are calling this method from. You can
13372 * then call g_dbus_connection_close_finish() to get the result of the
13373 * operation. See g_dbus_connection_close_sync() for the synchronous
13381 * g_dbus_connection_close_finish:
13382 * @connection: A #GDBusConnection.
13383 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
13384 * @error: Return location for error or %NULL.
13386 * Finishes an operation started with g_dbus_connection_close().
13388 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
13394 * g_dbus_connection_close_sync:
13395 * @connection: A #GDBusConnection.
13396 * @cancellable: (allow-none): A #GCancellable or %NULL.
13397 * @error: Return location for error or %NULL.
13399 * Synchronously closees @connection. The calling thread is blocked
13400 * until this is done. See g_dbus_connection_close() for the
13401 * asynchronous version of this method and more details about what it
13404 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
13410 * g_dbus_connection_emit_signal:
13411 * @connection: A #GDBusConnection.
13412 * @destination_bus_name: (allow-none): The unique bus name for the destination for the signal or %NULL to emit to all listeners.
13413 * @object_path: Path of remote object.
13414 * @interface_name: D-Bus interface to emit a signal on.
13415 * @signal_name: The name of the signal to emit.
13416 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
13417 * @error: Return location for error or %NULL.
13421 * If the parameters GVariant is floating, it is consumed.
13423 * This can only fail if @parameters is not compatible with the D-Bus protocol.
13425 * Returns: %TRUE unless @error is set.
13431 * g_dbus_connection_export_action_group:
13432 * @connection: a #GDBusConnection
13433 * @object_path: a D-Bus object path
13434 * @action_group: a #GActionGroup
13435 * @error: a pointer to a %NULL #GError, or %NULL
13437 * Exports @action_group on @connection at @object_path.
13439 * The implemented D-Bus API should be considered private. It is
13440 * subject to change in the future.
13442 * A given object path can only have one action group exported on it.
13443 * If this constraint is violated, the export will fail and 0 will be
13444 * returned (with @error set accordingly).
13446 * You can unexport the action group using
13447 * g_dbus_connection_unexport_action_group() with the return value of
13450 * The thread default main context is taken at the time of this call.
13451 * All incoming action activations and state change requests are
13452 * reported from this context. Any changes on the action group that
13453 * cause it to emit signals must also come from this same context.
13454 * Since incoming action activations and state change requests are
13455 * rather likely to cause changes on the action group, this effectively
13456 * limits a given action group to being exported from only one main
13459 * Returns: the ID of the export (never zero), or 0 in case of failure
13465 * g_dbus_connection_export_menu_model:
13466 * @connection: a #GDBusConnection
13467 * @object_path: a D-Bus object path
13468 * @menu: a #GMenuModel
13469 * @error: return location for an error, or %NULL
13471 * Exports @menu on @connection at @object_path.
13473 * The implemented D-Bus API should be considered private.
13474 * It is subject to change in the future.
13476 * An object path can only have one action group exported on it. If this
13477 * constraint is violated, the export will fail and 0 will be
13478 * returned (with @error set accordingly).
13480 * You can unexport the menu model using
13481 * g_dbus_connection_unexport_menu_model() with the return value of
13484 * Returns: the ID of the export (never zero), or 0 in case of failure
13490 * g_dbus_connection_flush:
13491 * @connection: A #GDBusConnection.
13492 * @cancellable: (allow-none): A #GCancellable or %NULL.
13493 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13494 * @user_data: The data to pass to @callback.
13496 * Asynchronously flushes @connection, that is, writes all queued
13497 * outgoing message to the transport and then flushes the transport
13498 * (using g_output_stream_flush_async()). This is useful in programs
13499 * that wants to emit a D-Bus signal and then exit
13500 * immediately. Without flushing the connection, there is no guarantee
13501 * that the message has been sent to the networking buffers in the OS
13504 * This is an asynchronous method. When the operation is finished,
13505 * @callback will be invoked in the <link
13506 * linkend="g-main-context-push-thread-default">thread-default main
13507 * loop</link> of the thread you are calling this method from. You can
13508 * then call g_dbus_connection_flush_finish() to get the result of the
13509 * operation. See g_dbus_connection_flush_sync() for the synchronous
13517 * g_dbus_connection_flush_finish:
13518 * @connection: A #GDBusConnection.
13519 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
13520 * @error: Return location for error or %NULL.
13522 * Finishes an operation started with g_dbus_connection_flush().
13524 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
13530 * g_dbus_connection_flush_sync:
13531 * @connection: A #GDBusConnection.
13532 * @cancellable: (allow-none): A #GCancellable or %NULL.
13533 * @error: Return location for error or %NULL.
13535 * Synchronously flushes @connection. The calling thread is blocked
13536 * until this is done. See g_dbus_connection_flush() for the
13537 * asynchronous version of this method and more details about what it
13540 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
13546 * g_dbus_connection_get_capabilities:
13547 * @connection: A #GDBusConnection.
13549 * Gets the capabilities negotiated with the remote peer
13551 * Returns: Zero or more flags from the #GDBusCapabilityFlags enumeration.
13557 * g_dbus_connection_get_exit_on_close:
13558 * @connection: A #GDBusConnection.
13560 * Gets whether the process is terminated when @connection is
13561 * closed by the remote peer. See
13562 * #GDBusConnection:exit-on-close for more details.
13564 * Returns: Whether the process is terminated when @connection is closed by the remote peer.
13570 * g_dbus_connection_get_guid:
13571 * @connection: A #GDBusConnection.
13573 * The GUID of the peer performing the role of server when
13574 * authenticating. See #GDBusConnection:guid for more details.
13576 * Returns: The GUID. Do not free this string, it is owned by @connection.
13582 * g_dbus_connection_get_last_serial:
13583 * @connection: A #GDBusConnection.
13585 * Retrieves the last serial number assigned to a #GDBusMessage on
13586 * the current thread. This includes messages sent via both low-level
13587 * API such as g_dbus_connection_send_message() as well as
13588 * high-level API such as g_dbus_connection_emit_signal(),
13589 * g_dbus_connection_call() or g_dbus_proxy_call().
13591 * Returns: the last used serial or zero when no message has been sent within the current thread.
13597 * g_dbus_connection_get_peer_credentials:
13598 * @connection: A #GDBusConnection.
13600 * Gets the credentials of the authenticated peer. This will always
13601 * return %NULL unless @connection acted as a server
13602 * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
13603 * when set up and the client passed credentials as part of the
13604 * authentication process.
13606 * In a message bus setup, the message bus is always the server and
13607 * each application is a client. So this method will always return
13608 * %NULL for message bus clients.
13610 * Returns: (transfer none): A #GCredentials or %NULL if not available. Do not free this object, it is owned by @connection.
13616 * g_dbus_connection_get_stream:
13617 * @connection: a #GDBusConnection
13619 * Gets the underlying stream used for IO.
13621 * While the #GDBusConnection is active, it will interact with this
13622 * stream from a worker thread, so it is not safe to interact with
13623 * the stream directly.
13625 * Returns: (transfer none): the stream used for IO
13631 * g_dbus_connection_get_unique_name:
13632 * @connection: A #GDBusConnection.
13634 * Gets the unique name of @connection as assigned by the message
13635 * bus. This can also be used to figure out if @connection is a
13636 * message bus connection.
13638 * Returns: The unique name or %NULL if @connection is not a message bus connection. Do not free this string, it is owned by @connection.
13644 * g_dbus_connection_is_closed:
13645 * @connection: A #GDBusConnection.
13647 * Gets whether @connection is closed.
13649 * Returns: %TRUE if the connection is closed, %FALSE otherwise.
13655 * g_dbus_connection_new:
13656 * @stream: A #GIOStream.
13657 * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13658 * @flags: Flags describing how to make the connection.
13659 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13660 * @cancellable: (allow-none): A #GCancellable or %NULL.
13661 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13662 * @user_data: The data to pass to @callback.
13664 * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
13665 * with the end represented by @stream.
13667 * If @stream is a #GSocketConnection, then the corresponding #GSocket
13668 * will be put into non-blocking mode.
13670 * The D-Bus connection will interact with @stream from a worker thread.
13671 * As a result, the caller should not interact with @stream after this
13672 * method has been called, except by calling g_object_unref() on it.
13674 * If @observer is not %NULL it may be used to control the
13675 * authentication process.
13677 * When the operation is finished, @callback will be invoked. You can
13678 * then call g_dbus_connection_new_finish() to get the result of the
13681 * This is a asynchronous failable constructor. See
13682 * g_dbus_connection_new_sync() for the synchronous
13690 * g_dbus_connection_new_finish:
13691 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13692 * @error: Return location for error or %NULL.
13694 * Finishes an operation started with g_dbus_connection_new().
13696 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13702 * g_dbus_connection_new_for_address:
13703 * @address: A D-Bus address.
13704 * @flags: Flags describing how to make the connection.
13705 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13706 * @cancellable: (allow-none): A #GCancellable or %NULL.
13707 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13708 * @user_data: The data to pass to @callback.
13710 * Asynchronously connects and sets up a D-Bus client connection for
13711 * exchanging D-Bus messages with an endpoint specified by @address
13712 * which must be in the D-Bus address format.
13714 * This constructor can only be used to initiate client-side
13715 * connections - use g_dbus_connection_new() if you need to act as the
13716 * server. In particular, @flags cannot contain the
13717 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13718 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13720 * When the operation is finished, @callback will be invoked. You can
13721 * then call g_dbus_connection_new_finish() to get the result of the
13724 * If @observer is not %NULL it may be used to control the
13725 * authentication process.
13727 * This is a asynchronous failable constructor. See
13728 * g_dbus_connection_new_for_address_sync() for the synchronous
13736 * g_dbus_connection_new_for_address_finish:
13737 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13738 * @error: Return location for error or %NULL.
13740 * Finishes an operation started with g_dbus_connection_new_for_address().
13742 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13748 * g_dbus_connection_new_for_address_sync:
13749 * @address: A D-Bus address.
13750 * @flags: Flags describing how to make the connection.
13751 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13752 * @cancellable: (allow-none): A #GCancellable or %NULL.
13753 * @error: Return location for error or %NULL.
13755 * Synchronously connects and sets up a D-Bus client connection for
13756 * exchanging D-Bus messages with an endpoint specified by @address
13757 * which must be in the D-Bus address format.
13759 * This constructor can only be used to initiate client-side
13760 * connections - use g_dbus_connection_new_sync() if you need to act
13761 * as the server. In particular, @flags cannot contain the
13762 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13763 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13765 * This is a synchronous failable constructor. See
13766 * g_dbus_connection_new_for_address() for the asynchronous version.
13768 * If @observer is not %NULL it may be used to control the
13769 * authentication process.
13771 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13777 * g_dbus_connection_new_sync:
13778 * @stream: A #GIOStream.
13779 * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13780 * @flags: Flags describing how to make the connection.
13781 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13782 * @cancellable: (allow-none): A #GCancellable or %NULL.
13783 * @error: Return location for error or %NULL.
13785 * Synchronously sets up a D-Bus connection for exchanging D-Bus messages
13786 * with the end represented by @stream.
13788 * If @stream is a #GSocketConnection, then the corresponding #GSocket
13789 * will be put into non-blocking mode.
13791 * The D-Bus connection will interact with @stream from a worker thread.
13792 * As a result, the caller should not interact with @stream after this
13793 * method has been called, except by calling g_object_unref() on it.
13795 * If @observer is not %NULL it may be used to control the
13796 * authentication process.
13798 * This is a synchronous failable constructor. See
13799 * g_dbus_connection_new() for the asynchronous version.
13801 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13807 * g_dbus_connection_register_object:
13808 * @connection: A #GDBusConnection.
13809 * @object_path: The object path to register at.
13810 * @interface_info: Introspection data for the interface.
13811 * @vtable: (allow-none): A #GDBusInterfaceVTable to call into or %NULL.
13812 * @user_data: (allow-none): Data to pass to functions in @vtable.
13813 * @user_data_free_func: Function to call when the object path is unregistered.
13814 * @error: Return location for error or %NULL.
13816 * Registers callbacks for exported objects at @object_path with the
13817 * D-Bus interface that is described in @interface_info.
13819 * Calls to functions in @vtable (and @user_data_free_func) will
13820 * happen in the <link linkend="g-main-context-push-thread-default">thread-default main
13821 * loop</link> of the thread you are calling this method from.
13823 * Note that all #GVariant values passed to functions in @vtable will match
13824 * the signature given in @interface_info - if a remote caller passes
13825 * incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
13826 * is returned to the remote caller.
13828 * Additionally, if the remote caller attempts to invoke methods or
13829 * access properties not mentioned in @interface_info the
13830 * <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
13831 * <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
13832 * are returned to the caller.
13834 * It is considered a programming error if the
13835 * #GDBusInterfaceGetPropertyFunc function in @vtable returns a
13836 * #GVariant of incorrect type.
13838 * If an existing callback is already registered at @object_path and
13839 * @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
13841 * GDBus automatically implements the standard D-Bus interfaces
13842 * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
13843 * and org.freedesktop.Peer, so you don't have to implement those for
13844 * the objects you export. You <emphasis>can</emphasis> implement
13845 * org.freedesktop.DBus.Properties yourself, e.g. to handle getting
13846 * and setting of properties asynchronously.
13848 * Note that the reference count on @interface_info will be
13849 * incremented by 1 (unless allocated statically, e.g. if the
13850 * reference count is -1, see g_dbus_interface_info_ref()) for as long
13851 * as the object is exported. Also note that @vtable will be copied.
13853 * See <xref linkend="gdbus-server"/> for an example of how to use this method.
13855 * Returns: 0 if @error is set, otherwise a registration id (never 0) that can be used with g_dbus_connection_unregister_object() .
13861 * g_dbus_connection_register_subtree:
13862 * @connection: A #GDBusConnection.
13863 * @object_path: The object path to register the subtree at.
13864 * @vtable: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
13865 * @flags: Flags used to fine tune the behavior of the subtree.
13866 * @user_data: Data to pass to functions in @vtable.
13867 * @user_data_free_func: Function to call when the subtree is unregistered.
13868 * @error: Return location for error or %NULL.
13870 * Registers a whole subtree of <quote>dynamic</quote> objects.
13872 * The @enumerate and @introspection functions in @vtable are used to
13873 * convey, to remote callers, what nodes exist in the subtree rooted
13876 * When handling remote calls into any node in the subtree, first the
13877 * @enumerate function is used to check if the node exists. If the node exists
13878 * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
13879 * the @introspection function is used to check if the node supports the
13880 * requested method. If so, the @dispatch function is used to determine
13881 * where to dispatch the call. The collected #GDBusInterfaceVTable and
13882 * #gpointer will be used to call into the interface vtable for processing
13885 * All calls into user-provided code will be invoked in the <link
13886 * linkend="g-main-context-push-thread-default">thread-default main
13887 * loop</link> of the thread you are calling this method from.
13889 * If an existing subtree is already registered at @object_path or
13890 * then @error is set to #G_IO_ERROR_EXISTS.
13892 * Note that it is valid to register regular objects (using
13893 * g_dbus_connection_register_object()) in a subtree registered with
13894 * g_dbus_connection_register_subtree() - if so, the subtree handler
13895 * is tried as the last resort. One way to think about a subtree
13896 * handler is to consider it a <quote>fallback handler</quote>
13897 * for object paths not registered via g_dbus_connection_register_object()
13898 * or other bindings.
13900 * Note that @vtable will be copied so you cannot change it after
13903 * See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
13905 * Returns: 0 if @error is set, otherwise a subtree registration id (never 0) that can be used with g_dbus_connection_unregister_subtree() .
13911 * g_dbus_connection_remove_filter:
13912 * @connection: a #GDBusConnection
13913 * @filter_id: an identifier obtained from g_dbus_connection_add_filter()
13915 * Removes a filter.
13922 * g_dbus_connection_send_message:
13923 * @connection: A #GDBusConnection.
13924 * @message: A #GDBusMessage
13925 * @flags: Flags affecting how the message is sent.
13926 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13927 * @error: Return location for error or %NULL.
13929 * Asynchronously sends @message to the peer represented by @connection.
13931 * Unless @flags contain the
13932 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13933 * will be assigned by @connection and set on @message via
13934 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13935 * serial number used will be written to this location prior to
13936 * submitting the message to the underlying transport.
13938 * If @connection is closed then the operation will fail with
13939 * %G_IO_ERROR_CLOSED. If @message is not well-formed,
13940 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13942 * See <xref linkend="gdbus-server"/> and <xref
13943 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13944 * low-level API to send and receive UNIX file descriptors.
13946 * Note that @message must be unlocked, unless @flags contain the
13947 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13949 * Returns: %TRUE if the message was well-formed and queued for transmission, %FALSE if @error is set.
13955 * g_dbus_connection_send_message_with_reply:
13956 * @connection: A #GDBusConnection.
13957 * @message: A #GDBusMessage.
13958 * @flags: Flags affecting how the message is sent.
13959 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13960 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13961 * @cancellable: (allow-none): A #GCancellable or %NULL.
13962 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13963 * @user_data: The data to pass to @callback.
13965 * Asynchronously sends @message to the peer represented by @connection.
13967 * Unless @flags contain the
13968 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13969 * will be assigned by @connection and set on @message via
13970 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13971 * serial number used will be written to this location prior to
13972 * submitting the message to the underlying transport.
13974 * If @connection is closed then the operation will fail with
13975 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13976 * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13977 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13979 * This is an asynchronous method. When the operation is finished, @callback will be invoked
13980 * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13981 * of the thread you are calling this method from. You can then call
13982 * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
13983 * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
13985 * Note that @message must be unlocked, unless @flags contain the
13986 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13988 * See <xref linkend="gdbus-server"/> and <xref
13989 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13990 * low-level API to send and receive UNIX file descriptors.
13997 * g_dbus_connection_send_message_with_reply_finish:
13998 * @connection: a #GDBusConnection
13999 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
14000 * @error: Return location for error or %NULL.
14002 * Finishes an operation started with g_dbus_connection_send_message_with_reply().
14004 * Note that @error is only set if a local in-process error
14005 * occurred. That is to say that the returned #GDBusMessage object may
14006 * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
14007 * g_dbus_message_to_gerror() to transcode this to a #GError.
14009 * See <xref linkend="gdbus-server"/> and <xref
14010 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
14011 * low-level API to send and receive UNIX file descriptors.
14013 * Returns: (transfer full): A locked #GDBusMessage or %NULL if @error is set.
14019 * g_dbus_connection_send_message_with_reply_sync:
14020 * @connection: A #GDBusConnection.
14021 * @message: A #GDBusMessage.
14022 * @flags: Flags affecting how the message is sent.
14023 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
14024 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
14025 * @cancellable: (allow-none): A #GCancellable or %NULL.
14026 * @error: Return location for error or %NULL.
14028 * Synchronously sends @message to the peer represented by @connection
14029 * and blocks the calling thread until a reply is received or the
14030 * timeout is reached. See g_dbus_connection_send_message_with_reply()
14031 * for the asynchronous version of this method.
14033 * Unless @flags contain the
14034 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
14035 * will be assigned by @connection and set on @message via
14036 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
14037 * serial number used will be written to this location prior to
14038 * submitting the message to the underlying transport.
14040 * If @connection is closed then the operation will fail with
14041 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
14042 * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
14043 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
14045 * Note that @error is only set if a local in-process error
14046 * occurred. That is to say that the returned #GDBusMessage object may
14047 * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
14048 * g_dbus_message_to_gerror() to transcode this to a #GError.
14050 * See <xref linkend="gdbus-server"/> and <xref
14051 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
14052 * low-level API to send and receive UNIX file descriptors.
14054 * Note that @message must be unlocked, unless @flags contain the
14055 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
14057 * Returns: (transfer full): A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
14063 * g_dbus_connection_set_exit_on_close:
14064 * @connection: A #GDBusConnection.
14065 * @exit_on_close: Whether the process should be terminated when @connection is closed by the remote peer.
14067 * Sets whether the process should be terminated when @connection is
14068 * closed by the remote peer. See #GDBusConnection:exit-on-close for
14071 * Note that this function should be used with care. Most modern UNIX
14072 * desktops tie the notion of a user session the session bus, and expect
14073 * all of a users applications to quit when their bus connection goes away.
14074 * If you are setting @exit_on_close to %FALSE for the shared session
14075 * bus connection, you should make sure that your application exits
14076 * when the user session ends.
14083 * g_dbus_connection_signal_subscribe:
14084 * @connection: A #GDBusConnection.
14085 * @sender: (allow-none): Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
14086 * @interface_name: (allow-none): D-Bus interface name to match on or %NULL to match on all interfaces.
14087 * @member: (allow-none): D-Bus signal name to match on or %NULL to match on all signals.
14088 * @object_path: (allow-none): Object path to match on or %NULL to match on all object paths.
14089 * @arg0: (allow-none): Contents of first string argument to match on or %NULL to match on all kinds of arguments.
14090 * @flags: Flags describing how to subscribe to the signal (currently unused).
14091 * @callback: Callback to invoke when there is a signal matching the requested data.
14092 * @user_data: User data to pass to @callback.
14093 * @user_data_free_func: (allow-none): Function to free @user_data with when subscription is removed or %NULL.
14095 * Subscribes to signals on @connection and invokes @callback with a
14096 * whenever the signal is received. Note that @callback
14097 * will be invoked in the <link
14098 * linkend="g-main-context-push-thread-default">thread-default main
14099 * loop</link> of the thread you are calling this method from.
14101 * If @connection is not a message bus connection, @sender must be
14104 * If @sender is a well-known name note that @callback is invoked with
14105 * the unique name for the owner of @sender, not the well-known name
14106 * as one would expect. This is because the message bus rewrites the
14107 * name. As such, to avoid certain race conditions, users should be
14108 * tracking the name owner of the well-known name and use that when
14109 * processing the received signal.
14111 * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
14117 * g_dbus_connection_signal_unsubscribe:
14118 * @connection: A #GDBusConnection.
14119 * @subscription_id: A subscription id obtained from g_dbus_connection_signal_subscribe().
14121 * Unsubscribes from signals.
14128 * g_dbus_connection_start_message_processing:
14129 * @connection: A #GDBusConnection.
14131 * If @connection was created with
14132 * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
14133 * starts processing messages. Does nothing on if @connection wasn't
14134 * created with this flag or if the method has already been called.
14141 * g_dbus_connection_unexport_action_group:
14142 * @connection: a #GDBusConnection
14143 * @export_id: the ID from g_dbus_connection_export_action_group()
14145 * Reverses the effect of a previous call to
14146 * g_dbus_connection_export_action_group().
14148 * It is an error to call this function with an ID that wasn't returned
14149 * from g_dbus_connection_export_action_group() or to call it with the
14150 * same ID more than once.
14157 * g_dbus_connection_unexport_menu_model:
14158 * @connection: a #GDBusConnection
14159 * @export_id: the ID from g_dbus_connection_export_menu_model()
14161 * Reverses the effect of a previous call to
14162 * g_dbus_connection_export_menu_model().
14164 * It is an error to call this function with an ID that wasn't returned
14165 * from g_dbus_connection_export_menu_model() or to call it with the
14166 * same ID more than once.
14173 * g_dbus_connection_unregister_object:
14174 * @connection: A #GDBusConnection.
14175 * @registration_id: A registration id obtained from g_dbus_connection_register_object().
14177 * Unregisters an object.
14179 * Returns: %TRUE if the object was unregistered, %FALSE otherwise.
14185 * g_dbus_connection_unregister_subtree:
14186 * @connection: A #GDBusConnection.
14187 * @registration_id: A subtree registration id obtained from g_dbus_connection_register_subtree().
14189 * Unregisters a subtree.
14191 * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise.
14197 * g_dbus_error_encode_gerror:
14198 * @error: A #GError.
14200 * Creates a D-Bus error name to use for @error. If @error matches
14201 * a registered error (cf. g_dbus_error_register_error()), the corresponding
14202 * D-Bus error name will be returned.
14204 * Otherwise the a name of the form
14205 * <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
14206 * will be used. This allows other GDBus applications to map the error
14207 * on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
14209 * This function is typically only used in object mappings to put a
14210 * #GError on the wire. Regular applications should not use it.
14212 * Returns: A D-Bus error name (never %NULL). Free with g_free().
14218 * g_dbus_error_get_remote_error:
14219 * @error: A #GError.
14221 * Gets the D-Bus error name used for @error, if any.
14223 * This function is guaranteed to return a D-Bus error name for all
14224 * #GError<!-- -->s returned from functions handling remote method
14225 * calls (e.g. g_dbus_connection_call_finish()) unless
14226 * g_dbus_error_strip_remote_error() has been used on @error.
14228 * Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
14234 * g_dbus_error_is_remote_error:
14235 * @error: A #GError.
14237 * Checks if @error represents an error received via D-Bus from a remote peer. If so,
14238 * use g_dbus_error_get_remote_error() to get the name of the error.
14240 * Returns: %TRUE if @error represents an error from a remote peer, %FALSE otherwise.
14246 * g_dbus_error_new_for_dbus_error:
14247 * @dbus_error_name: D-Bus error name.
14248 * @dbus_error_message: D-Bus error message.
14250 * Creates a #GError based on the contents of @dbus_error_name and
14251 * @dbus_error_message.
14253 * Errors registered with g_dbus_error_register_error() will be looked
14254 * up using @dbus_error_name and if a match is found, the error domain
14255 * and code is used. Applications can use g_dbus_error_get_remote_error()
14256 * to recover @dbus_error_name.
14258 * If a match against a registered error is not found and the D-Bus
14259 * error name is in a form as returned by g_dbus_error_encode_gerror()
14260 * the error domain and code encoded in the name is used to
14261 * create the #GError. Also, @dbus_error_name is added to the error message
14262 * such that it can be recovered with g_dbus_error_get_remote_error().
14264 * Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
14265 * in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
14266 * added to the error message such that it can be recovered with
14267 * g_dbus_error_get_remote_error().
14269 * In all three cases, @dbus_error_name can always be recovered from the
14270 * returned #GError using the g_dbus_error_get_remote_error() function
14271 * (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
14273 * This function is typically only used in object mappings to prepare
14274 * #GError instances for applications. Regular applications should not use
14277 * Returns: An allocated #GError. Free with g_error_free().
14283 * g_dbus_error_register_error:
14284 * @error_domain: A #GQuark for a error domain.
14285 * @error_code: An error code.
14286 * @dbus_error_name: A D-Bus error name.
14288 * Creates an association to map between @dbus_error_name and
14289 * #GError<!-- -->s specified by @error_domain and @error_code.
14291 * This is typically done in the routine that returns the #GQuark for
14294 * Returns: %TRUE if the association was created, %FALSE if it already exists.
14300 * g_dbus_error_register_error_domain:
14301 * @error_domain_quark_name: The error domain name.
14302 * @quark_volatile: A pointer where to store the #GQuark.
14303 * @entries: A pointer to @num_entries #GDBusErrorEntry struct items.
14304 * @num_entries: Number of items to register.
14306 * Helper function for associating a #GError error domain with D-Bus error names.
14313 * g_dbus_error_set_dbus_error:
14314 * @error: A pointer to a #GError or %NULL.
14315 * @dbus_error_name: D-Bus error name.
14316 * @dbus_error_message: D-Bus error message.
14317 * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
14318 * @...: Arguments for @format.
14320 * Does nothing if @error is %NULL. Otherwise sets *@error to
14321 * a new #GError created with g_dbus_error_new_for_dbus_error()
14322 * with @dbus_error_message prepend with @format (unless %NULL).
14329 * g_dbus_error_set_dbus_error_valist:
14330 * @error: A pointer to a #GError or %NULL.
14331 * @dbus_error_name: D-Bus error name.
14332 * @dbus_error_message: D-Bus error message.
14333 * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
14334 * @var_args: Arguments for @format.
14336 * Like g_dbus_error_set_dbus_error() but intended for language bindings.
14343 * g_dbus_error_strip_remote_error:
14344 * @error: A #GError.
14346 * Looks for extra information in the error message used to recover
14347 * the D-Bus error name and strips it if found. If stripped, the
14348 * message field in @error will correspond exactly to what was
14349 * received on the wire.
14351 * This is typically used when presenting errors to the end user.
14353 * Returns: %TRUE if information was stripped, %FALSE otherwise.
14359 * g_dbus_error_unregister_error:
14360 * @error_domain: A #GQuark for a error domain.
14361 * @error_code: An error code.
14362 * @dbus_error_name: A D-Bus error name.
14364 * Destroys an association previously set up with g_dbus_error_register_error().
14366 * Returns: %TRUE if the association was destroyed, %FALSE if it wasn't found.
14372 * g_dbus_generate_guid:
14374 * Generate a D-Bus GUID that can be used with
14375 * e.g. g_dbus_connection_new().
14377 * See the D-Bus specification regarding what strings are valid D-Bus
14378 * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
14380 * Returns: A valid D-Bus GUID. Free with g_free().
14386 * g_dbus_gvalue_to_gvariant:
14387 * @gvalue: A #GValue to convert to a #GVariant.
14388 * @type: A #GVariantType.
14390 * Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
14392 * The conversion is using the following rules:
14393 * <table frame='all'>
14394 * <title>#GValue / #GVariant conversion rules</title>
14395 * <tgroup cols='2' align='left' colsep='1' rowsep='1'>
14398 * <entry>If the #GType for @gvalue is...</entry>
14399 * <entry>... then @type must be</entry>
14404 * <entry>#G_TYPE_STRING</entry>
14405 * <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>
14408 * <entry>#G_TYPE_STRV</entry>
14409 * <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>
14412 * <entry>#G_TYPE_BOOLEAN</entry>
14413 * <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
14416 * <entry>#G_TYPE_UCHAR</entry>
14417 * <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
14420 * <entry>#G_TYPE_INT</entry>
14421 * <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
14424 * <entry>#G_TYPE_UINT</entry>
14425 * <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
14428 * <entry>#G_TYPE_INT64</entry>
14429 * <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
14432 * <entry>#G_TYPE_UINT64</entry>
14433 * <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
14436 * <entry>#G_TYPE_DOUBLE</entry>
14437 * <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
14440 * <entry>#G_TYPE_VARIANT</entry>
14441 * <entry>Any #GVariantType</entry>
14446 * This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
14447 * is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
14448 * also fail for any #GType (including e.g. #G_TYPE_OBJECT and
14449 * #G_TYPE_BOXED derived-types) not in the table above.
14451 * Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
14452 * %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
14453 * %NULL) for @type is returned (e.g. 0 for scalar types, the empty
14454 * string for string types, <literal>'/'</literal> for object path
14455 * types, the empty array for any array type and so on).
14457 * See the g_dbus_gvariant_to_gvalue() function for how to convert a
14458 * #GVariant to a #GValue.
14460 * Returns: A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or %NULL in case of failure. Free with g_variant_unref().
14466 * g_dbus_gvariant_to_gvalue:
14467 * @value: A #GVariant.
14468 * @out_gvalue: (out): Return location pointing to a zero-filled (uninitialized) #GValue.
14470 * Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
14472 * The rules specified in the g_dbus_gvalue_to_gvariant() function are
14473 * used - this function is essentially its reverse form.
14475 * The conversion never fails - a valid #GValue is always returned in
14483 * g_dbus_interface_dup_object:
14484 * @interface_: An exported D-Bus interface.
14486 * Gets the #GDBusObject that @interface_ belongs to, if any.
14488 * Returns: (transfer full): A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
14490 * Rename to: g_dbus_interface_get_object
14495 * g_dbus_interface_get_info:
14496 * @interface_: An exported D-Bus interface.
14498 * Gets D-Bus introspection information for the D-Bus interface
14499 * implemented by @interface_.
14501 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
14507 * g_dbus_interface_get_object: (skip)
14508 * @interface_: An exported D-Bus interface.
14510 * Gets the #GDBusObject that @interface_ belongs to, if any.
14512 * <warning>It is not safe to use the returned object if @interface_
14513 * or the returned object is being used from other threads. See
14514 * g_dbus_interface_dup_object() for a thread-safe
14515 * alternative.</warning>
14517 * Returns: (transfer none): A #GDBusObject or %NULL. The returned reference belongs to @interface_ and should not be freed.
14523 * g_dbus_interface_info_cache_build:
14524 * @info: A #GDBusInterfaceInfo.
14526 * Builds a lookup-cache to speed up
14527 * g_dbus_interface_info_lookup_method(),
14528 * g_dbus_interface_info_lookup_signal() and
14529 * g_dbus_interface_info_lookup_property().
14531 * If this has already been called with @info, the existing cache is
14532 * used and its use count is increased.
14534 * Note that @info cannot be modified until
14535 * g_dbus_interface_info_cache_release() is called.
14542 * g_dbus_interface_info_cache_release:
14543 * @info: A GDBusInterfaceInfo
14545 * Decrements the usage count for the cache for @info built by
14546 * g_dbus_interface_info_cache_build() (if any) and frees the
14547 * resources used by the cache if the usage count drops to zero.
14554 * g_dbus_interface_info_generate_xml:
14555 * @info: A #GDBusNodeInfo
14556 * @indent: Indentation level.
14557 * @string_builder: (out): A #GString to to append XML data to.
14559 * Appends an XML representation of @info (and its children) to @string_builder.
14561 * This function is typically used for generating introspection XML
14562 * documents at run-time for handling the
14563 * <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
14571 * g_dbus_interface_info_lookup_method:
14572 * @info: A #GDBusInterfaceInfo.
14573 * @name: A D-Bus method name (typically in CamelCase)
14575 * Looks up information about a method.
14577 * The cost of this function is O(n) in number of methods unless
14578 * g_dbus_interface_info_cache_build() has been used on @info.
14580 * Returns: (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
14586 * g_dbus_interface_info_lookup_property:
14587 * @info: A #GDBusInterfaceInfo.
14588 * @name: A D-Bus property name (typically in CamelCase).
14590 * Looks up information about a property.
14592 * The cost of this function is O(n) in number of properties unless
14593 * g_dbus_interface_info_cache_build() has been used on @info.
14595 * Returns: (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
14601 * g_dbus_interface_info_lookup_signal:
14602 * @info: A #GDBusInterfaceInfo.
14603 * @name: A D-Bus signal name (typically in CamelCase)
14605 * Looks up information about a signal.
14607 * The cost of this function is O(n) in number of signals unless
14608 * g_dbus_interface_info_cache_build() has been used on @info.
14610 * Returns: (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
14616 * g_dbus_interface_info_ref:
14617 * @info: A #GDBusInterfaceInfo
14619 * If @info is statically allocated does nothing. Otherwise increases
14620 * the reference count.
14622 * Returns: The same @info.
14628 * g_dbus_interface_info_unref:
14629 * @info: A #GDBusInterfaceInfo.
14631 * If @info is statically allocated, does nothing. Otherwise decreases
14632 * the reference count of @info. When its reference count drops to 0,
14633 * the memory used is freed.
14640 * g_dbus_interface_set_object:
14641 * @interface_: An exported D-Bus interface.
14642 * @object: (allow-none): A #GDBusObject or %NULL.
14644 * Sets the #GDBusObject for @interface_ to @object.
14646 * Note that @interface_ will hold a weak reference to @object.
14653 * g_dbus_interface_skeleton_export:
14654 * @interface_: The D-Bus interface to export.
14655 * @connection: A #GDBusConnection to export @interface_ on.
14656 * @object_path: The path to export the interface at.
14657 * @error: Return location for error or %NULL.
14659 * Exports @interface_ at @object_path on @connection.
14661 * This can be called multiple times to export the same @interface_
14662 * onto multiple connections however the @object_path provided must be
14663 * the same for all connections.
14665 * Use g_dbus_interface_skeleton_unexport() to unexport the object.
14667 * Returns: %TRUE if the interface was exported on @connection, otherwise %FALSE with @error set.
14673 * g_dbus_interface_skeleton_flush:
14674 * @interface_: A #GDBusInterfaceSkeleton.
14676 * If @interface_ has outstanding changes, request for these changes to be
14677 * emitted immediately.
14679 * For example, an exported D-Bus interface may queue up property
14680 * changes and emit the
14681 * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
14682 * signal later (e.g. in an idle handler). This technique is useful
14683 * for collapsing multiple property changes into one.
14690 * g_dbus_interface_skeleton_get_connection:
14691 * @interface_: A #GDBusInterfaceSkeleton.
14693 * Gets the first connection that @interface_ is exported on, if any.
14695 * Returns: (transfer none): A #GDBusConnection or %NULL if @interface_ is not exported anywhere. Do not free, the object belongs to @interface_.
14701 * g_dbus_interface_skeleton_get_connections:
14702 * @interface_: A #GDBusInterfaceSkeleton.
14704 * Gets a list of the connections that @interface_ is exported on.
14706 * 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().
14712 * g_dbus_interface_skeleton_get_flags:
14713 * @interface_: A #GDBusInterfaceSkeleton.
14715 * Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
14718 * Returns: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
14724 * g_dbus_interface_skeleton_get_info:
14725 * @interface_: A #GDBusInterfaceSkeleton.
14727 * Gets D-Bus introspection information for the D-Bus interface
14728 * implemented by @interface_.
14730 * Returns: (transfer none): A #GDBusInterfaceInfo (never %NULL). Do not free.
14736 * g_dbus_interface_skeleton_get_object_path:
14737 * @interface_: A #GDBusInterfaceSkeleton.
14739 * Gets the object path that @interface_ is exported on, if any.
14741 * Returns: A string owned by @interface_ or %NULL if @interface_ is not exported anywhere. Do not free, the string belongs to @interface_.
14747 * g_dbus_interface_skeleton_get_properties:
14748 * @interface_: A #GDBusInterfaceSkeleton.
14750 * Gets all D-Bus properties for @interface_.
14752 * Returns: (transfer full): A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
14758 * g_dbus_interface_skeleton_get_vtable: (skip)
14759 * @interface_: A #GDBusInterfaceSkeleton.
14761 * Gets the interface vtable for the D-Bus interface implemented by
14762 * @interface_. The returned function pointers should expect @interface_
14763 * itself to be passed as @user_data.
14765 * Returns: A #GDBusInterfaceVTable (never %NULL).
14771 * g_dbus_interface_skeleton_has_connection:
14772 * @interface_: A #GDBusInterfaceSkeleton.
14773 * @connection: A #GDBusConnection.
14775 * Checks if @interface_ is exported on @connection.
14777 * Returns: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
14783 * g_dbus_interface_skeleton_set_flags:
14784 * @interface_: A #GDBusInterfaceSkeleton.
14785 * @flags: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
14787 * Sets flags describing what the behavior of @skeleton should be.
14794 * g_dbus_interface_skeleton_unexport:
14795 * @interface_: A #GDBusInterfaceSkeleton.
14797 * Stops exporting @interface_ on all connections it is exported on.
14799 * To unexport @interface_ from only a single connection, use
14800 * g_dbus_interface_skeleton_unexport_from_connection()
14807 * g_dbus_interface_skeleton_unexport_from_connection:
14808 * @interface_: A #GDBusInterfaceSkeleton.
14809 * @connection: A #GDBusConnection.
14811 * Stops exporting @interface_ on @connection.
14813 * To stop exporting on all connections the interface is exported on,
14814 * use g_dbus_interface_skeleton_unexport().
14821 * g_dbus_is_address:
14822 * @string: A string.
14824 * Checks if @string is a D-Bus address.
14826 * This doesn't check if @string is actually supported by #GDBusServer
14827 * or #GDBusConnection - use g_dbus_is_supported_address() to do more
14830 * Returns: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
14837 * @string: The string to check.
14839 * Checks if @string is a D-Bus GUID.
14841 * See the D-Bus specification regarding what strings are valid D-Bus
14842 * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
14844 * Returns: %TRUE if @string is a guid, %FALSE otherwise.
14850 * g_dbus_is_interface_name:
14851 * @string: The string to check.
14853 * Checks if @string is a valid D-Bus interface name.
14855 * Returns: %TRUE if valid, %FALSE otherwise.
14861 * g_dbus_is_member_name:
14862 * @string: The string to check.
14864 * Checks if @string is a valid D-Bus member (e.g. signal or method) name.
14866 * Returns: %TRUE if valid, %FALSE otherwise.
14873 * @string: The string to check.
14875 * Checks if @string is a valid D-Bus bus name (either unique or well-known).
14877 * Returns: %TRUE if valid, %FALSE otherwise.
14883 * g_dbus_is_supported_address:
14884 * @string: A string.
14885 * @error: Return location for error or %NULL.
14887 * Like g_dbus_is_address() but also checks if the library suppors the
14888 * transports in @string and that key/value pairs for each transport
14891 * Returns: %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set.
14897 * g_dbus_is_unique_name:
14898 * @string: The string to check.
14900 * Checks if @string is a valid D-Bus unique bus name.
14902 * Returns: %TRUE if valid, %FALSE otherwise.
14908 * g_dbus_menu_model_get:
14909 * @connection: a #GDBusConnection
14910 * @bus_name: the bus name which exports the menu model
14911 * @object_path: the object path at which the menu model is exported
14913 * Obtains a #GDBusMenuModel for the menu model which is exported
14914 * at the given @bus_name and @object_path.
14916 * The thread default main context is taken at the time of this call.
14917 * All signals on the menu model (and any linked models) are reported
14918 * with respect to this context. All calls on the returned menu model
14919 * (and linked models) must also originate from this same context, with
14920 * the thread default main context unchanged.
14922 * Returns: (transfer full): a #GDBusMenuModel object. Free with g_object_unref().
14928 * g_dbus_message_bytes_needed:
14929 * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14930 * @blob_len: The length of @blob (must be at least 16).
14931 * @error: Return location for error or %NULL.
14933 * Utility function to calculate how many bytes are needed to
14934 * completely deserialize the D-Bus message stored at @blob.
14936 * 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).
14942 * g_dbus_message_copy:
14943 * @message: A #GDBusMessage.
14944 * @error: Return location for error or %NULL.
14946 * Copies @message. The copy is a deep copy and the returned
14947 * #GDBusMessage is completely identical except that it is guaranteed
14948 * to not be locked.
14950 * This operation can fail if e.g. @message contains file descriptors
14951 * and the per-process or system-wide open files limit is reached.
14953 * Returns: (transfer full): A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14959 * g_dbus_message_get_arg0:
14960 * @message: A #GDBusMessage.
14962 * Convenience to get the first item in the body of @message.
14964 * Returns: The string item or %NULL if the first item in the body of @message is not a string.
14970 * g_dbus_message_get_body:
14971 * @message: A #GDBusMessage.
14973 * Gets the body of a message.
14975 * Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
14981 * g_dbus_message_get_byte_order:
14982 * @message: A #GDBusMessage.
14984 * Gets the byte order of @message.
14986 * Returns: The byte order.
14991 * g_dbus_message_get_destination:
14992 * @message: A #GDBusMessage.
14994 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14996 * Returns: The value.
15002 * g_dbus_message_get_error_name:
15003 * @message: A #GDBusMessage.
15005 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
15007 * Returns: The value.
15013 * g_dbus_message_get_flags:
15014 * @message: A #GDBusMessage.
15016 * Gets the flags for @message.
15018 * Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
15024 * g_dbus_message_get_header:
15025 * @message: A #GDBusMessage.
15026 * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
15028 * Gets a header field on @message.
15030 * Returns: A #GVariant with the value if the header was found, %NULL otherwise. Do not free, it is owned by @message.
15036 * g_dbus_message_get_header_fields:
15037 * @message: A #GDBusMessage.
15039 * Gets an array of all header fields on @message that are set.
15041 * 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().
15047 * g_dbus_message_get_interface:
15048 * @message: A #GDBusMessage.
15050 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
15052 * Returns: The value.
15058 * g_dbus_message_get_locked:
15059 * @message: A #GDBusMessage.
15061 * Checks whether @message is locked. To monitor changes to this
15062 * value, conncet to the #GObject::notify signal to listen for changes
15063 * on the #GDBusMessage:locked property.
15065 * Returns: %TRUE if @message is locked, %FALSE otherwise.
15071 * g_dbus_message_get_member:
15072 * @message: A #GDBusMessage.
15074 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
15076 * Returns: The value.
15082 * g_dbus_message_get_message_type:
15083 * @message: A #GDBusMessage.
15085 * Gets the type of @message.
15087 * Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
15093 * g_dbus_message_get_num_unix_fds:
15094 * @message: A #GDBusMessage.
15096 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
15098 * Returns: The value.
15104 * g_dbus_message_get_path:
15105 * @message: A #GDBusMessage.
15107 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
15109 * Returns: The value.
15115 * g_dbus_message_get_reply_serial:
15116 * @message: A #GDBusMessage.
15118 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
15120 * Returns: The value.
15126 * g_dbus_message_get_sender:
15127 * @message: A #GDBusMessage.
15129 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
15131 * Returns: The value.
15137 * g_dbus_message_get_serial:
15138 * @message: A #GDBusMessage.
15140 * Gets the serial for @message.
15142 * Returns: A #guint32.
15148 * g_dbus_message_get_signature:
15149 * @message: A #GDBusMessage.
15151 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
15153 * Returns: The value.
15159 * g_dbus_message_get_unix_fd_list:
15160 * @message: A #GDBusMessage.
15162 * Gets the UNIX file descriptors associated with @message, if any.
15164 * This method is only available on UNIX.
15166 * Returns: (transfer none): A #GUnixFDList or %NULL if no file descriptors are associated. Do not free, this object is owned by @message.
15172 * g_dbus_message_lock:
15173 * @message: A #GDBusMessage.
15175 * If @message is locked, does nothing. Otherwise locks the message.
15182 * g_dbus_message_new:
15184 * Creates a new empty #GDBusMessage.
15186 * Returns: A #GDBusMessage. Free with g_object_unref().
15192 * g_dbus_message_new_from_blob:
15193 * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
15194 * @blob_len: The length of @blob.
15195 * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
15196 * @error: Return location for error or %NULL.
15198 * Creates a new #GDBusMessage from the data stored at @blob. The byte
15199 * order that the message was in can be retrieved using
15200 * g_dbus_message_get_byte_order().
15202 * Returns: A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
15208 * g_dbus_message_new_method_call:
15209 * @name: (allow-none): A valid D-Bus name or %NULL.
15210 * @path: A valid object path.
15211 * @interface_: (allow-none): A valid D-Bus interface name or %NULL.
15212 * @method: A valid method name.
15214 * Creates a new #GDBusMessage for a method call.
15216 * Returns: A #GDBusMessage. Free with g_object_unref().
15222 * g_dbus_message_new_method_error:
15223 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
15224 * @error_name: A valid D-Bus error name.
15225 * @error_message_format: The D-Bus error message in a printf() format.
15226 * @...: Arguments for @error_message_format.
15228 * Creates a new #GDBusMessage that is an error reply to @method_call_message.
15230 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
15236 * g_dbus_message_new_method_error_literal:
15237 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
15238 * @error_name: A valid D-Bus error name.
15239 * @error_message: The D-Bus error message.
15241 * Creates a new #GDBusMessage that is an error reply to @method_call_message.
15243 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
15249 * g_dbus_message_new_method_error_valist:
15250 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
15251 * @error_name: A valid D-Bus error name.
15252 * @error_message_format: The D-Bus error message in a printf() format.
15253 * @var_args: Arguments for @error_message_format.
15255 * Like g_dbus_message_new_method_error() but intended for language bindings.
15257 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
15263 * g_dbus_message_new_method_reply:
15264 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
15266 * Creates a new #GDBusMessage that is a reply to @method_call_message.
15268 * Returns: (transfer full): #GDBusMessage. Free with g_object_unref().
15274 * g_dbus_message_new_signal:
15275 * @path: A valid object path.
15276 * @interface_: A valid D-Bus interface name.
15277 * @signal: A valid signal name.
15279 * Creates a new #GDBusMessage for a signal emission.
15281 * Returns: A #GDBusMessage. Free with g_object_unref().
15287 * g_dbus_message_print:
15288 * @message: A #GDBusMessage.
15289 * @indent: Indentation level.
15291 * Produces a human-readable multi-line description of @message.
15293 * The contents of the description has no ABI guarantees, the contents
15294 * and formatting is subject to change at any time. Typical output
15295 * looks something like this:
15297 * Type: method-call
15298 * Flags: none
15302 * path -> objectpath '/org/gtk/GDBus/TestObject'
15303 * interface -> 'org.gtk.GDBus.TestInterface'
15304 * member -> 'GimmeStdout'
15305 * destination -> ':1.146'
15307 * UNIX File Descriptors:
15309 * </programlisting>
15312 * Type: method-return
15313 * Flags: no-reply-expected
15315 * Serial: 477
15317 * reply-serial -> uint32 4
15318 * destination -> ':1.159'
15319 * sender -> ':1.146'
15320 * num-unix-fds -> uint32 1
15322 * UNIX File Descriptors:
15323 * fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
15324 * </programlisting>
15326 * Returns: A string that should be freed with g_free().
15332 * g_dbus_message_set_body:
15333 * @message: A #GDBusMessage.
15334 * @body: Either %NULL or a #GVariant that is a tuple.
15336 * Sets the body @message. As a side-effect the
15337 * %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
15338 * type string of @body (or cleared if @body is %NULL).
15340 * If @body is floating, @message assumes ownership of @body.
15347 * g_dbus_message_set_byte_order:
15348 * @message: A #GDBusMessage.
15349 * @byte_order: The byte order.
15351 * Sets the byte order of @message.
15356 * g_dbus_message_set_destination:
15357 * @message: A #GDBusMessage.
15358 * @value: The value to set.
15360 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
15367 * g_dbus_message_set_error_name:
15368 * @message: A #GDBusMessage.
15369 * @value: The value to set.
15371 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
15378 * g_dbus_message_set_flags:
15379 * @message: A #GDBusMessage.
15380 * @flags: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
15382 * Sets the flags to set on @message.
15389 * g_dbus_message_set_header:
15390 * @message: A #GDBusMessage.
15391 * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
15392 * @value: (allow-none): A #GVariant to set the header field or %NULL to clear the header field.
15394 * Sets a header field on @message.
15396 * If @value is floating, @message assumes ownership of @value.
15403 * g_dbus_message_set_interface:
15404 * @message: A #GDBusMessage.
15405 * @value: The value to set.
15407 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
15414 * g_dbus_message_set_member:
15415 * @message: A #GDBusMessage.
15416 * @value: The value to set.
15418 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
15425 * g_dbus_message_set_message_type:
15426 * @message: A #GDBusMessage.
15427 * @type: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
15429 * Sets @message to be of @type.
15436 * g_dbus_message_set_num_unix_fds:
15437 * @message: A #GDBusMessage.
15438 * @value: The value to set.
15440 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
15447 * g_dbus_message_set_path:
15448 * @message: A #GDBusMessage.
15449 * @value: The value to set.
15451 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
15458 * g_dbus_message_set_reply_serial:
15459 * @message: A #GDBusMessage.
15460 * @value: The value to set.
15462 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
15469 * g_dbus_message_set_sender:
15470 * @message: A #GDBusMessage.
15471 * @value: The value to set.
15473 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
15480 * g_dbus_message_set_serial:
15481 * @message: A #GDBusMessage.
15482 * @serial: A #guint32.
15484 * Sets the serial for @message.
15491 * g_dbus_message_set_signature:
15492 * @message: A #GDBusMessage.
15493 * @value: The value to set.
15495 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
15502 * g_dbus_message_set_unix_fd_list:
15503 * @message: A #GDBusMessage.
15504 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15506 * Sets the UNIX file descriptors associated with @message. As a
15507 * side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
15508 * field is set to the number of fds in @fd_list (or cleared if
15509 * @fd_list is %NULL).
15511 * This method is only available on UNIX.
15518 * g_dbus_message_to_blob:
15519 * @message: A #GDBusMessage.
15520 * @out_size: Return location for size of generated blob.
15521 * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
15522 * @error: Return location for error.
15524 * Serializes @message to a blob. The byte order returned by
15525 * g_dbus_message_get_byte_order() will be used.
15527 * 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().
15533 * g_dbus_message_to_gerror:
15534 * @message: A #GDBusMessage.
15535 * @error: The #GError to set.
15537 * If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
15538 * nothing and returns %FALSE.
15540 * Otherwise this method encodes the error in @message as a #GError
15541 * using g_dbus_error_set_dbus_error() using the information in the
15542 * %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
15543 * well as the first string item in @message's body.
15545 * Returns: %TRUE if @error was set, %FALSE otherwise.
15551 * g_dbus_method_info_ref:
15552 * @info: A #GDBusMethodInfo
15554 * If @info is statically allocated does nothing. Otherwise increases
15555 * the reference count.
15557 * Returns: The same @info.
15563 * g_dbus_method_info_unref:
15564 * @info: A #GDBusMethodInfo.
15566 * If @info is statically allocated, does nothing. Otherwise decreases
15567 * the reference count of @info. When its reference count drops to 0,
15568 * the memory used is freed.
15575 * g_dbus_method_invocation_get_connection:
15576 * @invocation: A #GDBusMethodInvocation.
15578 * Gets the #GDBusConnection the method was invoked on.
15580 * Returns: (transfer none): A #GDBusConnection. Do not free, it is owned by @invocation.
15586 * g_dbus_method_invocation_get_interface_name:
15587 * @invocation: A #GDBusMethodInvocation.
15589 * Gets the name of the D-Bus interface the method was invoked on.
15591 * Returns: A string. Do not free, it is owned by @invocation.
15597 * g_dbus_method_invocation_get_message:
15598 * @invocation: A #GDBusMethodInvocation.
15600 * Gets the #GDBusMessage for the method invocation. This is useful if
15601 * you need to use low-level protocol features, such as UNIX file
15602 * descriptor passing, that cannot be properly expressed in the
15605 * See <xref linkend="gdbus-server"/> and <xref
15606 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
15607 * low-level API to send and receive UNIX file descriptors.
15609 * Returns: (transfer none): #GDBusMessage. Do not free, it is owned by @invocation.
15615 * g_dbus_method_invocation_get_method_info:
15616 * @invocation: A #GDBusMethodInvocation.
15618 * Gets information about the method call, if any.
15620 * Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
15626 * g_dbus_method_invocation_get_method_name:
15627 * @invocation: A #GDBusMethodInvocation.
15629 * Gets the name of the method that was invoked.
15631 * Returns: A string. Do not free, it is owned by @invocation.
15637 * g_dbus_method_invocation_get_object_path:
15638 * @invocation: A #GDBusMethodInvocation.
15640 * Gets the object path the method was invoked on.
15642 * Returns: A string. Do not free, it is owned by @invocation.
15648 * g_dbus_method_invocation_get_parameters:
15649 * @invocation: A #GDBusMethodInvocation.
15651 * Gets the parameters of the method invocation. If there are no input
15652 * parameters then this will return a GVariant with 0 children rather than NULL.
15654 * Returns: (transfer none): A #GVariant tuple. Do not unref this because it is owned by @invocation.
15660 * g_dbus_method_invocation_get_sender:
15661 * @invocation: A #GDBusMethodInvocation.
15663 * Gets the bus name that invoked the method.
15665 * Returns: A string. Do not free, it is owned by @invocation.
15671 * g_dbus_method_invocation_get_user_data: (skip)
15672 * @invocation: A #GDBusMethodInvocation.
15674 * Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
15676 * Returns: A #gpointer.
15682 * g_dbus_method_invocation_return_dbus_error:
15683 * @invocation: (transfer full): A #GDBusMethodInvocation.
15684 * @error_name: A valid D-Bus error name.
15685 * @error_message: A valid D-Bus error message.
15687 * Finishes handling a D-Bus method call by returning an error.
15689 * This method will free @invocation, you cannot use it afterwards.
15696 * g_dbus_method_invocation_return_error:
15697 * @invocation: (transfer full): A #GDBusMethodInvocation.
15698 * @domain: A #GQuark for the #GError error domain.
15699 * @code: The error code.
15700 * @format: printf()-style format.
15701 * @...: Parameters for @format.
15703 * Finishes handling a D-Bus method call by returning an error.
15705 * See g_dbus_error_encode_gerror() for details about what error name
15706 * will be returned on the wire. In a nutshell, if the given error is
15707 * registered using g_dbus_error_register_error() the name given
15708 * during registration is used. Otherwise, a name of the form
15709 * <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
15710 * used. This provides transparent mapping of #GError between
15711 * applications using GDBus.
15713 * If you are writing an application intended to be portable,
15714 * <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
15715 * or use g_dbus_method_invocation_return_dbus_error().
15717 * This method will free @invocation, you cannot use it afterwards.
15724 * g_dbus_method_invocation_return_error_literal:
15725 * @invocation: (transfer full): A #GDBusMethodInvocation.
15726 * @domain: A #GQuark for the #GError error domain.
15727 * @code: The error code.
15728 * @message: The error message.
15730 * Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
15732 * This method will free @invocation, you cannot use it afterwards.
15739 * g_dbus_method_invocation_return_error_valist:
15740 * @invocation: (transfer full): A #GDBusMethodInvocation.
15741 * @domain: A #GQuark for the #GError error domain.
15742 * @code: The error code.
15743 * @format: printf()-style format.
15744 * @var_args: #va_list of parameters for @format.
15746 * Like g_dbus_method_invocation_return_error() but intended for
15747 * language bindings.
15749 * This method will free @invocation, you cannot use it afterwards.
15756 * g_dbus_method_invocation_return_gerror:
15757 * @invocation: (transfer full): A #GDBusMethodInvocation.
15758 * @error: A #GError.
15760 * Like g_dbus_method_invocation_return_error() but takes a #GError
15761 * instead of the error domain, error code and message.
15763 * This method will free @invocation, you cannot use it afterwards.
15770 * g_dbus_method_invocation_return_value:
15771 * @invocation: (transfer full): A #GDBusMethodInvocation.
15772 * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15774 * Finishes handling a D-Bus method call by returning @parameters.
15775 * If the @parameters GVariant is floating, it is consumed.
15777 * It is an error if @parameters is not of the right format.
15779 * This method will free @invocation, you cannot use it afterwards.
15786 * g_dbus_method_invocation_return_value_with_unix_fd_list:
15787 * @invocation: (transfer full): A #GDBusMethodInvocation.
15788 * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15789 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15791 * Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
15793 * This method is only available on UNIX.
15795 * This method will free @invocation, you cannot use it afterwards.
15802 * g_dbus_method_invocation_take_error: (skip)
15803 * @invocation: (transfer full): A #GDBusMethodInvocation.
15804 * @error: (transfer full): A #GError.
15806 * Like g_dbus_method_invocation_return_gerror() but takes ownership
15807 * of @error so the caller does not need to free it.
15809 * This method will free @invocation, you cannot use it afterwards.
15816 * g_dbus_node_info_generate_xml:
15817 * @info: A #GDBusNodeInfo.
15818 * @indent: Indentation level.
15819 * @string_builder: (out): A #GString to to append XML data to.
15821 * Appends an XML representation of @info (and its children) to @string_builder.
15823 * This function is typically used for generating introspection XML documents at run-time for
15824 * handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
15831 * g_dbus_node_info_lookup_interface:
15832 * @info: A #GDBusNodeInfo.
15833 * @name: A D-Bus interface name.
15835 * Looks up information about an interface.
15837 * The cost of this function is O(n) in number of interfaces.
15839 * Returns: (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
15845 * g_dbus_node_info_new_for_xml:
15846 * @xml_data: Valid D-Bus introspection XML.
15847 * @error: Return location for error.
15849 * Parses @xml_data and returns a #GDBusNodeInfo representing the data.
15851 * The introspection XML must contain exactly one top-level
15852 * <tag class="starttag">node</tag> element.
15854 * Note that this routine is using a
15855 * <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
15856 * parser that only accepts a subset of valid XML documents.
15858 * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free with g_dbus_node_info_unref().
15864 * g_dbus_node_info_ref:
15865 * @info: A #GDBusNodeInfo
15867 * If @info is statically allocated does nothing. Otherwise increases
15868 * the reference count.
15870 * Returns: The same @info.
15876 * g_dbus_node_info_unref:
15877 * @info: A #GDBusNodeInfo.
15879 * If @info is statically allocated, does nothing. Otherwise decreases
15880 * the reference count of @info. When its reference count drops to 0,
15881 * the memory used is freed.
15888 * g_dbus_object_get_interface:
15889 * @object: A #GDBusObject.
15890 * @interface_name: A D-Bus interface name.
15892 * Gets the D-Bus interface with name @interface_name associated with
15895 * Returns: (transfer full): %NULL if not found, otherwise a #GDBusInterface that must be freed with g_object_unref().
15901 * g_dbus_object_get_interfaces:
15902 * @object: A #GDBusObject.
15904 * Gets the D-Bus interfaces associated with @object.
15906 * 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().
15912 * g_dbus_object_get_object_path:
15913 * @object: A #GDBusObject.
15915 * Gets the object path for @object.
15917 * Returns: A string owned by @object. Do not free.
15923 * g_dbus_object_manager_client_get_connection:
15924 * @manager: A #GDBusObjectManagerClient
15926 * Gets the #GDBusConnection used by @manager.
15928 * Returns: (transfer none): A #GDBusConnection object. Do not free, the object belongs to @manager.
15934 * g_dbus_object_manager_client_get_flags:
15935 * @manager: A #GDBusObjectManagerClient
15937 * Gets the flags that @manager was constructed with.
15939 * Returns: Zero of more flags from the #GDBusObjectManagerClientFlags enumeration.
15945 * g_dbus_object_manager_client_get_name:
15946 * @manager: A #GDBusObjectManagerClient
15948 * Gets the name that @manager is for, or %NULL if not a message bus
15951 * Returns: A unique or well-known name. Do not free, the string belongs to @manager.
15957 * g_dbus_object_manager_client_get_name_owner:
15958 * @manager: A #GDBusObjectManagerClient.
15960 * The unique name that owns the name that @manager is for or %NULL if
15961 * no-one currently owns that name. You can connect to the
15962 * #GObject::notify signal to track changes to the
15963 * #GDBusObjectManagerClient:name-owner property.
15965 * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15971 * g_dbus_object_manager_client_new:
15972 * @connection: A #GDBusConnection.
15973 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15974 * @name: The owner of the control object (unique or well-known name).
15975 * @object_path: The object path of the control object.
15976 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15977 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15978 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15979 * @cancellable: (allow-none): A #GCancellable or %NULL
15980 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15981 * @user_data: The data to pass to @callback.
15983 * Asynchronously creates a new #GDBusObjectManagerClient object.
15985 * This is an asynchronous failable constructor. When the result is
15986 * ready, @callback will be invoked in the
15987 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15988 * of the thread you are calling this method from. You can
15989 * then call g_dbus_object_manager_client_new_finish() to get the result. See
15990 * g_dbus_object_manager_client_new_sync() for the synchronous version.
15997 * g_dbus_object_manager_client_new_finish:
15998 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
15999 * @error: Return location for error or %NULL.
16001 * Finishes an operation started with g_dbus_object_manager_client_new().
16003 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
16009 * g_dbus_object_manager_client_new_for_bus:
16010 * @bus_type: A #GBusType.
16011 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
16012 * @name: The owner of the control object (unique or well-known name).
16013 * @object_path: The object path of the control object.
16014 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
16015 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
16016 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
16017 * @cancellable: (allow-none): A #GCancellable or %NULL
16018 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
16019 * @user_data: The data to pass to @callback.
16021 * Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
16022 * #GDBusConnection.
16024 * This is an asynchronous failable constructor. When the result is
16025 * ready, @callback will be invoked in the
16026 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
16027 * of the thread you are calling this method from. You can
16028 * then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
16029 * g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
16036 * g_dbus_object_manager_client_new_for_bus_finish:
16037 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
16038 * @error: Return location for error or %NULL.
16040 * Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
16042 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
16048 * g_dbus_object_manager_client_new_for_bus_sync:
16049 * @bus_type: A #GBusType.
16050 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
16051 * @name: The owner of the control object (unique or well-known name).
16052 * @object_path: The object path of the control object.
16053 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
16054 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
16055 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
16056 * @cancellable: (allow-none): A #GCancellable or %NULL
16057 * @error: Return location for error or %NULL.
16059 * Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
16060 * of a #GDBusConnection.
16062 * This is a synchronous failable constructor - the calling thread is
16063 * blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
16064 * for the asynchronous version.
16066 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
16072 * g_dbus_object_manager_client_new_sync:
16073 * @connection: A #GDBusConnection.
16074 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
16075 * @name: (allow-none): The owner of the control object (unique or well-known name), or %NULL when not using a message bus connection.
16076 * @object_path: The object path of the control object.
16077 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
16078 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
16079 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
16080 * @cancellable: (allow-none): A #GCancellable or %NULL
16081 * @error: Return location for error or %NULL.
16083 * Creates a new #GDBusObjectManagerClient object.
16085 * This is a synchronous failable constructor - the calling thread is
16086 * blocked until a reply is received. See g_dbus_object_manager_client_new()
16087 * for the asynchronous version.
16089 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
16095 * g_dbus_object_manager_get_interface:
16096 * @manager: A #GDBusObjectManager.
16097 * @object_path: Object path to lookup.
16098 * @interface_name: D-Bus interface name to lookup.
16100 * Gets the interface proxy for @interface_name at @object_path, if
16103 * Returns: (transfer full): A #GDBusInterface instance or %NULL. Free with g_object_unref().
16109 * g_dbus_object_manager_get_object:
16110 * @manager: A #GDBusObjectManager.
16111 * @object_path: Object path to lookup.
16113 * Gets the #GDBusObjectProxy at @object_path, if any.
16115 * Returns: (transfer full): A #GDBusObject or %NULL. Free with g_object_unref().
16121 * g_dbus_object_manager_get_object_path:
16122 * @manager: A #GDBusObjectManager.
16124 * Gets the object path that @manager is for.
16126 * Returns: A string owned by @manager. Do not free.
16132 * g_dbus_object_manager_get_objects:
16133 * @manager: A #GDBusObjectManager.
16135 * Gets all #GDBusObject objects known to @manager.
16137 * 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().
16143 * g_dbus_object_manager_server_export:
16144 * @manager: A #GDBusObjectManagerServer.
16145 * @object: A #GDBusObjectSkeleton.
16147 * Exports @object on @manager.
16149 * If there is already a #GDBusObject exported at the object path,
16150 * then the old object is removed.
16152 * The object path for @object must be in the hierarchy rooted by the
16153 * object path for @manager.
16155 * Note that @manager will take a reference on @object for as long as
16163 * g_dbus_object_manager_server_export_uniquely:
16164 * @manager: A #GDBusObjectManagerServer.
16165 * @object: An object.
16167 * Like g_dbus_object_manager_server_export() but appends a string of
16168 * the form <literal>_N</literal> (with N being a natural number) to
16169 * @object<!-- -->'s object path if an object with the given path
16170 * already exists. As such, the #GDBusObjectProxy:g-object-path property
16171 * of @object may be modified.
16178 * g_dbus_object_manager_server_get_connection:
16179 * @manager: A #GDBusObjectManagerServer
16181 * Gets the #GDBusConnection used by @manager.
16183 * 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().
16189 * g_dbus_object_manager_server_is_exported:
16190 * @manager: A #GDBusObjectManagerServer.
16191 * @object: An object.
16193 * Returns whether @object is currently exported on @manager.
16195 * Returns: %TRUE if @object is exported
16201 * g_dbus_object_manager_server_new:
16202 * @object_path: The object path to export the manager object at.
16204 * Creates a new #GDBusObjectManagerServer object.
16206 * The returned server isn't yet exported on any connection. To do so,
16207 * use g_dbus_object_manager_server_set_connection(). Normally you
16208 * want to export all of your objects before doing so to avoid <ulink
16209 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
16210 * signals being emitted.
16212 * Returns: A #GDBusObjectManagerServer object. Free with g_object_unref().
16218 * g_dbus_object_manager_server_set_connection:
16219 * @manager: A #GDBusObjectManagerServer.
16220 * @connection: (allow-none): A #GDBusConnection or %NULL.
16222 * Exports all objects managed by @manager on @connection. If
16223 * @connection is %NULL, stops exporting objects.
16228 * g_dbus_object_manager_server_unexport:
16229 * @manager: A #GDBusObjectManagerServer.
16230 * @object_path: An object path.
16232 * If @manager has an object at @path, removes the object. Otherwise
16235 * Note that @object_path must be in the hierarchy rooted by the
16236 * object path for @manager.
16238 * Returns: %TRUE if object at @object_path was removed, %FALSE otherwise.
16244 * g_dbus_object_proxy_get_connection:
16245 * @proxy: a #GDBusObjectProxy
16247 * Gets the connection that @proxy is for.
16249 * Returns: (transfer none): A #GDBusConnection. Do not free, the object is owned by @proxy.
16255 * g_dbus_object_proxy_new:
16256 * @connection: a #GDBusConnection
16257 * @object_path: the object path
16259 * Creates a new #GDBusObjectProxy for the given connection and
16262 * Returns: a new #GDBusObjectProxy
16268 * g_dbus_object_skeleton_add_interface:
16269 * @object: A #GDBusObjectSkeleton.
16270 * @interface_: A #GDBusInterfaceSkeleton.
16272 * Adds @interface_ to @object.
16274 * If @object already contains a #GDBusInterfaceSkeleton with the same
16275 * interface name, it is removed before @interface_ is added.
16277 * Note that @object takes its own reference on @interface_ and holds
16278 * it until removed.
16285 * g_dbus_object_skeleton_flush:
16286 * @object: A #GDBusObjectSkeleton.
16288 * This method simply calls g_dbus_interface_skeleton_flush() on all
16289 * interfaces belonging to @object. See that method for when flushing
16297 * g_dbus_object_skeleton_new:
16298 * @object_path: An object path.
16300 * Creates a new #GDBusObjectSkeleton.
16302 * Returns: A #GDBusObjectSkeleton. Free with g_object_unref().
16308 * g_dbus_object_skeleton_remove_interface:
16309 * @object: A #GDBusObjectSkeleton.
16310 * @interface_: A #GDBusInterfaceSkeleton.
16312 * Removes @interface_ from @object.
16319 * g_dbus_object_skeleton_remove_interface_by_name:
16320 * @object: A #GDBusObjectSkeleton.
16321 * @interface_name: A D-Bus interface name.
16323 * Removes the #GDBusInterface with @interface_name from @object.
16325 * If no D-Bus interface of the given interface exists, this function
16333 * g_dbus_object_skeleton_set_object_path:
16334 * @object: A #GDBusObjectSkeleton.
16335 * @object_path: A valid D-Bus object path.
16337 * Sets the object path for @object.
16344 * g_dbus_property_info_ref:
16345 * @info: A #GDBusPropertyInfo
16347 * If @info is statically allocated does nothing. Otherwise increases
16348 * the reference count.
16350 * Returns: The same @info.
16356 * g_dbus_property_info_unref:
16357 * @info: A #GDBusPropertyInfo.
16359 * If @info is statically allocated, does nothing. Otherwise decreases
16360 * the reference count of @info. When its reference count drops to 0,
16361 * the memory used is freed.
16368 * g_dbus_proxy_call:
16369 * @proxy: A #GDBusProxy.
16370 * @method_name: Name of method to invoke.
16371 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
16372 * @flags: Flags from the #GDBusCallFlags enumeration.
16373 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
16374 * @cancellable: (allow-none): A #GCancellable or %NULL.
16375 * @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.
16376 * @user_data: The data to pass to @callback.
16378 * Asynchronously invokes the @method_name method on @proxy.
16380 * If @method_name contains any dots, then @name is split into interface and
16381 * method name parts. This allows using @proxy for invoking methods on
16382 * other interfaces.
16384 * If the #GDBusConnection associated with @proxy is closed then
16385 * the operation will fail with %G_IO_ERROR_CLOSED. If
16386 * @cancellable is canceled, the operation will fail with
16387 * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
16388 * compatible with the D-Bus protocol, the operation fails with
16389 * %G_IO_ERROR_INVALID_ARGUMENT.
16391 * If the @parameters #GVariant is floating, it is consumed. This allows
16392 * convenient 'inline' use of g_variant_new(), e.g.:
16394 * g_dbus_proxy_call (proxy,
16396 * g_variant_new ("(ss)",
16399 * G_DBUS_CALL_FLAGS_NONE,
16402 * (GAsyncReadyCallback) two_strings_done,
16406 * If @proxy has an expected interface (see
16407 * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
16408 * then the return value is checked against the return type.
16410 * This is an asynchronous method. When the operation is finished,
16411 * @callback will be invoked in the
16412 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
16413 * of the thread you are calling this method from.
16414 * You can then call g_dbus_proxy_call_finish() to get the result of
16415 * the operation. See g_dbus_proxy_call_sync() for the synchronous
16416 * version of this method.
16418 * If @callback is %NULL then the D-Bus method call message will be sent with
16419 * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
16426 * g_dbus_proxy_call_finish:
16427 * @proxy: A #GDBusProxy.
16428 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
16429 * @error: Return location for error or %NULL.
16431 * Finishes an operation started with g_dbus_proxy_call().
16433 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
16439 * g_dbus_proxy_call_sync:
16440 * @proxy: A #GDBusProxy.
16441 * @method_name: Name of method to invoke.
16442 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
16443 * @flags: Flags from the #GDBusCallFlags enumeration.
16444 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
16445 * @cancellable: (allow-none): A #GCancellable or %NULL.
16446 * @error: Return location for error or %NULL.
16448 * Synchronously invokes the @method_name method on @proxy.
16450 * If @method_name contains any dots, then @name is split into interface and
16451 * method name parts. This allows using @proxy for invoking methods on
16452 * other interfaces.
16454 * If the #GDBusConnection associated with @proxy is disconnected then
16455 * the operation will fail with %G_IO_ERROR_CLOSED. If
16456 * @cancellable is canceled, the operation will fail with
16457 * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
16458 * compatible with the D-Bus protocol, the operation fails with
16459 * %G_IO_ERROR_INVALID_ARGUMENT.
16461 * If the @parameters #GVariant is floating, it is consumed. This allows
16462 * convenient 'inline' use of g_variant_new(), e.g.:
16464 * g_dbus_proxy_call_sync (proxy,
16466 * g_variant_new ("(ss)",
16469 * G_DBUS_CALL_FLAGS_NONE,
16475 * The calling thread is blocked until a reply is received. See
16476 * g_dbus_proxy_call() for the asynchronous version of this
16479 * If @proxy has an expected interface (see
16480 * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
16481 * then the return value is checked against the return type.
16483 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
16489 * g_dbus_proxy_call_with_unix_fd_list:
16490 * @proxy: A #GDBusProxy.
16491 * @method_name: Name of method to invoke.
16492 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
16493 * @flags: Flags from the #GDBusCallFlags enumeration.
16494 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
16495 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
16496 * @cancellable: (allow-none): A #GCancellable or %NULL.
16497 * @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.
16498 * @user_data: The data to pass to @callback.
16500 * Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
16502 * This method is only available on UNIX.
16509 * g_dbus_proxy_call_with_unix_fd_list_finish:
16510 * @proxy: A #GDBusProxy.
16511 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
16512 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
16513 * @error: Return location for error or %NULL.
16515 * Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
16517 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
16523 * g_dbus_proxy_call_with_unix_fd_list_sync:
16524 * @proxy: A #GDBusProxy.
16525 * @method_name: Name of method to invoke.
16526 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
16527 * @flags: Flags from the #GDBusCallFlags enumeration.
16528 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
16529 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
16530 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
16531 * @cancellable: (allow-none): A #GCancellable or %NULL.
16532 * @error: Return location for error or %NULL.
16534 * Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
16536 * This method is only available on UNIX.
16538 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
16544 * g_dbus_proxy_get_cached_property:
16545 * @proxy: A #GDBusProxy.
16546 * @property_name: Property name.
16548 * Looks up the value for a property from the cache. This call does no
16551 * If @proxy has an expected interface (see
16552 * #GDBusProxy:g-interface-info) and @property_name is referenced by
16553 * it, then @value is checked against the type of the property.
16555 * 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().
16561 * g_dbus_proxy_get_cached_property_names:
16562 * @proxy: A #GDBusProxy.
16564 * Gets the names of all cached properties on @proxy.
16566 * Returns: (transfer full): A %NULL-terminated array of strings or %NULL if @proxy has no cached properties. Free the returned array with g_strfreev().
16572 * g_dbus_proxy_get_connection:
16573 * @proxy: A #GDBusProxy.
16575 * Gets the connection @proxy is for.
16577 * Returns: (transfer none): A #GDBusConnection owned by @proxy. Do not free.
16583 * g_dbus_proxy_get_default_timeout:
16584 * @proxy: A #GDBusProxy.
16586 * Gets the timeout to use if -1 (specifying default timeout) is
16587 * passed as @timeout_msec in the g_dbus_proxy_call() and
16588 * g_dbus_proxy_call_sync() functions.
16590 * See the #GDBusProxy:g-default-timeout property for more details.
16592 * Returns: Timeout to use for @proxy.
16598 * g_dbus_proxy_get_flags:
16599 * @proxy: A #GDBusProxy.
16601 * Gets the flags that @proxy was constructed with.
16603 * Returns: Flags from the #GDBusProxyFlags enumeration.
16609 * g_dbus_proxy_get_interface_info:
16610 * @proxy: A #GDBusProxy
16612 * Returns the #GDBusInterfaceInfo, if any, specifying the interface
16613 * that @proxy conforms to. See the #GDBusProxy:g-interface-info
16614 * property for more details.
16616 * Returns: A #GDBusInterfaceInfo or %NULL. Do not unref the returned object, it is owned by @proxy.
16622 * g_dbus_proxy_get_interface_name:
16623 * @proxy: A #GDBusProxy.
16625 * Gets the D-Bus interface name @proxy is for.
16627 * Returns: A string owned by @proxy. Do not free.
16633 * g_dbus_proxy_get_name:
16634 * @proxy: A #GDBusProxy.
16636 * Gets the name that @proxy was constructed for.
16638 * Returns: A string owned by @proxy. Do not free.
16644 * g_dbus_proxy_get_name_owner:
16645 * @proxy: A #GDBusProxy.
16647 * The unique name that owns the name that @proxy is for or %NULL if
16648 * no-one currently owns that name. You may connect to the
16649 * #GObject::notify signal to track changes to the
16650 * #GDBusProxy:g-name-owner property.
16652 * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
16658 * g_dbus_proxy_get_object_path:
16659 * @proxy: A #GDBusProxy.
16661 * Gets the object path @proxy is for.
16663 * Returns: A string owned by @proxy. Do not free.
16669 * g_dbus_proxy_new:
16670 * @connection: A #GDBusConnection.
16671 * @flags: Flags used when constructing the proxy.
16672 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16673 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16674 * @object_path: An object path.
16675 * @interface_name: A D-Bus interface name.
16676 * @cancellable: (allow-none): A #GCancellable or %NULL.
16677 * @callback: Callback function to invoke when the proxy is ready.
16678 * @user_data: User data to pass to @callback.
16680 * Creates a proxy for accessing @interface_name on the remote object
16681 * at @object_path owned by @name at @connection and asynchronously
16682 * loads D-Bus properties unless the
16683 * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
16684 * the #GDBusProxy::g-properties-changed signal to get notified about
16685 * property changes.
16687 * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16688 * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16689 * to handle signals from the remote object.
16691 * If @name is a well-known name and the
16692 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16693 * owner currently exists, the message bus will be requested to launch
16694 * a name owner for the name.
16696 * This is a failable asynchronous constructor - when the proxy is
16697 * ready, @callback will be invoked and you can use
16698 * g_dbus_proxy_new_finish() to get the result.
16700 * See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
16702 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16709 * g_dbus_proxy_new_finish:
16710 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
16711 * @error: Return location for error or %NULL.
16713 * Finishes creating a #GDBusProxy.
16715 * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16721 * g_dbus_proxy_new_for_bus:
16722 * @bus_type: A #GBusType.
16723 * @flags: Flags used when constructing the proxy.
16724 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16725 * @name: A bus name (well-known or unique).
16726 * @object_path: An object path.
16727 * @interface_name: A D-Bus interface name.
16728 * @cancellable: (allow-none): A #GCancellable or %NULL.
16729 * @callback: Callback function to invoke when the proxy is ready.
16730 * @user_data: User data to pass to @callback.
16732 * Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
16734 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16741 * g_dbus_proxy_new_for_bus_finish:
16742 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
16743 * @error: Return location for error or %NULL.
16745 * Finishes creating a #GDBusProxy.
16747 * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16753 * g_dbus_proxy_new_for_bus_sync:
16754 * @bus_type: A #GBusType.
16755 * @flags: Flags used when constructing the proxy.
16756 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16757 * @name: A bus name (well-known or unique).
16758 * @object_path: An object path.
16759 * @interface_name: A D-Bus interface name.
16760 * @cancellable: (allow-none): A #GCancellable or %NULL.
16761 * @error: Return location for error or %NULL.
16763 * Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
16765 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16767 * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16773 * g_dbus_proxy_new_sync:
16774 * @connection: A #GDBusConnection.
16775 * @flags: Flags used when constructing the proxy.
16776 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16777 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16778 * @object_path: An object path.
16779 * @interface_name: A D-Bus interface name.
16780 * @cancellable: (allow-none): A #GCancellable or %NULL.
16781 * @error: (allow-none): Return location for error or %NULL.
16783 * Creates a proxy for accessing @interface_name on the remote object
16784 * at @object_path owned by @name at @connection and synchronously
16785 * loads D-Bus properties unless the
16786 * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
16788 * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16789 * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16790 * to handle signals from the remote object.
16792 * If @name is a well-known name and the
16793 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16794 * owner currently exists, the message bus will be requested to launch
16795 * a name owner for the name.
16797 * This is a synchronous failable constructor. See g_dbus_proxy_new()
16798 * and g_dbus_proxy_new_finish() for the asynchronous version.
16800 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16802 * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16808 * g_dbus_proxy_set_cached_property:
16809 * @proxy: A #GDBusProxy
16810 * @property_name: Property name.
16811 * @value: (allow-none): Value for the property or %NULL to remove it from the cache.
16813 * If @value is not %NULL, sets the cached value for the property with
16814 * name @property_name to the value in @value.
16816 * If @value is %NULL, then the cached value is removed from the
16819 * If @proxy has an expected interface (see
16820 * #GDBusProxy:g-interface-info) and @property_name is referenced by
16821 * it, then @value is checked against the type of the property.
16823 * If the @value #GVariant is floating, it is consumed. This allows
16824 * convenient 'inline' use of g_variant_new(), e.g.
16826 * g_dbus_proxy_set_cached_property (proxy,
16828 * g_variant_new ("(si)",
16833 * Normally you will not need to use this method since @proxy is
16834 * tracking changes using the
16835 * <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
16836 * D-Bus signal. However, for performance reasons an object may decide
16837 * to not use this signal for some properties and instead use a
16838 * proprietary out-of-band mechanism to transmit changes.
16840 * As a concrete example, consider an object with a property
16841 * <literal>ChatroomParticipants</literal> which is an array of
16842 * strings. Instead of transmitting the same (long) array every time
16843 * the property changes, it is more efficient to only transmit the
16844 * delta using e.g. signals <literal>ChatroomParticipantJoined(String
16845 * name)</literal> and <literal>ChatroomParticipantParted(String
16853 * g_dbus_proxy_set_default_timeout:
16854 * @proxy: A #GDBusProxy.
16855 * @timeout_msec: Timeout in milliseconds.
16857 * Sets the timeout to use if -1 (specifying default timeout) is
16858 * passed as @timeout_msec in the g_dbus_proxy_call() and
16859 * g_dbus_proxy_call_sync() functions.
16861 * See the #GDBusProxy:g-default-timeout property for more details.
16868 * g_dbus_proxy_set_interface_info:
16869 * @proxy: A #GDBusProxy
16870 * @info: (allow-none): Minimum interface this proxy conforms to or %NULL to unset.
16872 * Ensure that interactions with @proxy conform to the given
16873 * interface. See the #GDBusProxy:g-interface-info property for more
16881 * g_dbus_server_get_client_address:
16882 * @server: A #GDBusServer.
16884 * Gets a D-Bus address string that can be used by clients to connect
16887 * Returns: A D-Bus address string. Do not free, the string is owned by @server.
16893 * g_dbus_server_get_flags:
16894 * @server: A #GDBusServer.
16896 * Gets the flags for @server.
16898 * Returns: A set of flags from the #GDBusServerFlags enumeration.
16904 * g_dbus_server_get_guid:
16905 * @server: A #GDBusServer.
16907 * Gets the GUID for @server.
16909 * Returns: A D-Bus GUID. Do not free this string, it is owned by @server.
16915 * g_dbus_server_is_active:
16916 * @server: A #GDBusServer.
16918 * Gets whether @server is active.
16920 * Returns: %TRUE if server is active, %FALSE otherwise.
16926 * g_dbus_server_new_sync:
16927 * @address: A D-Bus address.
16928 * @flags: Flags from the #GDBusServerFlags enumeration.
16929 * @guid: A D-Bus GUID.
16930 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
16931 * @cancellable: (allow-none): A #GCancellable or %NULL.
16932 * @error: Return location for server or %NULL.
16934 * Creates a new D-Bus server that listens on the first address in
16935 * @address that works.
16937 * Once constructed, you can use g_dbus_server_get_client_address() to
16938 * get a D-Bus address string that clients can use to connect.
16940 * Connect to the #GDBusServer::new-connection signal to handle
16941 * incoming connections.
16943 * The returned #GDBusServer isn't active - you have to start it with
16944 * g_dbus_server_start().
16946 * See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
16949 * This is a synchronous failable constructor. See
16950 * g_dbus_server_new() for the asynchronous version.
16952 * Returns: A #GDBusServer or %NULL if @error is set. Free with g_object_unref().
16958 * g_dbus_server_start:
16959 * @server: A #GDBusServer.
16968 * g_dbus_server_stop:
16969 * @server: A #GDBusServer.
16978 * g_dbus_signal_info_ref:
16979 * @info: A #GDBusSignalInfo
16981 * If @info is statically allocated does nothing. Otherwise increases
16982 * the reference count.
16984 * Returns: The same @info.
16990 * g_dbus_signal_info_unref:
16991 * @info: A #GDBusSignalInfo.
16993 * If @info is statically allocated, does nothing. Otherwise decreases
16994 * the reference count of @info. When its reference count drops to 0,
16995 * the memory used is freed.
17002 * g_desktop_app_info_get_categories:
17003 * @info: a #GDesktopAppInfo
17005 * Gets the categories from the desktop file.
17007 * Returns: The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by ';' or validate it.
17012 * g_desktop_app_info_get_filename:
17013 * @info: a #GDesktopAppInfo
17015 * When @info was created from a known filename, return it. In some
17016 * situations such as the #GDesktopAppInfo returned from
17017 * g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
17019 * Returns: The full path to the file for @info, or %NULL if not known.
17025 * g_desktop_app_info_get_generic_name:
17026 * @info: a #GDesktopAppInfo
17028 * Gets the generic name from the destkop file.
17030 * Returns: The value of the GenericName key
17035 * g_desktop_app_info_get_is_hidden:
17036 * @info: a #GDesktopAppInfo.
17038 * A desktop file is hidden if the Hidden key in it is
17041 * Returns: %TRUE if hidden, %FALSE otherwise.
17046 * g_desktop_app_info_get_keywords:
17047 * @info: a #GDesktopAppInfo
17049 * Gets the keywords from the desktop file.
17051 * Returns: (transfer none): The value of the Keywords key
17057 * g_desktop_app_info_get_nodisplay:
17058 * @info: a #GDesktopAppInfo
17060 * Gets the value of the NoDisplay key, which helps determine if the
17061 * application info should be shown in menus. See
17062 * #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
17064 * Returns: The value of the NoDisplay key
17070 * g_desktop_app_info_get_show_in:
17071 * @info: a #GDesktopAppInfo
17072 * @desktop_env: a string specifying a desktop name
17074 * Checks if the application info should be shown in menus that list available
17075 * applications for a specific name of the desktop, based on the
17076 * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
17078 * If @desktop_env is %NULL, then the name of the desktop set with
17079 * g_desktop_app_info_set_desktop_env() is used.
17081 * Note that g_app_info_should_show() for @info will include this check (with
17082 * %NULL for @desktop_env) as well as additional checks.
17084 * Returns: %TRUE if the @info should be shown in @desktop_env according to the <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE otherwise.
17090 * g_desktop_app_info_get_startup_wm_class:
17091 * @info: a #GDesktopAppInfo that supports startup notify
17093 * Retrieves the StartupWMClass field from @info. This represents the
17094 * WM_CLASS property of the main window of the application, if launched
17097 * Returns: (transfer none): the startup WM class, or %NULL if none is set in the desktop file.
17103 * g_desktop_app_info_launch_uris_as_manager:
17104 * @appinfo: a #GDesktopAppInfo
17105 * @uris: (element-type utf8): List of URIs
17106 * @launch_context: a #GAppLaunchContext
17107 * @spawn_flags: #GSpawnFlags, used for each process
17108 * @user_setup: (scope call): a #GSpawnChildSetupFunc, used once for each process.
17109 * @user_setup_data: (closure user_setup): User data for @user_setup
17110 * @pid_callback: (scope call): Callback for child processes
17111 * @pid_callback_data: (closure pid_callback): User data for @callback
17112 * @error: return location for a #GError, or %NULL
17114 * This function performs the equivalent of g_app_info_launch_uris(),
17115 * but is intended primarily for operating system components that
17116 * launch applications. Ordinary applications should use
17117 * g_app_info_launch_uris().
17119 * In contrast to g_app_info_launch_uris(), all processes created will
17120 * always be run directly as children as if by the UNIX fork()/exec()
17123 * This guarantee allows additional control over the exact environment
17124 * of the child processes, which is provided via a setup function
17125 * @user_setup, as well as the process identifier of each child process
17126 * via @pid_callback. See g_spawn_async() for more information about the
17127 * semantics of the @user_setup function.
17129 * Returns: %TRUE on successful launch, %FALSE otherwise.
17134 * g_desktop_app_info_lookup_get_default_for_uri_scheme:
17135 * @lookup: a #GDesktopAppInfoLookup
17136 * @uri_scheme: a string containing a URI scheme.
17138 * Gets the default application for launching applications
17139 * using this URI scheme for a particular GDesktopAppInfoLookup
17142 * The GDesktopAppInfoLookup interface and this function is used
17143 * to implement g_app_info_get_default_for_uri_scheme() backends
17144 * in a GIO module. There is no reason for applications to use it
17145 * directly. Applications should use g_app_info_get_default_for_uri_scheme().
17147 * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
17148 * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
17153 * g_desktop_app_info_new:
17154 * @desktop_id: the desktop file id
17156 * Creates a new #GDesktopAppInfo based on a desktop file id.
17158 * A desktop file id is the basename of the desktop file, including the
17159 * .desktop extension. GIO is looking for a desktop file with this name
17160 * in the <filename>applications</filename> subdirectories of the XDG data
17161 * directories (i.e. the directories specified in the
17162 * <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
17163 * variables). GIO also supports the prefix-to-subdirectory mapping that is
17164 * described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
17165 * (i.e. a desktop id of kde-foo.desktop will match
17166 * <filename>/usr/share/applications/kde/foo.desktop</filename>).
17168 * Returns: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
17173 * g_desktop_app_info_new_from_filename:
17174 * @filename: the path of a desktop file, in the GLib filename encoding
17176 * Creates a new #GDesktopAppInfo.
17178 * Returns: a new #GDesktopAppInfo or %NULL on error.
17183 * g_desktop_app_info_new_from_keyfile:
17184 * @key_file: an opened #GKeyFile
17186 * Creates a new #GDesktopAppInfo.
17188 * Returns: a new #GDesktopAppInfo or %NULL on error.
17194 * g_desktop_app_info_set_desktop_env:
17195 * @desktop_env: a string specifying what desktop this is
17197 * Sets the name of the desktop that the application is running in.
17198 * This is used by g_app_info_should_show() and
17199 * g_desktop_app_info_get_show_in() to evaluate the
17200 * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
17201 * desktop entry fields.
17203 * The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
17204 * Menu specification</ulink> recognizes the following:
17206 * <member>GNOME</member>
17207 * <member>KDE</member>
17208 * <member>ROX</member>
17209 * <member>XFCE</member>
17210 * <member>LXDE</member>
17211 * <member>Unity</member>
17212 * <member>Old</member>
17215 * Should be called only once; subsequent calls are ignored.
17220 * g_drive_can_eject:
17221 * @drive: a #GDrive.
17223 * Checks if a drive can be ejected.
17225 * Returns: %TRUE if the @drive can be ejected, %FALSE otherwise.
17230 * g_drive_can_poll_for_media:
17231 * @drive: a #GDrive.
17233 * Checks if a drive can be polled for media changes.
17235 * Returns: %TRUE if the @drive can be polled for media changes, %FALSE otherwise.
17240 * g_drive_can_start:
17241 * @drive: a #GDrive.
17243 * Checks if a drive can be started.
17245 * Returns: %TRUE if the @drive can be started, %FALSE otherwise.
17251 * g_drive_can_start_degraded:
17252 * @drive: a #GDrive.
17254 * Checks if a drive can be started degraded.
17256 * Returns: %TRUE if the @drive can be started degraded, %FALSE otherwise.
17262 * g_drive_can_stop:
17263 * @drive: a #GDrive.
17265 * Checks if a drive can be stopped.
17267 * Returns: %TRUE if the @drive can be stopped, %FALSE otherwise.
17274 * @drive: a #GDrive.
17275 * @flags: flags affecting the unmount if required for eject
17276 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17277 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
17278 * @user_data: user data to pass to @callback
17280 * Asynchronously ejects a drive.
17282 * When the operation is finished, @callback will be called.
17283 * You can then call g_drive_eject_finish() to obtain the
17284 * result of the operation.
17286 * Deprecated: 2.22: Use g_drive_eject_with_operation() instead.
17291 * g_drive_eject_finish:
17292 * @drive: a #GDrive.
17293 * @result: a #GAsyncResult.
17294 * @error: a #GError, or %NULL
17296 * Finishes ejecting a drive.
17298 * Returns: %TRUE if the drive has been ejected successfully, %FALSE otherwise.
17299 * Deprecated: 2.22: Use g_drive_eject_with_operation_finish() instead.
17304 * g_drive_eject_with_operation:
17305 * @drive: a #GDrive.
17306 * @flags: flags affecting the unmount if required for eject
17307 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
17308 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17309 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
17310 * @user_data: user data passed to @callback.
17312 * Ejects a drive. This is an asynchronous operation, and is
17313 * finished by calling g_drive_eject_with_operation_finish() with the @drive
17314 * and #GAsyncResult data returned in the @callback.
17321 * g_drive_eject_with_operation_finish:
17322 * @drive: a #GDrive.
17323 * @result: a #GAsyncResult.
17324 * @error: a #GError location to store the error occurring, or %NULL to ignore.
17326 * Finishes ejecting a drive. If any errors occurred during the operation,
17327 * @error will be set to contain the errors and %FALSE will be returned.
17329 * Returns: %TRUE if the drive was successfully ejected. %FALSE otherwise.
17335 * g_drive_enumerate_identifiers:
17336 * @drive: a #GDrive
17338 * Gets the kinds of identifiers that @drive has.
17339 * Use g_drive_get_identifier() to obtain the identifiers
17342 * Returns: (transfer full) (array zero-terminated=1): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
17347 * g_drive_get_icon:
17348 * @drive: a #GDrive.
17350 * Gets the icon for @drive.
17352 * Returns: (transfer full): #GIcon for the @drive. Free the returned object with g_object_unref().
17357 * g_drive_get_identifier:
17358 * @drive: a #GDrive
17359 * @kind: the kind of identifier to return
17361 * Gets the identifier of the given kind for @drive.
17363 * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GDrive doesn't have this kind of identifier.
17368 * g_drive_get_name:
17369 * @drive: a #GDrive.
17371 * Gets the name of @drive.
17373 * Returns: a string containing @drive's name. The returned string should be freed when no longer needed.
17378 * g_drive_get_sort_key:
17379 * @drive: A #GDrive.
17381 * Gets the sort key for @drive, if any.
17383 * Returns: Sorting key for @drive or %NULL if no such key is available.
17389 * g_drive_get_start_stop_type:
17390 * @drive: a #GDrive.
17392 * Gets a hint about how a drive can be started/stopped.
17394 * Returns: A value from the #GDriveStartStopType enumeration.
17400 * g_drive_get_symbolic_icon:
17401 * @drive: a #GDrive.
17403 * Gets the icon for @drive.
17405 * Returns: (transfer full): symbolic #GIcon for the @drive. Free the returned object with g_object_unref().
17411 * g_drive_get_volumes:
17412 * @drive: a #GDrive.
17414 * Get a list of mountable volumes for @drive.
17416 * The returned list should be freed with g_list_free(), after
17417 * its elements have been unreffed with g_object_unref().
17419 * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive.
17424 * g_drive_has_media:
17425 * @drive: a #GDrive.
17427 * Checks if the @drive has media. Note that the OS may not be polling
17428 * the drive for media changes; see g_drive_is_media_check_automatic()
17429 * for more details.
17431 * Returns: %TRUE if @drive has media, %FALSE otherwise.
17436 * g_drive_has_volumes:
17437 * @drive: a #GDrive.
17439 * Check if @drive has any mountable volumes.
17441 * Returns: %TRUE if the @drive contains volumes, %FALSE otherwise.
17446 * g_drive_is_media_check_automatic:
17447 * @drive: a #GDrive.
17449 * Checks if @drive is capabable of automatically detecting media changes.
17451 * Returns: %TRUE if the @drive is capabable of automatically detecting media changes, %FALSE otherwise.
17456 * g_drive_is_media_removable:
17457 * @drive: a #GDrive.
17459 * Checks if the @drive supports removable media.
17461 * Returns: %TRUE if @drive supports removable media, %FALSE otherwise.
17466 * g_drive_poll_for_media:
17467 * @drive: a #GDrive.
17468 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17469 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
17470 * @user_data: user data to pass to @callback
17472 * Asynchronously polls @drive to see if media has been inserted or removed.
17474 * When the operation is finished, @callback will be called.
17475 * You can then call g_drive_poll_for_media_finish() to obtain the
17476 * result of the operation.
17481 * g_drive_poll_for_media_finish:
17482 * @drive: a #GDrive.
17483 * @result: a #GAsyncResult.
17484 * @error: a #GError, or %NULL
17486 * Finishes an operation started with g_drive_poll_for_media() on a drive.
17488 * Returns: %TRUE if the drive has been poll_for_mediaed successfully, %FALSE otherwise.
17494 * @drive: a #GDrive.
17495 * @flags: flags affecting the start operation.
17496 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
17497 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17498 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
17499 * @user_data: user data to pass to @callback
17501 * Asynchronously starts a drive.
17503 * When the operation is finished, @callback will be called.
17504 * You can then call g_drive_start_finish() to obtain the
17505 * result of the operation.
17512 * g_drive_start_finish:
17513 * @drive: a #GDrive.
17514 * @result: a #GAsyncResult.
17515 * @error: a #GError, or %NULL
17517 * Finishes starting a drive.
17519 * Returns: %TRUE if the drive has been started successfully, %FALSE otherwise.
17526 * @drive: a #GDrive.
17527 * @flags: flags affecting the unmount if required for stopping.
17528 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
17529 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17530 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
17531 * @user_data: user data to pass to @callback
17533 * Asynchronously stops a drive.
17535 * When the operation is finished, @callback will be called.
17536 * You can then call g_drive_stop_finish() to obtain the
17537 * result of the operation.
17544 * g_drive_stop_finish:
17545 * @drive: a #GDrive.
17546 * @result: a #GAsyncResult.
17547 * @error: a #GError, or %NULL
17549 * Finishes stopping a drive.
17551 * Returns: %TRUE if the drive has been stopped successfully, %FALSE otherwise.
17557 * g_emblem_get_icon:
17558 * @emblem: a #GEmblem from which the icon should be extracted.
17560 * Gives back the icon from @emblem.
17562 * Returns: (transfer none): a #GIcon. The returned object belongs to the emblem and should not be modified or freed.
17568 * g_emblem_get_origin:
17569 * @emblem: a #GEmblem
17571 * Gets the origin of the emblem.
17573 * Returns: (transfer none): the origin of the emblem
17580 * @icon: a GIcon containing the icon.
17582 * Creates a new emblem for @icon.
17584 * Returns: a new #GEmblem.
17590 * g_emblem_new_with_origin:
17591 * @icon: a GIcon containing the icon.
17592 * @origin: a GEmblemOrigin enum defining the emblem's origin
17594 * Creates a new emblem for @icon.
17596 * Returns: a new #GEmblem.
17602 * g_emblemed_icon_add_emblem:
17603 * @emblemed: a #GEmblemedIcon
17604 * @emblem: a #GEmblem
17606 * Adds @emblem to the #GList of #GEmblem <!-- -->s.
17613 * g_emblemed_icon_clear_emblems:
17614 * @emblemed: a #GEmblemedIcon
17616 * Removes all the emblems from @icon.
17623 * g_emblemed_icon_get_emblems:
17624 * @emblemed: a #GEmblemedIcon
17626 * Gets the list of emblems for the @icon.
17628 * Returns: (element-type Gio.Emblem) (transfer none): a #GList of #GEmblem <!-- -->s that is owned by @emblemed
17634 * g_emblemed_icon_get_icon:
17635 * @emblemed: a #GEmblemedIcon
17637 * Gets the main icon for @emblemed.
17639 * Returns: (transfer none): a #GIcon that is owned by @emblemed
17645 * g_emblemed_icon_new:
17647 * @emblem: (allow-none): a #GEmblem, or %NULL
17649 * Creates a new emblemed icon for @icon with the emblem @emblem.
17651 * Returns: (transfer full) (type GEmblemedIcon): a new #GIcon
17657 * g_file_append_to:
17658 * @file: input #GFile
17659 * @flags: a set of #GFileCreateFlags
17660 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17661 * @error: a #GError, or %NULL
17663 * Gets an output stream for appending data to the file.
17664 * If the file doesn't already exist it is created.
17666 * By default files created are generally readable by everyone,
17667 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17668 * will be made readable only to the current user, to the level that
17669 * is supported on the target filesystem.
17671 * If @cancellable is not %NULL, then the operation can be cancelled
17672 * by triggering the cancellable object from another thread. If the
17673 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17676 * Some file systems don't allow all file names, and may return an
17677 * %G_IO_ERROR_INVALID_FILENAME error. If the file is a directory the
17678 * %G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are
17679 * possible too, and depend on what kind of filesystem the file is on.
17681 * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
17686 * g_file_append_to_async:
17687 * @file: input #GFile
17688 * @flags: a set of #GFileCreateFlags
17689 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17690 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17691 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17692 * @user_data: (closure): the data to pass to callback function
17694 * Asynchronously opens @file for appending.
17696 * For more details, see g_file_append_to() which is
17697 * the synchronous version of this call.
17699 * When the operation is finished, @callback will be called.
17700 * You can then call g_file_append_to_finish() to get the result
17701 * of the operation.
17706 * g_file_append_to_finish:
17707 * @file: input #GFile
17708 * @res: #GAsyncResult
17709 * @error: a #GError, or %NULL
17711 * Finishes an asynchronous file append operation started with
17712 * g_file_append_to_async().
17714 * Returns: (transfer full): a valid #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17719 * g_file_attribute_info_list_add:
17720 * @list: a #GFileAttributeInfoList.
17721 * @name: the name of the attribute to add.
17722 * @type: the #GFileAttributeType for the attribute.
17723 * @flags: #GFileAttributeInfoFlags for the attribute.
17725 * Adds a new attribute with @name to the @list, setting
17726 * its @type and @flags.
17731 * g_file_attribute_info_list_dup:
17732 * @list: a #GFileAttributeInfoList to duplicate.
17734 * Makes a duplicate of a file attribute info list.
17736 * Returns: a copy of the given @list.
17741 * g_file_attribute_info_list_lookup:
17742 * @list: a #GFileAttributeInfoList.
17743 * @name: the name of the attribute to lookup.
17745 * Gets the file attribute with the name @name from @list.
17747 * Returns: a #GFileAttributeInfo for the @name, or %NULL if an attribute isn't found.
17752 * g_file_attribute_info_list_new:
17754 * Creates a new file attribute info list.
17756 * Returns: a #GFileAttributeInfoList.
17761 * g_file_attribute_info_list_ref:
17762 * @list: a #GFileAttributeInfoList to reference.
17764 * References a file attribute info list.
17766 * Returns: #GFileAttributeInfoList or %NULL on error.
17771 * g_file_attribute_info_list_unref:
17772 * @list: The #GFileAttributeInfoList to unreference.
17774 * Removes a reference from the given @list. If the reference count
17775 * falls to zero, the @list is deleted.
17780 * g_file_attribute_matcher_enumerate_namespace:
17781 * @matcher: a #GFileAttributeMatcher.
17782 * @ns: a string containing a file attribute namespace.
17784 * Checks if the matcher will match all of the keys in a given namespace.
17785 * This will always return %TRUE if a wildcard character is in use (e.g. if
17786 * matcher was created with "standard::*" and @ns is "standard", or if matcher was created
17787 * using "*" and namespace is anything.)
17789 * TODO: this is awkwardly worded.
17791 * Returns: %TRUE if the matcher matches all of the entries in the given @ns, %FALSE otherwise.
17796 * g_file_attribute_matcher_enumerate_next:
17797 * @matcher: a #GFileAttributeMatcher.
17799 * Gets the next matched attribute from a #GFileAttributeMatcher.
17801 * Returns: a string containing the next attribute or %NULL if no more attribute exist.
17806 * g_file_attribute_matcher_matches:
17807 * @matcher: a #GFileAttributeMatcher.
17808 * @attribute: a file attribute key.
17810 * Checks if an attribute will be matched by an attribute matcher. If
17811 * the matcher was created with the "*" matching string, this function
17812 * will always return %TRUE.
17814 * Returns: %TRUE if @attribute matches @matcher. %FALSE otherwise.
17819 * g_file_attribute_matcher_matches_only:
17820 * @matcher: a #GFileAttributeMatcher.
17821 * @attribute: a file attribute key.
17823 * Checks if a attribute matcher only matches a given attribute. Always
17824 * returns %FALSE if "*" was used when creating the matcher.
17826 * Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
17831 * g_file_attribute_matcher_new:
17832 * @attributes: an attribute string to match.
17834 * Creates a new file attribute matcher, which matches attributes
17835 * against a given string. #GFileAttributeMatcher<!-- -->s are reference
17836 * counted structures, and are created with a reference count of 1. If
17837 * the number of references falls to 0, the #GFileAttributeMatcher is
17838 * automatically destroyed.
17840 * The @attribute string should be formatted with specific keys separated
17841 * from namespaces with a double colon. Several "namespace::key" strings may be
17842 * concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
17843 * The wildcard "*" may be used to match all keys and namespaces, or
17844 * "namespace::*" will match all keys in a given namespace.
17846 * Examples of strings to use:
17848 * <title>File Attribute Matcher strings and results</title>
17849 * <tgroup cols='2' align='left'><thead>
17850 * <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
17852 * <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
17853 * <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
17854 * <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
17855 * all keys in the unix namespace.</entry></row>
17856 * </tbody></tgroup>
17859 * Returns: a #GFileAttributeMatcher.
17864 * g_file_attribute_matcher_ref:
17865 * @matcher: a #GFileAttributeMatcher.
17867 * References a file attribute matcher.
17869 * Returns: a #GFileAttributeMatcher.
17874 * g_file_attribute_matcher_subtract:
17875 * @matcher: Matcher to subtract from
17876 * @subtract: The matcher to subtract
17878 * Subtracts all attributes of @subtract from @matcher and returns
17879 * a matcher that supports those attributes.
17881 * Note that currently it is not possible to remove a single
17882 * attribute when the @matcher matches the whole namespace - or remove
17883 * a namespace or attribute when the matcher matches everything. This
17884 * is a limitation of the current implementation, but may be fixed
17887 * Returns: A file attribute matcher matching all attributes of @matcher that are not matched by @subtract
17892 * g_file_attribute_matcher_to_string:
17893 * @matcher: (allow-none): a #GFileAttributeMatcher.
17895 * Prints what the matcher is matching against. The format will be
17896 * equal to the format passed to g_file_attribute_matcher_new().
17897 * The output however, might not be identical, as the matcher may
17898 * decide to use a different order or omit needless parts.
17900 * Returns: a string describing the attributes the matcher matches against or %NULL if @matcher was %NULL.
17906 * g_file_attribute_matcher_unref:
17907 * @matcher: a #GFileAttributeMatcher.
17909 * Unreferences @matcher. If the reference count falls below 1,
17910 * the @matcher is automatically freed.
17916 * @source: input #GFile
17917 * @destination: destination #GFile
17918 * @flags: set of #GFileCopyFlags
17919 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17920 * @progress_callback: (allow-none) (scope call): function to callback with progress information, or %NULL if progress information is not needed
17921 * @progress_callback_data: (closure): user data to pass to @progress_callback
17922 * @error: #GError to set on error, or %NULL
17924 * Copies the file @source to the location specified by @destination.
17925 * Can not handle recursive copies of directories.
17927 * If the flag #G_FILE_COPY_OVERWRITE is specified an already
17928 * existing @destination file is overwritten.
17930 * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
17931 * will be copied as symlinks, otherwise the target of the
17932 * @source symlink will be copied.
17934 * If @cancellable is not %NULL, then the operation can be cancelled by
17935 * triggering the cancellable object from another thread. If the operation
17936 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17938 * If @progress_callback is not %NULL, then the operation can be monitored
17939 * by setting this to a #GFileProgressCallback function.
17940 * @progress_callback_data will be passed to this function. It is guaranteed
17941 * that this callback will be called after all data has been transferred with
17942 * the total number of bytes copied during the operation.
17944 * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND error
17945 * is returned, independent on the status of the @destination.
17947 * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then
17948 * the error %G_IO_ERROR_EXISTS is returned.
17950 * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
17951 * error is returned. If trying to overwrite a directory with a directory the
17952 * %G_IO_ERROR_WOULD_MERGE error is returned.
17954 * If the source is a directory and the target does not exist, or
17955 * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
17956 * %G_IO_ERROR_WOULD_RECURSE error is returned.
17958 * If you are interested in copying the #GFile object itself (not the on-disk
17959 * file), see g_file_dup().
17961 * Returns: %TRUE on success, %FALSE otherwise.
17966 * g_file_copy_async: (skip)
17967 * @source: input #GFile
17968 * @destination: destination #GFile
17969 * @flags: set of #GFileCopyFlags
17970 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17971 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17972 * @progress_callback: (allow-none): function to callback with progress information, or %NULL if progress information is not needed
17973 * @progress_callback_data: (closure): user data to pass to @progress_callback
17974 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17975 * @user_data: the data to pass to callback function
17977 * Copies the file @source to the location specified by @destination
17978 * asynchronously. For details of the behaviour, see g_file_copy().
17980 * If @progress_callback is not %NULL, then that function that will be called
17981 * just like in g_file_copy(), however the callback will run in the main loop,
17982 * not in the thread that is doing the I/O operation.
17984 * When the operation is finished, @callback will be called. You can then call
17985 * g_file_copy_finish() to get the result of the operation.
17990 * g_file_copy_attributes:
17991 * @source: a #GFile with attributes
17992 * @destination: a #GFile to copy attributes to
17993 * @flags: a set of #GFileCopyFlags
17994 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17995 * @error: a #GError, %NULL to ignore
17997 * Copies the file attributes from @source to @destination.
17999 * Normally only a subset of the file attributes are copied,
18000 * those that are copies in a normal file copy operation
18001 * (which for instance does not include e.g. owner). However
18002 * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
18003 * all the metadata that is possible to copy is copied. This
18004 * is useful when implementing move by copy + delete source.
18006 * Returns: %TRUE if the attributes were copied successfully, %FALSE otherwise.
18011 * g_file_copy_finish:
18012 * @file: input #GFile
18013 * @res: a #GAsyncResult
18014 * @error: a #GError, or %NULL
18016 * Finishes copying the file started with g_file_copy_async().
18018 * Returns: a %TRUE on success, %FALSE on error.
18024 * @file: input #GFile
18025 * @flags: a set of #GFileCreateFlags
18026 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18027 * @error: a #GError, or %NULL
18029 * Creates a new file and returns an output stream for writing to it.
18030 * The file must not already exist.
18032 * By default files created are generally readable by everyone,
18033 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
18034 * will be made readable only to the current user, to the level
18035 * that is supported on the target filesystem.
18037 * If @cancellable is not %NULL, then the operation can be cancelled
18038 * by triggering the cancellable object from another thread. If the
18039 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
18042 * If a file or directory with this name already exists the
18043 * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
18044 * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
18045 * error, and if the name is to long %G_IO_ERROR_FILENAME_TOO_LONG will
18046 * be returned. Other errors are possible too, and depend on what kind
18047 * of filesystem the file is on.
18049 * Returns: (transfer full): a #GFileOutputStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
18054 * g_file_create_async:
18055 * @file: input #GFile
18056 * @flags: a set of #GFileCreateFlags
18057 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
18058 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18059 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18060 * @user_data: (closure): the data to pass to callback function
18062 * Asynchronously creates a new file and returns an output stream
18063 * for writing to it. The file must not already exist.
18065 * For more details, see g_file_create() which is
18066 * the synchronous version of this call.
18068 * When the operation is finished, @callback will be called.
18069 * You can then call g_file_create_finish() to get the result
18070 * of the operation.
18075 * g_file_create_finish:
18076 * @file: input #GFile
18077 * @res: a #GAsyncResult
18078 * @error: a #GError, or %NULL
18080 * Finishes an asynchronous file create operation started with
18081 * g_file_create_async().
18083 * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
18088 * g_file_create_readwrite:
18090 * @flags: a set of #GFileCreateFlags
18091 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18092 * @error: return location for a #GError, or %NULL
18094 * Creates a new file and returns a stream for reading and
18095 * writing to it. The file must not already exist.
18097 * By default files created are generally readable by everyone,
18098 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
18099 * will be made readable only to the current user, to the level
18100 * that is supported on the target filesystem.
18102 * If @cancellable is not %NULL, then the operation can be cancelled
18103 * by triggering the cancellable object from another thread. If the
18104 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
18107 * If a file or directory with this name already exists, the
18108 * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
18109 * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
18110 * error, and if the name is too long, %G_IO_ERROR_FILENAME_TOO_LONG
18111 * will be returned. Other errors are possible too, and depend on what
18112 * kind of filesystem the file is on.
18114 * Note that in many non-local file cases read and write streams are
18115 * not supported, so make sure you really need to do read and write
18116 * streaming, rather than just opening for reading or writing.
18118 * Returns: (transfer full): a #GFileIOStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
18124 * g_file_create_readwrite_async:
18125 * @file: input #GFile
18126 * @flags: a set of #GFileCreateFlags
18127 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
18128 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18129 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18130 * @user_data: (closure): the data to pass to callback function
18132 * Asynchronously creates a new file and returns a stream
18133 * for reading and writing to it. The file must not already exist.
18135 * For more details, see g_file_create_readwrite() which is
18136 * the synchronous version of this call.
18138 * When the operation is finished, @callback will be called.
18139 * You can then call g_file_create_readwrite_finish() to get
18140 * the result of the operation.
18147 * g_file_create_readwrite_finish:
18148 * @file: input #GFile
18149 * @res: a #GAsyncResult
18150 * @error: a #GError, or %NULL
18152 * Finishes an asynchronous file create operation started with
18153 * g_file_create_readwrite_async().
18155 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
18162 * @file: input #GFile
18163 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18164 * @error: a #GError, or %NULL
18166 * Deletes a file. If the @file is a directory, it will only be
18167 * deleted if it is empty. This has the same semantics as g_unlink().
18169 * If @cancellable is not %NULL, then the operation can be cancelled by
18170 * triggering the cancellable object from another thread. If the operation
18171 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18173 * Virtual: delete_file
18174 * Returns: %TRUE if the file was deleted. %FALSE otherwise.
18179 * g_file_delete_async:
18180 * @file: input #GFile
18181 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
18182 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18183 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
18184 * @user_data: the data to pass to callback function
18186 * Asynchronously delete a file. If the @file is a directory, it will
18187 * only be deleted if it is empty. This has the same semantics as
18190 * Virtual: delete_file_async
18196 * g_file_delete_finish:
18197 * @file: input #GFile
18198 * @result: a #GAsyncResult
18199 * @error: a #GError, or %NULL
18201 * Finishes deleting a file started with g_file_delete_async().
18203 * Virtual: delete_file_finish
18209 * g_file_descriptor_based_get_fd:
18210 * @fd_based: a #GFileDescriptorBased.
18212 * Gets the underlying file descriptor.
18214 * Returns: The file descriptor
18221 * @file: input #GFile
18223 * Duplicates a #GFile handle. This operation does not duplicate
18224 * the actual file or directory represented by the #GFile; see
18225 * g_file_copy() if attempting to copy a file.
18227 * This call does no blocking I/O.
18229 * Returns: (transfer full): a new #GFile that is a duplicate of the given #GFile.
18234 * g_file_eject_mountable:
18235 * @file: input #GFile
18236 * @flags: flags affecting the operation
18237 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18238 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
18239 * @user_data: (closure): the data to pass to callback function
18241 * Starts an asynchronous eject on a mountable.
18242 * When this operation has completed, @callback will be called with
18243 * @user_user data, and the operation can be finalized with
18244 * g_file_eject_mountable_finish().
18246 * If @cancellable is not %NULL, then the operation can be cancelled by
18247 * triggering the cancellable object from another thread. If the operation
18248 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18250 * Deprecated: 2.22: Use g_file_eject_mountable_with_operation() instead.
18255 * g_file_eject_mountable_finish:
18256 * @file: input #GFile
18257 * @result: a #GAsyncResult
18258 * @error: a #GError, or %NULL
18260 * Finishes an asynchronous eject operation started by
18261 * g_file_eject_mountable().
18263 * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
18264 * Deprecated: 2.22: Use g_file_eject_mountable_with_operation_finish() instead.
18269 * g_file_eject_mountable_with_operation:
18270 * @file: input #GFile
18271 * @flags: flags affecting the operation
18272 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
18273 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18274 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
18275 * @user_data: (closure): the data to pass to callback function
18277 * Starts an asynchronous eject on a mountable.
18278 * When this operation has completed, @callback will be called with
18279 * @user_user data, and the operation can be finalized with
18280 * g_file_eject_mountable_with_operation_finish().
18282 * If @cancellable is not %NULL, then the operation can be cancelled by
18283 * triggering the cancellable object from another thread. If the operation
18284 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18291 * g_file_eject_mountable_with_operation_finish:
18292 * @file: input #GFile
18293 * @result: a #GAsyncResult
18294 * @error: a #GError, or %NULL
18296 * Finishes an asynchronous eject operation started by
18297 * g_file_eject_mountable_with_operation().
18299 * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
18305 * g_file_enumerate_children:
18306 * @file: input #GFile
18307 * @attributes: an attribute query string
18308 * @flags: a set of #GFileQueryInfoFlags
18309 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18310 * @error: #GError for error reporting
18312 * Gets the requested information about the files in a directory.
18313 * The result is a #GFileEnumerator object that will give out
18314 * #GFileInfo objects for all the files in the directory.
18316 * The @attributes value is a string that specifies the file
18317 * attributes that should be gathered. It is not an error if
18318 * it's not possible to read a particular requested attribute
18319 * from a file - it just won't be set. @attributes should
18320 * be a comma-separated list of attributes or attribute wildcards.
18321 * The wildcard "*" means all attributes, and a wildcard like
18322 * "standard::*" means all attributes in the standard namespace.
18323 * An example attribute query be "standard::*,owner::user".
18324 * The standard attributes are available as defines, like
18325 * #G_FILE_ATTRIBUTE_STANDARD_NAME.
18327 * If @cancellable is not %NULL, then the operation can be cancelled
18328 * by triggering the cancellable object from another thread. If the
18329 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
18332 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
18333 * be returned. If the file is not a directory, the %G_FILE_ERROR_NOTDIR
18334 * error will be returned. Other errors are possible too.
18336 * Returns: (transfer full): A #GFileEnumerator if successful, %NULL on error. Free the returned object with g_object_unref().
18341 * g_file_enumerate_children_async:
18342 * @file: input #GFile
18343 * @attributes: an attribute query string
18344 * @flags: a set of #GFileQueryInfoFlags
18345 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
18346 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18347 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18348 * @user_data: (closure): the data to pass to callback function
18350 * Asynchronously gets the requested information about the files
18351 * in a directory. The result is a #GFileEnumerator object that will
18352 * give out #GFileInfo objects for all the files in the directory.
18354 * For more details, see g_file_enumerate_children() which is
18355 * the synchronous version of this call.
18357 * When the operation is finished, @callback will be called. You can
18358 * then call g_file_enumerate_children_finish() to get the result of
18364 * g_file_enumerate_children_finish:
18365 * @file: input #GFile
18366 * @res: a #GAsyncResult
18367 * @error: a #GError
18369 * Finishes an async enumerate children operation.
18370 * See g_file_enumerate_children_async().
18372 * Returns: (transfer full): a #GFileEnumerator or %NULL if an error occurred. Free the returned object with g_object_unref().
18377 * g_file_enumerator_close:
18378 * @enumerator: a #GFileEnumerator.
18379 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18380 * @error: location to store the error occurring, or %NULL to ignore
18382 * Releases all resources used by this enumerator, making the
18383 * enumerator return %G_IO_ERROR_CLOSED on all calls.
18385 * This will be automatically called when the last reference
18386 * is dropped, but you might want to call this function to make
18387 * sure resources are released as early as possible.
18389 * Returns: #TRUE on success or #FALSE on error.
18394 * g_file_enumerator_close_async:
18395 * @enumerator: a #GFileEnumerator.
18396 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18397 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18398 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18399 * @user_data: (closure): the data to pass to callback function
18401 * Asynchronously closes the file enumerator.
18403 * If @cancellable is not %NULL, then the operation can be cancelled by
18404 * triggering the cancellable object from another thread. If the operation
18405 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
18406 * g_file_enumerator_close_finish().
18411 * g_file_enumerator_close_finish:
18412 * @enumerator: a #GFileEnumerator.
18413 * @result: a #GAsyncResult.
18414 * @error: a #GError location to store the error occurring, or %NULL to ignore.
18416 * Finishes closing a file enumerator, started from g_file_enumerator_close_async().
18418 * If the file enumerator was already closed when g_file_enumerator_close_async()
18419 * was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
18420 * return %FALSE. If the file enumerator had pending operation when the close
18421 * operation was started, then this function will report %G_IO_ERROR_PENDING, and
18422 * return %FALSE. If @cancellable was not %NULL, then the operation may have been
18423 * cancelled by triggering the cancellable object from another thread. If the operation
18424 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
18427 * Returns: %TRUE if the close operation has finished successfully.
18432 * g_file_enumerator_get_container:
18433 * @enumerator: a #GFileEnumerator
18435 * Get the #GFile container which is being enumerated.
18437 * Returns: (transfer none): the #GFile which is being enumerated.
18443 * g_file_enumerator_has_pending:
18444 * @enumerator: a #GFileEnumerator.
18446 * Checks if the file enumerator has pending operations.
18448 * Returns: %TRUE if the @enumerator has pending operations.
18453 * g_file_enumerator_is_closed:
18454 * @enumerator: a #GFileEnumerator.
18456 * Checks if the file enumerator has been closed.
18458 * Returns: %TRUE if the @enumerator is closed.
18463 * g_file_enumerator_next_file:
18464 * @enumerator: a #GFileEnumerator.
18465 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18466 * @error: location to store the error occurring, or %NULL to ignore
18468 * Returns information for the next file in the enumerated object.
18469 * Will block until the information is available. The #GFileInfo
18470 * returned from this function will contain attributes that match the
18471 * attribute string that was passed when the #GFileEnumerator was created.
18473 * On error, returns %NULL and sets @error to the error. If the
18474 * enumerator is at the end, %NULL will be returned and @error will
18477 * 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.
18482 * g_file_enumerator_next_files_async:
18483 * @enumerator: a #GFileEnumerator.
18484 * @num_files: the number of file info objects to request
18485 * @io_priority: the <link linkend="io-priority">io priority</link> of the request.
18486 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18487 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18488 * @user_data: (closure): the data to pass to callback function
18490 * Request information for a number of files from the enumerator asynchronously.
18491 * When all i/o for the operation is finished the @callback will be called with
18492 * the requested information.
18494 * The callback can be called with less than @num_files files in case of error
18495 * or at the end of the enumerator. In case of a partial error the callback will
18496 * be called with any succeeding items and no error, and on the next request the
18497 * error will be reported. If a request is cancelled the callback will be called
18498 * with %G_IO_ERROR_CANCELLED.
18500 * During an async request no other sync and async calls are allowed, and will
18501 * result in %G_IO_ERROR_PENDING errors.
18503 * Any outstanding i/o request with higher priority (lower numerical value) will
18504 * be executed before an outstanding request with lower priority. Default
18505 * priority is %G_PRIORITY_DEFAULT.
18510 * g_file_enumerator_next_files_finish:
18511 * @enumerator: a #GFileEnumerator.
18512 * @result: a #GAsyncResult.
18513 * @error: a #GError location to store the error occurring, or %NULL to ignore.
18515 * Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
18517 * 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.
18522 * g_file_enumerator_set_pending:
18523 * @enumerator: a #GFileEnumerator.
18524 * @pending: a boolean value.
18526 * Sets the file enumerator as having pending operations.
18532 * @file1: the first #GFile
18533 * @file2: the second #GFile
18535 * Checks equality of two given #GFiles.
18537 * Note that two #GFiles that differ can still refer to the same
18538 * file on the filesystem due to various forms of filename
18541 * This call does no blocking I/O.
18543 * Returns: %TRUE if @file1 and @file2 are equal. %FALSE if either is not a #GFile.
18548 * g_file_find_enclosing_mount:
18549 * @file: input #GFile
18550 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18551 * @error: a #GError
18553 * Gets a #GMount for the #GFile.
18555 * If the #GFileIface for @file does not have a mount (e.g.
18556 * possibly a remote share), @error will be set to %G_IO_ERROR_NOT_FOUND
18557 * and %NULL will be returned.
18559 * If @cancellable is not %NULL, then the operation can be cancelled by
18560 * triggering the cancellable object from another thread. If the operation
18561 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18563 * Returns: (transfer full): a #GMount where the @file is located or %NULL on error. Free the returned object with g_object_unref().
18568 * g_file_find_enclosing_mount_async:
18570 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
18571 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18572 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18573 * @user_data: (closure): the data to pass to callback function
18575 * Asynchronously gets the mount for the file.
18577 * For more details, see g_file_find_enclosing_mount() which is
18578 * the synchronous version of this call.
18580 * When the operation is finished, @callback will be called.
18581 * You can then call g_file_find_enclosing_mount_finish() to
18582 * get the result of the operation.
18587 * g_file_find_enclosing_mount_finish:
18589 * @res: a #GAsyncResult
18590 * @error: a #GError
18592 * Finishes an asynchronous find mount request.
18593 * See g_file_find_enclosing_mount_async().
18595 * Returns: (transfer full): #GMount for given @file or %NULL on error. Free the returned object with g_object_unref().
18600 * g_file_get_basename:
18601 * @file: input #GFile
18603 * Gets the base name (the last component of the path) for a given #GFile.
18605 * If called for the top level of a system (such as the filesystem root
18606 * or a uri like sftp://host/) it will return a single directory separator
18607 * (and on Windows, possibly a drive letter).
18609 * The base name is a byte string (not UTF-8). It has no defined encoding
18610 * or rules other than it may not contain zero bytes. If you want to use
18611 * filenames in a user interface you should use the display name that you
18612 * can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
18613 * attribute with g_file_query_info().
18615 * This call does no blocking I/O.
18617 * 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.
18622 * g_file_get_child:
18623 * @file: input #GFile
18624 * @name: string containing the child's basename
18626 * Gets a child of @file with basename equal to @name.
18628 * Note that the file with that specific name might not exist, but
18629 * you can still have a #GFile that points to it. You can use this
18630 * for instance to create that file.
18632 * This call does no blocking I/O.
18634 * Returns: (transfer full): a #GFile to a child specified by @name. Free the returned object with g_object_unref().
18639 * g_file_get_child_for_display_name:
18640 * @file: input #GFile
18641 * @display_name: string to a possible child
18642 * @error: return location for an error
18644 * Gets the child of @file for a given @display_name (i.e. a UTF-8
18645 * version of the name). If this function fails, it returns %NULL
18646 * and @error will be set. This is very useful when constructing a
18647 * #GFile for a new file and the user entered the filename in the
18648 * user interface, for instance when you select a directory and
18649 * type a filename in the file selector.
18651 * This call does no blocking I/O.
18653 * 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().
18658 * g_file_get_parent:
18659 * @file: input #GFile
18661 * Gets the parent directory for the @file.
18662 * If the @file represents the root directory of the
18663 * file system, then %NULL will be returned.
18665 * This call does no blocking I/O.
18667 * 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().
18672 * g_file_get_parse_name:
18673 * @file: input #GFile
18675 * Gets the parse name of the @file.
18676 * A parse name is a UTF-8 string that describes the
18677 * file such that one can get the #GFile back using
18678 * g_file_parse_name().
18680 * This is generally used to show the #GFile as a nice
18681 * full-pathname kind of string in a user interface,
18682 * like in a location entry.
18684 * For local files with names that can safely be converted
18685 * to UTF-8 the pathname is used, otherwise the IRI is used
18686 * (a form of URI that allows UTF-8 characters unescaped).
18688 * This call does no blocking I/O.
18690 * Returns: a string containing the #GFile's parse name. The returned string should be freed with g_free() when no longer needed.
18696 * @file: input #GFile
18698 * Gets the local pathname for #GFile, if one exists.
18700 * This call does no blocking I/O.
18702 * 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.
18707 * g_file_get_relative_path:
18708 * @parent: input #GFile
18709 * @descendant: input #GFile
18711 * Gets the path for @descendant relative to @parent.
18713 * This call does no blocking I/O.
18715 * 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.
18721 * @file: input #GFile
18723 * Gets the URI for the @file.
18725 * This call does no blocking I/O.
18727 * Returns: a string containing the #GFile's URI. The returned string should be freed with g_free() when no longer needed.
18732 * g_file_get_uri_scheme:
18733 * @file: input #GFile
18735 * Gets the URI scheme for a #GFile.
18736 * RFC 3986 decodes the scheme as:
18738 * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
18739 * </programlisting>
18740 * Common schemes include "file", "http", "ftp", etc.
18742 * This call does no blocking I/O.
18744 * Returns: a string containing the URI scheme for the given #GFile. The returned string should be freed with g_free() when no longer needed.
18749 * g_file_has_parent:
18750 * @file: input #GFile
18751 * @parent: (allow-none): the parent to check for, or %NULL
18753 * Checks if @file has a parent, and optionally, if it is @parent.
18755 * If @parent is %NULL then this function returns %TRUE if @file has any
18756 * parent at all. If @parent is non-%NULL then %TRUE is only returned
18757 * if @file is a child of @parent.
18759 * Returns: %TRUE if @file is a child of @parent (or any parent in the case that @parent is %NULL).
18765 * g_file_has_prefix:
18766 * @file: input #GFile
18767 * @prefix: input #GFile
18769 * Checks whether @file has the prefix specified by @prefix.
18771 * In other words, if the names of initial elements of @file's
18772 * pathname match @prefix. Only full pathname elements are matched,
18773 * so a path like /foo is not considered a prefix of /foobar, only
18776 * This call does no I/O, as it works purely on names. As such it can
18777 * sometimes return %FALSE even if @file is inside a @prefix (from a
18778 * filesystem point of view), because the prefix of @file is an alias
18781 * Virtual: prefix_matches
18782 * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix, %FALSE otherwise.
18787 * g_file_has_uri_scheme:
18788 * @file: input #GFile
18789 * @uri_scheme: a string containing a URI scheme
18791 * Checks to see if a #GFile has a given URI scheme.
18793 * This call does no blocking I/O.
18795 * Returns: %TRUE if #GFile's backend supports the given URI scheme, %FALSE if URI scheme is %NULL, not supported, or #GFile is invalid.
18801 * @file: (type GFile): #gconstpointer to a #GFile
18803 * Creates a hash value for a #GFile.
18805 * This call does no blocking I/O.
18808 * 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.
18813 * g_file_icon_get_file:
18816 * Gets the #GFile associated with the given @icon.
18818 * Returns: (transfer none): a #GFile, or %NULL.
18826 * Creates a new icon for a file.
18828 * Returns: (transfer full) (type GFileIcon): a #GIcon for the given @file, or %NULL on error.
18833 * g_file_info_clear_status:
18834 * @info: a #GFileInfo.
18836 * Clears the status information from @info.
18841 * g_file_info_copy_into:
18842 * @src_info: source to copy attributes from.
18843 * @dest_info: destination to copy attributes to.
18845 * Copies all of the <link linkend="gio-GFileAttribute">GFileAttribute</link>s
18846 * from @src_info to @dest_info.
18852 * @other: a #GFileInfo.
18854 * Duplicates a file info structure.
18856 * Returns: (transfer full): a duplicate #GFileInfo of @other.
18861 * g_file_info_get_attribute_as_string:
18862 * @info: a #GFileInfo.
18863 * @attribute: a file attribute key.
18865 * Gets the value of a attribute, formated as a string.
18866 * This escapes things as needed to make the string valid
18869 * Returns: a UTF-8 string associated with the given @attribute. When you're done with the string it must be freed with g_free().
18874 * g_file_info_get_attribute_boolean:
18875 * @info: a #GFileInfo.
18876 * @attribute: a file attribute key.
18878 * Gets the value of a boolean attribute. If the attribute does not
18879 * contain a boolean value, %FALSE will be returned.
18881 * Returns: the boolean value contained within the attribute.
18886 * g_file_info_get_attribute_byte_string:
18887 * @info: a #GFileInfo.
18888 * @attribute: a file attribute key.
18890 * Gets the value of a byte string attribute. If the attribute does
18891 * not contain a byte string, %NULL will be returned.
18893 * Returns: the contents of the @attribute value as a byte string, or %NULL otherwise.
18898 * g_file_info_get_attribute_data:
18899 * @info: a #GFileInfo
18900 * @attribute: a file attribute key
18901 * @type: (out) (allow-none): return location for the attribute type, or %NULL
18902 * @value_pp: (out) (allow-none): return location for the attribute value, or %NULL
18903 * @status: (out) (allow-none): return location for the attribute status, or %NULL
18905 * Gets the attribute type, value and status for an attribute key.
18907 * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
18912 * g_file_info_get_attribute_int32:
18913 * @info: a #GFileInfo.
18914 * @attribute: a file attribute key.
18916 * Gets a signed 32-bit integer contained within the attribute. If the
18917 * attribute does not contain a signed 32-bit integer, or is invalid,
18918 * 0 will be returned.
18920 * Returns: a signed 32-bit integer from the attribute.
18925 * g_file_info_get_attribute_int64:
18926 * @info: a #GFileInfo.
18927 * @attribute: a file attribute key.
18929 * Gets a signed 64-bit integer contained within the attribute. If the
18930 * attribute does not contain an signed 64-bit integer, or is invalid,
18931 * 0 will be returned.
18933 * Returns: a signed 64-bit integer from the attribute.
18938 * g_file_info_get_attribute_object:
18939 * @info: a #GFileInfo.
18940 * @attribute: a file attribute key.
18942 * Gets the value of a #GObject attribute. If the attribute does
18943 * not contain a #GObject, %NULL will be returned.
18945 * Returns: (transfer none): a #GObject associated with the given @attribute, or %NULL otherwise.
18950 * g_file_info_get_attribute_status:
18951 * @info: a #GFileInfo
18952 * @attribute: a file attribute key
18954 * Gets the attribute status for an attribute key.
18956 * Returns: a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
18961 * g_file_info_get_attribute_string:
18962 * @info: a #GFileInfo.
18963 * @attribute: a file attribute key.
18965 * Gets the value of a string attribute. If the attribute does
18966 * not contain a string, %NULL will be returned.
18968 * Returns: the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
18973 * g_file_info_get_attribute_stringv:
18974 * @info: a #GFileInfo.
18975 * @attribute: a file attribute key.
18977 * Gets the value of a stringv attribute. If the attribute does
18978 * not contain a stringv, %NULL will be returned.
18980 * Returns: (transfer none): the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
18986 * g_file_info_get_attribute_type:
18987 * @info: a #GFileInfo.
18988 * @attribute: a file attribute key.
18990 * Gets the attribute type for an attribute key.
18992 * Returns: a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
18997 * g_file_info_get_attribute_uint32:
18998 * @info: a #GFileInfo.
18999 * @attribute: a file attribute key.
19001 * Gets an unsigned 32-bit integer contained within the attribute. If the
19002 * attribute does not contain an unsigned 32-bit integer, or is invalid,
19003 * 0 will be returned.
19005 * Returns: an unsigned 32-bit integer from the attribute.
19010 * g_file_info_get_attribute_uint64:
19011 * @info: a #GFileInfo.
19012 * @attribute: a file attribute key.
19014 * Gets a unsigned 64-bit integer contained within the attribute. If the
19015 * attribute does not contain an unsigned 64-bit integer, or is invalid,
19016 * 0 will be returned.
19018 * Returns: a unsigned 64-bit integer from the attribute.
19023 * g_file_info_get_content_type:
19024 * @info: a #GFileInfo.
19026 * Gets the file's content type.
19028 * Returns: a string containing the file's content type.
19033 * g_file_info_get_display_name:
19034 * @info: a #GFileInfo.
19036 * Gets a display name for a file.
19038 * Returns: a string containing the display name.
19043 * g_file_info_get_edit_name:
19044 * @info: a #GFileInfo.
19046 * Gets the edit name for a file.
19048 * Returns: a string containing the edit name.
19053 * g_file_info_get_etag:
19054 * @info: a #GFileInfo.
19056 * Gets the <link linkend="gfile-etag">entity tag</link> for a given
19057 * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
19059 * Returns: a string containing the value of the "etag:value" attribute.
19064 * g_file_info_get_file_type:
19065 * @info: a #GFileInfo.
19067 * Gets a file's type (whether it is a regular file, symlink, etc).
19068 * This is different from the file's content type, see g_file_info_get_content_type().
19070 * Returns: a #GFileType for the given file.
19075 * g_file_info_get_icon:
19076 * @info: a #GFileInfo.
19078 * Gets the icon for a file.
19080 * Returns: (transfer none): #GIcon for the given @info.
19085 * g_file_info_get_is_backup:
19086 * @info: a #GFileInfo.
19088 * Checks if a file is a backup file.
19090 * Returns: %TRUE if file is a backup file, %FALSE otherwise.
19095 * g_file_info_get_is_hidden:
19096 * @info: a #GFileInfo.
19098 * Checks if a file is hidden.
19100 * Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
19105 * g_file_info_get_is_symlink:
19106 * @info: a #GFileInfo.
19108 * Checks if a file is a symlink.
19110 * Returns: %TRUE if the given @info is a symlink.
19115 * g_file_info_get_modification_time:
19116 * @info: a #GFileInfo.
19117 * @result: (out caller-allocates): a #GTimeVal.
19119 * Gets the modification time of the current @info and sets it
19125 * g_file_info_get_name:
19126 * @info: a #GFileInfo.
19128 * Gets the name for a file.
19130 * Returns: a string containing the file name.
19135 * g_file_info_get_size:
19136 * @info: a #GFileInfo.
19138 * Gets the file's size.
19140 * Returns: a #goffset containing the file's size.
19145 * g_file_info_get_sort_order:
19146 * @info: a #GFileInfo.
19148 * Gets the value of the sort_order attribute from the #GFileInfo.
19149 * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
19151 * Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
19156 * g_file_info_get_symbolic_icon:
19157 * @info: a #GFileInfo.
19159 * Gets the symbolic icon for a file.
19161 * Returns: (transfer none): #GIcon for the given @info.
19167 * g_file_info_get_symlink_target:
19168 * @info: a #GFileInfo.
19170 * Gets the symlink target for a given #GFileInfo.
19172 * Returns: a string containing the symlink target.
19177 * g_file_info_has_attribute:
19178 * @info: a #GFileInfo.
19179 * @attribute: a file attribute key.
19181 * Checks if a file info structure has an attribute named @attribute.
19183 * Returns: %TRUE if @Ginfo has an attribute named @attribute, %FALSE otherwise.
19188 * g_file_info_has_namespace:
19189 * @info: a #GFileInfo.
19190 * @name_space: a file attribute namespace.
19192 * Checks if a file info structure has an attribute in the
19193 * specified @name_space.
19195 * Returns: %TRUE if @Ginfo has an attribute in @name_space, %FALSE otherwise.
19201 * g_file_info_list_attributes:
19202 * @info: a #GFileInfo.
19203 * @name_space: a file attribute key's namespace.
19205 * Lists the file info structure's attributes.
19207 * 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.
19214 * Creates a new file info structure.
19216 * Returns: a #GFileInfo.
19221 * g_file_info_remove_attribute:
19222 * @info: a #GFileInfo.
19223 * @attribute: a file attribute key.
19225 * Removes all cases of @attribute from @info if it exists.
19230 * g_file_info_set_attribute:
19231 * @info: a #GFileInfo.
19232 * @attribute: a file attribute key.
19233 * @type: a #GFileAttributeType
19234 * @value_p: pointer to the value
19236 * Sets the @attribute to contain the given value, if possible. To unset the
19237 * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
19242 * g_file_info_set_attribute_boolean:
19243 * @info: a #GFileInfo.
19244 * @attribute: a file attribute key.
19245 * @attr_value: a boolean value.
19247 * Sets the @attribute to contain the given @attr_value,
19253 * g_file_info_set_attribute_byte_string:
19254 * @info: a #GFileInfo.
19255 * @attribute: a file attribute key.
19256 * @attr_value: a byte string.
19258 * Sets the @attribute to contain the given @attr_value,
19264 * g_file_info_set_attribute_int32:
19265 * @info: a #GFileInfo.
19266 * @attribute: a file attribute key.
19267 * @attr_value: a signed 32-bit integer
19269 * Sets the @attribute to contain the given @attr_value,
19275 * g_file_info_set_attribute_int64:
19276 * @info: a #GFileInfo.
19277 * @attribute: attribute name to set.
19278 * @attr_value: int64 value to set attribute to.
19280 * Sets the @attribute to contain the given @attr_value,
19286 * g_file_info_set_attribute_mask:
19287 * @info: a #GFileInfo.
19288 * @mask: a #GFileAttributeMatcher.
19290 * Sets @mask on @info to match specific attribute types.
19295 * g_file_info_set_attribute_object:
19296 * @info: a #GFileInfo.
19297 * @attribute: a file attribute key.
19298 * @attr_value: a #GObject.
19300 * Sets the @attribute to contain the given @attr_value,
19306 * g_file_info_set_attribute_status:
19307 * @info: a #GFileInfo
19308 * @attribute: a file attribute key
19309 * @status: a #GFileAttributeStatus
19311 * Sets the attribute status for an attribute key. This is only
19312 * needed by external code that implement g_file_set_attributes_from_info()
19313 * or similar functions.
19315 * The attribute must exist in @info for this to work. Otherwise %FALSE
19316 * is returned and @info is unchanged.
19318 * Returns: %TRUE if the status was changed, %FALSE if the key was not set.
19324 * g_file_info_set_attribute_string:
19325 * @info: a #GFileInfo.
19326 * @attribute: a file attribute key.
19327 * @attr_value: a UTF-8 string.
19329 * Sets the @attribute to contain the given @attr_value,
19335 * g_file_info_set_attribute_stringv:
19336 * @info: a #GFileInfo.
19337 * @attribute: a file attribute key
19338 * @attr_value: (array) (element-type utf8): a %NULL terminated array of UTF-8 strings.
19340 * Sets the @attribute to contain the given @attr_value,
19348 * g_file_info_set_attribute_uint32:
19349 * @info: a #GFileInfo.
19350 * @attribute: a file attribute key.
19351 * @attr_value: an unsigned 32-bit integer.
19353 * Sets the @attribute to contain the given @attr_value,
19359 * g_file_info_set_attribute_uint64:
19360 * @info: a #GFileInfo.
19361 * @attribute: a file attribute key.
19362 * @attr_value: an unsigned 64-bit integer.
19364 * Sets the @attribute to contain the given @attr_value,
19370 * g_file_info_set_content_type:
19371 * @info: a #GFileInfo.
19372 * @content_type: a content type. See <link linkend="gio-GContentType">GContentType</link>.
19374 * Sets the content type attribute for a given #GFileInfo.
19375 * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
19380 * g_file_info_set_display_name:
19381 * @info: a #GFileInfo.
19382 * @display_name: a string containing a display name.
19384 * Sets the display name for the current #GFileInfo.
19385 * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
19390 * g_file_info_set_edit_name:
19391 * @info: a #GFileInfo.
19392 * @edit_name: a string containing an edit name.
19394 * Sets the edit name for the current file.
19395 * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
19400 * g_file_info_set_file_type:
19401 * @info: a #GFileInfo.
19402 * @type: a #GFileType.
19404 * Sets the file type in a #GFileInfo to @type.
19405 * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
19410 * g_file_info_set_icon:
19411 * @info: a #GFileInfo.
19414 * Sets the icon for a given #GFileInfo.
19415 * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
19420 * g_file_info_set_is_hidden:
19421 * @info: a #GFileInfo.
19422 * @is_hidden: a #gboolean.
19424 * Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
19425 * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
19430 * g_file_info_set_is_symlink:
19431 * @info: a #GFileInfo.
19432 * @is_symlink: a #gboolean.
19434 * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
19435 * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
19440 * g_file_info_set_modification_time:
19441 * @info: a #GFileInfo.
19442 * @mtime: a #GTimeVal.
19444 * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
19445 * info to the given time value.
19450 * g_file_info_set_name:
19451 * @info: a #GFileInfo.
19452 * @name: a string containing a name.
19454 * Sets the name attribute for the current #GFileInfo.
19455 * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
19460 * g_file_info_set_size:
19461 * @info: a #GFileInfo.
19462 * @size: a #goffset containing the file's size.
19464 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
19465 * to the given size.
19470 * g_file_info_set_sort_order:
19471 * @info: a #GFileInfo.
19472 * @sort_order: a sort order integer.
19474 * Sets the sort order attribute in the file info structure. See
19475 * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
19480 * g_file_info_set_symbolic_icon:
19481 * @info: a #GFileInfo.
19484 * Sets the symbolic icon for a given #GFileInfo.
19485 * See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
19492 * g_file_info_set_symlink_target:
19493 * @info: a #GFileInfo.
19494 * @symlink_target: a static string containing a path to a symlink target.
19496 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
19497 * to the given symlink target.
19502 * g_file_info_unset_attribute_mask:
19503 * @info: #GFileInfo.
19505 * Unsets a mask set by g_file_info_set_attribute_mask(), if one
19511 * g_file_input_stream_query_info:
19512 * @stream: a #GFileInputStream.
19513 * @attributes: a file attribute query string.
19514 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19515 * @error: a #GError location to store the error occurring, or %NULL to ignore.
19517 * Queries a file input stream the given @attributes. This function blocks
19518 * while querying the stream. For the asynchronous (non-blocking) version
19519 * of this function, see g_file_input_stream_query_info_async(). While the
19520 * stream is blocked, the stream will set the pending flag internally, and
19521 * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
19523 * Returns: (transfer full): a #GFileInfo, or %NULL on error.
19528 * g_file_input_stream_query_info_async:
19529 * @stream: a #GFileInputStream.
19530 * @attributes: a file attribute query string.
19531 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
19532 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19533 * @callback: (scope async): callback to call when the request is satisfied
19534 * @user_data: (closure): the data to pass to callback function
19536 * Queries the stream information asynchronously.
19537 * When the operation is finished @callback will be called.
19538 * You can then call g_file_input_stream_query_info_finish()
19539 * to get the result of the operation.
19541 * For the synchronous version of this function,
19542 * see g_file_input_stream_query_info().
19544 * If @cancellable is not %NULL, then the operation can be cancelled by
19545 * triggering the cancellable object from another thread. If the operation
19546 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set
19551 * g_file_input_stream_query_info_finish:
19552 * @stream: a #GFileInputStream.
19553 * @result: a #GAsyncResult.
19554 * @error: a #GError location to store the error occurring, or %NULL to ignore.
19556 * Finishes an asynchronous info query operation.
19558 * Returns: (transfer full): #GFileInfo.
19563 * g_file_io_stream_get_etag:
19564 * @stream: a #GFileIOStream.
19566 * Gets the entity tag for the file when it has been written.
19567 * This must be called after the stream has been written
19568 * and closed, as the etag can change while writing.
19570 * Returns: the entity tag for the stream.
19576 * g_file_io_stream_query_info:
19577 * @stream: a #GFileIOStream.
19578 * @attributes: a file attribute query string.
19579 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19580 * @error: a #GError, %NULL to ignore.
19582 * Queries a file io stream for the given @attributes.
19583 * This function blocks while querying the stream. For the asynchronous
19584 * version of this function, see g_file_io_stream_query_info_async().
19585 * While the stream is blocked, the stream will set the pending flag
19586 * internally, and any other operations on the stream will fail with
19587 * %G_IO_ERROR_PENDING.
19589 * Can fail if the stream was already closed (with @error being set to
19590 * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19591 * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19592 * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
19593 * all cases of failure, %NULL will be returned.
19595 * If @cancellable is not %NULL, then the operation can be cancelled by
19596 * triggering the cancellable object from another thread. If the operation
19597 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19600 * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19606 * g_file_io_stream_query_info_async:
19607 * @stream: a #GFileIOStream.
19608 * @attributes: a file attribute query string.
19609 * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19610 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19611 * @callback: (scope async): callback to call when the request is satisfied
19612 * @user_data: (closure): the data to pass to callback function
19614 * Asynchronously queries the @stream for a #GFileInfo. When completed,
19615 * @callback will be called with a #GAsyncResult which can be used to
19616 * finish the operation with g_file_io_stream_query_info_finish().
19618 * For the synchronous version of this function, see
19619 * g_file_io_stream_query_info().
19626 * g_file_io_stream_query_info_finish:
19627 * @stream: a #GFileIOStream.
19628 * @result: a #GAsyncResult.
19629 * @error: a #GError, %NULL to ignore.
19631 * Finalizes the asynchronous query started
19632 * by g_file_io_stream_query_info_async().
19634 * Returns: (transfer full): A #GFileInfo for the finished query.
19640 * g_file_is_native:
19641 * @file: input #GFile
19643 * Checks to see if a file is native to the platform.
19645 * A native file s one expressed in the platform-native filename format,
19646 * e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
19647 * as it might be on a locally mounted remote filesystem.
19649 * On some systems non-native files may be available using the native
19650 * filesystem via a userspace filesystem (FUSE), in these cases this call
19651 * will return %FALSE, but g_file_get_path() will still return a native path.
19653 * This call does no blocking I/O.
19655 * Returns: %TRUE if @file is native
19660 * g_file_load_contents:
19661 * @file: input #GFile
19662 * @cancellable: optional #GCancellable object, %NULL to ignore
19663 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19664 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19665 * @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
19666 * @error: a #GError, or %NULL
19668 * Loads the content of the file into memory. The data is always
19669 * zero-terminated, but this is not included in the resultant @length.
19670 * The returned @content should be freed with g_free() when no longer
19673 * If @cancellable is not %NULL, then the operation can be cancelled by
19674 * triggering the cancellable object from another thread. If the operation
19675 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19677 * Returns: %TRUE if the @file's contents were successfully loaded. %FALSE if there were errors.
19682 * g_file_load_contents_async:
19683 * @file: input #GFile
19684 * @cancellable: optional #GCancellable object, %NULL to ignore
19685 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19686 * @user_data: the data to pass to callback function
19688 * Starts an asynchronous load of the @file's contents.
19690 * For more details, see g_file_load_contents() which is
19691 * the synchronous version of this call.
19693 * When the load operation has completed, @callback will be called
19694 * with @user data. To finish the operation, call
19695 * g_file_load_contents_finish() with the #GAsyncResult returned by
19698 * If @cancellable is not %NULL, then the operation can be cancelled by
19699 * triggering the cancellable object from another thread. If the operation
19700 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19705 * g_file_load_contents_finish:
19706 * @file: input #GFile
19707 * @res: a #GAsyncResult
19708 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19709 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19710 * @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
19711 * @error: a #GError, or %NULL
19713 * Finishes an asynchronous load of the @file's contents.
19714 * The contents are placed in @contents, and @length is set to the
19715 * size of the @contents string. The @content should be freed with
19716 * g_free() when no longer needed. If @etag_out is present, it will be
19717 * set to the new entity tag for the @file.
19719 * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19724 * g_file_load_partial_contents_async: (skip)
19725 * @file: input #GFile
19726 * @cancellable: optional #GCancellable object, %NULL to ignore
19727 * @read_more_callback: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read
19728 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19729 * @user_data: the data to pass to the callback functions
19731 * Reads the partial contents of a file. A #GFileReadMoreCallback should
19732 * be used to stop reading from the file when appropriate, else this
19733 * function will behave exactly as g_file_load_contents_async(). This
19734 * operation can be finished by g_file_load_partial_contents_finish().
19736 * Users of this function should be aware that @user_data is passed to
19737 * both the @read_more_callback and the @callback.
19739 * If @cancellable is not %NULL, then the operation can be cancelled by
19740 * triggering the cancellable object from another thread. If the operation
19741 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19746 * g_file_load_partial_contents_finish:
19747 * @file: input #GFile
19748 * @res: a #GAsyncResult
19749 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19750 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19751 * @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
19752 * @error: a #GError, or %NULL
19754 * Finishes an asynchronous partial load operation that was started
19755 * with g_file_load_partial_contents_async(). The data is always
19756 * zero-terminated, but this is not included in the resultant @length.
19757 * The returned @content should be freed with g_free() when no longer
19760 * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19765 * g_file_make_directory:
19766 * @file: input #GFile
19767 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19768 * @error: a #GError, or %NULL
19770 * Creates a directory. Note that this will only create a child directory
19771 * of the immediate parent directory of the path or URI given by the #GFile.
19772 * To recursively create directories, see g_file_make_directory_with_parents().
19773 * This function will fail if the parent directory does not exist, setting
19774 * @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support
19775 * creating directories, this function will fail, setting @error to
19776 * %G_IO_ERROR_NOT_SUPPORTED.
19778 * For a local #GFile the newly created directory will have the default
19779 * (current) ownership and permissions of the current process.
19781 * If @cancellable is not %NULL, then the operation can be cancelled by
19782 * triggering the cancellable object from another thread. If the operation
19783 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19785 * Returns: %TRUE on successful creation, %FALSE otherwise.
19790 * g_file_make_directory_with_parents:
19791 * @file: input #GFile
19792 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19793 * @error: a #GError, or %NULL
19795 * Creates a directory and any parent directories that may not
19796 * exist similar to 'mkdir -p'. If the file system does not support
19797 * creating directories, this function will fail, setting @error to
19798 * %G_IO_ERROR_NOT_SUPPORTED. If the directory itself already exists,
19799 * this function will fail setting @error to %G_IO_ERROR_EXISTS, unlike
19800 * the similar g_mkdir_with_parents().
19802 * For a local #GFile the newly created directories will have the default
19803 * (current) ownership and permissions of the current process.
19805 * If @cancellable is not %NULL, then the operation can be cancelled by
19806 * triggering the cancellable object from another thread. If the operation
19807 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19809 * Returns: %TRUE if all directories have been successfully created, %FALSE otherwise.
19815 * g_file_make_symbolic_link:
19816 * @file: a #GFile with the name of the symlink to create
19817 * @symlink_value: a string with the path for the target of the new symlink
19818 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19819 * @error: a #GError
19821 * Creates a symbolic link named @file which contains the string
19824 * If @cancellable is not %NULL, then the operation can be cancelled by
19825 * triggering the cancellable object from another thread. If the operation
19826 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19828 * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
19834 * @file: input #GFile
19835 * @flags: a set of #GFileMonitorFlags
19836 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19837 * @error: a #GError, or %NULL
19839 * Obtains a file or directory monitor for the given file,
19840 * depending on the type of the file.
19842 * If @cancellable is not %NULL, then the operation can be cancelled by
19843 * triggering the cancellable object from another thread. If the operation
19844 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19846 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19852 * g_file_monitor_cancel:
19853 * @monitor: a #GFileMonitor.
19855 * Cancels a file monitor.
19857 * Returns: %TRUE if monitor was cancelled.
19862 * g_file_monitor_directory:
19863 * @file: input #GFile
19864 * @flags: a set of #GFileMonitorFlags
19865 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19866 * @error: a #GError, or %NULL
19868 * Obtains a directory monitor for the given file.
19869 * This may fail if directory monitoring is not supported.
19871 * If @cancellable is not %NULL, then the operation can be cancelled by
19872 * triggering the cancellable object from another thread. If the operation
19873 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19875 * Virtual: monitor_dir
19876 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19881 * g_file_monitor_emit_event:
19882 * @monitor: a #GFileMonitor.
19883 * @child: a #GFile.
19884 * @other_file: a #GFile.
19885 * @event_type: a set of #GFileMonitorEvent flags.
19887 * Emits the #GFileMonitor::changed signal if a change
19888 * has taken place. Should be called from file monitor
19889 * implementations only.
19891 * The signal will be emitted from an idle handler (in the <link
19892 * linkend="g-main-context-push-thread-default">thread-default main
19898 * g_file_monitor_file:
19899 * @file: input #GFile
19900 * @flags: a set of #GFileMonitorFlags
19901 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19902 * @error: a #GError, or %NULL
19904 * Obtains a file monitor for the given file. If no file notification
19905 * mechanism exists, then regular polling of the file is used.
19907 * If @cancellable is not %NULL, then the operation can be cancelled by
19908 * triggering the cancellable object from another thread. If the operation
19909 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19911 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19916 * g_file_monitor_is_cancelled:
19917 * @monitor: a #GFileMonitor
19919 * Returns whether the monitor is canceled.
19921 * Returns: %TRUE if monitor is canceled. %FALSE otherwise.
19926 * g_file_monitor_set_rate_limit:
19927 * @monitor: a #GFileMonitor.
19928 * @limit_msecs: a non-negative integer with the limit in milliseconds to poll for changes
19930 * Sets the rate limit to which the @monitor will report
19931 * consecutive change events to the same file.
19936 * g_file_mount_enclosing_volume:
19937 * @location: input #GFile
19938 * @flags: flags affecting the operation
19939 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction
19940 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19941 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19942 * @user_data: the data to pass to callback function
19944 * Starts a @mount_operation, mounting the volume that contains
19945 * the file @location.
19947 * When this operation has completed, @callback will be called with
19948 * @user_user data, and the operation can be finalized with
19949 * g_file_mount_enclosing_volume_finish().
19951 * If @cancellable is not %NULL, then the operation can be cancelled by
19952 * triggering the cancellable object from another thread. If the operation
19953 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19958 * g_file_mount_enclosing_volume_finish:
19959 * @location: input #GFile
19960 * @result: a #GAsyncResult
19961 * @error: a #GError, or %NULL
19963 * Finishes a mount operation started by g_file_mount_enclosing_volume().
19965 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19970 * g_file_mount_mountable:
19971 * @file: input #GFile
19972 * @flags: flags affecting the operation
19973 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
19974 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19975 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19976 * @user_data: (closure): the data to pass to callback function
19978 * Mounts a file of type G_FILE_TYPE_MOUNTABLE.
19979 * Using @mount_operation, you can request callbacks when, for instance,
19980 * passwords are needed during authentication.
19982 * If @cancellable is not %NULL, then the operation can be cancelled by
19983 * triggering the cancellable object from another thread. If the operation
19984 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19986 * When the operation is finished, @callback will be called.
19987 * You can then call g_file_mount_mountable_finish() to get
19988 * the result of the operation.
19993 * g_file_mount_mountable_finish:
19994 * @file: input #GFile
19995 * @result: a #GAsyncResult
19996 * @error: a #GError, or %NULL
19998 * Finishes a mount operation. See g_file_mount_mountable() for details.
20000 * Finish an asynchronous mount operation that was started
20001 * with g_file_mount_mountable().
20003 * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
20009 * @source: #GFile pointing to the source location
20010 * @destination: #GFile pointing to the destination location
20011 * @flags: set of #GFileCopyFlags
20012 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20013 * @progress_callback: (allow-none) (scope call): #GFileProgressCallback function for updates
20014 * @progress_callback_data: (closure): gpointer to user data for the callback function
20015 * @error: #GError for returning error conditions, or %NULL
20017 * Tries to move the file or directory @source to the location specified
20018 * by @destination. If native move operations are supported then this is
20019 * used, otherwise a copy + delete fallback is used. The native
20020 * implementation may support moving directories (for instance on moves
20021 * inside the same filesystem), but the fallback code does not.
20023 * If the flag #G_FILE_COPY_OVERWRITE is specified an already
20024 * existing @destination file is overwritten.
20026 * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
20027 * will be copied as symlinks, otherwise the target of the
20028 * @source symlink will be copied.
20030 * If @cancellable is not %NULL, then the operation can be cancelled by
20031 * triggering the cancellable object from another thread. If the operation
20032 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20034 * If @progress_callback is not %NULL, then the operation can be monitored
20035 * by setting this to a #GFileProgressCallback function.
20036 * @progress_callback_data will be passed to this function. It is
20037 * guaranteed that this callback will be called after all data has been
20038 * transferred with the total number of bytes copied during the operation.
20040 * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND
20041 * error is returned, independent on the status of the @destination.
20043 * If #G_FILE_COPY_OVERWRITE is not specified and the target exists,
20044 * then the error %G_IO_ERROR_EXISTS is returned.
20046 * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
20047 * error is returned. If trying to overwrite a directory with a directory the
20048 * %G_IO_ERROR_WOULD_MERGE error is returned.
20050 * If the source is a directory and the target does not exist, or
20051 * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then
20052 * the %G_IO_ERROR_WOULD_RECURSE error may be returned (if the native
20053 * move operation isn't available).
20055 * Returns: %TRUE on successful move, %FALSE otherwise.
20060 * g_file_new_for_commandline_arg:
20061 * @arg: a command line string
20063 * Creates a #GFile with the given argument from the command line.
20064 * The value of @arg can be either a URI, an absolute path or a
20065 * relative path resolved relative to the current working directory.
20066 * This operation never fails, but the returned object might not
20067 * support any I/O operation if @arg points to a malformed path.
20069 * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
20074 * g_file_new_for_path:
20075 * @path: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
20077 * Constructs a #GFile for a given path. This operation never
20078 * fails, but the returned object might not support any I/O
20079 * operation if @path is malformed.
20081 * Returns: (transfer full): a new #GFile for the given @path. Free the returned object with g_object_unref().
20086 * g_file_new_for_uri:
20087 * @uri: a UTF-8 string containing a URI
20089 * Constructs a #GFile for a given URI. This operation never
20090 * fails, but the returned object might not support any I/O
20091 * operation if @uri is malformed or if the uri type is
20094 * Returns: (transfer full): a new #GFile for the given @uri. Free the returned object with g_object_unref().
20100 * @tmpl: (type filename) (allow-none): Template for the file name, as in g_file_open_tmp(), or %NULL for a default template
20101 * @iostream: (out): on return, a #GFileIOStream for the created file
20102 * @error: a #GError, or %NULL
20104 * Opens a file in the preferred directory for temporary files (as
20105 * returned by g_get_tmp_dir()) and returns a #GFile and
20106 * #GFileIOStream pointing to it.
20108 * @tmpl should be a string in the GLib file name encoding
20109 * containing a sequence of six 'X' characters, and containing no
20110 * directory components. If it is %NULL, a default template is used.
20112 * Unlike the other #GFile constructors, this will return %NULL if
20113 * a temporary file could not be created.
20115 * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
20121 * g_file_open_readwrite:
20122 * @file: #GFile to open
20123 * @cancellable: (allow-none): a #GCancellable
20124 * @error: a #GError, or %NULL
20126 * Opens an existing file for reading and writing. The result is
20127 * a #GFileIOStream that can be used to read and write the contents
20130 * If @cancellable is not %NULL, then the operation can be cancelled
20131 * by triggering the cancellable object from another thread. If the
20132 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20135 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
20136 * be returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
20137 * error will be returned. Other errors are possible too, and depend on
20138 * what kind of filesystem the file is on. Note that in many non-local
20139 * file cases read and write streams are not supported, so make sure you
20140 * really need to do read and write streaming, rather than just opening
20141 * for reading or writing.
20143 * Returns: (transfer full): #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20149 * g_file_open_readwrite_async:
20150 * @file: input #GFile
20151 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20152 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20153 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20154 * @user_data: (closure): the data to pass to callback function
20156 * Asynchronously opens @file for reading and writing.
20158 * For more details, see g_file_open_readwrite() which is
20159 * the synchronous version of this call.
20161 * When the operation is finished, @callback will be called.
20162 * You can then call g_file_open_readwrite_finish() to get
20163 * the result of the operation.
20170 * g_file_open_readwrite_finish:
20171 * @file: input #GFile
20172 * @res: a #GAsyncResult
20173 * @error: a #GError, or %NULL
20175 * Finishes an asynchronous file read operation started with
20176 * g_file_open_readwrite_async().
20178 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20184 * g_file_output_stream_get_etag:
20185 * @stream: a #GFileOutputStream.
20187 * Gets the entity tag for the file when it has been written.
20188 * This must be called after the stream has been written
20189 * and closed, as the etag can change while writing.
20191 * Returns: the entity tag for the stream.
20196 * g_file_output_stream_query_info:
20197 * @stream: a #GFileOutputStream.
20198 * @attributes: a file attribute query string.
20199 * @cancellable: optional #GCancellable object, %NULL to ignore.
20200 * @error: a #GError, %NULL to ignore.
20202 * Queries a file output stream for the given @attributes.
20203 * This function blocks while querying the stream. For the asynchronous
20204 * version of this function, see g_file_output_stream_query_info_async().
20205 * While the stream is blocked, the stream will set the pending flag
20206 * internally, and any other operations on the stream will fail with
20207 * %G_IO_ERROR_PENDING.
20209 * Can fail if the stream was already closed (with @error being set to
20210 * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
20211 * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
20212 * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
20213 * all cases of failure, %NULL will be returned.
20215 * If @cancellable is not %NULL, then the operation can be cancelled by
20216 * triggering the cancellable object from another thread. If the operation
20217 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
20220 * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
20225 * g_file_output_stream_query_info_async:
20226 * @stream: a #GFileOutputStream.
20227 * @attributes: a file attribute query string.
20228 * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
20229 * @cancellable: optional #GCancellable object, %NULL to ignore.
20230 * @callback: callback to call when the request is satisfied
20231 * @user_data: the data to pass to callback function
20233 * Asynchronously queries the @stream for a #GFileInfo. When completed,
20234 * @callback will be called with a #GAsyncResult which can be used to
20235 * finish the operation with g_file_output_stream_query_info_finish().
20237 * For the synchronous version of this function, see
20238 * g_file_output_stream_query_info().
20243 * g_file_output_stream_query_info_finish:
20244 * @stream: a #GFileOutputStream.
20245 * @result: a #GAsyncResult.
20246 * @error: a #GError, %NULL to ignore.
20248 * Finalizes the asynchronous query started
20249 * by g_file_output_stream_query_info_async().
20251 * Returns: (transfer full): A #GFileInfo for the finished query.
20256 * g_file_parse_name:
20257 * @parse_name: a file name or path to be parsed
20259 * Constructs a #GFile with the given @parse_name (i.e. something
20260 * given by g_file_get_parse_name()). This operation never fails,
20261 * but the returned object might not support any I/O operation if
20262 * the @parse_name cannot be parsed.
20264 * Returns: (transfer full): a new #GFile.
20269 * g_file_poll_mountable:
20270 * @file: input #GFile
20271 * @cancellable: optional #GCancellable object, %NULL to ignore
20272 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20273 * @user_data: the data to pass to callback function
20275 * Polls a file of type #G_FILE_TYPE_MOUNTABLE.
20277 * If @cancellable is not %NULL, then the operation can be cancelled by
20278 * triggering the cancellable object from another thread. If the operation
20279 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20281 * When the operation is finished, @callback will be called.
20282 * You can then call g_file_mount_mountable_finish() to get
20283 * the result of the operation.
20290 * g_file_poll_mountable_finish:
20291 * @file: input #GFile
20292 * @result: a #GAsyncResult
20293 * @error: a #GError, or %NULL
20295 * Finishes a poll operation. See g_file_poll_mountable() for details.
20297 * Finish an asynchronous poll operation that was polled
20298 * with g_file_poll_mountable().
20300 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20306 * g_file_query_default_handler:
20307 * @file: a #GFile to open
20308 * @cancellable: optional #GCancellable object, %NULL to ignore
20309 * @error: a #GError, or %NULL
20311 * Returns the #GAppInfo that is registered as the default
20312 * application to handle the file specified by @file.
20314 * If @cancellable is not %NULL, then the operation can be cancelled by
20315 * triggering the cancellable object from another thread. If the operation
20316 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20318 * 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()
20323 * g_file_query_exists:
20324 * @file: input #GFile
20325 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20327 * Utility function to check if a particular file exists. This is
20328 * implemented using g_file_query_info() and as such does blocking I/O.
20330 * Note that in many cases it is racy to first check for file existence
20331 * and then execute something based on the outcome of that, because the
20332 * file might have been created or removed in between the operations. The
20333 * general approach to handling that is to not check, but just do the
20334 * operation and handle the errors as they come.
20336 * As an example of race-free checking, take the case of reading a file,
20337 * and if it doesn't exist, creating it. There are two racy versions: read
20338 * it, and on error create it; and: check if it exists, if not create it.
20339 * These can both result in two processes creating the file (with perhaps
20340 * a partially written file as the result). The correct approach is to
20341 * always try to create the file with g_file_create() which will either
20342 * atomically create the file or fail with a %G_IO_ERROR_EXISTS error.
20344 * However, in many cases an existence check is useful in a user interface,
20345 * for instance to make a menu item sensitive/insensitive, so that you don't
20346 * have to fool users that something is possible and then just show an error
20347 * dialog. If you do this, you should make sure to also handle the errors
20348 * that can happen due to races when you execute the operation.
20350 * Returns: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
20355 * g_file_query_file_type:
20356 * @file: input #GFile
20357 * @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info()
20358 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20360 * Utility function to inspect the #GFileType of a file. This is
20361 * implemented using g_file_query_info() and as such does blocking I/O.
20363 * The primary use case of this method is to check if a file is
20364 * a regular file, directory, or symlink.
20366 * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist
20372 * g_file_query_filesystem_info:
20373 * @file: input #GFile
20374 * @attributes: an attribute query string
20375 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20376 * @error: a #GError
20378 * Similar to g_file_query_info(), but obtains information
20379 * about the filesystem the @file is on, rather than the file itself.
20380 * For instance the amount of space available and the type of
20383 * The @attributes value is a string that specifies the attributes
20384 * that should be gathered. It is not an error if it's not possible
20385 * to read a particular requested attribute from a file - it just
20386 * won't be set. @attributes should be a comma-separated list of
20387 * attributes or attribute wildcards. The wildcard "*" means all
20388 * attributes, and a wildcard like "filesystem::*" means all attributes
20389 * in the filesystem namespace. The standard namespace for filesystem
20390 * attributes is "filesystem". Common attributes of interest are
20391 * #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem
20392 * in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available),
20393 * and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
20395 * If @cancellable is not %NULL, then the operation can be cancelled
20396 * by triggering the cancellable object from another thread. If the
20397 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20400 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
20401 * be returned. Other errors are possible too, and depend on what
20402 * kind of filesystem the file is on.
20404 * Returns: (transfer full): a #GFileInfo or %NULL if there was an error. Free the returned object with g_object_unref().
20409 * g_file_query_filesystem_info_async:
20410 * @file: input #GFile
20411 * @attributes: an attribute query string
20412 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20413 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20414 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20415 * @user_data: (closure): the data to pass to callback function
20417 * Asynchronously gets the requested information about the filesystem
20418 * that the specified @file is on. The result is a #GFileInfo object
20419 * that contains key-value attributes (such as type or size for the
20422 * For more details, see g_file_query_filesystem_info() which is the
20423 * synchronous version of this call.
20425 * When the operation is finished, @callback will be called. You can
20426 * then call g_file_query_info_finish() to get the result of the
20432 * g_file_query_filesystem_info_finish:
20433 * @file: input #GFile
20434 * @res: a #GAsyncResult
20435 * @error: a #GError
20437 * Finishes an asynchronous filesystem info query.
20438 * See g_file_query_filesystem_info_async().
20440 * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
20445 * g_file_query_info:
20446 * @file: input #GFile
20447 * @attributes: an attribute query string
20448 * @flags: a set of #GFileQueryInfoFlags
20449 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20450 * @error: a #GError
20452 * Gets the requested information about specified @file.
20453 * The result is a #GFileInfo object that contains key-value
20454 * attributes (such as the type or size of the file).
20456 * The @attributes value is a string that specifies the file
20457 * attributes that should be gathered. It is not an error if
20458 * it's not possible to read a particular requested attribute
20459 * from a file - it just won't be set. @attributes should be a
20460 * comma-separated list of attributes or attribute wildcards.
20461 * The wildcard "*" means all attributes, and a wildcard like
20462 * "standard::*" means all attributes in the standard namespace.
20463 * An example attribute query be "standard::*,owner::user".
20464 * The standard attributes are available as defines, like
20465 * #G_FILE_ATTRIBUTE_STANDARD_NAME.
20467 * If @cancellable is not %NULL, then the operation can be cancelled
20468 * by triggering the cancellable object from another thread. If the
20469 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20472 * For symlinks, normally the information about the target of the
20473 * symlink is returned, rather than information about the symlink
20474 * itself. However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS
20475 * in @flags the information about the symlink itself will be returned.
20476 * Also, for symlinks that point to non-existing files the information
20477 * about the symlink itself will be returned.
20479 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
20480 * returned. Other errors are possible too, and depend on what kind of
20481 * filesystem the file is on.
20483 * Returns: (transfer full): a #GFileInfo for the given @file, or %NULL on error. Free the returned object with g_object_unref().
20488 * g_file_query_info_async:
20489 * @file: input #GFile
20490 * @attributes: an attribute query string
20491 * @flags: a set of #GFileQueryInfoFlags
20492 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20493 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20494 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20495 * @user_data: (closure): the data to pass to callback function
20497 * Asynchronously gets the requested information about specified @file.
20498 * The result is a #GFileInfo object that contains key-value attributes
20499 * (such as type or size for the file).
20501 * For more details, see g_file_query_info() which is the synchronous
20502 * version of this call.
20504 * When the operation is finished, @callback will be called. You can
20505 * then call g_file_query_info_finish() to get the result of the operation.
20510 * g_file_query_info_finish:
20511 * @file: input #GFile
20512 * @res: a #GAsyncResult
20513 * @error: a #GError
20515 * Finishes an asynchronous file info query.
20516 * See g_file_query_info_async().
20518 * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
20523 * g_file_query_settable_attributes:
20524 * @file: input #GFile
20525 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20526 * @error: a #GError, or %NULL
20528 * Obtain the list of settable attributes for the file.
20530 * Returns the type and full attribute name of all the attributes
20531 * that can be set on this file. This doesn't mean setting it will
20532 * always succeed though, you might get an access failure, or some
20533 * specific file may not support a specific attribute.
20535 * If @cancellable is not %NULL, then the operation can be cancelled by
20536 * triggering the cancellable object from another thread. If the operation
20537 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20539 * Returns: a #GFileAttributeInfoList describing the settable attributes. When you are done with it, release it with g_file_attribute_info_list_unref()
20544 * g_file_query_writable_namespaces:
20545 * @file: input #GFile
20546 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20547 * @error: a #GError, or %NULL
20549 * Obtain the list of attribute namespaces where new attributes
20550 * can be created by a user. An example of this is extended
20551 * attributes (in the "xattr" namespace).
20553 * If @cancellable is not %NULL, then the operation can be cancelled by
20554 * triggering the cancellable object from another thread. If the operation
20555 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20557 * Returns: a #GFileAttributeInfoList describing the writable namespaces. When you are done with it, release it with g_file_attribute_info_list_unref()
20563 * @file: #GFile to read
20564 * @cancellable: (allow-none): a #GCancellable
20565 * @error: a #GError, or %NULL
20567 * Opens a file for reading. The result is a #GFileInputStream that
20568 * can be used to read the contents of the file.
20570 * If @cancellable is not %NULL, then the operation can be cancelled by
20571 * triggering the cancellable object from another thread. If the operation
20572 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20574 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
20575 * returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
20576 * error will be returned. Other errors are possible too, and depend
20577 * on what kind of filesystem the file is on.
20580 * Returns: (transfer full): #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20585 * g_file_read_async:
20586 * @file: input #GFile
20587 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20588 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20589 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20590 * @user_data: (closure): the data to pass to callback function
20592 * Asynchronously opens @file for reading.
20594 * For more details, see g_file_read() which is
20595 * the synchronous version of this call.
20597 * When the operation is finished, @callback will be called.
20598 * You can then call g_file_read_finish() to get the result
20599 * of the operation.
20604 * g_file_read_finish:
20605 * @file: input #GFile
20606 * @res: a #GAsyncResult
20607 * @error: a #GError, or %NULL
20609 * Finishes an asynchronous file read operation started with
20610 * g_file_read_async().
20612 * Returns: (transfer full): a #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20618 * @file: input #GFile
20619 * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20620 * @make_backup: %TRUE if a backup should be created
20621 * @flags: a set of #GFileCreateFlags
20622 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20623 * @error: a #GError, or %NULL
20625 * Returns an output stream for overwriting the file, possibly
20626 * creating a backup copy of the file first. If the file doesn't exist,
20627 * it will be created.
20629 * This will try to replace the file in the safest way possible so
20630 * that any errors during the writing will not affect an already
20631 * existing copy of the file. For instance, for local files it
20632 * may write to a temporary file and then atomically rename over
20633 * the destination when the stream is closed.
20635 * By default files created are generally readable by everyone,
20636 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
20637 * will be made readable only to the current user, to the level that
20638 * is supported on the target filesystem.
20640 * If @cancellable is not %NULL, then the operation can be cancelled
20641 * by triggering the cancellable object from another thread. If the
20642 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20645 * If you pass in a non-%NULL @etag value, then this value is
20646 * compared to the current entity tag of the file, and if they differ
20647 * an %G_IO_ERROR_WRONG_ETAG error is returned. This generally means
20648 * that the file has been changed since you last read it. You can get
20649 * the new etag from g_file_output_stream_get_etag() after you've
20650 * finished writing and closed the #GFileOutputStream. When you load
20651 * a new file you can use g_file_input_stream_query_info() to get
20652 * the etag of the file.
20654 * If @make_backup is %TRUE, this function will attempt to make a
20655 * backup of the current file before overwriting it. If this fails
20656 * a %G_IO_ERROR_CANT_CREATE_BACKUP error will be returned. If you
20657 * want to replace anyway, try again with @make_backup set to %FALSE.
20659 * If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will
20660 * be returned, and if the file is some other form of non-regular file
20661 * then a %G_IO_ERROR_NOT_REGULAR_FILE error will be returned. Some
20662 * file systems don't allow all file names, and may return an
20663 * %G_IO_ERROR_INVALID_FILENAME error, and if the name is to long
20664 * %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are
20665 * possible too, and depend on what kind of filesystem the file is on.
20667 * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
20672 * g_file_replace_async:
20673 * @file: input #GFile
20674 * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20675 * @make_backup: %TRUE if a backup should be created
20676 * @flags: a set of #GFileCreateFlags
20677 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20678 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20679 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20680 * @user_data: (closure): the data to pass to callback function
20682 * Asynchronously overwrites the file, replacing the contents,
20683 * possibly creating a backup copy of the file first.
20685 * For more details, see g_file_replace() which is
20686 * the synchronous version of this call.
20688 * When the operation is finished, @callback will be called.
20689 * You can then call g_file_replace_finish() to get the result
20690 * of the operation.
20695 * g_file_replace_contents:
20696 * @file: input #GFile
20697 * @contents: (element-type guint8) (array length=length): a string containing the new contents for @file
20698 * @length: the length of @contents in bytes
20699 * @etag: (allow-none): the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
20700 * @make_backup: %TRUE if a backup should be created
20701 * @flags: a set of #GFileCreateFlags
20702 * @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
20703 * @cancellable: optional #GCancellable object, %NULL to ignore
20704 * @error: a #GError, or %NULL
20706 * Replaces the contents of @file with @contents of @length bytes.
20708 * If @etag is specified (not %NULL), any existing file must have that etag,
20709 * or the error %G_IO_ERROR_WRONG_ETAG will be returned.
20711 * If @make_backup is %TRUE, this function will attempt to make a backup
20714 * If @cancellable is not %NULL, then the operation can be cancelled by
20715 * triggering the cancellable object from another thread. If the operation
20716 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20718 * The returned @new_etag can be used to verify that the file hasn't
20719 * changed the next time it is saved over.
20721 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
20726 * g_file_replace_contents_async:
20727 * @file: input #GFile
20728 * @contents: (element-type guint8) (array length=length): string of contents to replace the file with
20729 * @length: the length of @contents in bytes
20730 * @etag: (allow-none): a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
20731 * @make_backup: %TRUE if a backup should be created
20732 * @flags: a set of #GFileCreateFlags
20733 * @cancellable: optional #GCancellable object, %NULL to ignore
20734 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
20735 * @user_data: the data to pass to callback function
20737 * Starts an asynchronous replacement of @file with the given
20738 * @contents of @length bytes. @etag will replace the document's
20739 * current entity tag.
20741 * When this operation has completed, @callback will be called with
20742 * @user_user data, and the operation can be finalized with
20743 * g_file_replace_contents_finish().
20745 * If @cancellable is not %NULL, then the operation can be cancelled by
20746 * triggering the cancellable object from another thread. If the operation
20747 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20749 * If @make_backup is %TRUE, this function will attempt to
20750 * make a backup of @file.
20755 * g_file_replace_contents_finish:
20756 * @file: input #GFile
20757 * @res: a #GAsyncResult
20758 * @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
20759 * @error: a #GError, or %NULL
20761 * Finishes an asynchronous replace of the given @file. See
20762 * g_file_replace_contents_async(). Sets @new_etag to the new entity
20763 * tag for the document, if present.
20765 * Returns: %TRUE on success, %FALSE on failure.
20770 * g_file_replace_finish:
20771 * @file: input #GFile
20772 * @res: a #GAsyncResult
20773 * @error: a #GError, or %NULL
20775 * Finishes an asynchronous file replace operation started with
20776 * g_file_replace_async().
20778 * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
20783 * g_file_replace_readwrite:
20785 * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20786 * @make_backup: %TRUE if a backup should be created
20787 * @flags: a set of #GFileCreateFlags
20788 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20789 * @error: return location for a #GError, or %NULL
20791 * Returns an output stream for overwriting the file in readwrite mode,
20792 * possibly creating a backup copy of the file first. If the file doesn't
20793 * exist, it will be created.
20795 * For details about the behaviour, see g_file_replace() which does the
20796 * same thing but returns an output stream only.
20798 * Note that in many non-local file cases read and write streams are not
20799 * supported, so make sure you really need to do read and write streaming,
20800 * rather than just opening for reading or writing.
20802 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20808 * g_file_replace_readwrite_async:
20809 * @file: input #GFile
20810 * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20811 * @make_backup: %TRUE if a backup should be created
20812 * @flags: a set of #GFileCreateFlags
20813 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20814 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20815 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20816 * @user_data: (closure): the data to pass to callback function
20818 * Asynchronously overwrites the file in read-write mode,
20819 * replacing the contents, possibly creating a backup copy
20820 * of the file first.
20822 * For more details, see g_file_replace_readwrite() which is
20823 * the synchronous version of this call.
20825 * When the operation is finished, @callback will be called.
20826 * You can then call g_file_replace_readwrite_finish() to get
20827 * the result of the operation.
20834 * g_file_replace_readwrite_finish:
20835 * @file: input #GFile
20836 * @res: a #GAsyncResult
20837 * @error: a #GError, or %NULL
20839 * Finishes an asynchronous file replace operation started with
20840 * g_file_replace_readwrite_async().
20842 * Returns: (transfer full): a #GFileIOStream, or %NULL on error. Free the returned object with g_object_unref().
20848 * g_file_resolve_relative_path:
20849 * @file: input #GFile
20850 * @relative_path: a given relative path string
20852 * Resolves a relative path for @file to an absolute path.
20854 * This call does no blocking I/O.
20856 * 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().
20861 * g_file_set_attribute:
20862 * @file: input #GFile
20863 * @attribute: a string containing the attribute's name
20864 * @type: The type of the attribute
20865 * @value_p: (allow-none): a pointer to the value (or the pointer itself if the type is a pointer type)
20866 * @flags: a set of #GFileQueryInfoFlags
20867 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20868 * @error: a #GError, or %NULL
20870 * Sets an attribute in the file with attribute name @attribute to @value.
20872 * Some attributes can be unset by setting @attribute to
20873 * %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
20875 * If @cancellable is not %NULL, then the operation can be cancelled by
20876 * triggering the cancellable object from another thread. If the operation
20877 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20879 * Returns: %TRUE if the attribute was set, %FALSE otherwise.
20884 * g_file_set_attribute_byte_string:
20885 * @file: input #GFile
20886 * @attribute: a string containing the attribute's name
20887 * @value: a string containing the attribute's new value
20888 * @flags: a #GFileQueryInfoFlags
20889 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20890 * @error: a #GError, or %NULL
20892 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
20893 * If @attribute is of a different type, this operation will fail,
20894 * returning %FALSE.
20896 * If @cancellable is not %NULL, then the operation can be cancelled by
20897 * triggering the cancellable object from another thread. If the operation
20898 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20900 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20905 * g_file_set_attribute_int32:
20906 * @file: input #GFile
20907 * @attribute: a string containing the attribute's name
20908 * @value: a #gint32 containing the attribute's new value
20909 * @flags: a #GFileQueryInfoFlags
20910 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20911 * @error: a #GError, or %NULL
20913 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
20914 * If @attribute is of a different type, this operation will fail.
20916 * If @cancellable is not %NULL, then the operation can be cancelled by
20917 * triggering the cancellable object from another thread. If the operation
20918 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20920 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20925 * g_file_set_attribute_int64:
20926 * @file: input #GFile
20927 * @attribute: a string containing the attribute's name
20928 * @value: a #guint64 containing the attribute's new value
20929 * @flags: a #GFileQueryInfoFlags
20930 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20931 * @error: a #GError, or %NULL
20933 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
20934 * If @attribute is of a different type, this operation will fail.
20936 * If @cancellable is not %NULL, then the operation can be cancelled by
20937 * triggering the cancellable object from another thread. If the operation
20938 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20940 * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20945 * g_file_set_attribute_string:
20946 * @file: input #GFile
20947 * @attribute: a string containing the attribute's name
20948 * @value: a string containing the attribute's value
20949 * @flags: #GFileQueryInfoFlags
20950 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20951 * @error: a #GError, or %NULL
20953 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
20954 * If @attribute is of a different type, this operation will fail.
20956 * If @cancellable is not %NULL, then the operation can be cancelled by
20957 * triggering the cancellable object from another thread. If the operation
20958 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20960 * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20965 * g_file_set_attribute_uint32:
20966 * @file: input #GFile
20967 * @attribute: a string containing the attribute's name
20968 * @value: a #guint32 containing the attribute's new value
20969 * @flags: a #GFileQueryInfoFlags
20970 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20971 * @error: a #GError, or %NULL
20973 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
20974 * If @attribute is of a different type, this operation will fail.
20976 * If @cancellable is not %NULL, then the operation can be cancelled by
20977 * triggering the cancellable object from another thread. If the operation
20978 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20980 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20985 * g_file_set_attribute_uint64:
20986 * @file: input #GFile
20987 * @attribute: a string containing the attribute's name
20988 * @value: a #guint64 containing the attribute's new value
20989 * @flags: a #GFileQueryInfoFlags
20990 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20991 * @error: a #GError, or %NULL
20993 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
20994 * If @attribute is of a different type, this operation will fail.
20996 * If @cancellable is not %NULL, then the operation can be cancelled by
20997 * triggering the cancellable object from another thread. If the operation
20998 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21000 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
21005 * g_file_set_attributes_async:
21006 * @file: input #GFile
21007 * @info: a #GFileInfo
21008 * @flags: a #GFileQueryInfoFlags
21009 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
21010 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21011 * @callback: (scope async): a #GAsyncReadyCallback
21012 * @user_data: (closure): a #gpointer
21014 * Asynchronously sets the attributes of @file with @info.
21016 * For more details, see g_file_set_attributes_from_info(),
21017 * which is the synchronous version of this call.
21019 * When the operation is finished, @callback will be called.
21020 * You can then call g_file_set_attributes_finish() to get
21021 * the result of the operation.
21026 * g_file_set_attributes_finish:
21027 * @file: input #GFile
21028 * @result: a #GAsyncResult
21029 * @info: (out) (transfer full): a #GFileInfo
21030 * @error: a #GError, or %NULL
21032 * Finishes setting an attribute started in g_file_set_attributes_async().
21034 * Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
21039 * g_file_set_attributes_from_info:
21040 * @file: input #GFile
21041 * @info: a #GFileInfo
21042 * @flags: #GFileQueryInfoFlags
21043 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21044 * @error: a #GError, or %NULL
21046 * Tries to set all attributes in the #GFileInfo on the target
21047 * values, not stopping on the first error.
21049 * If there is any error during this operation then @error will
21050 * be set to the first error. Error on particular fields are flagged
21051 * by setting the "status" field in the attribute value to
21052 * %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can
21053 * also detect further errors.
21055 * If @cancellable is not %NULL, then the operation can be cancelled by
21056 * triggering the cancellable object from another thread. If the operation
21057 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21059 * Returns: %TRUE if there was any error, %FALSE otherwise.
21064 * g_file_set_display_name:
21065 * @file: input #GFile
21066 * @display_name: a string
21067 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21068 * @error: a #GError, or %NULL
21070 * Renames @file to the specified display name.
21072 * The display name is converted from UTF-8 to the correct encoding
21073 * for the target filesystem if possible and the @file is renamed to this.
21075 * If you want to implement a rename operation in the user interface the
21076 * edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
21077 * initial value in the rename widget, and then the result after editing
21078 * should be passed to g_file_set_display_name().
21080 * On success the resulting converted filename is returned.
21082 * If @cancellable is not %NULL, then the operation can be cancelled by
21083 * triggering the cancellable object from another thread. If the operation
21084 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21086 * 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().
21091 * g_file_set_display_name_async:
21092 * @file: input #GFile
21093 * @display_name: a string
21094 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
21095 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21096 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
21097 * @user_data: (closure): the data to pass to callback function
21099 * Asynchronously sets the display name for a given #GFile.
21101 * For more details, see g_file_set_display_name() which is
21102 * the synchronous version of this call.
21104 * When the operation is finished, @callback will be called.
21105 * You can then call g_file_set_display_name_finish() to get
21106 * the result of the operation.
21111 * g_file_set_display_name_finish:
21112 * @file: input #GFile
21113 * @res: a #GAsyncResult
21114 * @error: a #GError, or %NULL
21116 * Finishes setting a display name started with
21117 * g_file_set_display_name_async().
21119 * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
21124 * g_file_start_mountable:
21125 * @file: input #GFile
21126 * @flags: flags affecting the operation
21127 * @start_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
21128 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21129 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
21130 * @user_data: the data to pass to callback function
21132 * Starts a file of type #G_FILE_TYPE_MOUNTABLE.
21133 * Using @start_operation, you can request callbacks when, for instance,
21134 * passwords are needed during authentication.
21136 * If @cancellable is not %NULL, then the operation can be cancelled by
21137 * triggering the cancellable object from another thread. If the operation
21138 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21140 * When the operation is finished, @callback will be called.
21141 * You can then call g_file_mount_mountable_finish() to get
21142 * the result of the operation.
21149 * g_file_start_mountable_finish:
21150 * @file: input #GFile
21151 * @result: a #GAsyncResult
21152 * @error: a #GError, or %NULL
21154 * Finishes a start operation. See g_file_start_mountable() for details.
21156 * Finish an asynchronous start operation that was started
21157 * with g_file_start_mountable().
21159 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
21165 * g_file_stop_mountable:
21166 * @file: input #GFile
21167 * @flags: flags affecting the operation
21168 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
21169 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21170 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
21171 * @user_data: the data to pass to callback function
21173 * Stops a file of type #G_FILE_TYPE_MOUNTABLE.
21175 * If @cancellable is not %NULL, then the operation can be cancelled by
21176 * triggering the cancellable object from another thread. If the operation
21177 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21179 * When the operation is finished, @callback will be called.
21180 * You can then call g_file_stop_mountable_finish() to get
21181 * the result of the operation.
21188 * g_file_stop_mountable_finish:
21189 * @file: input #GFile
21190 * @result: a #GAsyncResult
21191 * @error: a #GError, or %NULL
21193 * Finishes an stop operation, see g_file_stop_mountable() for details.
21195 * Finish an asynchronous stop operation that was started
21196 * with g_file_stop_mountable().
21198 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
21204 * g_file_supports_thread_contexts:
21207 * Checks if @file supports <link
21208 * linkend="g-main-context-push-thread-default-context">thread-default
21209 * contexts</link>. If this returns %FALSE, you cannot perform
21210 * asynchronous operations on @file in a thread that has a
21211 * thread-default context.
21213 * Returns: Whether or not @file supports thread-default contexts.
21220 * @file: #GFile to send to trash
21221 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21222 * @error: a #GError, or %NULL
21224 * Sends @file to the "Trashcan", if possible. This is similar to
21225 * deleting it, but the user can recover it before emptying the trashcan.
21226 * Not all file systems support trashing, so this call can return the
21227 * %G_IO_ERROR_NOT_SUPPORTED error.
21229 * If @cancellable is not %NULL, then the operation can be cancelled by
21230 * triggering the cancellable object from another thread. If the operation
21231 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21233 * Returns: %TRUE on successful trash, %FALSE otherwise.
21238 * g_file_unmount_mountable:
21239 * @file: input #GFile
21240 * @flags: flags affecting the operation
21241 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21242 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
21243 * @user_data: (closure): the data to pass to callback function
21245 * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
21247 * If @cancellable is not %NULL, then the operation can be cancelled by
21248 * triggering the cancellable object from another thread. If the operation
21249 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21251 * When the operation is finished, @callback will be called.
21252 * You can then call g_file_unmount_mountable_finish() to get
21253 * the result of the operation.
21255 * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation() instead.
21260 * g_file_unmount_mountable_finish:
21261 * @file: input #GFile
21262 * @result: a #GAsyncResult
21263 * @error: a #GError, or %NULL
21265 * Finishes an unmount operation, see g_file_unmount_mountable() for details.
21267 * Finish an asynchronous unmount operation that was started
21268 * with g_file_unmount_mountable().
21270 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
21271 * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation_finish() instead.
21276 * g_file_unmount_mountable_with_operation:
21277 * @file: input #GFile
21278 * @flags: flags affecting the operation
21279 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
21280 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21281 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
21282 * @user_data: (closure): the data to pass to callback function
21284 * Unmounts a file of type #G_FILE_TYPE_MOUNTABLE.
21286 * If @cancellable is not %NULL, then the operation can be cancelled by
21287 * triggering the cancellable object from another thread. If the operation
21288 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21290 * When the operation is finished, @callback will be called.
21291 * You can then call g_file_unmount_mountable_finish() to get
21292 * the result of the operation.
21299 * g_file_unmount_mountable_with_operation_finish:
21300 * @file: input #GFile
21301 * @result: a #GAsyncResult
21302 * @error: a #GError, or %NULL
21304 * Finishes an unmount operation,
21305 * see g_file_unmount_mountable_with_operation() for details.
21307 * Finish an asynchronous unmount operation that was started
21308 * with g_file_unmount_mountable_with_operation().
21310 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
21316 * g_filename_completer_get_completion_suffix:
21317 * @completer: the filename completer.
21318 * @initial_text: text to be completed.
21320 * Obtains a completion for @initial_text from @completer.
21322 * 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.
21327 * g_filename_completer_get_completions:
21328 * @completer: the filename completer.
21329 * @initial_text: text to be completed.
21331 * Gets an array of completion strings for a given initial text.
21333 * 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.
21338 * g_filename_completer_new:
21340 * Creates a new filename completer.
21342 * Returns: a #GFilenameCompleter.
21347 * g_filename_completer_set_dirs_only:
21348 * @completer: the filename completer.
21349 * @dirs_only: a #gboolean.
21351 * If @dirs_only is %TRUE, @completer will only
21352 * complete directory names, and not file names.
21357 * g_filter_input_stream_get_base_stream:
21358 * @stream: a #GFilterInputStream.
21360 * Gets the base stream for the filter stream.
21362 * Returns: (transfer none): a #GInputStream.
21367 * g_filter_input_stream_get_close_base_stream:
21368 * @stream: a #GFilterInputStream.
21370 * Returns whether the base stream will be closed when @stream is
21373 * Returns: %TRUE if the base stream will be closed.
21378 * g_filter_input_stream_set_close_base_stream:
21379 * @stream: a #GFilterInputStream.
21380 * @close_base: %TRUE to close the base stream.
21382 * Sets whether the base stream will be closed when @stream is closed.
21387 * g_filter_output_stream_get_base_stream:
21388 * @stream: a #GFilterOutputStream.
21390 * Gets the base stream for the filter stream.
21392 * Returns: (transfer none): a #GOutputStream.
21397 * g_filter_output_stream_get_close_base_stream:
21398 * @stream: a #GFilterOutputStream.
21400 * Returns whether the base stream will be closed when @stream is
21403 * Returns: %TRUE if the base stream will be closed.
21408 * g_filter_output_stream_set_close_base_stream:
21409 * @stream: a #GFilterOutputStream.
21410 * @close_base: %TRUE to close the base stream.
21412 * Sets whether the base stream will be closed when @stream is closed.
21418 * @icon1: (allow-none): pointer to the first #GIcon.
21419 * @icon2: (allow-none): pointer to the second #GIcon.
21421 * Checks if two icons are equal.
21423 * Returns: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
21429 * @icon: #gconstpointer to an icon object.
21431 * Gets a hash for an icon.
21434 * Returns: a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure.
21439 * g_icon_new_for_string:
21440 * @str: A string obtained via g_icon_to_string().
21441 * @error: Return location for error.
21443 * Generate a #GIcon instance from @str. This function can fail if
21444 * @str is not valid - see g_icon_to_string() for discussion.
21446 * If your application or library provides one or more #GIcon
21447 * implementations you need to ensure that each #GType is registered
21448 * with the type system prior to calling g_icon_new_for_string().
21450 * Returns: (transfer full): An object implementing the #GIcon interface or %NULL if @error is set.
21456 * g_icon_to_string:
21459 * Generates a textual representation of @icon that can be used for
21460 * serialization such as when passing @icon to a different process or
21461 * saving it to persistent storage. Use g_icon_new_for_string() to
21462 * get @icon back from the returned string.
21464 * The encoding of the returned string is proprietary to #GIcon except
21465 * in the following two cases
21469 * If @icon is a #GFileIcon, the returned string is a native path
21470 * (such as <literal>/path/to/my icon.png</literal>) without escaping
21471 * if the #GFile for @icon is a native file. If the file is not
21472 * native, the returned string is the result of g_file_get_uri()
21473 * (such as <literal>sftp://path/to/my%20icon.png</literal>).
21474 * </para></listitem>
21476 * If @icon is a #GThemedIcon with exactly one name, the encoding is
21477 * simply the name (such as <literal>network-server</literal>).
21478 * </para></listitem>
21481 * Virtual: to_tokens
21482 * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't be serialized. Use g_free() to free.
21488 * g_inet_address_equal:
21489 * @address: A #GInetAddress.
21490 * @other_address: Another #GInetAddress.
21492 * Checks if two #GInetAddress instances are equal, e.g. the same address.
21494 * Returns: %TRUE if @address and @other_address are equal, %FALSE otherwise.
21500 * g_inet_address_get_family:
21501 * @address: a #GInetAddress
21503 * Gets @address's family
21505 * Returns: @address's family
21511 * g_inet_address_get_is_any:
21512 * @address: a #GInetAddress
21514 * Tests whether @address is the "any" address for its family.
21516 * Returns: %TRUE if @address is the "any" address for its family.
21522 * g_inet_address_get_is_link_local:
21523 * @address: a #GInetAddress
21525 * Tests whether @address is a link-local address (that is, if it
21526 * identifies a host on a local network that is not connected to the
21529 * Returns: %TRUE if @address is a link-local address.
21535 * g_inet_address_get_is_loopback:
21536 * @address: a #GInetAddress
21538 * Tests whether @address is the loopback address for its family.
21540 * Returns: %TRUE if @address is the loopback address for its family.
21546 * g_inet_address_get_is_mc_global:
21547 * @address: a #GInetAddress
21549 * Tests whether @address is a global multicast address.
21551 * Returns: %TRUE if @address is a global multicast address.
21557 * g_inet_address_get_is_mc_link_local:
21558 * @address: a #GInetAddress
21560 * Tests whether @address is a link-local multicast address.
21562 * Returns: %TRUE if @address is a link-local multicast address.
21568 * g_inet_address_get_is_mc_node_local:
21569 * @address: a #GInetAddress
21571 * Tests whether @address is a node-local multicast address.
21573 * Returns: %TRUE if @address is a node-local multicast address.
21579 * g_inet_address_get_is_mc_org_local:
21580 * @address: a #GInetAddress
21582 * Tests whether @address is an organization-local multicast address.
21584 * Returns: %TRUE if @address is an organization-local multicast address.
21590 * g_inet_address_get_is_mc_site_local:
21591 * @address: a #GInetAddress
21593 * Tests whether @address is a site-local multicast address.
21595 * Returns: %TRUE if @address is a site-local multicast address.
21601 * g_inet_address_get_is_multicast:
21602 * @address: a #GInetAddress
21604 * Tests whether @address is a multicast address.
21606 * Returns: %TRUE if @address is a multicast address.
21612 * g_inet_address_get_is_site_local:
21613 * @address: a #GInetAddress
21615 * Tests whether @address is a site-local address such as 10.0.0.1
21616 * (that is, the address identifies a host on a local network that can
21617 * not be reached directly from the Internet, but which may have
21618 * outgoing Internet connectivity via a NAT or firewall).
21620 * Returns: %TRUE if @address is a site-local address.
21626 * g_inet_address_get_native_size:
21627 * @address: a #GInetAddress
21629 * Gets the size of the native raw binary address for @address. This
21630 * is the size of the data that you get from g_inet_address_to_bytes().
21632 * Returns: the number of bytes used for the native version of @address.
21638 * g_inet_address_mask_equal:
21639 * @mask: a #GInetAddressMask
21640 * @mask2: another #GInetAddressMask
21642 * Tests if @mask and @mask2 are the same mask.
21644 * Returns: whether @mask and @mask2 are the same mask
21650 * g_inet_address_mask_get_address:
21651 * @mask: a #GInetAddressMask
21653 * Gets @mask's base address
21655 * Returns: (transfer none): @mask's base address
21661 * g_inet_address_mask_get_family:
21662 * @mask: a #GInetAddressMask
21664 * Gets the #GSocketFamily of @mask's address
21666 * Returns: the #GSocketFamily of @mask's address
21672 * g_inet_address_mask_get_length:
21673 * @mask: a #GInetAddressMask
21675 * Gets @mask's length
21677 * Returns: @mask's length
21683 * g_inet_address_mask_matches:
21684 * @mask: a #GInetAddressMask
21685 * @address: a #GInetAddress
21687 * Tests if @address falls within the range described by @mask.
21689 * Returns: whether @address falls within the range described by @mask.
21695 * g_inet_address_mask_new:
21696 * @addr: a #GInetAddress
21697 * @length: number of bits of @addr to use
21698 * @error: return location for #GError, or %NULL
21700 * Creates a new #GInetAddressMask representing all addresses whose
21701 * first @length bits match @addr.
21703 * Returns: a new #GInetAddressMask, or %NULL on error
21709 * g_inet_address_mask_new_from_string:
21710 * @mask_string: an IP address or address/length string
21711 * @error: return location for #GError, or %NULL
21713 * Parses @mask_string as an IP address and (optional) length, and
21714 * creates a new #GInetAddressMask. The length, if present, is
21715 * delimited by a "/". If it is not present, then the length is
21716 * assumed to be the full length of the address.
21718 * Returns: a new #GInetAddressMask corresponding to @string, or %NULL on error.
21724 * g_inet_address_mask_to_string:
21725 * @mask: a #GInetAddressMask
21727 * Converts @mask back to its corresponding string form.
21729 * Returns: a string corresponding to @mask.
21735 * g_inet_address_new_any:
21736 * @family: the address family
21738 * Creates a #GInetAddress for the "any" address (unassigned/"don't
21739 * care") for @family.
21741 * Returns: a new #GInetAddress corresponding to the "any" address for @family.
21747 * g_inet_address_new_from_bytes:
21748 * @bytes: (array) (element-type guint8): raw address data
21749 * @family: the address family of @bytes
21751 * Creates a new #GInetAddress from the given @family and @bytes.
21752 * @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
21753 * %G_SOCKET_FAMILY_IPV6.
21755 * Returns: a new #GInetAddress corresponding to @family and @bytes.
21761 * g_inet_address_new_from_string:
21762 * @string: a string representation of an IP address
21764 * Parses @string as an IP address and creates a new #GInetAddress.
21766 * Returns: a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed.
21772 * g_inet_address_new_loopback:
21773 * @family: the address family
21775 * Creates a #GInetAddress for the loopback address for @family.
21777 * Returns: a new #GInetAddress corresponding to the loopback address for @family.
21783 * g_inet_address_to_bytes: (skip)
21784 * @address: a #GInetAddress
21786 * Gets the raw binary address data from @address.
21788 * 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().
21794 * g_inet_address_to_string:
21795 * @address: a #GInetAddress
21797 * Converts @address to string form.
21799 * Returns: a representation of @address as a string, which should be freed after use.
21805 * g_inet_socket_address_get_address:
21806 * @address: a #GInetSocketAddress
21808 * Gets @address's #GInetAddress.
21810 * Returns: (transfer none): the #GInetAddress for @address, which must be g_object_ref()'d if it will be stored
21816 * g_inet_socket_address_get_flowinfo:
21817 * @address: a %G_SOCKET_FAMILY_IPV6 #GInetSocketAddress
21819 * Gets the <literal>sin6_flowinfo</literal> field from @address,
21820 * which must be an IPv6 address.
21822 * Returns: the flowinfo field
21828 * g_inet_socket_address_get_port:
21829 * @address: a #GInetSocketAddress
21831 * Gets @address's port.
21833 * Returns: the port for @address
21839 * g_inet_socket_address_get_scope_id:
21840 * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress
21842 * Gets the <literal>sin6_scope_id</literal> field from @address,
21843 * which must be an IPv6 address.
21845 * Returns: the scope id field
21851 * g_inet_socket_address_new:
21852 * @address: a #GInetAddress
21853 * @port: a port number
21855 * Creates a new #GInetSocketAddress for @address and @port.
21857 * Returns: a new #GInetSocketAddress
21864 * @initable: a #GInitable.
21865 * @cancellable: optional #GCancellable object, %NULL to ignore.
21866 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21868 * Initializes the object implementing the interface.
21870 * The object must be initialized before any real use after initial
21871 * construction, either with this function or g_async_initable_init_async().
21873 * Implementations may also support cancellation. If @cancellable is not %NULL,
21874 * then initialization can be cancelled by triggering the cancellable object
21875 * from another thread. If the operation was cancelled, the error
21876 * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
21877 * the object doesn't support cancellable initialization the error
21878 * %G_IO_ERROR_NOT_SUPPORTED will be returned.
21880 * If the object is not initialized, or initialization returns with an
21881 * error, then all operations on the object except g_object_ref() and
21882 * g_object_unref() are considered to be invalid, and have undefined
21883 * behaviour. See the <xref linkend="ginitable"/> section introduction
21884 * for more details.
21886 * Implementations of this method must be idempotent, i.e. multiple calls
21887 * to this function with the same argument should return the same results.
21888 * Only the first call initializes the object, further calls return the result
21889 * of the first call. This is so that it's safe to implement the singleton
21890 * pattern in the GObject constructor function.
21892 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
21899 * @object_type: a #GType supporting #GInitable.
21900 * @cancellable: optional #GCancellable object, %NULL to ignore.
21901 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21902 * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
21903 * @...: the value if the first property, followed by and other property value pairs, and ended by %NULL.
21905 * Helper function for constructing #GInitable object. This is
21906 * similar to g_object_new() but also initializes the object
21907 * and returns %NULL, setting an error on failure.
21909 * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21915 * g_initable_new_valist:
21916 * @object_type: a #GType supporting #GInitable.
21917 * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
21918 * @var_args: The var args list generated from @first_property_name.
21919 * @cancellable: optional #GCancellable object, %NULL to ignore.
21920 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21922 * Helper function for constructing #GInitable object. This is
21923 * similar to g_object_new_valist() but also initializes the object
21924 * and returns %NULL, setting an error on failure.
21926 * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21933 * @object_type: a #GType supporting #GInitable.
21934 * @n_parameters: the number of parameters in @parameters
21935 * @parameters: (array length=n_parameters): the parameters to use to construct the object
21936 * @cancellable: optional #GCancellable object, %NULL to ignore.
21937 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21939 * Helper function for constructing #GInitable object. This is
21940 * similar to g_object_newv() but also initializes the object
21941 * and returns %NULL, setting an error on failure.
21943 * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21949 * g_input_stream_clear_pending:
21950 * @stream: input stream
21952 * Clears the pending flag on @stream.
21957 * g_input_stream_close:
21958 * @stream: A #GInputStream.
21959 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21960 * @error: location to store the error occurring, or %NULL to ignore
21962 * Closes the stream, releasing resources related to it.
21964 * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
21965 * Closing a stream multiple times will not return an error.
21967 * Streams will be automatically closed when the last reference
21968 * is dropped, but you might want to call this function to make sure
21969 * resources are released as early as possible.
21971 * Some streams might keep the backing store of the stream (e.g. a file descriptor)
21972 * open after the stream is closed. See the documentation for the individual
21973 * stream for details.
21975 * On failure the first error that happened will be reported, but the close
21976 * operation will finish as much as possible. A stream that failed to
21977 * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
21978 * is important to check and report the error to the user.
21980 * If @cancellable is not %NULL, then the operation can be cancelled by
21981 * triggering the cancellable object from another thread. If the operation
21982 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21983 * Cancelling a close will still leave the stream closed, but some streams
21984 * can use a faster close that doesn't block to e.g. check errors.
21986 * Returns: %TRUE on success, %FALSE on failure
21991 * g_input_stream_close_async:
21992 * @stream: A #GInputStream.
21993 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21994 * @cancellable: (allow-none): optional cancellable object
21995 * @callback: (scope async): callback to call when the request is satisfied
21996 * @user_data: (closure): the data to pass to callback function
21998 * Requests an asynchronous closes of the stream, releasing resources related to it.
21999 * When the operation is finished @callback will be called.
22000 * You can then call g_input_stream_close_finish() to get the result of the
22003 * For behaviour details see g_input_stream_close().
22005 * The asyncronous methods have a default fallback that uses threads to implement
22006 * asynchronicity, so they are optional for inheriting classes. However, if you
22007 * override one you must override all.
22012 * g_input_stream_close_finish:
22013 * @stream: a #GInputStream.
22014 * @result: a #GAsyncResult.
22015 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22017 * Finishes closing a stream asynchronously, started from g_input_stream_close_async().
22019 * Returns: %TRUE if the stream was closed successfully.
22024 * g_input_stream_has_pending:
22025 * @stream: input stream.
22027 * Checks if an input stream has pending actions.
22029 * Returns: %TRUE if @stream has pending actions.
22034 * g_input_stream_is_closed:
22035 * @stream: input stream.
22037 * Checks if an input stream is closed.
22039 * Returns: %TRUE if the stream is closed.
22044 * g_input_stream_read:
22045 * @stream: a #GInputStream.
22046 * @buffer: a buffer to read data into (which should be at least count bytes long).
22047 * @count: the number of bytes that will be read from the stream
22048 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22049 * @error: location to store the error occurring, or %NULL to ignore
22051 * Tries to read @count bytes from the stream into the buffer starting at
22052 * @buffer. Will block during this read.
22054 * If count is zero returns zero and does nothing. A value of @count
22055 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
22057 * On success, the number of bytes read into the buffer is returned.
22058 * It is not an error if this is not the same as the requested size, as it
22059 * can happen e.g. near the end of a file. Zero is returned on end of file
22060 * (or if @count is zero), but never otherwise.
22062 * If @cancellable is not %NULL, then the operation can be cancelled by
22063 * triggering the cancellable object from another thread. If the operation
22064 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
22065 * operation was partially finished when the operation was cancelled the
22066 * partial result will be returned, without an error.
22068 * On error -1 is returned and @error is set accordingly.
22070 * Returns: Number of bytes read, or -1 on error, or 0 on end of file.
22075 * g_input_stream_read_all:
22076 * @stream: a #GInputStream.
22077 * @buffer: a buffer to read data into (which should be at least count bytes long).
22078 * @count: the number of bytes that will be read from the stream
22079 * @bytes_read: (out): location to store the number of bytes that was read from the stream
22080 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22081 * @error: location to store the error occurring, or %NULL to ignore
22083 * Tries to read @count bytes from the stream into the buffer starting at
22084 * @buffer. Will block during this read.
22086 * This function is similar to g_input_stream_read(), except it tries to
22087 * read as many bytes as requested, only stopping on an error or end of stream.
22089 * On a successful read of @count bytes, or if we reached the end of the
22090 * stream, %TRUE is returned, and @bytes_read is set to the number of bytes
22091 * read into @buffer.
22093 * If there is an error during the operation %FALSE is returned and @error
22094 * is set to indicate the error status, @bytes_read is updated to contain
22095 * the number of bytes read into @buffer before the error occurred.
22097 * Returns: %TRUE on success, %FALSE if there was an error
22102 * g_input_stream_read_async:
22103 * @stream: A #GInputStream.
22104 * @buffer: a buffer to read data into (which should be at least count bytes long).
22105 * @count: the number of bytes that will be read from the stream
22106 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
22107 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22108 * @callback: (scope async): callback to call when the request is satisfied
22109 * @user_data: (closure): the data to pass to callback function
22111 * Request an asynchronous read of @count bytes from the stream into the buffer
22112 * starting at @buffer. When the operation is finished @callback will be called.
22113 * You can then call g_input_stream_read_finish() to get the result of the
22116 * During an async request no other sync and async calls are allowed on @stream, and will
22117 * result in %G_IO_ERROR_PENDING errors.
22119 * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
22121 * On success, the number of bytes read into the buffer will be passed to the
22122 * callback. It is not an error if this is not the same as the requested size, as it
22123 * can happen e.g. near the end of a file, but generally we try to read
22124 * as many bytes as requested. Zero is returned on end of file
22125 * (or if @count is zero), but never otherwise.
22127 * Any outstanding i/o request with higher priority (lower numerical value) will
22128 * be executed before an outstanding request with lower priority. Default
22129 * priority is %G_PRIORITY_DEFAULT.
22131 * The asyncronous methods have a default fallback that uses threads to implement
22132 * asynchronicity, so they are optional for inheriting classes. However, if you
22133 * override one you must override all.
22138 * g_input_stream_read_bytes:
22139 * @stream: a #GInputStream.
22140 * @count: maximum number of bytes that will be read from the stream. Common values include 4096 and 8192.
22141 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22142 * @error: location to store the error occurring, or %NULL to ignore
22144 * Like g_input_stream_read(), this tries to read @count bytes from
22145 * the stream in a blocking fashion. However, rather than reading into
22146 * a user-supplied buffer, this will create a new #GBytes containing
22147 * the data that was read. This may be easier to use from language
22150 * If count is zero, returns a zero-length #GBytes and does nothing. A
22151 * value of @count larger than %G_MAXSSIZE will cause a
22152 * %G_IO_ERROR_INVALID_ARGUMENT error.
22154 * On success, a new #GBytes is returned. It is not an error if the
22155 * size of this object is not the same as the requested size, as it
22156 * can happen e.g. near the end of a file. A zero-length #GBytes is
22157 * returned on end of file (or if @count is zero), but never
22160 * If @cancellable is not %NULL, then the operation can be cancelled by
22161 * triggering the cancellable object from another thread. If the operation
22162 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
22163 * operation was partially finished when the operation was cancelled the
22164 * partial result will be returned, without an error.
22166 * On error %NULL is returned and @error is set accordingly.
22168 * Returns: a new #GBytes, or %NULL on error
22173 * g_input_stream_read_bytes_async:
22174 * @stream: A #GInputStream.
22175 * @count: the number of bytes that will be read from the stream
22176 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
22177 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22178 * @callback: (scope async): callback to call when the request is satisfied
22179 * @user_data: (closure): the data to pass to callback function
22181 * Request an asynchronous read of @count bytes from the stream into a
22182 * new #GBytes. When the operation is finished @callback will be
22183 * called. You can then call g_input_stream_read_bytes_finish() to get the
22184 * result of the operation.
22186 * During an async request no other sync and async calls are allowed
22187 * on @stream, and will result in %G_IO_ERROR_PENDING errors.
22189 * A value of @count larger than %G_MAXSSIZE will cause a
22190 * %G_IO_ERROR_INVALID_ARGUMENT error.
22192 * On success, the new #GBytes will be passed to the callback. It is
22193 * not an error if this is smaller than the requested size, as it can
22194 * happen e.g. near the end of a file, but generally we try to read as
22195 * many bytes as requested. Zero is returned on end of file (or if
22196 * @count is zero), but never otherwise.
22198 * Any outstanding I/O request with higher priority (lower numerical
22199 * value) will be executed before an outstanding request with lower
22200 * priority. Default priority is %G_PRIORITY_DEFAULT.
22205 * g_input_stream_read_bytes_finish:
22206 * @stream: a #GInputStream.
22207 * @result: a #GAsyncResult.
22208 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22210 * Finishes an asynchronous stream read-into-#GBytes operation.
22212 * Returns: the newly-allocated #GBytes, or %NULL on error
22217 * g_input_stream_read_finish:
22218 * @stream: a #GInputStream.
22219 * @result: a #GAsyncResult.
22220 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22222 * Finishes an asynchronous stream read operation.
22224 * Returns: number of bytes read in, or -1 on error, or 0 on end of file.
22229 * g_input_stream_set_pending:
22230 * @stream: input stream
22231 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22233 * Sets @stream to have actions pending. If the pending flag is
22234 * already set or @stream is closed, it will return %FALSE and set
22237 * Returns: %TRUE if pending was previously unset and is now set.
22242 * g_input_stream_skip:
22243 * @stream: a #GInputStream.
22244 * @count: the number of bytes that will be skipped from the stream
22245 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22246 * @error: location to store the error occurring, or %NULL to ignore
22248 * Tries to skip @count bytes from the stream. Will block during the operation.
22250 * This is identical to g_input_stream_read(), from a behaviour standpoint,
22251 * but the bytes that are skipped are not returned to the user. Some
22252 * streams have an implementation that is more efficient than reading the data.
22254 * This function is optional for inherited classes, as the default implementation
22255 * emulates it using read.
22257 * If @cancellable is not %NULL, then the operation can be cancelled by
22258 * triggering the cancellable object from another thread. If the operation
22259 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
22260 * operation was partially finished when the operation was cancelled the
22261 * partial result will be returned, without an error.
22263 * Returns: Number of bytes skipped, or -1 on error
22268 * g_input_stream_skip_async:
22269 * @stream: A #GInputStream.
22270 * @count: the number of bytes that will be skipped from the stream
22271 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
22272 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22273 * @callback: (scope async): callback to call when the request is satisfied
22274 * @user_data: (closure): the data to pass to callback function
22276 * Request an asynchronous skip of @count bytes from the stream.
22277 * When the operation is finished @callback will be called.
22278 * You can then call g_input_stream_skip_finish() to get the result
22279 * of the operation.
22281 * During an async request no other sync and async calls are allowed,
22282 * and will result in %G_IO_ERROR_PENDING errors.
22284 * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
22286 * On success, the number of bytes skipped will be passed to the callback.
22287 * It is not an error if this is not the same as the requested size, as it
22288 * can happen e.g. near the end of a file, but generally we try to skip
22289 * as many bytes as requested. Zero is returned on end of file
22290 * (or if @count is zero), but never otherwise.
22292 * Any outstanding i/o request with higher priority (lower numerical value)
22293 * will be executed before an outstanding request with lower priority.
22294 * Default priority is %G_PRIORITY_DEFAULT.
22296 * The asynchronous methods have a default fallback that uses threads to
22297 * implement asynchronicity, so they are optional for inheriting classes.
22298 * However, if you override one, you must override all.
22303 * g_input_stream_skip_finish:
22304 * @stream: a #GInputStream.
22305 * @result: a #GAsyncResult.
22306 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22308 * Finishes a stream skip operation.
22310 * Returns: the size of the bytes skipped, or %-1 on error.
22315 * g_io_error_from_errno:
22316 * @err_no: Error number as defined in errno.h.
22318 * Converts errno.h error codes into GIO error codes.
22320 * Returns: #GIOErrorEnum value for the given errno.h error number.
22325 * g_io_error_from_win32_error:
22326 * @error_code: Windows error number.
22328 * Converts some common error codes into GIO error codes. The
22329 * fallback value G_IO_ERROR_FAILED is returned for error codes not
22332 * Returns: #GIOErrorEnum value for the given error number.
22338 * g_io_error_quark:
22340 * Gets the GIO Error Quark.
22342 * Returns: a #GQuark.
22347 * g_io_extension_get_name:
22348 * @extension: a #GIOExtension
22350 * Gets the name under which @extension was registered.
22352 * Note that the same type may be registered as extension
22353 * for multiple extension points, under different names.
22355 * Returns: the name of @extension.
22360 * g_io_extension_get_priority:
22361 * @extension: a #GIOExtension
22363 * Gets the priority with which @extension was registered.
22365 * Returns: the priority of @extension
22370 * g_io_extension_get_type:
22371 * @extension: a #GIOExtension
22373 * Gets the type associated with @extension.
22375 * Returns: the type of @extension
22380 * g_io_extension_point_get_extension_by_name:
22381 * @extension_point: a #GIOExtensionPoint
22382 * @name: the name of the extension to get
22384 * Finds a #GIOExtension for an extension point by name.
22386 * Returns: (transfer none): the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name
22391 * g_io_extension_point_get_extensions:
22392 * @extension_point: a #GIOExtensionPoint
22394 * Gets a list of all extensions that implement this extension point.
22395 * The list is sorted by priority, beginning with the highest priority.
22397 * Returns: (element-type GIOExtension) (transfer none): a #GList of #GIOExtension<!-- -->s. The list is owned by GIO and should not be modified.
22402 * g_io_extension_point_get_required_type:
22403 * @extension_point: a #GIOExtensionPoint
22405 * Gets the required type for @extension_point.
22407 * Returns: the #GType that all implementations must have, or #G_TYPE_INVALID if the extension point has no required type
22412 * g_io_extension_point_implement:
22413 * @extension_point_name: the name of the extension point
22414 * @type: the #GType to register as extension
22415 * @extension_name: the name for the extension
22416 * @priority: the priority for the extension
22418 * Registers @type as extension for the extension point with name
22419 * @extension_point_name.
22421 * If @type has already been registered as an extension for this
22422 * extension point, the existing #GIOExtension object is returned.
22424 * Returns: (transfer none): a #GIOExtension object for #GType
22429 * g_io_extension_point_lookup:
22430 * @name: the name of the extension point
22432 * Looks up an existing extension point.
22434 * Returns: (transfer none): the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name.
22439 * g_io_extension_point_register:
22440 * @name: The name of the extension point
22442 * Registers an extension point.
22444 * Returns: (transfer none): the new #GIOExtensionPoint. This object is owned by GIO and should not be freed.
22449 * g_io_extension_point_set_required_type:
22450 * @extension_point: a #GIOExtensionPoint
22451 * @type: the #GType to require
22453 * Sets the required type for @extension_point to @type.
22454 * All implementations must henceforth have this type.
22459 * g_io_extension_ref_class:
22460 * @extension: a #GIOExtension
22462 * Gets a reference to the class for the type that is
22463 * associated with @extension.
22465 * Returns: (transfer full): the #GTypeClass for the type of @extension
22471 * @filename: filename of the shared library module.
22473 * Creates a new GIOModule that will load the specific
22474 * shared library when in use.
22476 * Returns: a #GIOModule from given @filename, or %NULL on error.
22481 * g_io_module_scope_block:
22482 * @scope: a module loading scope
22483 * @basename: the basename to block
22485 * Block modules with the given @basename from being loaded when
22486 * this scope is used with g_io_modules_scan_all_in_directory_with_scope()
22487 * or g_io_modules_load_all_in_directory_with_scope().
22494 * g_io_module_scope_free:
22495 * @scope: a module loading scope
22497 * Free a module scope.
22504 * g_io_module_scope_new:
22505 * @flags: flags for the new scope
22507 * Create a new scope for loading of IO modules. A scope can be used for
22508 * blocking duplicate modules, or blocking a module you don't want to load.
22510 * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
22511 * which have the same base name as a module that has already been seen
22514 * Returns: (transfer full): the new module scope
22520 * g_io_modules_load_all_in_directory:
22521 * @dirname: pathname for a directory containing modules to load.
22523 * Loads all the modules in the specified directory.
22525 * If don't require all modules to be initialized (and thus registering
22526 * all gtypes) then you can use g_io_modules_scan_all_in_directory()
22527 * which allows delayed/lazy loading of modules.
22529 * 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().
22534 * g_io_modules_load_all_in_directory_with_scope:
22535 * @dirname: pathname for a directory containing modules to load.
22536 * @scope: a scope to use when scanning the modules.
22538 * Loads all the modules in the specified directory.
22540 * If don't require all modules to be initialized (and thus registering
22541 * all gtypes) then you can use g_io_modules_scan_all_in_directory()
22542 * which allows delayed/lazy loading of modules.
22544 * 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().
22550 * g_io_modules_scan_all_in_directory:
22551 * @dirname: pathname for a directory containing modules to scan.
22553 * Scans all the modules in the specified directory, ensuring that
22554 * any extension point implemented by a module is registered.
22556 * This may not actually load and initialize all the types in each
22557 * module, some modules may be lazily loaded and initialized when
22558 * an extension point it implementes is used with e.g.
22559 * g_io_extension_point_get_extensions() or
22560 * g_io_extension_point_get_extension_by_name().
22562 * If you need to guarantee that all types are loaded in all the modules,
22563 * use g_io_modules_load_all_in_directory().
22570 * g_io_modules_scan_all_in_directory_with_scope:
22571 * @dirname: pathname for a directory containing modules to scan.
22572 * @scope: a scope to use when scanning the modules
22574 * Scans all the modules in the specified directory, ensuring that
22575 * any extension point implemented by a module is registered.
22577 * This may not actually load and initialize all the types in each
22578 * module, some modules may be lazily loaded and initialized when
22579 * an extension point it implementes is used with e.g.
22580 * g_io_extension_point_get_extensions() or
22581 * g_io_extension_point_get_extension_by_name().
22583 * If you need to guarantee that all types are loaded in all the modules,
22584 * use g_io_modules_load_all_in_directory().
22591 * g_io_scheduler_cancel_all_jobs:
22593 * Cancels all cancellable I/O jobs.
22595 * A job is cancellable if a #GCancellable was passed into
22596 * g_io_scheduler_push_job().
22598 * Deprecated: You should never call this function, since you don't know how other libraries in your program might be making use of gioscheduler.
22603 * g_io_scheduler_job_send_to_mainloop:
22604 * @job: a #GIOSchedulerJob
22605 * @func: a #GSourceFunc callback that will be called in the original thread
22606 * @user_data: data to pass to @func
22607 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22609 * Used from an I/O job to send a callback to be run in the thread
22610 * that the job was started from, waiting for the result (and thus
22611 * blocking the I/O job).
22613 * Returns: The return value of @func
22614 * Deprecated: Use g_main_context_invoke().
22619 * g_io_scheduler_job_send_to_mainloop_async:
22620 * @job: a #GIOSchedulerJob
22621 * @func: a #GSourceFunc callback that will be called in the original thread
22622 * @user_data: data to pass to @func
22623 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22625 * Used from an I/O job to send a callback to be run asynchronously in
22626 * the thread that the job was started from. The callback will be run
22627 * when the main loop is available, but at that time the I/O job might
22628 * have finished. The return value from the callback is ignored.
22630 * Note that if you are passing the @user_data from g_io_scheduler_push_job()
22631 * on to this function you have to ensure that it is not freed before
22632 * @func is called, either by passing %NULL as @notify to
22633 * g_io_scheduler_push_job() or by using refcounting for @user_data.
22635 * Deprecated: Use g_main_context_invoke().
22640 * g_io_scheduler_push_job:
22641 * @job_func: a #GIOSchedulerJobFunc.
22642 * @user_data: data to pass to @job_func
22643 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22644 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
22645 * @cancellable: optional #GCancellable object, %NULL to ignore.
22647 * Schedules the I/O job to run in another thread.
22649 * @notify will be called on @user_data after @job_func has returned,
22650 * regardless whether the job was cancelled or has run to completion.
22652 * If @cancellable is not %NULL, it can be used to cancel the I/O job
22653 * by calling g_cancellable_cancel() or by calling
22654 * g_io_scheduler_cancel_all_jobs().
22656 * Deprecated: use #GThreadPool or g_task_run_in_thread()
22661 * g_io_stream_clear_pending:
22662 * @stream: a #GIOStream
22664 * Clears the pending flag on @stream.
22671 * g_io_stream_close:
22672 * @stream: a #GIOStream
22673 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
22674 * @error: location to store the error occurring, or %NULL to ignore
22676 * Closes the stream, releasing resources related to it. This will also
22677 * closes the individual input and output streams, if they are not already
22680 * Once the stream is closed, all other operations will return
22681 * %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
22684 * Closing a stream will automatically flush any outstanding buffers
22687 * Streams will be automatically closed when the last reference
22688 * is dropped, but you might want to call this function to make sure
22689 * resources are released as early as possible.
22691 * Some streams might keep the backing store of the stream (e.g. a file
22692 * descriptor) open after the stream is closed. See the documentation for
22693 * the individual stream for details.
22695 * On failure the first error that happened will be reported, but the
22696 * close operation will finish as much as possible. A stream that failed
22697 * to close will still return %G_IO_ERROR_CLOSED for all operations.
22698 * Still, it is important to check and report the error to the user,
22699 * otherwise there might be a loss of data as all data might not be written.
22701 * If @cancellable is not NULL, then the operation can be cancelled by
22702 * triggering the cancellable object from another thread. If the operation
22703 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
22704 * Cancelling a close will still leave the stream closed, but some streams
22705 * can use a faster close that doesn't block to e.g. check errors.
22707 * The default implementation of this method just calls close on the
22708 * individual input/output streams.
22710 * Returns: %TRUE on success, %FALSE on failure
22716 * g_io_stream_close_async:
22717 * @stream: a #GIOStream
22718 * @io_priority: the io priority of the request
22719 * @cancellable: (allow-none): optional cancellable object
22720 * @callback: (scope async): callback to call when the request is satisfied
22721 * @user_data: (closure): the data to pass to callback function
22723 * Requests an asynchronous close of the stream, releasing resources
22724 * related to it. When the operation is finished @callback will be
22725 * called. You can then call g_io_stream_close_finish() to get
22726 * the result of the operation.
22728 * For behaviour details see g_io_stream_close().
22730 * The asynchronous methods have a default fallback that uses threads
22731 * to implement asynchronicity, so they are optional for inheriting
22732 * classes. However, if you override one you must override all.
22739 * g_io_stream_close_finish:
22740 * @stream: a #GIOStream
22741 * @result: a #GAsyncResult
22742 * @error: a #GError location to store the error occurring, or %NULL to ignore
22746 * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
22752 * g_io_stream_get_input_stream:
22753 * @stream: a #GIOStream
22755 * Gets the input stream for this object. This is used
22758 * Returns: (transfer none): a #GInputStream, owned by the #GIOStream. Do not free.
22764 * g_io_stream_get_output_stream:
22765 * @stream: a #GIOStream
22767 * Gets the output stream for this object. This is used for
22770 * Returns: (transfer none): a #GOutputStream, owned by the #GIOStream. Do not free.
22776 * g_io_stream_has_pending:
22777 * @stream: a #GIOStream
22779 * Checks if a stream has pending actions.
22781 * Returns: %TRUE if @stream has pending actions.
22787 * g_io_stream_is_closed:
22788 * @stream: a #GIOStream
22790 * Checks if a stream is closed.
22792 * Returns: %TRUE if the stream is closed.
22798 * g_io_stream_set_pending:
22799 * @stream: a #GIOStream
22800 * @error: a #GError location to store the error occurring, or %NULL to ignore
22802 * Sets @stream to have actions pending. If the pending flag is
22803 * already set or @stream is closed, it will return %FALSE and set
22806 * Returns: %TRUE if pending was previously unset and is now set.
22812 * g_io_stream_splice_async:
22813 * @stream1: a #GIOStream.
22814 * @stream2: a #GIOStream.
22815 * @flags: a set of #GIOStreamSpliceFlags.
22816 * @io_priority: the io priority of the request.
22817 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22818 * @callback: (scope async): a #GAsyncReadyCallback.
22819 * @user_data: (closure): user data passed to @callback.
22821 * Asyncronously splice the output stream of @stream1 to the input stream of
22822 * @stream2, and splice the output stream of @stream2 to the input stream of
22825 * When the operation is finished @callback will be called.
22826 * You can then call g_io_stream_splice_finish() to get the
22827 * result of the operation.
22834 * g_io_stream_splice_finish:
22835 * @result: a #GAsyncResult.
22836 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22838 * Finishes an asynchronous io stream splice operation.
22840 * Returns: %TRUE on success, %FALSE otherwise.
22846 * g_keyfile_settings_backend_new:
22847 * @filename: the filename of the keyfile
22848 * @root_path: the path under which all settings keys appear
22849 * @root_group: (allow-none): the group name corresponding to @root_path, or %NULL
22851 * Creates a keyfile-backed #GSettingsBackend.
22853 * The filename of the keyfile to use is given by @filename.
22855 * All settings read to or written from the backend must fall under the
22856 * path given in @root_path (which must start and end with a slash and
22857 * not contain two consecutive slashes). @root_path may be "/".
22859 * If @root_group is non-%NULL then it specifies the name of the keyfile
22860 * group used for keys that are written directly below @root_path. For
22861 * example, if @root_path is "/apps/example/" and @root_group is
22862 * "toplevel", then settings the key "/apps/example/enabled" to a value
22863 * of %TRUE will cause the following to appear in the keyfile:
22870 * If @root_group is %NULL then it is not permitted to store keys
22871 * directly below the @root_path.
22873 * For keys not stored directly below @root_path (ie: in a sub-path),
22874 * the name of the subpath (with the final slash stripped) is used as
22875 * the name of the keyfile group. To continue the example, if
22876 * "/apps/example/profiles/default/font-size" were set to
22877 * 12 then the following would appear in the keyfile:
22880 * [profiles/default]
22884 * The backend will refuse writes (and return writability as being
22885 * %FALSE) for keys outside of @root_path and, in the event that
22886 * @root_group is %NULL, also for keys directly under @root_path.
22887 * Writes will also be refused if the backend detects that it has the
22888 * inability to rewrite the keyfile (ie: the containing directory is not
22891 * There is no checking done for your key namespace clashing with the
22892 * syntax of the key file format. For example, if you have '[' or ']'
22893 * characters in your path names or '=' in your key names you may be in
22896 * Returns: (transfer full): a keyfile-backed #GSettingsBackend
22901 * g_loadable_icon_load:
22902 * @icon: a #GLoadableIcon.
22903 * @size: an integer.
22904 * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
22905 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22906 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22908 * Loads a loadable icon. For the asynchronous version of this function,
22909 * see g_loadable_icon_load_async().
22911 * Returns: (transfer full): a #GInputStream to read the icon from.
22916 * g_loadable_icon_load_async:
22917 * @icon: a #GLoadableIcon.
22918 * @size: an integer.
22919 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22920 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
22921 * @user_data: (closure): the data to pass to callback function
22923 * Loads an icon asynchronously. To finish this function, see
22924 * g_loadable_icon_load_finish(). For the synchronous, blocking
22925 * version of this function, see g_loadable_icon_load().
22930 * g_loadable_icon_load_finish:
22931 * @icon: a #GLoadableIcon.
22932 * @res: a #GAsyncResult.
22933 * @type: a location to store the type of the loaded icon, %NULL to ignore.
22934 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22936 * Finishes an asynchronous icon load started in g_loadable_icon_load_async().
22938 * Returns: (transfer full): a #GInputStream to read the icon from.
22945 * Returns a new #GVfs handle for a local vfs.
22947 * Returns: a new #GVfs handle.
22952 * g_memory_input_stream_add_bytes:
22953 * @stream: a #GMemoryInputStream
22954 * @bytes: input data
22956 * Appends @bytes to data that can be read from the input stream.
22963 * g_memory_input_stream_add_data:
22964 * @stream: a #GMemoryInputStream
22965 * @data: (array length=len) (element-type guint8) (transfer full): input data
22966 * @len: length of the data, may be -1 if @data is a nul-terminated string
22967 * @destroy: (allow-none): function that is called to free @data, or %NULL
22969 * Appends @data to data that can be read from the input stream
22974 * g_memory_input_stream_new:
22976 * Creates a new empty #GMemoryInputStream.
22978 * Returns: a new #GInputStream
22983 * g_memory_input_stream_new_from_bytes:
22984 * @bytes: a #GBytes
22986 * Creates a new #GMemoryInputStream with data from the given @bytes.
22988 * Returns: new #GInputStream read from @bytes
22994 * g_memory_input_stream_new_from_data:
22995 * @data: (array length=len) (element-type guint8) (transfer full): input data
22996 * @len: length of the data, may be -1 if @data is a nul-terminated string
22997 * @destroy: (allow-none): function that is called to free @data, or %NULL
22999 * Creates a new #GMemoryInputStream with data in memory of a given size.
23001 * Returns: new #GInputStream read from @data of @len bytes.
23006 * g_memory_output_stream_get_data:
23007 * @ostream: a #GMemoryOutputStream
23009 * Gets any loaded data from the @ostream.
23011 * Note that the returned pointer may become invalid on the next
23012 * write or truncate operation on the stream.
23014 * Returns: (transfer none): pointer to the stream's data
23019 * g_memory_output_stream_get_data_size:
23020 * @ostream: a #GMemoryOutputStream
23022 * Returns the number of bytes from the start up
23023 * to including the last byte written in the stream
23024 * that has not been truncated away.
23026 * Returns: the number of bytes written to the stream
23032 * g_memory_output_stream_get_size:
23033 * @ostream: a #GMemoryOutputStream
23035 * Gets the size of the currently allocated data area (available from
23036 * g_memory_output_stream_get_data()). If the stream isn't
23037 * growable (no realloc was passed to g_memory_output_stream_new()) then
23038 * this is the maximum size of the stream and further writes
23039 * will return %G_IO_ERROR_NO_SPACE.
23041 * Note that for growable streams the returned size may become invalid on
23042 * the next write or truncate operation on the stream.
23044 * If you want the number of bytes currently written to the stream, use
23045 * g_memory_output_stream_get_data_size().
23047 * Returns: the number of bytes allocated for the data buffer
23052 * g_memory_output_stream_new: (skip)
23053 * @data: (allow-none): pointer to a chunk of memory to use, or %NULL
23054 * @size: the size of @data
23055 * @realloc_function: (allow-none): a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
23056 * @destroy_function: (allow-none): a function to be called on @data when the stream is finalized, or %NULL
23058 * Creates a new #GMemoryOutputStream.
23060 * If @data is non-%NULL, the stream will use that for its internal storage.
23061 * If @realloc_fn is non-%NULL, it will be used for resizing the internal
23062 * storage when necessary. To construct a fixed-size output stream,
23063 * pass %NULL as @realloc_fn.
23066 * /* a stream that can grow */
23067 * stream = g_memory_output_stream_new (NULL, 0, realloc, free);
23069 * /* another stream that can grow */
23070 * stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
23072 * /* a fixed-size stream */
23073 * data = malloc (200);
23074 * stream3 = g_memory_output_stream_new (data, 200, NULL, free);
23077 * Returns: A newly created #GMemoryOutputStream object.
23082 * g_memory_output_stream_steal_as_bytes:
23083 * @ostream: a #GMemoryOutputStream
23085 * Returns data from the @ostream as a #GBytes. @ostream must be
23086 * closed before calling this function.
23088 * Returns: (transfer full): the stream's data
23094 * g_memory_output_stream_steal_data:
23095 * @ostream: a #GMemoryOutputStream
23097 * Gets any loaded data from the @ostream. Ownership of the data
23098 * is transferred to the caller; when no longer needed it must be
23099 * freed using the free function set in @ostream's
23100 * #GMemoryOutputStream:destroy-function property.
23102 * @ostream must be closed before calling this function.
23104 * Returns: (transfer full): the stream's data
23110 * g_memory_settings_backend_new:
23112 * Creates a memory-backed #GSettingsBackend.
23114 * This backend allows changes to settings, but does not write them
23115 * to any backing storage, so the next time you run your application,
23116 * the memory backend will start out with the default values again.
23118 * Returns: (transfer full): a newly created #GSettingsBackend
23126 * @label: (allow-none): the section label, or %NULL
23127 * @detailed_action: (allow-none): the detailed action string, or %NULL
23129 * Convenience function for appending a normal menu item to the end of
23130 * @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
23131 * flexible alternative.
23138 * g_menu_append_item:
23140 * @item: a #GMenuItem to append
23142 * Appends @item to the end of @menu.
23144 * See g_menu_insert_item() for more information.
23151 * g_menu_append_section:
23153 * @label: (allow-none): the section label, or %NULL
23154 * @section: a #GMenuModel with the items of the section
23156 * Convenience function for appending a section menu item to the end of
23157 * @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for a
23158 * more flexible alternative.
23165 * g_menu_append_submenu:
23167 * @label: (allow-none): the section label, or %NULL
23168 * @submenu: a #GMenuModel with the items of the submenu
23170 * Convenience function for appending a submenu menu item to the end of
23171 * @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for a
23172 * more flexible alternative.
23179 * g_menu_attribute_iter_get_name:
23180 * @iter: a #GMenuAttributeIter
23182 * Gets the name of the attribute at the current iterator position, as
23185 * The iterator is not advanced.
23187 * Returns: the name of the attribute
23193 * g_menu_attribute_iter_get_next:
23194 * @iter: a #GMenuAttributeIter
23195 * @out_name: (out) (allow-none) (transfer none): the type of the attribute
23196 * @value: (out) (allow-none) (transfer full): the attribute value
23198 * This function combines g_menu_attribute_iter_next() with
23199 * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
23201 * First the iterator is advanced to the next (possibly first) attribute.
23202 * If that fails, then %FALSE is returned and there are no other
23205 * If successful, @name and @value are set to the name and value of the
23206 * attribute that has just been advanced to. At this point,
23207 * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will
23208 * return the same values again.
23210 * The value returned in @name remains valid for as long as the iterator
23211 * remains at the current position. The value returned in @value must
23212 * be unreffed using g_variant_unref() when it is no longer in use.
23214 * Returns: %TRUE on success, or %FALSE if there is no additional attribute
23220 * g_menu_attribute_iter_get_value:
23221 * @iter: a #GMenuAttributeIter
23223 * Gets the value of the attribute at the current iterator position.
23225 * The iterator is not advanced.
23227 * Returns: (transfer full): the value of the current attribute
23233 * g_menu_attribute_iter_next:
23234 * @iter: a #GMenuAttributeIter
23236 * Attempts to advance the iterator to the next (possibly first)
23239 * %TRUE is returned on success, or %FALSE if there are no more
23242 * You must call this function when you first acquire the iterator
23243 * to advance it to the first attribute (and determine if the first
23244 * attribute exists at all).
23246 * Returns: %TRUE on success, or %FALSE when there are no more attributes
23255 * Marks @menu as frozen.
23257 * After the menu is frozen, it is an error to attempt to make any
23258 * changes to it. In effect this means that the #GMenu API must no
23261 * This function causes g_menu_model_is_mutable() to begin returning
23262 * %FALSE, which has some positive performance implications.
23271 * @position: the position at which to insert the item
23272 * @label: (allow-none): the section label, or %NULL
23273 * @detailed_action: (allow-none): the detailed action string, or %NULL
23275 * Convenience function for inserting a normal menu item into @menu.
23276 * Combine g_menu_item_new() and g_menu_insert_item() for a more flexible
23284 * g_menu_insert_item:
23286 * @position: the position at which to insert the item
23287 * @item: the #GMenuItem to insert
23289 * Inserts @item into @menu.
23291 * The "insertion" is actually done by copying all of the attribute and
23292 * link values of @item and using them to form a new item within @menu.
23293 * As such, @item itself is not really inserted, but rather, a menu item
23294 * that is exactly the same as the one presently described by @item.
23296 * This means that @item is essentially useless after the insertion
23297 * occurs. Any changes you make to it are ignored unless it is inserted
23298 * again (at which point its updated values will be copied).
23300 * You should probably just free @item once you're done.
23302 * There are many convenience functions to take care of common cases.
23303 * See g_menu_insert(), g_menu_insert_section() and
23304 * g_menu_insert_submenu() as well as "prepend" and "append" variants of
23305 * each of these functions.
23312 * g_menu_insert_section:
23314 * @position: the position at which to insert the item
23315 * @label: (allow-none): the section label, or %NULL
23316 * @section: a #GMenuModel with the items of the section
23318 * Convenience function for inserting a section menu item into @menu.
23319 * Combine g_menu_item_new_section() and g_menu_insert_item() for a more
23320 * flexible alternative.
23327 * g_menu_insert_submenu:
23329 * @position: the position at which to insert the item
23330 * @label: (allow-none): the section label, or %NULL
23331 * @submenu: a #GMenuModel with the items of the submenu
23333 * Convenience function for inserting a submenu menu item into @menu.
23334 * Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more
23335 * flexible alternative.
23342 * g_menu_item_get_attribute:
23343 * @menu_item: a #GMenuItem
23344 * @attribute: the attribute name to query
23345 * @format_string: a #GVariant format string
23346 * @...: positional parameters, as per @format_string
23348 * Queries the named @attribute on @menu_item.
23350 * If the attribute exists and matches the #GVariantType corresponding
23351 * to @format_string then @format_string is used to deconstruct the
23352 * value into the positional parameters and %TRUE is returned.
23354 * If the attribute does not exist, or it does exist but has the wrong
23355 * type, then the positional parameters are ignored and %FALSE is
23358 * Returns: %TRUE if the named attribute was found with the expected type
23364 * g_menu_item_get_attribute_value:
23365 * @menu_item: a #GMenuItem
23366 * @attribute: the attribute name to query
23367 * @expected_type: (allow-none): the expected type of the attribute
23369 * Queries the named @attribute on @menu_item.
23371 * If @expected_type is specified and the attribute does not have this
23372 * type, %NULL is returned. %NULL is also returned if the attribute
23373 * simply does not exist.
23375 * Returns: (transfer full): the attribute value, or %NULL
23381 * g_menu_item_get_link:
23382 * @menu_item: a #GMenuItem
23383 * @link: the link name to query
23385 * Queries the named @link on @menu_item.
23387 * Returns: (transfer full): the link, or %NULL
23394 * @label: (allow-none): the section label, or %NULL
23395 * @detailed_action: (allow-none): the detailed action string, or %NULL
23397 * Creates a new #GMenuItem.
23399 * If @label is non-%NULL it is used to set the "label" attribute of the
23402 * If @detailed_action is non-%NULL it is used to set the "action" and
23403 * possibly the "target" attribute of the new item. See
23404 * g_menu_item_set_detailed_action() for more information.
23406 * Returns: a new #GMenuItem
23412 * g_menu_item_new_from_model:
23413 * @model: a #GMenuModel
23414 * @item_index: the index of an item in @model
23416 * Creates a #GMenuItem as an exact copy of an existing menu item in a
23419 * @item_index must be valid (ie: be sure to call
23420 * g_menu_model_get_n_items() first).
23422 * Returns: a new #GMenuItem.
23428 * g_menu_item_new_section:
23429 * @label: (allow-none): the section label, or %NULL
23430 * @section: a #GMenuModel with the items of the section
23432 * Creates a new #GMenuItem representing a section.
23434 * This is a convenience API around g_menu_item_new() and
23435 * g_menu_item_set_section().
23437 * The effect of having one menu appear as a section of another is
23438 * exactly as it sounds: the items from @section become a direct part of
23439 * the menu that @menu_item is added to.
23441 * Visual separation is typically displayed between two non-empty
23442 * sections. If @label is non-%NULL then it will be encorporated into
23443 * this visual indication. This allows for labeled subsections of a
23446 * As a simple example, consider a typical "Edit" menu from a simple
23447 * program. It probably contains an "Undo" and "Redo" item, followed by
23448 * a separator, followed by "Cut", "Copy" and "Paste".
23450 * This would be accomplished by creating three #GMenu instances. The
23451 * first would be populated with the "Undo" and "Redo" items, and the
23452 * second with the "Cut", "Copy" and "Paste" items. The first and
23453 * second menus would then be added as submenus of the third. In XML
23454 * format, this would look something like the following:
23456 * <informalexample><programlisting><![CDATA[
23457 * <menu id='edit-menu'>
23459 * <item label='Undo'/>
23460 * <item label='Redo'/>
23463 * <item label='Cut'/>
23464 * <item label='Copy'/>
23465 * <item label='Paste'/>
23468 * ]]></programlisting></informalexample>
23470 * The following example is exactly equivalent. It is more illustrative
23471 * of the exact relationship between the menus and items (keeping in
23472 * mind that the 'link' element defines a new menu that is linked to the
23473 * containing one). The style of the second example is more verbose and
23474 * difficult to read (and therefore not recommended except for the
23475 * purpose of understanding what is really going on).
23477 * <informalexample><programlisting><![CDATA[
23478 * <menu id='edit-menu'>
23480 * <link name='section'>
23481 * <item label='Undo'/>
23482 * <item label='Redo'/>
23486 * <link name='section'>
23487 * <item label='Cut'/>
23488 * <item label='Copy'/>
23489 * <item label='Paste'/>
23493 * ]]></programlisting></informalexample>
23495 * Returns: a new #GMenuItem
23501 * g_menu_item_new_submenu:
23502 * @label: (allow-none): the section label, or %NULL
23503 * @submenu: a #GMenuModel with the items of the submenu
23505 * Creates a new #GMenuItem representing a submenu.
23507 * This is a convenience API around g_menu_item_new() and
23508 * g_menu_item_set_submenu().
23510 * Returns: a new #GMenuItem
23516 * g_menu_item_set_action_and_target:
23517 * @menu_item: a #GMenuItem
23518 * @action: (allow-none): the name of the action for this item
23519 * @format_string: (allow-none): a GVariant format string
23520 * @...: positional parameters, as per @format_string
23522 * Sets or unsets the "action" and "target" attributes of @menu_item.
23524 * If @action is %NULL then both the "action" and "target" attributes
23525 * are unset (and @format_string is ignored along with the positional
23528 * If @action is non-%NULL then the "action" attribute is set.
23529 * @format_string is then inspected. If it is non-%NULL then the proper
23530 * position parameters are collected to create a #GVariant instance to
23531 * use as the target value. If it is %NULL then the positional
23532 * parameters are ignored and the "target" attribute is unset.
23534 * See also g_menu_item_set_action_and_target_value() for an equivalent
23535 * call that directly accepts a #GVariant. See
23536 * g_menu_item_set_detailed_action() for a more convenient version that
23537 * works with string-typed targets.
23539 * See also g_menu_item_set_action_and_target_value() for a
23540 * description of the semantics of the action and target attributes.
23547 * g_menu_item_set_action_and_target_value:
23548 * @menu_item: a #GMenuItem
23549 * @action: (allow-none): the name of the action for this item
23550 * @target_value: (allow-none): a #GVariant to use as the action target
23552 * Sets or unsets the "action" and "target" attributes of @menu_item.
23554 * If @action is %NULL then both the "action" and "target" attributes
23555 * are unset (and @target_value is ignored).
23557 * If @action is non-%NULL then the "action" attribute is set. The
23558 * "target" attribute is then set to the value of @target_value if it is
23559 * non-%NULL or unset otherwise.
23561 * Normal menu items (ie: not submenu, section or other custom item
23562 * types) are expected to have the "action" attribute set to identify
23563 * the action that they are associated with. The state type of the
23564 * action help to determine the disposition of the menu item. See
23565 * #GAction and #GActionGroup for an overview of actions.
23567 * In general, clicking on the menu item will result in activation of
23568 * the named action with the "target" attribute given as the parameter
23569 * to the action invocation. If the "target" attribute is not set then
23570 * the action is invoked with no parameter.
23572 * If the action has no state then the menu item is usually drawn as a
23573 * plain menu item (ie: with no additional decoration).
23575 * If the action has a boolean state then the menu item is usually drawn
23576 * as a toggle menu item (ie: with a checkmark or equivalent
23577 * indication). The item should be marked as 'toggled' or 'checked'
23578 * when the boolean state is %TRUE.
23580 * If the action has a string state then the menu item is usually drawn
23581 * as a radio menu item (ie: with a radio bullet or equivalent
23582 * indication). The item should be marked as 'selected' when the string
23583 * state is equal to the value of the @target property.
23585 * See g_menu_item_set_action_and_target() or
23586 * g_menu_item_set_detailed_action() for two equivalent calls that are
23587 * probably more convenient for most uses.
23594 * g_menu_item_set_attribute:
23595 * @menu_item: a #GMenuItem
23596 * @attribute: the attribute to set
23597 * @format_string: (allow-none): a #GVariant format string, or %NULL
23598 * @...: positional parameters, as per @format_string
23600 * Sets or unsets an attribute on @menu_item.
23602 * The attribute to set or unset is specified by @attribute. This
23603 * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23604 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23606 * Attribute names are restricted to lowercase characters, numbers
23607 * and '-'. Furthermore, the names must begin with a lowercase character,
23608 * must not end with a '-', and must not contain consecutive dashes.
23610 * If @format_string is non-%NULL then the proper position parameters
23611 * are collected to create a #GVariant instance to use as the attribute
23612 * value. If it is %NULL then the positional parameterrs are ignored
23613 * and the named attribute is unset.
23615 * See also g_menu_item_set_attribute_value() for an equivalent call
23616 * that directly accepts a #GVariant.
23623 * g_menu_item_set_attribute_value:
23624 * @menu_item: a #GMenuItem
23625 * @attribute: the attribute to set
23626 * @value: (allow-none): a #GVariant to use as the value, or %NULL
23628 * Sets or unsets an attribute on @menu_item.
23630 * The attribute to set or unset is specified by @attribute. This
23631 * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23632 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23634 * Attribute names are restricted to lowercase characters, numbers
23635 * and '-'. Furthermore, the names must begin with a lowercase character,
23636 * must not end with a '-', and must not contain consecutive dashes.
23638 * must consist only of lowercase
23639 * ASCII characters, digits and '-'.
23641 * If @value is non-%NULL then it is used as the new value for the
23642 * attribute. If @value is %NULL then the attribute is unset. If
23643 * the @value #GVariant is floating, it is consumed.
23645 * See also g_menu_item_set_attribute() for a more convenient way to do
23653 * g_menu_item_set_detailed_action:
23654 * @menu_item: a #GMenuItem
23655 * @detailed_action: the "detailed" action string
23657 * Sets the "action" and possibly the "target" attribute of @menu_item.
23659 * If @detailed_action contains a double colon ("::") then it is used as
23660 * a separator between an action name and a target string. In this
23661 * case, this call is equivalent to calling
23662 * g_menu_item_set_action_and_target() with the part before the "::" and
23663 * with a string-type #GVariant containing the part following the "::".
23665 * If @detailed_action doesn't contain "::" then the action is set to
23666 * the given string (verbatim) and the target value is unset.
23668 * See g_menu_item_set_action_and_target() or
23669 * g_menu_item_set_action_and_target_value() for more flexible (but
23670 * slightly less convenient) alternatives.
23672 * See also g_menu_item_set_action_and_target_value() for a description of
23673 * the semantics of the action and target attributes.
23680 * g_menu_item_set_label:
23681 * @menu_item: a #GMenuItem
23682 * @label: (allow-none): the label to set, or %NULL to unset
23684 * Sets or unsets the "label" attribute of @menu_item.
23686 * If @label is non-%NULL it is used as the label for the menu item. If
23687 * it is %NULL then the label attribute is unset.
23694 * g_menu_item_set_link:
23695 * @menu_item: a #GMenuItem
23696 * @link: type of link to establish or unset
23697 * @model: (allow-none): the #GMenuModel to link to (or %NULL to unset)
23699 * Creates a link from @menu_item to @model if non-%NULL, or unsets it.
23701 * Links are used to establish a relationship between a particular menu
23702 * item and another menu. For example, %G_MENU_LINK_SUBMENU is used to
23703 * associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
23704 * is used to create a section. Other types of link can be used, but there
23705 * is no guarantee that clients will be able to make sense of them.
23706 * Link types are restricted to lowercase characters, numbers
23707 * and '-'. Furthermore, the names must begin with a lowercase character,
23708 * must not end with a '-', and must not contain consecutive dashes.
23715 * g_menu_item_set_section:
23716 * @menu_item: a #GMenuItem
23717 * @section: (allow-none): a #GMenuModel, or %NULL
23719 * Sets or unsets the "section" link of @menu_item to @section.
23721 * The effect of having one menu appear as a section of another is
23722 * exactly as it sounds: the items from @section become a direct part of
23723 * the menu that @menu_item is added to. See g_menu_item_new_section()
23724 * for more information about what it means for a menu item to be a
23732 * g_menu_item_set_submenu:
23733 * @menu_item: a #GMenuItem
23734 * @submenu: (allow-none): a #GMenuModel, or %NULL
23736 * Sets or unsets the "submenu" link of @menu_item to @submenu.
23738 * If @submenu is non-%NULL, it is linked to. If it is %NULL then the
23741 * The effect of having one menu appear as a submenu of another is
23742 * exactly as it sounds.
23749 * g_menu_link_iter_get_name:
23750 * @iter: a #GMenuLinkIter
23752 * Gets the name of the link at the current iterator position.
23754 * The iterator is not advanced.
23756 * Returns: the type of the link
23762 * g_menu_link_iter_get_next:
23763 * @iter: a #GMenuLinkIter
23764 * @out_link: (out) (allow-none) (transfer none): the name of the link
23765 * @value: (out) (allow-none) (transfer full): the linked #GMenuModel
23767 * This function combines g_menu_link_iter_next() with
23768 * g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
23770 * First the iterator is advanced to the next (possibly first) link.
23771 * If that fails, then %FALSE is returned and there are no other effects.
23773 * If successful, @out_link and @value are set to the name and #GMenuModel
23774 * of the link that has just been advanced to. At this point,
23775 * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
23776 * same values again.
23778 * The value returned in @out_link remains valid for as long as the iterator
23779 * remains at the current position. The value returned in @value must
23780 * be unreffed using g_object_unref() when it is no longer in use.
23782 * Returns: %TRUE on success, or %FALSE if there is no additional link
23788 * g_menu_link_iter_get_value:
23789 * @iter: a #GMenuLinkIter
23791 * Gets the linked #GMenuModel at the current iterator position.
23793 * The iterator is not advanced.
23795 * Returns: (transfer full): the #GMenuModel that is linked to
23801 * g_menu_link_iter_next:
23802 * @iter: a #GMenuLinkIter
23804 * Attempts to advance the iterator to the next (possibly first)
23807 * %TRUE is returned on success, or %FALSE if there are no more links.
23809 * You must call this function when you first acquire the iterator to
23810 * advance it to the first link (and determine if the first link exists
23813 * Returns: %TRUE on success, or %FALSE when there are no more links
23819 * g_menu_model_get_item_attribute:
23820 * @model: a #GMenuModel
23821 * @item_index: the index of the item
23822 * @attribute: the attribute to query
23823 * @format_string: a #GVariant format string
23824 * @...: positional parameters, as per @format_string
23826 * Queries item at position @item_index in @model for the attribute
23827 * specified by @attribute.
23829 * If the attribute exists and matches the #GVariantType corresponding
23830 * to @format_string then @format_string is used to deconstruct the
23831 * value into the positional parameters and %TRUE is returned.
23833 * If the attribute does not exist, or it does exist but has the wrong
23834 * type, then the positional parameters are ignored and %FALSE is
23837 * This function is a mix of g_menu_model_get_item_attribute_value() and
23838 * g_variant_get(), followed by a g_variant_unref(). As such,
23839 * @format_string must make a complete copy of the data (since the
23840 * #GVariant may go away after the call to g_variant_unref()). In
23841 * particular, no '&' characters are allowed in @format_string.
23843 * Returns: %TRUE if the named attribute was found with the expected type
23849 * g_menu_model_get_item_attribute_value:
23850 * @model: a #GMenuModel
23851 * @item_index: the index of the item
23852 * @attribute: the attribute to query
23853 * @expected_type: (allow-none): the expected type of the attribute, or %NULL
23855 * Queries the item at position @item_index in @model for the attribute
23856 * specified by @attribute.
23858 * If @expected_type is non-%NULL then it specifies the expected type of
23859 * the attribute. If it is %NULL then any type will be accepted.
23861 * If the attribute exists and matches @expected_type (or if the
23862 * expected type is unspecified) then the value is returned.
23864 * If the attribute does not exist, or does not match the expected type
23865 * then %NULL is returned.
23867 * Returns: (transfer full): the value of the attribute
23873 * g_menu_model_get_item_link:
23874 * @model: a #GMenuModel
23875 * @item_index: the index of the item
23876 * @link: the link to query
23878 * Queries the item at position @item_index in @model for the link
23879 * specified by @link.
23881 * If the link exists, the linked #GMenuModel is returned. If the link
23882 * does not exist, %NULL is returned.
23884 * Returns: (transfer full): the linked #GMenuModel, or %NULL
23890 * g_menu_model_get_n_items:
23891 * @model: a #GMenuModel
23893 * Query the number of items in @model.
23895 * Returns: the number of items
23901 * g_menu_model_is_mutable:
23902 * @model: a #GMenuModel
23904 * Queries if @model is mutable.
23906 * An immutable #GMenuModel will never emit the #GMenuModel::items-changed
23907 * signal. Consumers of the model may make optimisations accordingly.
23909 * Returns: %TRUE if the model is mutable (ie: "items-changed" may be emitted).
23915 * g_menu_model_items_changed:
23916 * @model: a #GMenuModel
23917 * @position: the position of the change
23918 * @removed: the number of items removed
23919 * @added: the number of items added
23921 * Requests emission of the #GMenuModel::items-changed signal on @model.
23923 * This function should never be called except by #GMenuModel
23924 * subclasses. Any other calls to this function will very likely lead
23925 * to a violation of the interface of the model.
23927 * The implementation should update its internal representation of the
23928 * menu before emitting the signal. The implementation should further
23929 * expect to receive queries about the new state of the menu (and
23930 * particularly added menu items) while signal handlers are running.
23932 * The implementation must dispatch this call directly from a mainloop
23933 * entry and not in response to calls -- particularly those from the
23934 * #GMenuModel API. Said another way: the menu must not change while
23935 * user code is running without returning to the mainloop.
23942 * g_menu_model_iterate_item_attributes:
23943 * @model: a #GMenuModel
23944 * @item_index: the index of the item
23946 * Creates a #GMenuAttributeIter to iterate over the attributes of
23947 * the item at position @item_index in @model.
23949 * You must free the iterator with g_object_unref() when you are done.
23951 * Returns: (transfer full): a new #GMenuAttributeIter
23957 * g_menu_model_iterate_item_links:
23958 * @model: a #GMenuModel
23959 * @item_index: the index of the item
23961 * Creates a #GMenuLinkIter to iterate over the links of the item at
23962 * position @item_index in @model.
23964 * You must free the iterator with g_object_unref() when you are done.
23966 * Returns: (transfer full): a new #GMenuLinkIter
23974 * Creates a new #GMenu.
23976 * The new menu has no items.
23978 * Returns: a new #GMenu
23986 * @label: (allow-none): the section label, or %NULL
23987 * @detailed_action: (allow-none): the detailed action string, or %NULL
23989 * Convenience function for prepending a normal menu item to the start
23990 * of @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
23991 * flexible alternative.
23998 * g_menu_prepend_item:
24000 * @item: a #GMenuItem to prepend
24002 * Prepends @item to the start of @menu.
24004 * See g_menu_insert_item() for more information.
24011 * g_menu_prepend_section:
24013 * @label: (allow-none): the section label, or %NULL
24014 * @section: a #GMenuModel with the items of the section
24016 * Convenience function for prepending a section menu item to the start
24017 * of @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for
24018 * a more flexible alternative.
24025 * g_menu_prepend_submenu:
24027 * @label: (allow-none): the section label, or %NULL
24028 * @submenu: a #GMenuModel with the items of the submenu
24030 * Convenience function for prepending a submenu menu item to the start
24031 * of @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for
24032 * a more flexible alternative.
24041 * @position: the position of the item to remove
24043 * Removes an item from the menu.
24045 * @position gives the index of the item to remove.
24047 * It is an error if position is not in range the range from 0 to one
24048 * less than the number of items in the menu.
24050 * It is not possible to remove items by identity since items are added
24051 * to the menu simply by copying their links and attributes (ie:
24052 * identity of the item itself is not preserved).
24059 * g_mount_can_eject:
24060 * @mount: a #GMount.
24062 * Checks if @mount can be eject.
24064 * Returns: %TRUE if the @mount can be ejected.
24069 * g_mount_can_unmount:
24070 * @mount: a #GMount.
24072 * Checks if @mount can be mounted.
24074 * Returns: %TRUE if the @mount can be unmounted.
24080 * @mount: a #GMount.
24081 * @flags: flags affecting the unmount if required for eject
24082 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24083 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24084 * @user_data: user data passed to @callback.
24086 * Ejects a mount. This is an asynchronous operation, and is
24087 * finished by calling g_mount_eject_finish() with the @mount
24088 * and #GAsyncResult data returned in the @callback.
24090 * Deprecated: 2.22: Use g_mount_eject_with_operation() instead.
24095 * g_mount_eject_finish:
24096 * @mount: a #GMount.
24097 * @result: a #GAsyncResult.
24098 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24100 * Finishes ejecting a mount. If any errors occurred during the operation,
24101 * @error will be set to contain the errors and %FALSE will be returned.
24103 * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
24104 * Deprecated: 2.22: Use g_mount_eject_with_operation_finish() instead.
24109 * g_mount_eject_with_operation:
24110 * @mount: a #GMount.
24111 * @flags: flags affecting the unmount if required for eject
24112 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
24113 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24114 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24115 * @user_data: user data passed to @callback.
24117 * Ejects a mount. This is an asynchronous operation, and is
24118 * finished by calling g_mount_eject_with_operation_finish() with the @mount
24119 * and #GAsyncResult data returned in the @callback.
24126 * g_mount_eject_with_operation_finish:
24127 * @mount: a #GMount.
24128 * @result: a #GAsyncResult.
24129 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24131 * Finishes ejecting a mount. If any errors occurred during the operation,
24132 * @error will be set to contain the errors and %FALSE will be returned.
24134 * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
24140 * g_mount_get_default_location:
24141 * @mount: a #GMount.
24143 * Gets the default location of @mount. The default location of the given
24144 * @mount is a path that reflects the main entry point for the user (e.g.
24145 * the home directory, or the root of the volume).
24147 * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
24152 * g_mount_get_drive:
24153 * @mount: a #GMount.
24155 * Gets the drive for the @mount.
24157 * This is a convenience method for getting the #GVolume and then
24158 * using that object to get the #GDrive.
24160 * 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.
24165 * g_mount_get_icon:
24166 * @mount: a #GMount.
24168 * Gets the icon for @mount.
24170 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
24175 * g_mount_get_name:
24176 * @mount: a #GMount.
24178 * Gets the name of @mount.
24180 * Returns: the name for the given @mount. The returned string should be freed with g_free() when no longer needed.
24185 * g_mount_get_root:
24186 * @mount: a #GMount.
24188 * Gets the root directory on @mount.
24190 * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
24195 * g_mount_get_sort_key:
24196 * @mount: A #GMount.
24198 * Gets the sort key for @mount, if any.
24200 * Returns: Sorting key for @mount or %NULL if no such key is available.
24206 * g_mount_get_symbolic_icon:
24207 * @mount: a #GMount.
24209 * Gets the symbolic icon for @mount.
24211 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
24217 * g_mount_get_uuid:
24218 * @mount: a #GMount.
24220 * Gets the UUID for the @mount. The reference is typically based on
24221 * the file system UUID for the mount in question and should be
24222 * considered an opaque string. Returns %NULL if there is no UUID
24225 * 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.
24230 * g_mount_get_volume:
24231 * @mount: a #GMount.
24233 * Gets the volume for the @mount.
24235 * 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.
24240 * g_mount_guess_content_type:
24241 * @mount: a #GMount
24242 * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
24243 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
24244 * @callback: a #GAsyncReadyCallback
24245 * @user_data: user data passed to @callback
24247 * Tries to guess the type of content stored on @mount. Returns one or
24248 * more textual identifiers of well-known content types (typically
24249 * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
24250 * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
24251 * specification for more on x-content types.
24253 * This is an asynchronous operation (see
24254 * g_mount_guess_content_type_sync() for the synchronous version), and
24255 * is finished by calling g_mount_guess_content_type_finish() with the
24256 * @mount and #GAsyncResult data returned in the @callback.
24263 * g_mount_guess_content_type_finish:
24264 * @mount: a #GMount
24265 * @result: a #GAsyncResult
24266 * @error: a #GError location to store the error occurring, or %NULL to ignore
24268 * Finishes guessing content types of @mount. If any errors occurred
24269 * during the operation, @error will be set to contain the errors and
24270 * %FALSE will be returned. In particular, you may get an
24271 * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
24274 * 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.
24280 * g_mount_guess_content_type_sync:
24281 * @mount: a #GMount
24282 * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
24283 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
24284 * @error: a #GError location to store the error occurring, or %NULL to ignore
24286 * Tries to guess the type of content stored on @mount. Returns one or
24287 * more textual identifiers of well-known content types (typically
24288 * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
24289 * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
24290 * specification for more on x-content types.
24292 * This is an synchronous operation and as such may block doing IO;
24293 * see g_mount_guess_content_type() for the asynchronous version.
24295 * 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.
24301 * g_mount_is_shadowed:
24302 * @mount: A #GMount.
24304 * Determines if @mount is shadowed. Applications or libraries should
24305 * avoid displaying @mount in the user interface if it is shadowed.
24307 * A mount is said to be shadowed if there exists one or more user
24308 * visible objects (currently #GMount objects) with a root that is
24309 * inside the root of @mount.
24311 * One application of shadow mounts is when exposing a single file
24312 * system that is used to address several logical volumes. In this
24313 * situation, a #GVolumeMonitor implementation would create two
24314 * #GVolume objects (for example, one for the camera functionality of
24315 * the device and one for a SD card reader on the device) with
24316 * activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
24317 * and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
24318 * underlying mount (with root
24319 * <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
24320 * #GVolumeMonitor implementation would create two #GMount objects
24321 * (each with their root matching the corresponding volume activation
24322 * root) that would shadow the original mount.
24324 * The proxy monitor in GVfs 2.26 and later, automatically creates and
24325 * manage shadow mounts (and shadows the underlying mount) if the
24326 * activation root on a #GVolume is set.
24328 * Returns: %TRUE if @mount is shadowed.
24334 * g_mount_operation_get_anonymous:
24335 * @op: a #GMountOperation.
24337 * Check to see whether the mount operation is being used
24338 * for an anonymous user.
24340 * Returns: %TRUE if mount operation is anonymous.
24345 * g_mount_operation_get_choice:
24346 * @op: a #GMountOperation.
24348 * Gets a choice from the mount operation.
24350 * Returns: an integer containing an index of the user's choice from the choice's list, or %0.
24355 * g_mount_operation_get_domain:
24356 * @op: a #GMountOperation.
24358 * Gets the domain of the mount operation.
24360 * Returns: a string set to the domain.
24365 * g_mount_operation_get_password:
24366 * @op: a #GMountOperation.
24368 * Gets a password from the mount operation.
24370 * Returns: a string containing the password within @op.
24375 * g_mount_operation_get_password_save:
24376 * @op: a #GMountOperation.
24378 * Gets the state of saving passwords for the mount operation.
24380 * Returns: a #GPasswordSave flag.
24385 * g_mount_operation_get_username:
24386 * @op: a #GMountOperation.
24388 * Get the user name from the mount operation.
24390 * Returns: a string containing the user name.
24395 * g_mount_operation_new:
24397 * Creates a new mount operation.
24399 * Returns: a #GMountOperation.
24404 * g_mount_operation_reply:
24405 * @op: a #GMountOperation
24406 * @result: a #GMountOperationResult
24408 * Emits the #GMountOperation::reply signal.
24413 * g_mount_operation_set_anonymous:
24414 * @op: a #GMountOperation.
24415 * @anonymous: boolean value.
24417 * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
24422 * g_mount_operation_set_choice:
24423 * @op: a #GMountOperation.
24424 * @choice: an integer.
24426 * Sets a default choice for the mount operation.
24431 * g_mount_operation_set_domain:
24432 * @op: a #GMountOperation.
24433 * @domain: the domain to set.
24435 * Sets the mount operation's domain.
24440 * g_mount_operation_set_password:
24441 * @op: a #GMountOperation.
24442 * @password: password to set.
24444 * Sets the mount operation's password to @password.
24449 * g_mount_operation_set_password_save:
24450 * @op: a #GMountOperation.
24451 * @save: a set of #GPasswordSave flags.
24453 * Sets the state of saving passwords for the mount operation.
24458 * g_mount_operation_set_username:
24459 * @op: a #GMountOperation.
24460 * @username: input username.
24462 * Sets the user name within @op to @username.
24468 * @mount: a #GMount.
24469 * @flags: flags affecting the operation
24470 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
24471 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24472 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24473 * @user_data: user data passed to @callback.
24475 * Remounts a mount. This is an asynchronous operation, and is
24476 * finished by calling g_mount_remount_finish() with the @mount
24477 * and #GAsyncResults data returned in the @callback.
24479 * Remounting is useful when some setting affecting the operation
24480 * of the volume has been changed, as these may need a remount to
24481 * take affect. While this is semantically equivalent with unmounting
24482 * and then remounting not all backends might need to actually be
24488 * g_mount_remount_finish:
24489 * @mount: a #GMount.
24490 * @result: a #GAsyncResult.
24491 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24493 * Finishes remounting a mount. If any errors occurred during the operation,
24494 * @error will be set to contain the errors and %FALSE will be returned.
24496 * Returns: %TRUE if the mount was successfully remounted. %FALSE otherwise.
24502 * @mount: A #GMount.
24504 * Increments the shadow count on @mount. Usually used by
24505 * #GVolumeMonitor implementations when creating a shadow mount for
24506 * @mount, see g_mount_is_shadowed() for more information. The caller
24507 * will need to emit the #GMount::changed signal on @mount manually.
24515 * @mount: a #GMount.
24516 * @flags: flags affecting the operation
24517 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24518 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24519 * @user_data: user data passed to @callback.
24521 * Unmounts a mount. This is an asynchronous operation, and is
24522 * finished by calling g_mount_unmount_finish() with the @mount
24523 * and #GAsyncResult data returned in the @callback.
24525 * Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
24530 * g_mount_unmount_finish:
24531 * @mount: a #GMount.
24532 * @result: a #GAsyncResult.
24533 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24535 * Finishes unmounting a mount. If any errors occurred during the operation,
24536 * @error will be set to contain the errors and %FALSE will be returned.
24538 * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
24539 * Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
24544 * g_mount_unmount_with_operation:
24545 * @mount: a #GMount.
24546 * @flags: flags affecting the operation
24547 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
24548 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24549 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24550 * @user_data: user data passed to @callback.
24552 * Unmounts a mount. This is an asynchronous operation, and is
24553 * finished by calling g_mount_unmount_with_operation_finish() with the @mount
24554 * and #GAsyncResult data returned in the @callback.
24561 * g_mount_unmount_with_operation_finish:
24562 * @mount: a #GMount.
24563 * @result: a #GAsyncResult.
24564 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24566 * Finishes unmounting a mount. If any errors occurred during the operation,
24567 * @error will be set to contain the errors and %FALSE will be returned.
24569 * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
24575 * g_mount_unshadow:
24576 * @mount: A #GMount.
24578 * Decrements the shadow count on @mount. Usually used by
24579 * #GVolumeMonitor implementations when destroying a shadow mount for
24580 * @mount, see g_mount_is_shadowed() for more information. The caller
24581 * will need to emit the #GMount::changed signal on @mount manually.
24588 * g_network_address_get_hostname:
24589 * @addr: a #GNetworkAddress
24591 * Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
24592 * depending on what @addr was created with.
24594 * Returns: @addr's hostname
24600 * g_network_address_get_port:
24601 * @addr: a #GNetworkAddress
24603 * Gets @addr's port number
24605 * Returns: @addr's port (which may be 0)
24611 * g_network_address_get_scheme:
24612 * @addr: a #GNetworkAddress
24614 * Gets @addr's scheme
24616 * Returns: @addr's scheme (%NULL if not built from URI)
24622 * g_network_address_new:
24623 * @hostname: the hostname
24626 * Creates a new #GSocketConnectable for connecting to the given
24627 * @hostname and @port.
24629 * Returns: (transfer full) (type GNetworkAddress): the new #GNetworkAddress
24635 * g_network_address_parse:
24636 * @host_and_port: the hostname and optionally a port
24637 * @default_port: the default port if not in @host_and_port
24638 * @error: a pointer to a #GError, or %NULL
24640 * Creates a new #GSocketConnectable for connecting to the given
24641 * @hostname and @port. May fail and return %NULL in case
24642 * parsing @host_and_port fails.
24644 * @host_and_port may be in any of a number of recognised formats; an IPv6
24645 * address, an IPv4 address, or a domain name (in which case a DNS
24646 * lookup is performed). Quoting with [] is supported for all address
24647 * types. A port override may be specified in the usual way with a
24650 * If no port is specified in @host_and_port then @default_port will be
24651 * used as the port number to connect to.
24653 * In general, @host_and_port is expected to be provided by the user
24654 * (allowing them to give the hostname, and a port overide if necessary)
24655 * and @default_port is expected to be provided by the application.
24657 * (The port component of @host_and_port can also be specified as a
24658 * service name rather than as a numeric port, but this functionality
24659 * is deprecated, because it depends on the contents of /etc/services,
24660 * which is generally quite sparse on platforms other than Linux.)
24662 * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24668 * g_network_address_parse_uri:
24669 * @uri: the hostname and optionally a port
24670 * @default_port: The default port if none is found in the URI
24671 * @error: a pointer to a #GError, or %NULL
24673 * Creates a new #GSocketConnectable for connecting to the given
24674 * @uri. May fail and return %NULL in case parsing @uri fails.
24676 * Using this rather than g_network_address_new() or
24677 * g_network_address_parse() allows #GSocketClient to determine
24678 * when to use application-specific proxy protocols.
24680 * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24686 * g_network_monitor_base_add_network:
24687 * @monitor: the #GNetworkMonitorBase
24688 * @network: a #GInetAddressMask
24690 * Adds @network to @monitor's list of available networks.
24697 * g_network_monitor_base_remove_network:
24698 * @monitor: the #GNetworkMonitorBase
24699 * @network: a #GInetAddressMask
24701 * Removes @network from @monitor's list of available networks.
24708 * g_network_monitor_base_set_networks:
24709 * @monitor: the #GNetworkMonitorBase
24710 * @networks: (array length=length): an array of #GInetAddressMask
24711 * @length: length of @networks
24713 * Drops @monitor's current list of available networks and replaces
24714 * it with @networks.
24719 * g_network_monitor_can_reach:
24720 * @monitor: a #GNetworkMonitor
24721 * @connectable: a #GSocketConnectable
24722 * @cancellable: (allow-none): a #GCancellable, or %NULL
24723 * @error: return location for a #GError, or %NULL
24725 * Attempts to determine whether or not the host pointed to by
24726 * @connectable can be reached, without actually trying to connect to
24729 * This may return %TRUE even when #GNetworkMonitor:network-available
24730 * is %FALSE, if, for example, @monitor can determine that
24731 * @connectable refers to a host on a local network.
24733 * If @monitor believes that an attempt to connect to @connectable
24734 * will succeed, it will return %TRUE. Otherwise, it will return
24735 * %FALSE and set @error to an appropriate error (such as
24736 * %G_IO_ERROR_HOST_UNREACHABLE).
24738 * Note that although this does not attempt to connect to
24739 * @connectable, it may still block for a brief period of time (eg,
24740 * trying to do multicast DNS on the local network), so if you do not
24741 * want to block, you should use g_network_monitor_can_reach_async().
24743 * Returns: %TRUE if @connectable is reachable, %FALSE if not.
24749 * g_network_monitor_can_reach_async:
24750 * @monitor: a #GNetworkMonitor
24751 * @connectable: a #GSocketConnectable
24752 * @cancellable: (allow-none): a #GCancellable, or %NULL
24753 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24754 * @user_data: (closure): the data to pass to callback function
24756 * Asynchronously attempts to determine whether or not the host
24757 * pointed to by @connectable can be reached, without actually
24758 * trying to connect to it.
24760 * For more details, see g_network_monitor_can_reach().
24762 * When the operation is finished, @callback will be called.
24763 * You can then call g_network_monitor_can_reach_finish()
24764 * to get the result of the operation.
24769 * g_network_monitor_can_reach_finish:
24770 * @monitor: a #GNetworkMonitor
24771 * @result: a #GAsyncResult
24772 * @error: return location for errors, or %NULL
24774 * Finishes an async network connectivity test.
24775 * See g_network_monitor_can_reach_async().
24777 * Returns: %TRUE if network is reachable, %FALSE if not.
24782 * g_network_monitor_get_default:
24784 * Gets the default #GNetworkMonitor for the system.
24786 * Returns: (transfer none): a #GNetworkMonitor
24792 * g_network_monitor_get_network_available:
24793 * @monitor: the #GNetworkMonitor
24795 * Checks if the network is available. "Available" here means that the
24796 * system has a default route available for at least one of IPv4 or
24797 * IPv6. It does not necessarily imply that the public Internet is
24798 * reachable. See #GNetworkMonitor:network-available for more details.
24800 * Returns: whether the network is available
24806 * g_network_service_get_domain:
24807 * @srv: a #GNetworkService
24809 * Gets the domain that @srv serves. This might be either UTF-8 or
24810 * ASCII-encoded, depending on what @srv was created with.
24812 * Returns: @srv's domain name
24818 * g_network_service_get_protocol:
24819 * @srv: a #GNetworkService
24821 * Gets @srv's protocol name (eg, "tcp").
24823 * Returns: @srv's protocol name
24829 * g_network_service_get_scheme:
24830 * @srv: a #GNetworkService
24832 * Get's the URI scheme used to resolve proxies. By default, the service name
24833 * is used as scheme.
24835 * Returns: @srv's scheme name
24841 * g_network_service_get_service:
24842 * @srv: a #GNetworkService
24844 * Gets @srv's service name (eg, "ldap").
24846 * Returns: @srv's service name
24852 * g_network_service_new:
24853 * @service: the service type to look up (eg, "ldap")
24854 * @protocol: the networking protocol to use for @service (eg, "tcp")
24855 * @domain: the DNS domain to look up the service in
24857 * Creates a new #GNetworkService representing the given @service,
24858 * @protocol, and @domain. This will initially be unresolved; use the
24859 * #GSocketConnectable interface to resolve it.
24861 * Returns: (transfer full) (type GNetworkService): a new #GNetworkService
24867 * g_network_service_set_scheme:
24868 * @srv: a #GNetworkService
24869 * @scheme: a URI scheme
24871 * Set's the URI scheme used to resolve proxies. By default, the service name
24872 * is used as scheme.
24879 * g_null_settings_backend_new:
24881 * Creates a readonly #GSettingsBackend.
24883 * This backend does not allow changes to settings, so all settings
24884 * will always have their default values.
24886 * Returns: (transfer full): a newly created #GSettingsBackend
24892 * g_output_stream_clear_pending:
24893 * @stream: output stream
24895 * Clears the pending flag on @stream.
24900 * g_output_stream_close:
24901 * @stream: A #GOutputStream.
24902 * @cancellable: (allow-none): optional cancellable object
24903 * @error: location to store the error occurring, or %NULL to ignore
24905 * Closes the stream, releasing resources related to it.
24907 * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
24908 * Closing a stream multiple times will not return an error.
24910 * Closing a stream will automatically flush any outstanding buffers in the
24913 * Streams will be automatically closed when the last reference
24914 * is dropped, but you might want to call this function to make sure
24915 * resources are released as early as possible.
24917 * Some streams might keep the backing store of the stream (e.g. a file descriptor)
24918 * open after the stream is closed. See the documentation for the individual
24919 * stream for details.
24921 * On failure the first error that happened will be reported, but the close
24922 * operation will finish as much as possible. A stream that failed to
24923 * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
24924 * is important to check and report the error to the user, otherwise
24925 * there might be a loss of data as all data might not be written.
24927 * If @cancellable is not %NULL, then the operation can be cancelled by
24928 * triggering the cancellable object from another thread. If the operation
24929 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24930 * Cancelling a close will still leave the stream closed, but there some streams
24931 * can use a faster close that doesn't block to e.g. check errors. On
24932 * cancellation (as with any error) there is no guarantee that all written
24933 * data will reach the target.
24935 * Returns: %TRUE on success, %FALSE on failure
24940 * g_output_stream_close_async:
24941 * @stream: A #GOutputStream.
24942 * @io_priority: the io priority of the request.
24943 * @cancellable: (allow-none): optional cancellable object
24944 * @callback: (scope async): callback to call when the request is satisfied
24945 * @user_data: (closure): the data to pass to callback function
24947 * Requests an asynchronous close of the stream, releasing resources
24948 * related to it. When the operation is finished @callback will be
24949 * called. You can then call g_output_stream_close_finish() to get
24950 * the result of the operation.
24952 * For behaviour details see g_output_stream_close().
24954 * The asyncronous methods have a default fallback that uses threads
24955 * to implement asynchronicity, so they are optional for inheriting
24956 * classes. However, if you override one you must override all.
24961 * g_output_stream_close_finish:
24962 * @stream: a #GOutputStream.
24963 * @result: a #GAsyncResult.
24964 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24966 * Closes an output stream.
24968 * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
24973 * g_output_stream_flush:
24974 * @stream: a #GOutputStream.
24975 * @cancellable: (allow-none): optional cancellable object
24976 * @error: location to store the error occurring, or %NULL to ignore
24978 * Forces a write of all user-space buffered data for the given
24979 * @stream. Will block during the operation. Closing the stream will
24980 * implicitly cause a flush.
24982 * This function is optional for inherited classes.
24984 * If @cancellable is not %NULL, then the operation can be cancelled by
24985 * triggering the cancellable object from another thread. If the operation
24986 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24988 * Returns: %TRUE on success, %FALSE on error
24993 * g_output_stream_flush_async:
24994 * @stream: a #GOutputStream.
24995 * @io_priority: the io priority of the request.
24996 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24997 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24998 * @user_data: (closure): the data to pass to callback function
25000 * Forces an asynchronous write of all user-space buffered data for
25001 * the given @stream.
25002 * For behaviour details see g_output_stream_flush().
25004 * When the operation is finished @callback will be
25005 * called. You can then call g_output_stream_flush_finish() to get the
25006 * result of the operation.
25011 * g_output_stream_flush_finish:
25012 * @stream: a #GOutputStream.
25013 * @result: a GAsyncResult.
25014 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25016 * Finishes flushing an output stream.
25018 * Returns: %TRUE if flush operation succeeded, %FALSE otherwise.
25023 * g_output_stream_has_pending:
25024 * @stream: a #GOutputStream.
25026 * Checks if an ouput stream has pending actions.
25028 * Returns: %TRUE if @stream has pending actions.
25033 * g_output_stream_is_closed:
25034 * @stream: a #GOutputStream.
25036 * Checks if an output stream has already been closed.
25038 * Returns: %TRUE if @stream is closed. %FALSE otherwise.
25043 * g_output_stream_is_closing:
25044 * @stream: a #GOutputStream.
25046 * Checks if an output stream is being closed. This can be
25047 * used inside e.g. a flush implementation to see if the
25048 * flush (or other i/o operation) is called from within
25049 * the closing operation.
25051 * Returns: %TRUE if @stream is being closed. %FALSE otherwise.
25057 * g_output_stream_set_pending:
25058 * @stream: a #GOutputStream.
25059 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25061 * Sets @stream to have actions pending. If the pending flag is
25062 * already set or @stream is closed, it will return %FALSE and set
25065 * Returns: %TRUE if pending was previously unset and is now set.
25070 * g_output_stream_splice:
25071 * @stream: a #GOutputStream.
25072 * @source: a #GInputStream.
25073 * @flags: a set of #GOutputStreamSpliceFlags.
25074 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25075 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25077 * Splices an input stream into an output stream.
25079 * 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.
25084 * g_output_stream_splice_async:
25085 * @stream: a #GOutputStream.
25086 * @source: a #GInputStream.
25087 * @flags: a set of #GOutputStreamSpliceFlags.
25088 * @io_priority: the io priority of the request.
25089 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25090 * @callback: (scope async): a #GAsyncReadyCallback.
25091 * @user_data: (closure): user data passed to @callback.
25093 * Splices a stream asynchronously.
25094 * When the operation is finished @callback will be called.
25095 * You can then call g_output_stream_splice_finish() to get the
25096 * result of the operation.
25098 * For the synchronous, blocking version of this function, see
25099 * g_output_stream_splice().
25104 * g_output_stream_splice_finish:
25105 * @stream: a #GOutputStream.
25106 * @result: a #GAsyncResult.
25107 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25109 * Finishes an asynchronous stream splice operation.
25111 * 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.
25116 * g_output_stream_write:
25117 * @stream: a #GOutputStream.
25118 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25119 * @count: the number of bytes to write
25120 * @cancellable: (allow-none): optional cancellable object
25121 * @error: location to store the error occurring, or %NULL to ignore
25123 * Tries to write @count bytes from @buffer into the stream. Will block
25124 * during the operation.
25126 * If count is 0, returns 0 and does nothing. A value of @count
25127 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
25129 * On success, the number of bytes written to the stream is returned.
25130 * It is not an error if this is not the same as the requested size, as it
25131 * can happen e.g. on a partial I/O error, or if there is not enough
25132 * storage in the stream. All writes block until at least one byte
25133 * is written or an error occurs; 0 is never returned (unless
25136 * If @cancellable is not %NULL, then the operation can be cancelled by
25137 * triggering the cancellable object from another thread. If the operation
25138 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
25139 * operation was partially finished when the operation was cancelled the
25140 * partial result will be returned, without an error.
25142 * On error -1 is returned and @error is set accordingly.
25144 * Virtual: write_fn
25145 * Returns: Number of bytes written, or -1 on error
25150 * g_output_stream_write_all:
25151 * @stream: a #GOutputStream.
25152 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25153 * @count: the number of bytes to write
25154 * @bytes_written: (out): location to store the number of bytes that was written to the stream
25155 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25156 * @error: location to store the error occurring, or %NULL to ignore
25158 * Tries to write @count bytes from @buffer into the stream. Will block
25159 * during the operation.
25161 * This function is similar to g_output_stream_write(), except it tries to
25162 * write as many bytes as requested, only stopping on an error.
25164 * On a successful write of @count bytes, %TRUE is returned, and @bytes_written
25165 * is set to @count.
25167 * If there is an error during the operation %FALSE is returned and @error
25168 * is set to indicate the error status, @bytes_written is updated to contain
25169 * the number of bytes written into the stream before the error occurred.
25171 * Returns: %TRUE on success, %FALSE if there was an error
25176 * g_output_stream_write_async:
25177 * @stream: A #GOutputStream.
25178 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25179 * @count: the number of bytes to write
25180 * @io_priority: the io priority of the request.
25181 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25182 * @callback: (scope async): callback to call when the request is satisfied
25183 * @user_data: (closure): the data to pass to callback function
25185 * Request an asynchronous write of @count bytes from @buffer into
25186 * the stream. When the operation is finished @callback will be called.
25187 * You can then call g_output_stream_write_finish() to get the result of the
25190 * During an async request no other sync and async calls are allowed,
25191 * and will result in %G_IO_ERROR_PENDING errors.
25193 * A value of @count larger than %G_MAXSSIZE will cause a
25194 * %G_IO_ERROR_INVALID_ARGUMENT error.
25196 * On success, the number of bytes written will be passed to the
25197 * @callback. It is not an error if this is not the same as the
25198 * requested size, as it can happen e.g. on a partial I/O error,
25199 * but generally we try to write as many bytes as requested.
25201 * You are guaranteed that this method will never fail with
25202 * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
25203 * method will just wait until this changes.
25205 * Any outstanding I/O request with higher priority (lower numerical
25206 * value) will be executed before an outstanding request with lower
25207 * priority. Default priority is %G_PRIORITY_DEFAULT.
25209 * The asyncronous methods have a default fallback that uses threads
25210 * to implement asynchronicity, so they are optional for inheriting
25211 * classes. However, if you override one you must override all.
25213 * For the synchronous, blocking version of this function, see
25214 * g_output_stream_write().
25219 * g_output_stream_write_bytes:
25220 * @stream: a #GOutputStream.
25221 * @bytes: the #GBytes to write
25222 * @cancellable: (allow-none): optional cancellable object
25223 * @error: location to store the error occurring, or %NULL to ignore
25225 * Tries to write the data from @bytes into the stream. Will block
25226 * during the operation.
25228 * If @bytes is 0-length, returns 0 and does nothing. A #GBytes larger
25229 * than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
25231 * On success, the number of bytes written to the stream is returned.
25232 * It is not an error if this is not the same as the requested size, as it
25233 * can happen e.g. on a partial I/O error, or if there is not enough
25234 * storage in the stream. All writes block until at least one byte
25235 * is written or an error occurs; 0 is never returned (unless
25236 * the size of @bytes is 0).
25238 * If @cancellable is not %NULL, then the operation can be cancelled by
25239 * triggering the cancellable object from another thread. If the operation
25240 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
25241 * operation was partially finished when the operation was cancelled the
25242 * partial result will be returned, without an error.
25244 * On error -1 is returned and @error is set accordingly.
25246 * Returns: Number of bytes written, or -1 on error
25251 * g_output_stream_write_bytes_async:
25252 * @stream: A #GOutputStream.
25253 * @bytes: The bytes to write
25254 * @io_priority: the io priority of the request.
25255 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25256 * @callback: (scope async): callback to call when the request is satisfied
25257 * @user_data: (closure): the data to pass to callback function
25259 * Request an asynchronous write of the data in @bytes to the stream.
25260 * When the operation is finished @callback will be called. You can
25261 * then call g_output_stream_write_bytes_finish() to get the result of
25264 * During an async request no other sync and async calls are allowed,
25265 * and will result in %G_IO_ERROR_PENDING errors.
25267 * A #GBytes larger than %G_MAXSSIZE will cause a
25268 * %G_IO_ERROR_INVALID_ARGUMENT error.
25270 * On success, the number of bytes written will be passed to the
25271 * @callback. It is not an error if this is not the same as the
25272 * requested size, as it can happen e.g. on a partial I/O error,
25273 * but generally we try to write as many bytes as requested.
25275 * You are guaranteed that this method will never fail with
25276 * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
25277 * method will just wait until this changes.
25279 * Any outstanding I/O request with higher priority (lower numerical
25280 * value) will be executed before an outstanding request with lower
25281 * priority. Default priority is %G_PRIORITY_DEFAULT.
25283 * For the synchronous, blocking version of this function, see
25284 * g_output_stream_write_bytes().
25289 * g_output_stream_write_bytes_finish:
25290 * @stream: a #GOutputStream.
25291 * @result: a #GAsyncResult.
25292 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25294 * Finishes a stream write-from-#GBytes operation.
25296 * Returns: a #gssize containing the number of bytes written to the stream.
25301 * g_output_stream_write_finish:
25302 * @stream: a #GOutputStream.
25303 * @result: a #GAsyncResult.
25304 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25306 * Finishes a stream write operation.
25308 * Returns: a #gssize containing the number of bytes written to the stream.
25313 * g_permission_acquire:
25314 * @permission: a #GPermission instance
25315 * @cancellable: (allow-none): a #GCancellable, or %NULL
25316 * @error: a pointer to a %NULL #GError, or %NULL
25318 * Attempts to acquire the permission represented by @permission.
25320 * The precise method by which this happens depends on the permission
25321 * and the underlying authentication mechanism. A simple example is
25322 * that a dialog may appear asking the user to enter their password.
25324 * You should check with g_permission_get_can_acquire() before calling
25327 * If the permission is acquired then %TRUE is returned. Otherwise,
25328 * %FALSE is returned and @error is set appropriately.
25330 * This call is blocking, likely for a very long time (in the case that
25331 * user interaction is required). See g_permission_acquire_async() for
25332 * the non-blocking version.
25334 * Returns: %TRUE if the permission was successfully acquired
25340 * g_permission_acquire_async:
25341 * @permission: a #GPermission instance
25342 * @cancellable: (allow-none): a #GCancellable, or %NULL
25343 * @callback: the #GAsyncReadyCallback to call when done
25344 * @user_data: the user data to pass to @callback
25346 * Attempts to acquire the permission represented by @permission.
25348 * This is the first half of the asynchronous version of
25349 * g_permission_acquire().
25356 * g_permission_acquire_finish:
25357 * @permission: a #GPermission instance
25358 * @result: the #GAsyncResult given to the #GAsyncReadyCallback
25359 * @error: a pointer to a %NULL #GError, or %NULL
25361 * Collects the result of attempting to acquire the permission
25362 * represented by @permission.
25364 * This is the second half of the asynchronous version of
25365 * g_permission_acquire().
25367 * Returns: %TRUE if the permission was successfully acquired
25373 * g_permission_get_allowed:
25374 * @permission: a #GPermission instance
25376 * Gets the value of the 'allowed' property. This property is %TRUE if
25377 * the caller currently has permission to perform the action that
25378 * @permission represents the permission to perform.
25380 * Returns: the value of the 'allowed' property
25386 * g_permission_get_can_acquire:
25387 * @permission: a #GPermission instance
25389 * Gets the value of the 'can-acquire' property. This property is %TRUE
25390 * if it is generally possible to acquire the permission by calling
25391 * g_permission_acquire().
25393 * Returns: the value of the 'can-acquire' property
25399 * g_permission_get_can_release:
25400 * @permission: a #GPermission instance
25402 * Gets the value of the 'can-release' property. This property is %TRUE
25403 * if it is generally possible to release the permission by calling
25404 * g_permission_release().
25406 * Returns: the value of the 'can-release' property
25412 * g_permission_impl_update:
25413 * @permission: a #GPermission instance
25414 * @allowed: the new value for the 'allowed' property
25415 * @can_acquire: the new value for the 'can-acquire' property
25416 * @can_release: the new value for the 'can-release' property
25418 * This function is called by the #GPermission implementation to update
25419 * the properties of the permission. You should never call this
25420 * function except from a #GPermission implementation.
25422 * GObject notify signals are generated, as appropriate.
25429 * g_permission_release:
25430 * @permission: a #GPermission instance
25431 * @cancellable: (allow-none): a #GCancellable, or %NULL
25432 * @error: a pointer to a %NULL #GError, or %NULL
25434 * Attempts to release the permission represented by @permission.
25436 * The precise method by which this happens depends on the permission
25437 * and the underlying authentication mechanism. In most cases the
25438 * permission will be dropped immediately without further action.
25440 * You should check with g_permission_get_can_release() before calling
25443 * If the permission is released then %TRUE is returned. Otherwise,
25444 * %FALSE is returned and @error is set appropriately.
25446 * This call is blocking, likely for a very long time (in the case that
25447 * user interaction is required). See g_permission_release_async() for
25448 * the non-blocking version.
25450 * Returns: %TRUE if the permission was successfully released
25456 * g_permission_release_async:
25457 * @permission: a #GPermission instance
25458 * @cancellable: (allow-none): a #GCancellable, or %NULL
25459 * @callback: the #GAsyncReadyCallback to call when done
25460 * @user_data: the user data to pass to @callback
25462 * Attempts to release the permission represented by @permission.
25464 * This is the first half of the asynchronous version of
25465 * g_permission_release().
25472 * g_permission_release_finish:
25473 * @permission: a #GPermission instance
25474 * @result: the #GAsyncResult given to the #GAsyncReadyCallback
25475 * @error: a pointer to a %NULL #GError, or %NULL
25477 * Collects the result of attempting to release the permission
25478 * represented by @permission.
25480 * This is the second half of the asynchronous version of
25481 * g_permission_release().
25483 * Returns: %TRUE if the permission was successfully released
25489 * g_poll_file_monitor_new:
25492 * Polls @file for changes.
25494 * Returns: a new #GFileMonitor for the given #GFile.
25499 * g_pollable_input_stream_can_poll:
25500 * @stream: a #GPollableInputStream.
25502 * Checks if @stream is actually pollable. Some classes may implement
25503 * #GPollableInputStream but have only certain instances of that class
25504 * be pollable. If this method returns %FALSE, then the behavior of
25505 * other #GPollableInputStream methods is undefined.
25507 * For any given stream, the value returned by this method is constant;
25508 * a stream cannot switch from pollable to non-pollable or vice versa.
25510 * Returns: %TRUE if @stream is pollable, %FALSE if not.
25516 * g_pollable_input_stream_create_source:
25517 * @stream: a #GPollableInputStream.
25518 * @cancellable: (allow-none): a #GCancellable, or %NULL
25520 * Creates a #GSource that triggers when @stream can be read, or
25521 * @cancellable is triggered or an error occurs. The callback on the
25522 * source is of the #GPollableSourceFunc type.
25524 * As with g_pollable_input_stream_is_readable(), it is possible that
25525 * the stream may not actually be readable even after the source
25526 * triggers, so you should use g_pollable_input_stream_read_nonblocking()
25527 * rather than g_input_stream_read() from the callback.
25529 * Returns: (transfer full): a new #GSource
25535 * g_pollable_input_stream_is_readable:
25536 * @stream: a #GPollableInputStream.
25538 * Checks if @stream can be read.
25540 * Note that some stream types may not be able to implement this 100%
25541 * reliably, and it is possible that a call to g_input_stream_read()
25542 * after this returns %TRUE would still block. To guarantee
25543 * non-blocking behavior, you should always use
25544 * g_pollable_input_stream_read_nonblocking(), which will return a
25545 * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
25547 * 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.
25553 * g_pollable_input_stream_read_nonblocking:
25554 * @stream: a #GPollableInputStream
25555 * @buffer: a buffer to read data into (which should be at least @count bytes long).
25556 * @count: the number of bytes you want to read
25557 * @cancellable: (allow-none): a #GCancellable, or %NULL
25558 * @error: #GError for error reporting, or %NULL to ignore.
25560 * Attempts to read up to @count bytes from @stream into @buffer, as
25561 * with g_input_stream_read(). If @stream is not currently readable,
25562 * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
25563 * use g_pollable_input_stream_create_source() to create a #GSource
25564 * that will be triggered when @stream is readable.
25566 * Note that since this method never blocks, you cannot actually
25567 * use @cancellable to cancel it. However, it will return an error
25568 * if @cancellable has already been cancelled when you call, which
25569 * may happen if you call this method after a source triggers due
25570 * to having been cancelled.
25572 * Virtual: read_nonblocking
25573 * Returns: the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
25578 * g_pollable_output_stream_can_poll:
25579 * @stream: a #GPollableOutputStream.
25581 * Checks if @stream is actually pollable. Some classes may implement
25582 * #GPollableOutputStream but have only certain instances of that
25583 * class be pollable. If this method returns %FALSE, then the behavior
25584 * of other #GPollableOutputStream methods is undefined.
25586 * For any given stream, the value returned by this method is constant;
25587 * a stream cannot switch from pollable to non-pollable or vice versa.
25589 * Returns: %TRUE if @stream is pollable, %FALSE if not.
25595 * g_pollable_output_stream_create_source:
25596 * @stream: a #GPollableOutputStream.
25597 * @cancellable: (allow-none): a #GCancellable, or %NULL
25599 * Creates a #GSource that triggers when @stream can be written, or
25600 * @cancellable is triggered or an error occurs. The callback on the
25601 * source is of the #GPollableSourceFunc type.
25603 * As with g_pollable_output_stream_is_writable(), it is possible that
25604 * the stream may not actually be writable even after the source
25605 * triggers, so you should use g_pollable_output_stream_write_nonblocking()
25606 * rather than g_output_stream_write() from the callback.
25608 * Returns: (transfer full): a new #GSource
25614 * g_pollable_output_stream_is_writable:
25615 * @stream: a #GPollableOutputStream.
25617 * Checks if @stream can be written.
25619 * Note that some stream types may not be able to implement this 100%
25620 * reliably, and it is possible that a call to g_output_stream_write()
25621 * after this returns %TRUE would still block. To guarantee
25622 * non-blocking behavior, you should always use
25623 * g_pollable_output_stream_write_nonblocking(), which will return a
25624 * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
25626 * 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.
25632 * g_pollable_output_stream_write_nonblocking:
25633 * @stream: a #GPollableOutputStream
25634 * @buffer: (array length=count) (element-type guint8): a buffer to write data from
25635 * @count: the number of bytes you want to write
25636 * @cancellable: (allow-none): a #GCancellable, or %NULL
25637 * @error: #GError for error reporting, or %NULL to ignore.
25639 * Attempts to write up to @count bytes from @buffer to @stream, as
25640 * with g_output_stream_write(). If @stream is not currently writable,
25641 * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
25642 * use g_pollable_output_stream_create_source() to create a #GSource
25643 * that will be triggered when @stream is writable.
25645 * Note that since this method never blocks, you cannot actually
25646 * use @cancellable to cancel it. However, it will return an error
25647 * if @cancellable has already been cancelled when you call, which
25648 * may happen if you call this method after a source triggers due
25649 * to having been cancelled.
25651 * Virtual: write_nonblocking
25652 * Returns: the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
25657 * g_pollable_source_new:
25658 * @pollable_stream: the stream associated with the new source
25660 * Utility method for #GPollableInputStream and #GPollableOutputStream
25661 * implementations. Creates a new #GSource that expects a callback of
25662 * type #GPollableSourceFunc. The new source does not actually do
25663 * anything on its own; use g_source_add_child_source() to add other
25664 * sources to it to cause it to trigger.
25666 * Returns: (transfer full): the new #GSource.
25672 * g_pollable_source_new_full:
25673 * @pollable_stream: (type GObject): the stream associated with the new source
25674 * @child_source: (allow-none): optional child source to attach
25675 * @cancellable: (allow-none): optional #GCancellable to attach
25677 * Utility method for #GPollableInputStream and #GPollableOutputStream
25678 * implementations. Creates a new #GSource, as with
25679 * g_pollable_source_new(), but also attaching @child_source (with a
25680 * dummy callback), and @cancellable, if they are non-%NULL.
25682 * Returns: (transfer full): the new #GSource.
25688 * g_pollable_stream_read:
25689 * @stream: a #GInputStream
25690 * @buffer: a buffer to read data into
25691 * @count: the number of bytes to read
25692 * @blocking: whether to do blocking I/O
25693 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25694 * @error: location to store the error occurring, or %NULL to ignore
25696 * Tries to read from @stream, as with g_input_stream_read() (if
25697 * @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
25698 * (if @blocking is %FALSE). This can be used to more easily share
25699 * code between blocking and non-blocking implementations of a method.
25701 * If @blocking is %FALSE, then @stream must be a
25702 * #GPollableInputStream for which g_pollable_input_stream_can_poll()
25703 * returns %TRUE, or else the behavior is undefined. If @blocking is
25704 * %TRUE, then @stream does not need to be a #GPollableInputStream.
25706 * Returns: the number of bytes read, or -1 on error.
25712 * g_pollable_stream_write:
25713 * @stream: a #GOutputStream.
25714 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25715 * @count: the number of bytes to write
25716 * @blocking: whether to do blocking I/O
25717 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25718 * @error: location to store the error occurring, or %NULL to ignore
25720 * Tries to write to @stream, as with g_output_stream_write() (if
25721 * @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
25722 * (if @blocking is %FALSE). This can be used to more easily share
25723 * code between blocking and non-blocking implementations of a method.
25725 * If @blocking is %FALSE, then @stream must be a
25726 * #GPollableOutputStream for which
25727 * g_pollable_output_stream_can_poll() returns %TRUE or else the
25728 * behavior is undefined. If @blocking is %TRUE, then @stream does not
25729 * need to be a #GPollableOutputStream.
25731 * Returns: the number of bytes written, or -1 on error.
25737 * g_pollable_stream_write_all:
25738 * @stream: a #GOutputStream.
25739 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25740 * @count: the number of bytes to write
25741 * @blocking: whether to do blocking I/O
25742 * @bytes_written: (out): location to store the number of bytes that was written to the stream
25743 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25744 * @error: location to store the error occurring, or %NULL to ignore
25746 * Tries to write @count bytes to @stream, as with
25747 * g_output_stream_write_all(), but using g_pollable_stream_write()
25748 * rather than g_output_stream_write().
25750 * On a successful write of @count bytes, %TRUE is returned, and
25751 * @bytes_written is set to @count.
25753 * If there is an error during the operation (including
25754 * %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is
25755 * returned and @error is set to indicate the error status,
25756 * @bytes_written is updated to contain the number of bytes written
25757 * into the stream before the error occurred.
25759 * As with g_pollable_stream_write(), if @blocking is %FALSE, then
25760 * @stream must be a #GPollableOutputStream for which
25761 * g_pollable_output_stream_can_poll() returns %TRUE or else the
25762 * behavior is undefined. If @blocking is %TRUE, then @stream does not
25763 * need to be a #GPollableOutputStream.
25765 * Returns: %TRUE on success, %FALSE if there was an error
25771 * g_proxy_address_get_destination_hostname:
25772 * @proxy: a #GProxyAddress
25774 * Gets @proxy's destination hostname; that is, the name of the host
25775 * that will be connected to via the proxy, not the name of the proxy
25778 * Returns: the @proxy's destination hostname
25784 * g_proxy_address_get_destination_port:
25785 * @proxy: a #GProxyAddress
25787 * Gets @proxy's destination port; that is, the port on the
25788 * destination host that will be connected to via the proxy, not the
25789 * port number of the proxy itself.
25791 * Returns: the @proxy's destination port
25797 * g_proxy_address_get_destination_protocol:
25798 * @proxy: a #GProxyAddress
25800 * Gets the protocol that is being spoken to the destination
25801 * server; eg, "http" or "ftp".
25803 * Returns: the @proxy's destination protocol
25809 * g_proxy_address_get_password:
25810 * @proxy: a #GProxyAddress
25812 * Gets @proxy's password.
25814 * Returns: the @proxy's password
25820 * g_proxy_address_get_protocol:
25821 * @proxy: a #GProxyAddress
25823 * Gets @proxy's protocol. eg, "socks" or "http"
25825 * Returns: the @proxy's protocol
25831 * g_proxy_address_get_uri:
25832 * @proxy: a #GProxyAddress
25834 * Gets the proxy URI that @proxy was constructed from.
25836 * Returns: the @proxy's URI, or %NULL if unknown
25842 * g_proxy_address_get_username:
25843 * @proxy: a #GProxyAddress
25845 * Gets @proxy's username.
25847 * Returns: the @proxy's username
25853 * g_proxy_address_new:
25854 * @inetaddr: The proxy server #GInetAddress.
25855 * @port: The proxy server port.
25856 * @protocol: The proxy protocol to support, in lower case (e.g. socks, http).
25857 * @dest_hostname: The destination hostname the proxy should tunnel to.
25858 * @dest_port: The destination port to tunnel to.
25859 * @username: (allow-none): The username to authenticate to the proxy server (or %NULL).
25860 * @password: (allow-none): The password to authenticate to the proxy server (or %NULL).
25862 * Creates a new #GProxyAddress for @inetaddr with @protocol that should
25863 * tunnel through @dest_hostname and @dest_port.
25865 * (Note that this method doesn't set the #GProxyAddress:uri or
25866 * #GProxyAddress:destination-protocol fields; use g_object_new()
25867 * directly if you want to set those.)
25869 * Returns: a new #GProxyAddress
25876 * @proxy: a #GProxy
25877 * @connection: a #GIOStream
25878 * @proxy_address: a #GProxyAddress
25879 * @cancellable: (allow-none): a #GCancellable
25880 * @error: return #GError
25882 * Given @connection to communicate with a proxy (eg, a
25883 * #GSocketConnection that is connected to the proxy server), this
25884 * does the necessary handshake to connect to @proxy_address, and if
25885 * required, wraps the #GIOStream to handle proxy payload.
25887 * Returns: (transfer full): a #GIOStream that will replace @connection. This might be the same as @connection, in which case a reference will be added.
25893 * g_proxy_connect_async:
25894 * @proxy: a #GProxy
25895 * @connection: a #GIOStream
25896 * @proxy_address: a #GProxyAddress
25897 * @cancellable: (allow-none): a #GCancellable
25898 * @callback: (scope async): a #GAsyncReadyCallback
25899 * @user_data: (closure): callback data
25901 * Asynchronous version of g_proxy_connect().
25908 * g_proxy_connect_finish:
25909 * @proxy: a #GProxy
25910 * @result: a #GAsyncResult
25911 * @error: return #GError
25913 * See g_proxy_connect().
25915 * Returns: (transfer full): a #GIOStream.
25921 * g_proxy_get_default_for_protocol:
25922 * @protocol: the proxy protocol name (e.g. http, socks, etc)
25924 * Lookup "gio-proxy" extension point for a proxy implementation that supports
25925 * specified protocol.
25927 * Returns: (transfer full): return a #GProxy or NULL if protocol is not supported.
25933 * g_proxy_resolver_get_default:
25935 * Gets the default #GProxyResolver for the system.
25937 * Returns: (transfer none): the default #GProxyResolver.
25943 * g_proxy_resolver_is_supported:
25944 * @resolver: a #GProxyResolver
25946 * Checks if @resolver can be used on this system. (This is used
25947 * internally; g_proxy_resolver_get_default() will only return a proxy
25948 * resolver that returns %TRUE for this method.)
25950 * Returns: %TRUE if @resolver is supported.
25956 * g_proxy_resolver_lookup:
25957 * @resolver: a #GProxyResolver
25958 * @uri: a URI representing the destination to connect to
25959 * @cancellable: (allow-none): a #GCancellable, or %NULL
25960 * @error: return location for a #GError, or %NULL
25962 * Looks into the system proxy configuration to determine what proxy,
25963 * if any, to use to connect to @uri. The returned proxy URIs are of the
25964 * form <literal><protocol>://[user[:password]@]host:port</literal>
25965 * or <literal>direct://</literal>, where <protocol> could be
25966 * http, rtsp, socks or other proxying protocol.
25968 * If you don't know what network protocol is being used on the
25969 * socket, you should use <literal>none</literal> as the URI protocol.
25970 * In this case, the resolver might still return a generic proxy type
25971 * (such as SOCKS), but would not return protocol-specific proxy types
25974 * <literal>direct://</literal> is used when no proxy is needed.
25975 * Direct connection should not be attempted unless it is part of the
25976 * returned array of proxies.
25978 * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25984 * g_proxy_resolver_lookup_async:
25985 * @resolver: a #GProxyResolver
25986 * @uri: a URI representing the destination to connect to
25987 * @cancellable: (allow-none): a #GCancellable, or %NULL
25988 * @callback: (scope async): callback to call after resolution completes
25989 * @user_data: (closure): data for @callback
25991 * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
25999 * g_proxy_resolver_lookup_finish:
26000 * @resolver: a #GProxyResolver
26001 * @result: the result passed to your #GAsyncReadyCallback
26002 * @error: return location for a #GError, or %NULL
26004 * Call this function to obtain the array of proxy URIs when
26005 * g_proxy_resolver_lookup_async() is complete. See
26006 * g_proxy_resolver_lookup() for more details.
26008 * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
26014 * g_proxy_supports_hostname:
26015 * @proxy: a #GProxy
26017 * Some proxy protocols expect to be passed a hostname, which they
26018 * will resolve to an IP address themselves. Others, like SOCKS4, do
26019 * not allow this. This function will return %FALSE if @proxy is
26020 * implementing such a protocol. When %FALSE is returned, the caller
26021 * should resolve the destination hostname first, and then pass a
26022 * #GProxyAddress containing the stringified IP address to
26023 * g_proxy_connect() or g_proxy_connect_async().
26025 * Returns: %TRUE if hostname resolution is supported.
26031 * g_remote_action_group_activate_action_full:
26032 * @remote: a #GDBusActionGroup
26033 * @action_name: the name of the action to activate
26034 * @parameter: (allow-none): the optional parameter to the activation
26035 * @platform_data: the platform data to send
26037 * Activates the remote action.
26039 * This is the same as g_action_group_activate_action() except that it
26040 * allows for provision of "platform data" to be sent along with the
26041 * activation request. This typically contains details such as the user
26042 * interaction timestamp or startup notification information.
26044 * @platform_data must be non-%NULL and must have the type
26045 * %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
26052 * g_remote_action_group_change_action_state_full:
26053 * @remote: a #GRemoteActionGroup
26054 * @action_name: the name of the action to change the state of
26055 * @value: the new requested value for the state
26056 * @platform_data: the platform data to send
26058 * Changes the state of a remote action.
26060 * This is the same as g_action_group_change_action_state() except that
26061 * it allows for provision of "platform data" to be sent along with the
26062 * state change request. This typically contains details such as the
26063 * user interaction timestamp or startup notification information.
26065 * @platform_data must be non-%NULL and must have the type
26066 * %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
26073 * g_resolver_error_quark:
26075 * Gets the #GResolver Error Quark.
26077 * Returns: a #GQuark.
26083 * g_resolver_free_addresses: (skip)
26084 * @addresses: a #GList of #GInetAddress
26086 * Frees @addresses (which should be the return value from
26087 * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
26088 * (This is a convenience method; you can also simply free the results
26096 * g_resolver_free_targets: (skip)
26097 * @targets: a #GList of #GSrvTarget
26099 * Frees @targets (which should be the return value from
26100 * g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
26101 * (This is a convenience method; you can also simply free the
26102 * results by hand.)
26109 * g_resolver_get_default:
26111 * Gets the default #GResolver. You should unref it when you are done
26112 * with it. #GResolver may use its reference count as a hint about how
26113 * many threads it should allocate for concurrent DNS resolutions.
26115 * Returns: (transfer full): the default #GResolver.
26121 * g_resolver_lookup_by_address:
26122 * @resolver: a #GResolver
26123 * @address: the address to reverse-resolve
26124 * @cancellable: (allow-none): a #GCancellable, or %NULL
26125 * @error: return location for a #GError, or %NULL
26127 * Synchronously reverse-resolves @address to determine its
26128 * associated hostname.
26130 * If the DNS resolution fails, @error (if non-%NULL) will be set to
26131 * a value from #GResolverError.
26133 * If @cancellable is non-%NULL, it can be used to cancel the
26134 * operation, in which case @error (if non-%NULL) will be set to
26135 * %G_IO_ERROR_CANCELLED.
26137 * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
26143 * g_resolver_lookup_by_address_async:
26144 * @resolver: a #GResolver
26145 * @address: the address to reverse-resolve
26146 * @cancellable: (allow-none): a #GCancellable, or %NULL
26147 * @callback: (scope async): callback to call after resolution completes
26148 * @user_data: (closure): data for @callback
26150 * Begins asynchronously reverse-resolving @address to determine its
26151 * associated hostname, and eventually calls @callback, which must
26152 * call g_resolver_lookup_by_address_finish() to get the final result.
26159 * g_resolver_lookup_by_address_finish:
26160 * @resolver: a #GResolver
26161 * @result: the result passed to your #GAsyncReadyCallback
26162 * @error: return location for a #GError, or %NULL
26164 * Retrieves the result of a previous call to
26165 * g_resolver_lookup_by_address_async().
26167 * If the DNS resolution failed, @error (if non-%NULL) will be set to
26168 * a value from #GResolverError. If the operation was cancelled,
26169 * @error will be set to %G_IO_ERROR_CANCELLED.
26171 * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
26177 * g_resolver_lookup_by_name:
26178 * @resolver: a #GResolver
26179 * @hostname: the hostname to look up
26180 * @cancellable: (allow-none): a #GCancellable, or %NULL
26181 * @error: return location for a #GError, or %NULL
26183 * Synchronously resolves @hostname to determine its associated IP
26184 * address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
26185 * the textual form of an IP address (in which case this just becomes
26186 * a wrapper around g_inet_address_new_from_string()).
26188 * On success, g_resolver_lookup_by_name() will return a #GList of
26189 * #GInetAddress, sorted in order of preference and guaranteed to not
26190 * contain duplicates. That is, if using the result to connect to
26191 * @hostname, you should attempt to connect to the first address
26192 * first, then the second if the first fails, etc. If you are using
26193 * the result to listen on a socket, it is appropriate to add each
26194 * result using e.g. g_socket_listener_add_address().
26196 * If the DNS resolution fails, @error (if non-%NULL) will be set to a
26197 * value from #GResolverError.
26199 * If @cancellable is non-%NULL, it can be used to cancel the
26200 * operation, in which case @error (if non-%NULL) will be set to
26201 * %G_IO_ERROR_CANCELLED.
26203 * If you are planning to connect to a socket on the resolved IP
26204 * address, it may be easier to create a #GNetworkAddress and use its
26205 * #GSocketConnectable interface.
26207 * 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.)
26213 * g_resolver_lookup_by_name_async:
26214 * @resolver: a #GResolver
26215 * @hostname: the hostname to look up the address of
26216 * @cancellable: (allow-none): a #GCancellable, or %NULL
26217 * @callback: (scope async): callback to call after resolution completes
26218 * @user_data: (closure): data for @callback
26220 * Begins asynchronously resolving @hostname to determine its
26221 * associated IP address(es), and eventually calls @callback, which
26222 * must call g_resolver_lookup_by_name_finish() to get the result.
26223 * See g_resolver_lookup_by_name() for more details.
26230 * g_resolver_lookup_by_name_finish:
26231 * @resolver: a #GResolver
26232 * @result: the result passed to your #GAsyncReadyCallback
26233 * @error: return location for a #GError, or %NULL
26235 * Retrieves the result of a call to
26236 * g_resolver_lookup_by_name_async().
26238 * If the DNS resolution failed, @error (if non-%NULL) will be set to
26239 * a value from #GResolverError. If the operation was cancelled,
26240 * @error will be set to %G_IO_ERROR_CANCELLED.
26242 * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name() for more details.
26248 * g_resolver_lookup_records:
26249 * @resolver: a #GResolver
26250 * @rrname: the DNS name to lookup the record for
26251 * @record_type: the type of DNS record to lookup
26252 * @cancellable: (allow-none): a #GCancellable, or %NULL
26253 * @error: return location for a #GError, or %NULL
26255 * Synchronously performs a DNS record lookup for the given @rrname and returns
26256 * a list of records as #GVariant tuples. See #GResolverRecordType for
26257 * information on what the records contain for each @record_type.
26259 * If the DNS resolution fails, @error (if non-%NULL) will be set to
26260 * a value from #GResolverError.
26262 * If @cancellable is non-%NULL, it can be used to cancel the
26263 * operation, in which case @error (if non-%NULL) will be set to
26264 * %G_IO_ERROR_CANCELLED.
26266 * 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.)
26272 * g_resolver_lookup_records_async:
26273 * @resolver: a #GResolver
26274 * @rrname: the DNS name to lookup the record for
26275 * @record_type: the type of DNS record to lookup
26276 * @cancellable: (allow-none): a #GCancellable, or %NULL
26277 * @callback: (scope async): callback to call after resolution completes
26278 * @user_data: (closure): data for @callback
26280 * Begins asynchronously performing a DNS lookup for the given
26281 * @rrname, and eventually calls @callback, which must call
26282 * g_resolver_lookup_records_finish() to get the final result. See
26283 * g_resolver_lookup_records() for more details.
26290 * g_resolver_lookup_records_finish:
26291 * @resolver: a #GResolver
26292 * @result: the result passed to your #GAsyncReadyCallback
26293 * @error: return location for a #GError, or %NULL
26295 * Retrieves the result of a previous call to
26296 * g_resolver_lookup_records_async(). Returns a list of records as #GVariant
26297 * tuples. See #GResolverRecordType for information on what the records contain.
26299 * If the DNS resolution failed, @error (if non-%NULL) will be set to
26300 * a value from #GResolverError. If the operation was cancelled,
26301 * @error will be set to %G_IO_ERROR_CANCELLED.
26303 * 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.)
26309 * g_resolver_lookup_service:
26310 * @resolver: a #GResolver
26311 * @service: the service type to look up (eg, "ldap")
26312 * @protocol: the networking protocol to use for @service (eg, "tcp")
26313 * @domain: the DNS domain to look up the service in
26314 * @cancellable: (allow-none): a #GCancellable, or %NULL
26315 * @error: return location for a #GError, or %NULL
26317 * Synchronously performs a DNS SRV lookup for the given @service and
26318 * @protocol in the given @domain and returns an array of #GSrvTarget.
26319 * @domain may be an ASCII-only or UTF-8 hostname. Note also that the
26320 * @service and @protocol arguments <emphasis>do not</emphasis>
26321 * include the leading underscore that appears in the actual DNS
26324 * On success, g_resolver_lookup_service() will return a #GList of
26325 * #GSrvTarget, sorted in order of preference. (That is, you should
26326 * attempt to connect to the first target first, then the second if
26327 * the first fails, etc.)
26329 * If the DNS resolution fails, @error (if non-%NULL) will be set to
26330 * a value from #GResolverError.
26332 * If @cancellable is non-%NULL, it can be used to cancel the
26333 * operation, in which case @error (if non-%NULL) will be set to
26334 * %G_IO_ERROR_CANCELLED.
26336 * If you are planning to connect to the service, it is usually easier
26337 * to create a #GNetworkService and use its #GSocketConnectable
26340 * 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.)
26346 * g_resolver_lookup_service_async:
26347 * @resolver: a #GResolver
26348 * @service: the service type to look up (eg, "ldap")
26349 * @protocol: the networking protocol to use for @service (eg, "tcp")
26350 * @domain: the DNS domain to look up the service in
26351 * @cancellable: (allow-none): a #GCancellable, or %NULL
26352 * @callback: (scope async): callback to call after resolution completes
26353 * @user_data: (closure): data for @callback
26355 * Begins asynchronously performing a DNS SRV lookup for the given
26356 * @service and @protocol in the given @domain, and eventually calls
26357 * @callback, which must call g_resolver_lookup_service_finish() to
26358 * get the final result. See g_resolver_lookup_service() for more
26366 * g_resolver_lookup_service_finish:
26367 * @resolver: a #GResolver
26368 * @result: the result passed to your #GAsyncReadyCallback
26369 * @error: return location for a #GError, or %NULL
26371 * Retrieves the result of a previous call to
26372 * g_resolver_lookup_service_async().
26374 * If the DNS resolution failed, @error (if non-%NULL) will be set to
26375 * a value from #GResolverError. If the operation was cancelled,
26376 * @error will be set to %G_IO_ERROR_CANCELLED.
26378 * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. See g_resolver_lookup_service() for more details.
26384 * g_resolver_set_default:
26385 * @resolver: the new default #GResolver
26387 * Sets @resolver to be the application's default resolver (reffing
26388 * @resolver, and unreffing the previous default resolver, if any).
26389 * Future calls to g_resolver_get_default() will return this resolver.
26391 * This can be used if an application wants to perform any sort of DNS
26392 * caching or "pinning"; it can implement its own #GResolver that
26393 * calls the original default resolver for DNS operations, and
26394 * implements its own cache policies on top of that, and then set
26395 * itself as the default resolver for all later code to use.
26402 * g_resource_enumerate_children:
26403 * @resource: A #GResource
26404 * @path: A pathname inside the resource
26405 * @lookup_flags: A #GResourceLookupFlags
26406 * @error: return location for a #GError, or %NULL
26408 * Returns all the names of children at the specified @path in the resource.
26409 * The return result is a %NULL terminated list of strings which should
26410 * be released with g_strfreev().
26412 * @lookup_flags controls the behaviour of the lookup.
26414 * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
26420 * g_resource_error_quark:
26422 * Gets the #GResource Error Quark.
26424 * Returns: a #GQuark
26430 * g_resource_get_info:
26431 * @resource: A #GResource
26432 * @path: A pathname inside the resource
26433 * @lookup_flags: A #GResourceLookupFlags
26434 * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
26435 * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
26436 * @error: return location for a #GError, or %NULL
26438 * Looks for a file at the specified @path in the resource and
26439 * if found returns information about it.
26441 * @lookup_flags controls the behaviour of the lookup.
26443 * Returns: %TRUE if the file was found. %FALSE if there were errors
26450 * @filename: (type filename): the path of a filename to load, in the GLib filename encoding
26451 * @error: return location for a #GError, or %NULL
26453 * Loads a binary resource bundle and creates a #GResource representation of it, allowing
26454 * you to query it for data.
26456 * If you want to use this resource in the global resource namespace you need
26457 * to register it with g_resources_register().
26459 * Returns: (transfer full): a new #GResource, or %NULL on error
26465 * g_resource_lookup_data:
26466 * @resource: A #GResource
26467 * @path: A pathname inside the resource
26468 * @lookup_flags: A #GResourceLookupFlags
26469 * @error: return location for a #GError, or %NULL
26471 * Looks for a file at the specified @path in the resource and
26472 * returns a #GBytes that lets you directly access the data in
26475 * The data is always followed by a zero byte, so you
26476 * can safely use the data as a C string. However, that byte
26477 * is not included in the size of the GBytes.
26479 * For uncompressed resource files this is a pointer directly into
26480 * the resource bundle, which is typically in some readonly data section
26481 * in the program binary. For compressed files we allocate memory on
26482 * the heap and automatically uncompress the data.
26484 * @lookup_flags controls the behaviour of the lookup.
26486 * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
26492 * g_resource_new_from_data:
26494 * @error: return location for a #GError, or %NULL
26496 * Creates a GResource from a reference to the binary resource bundle.
26497 * This will keep a reference to @data while the resource lives, so
26498 * the data should not be modified or freed.
26500 * If you want to use this resource in the global resource namespace you need
26501 * to register it with g_resources_register().
26503 * Returns: (transfer full): a new #GResource, or %NULL on error
26509 * g_resource_open_stream:
26510 * @resource: A #GResource
26511 * @path: A pathname inside the resource
26512 * @lookup_flags: A #GResourceLookupFlags
26513 * @error: return location for a #GError, or %NULL
26515 * Looks for a file at the specified @path in the resource and
26516 * returns a #GInputStream that lets you read the data.
26518 * @lookup_flags controls the behaviour of the lookup.
26520 * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
26527 * @resource: A #GResource
26529 * Atomically increments the reference count of @array by one. This
26530 * function is MT-safe and may be called from any thread.
26532 * Returns: The passed in #GResource
26538 * g_resource_unref:
26539 * @resource: A #GResource
26541 * Atomically decrements the reference count of @resource by one. If the
26542 * reference count drops to 0, all memory allocated by the array is
26543 * released. This function is MT-safe and may be called from any
26551 * g_resources_enumerate_children:
26552 * @path: A pathname inside the resource
26553 * @lookup_flags: A #GResourceLookupFlags
26554 * @error: return location for a #GError, or %NULL
26556 * Returns all the names of children at the specified @path in the set of
26557 * globally registered resources.
26558 * The return result is a %NULL terminated list of strings which should
26559 * be released with g_strfreev().
26561 * @lookup_flags controls the behaviour of the lookup.
26563 * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
26569 * g_resources_get_info:
26570 * @path: A pathname inside the resource
26571 * @lookup_flags: A #GResourceLookupFlags
26572 * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
26573 * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
26574 * @error: return location for a #GError, or %NULL
26576 * Looks for a file at the specified @path in the set of
26577 * globally registered resources and if found returns information about it.
26579 * @lookup_flags controls the behaviour of the lookup.
26581 * Returns: %TRUE if the file was found. %FALSE if there were errors
26587 * g_resources_lookup_data:
26588 * @path: A pathname inside the resource
26589 * @lookup_flags: A #GResourceLookupFlags
26590 * @error: return location for a #GError, or %NULL
26592 * Looks for a file at the specified @path in the set of
26593 * globally registered resources and returns a #GBytes that
26594 * lets you directly access the data in memory.
26596 * The data is always followed by a zero byte, so you
26597 * can safely use the data as a C string. However, that byte
26598 * is not included in the size of the GBytes.
26600 * For uncompressed resource files this is a pointer directly into
26601 * the resource bundle, which is typically in some readonly data section
26602 * in the program binary. For compressed files we allocate memory on
26603 * the heap and automatically uncompress the data.
26605 * @lookup_flags controls the behaviour of the lookup.
26607 * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
26613 * g_resources_open_stream:
26614 * @path: A pathname inside the resource
26615 * @lookup_flags: A #GResourceLookupFlags
26616 * @error: return location for a #GError, or %NULL
26618 * Looks for a file at the specified @path in the set of
26619 * globally registered resources and returns a #GInputStream
26620 * that lets you read the data.
26622 * @lookup_flags controls the behaviour of the lookup.
26624 * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
26630 * g_resources_register:
26631 * @resource: A #GResource
26633 * Registers the resource with the process-global set of resources.
26634 * Once a resource is registered the files in it can be accessed
26635 * with the global resource lookup functions like g_resources_lookup_data().
26642 * g_resources_unregister:
26643 * @resource: A #GResource
26645 * Unregisters the resource from the process-global set of resources.
26652 * g_seekable_can_seek:
26653 * @seekable: a #GSeekable.
26655 * Tests if the stream supports the #GSeekableIface.
26657 * Returns: %TRUE if @seekable can be seeked. %FALSE otherwise.
26662 * g_seekable_can_truncate:
26663 * @seekable: a #GSeekable.
26665 * Tests if the stream can be truncated.
26667 * Returns: %TRUE if the stream can be truncated, %FALSE otherwise.
26673 * @seekable: a #GSeekable.
26674 * @offset: a #goffset.
26675 * @type: a #GSeekType.
26676 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26677 * @error: a #GError location to store the error occurring, or %NULL to ignore.
26679 * Seeks in the stream by the given @offset, modified by @type.
26681 * If @cancellable is not %NULL, then the operation can be cancelled by
26682 * triggering the cancellable object from another thread. If the operation
26683 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
26685 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26691 * @seekable: a #GSeekable.
26693 * Tells the current position within the stream.
26695 * Returns: the offset from the beginning of the buffer.
26700 * g_seekable_truncate:
26701 * @seekable: a #GSeekable.
26702 * @offset: a #goffset.
26703 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26704 * @error: a #GError location to store the error occurring, or %NULL to ignore.
26706 * Truncates a stream with a given #offset.
26708 * If @cancellable is not %NULL, then the operation can be cancelled by
26709 * triggering the cancellable object from another thread. If the operation
26710 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
26711 * operation was partially finished when the operation was cancelled the
26712 * partial result will be returned, without an error.
26714 * Virtual: truncate_fn
26715 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26720 * g_settings_apply:
26721 * @settings: a #GSettings instance
26723 * Applies any changes that have been made to the settings. This
26724 * function does nothing unless @settings is in 'delay-apply' mode;
26725 * see g_settings_delay(). In the normal case settings are always
26726 * applied immediately.
26731 * g_settings_backend_changed:
26732 * @backend: a #GSettingsBackend implementation
26733 * @key: the name of the key
26734 * @origin_tag: the origin tag
26736 * Signals that a single key has possibly changed. Backend
26737 * implementations should call this if a key has possibly changed its
26740 * @key must be a valid key (ie starting with a slash, not containing
26741 * '//', and not ending with a slash).
26743 * The implementation must call this function during any call to
26744 * g_settings_backend_write(), before the call returns (except in the
26745 * case that no keys are actually changed and it cares to detect this
26746 * fact). It may not rely on the existence of a mainloop for
26747 * dispatching the signal later.
26749 * The implementation may call this function at any other time it likes
26750 * in response to other events (such as changes occurring outside of the
26751 * program). These calls may originate from a mainloop or may originate
26752 * in response to any other action (including from calls to
26753 * g_settings_backend_write()).
26755 * In the case that this call is in response to a call to
26756 * g_settings_backend_write() then @origin_tag must be set to the same
26757 * value that was passed to that call.
26764 * g_settings_backend_changed_tree:
26765 * @backend: a #GSettingsBackend implementation
26766 * @tree: a #GTree containing the changes
26767 * @origin_tag: the origin tag
26769 * This call is a convenience wrapper. It gets the list of changes from
26770 * @tree, computes the longest common prefix and calls
26771 * g_settings_backend_changed().
26778 * g_settings_backend_flatten_tree:
26779 * @tree: a #GTree containing the changes
26780 * @path: (out): the location to save the path
26781 * @keys: (out) (transfer container) (array zero-terminated=1): the location to save the relative keys
26782 * @values: (out) (allow-none) (transfer container) (array zero-terminated=1): the location to save the values, or %NULL
26784 * Calculate the longest common prefix of all keys in a tree and write
26785 * out an array of the key names relative to that prefix and,
26786 * optionally, the value to store at each of those keys.
26788 * You must free the value returned in @path, @keys and @values using
26789 * g_free(). You should not attempt to free or unref the contents of
26790 * @keys or @values.
26797 * g_settings_backend_get_default:
26799 * Returns the default #GSettingsBackend. It is possible to override
26800 * the default by setting the <envar>GSETTINGS_BACKEND</envar>
26801 * environment variable to the name of a settings backend.
26803 * The user gets a reference to the backend.
26805 * Returns: (transfer full): the default #GSettingsBackend
26811 * g_settings_backend_keys_changed:
26812 * @backend: a #GSettingsBackend implementation
26813 * @path: the path containing the changes
26814 * @items: (array zero-terminated=1): the %NULL-terminated list of changed keys
26815 * @origin_tag: the origin tag
26817 * Signals that a list of keys have possibly changed. Backend
26818 * implementations should call this if keys have possibly changed their
26821 * @path must be a valid path (ie starting and ending with a slash and
26822 * not containing '//'). Each string in @items must form a valid key
26823 * name when @path is prefixed to it (ie: each item must not start or
26824 * end with '/' and must not contain '//').
26826 * The meaning of this signal is that any of the key names resulting
26827 * from the contatenation of @path with each item in @items may have
26830 * The same rules for when notifications must occur apply as per
26831 * g_settings_backend_changed(). These two calls can be used
26832 * interchangeably if exactly one item has changed (although in that
26833 * case g_settings_backend_changed() is definitely preferred).
26835 * For efficiency reasons, the implementation should strive for @path to
26836 * be as long as possible (ie: the longest common prefix of all of the
26837 * keys that were changed) but this is not strictly required.
26844 * g_settings_backend_path_changed:
26845 * @backend: a #GSettingsBackend implementation
26846 * @path: the path containing the changes
26847 * @origin_tag: the origin tag
26849 * Signals that all keys below a given path may have possibly changed.
26850 * Backend implementations should call this if an entire path of keys
26851 * have possibly changed their values.
26853 * @path must be a valid path (ie starting and ending with a slash and
26854 * not containing '//').
26856 * The meaning of this signal is that any of the key which has a name
26857 * starting with @path may have changed.
26859 * The same rules for when notifications must occur apply as per
26860 * g_settings_backend_changed(). This call might be an appropriate
26861 * reasponse to a 'reset' call but implementations are also free to
26862 * explicitly list the keys that were affected by that call if they can
26865 * For efficiency reasons, the implementation should strive for @path to
26866 * be as long as possible (ie: the longest common prefix of all of the
26867 * keys that were changed) but this is not strictly required. As an
26868 * example, if this function is called with the path of "/" then every
26869 * single key in the application will be notified of a possible change.
26876 * g_settings_backend_path_writable_changed:
26877 * @backend: a #GSettingsBackend implementation
26878 * @path: the name of the path
26880 * Signals that the writability of all keys below a given path may have
26883 * Since GSettings performs no locking operations for itself, this call
26884 * will always be made in response to external events.
26891 * g_settings_backend_writable_changed:
26892 * @backend: a #GSettingsBackend implementation
26893 * @key: the name of the key
26895 * Signals that the writability of a single key has possibly changed.
26897 * Since GSettings performs no locking operations for itself, this call
26898 * will always be made in response to external events.
26906 * @settings: a #GSettings object
26907 * @key: the key to bind
26908 * @object: (type GObject.Object): a #GObject
26909 * @property: the name of the property to bind
26910 * @flags: flags for the binding
26912 * Create a binding between the @key in the @settings object
26913 * and the property @property of @object.
26915 * The binding uses the default GIO mapping functions to map
26916 * between the settings and property values. These functions
26917 * handle booleans, numeric types and string types in a
26918 * straightforward way. Use g_settings_bind_with_mapping() if
26919 * you need a custom mapping, or map between types that are not
26920 * supported by the default mapping functions.
26922 * Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
26923 * function also establishes a binding between the writability of
26924 * @key and the "sensitive" property of @object (if @object has
26925 * a boolean property by that name). See g_settings_bind_writable()
26926 * for more details about writable bindings.
26928 * Note that the lifecycle of the binding is tied to the object,
26929 * and that you can have only one binding per object property.
26930 * If you bind the same property twice on the same object, the second
26931 * binding overrides the first one.
26938 * g_settings_bind_with_mapping: (skip)
26939 * @settings: a #GSettings object
26940 * @key: the key to bind
26941 * @object: (type GObject.Object): a #GObject
26942 * @property: the name of the property to bind
26943 * @flags: flags for the binding
26944 * @get_mapping: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
26945 * @set_mapping: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
26946 * @user_data: data that gets passed to @get_mapping and @set_mapping
26947 * @destroy: #GDestroyNotify function for @user_data
26949 * Create a binding between the @key in the @settings object
26950 * and the property @property of @object.
26952 * The binding uses the provided mapping functions to map between
26953 * settings and property values.
26955 * Note that the lifecycle of the binding is tied to the object,
26956 * and that you can have only one binding per object property.
26957 * If you bind the same property twice on the same object, the second
26958 * binding overrides the first one.
26965 * g_settings_bind_writable:
26966 * @settings: a #GSettings object
26967 * @key: the key to bind
26968 * @object: (type GObject.Object): a #GObject
26969 * @property: the name of a boolean property to bind
26970 * @inverted: whether to 'invert' the value
26972 * Create a binding between the writability of @key in the
26973 * @settings object and the property @property of @object.
26974 * The property must be boolean; "sensitive" or "visible"
26975 * properties of widgets are the most likely candidates.
26977 * Writable bindings are always uni-directional; changes of the
26978 * writability of the setting will be propagated to the object
26979 * property, not the other way.
26981 * When the @inverted argument is %TRUE, the binding inverts the
26982 * value as it passes from the setting to the object, i.e. @property
26983 * will be set to %TRUE if the key is <emphasis>not</emphasis>
26986 * Note that the lifecycle of the binding is tied to the object,
26987 * and that you can have only one binding per object property.
26988 * If you bind the same property twice on the same object, the second
26989 * binding overrides the first one.
26996 * g_settings_create_action:
26997 * @settings: a #GSettings
26998 * @key: the name of a key in @settings
27000 * Creates a #GAction corresponding to a given #GSettings key.
27002 * The action has the same name as the key.
27004 * The value of the key becomes the state of the action and the action
27005 * is enabled when the key is writable. Changing the state of the
27006 * action results in the key being written to. Changes to the value or
27007 * writability of the key cause appropriate change notifications to be
27008 * emitted for the action.
27010 * For boolean-valued keys, action activations take no parameter and
27011 * result in the toggling of the value. For all other types,
27012 * activations take the new value for the key (which must have the
27015 * Returns: (transfer full): a new #GAction
27021 * g_settings_delay:
27022 * @settings: a #GSettings object
27024 * Changes the #GSettings object into 'delay-apply' mode. In this
27025 * mode, changes to @settings are not immediately propagated to the
27026 * backend, but kept locally until g_settings_apply() is called.
27034 * @settings: a #GSettings object
27035 * @key: the key to get the value for
27036 * @format: a #GVariant format string
27037 * @...: arguments as per @format
27039 * Gets the value that is stored at @key in @settings.
27041 * A convenience function that combines g_settings_get_value() with
27044 * It is a programmer error to give a @key that isn't contained in the
27045 * schema for @settings or for the #GVariantType of @format to mismatch
27046 * the type given in the schema.
27053 * g_settings_get_boolean:
27054 * @settings: a #GSettings object
27055 * @key: the key to get the value for
27057 * Gets the value that is stored at @key in @settings.
27059 * A convenience variant of g_settings_get() for booleans.
27061 * It is a programmer error to give a @key that isn't specified as
27062 * having a boolean type in the schema for @settings.
27064 * Returns: a boolean
27070 * g_settings_get_child:
27071 * @settings: a #GSettings object
27072 * @name: the name of the 'child' schema
27074 * Creates a 'child' settings object which has a base path of
27075 * <replaceable>base-path</replaceable>/@name, where
27076 * <replaceable>base-path</replaceable> is the base path of @settings.
27078 * The schema for the child settings object must have been declared
27079 * in the schema of @settings using a <tag class="starttag">child</tag> element.
27081 * Returns: (transfer full): a 'child' settings object
27087 * g_settings_get_double:
27088 * @settings: a #GSettings object
27089 * @key: the key to get the value for
27091 * Gets the value that is stored at @key in @settings.
27093 * A convenience variant of g_settings_get() for doubles.
27095 * It is a programmer error to give a @key that isn't specified as
27096 * having a 'double' type in the schema for @settings.
27098 * Returns: a double
27104 * g_settings_get_enum:
27105 * @settings: a #GSettings object
27106 * @key: the key to get the value for
27108 * Gets the value that is stored in @settings for @key and converts it
27109 * to the enum value that it represents.
27111 * In order to use this function the type of the value must be a string
27112 * and it must be marked in the schema file as an enumerated type.
27114 * It is a programmer error to give a @key that isn't contained in the
27115 * schema for @settings or is not marked as an enumerated type.
27117 * If the value stored in the configuration database is not a valid
27118 * value for the enumerated type then this function will return the
27121 * Returns: the enum value
27127 * g_settings_get_flags:
27128 * @settings: a #GSettings object
27129 * @key: the key to get the value for
27131 * Gets the value that is stored in @settings for @key and converts it
27132 * to the flags value that it represents.
27134 * In order to use this function the type of the value must be an array
27135 * of strings and it must be marked in the schema file as an flags type.
27137 * It is a programmer error to give a @key that isn't contained in the
27138 * schema for @settings or is not marked as a flags type.
27140 * If the value stored in the configuration database is not a valid
27141 * value for the flags type then this function will return the default
27144 * Returns: the flags value
27150 * g_settings_get_has_unapplied:
27151 * @settings: a #GSettings object
27153 * Returns whether the #GSettings object has any unapplied
27154 * changes. This can only be the case if it is in 'delayed-apply' mode.
27156 * Returns: %TRUE if @settings has unapplied changes
27162 * g_settings_get_int:
27163 * @settings: a #GSettings object
27164 * @key: the key to get the value for
27166 * Gets the value that is stored at @key in @settings.
27168 * A convenience variant of g_settings_get() for 32-bit integers.
27170 * It is a programmer error to give a @key that isn't specified as
27171 * having a int32 type in the schema for @settings.
27173 * Returns: an integer
27179 * g_settings_get_mapped:
27180 * @settings: a #GSettings object
27181 * @key: the key to get the value for
27182 * @mapping: (scope call): the function to map the value in the settings database to the value used by the application
27183 * @user_data: user data for @mapping
27185 * Gets the value that is stored at @key in @settings, subject to
27186 * application-level validation/mapping.
27188 * You should use this function when the application needs to perform
27189 * some processing on the value of the key (for example, parsing). The
27190 * @mapping function performs that processing. If the function
27191 * indicates that the processing was unsuccessful (due to a parse error,
27192 * for example) then the mapping is tried again with another value.
27194 * This allows a robust 'fall back to defaults' behaviour to be
27195 * implemented somewhat automatically.
27197 * The first value that is tried is the user's setting for the key. If
27198 * the mapping function fails to map this value, other values may be
27199 * tried in an unspecified order (system or site defaults, translated
27200 * schema default values, untranslated schema default values, etc).
27202 * If the mapping function fails for all possible values, one additional
27203 * attempt is made: the mapping function is called with a %NULL value.
27204 * If the mapping function still indicates failure at this point then
27205 * the application will be aborted.
27207 * The result parameter for the @mapping function is pointed to a
27208 * #gpointer which is initially set to %NULL. The same pointer is given
27209 * to each invocation of @mapping. The final value of that #gpointer is
27210 * what is returned by this function. %NULL is valid; it is returned
27211 * just as any other value would be.
27213 * Returns: (transfer full): the result, which may be %NULL
27218 * g_settings_get_range:
27219 * @settings: a #GSettings
27220 * @key: the key to query the range of
27222 * Queries the range of a key.
27224 * This function will return a #GVariant that fully describes the range
27225 * of values that are valid for @key.
27227 * The type of #GVariant returned is <literal>(sv)</literal>. The
27228 * string describes the type of range restriction in effect. The type
27229 * and meaning of the value contained in the variant depends on the
27232 * If the string is <literal>'type'</literal> then the variant contains
27233 * an empty array. The element type of that empty array is the expected
27234 * type of value and all values of that type are valid.
27236 * If the string is <literal>'enum'</literal> then the variant contains
27237 * an array enumerating the possible values. Each item in the array is
27238 * a possible valid value and no other values are valid.
27240 * If the string is <literal>'flags'</literal> then the variant contains
27241 * an array. Each item in the array is a value that may appear zero or
27242 * one times in an array to be used as the value for this key. For
27243 * example, if the variant contained the array <literal>['x',
27244 * 'y']</literal> then the valid values for the key would be
27245 * <literal>[]</literal>, <literal>['x']</literal>,
27246 * <literal>['y']</literal>, <literal>['x', 'y']</literal> and
27247 * <literal>['y', 'x']</literal>.
27249 * Finally, if the string is <literal>'range'</literal> then the variant
27250 * contains a pair of like-typed values -- the minimum and maximum
27251 * permissible values for this key.
27253 * This information should not be used by normal programs. It is
27254 * considered to be a hint for introspection purposes. Normal programs
27255 * should already know what is permitted by their own schema. The
27256 * format may change in any way in the future -- but particularly, new
27257 * forms may be added to the possibilities described above.
27259 * It is a programmer error to give a @key that isn't contained in the
27260 * schema for @settings.
27262 * You should free the returned value with g_variant_unref() when it is
27263 * no longer needed.
27265 * Returns: a #GVariant describing the range
27271 * g_settings_get_string:
27272 * @settings: a #GSettings object
27273 * @key: the key to get the value for
27275 * Gets the value that is stored at @key in @settings.
27277 * A convenience variant of g_settings_get() for strings.
27279 * It is a programmer error to give a @key that isn't specified as
27280 * having a string type in the schema for @settings.
27282 * Returns: a newly-allocated string
27288 * g_settings_get_strv:
27289 * @settings: a #GSettings object
27290 * @key: the key to get the value for
27292 * A convenience variant of g_settings_get() for string arrays.
27294 * It is a programmer error to give a @key that isn't specified as
27295 * having an array of strings type in the schema for @settings.
27297 * Returns: (array zero-terminated=1) (transfer full): a newly-allocated, %NULL-terminated array of strings, the value that is stored at @key in @settings.
27303 * g_settings_get_uint:
27304 * @settings: a #GSettings object
27305 * @key: the key to get the value for
27307 * Gets the value that is stored at @key in @settings.
27309 * A convenience variant of g_settings_get() for 32-bit unsigned
27312 * It is a programmer error to give a @key that isn't specified as
27313 * having a uint32 type in the schema for @settings.
27315 * Returns: an unsigned integer
27321 * g_settings_get_value:
27322 * @settings: a #GSettings object
27323 * @key: the key to get the value for
27325 * Gets the value that is stored in @settings for @key.
27327 * It is a programmer error to give a @key that isn't contained in the
27328 * schema for @settings.
27330 * Returns: a new #GVariant
27336 * g_settings_is_writable:
27337 * @settings: a #GSettings object
27338 * @name: the name of a key
27340 * Finds out if a key can be written or not
27342 * Returns: %TRUE if the key @name is writable
27348 * g_settings_list_children:
27349 * @settings: a #GSettings object
27351 * Gets the list of children on @settings.
27353 * The list is exactly the list of strings for which it is not an error
27354 * to call g_settings_get_child().
27356 * For GSettings objects that are lists, this value can change at any
27357 * time and you should connect to the "children-changed" signal to watch
27358 * for those changes. Note that there is a race condition here: you may
27359 * request a child after listing it only for it to have been destroyed
27360 * in the meantime. For this reason, g_settings_get_child() may return
27361 * %NULL even for a child that was listed by this function.
27363 * For GSettings objects that are not lists, you should probably not be
27364 * calling this function from "normal" code (since you should already
27365 * know what children are in your schema). This function may still be
27366 * useful there for introspection reasons, however.
27368 * You should free the return value with g_strfreev() when you are done
27371 * Returns: (transfer full) (element-type utf8): a list of the children on @settings
27376 * g_settings_list_keys:
27377 * @settings: a #GSettings object
27379 * Introspects the list of keys on @settings.
27381 * You should probably not be calling this function from "normal" code
27382 * (since you should already know what keys are in your schema). This
27383 * function is intended for introspection reasons.
27385 * You should free the return value with g_strfreev() when you are done
27388 * Returns: (transfer full) (element-type utf8): a list of the keys on @settings
27393 * g_settings_list_relocatable_schemas:
27395 * Gets a list of the relocatable #GSettings schemas installed on the
27396 * system. These are schemas that do not provide their own path. It is
27397 * usual to instantiate these schemas directly, but if you want to you
27398 * can use g_settings_new_with_path() to specify the path.
27400 * The output of this function, taken together with the output of
27401 * g_settings_list_schemas() represents the complete list of all
27402 * installed schemas.
27404 * Returns: (element-type utf8) (transfer none): a list of relocatable #GSettings schemas that are available. The list must not be modified or freed.
27410 * g_settings_list_schemas:
27412 * Gets a list of the #GSettings schemas installed on the system. The
27413 * returned list is exactly the list of schemas for which you may call
27414 * g_settings_new() without adverse effects.
27416 * This function does not list the schemas that do not provide their own
27417 * paths (ie: schemas for which you must use
27418 * g_settings_new_with_path()). See
27419 * g_settings_list_relocatable_schemas() for that.
27421 * Returns: (element-type utf8) (transfer none): a list of #GSettings schemas that are available. The list must not be modified or freed.
27428 * @schema_id: the id of the schema
27430 * Creates a new #GSettings object with the schema specified by
27433 * Signals on the newly created #GSettings object will be dispatched
27434 * via the thread-default #GMainContext in effect at the time of the
27435 * call to g_settings_new(). The new #GSettings will hold a reference
27436 * on the context. See g_main_context_push_thread_default().
27438 * Returns: a new #GSettings object
27444 * g_settings_new_full:
27445 * @schema: a #GSettingsSchema
27446 * @backend: (allow-none): a #GSettingsBackend
27447 * @path: (allow-none): the path to use
27449 * Creates a new #GSettings object with a given schema, backend and
27452 * It should be extremely rare that you ever want to use this function.
27453 * It is made available for advanced use-cases (such as plugin systems
27454 * that want to provide access to schemas loaded from custom locations,
27457 * At the most basic level, a #GSettings object is a pure composition of
27458 * 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
27459 * backend, and a #GMainContext to which signals are dispatched.
27461 * This constructor therefore gives you full control over constructing
27462 * #GSettings instances. The first 4 parameters are given directly as
27463 * @schema, @backend and @path, and the main context is taken from the
27464 * thread-default (as per g_settings_new()).
27466 * If @backend is %NULL then the default backend is used.
27468 * If @path is %NULL then the path from the schema is used. It is an
27469 * error f @path is %NULL and the schema has no path of its own or if
27470 * @path is non-%NULL and not equal to the path that the schema does
27473 * Returns: a new #GSettings object
27479 * g_settings_new_with_backend:
27480 * @schema_id: the id of the schema
27481 * @backend: the #GSettingsBackend to use
27483 * Creates a new #GSettings object with the schema specified by
27484 * @schema_id and a given #GSettingsBackend.
27486 * Creating a #GSettings object with a different backend allows accessing
27487 * settings from a database other than the usual one. For example, it may make
27488 * sense to pass a backend corresponding to the "defaults" settings database on
27489 * the system to get a settings object that modifies the system default
27490 * settings instead of the settings for this user.
27492 * Returns: a new #GSettings object
27498 * g_settings_new_with_backend_and_path:
27499 * @schema_id: the id of the schema
27500 * @backend: the #GSettingsBackend to use
27501 * @path: the path to use
27503 * Creates a new #GSettings object with the schema specified by
27504 * @schema_id and a given #GSettingsBackend and path.
27506 * This is a mix of g_settings_new_with_backend() and
27507 * g_settings_new_with_path().
27509 * Returns: a new #GSettings object
27515 * g_settings_new_with_path:
27516 * @schema_id: the id of the schema
27517 * @path: the path to use
27519 * Creates a new #GSettings object with the relocatable schema specified
27520 * by @schema_id and a given path.
27522 * You only need to do this if you want to directly create a settings
27523 * object with a schema that doesn't have a specified path of its own.
27524 * That's quite rare.
27526 * It is a programmer error to call this function for a schema that
27527 * has an explicitly specified path.
27529 * Returns: a new #GSettings object
27535 * g_settings_range_check:
27536 * @settings: a #GSettings
27537 * @key: the key to check
27538 * @value: the value to check
27540 * Checks if the given @value is of the correct type and within the
27541 * permitted range for @key.
27543 * This API is not intended to be used by normal programs -- they should
27544 * already know what is permitted by their own schemas. This API is
27545 * meant to be used by programs such as editors or commandline tools.
27547 * It is a programmer error to give a @key that isn't contained in the
27548 * schema for @settings.
27550 * Returns: %TRUE if @value is valid for @key
27556 * g_settings_reset:
27557 * @settings: a #GSettings object
27558 * @key: the name of a key
27560 * Resets @key to its default value.
27562 * This call resets the key, as much as possible, to its default value.
27563 * That might the value specified in the schema or the one set by the
27569 * g_settings_revert:
27570 * @settings: a #GSettings instance
27572 * Reverts all non-applied changes to the settings. This function
27573 * does nothing unless @settings is in 'delay-apply' mode; see
27574 * g_settings_delay(). In the normal case settings are always applied
27577 * Change notifications will be emitted for affected keys.
27582 * g_settings_schema_get_id:
27583 * @schema: a #GSettingsSchema
27585 * Get the ID of @schema.
27587 * Returns: (transfer none): the ID
27592 * g_settings_schema_get_path:
27593 * @schema: a #GSettingsSchema
27595 * Gets the path associated with @schema, or %NULL.
27597 * Schemas may be single-instance or relocatable. Single-instance
27598 * schemas correspond to exactly one set of keys in the backend
27599 * database: those located at the path returned by this function.
27601 * Relocatable schemas can be referenced by other schemas and can
27602 * threfore describe multiple sets of keys at different locations. For
27603 * relocatable schemas, this function will return %NULL.
27605 * Returns: (transfer none): the path of the schema, or %NULL
27611 * g_settings_schema_ref:
27612 * @schema: a #GSettingsSchema
27614 * Increase the reference count of @schema, returning a new reference.
27616 * Returns: a new reference to @schema
27622 * g_settings_schema_source_get_default:
27624 * Gets the default system schema source.
27626 * This function is not required for normal uses of #GSettings but it
27627 * may be useful to authors of plugin management systems or to those who
27628 * want to introspect the content of schemas.
27630 * If no schemas are installed, %NULL will be returned.
27632 * The returned source may actually consist of multiple schema sources
27633 * from different directories, depending on which directories were given
27634 * in <envar>XDG_DATA_DIRS</envar> and
27635 * <envar>GSETTINGS_SCHEMA_DIR</envar>. For this reason, all lookups
27636 * performed against the default source should probably be done
27639 * Returns: (transfer none): the default schema source
27645 * g_settings_schema_source_lookup:
27646 * @source: a #GSettingsSchemaSource
27647 * @schema_id: a schema ID
27648 * @recursive: %TRUE if the lookup should be recursive
27650 * Looks up a schema with the identifier @schema_id in @source.
27652 * This function is not required for normal uses of #GSettings but it
27653 * may be useful to authors of plugin management systems or to those who
27654 * want to introspect the content of schemas.
27656 * If the schema isn't found directly in @source and @recursive is %TRUE
27657 * then the parent sources will also be checked.
27659 * If the schema isn't found, %NULL is returned.
27661 * Returns: (transfer full): a new #GSettingsSchema
27667 * g_settings_schema_source_new_from_directory:
27668 * @directory: the filename of a directory
27669 * @parent: (allow-none): a #GSettingsSchemaSource, or %NULL
27670 * @trusted: %TRUE, if the directory is trusted
27671 * @error: a pointer to a #GError pointer set to %NULL, or %NULL
27673 * Attempts to create a new schema source corresponding to the contents
27674 * of the given directory.
27676 * This function is not required for normal uses of #GSettings but it
27677 * may be useful to authors of plugin management systems.
27679 * The directory should contain a file called
27680 * <filename>gschemas.compiled</filename> as produced by
27681 * <command>glib-compile-schemas</command>.
27683 * If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
27684 * trusted not to be corrupted. This assumption has a performance
27685 * advantage, but can result in crashes or inconsistent behaviour in the
27686 * case of a corrupted file. Generally, you should set @trusted to
27687 * %TRUE for files installed by the system and to %FALSE for files in
27688 * the home directory.
27690 * If @parent is non-%NULL then there are two effects.
27692 * First, if g_settings_schema_source_lookup() is called with the
27693 * @recursive flag set to %TRUE and the schema can not be found in the
27694 * source, the lookup will recurse to the parent.
27696 * Second, any references to other schemas specified within this
27697 * source (ie: <literal>child</literal> or <literal>extends</literal>)
27698 * references may be resolved from the @parent.
27700 * For this second reason, except in very unusual situations, the
27701 * @parent should probably be given as the default schema source, as
27702 * returned by g_settings_schema_source_get_default().
27709 * g_settings_schema_source_ref:
27710 * @source: a #GSettingsSchemaSource
27712 * Increase the reference count of @source, returning a new reference.
27714 * Returns: a new reference to @source
27720 * g_settings_schema_source_unref:
27721 * @source: a #GSettingsSchemaSource
27723 * Decrease the reference count of @source, possibly freeing it.
27730 * g_settings_schema_unref:
27731 * @schema: a #GSettingsSchema
27733 * Decrease the reference count of @schema, possibly freeing it.
27741 * @settings: a #GSettings object
27742 * @key: the name of the key to set
27743 * @format: a #GVariant format string
27744 * @...: arguments as per @format
27746 * Sets @key in @settings to @value.
27748 * A convenience function that combines g_settings_set_value() with
27751 * It is a programmer error to give a @key that isn't contained in the
27752 * schema for @settings or for the #GVariantType of @format to mismatch
27753 * the type given in the schema.
27755 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27761 * g_settings_set_boolean:
27762 * @settings: a #GSettings object
27763 * @key: the name of the key to set
27764 * @value: the value to set it to
27766 * Sets @key in @settings to @value.
27768 * A convenience variant of g_settings_set() for booleans.
27770 * It is a programmer error to give a @key that isn't specified as
27771 * having a boolean type in the schema for @settings.
27773 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27779 * g_settings_set_double:
27780 * @settings: a #GSettings object
27781 * @key: the name of the key to set
27782 * @value: the value to set it to
27784 * Sets @key in @settings to @value.
27786 * A convenience variant of g_settings_set() for doubles.
27788 * It is a programmer error to give a @key that isn't specified as
27789 * having a 'double' type in the schema for @settings.
27791 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27797 * g_settings_set_enum:
27798 * @settings: a #GSettings object
27799 * @key: a key, within @settings
27800 * @value: an enumerated value
27802 * Looks up the enumerated type nick for @value and writes it to @key,
27803 * within @settings.
27805 * It is a programmer error to give a @key that isn't contained in the
27806 * schema for @settings or is not marked as an enumerated type, or for
27807 * @value not to be a valid value for the named type.
27809 * After performing the write, accessing @key directly with
27810 * g_settings_get_string() will return the 'nick' associated with
27813 * Returns: %TRUE, if the set succeeds
27818 * g_settings_set_flags:
27819 * @settings: a #GSettings object
27820 * @key: a key, within @settings
27821 * @value: a flags value
27823 * Looks up the flags type nicks for the bits specified by @value, puts
27824 * them in an array of strings and writes the array to @key, within
27827 * It is a programmer error to give a @key that isn't contained in the
27828 * schema for @settings or is not marked as a flags type, or for @value
27829 * to contain any bits that are not value for the named type.
27831 * After performing the write, accessing @key directly with
27832 * g_settings_get_strv() will return an array of 'nicks'; one for each
27835 * Returns: %TRUE, if the set succeeds
27840 * g_settings_set_int:
27841 * @settings: a #GSettings object
27842 * @key: the name of the key to set
27843 * @value: the value to set it to
27845 * Sets @key in @settings to @value.
27847 * A convenience variant of g_settings_set() for 32-bit integers.
27849 * It is a programmer error to give a @key that isn't specified as
27850 * having a int32 type in the schema for @settings.
27852 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27858 * g_settings_set_string:
27859 * @settings: a #GSettings object
27860 * @key: the name of the key to set
27861 * @value: the value to set it to
27863 * Sets @key in @settings to @value.
27865 * A convenience variant of g_settings_set() for strings.
27867 * It is a programmer error to give a @key that isn't specified as
27868 * having a string type in the schema for @settings.
27870 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27876 * g_settings_set_strv:
27877 * @settings: a #GSettings object
27878 * @key: the name of the key to set
27879 * @value: (allow-none) (array zero-terminated=1): the value to set it to, or %NULL
27881 * Sets @key in @settings to @value.
27883 * A convenience variant of g_settings_set() for string arrays. If
27884 * @value is %NULL, then @key is set to be the empty array.
27886 * It is a programmer error to give a @key that isn't specified as
27887 * having an array of strings type in the schema for @settings.
27889 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27895 * g_settings_set_uint:
27896 * @settings: a #GSettings object
27897 * @key: the name of the key to set
27898 * @value: the value to set it to
27900 * Sets @key in @settings to @value.
27902 * A convenience variant of g_settings_set() for 32-bit unsigned
27905 * It is a programmer error to give a @key that isn't specified as
27906 * having a uint32 type in the schema for @settings.
27908 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27914 * g_settings_set_value:
27915 * @settings: a #GSettings object
27916 * @key: the name of the key to set
27917 * @value: a #GVariant of the correct type
27919 * Sets @key in @settings to @value.
27921 * It is a programmer error to give a @key that isn't contained in the
27922 * schema for @settings or for @value to have the incorrect type, per
27925 * If @value is floating then this function consumes the reference.
27927 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27935 * Ensures that all pending operations for the given are complete for
27936 * the default backend.
27938 * Writes made to a #GSettings are handled asynchronously. For this
27939 * reason, it is very unlikely that the changes have it to disk by the
27940 * time g_settings_set() returns.
27942 * This call will block until all of the writes have made it to the
27943 * backend. Since the mainloop is not running, no change notifications
27944 * will be dispatched during this call (but some may be queued by the
27945 * time the call is done).
27950 * g_settings_unbind:
27951 * @object: the object
27952 * @property: the property whose binding is removed
27954 * Removes an existing binding for @property on @object.
27956 * Note that bindings are automatically removed when the
27957 * object is finalized, so it is rarely necessary to call this
27965 * g_simple_action_group_add_entries:
27966 * @simple: a #GSimpleActionGroup
27967 * @entries: (array length=n_entries): a pointer to the first item in an array of #GActionEntry structs
27968 * @n_entries: the length of @entries, or -1
27969 * @user_data: the user data for signal connections
27971 * A convenience function for creating multiple #GSimpleAction instances
27972 * and adding them to the action group.
27979 * g_simple_action_group_insert:
27980 * @simple: a #GSimpleActionGroup
27981 * @action: a #GAction
27983 * Adds an action to the action group.
27985 * If the action group already contains an action with the same name as
27986 * @action then the old action is dropped from the group.
27988 * The action group takes its own reference on @action.
27995 * g_simple_action_group_lookup:
27996 * @simple: a #GSimpleActionGroup
27997 * @action_name: the name of an action
27999 * Looks up the action with the name @action_name in the group.
28001 * If no such action exists, returns %NULL.
28003 * Returns: (transfer none): a #GAction, or %NULL
28009 * g_simple_action_group_new:
28011 * Creates a new, empty, #GSimpleActionGroup.
28013 * Returns: a new #GSimpleActionGroup
28019 * g_simple_action_group_remove:
28020 * @simple: a #GSimpleActionGroup
28021 * @action_name: the name of the action
28023 * Removes the named action from the action group.
28025 * If no action of this name is in the group then nothing happens.
28032 * g_simple_action_new:
28033 * @name: the name of the action
28034 * @parameter_type: (allow-none): the type of parameter to the activate function
28036 * Creates a new action.
28038 * The created action is stateless. See g_simple_action_new_stateful().
28040 * Returns: a new #GSimpleAction
28046 * g_simple_action_new_stateful:
28047 * @name: the name of the action
28048 * @parameter_type: (allow-none): the type of the parameter to the activate function
28049 * @state: the initial state of the action
28051 * Creates a new stateful action.
28053 * @state is the initial state of the action. All future state values
28054 * must have the same #GVariantType as the initial state.
28056 * If the @state GVariant is floating, it is consumed.
28058 * Returns: a new #GSimpleAction
28064 * g_simple_action_set_enabled:
28065 * @simple: a #GSimpleAction
28066 * @enabled: whether the action is enabled
28068 * Sets the action as enabled or not.
28070 * An action must be enabled in order to be activated or in order to
28071 * have its state changed from outside callers.
28073 * This should only be called by the implementor of the action. Users
28074 * of the action should not attempt to modify its enabled flag.
28081 * g_simple_action_set_state:
28082 * @simple: a #GSimpleAction
28083 * @value: the new #GVariant for the state
28085 * Sets the state of the action.
28087 * This directly updates the 'state' property to the given value.
28089 * This should only be called by the implementor of the action. Users
28090 * of the action should not attempt to directly modify the 'state'
28091 * property. Instead, they should call g_action_change_state() to
28092 * request the change.
28099 * g_simple_async_report_error_in_idle: (skip)
28100 * @object: (allow-none): a #GObject, or %NULL.
28101 * @callback: a #GAsyncReadyCallback.
28102 * @user_data: user data passed to @callback.
28103 * @domain: a #GQuark containing the error domain (usually #G_IO_ERROR).
28104 * @code: a specific error code.
28105 * @format: a formatted error reporting string.
28106 * @...: a list of variables to fill in @format.
28108 * Reports an error in an asynchronous function in an idle function by
28109 * directly setting the contents of the #GAsyncResult with the given error
28115 * g_simple_async_report_gerror_in_idle:
28116 * @object: (allow-none): a #GObject, or %NULL
28117 * @callback: (scope async): a #GAsyncReadyCallback.
28118 * @user_data: (closure): user data passed to @callback.
28119 * @error: the #GError to report
28121 * Reports an error in an idle function. Similar to
28122 * g_simple_async_report_error_in_idle(), but takes a #GError rather
28123 * than building a new one.
28128 * g_simple_async_report_take_gerror_in_idle: (skip)
28129 * @object: (allow-none): a #GObject, or %NULL
28130 * @callback: a #GAsyncReadyCallback.
28131 * @user_data: user data passed to @callback.
28132 * @error: the #GError to report
28134 * Reports an error in an idle function. Similar to
28135 * g_simple_async_report_gerror_in_idle(), but takes over the caller's
28136 * ownership of @error, so the caller does not have to free it any more.
28143 * g_simple_async_result_complete:
28144 * @simple: a #GSimpleAsyncResult.
28146 * Completes an asynchronous I/O job immediately. Must be called in
28147 * the thread where the asynchronous result was to be delivered, as it
28148 * invokes the callback directly. If you are in a different thread use
28149 * g_simple_async_result_complete_in_idle().
28151 * Calling this function takes a reference to @simple for as long as
28152 * is needed to complete the call.
28157 * g_simple_async_result_complete_in_idle:
28158 * @simple: a #GSimpleAsyncResult.
28160 * Completes an asynchronous function in an idle handler in the <link
28161 * linkend="g-main-context-push-thread-default">thread-default main
28162 * loop</link> of the thread that @simple was initially created in
28163 * (and re-pushes that context around the invocation of the callback).
28165 * Calling this function takes a reference to @simple for as long as
28166 * is needed to complete the call.
28171 * g_simple_async_result_get_op_res_gboolean:
28172 * @simple: a #GSimpleAsyncResult.
28174 * Gets the operation result boolean from within the asynchronous result.
28176 * Returns: %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE.
28181 * g_simple_async_result_get_op_res_gpointer: (skip)
28182 * @simple: a #GSimpleAsyncResult.
28184 * Gets a pointer result as returned by the asynchronous function.
28186 * Returns: a pointer from the result.
28191 * g_simple_async_result_get_op_res_gssize:
28192 * @simple: a #GSimpleAsyncResult.
28194 * Gets a gssize from the asynchronous result.
28196 * Returns: a gssize returned from the asynchronous function.
28201 * g_simple_async_result_get_source_tag: (skip)
28202 * @simple: a #GSimpleAsyncResult.
28204 * Gets the source tag for the #GSimpleAsyncResult.
28206 * Returns: a #gpointer to the source object for the #GSimpleAsyncResult.
28211 * g_simple_async_result_is_valid:
28212 * @result: the #GAsyncResult passed to the _finish function.
28213 * @source: the #GObject passed to the _finish function.
28214 * @source_tag: the asynchronous function.
28216 * Ensures that the data passed to the _finish function of an async
28217 * operation is consistent. Three checks are performed.
28219 * First, @result is checked to ensure that it is really a
28220 * #GSimpleAsyncResult. Second, @source is checked to ensure that it
28221 * matches the source object of @result. Third, @source_tag is
28222 * checked to ensure that it is either %NULL (as it is when the result was
28223 * created by g_simple_async_report_error_in_idle() or
28224 * g_simple_async_report_gerror_in_idle()) or equal to the
28225 * @source_tag argument given to g_simple_async_result_new() (which, by
28226 * convention, is a pointer to the _async function corresponding to the
28227 * _finish function from which this function is called).
28229 * Returns: #TRUE if all checks passed or #FALSE if any failed.
28235 * g_simple_async_result_new:
28236 * @source_object: (allow-none): a #GObject, or %NULL.
28237 * @callback: (scope async): a #GAsyncReadyCallback.
28238 * @user_data: (closure): user data passed to @callback.
28239 * @source_tag: the asynchronous function.
28241 * Creates a #GSimpleAsyncResult.
28243 * The common convention is to create the #GSimpleAsyncResult in the
28244 * function that starts the asynchronous operation and use that same
28245 * function as the @source_tag.
28247 * If your operation supports cancellation with #GCancellable (which it
28248 * probably should) then you should provide the user's cancellable to
28249 * g_simple_async_result_set_check_cancellable() immediately after
28250 * this function returns.
28252 * Returns: a #GSimpleAsyncResult.
28257 * g_simple_async_result_new_error:
28258 * @source_object: (allow-none): a #GObject, or %NULL.
28259 * @callback: (scope async): a #GAsyncReadyCallback.
28260 * @user_data: (closure): user data passed to @callback.
28261 * @domain: a #GQuark.
28262 * @code: an error code.
28263 * @format: a string with format characters.
28264 * @...: a list of values to insert into @format.
28266 * Creates a new #GSimpleAsyncResult with a set error.
28268 * Returns: a #GSimpleAsyncResult.
28273 * g_simple_async_result_new_from_error:
28274 * @source_object: (allow-none): a #GObject, or %NULL.
28275 * @callback: (scope async): a #GAsyncReadyCallback.
28276 * @user_data: (closure): user data passed to @callback.
28277 * @error: a #GError
28279 * Creates a #GSimpleAsyncResult from an error condition.
28281 * Returns: a #GSimpleAsyncResult.
28286 * g_simple_async_result_new_take_error: (skip)
28287 * @source_object: (allow-none): a #GObject, or %NULL
28288 * @callback: (scope async): a #GAsyncReadyCallback
28289 * @user_data: (closure): user data passed to @callback
28290 * @error: a #GError
28292 * Creates a #GSimpleAsyncResult from an error condition, and takes over the
28293 * caller's ownership of @error, so the caller does not need to free it anymore.
28295 * Returns: a #GSimpleAsyncResult
28301 * g_simple_async_result_propagate_error:
28302 * @simple: a #GSimpleAsyncResult.
28303 * @dest: (out): a location to propagate the error to.
28305 * Propagates an error from within the simple asynchronous result to
28306 * a given destination.
28308 * If the #GCancellable given to a prior call to
28309 * g_simple_async_result_set_check_cancellable() is cancelled then this
28310 * function will return %TRUE with @dest set appropriately.
28312 * Returns: %TRUE if the error was propagated to @dest. %FALSE otherwise.
28317 * g_simple_async_result_run_in_thread: (skip)
28318 * @simple: a #GSimpleAsyncResult.
28319 * @func: a #GSimpleAsyncThreadFunc.
28320 * @io_priority: the io priority of the request.
28321 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28323 * Runs the asynchronous job in a separate thread and then calls
28324 * g_simple_async_result_complete_in_idle() on @simple to return
28325 * the result to the appropriate main loop.
28327 * Calling this function takes a reference to @simple for as long as
28328 * is needed to run the job and report its completion.
28333 * g_simple_async_result_set_check_cancellable:
28334 * @simple: a #GSimpleAsyncResult
28335 * @check_cancellable: (allow-none): a #GCancellable to check, or %NULL to unset
28337 * Sets a #GCancellable to check before dispatching results.
28339 * This function has one very specific purpose: the provided cancellable
28340 * is checked at the time of g_simple_async_result_propagate_error() If
28341 * it is cancelled, these functions will return an "Operation was
28342 * cancelled" error (%G_IO_ERROR_CANCELLED).
28344 * Implementors of cancellable asynchronous functions should use this in
28345 * order to provide a guarantee to their callers that cancelling an
28346 * async operation will reliably result in an error being returned for
28347 * that operation (even if a positive result for the operation has
28348 * already been sent as an idle to the main context to be dispatched).
28350 * The checking described above is done regardless of any call to the
28351 * unrelated g_simple_async_result_set_handle_cancellation() function.
28358 * g_simple_async_result_set_error: (skip)
28359 * @simple: a #GSimpleAsyncResult.
28360 * @domain: a #GQuark (usually #G_IO_ERROR).
28361 * @code: an error code.
28362 * @format: a formatted error reporting string.
28363 * @...: a list of variables to fill in @format.
28365 * Sets an error within the asynchronous result without a #GError.
28370 * g_simple_async_result_set_error_va: (skip)
28371 * @simple: a #GSimpleAsyncResult.
28372 * @domain: a #GQuark (usually #G_IO_ERROR).
28373 * @code: an error code.
28374 * @format: a formatted error reporting string.
28375 * @args: va_list of arguments.
28377 * Sets an error within the asynchronous result without a #GError.
28378 * Unless writing a binding, see g_simple_async_result_set_error().
28383 * g_simple_async_result_set_from_error:
28384 * @simple: a #GSimpleAsyncResult.
28387 * Sets the result from a #GError.
28392 * g_simple_async_result_set_handle_cancellation:
28393 * @simple: a #GSimpleAsyncResult.
28394 * @handle_cancellation: a #gboolean.
28396 * Sets whether to handle cancellation within the asynchronous operation.
28398 * This function has nothing to do with
28399 * g_simple_async_result_set_check_cancellable(). It only refers to the
28400 * #GCancellable passed to g_simple_async_result_run_in_thread().
28405 * g_simple_async_result_set_op_res_gboolean:
28406 * @simple: a #GSimpleAsyncResult.
28407 * @op_res: a #gboolean.
28409 * Sets the operation result to a boolean within the asynchronous result.
28414 * g_simple_async_result_set_op_res_gpointer: (skip)
28415 * @simple: a #GSimpleAsyncResult.
28416 * @op_res: a pointer result from an asynchronous function.
28417 * @destroy_op_res: a #GDestroyNotify function.
28419 * Sets the operation result within the asynchronous result to a pointer.
28424 * g_simple_async_result_set_op_res_gssize:
28425 * @simple: a #GSimpleAsyncResult.
28426 * @op_res: a #gssize.
28428 * Sets the operation result within the asynchronous result to
28429 * the given @op_res.
28434 * g_simple_async_result_take_error: (skip)
28435 * @simple: a #GSimpleAsyncResult
28436 * @error: a #GError
28438 * Sets the result from @error, and takes over the caller's ownership
28439 * of @error, so the caller does not need to free it any more.
28446 * g_simple_permission_new:
28447 * @allowed: %TRUE if the action is allowed
28449 * Creates a new #GPermission instance that represents an action that is
28450 * either always or never allowed.
28452 * Returns: the #GSimplePermission, as a #GPermission
28459 * @socket: a #GSocket.
28460 * @cancellable: (allow-none): a %GCancellable or %NULL
28461 * @error: #GError for error reporting, or %NULL to ignore.
28463 * Accept incoming connections on a connection-based socket. This removes
28464 * the first outstanding connection request from the listening socket and
28465 * creates a #GSocket object for it.
28467 * The @socket must be bound to a local address with g_socket_bind() and
28468 * must be listening for incoming connections (g_socket_listen()).
28470 * If there are no outstanding connections then the operation will block
28471 * or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
28472 * To be notified of an incoming connection, wait for the %G_IO_IN condition.
28474 * Returns: (transfer full): a new #GSocket, or %NULL on error. Free the returned object with g_object_unref().
28480 * g_socket_address_enumerator_next:
28481 * @enumerator: a #GSocketAddressEnumerator
28482 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28483 * @error: a #GError.
28485 * Retrieves the next #GSocketAddress from @enumerator. Note that this
28486 * may block for some amount of time. (Eg, a #GNetworkAddress may need
28487 * to do a DNS lookup before it can return an address.) Use
28488 * g_socket_address_enumerator_next_async() if you need to avoid
28491 * If @enumerator is expected to yield addresses, but for some reason
28492 * is unable to (eg, because of a DNS error), then the first call to
28493 * g_socket_address_enumerator_next() will return an appropriate error
28494 * in *@error. However, if the first call to
28495 * g_socket_address_enumerator_next() succeeds, then any further
28496 * internal errors (other than @cancellable being triggered) will be
28499 * 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.
28504 * g_socket_address_enumerator_next_async:
28505 * @enumerator: a #GSocketAddressEnumerator
28506 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28507 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
28508 * @user_data: (closure): the data to pass to callback function
28510 * Asynchronously retrieves the next #GSocketAddress from @enumerator
28511 * and then calls @callback, which must call
28512 * g_socket_address_enumerator_next_finish() to get the result.
28517 * g_socket_address_enumerator_next_finish:
28518 * @enumerator: a #GSocketAddressEnumerator
28519 * @result: a #GAsyncResult
28520 * @error: a #GError
28522 * Retrieves the result of a completed call to
28523 * g_socket_address_enumerator_next_async(). See
28524 * g_socket_address_enumerator_next() for more information about
28527 * 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.
28532 * g_socket_address_get_family:
28533 * @address: a #GSocketAddress
28535 * Gets the socket family type of @address.
28537 * Returns: the socket family type of @address.
28543 * g_socket_address_get_native_size:
28544 * @address: a #GSocketAddress
28546 * Gets the size of @address's native <type>struct sockaddr</type>.
28547 * You can use this to allocate memory to pass to
28548 * g_socket_address_to_native().
28550 * Returns: the size of the native <type>struct sockaddr</type> that @address represents
28556 * g_socket_address_new_from_native:
28557 * @native: a pointer to a <type>struct sockaddr</type>
28558 * @len: the size of the memory location pointed to by @native
28560 * Creates a #GSocketAddress subclass corresponding to the native
28561 * <type>struct sockaddr</type> @native.
28563 * Returns: a new #GSocketAddress if @native could successfully be converted, otherwise %NULL.
28569 * g_socket_address_to_native:
28570 * @address: a #GSocketAddress
28571 * @dest: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
28572 * @destlen: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
28573 * @error: #GError for error reporting, or %NULL to ignore.
28575 * Converts a #GSocketAddress to a native <type>struct
28576 * sockaddr</type>, which can be passed to low-level functions like
28577 * connect() or bind().
28579 * If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
28580 * returned. If the address type is not known on the system
28581 * then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
28583 * Returns: %TRUE if @dest was filled in, %FALSE on error
28590 * @socket: a #GSocket.
28591 * @address: a #GSocketAddress specifying the local address.
28592 * @allow_reuse: whether to allow reusing this address
28593 * @error: #GError for error reporting, or %NULL to ignore.
28595 * When a socket is created it is attached to an address family, but it
28596 * doesn't have an address in this family. g_socket_bind() assigns the
28597 * address (sometimes called name) of the socket.
28599 * It is generally required to bind to a local address before you can
28600 * receive connections. (See g_socket_listen() and g_socket_accept() ).
28601 * In certain situations, you may also want to bind a socket that will be
28602 * used to initiate connections, though this is not normally required.
28604 * @allow_reuse should be %TRUE for server sockets (sockets that you will
28605 * eventually call g_socket_accept() on), and %FALSE for client sockets.
28606 * (Specifically, if it is %TRUE, then g_socket_bind() will set the
28607 * %SO_REUSEADDR flag on the socket, allowing it to bind @address even if
28608 * that address was previously used by another socket that has not yet been
28609 * fully cleaned-up by the kernel. Failing to set this flag on a server
28610 * socket may cause the bind call to return %G_IO_ERROR_ADDRESS_IN_USE if
28611 * the server program is stopped and then immediately restarted.)
28613 * Returns: %TRUE on success, %FALSE on error.
28619 * g_socket_check_connect_result:
28620 * @socket: a #GSocket
28621 * @error: #GError for error reporting, or %NULL to ignore.
28623 * Checks and resets the pending connect error for the socket.
28624 * This is used to check for errors when g_socket_connect() is
28625 * used in non-blocking mode.
28627 * Returns: %TRUE if no error, %FALSE otherwise, setting @error to the error
28633 * g_socket_client_add_application_proxy:
28634 * @client: a #GSocketClient
28635 * @protocol: The proxy protocol
28637 * Enable proxy protocols to be handled by the application. When the
28638 * indicated proxy protocol is returned by the #GProxyResolver,
28639 * #GSocketClient will consider this protocol as supported but will
28640 * not try to find a #GProxy instance to handle handshaking. The
28641 * application must check for this case by calling
28642 * g_socket_connection_get_remote_address() on the returned
28643 * #GSocketConnection, and seeing if it's a #GProxyAddress of the
28644 * appropriate type, to determine whether or not it needs to handle
28645 * the proxy handshaking itself.
28647 * This should be used for proxy protocols that are dialects of
28648 * another protocol such as HTTP proxy. It also allows cohabitation of
28649 * proxy protocols that are reused between protocols. A good example
28650 * is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
28651 * be use as generic socket proxy through the HTTP CONNECT method.
28653 * When the proxy is detected as being an application proxy, TLS handshake
28654 * will be skipped. This is required to let the application do the proxy
28655 * specific handshake.
28660 * g_socket_client_connect:
28661 * @client: a #GSocketClient.
28662 * @connectable: a #GSocketConnectable specifying the remote address.
28663 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28664 * @error: #GError for error reporting, or %NULL to ignore.
28666 * Tries to resolve the @connectable and make a network connection to it.
28668 * Upon a successful connection, a new #GSocketConnection is constructed
28669 * and returned. The caller owns this new object and must drop their
28670 * reference to it when finished with it.
28672 * The type of the #GSocketConnection object returned depends on the type of
28673 * the underlying socket that is used. For instance, for a TCP/IP connection
28674 * it will be a #GTcpConnection.
28676 * The socket created will be the same family as the address that the
28677 * @connectable resolves to, unless family is set with g_socket_client_set_family()
28678 * or indirectly via g_socket_client_set_local_address(). The socket type
28679 * defaults to %G_SOCKET_TYPE_STREAM but can be set with
28680 * g_socket_client_set_socket_type().
28682 * If a local address is specified with g_socket_client_set_local_address() the
28683 * socket will be bound to this address before connecting.
28685 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28691 * g_socket_client_connect_async:
28692 * @client: a #GSocketClient
28693 * @connectable: a #GSocketConnectable specifying the remote address.
28694 * @cancellable: (allow-none): a #GCancellable, or %NULL
28695 * @callback: (scope async): a #GAsyncReadyCallback
28696 * @user_data: (closure): user data for the callback
28698 * This is the asynchronous version of g_socket_client_connect().
28700 * When the operation is finished @callback will be
28701 * called. You can then call g_socket_client_connect_finish() to get
28702 * the result of the operation.
28709 * g_socket_client_connect_finish:
28710 * @client: a #GSocketClient.
28711 * @result: a #GAsyncResult.
28712 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28714 * Finishes an async connect operation. See g_socket_client_connect_async()
28716 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28722 * g_socket_client_connect_to_host:
28723 * @client: a #GSocketClient
28724 * @host_and_port: the name and optionally port of the host to connect to
28725 * @default_port: the default port to connect to
28726 * @cancellable: (allow-none): a #GCancellable, or %NULL
28727 * @error: a pointer to a #GError, or %NULL
28729 * This is a helper function for g_socket_client_connect().
28731 * Attempts to create a TCP connection to the named host.
28733 * @host_and_port may be in any of a number of recognized formats; an IPv6
28734 * address, an IPv4 address, or a domain name (in which case a DNS
28735 * lookup is performed). Quoting with [] is supported for all address
28736 * types. A port override may be specified in the usual way with a
28737 * colon. Ports may be given as decimal numbers or symbolic names (in
28738 * which case an /etc/services lookup is performed).
28740 * If no port override is given in @host_and_port then @default_port will be
28741 * used as the port number to connect to.
28743 * In general, @host_and_port is expected to be provided by the user (allowing
28744 * them to give the hostname, and a port override if necessary) and
28745 * @default_port is expected to be provided by the application.
28747 * In the case that an IP address is given, a single connection
28748 * attempt is made. In the case that a name is given, multiple
28749 * connection attempts may be made, in turn and according to the
28750 * number of address records in DNS, until a connection succeeds.
28752 * Upon a successful connection, a new #GSocketConnection is constructed
28753 * and returned. The caller owns this new object and must drop their
28754 * reference to it when finished with it.
28756 * In the event of any failure (DNS error, service not found, no hosts
28757 * connectable) %NULL is returned and @error (if non-%NULL) is set
28760 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28766 * g_socket_client_connect_to_host_async:
28767 * @client: a #GSocketClient
28768 * @host_and_port: the name and optionally the port of the host to connect to
28769 * @default_port: the default port to connect to
28770 * @cancellable: (allow-none): a #GCancellable, or %NULL
28771 * @callback: (scope async): a #GAsyncReadyCallback
28772 * @user_data: (closure): user data for the callback
28774 * This is the asynchronous version of g_socket_client_connect_to_host().
28776 * When the operation is finished @callback will be
28777 * called. You can then call g_socket_client_connect_to_host_finish() to get
28778 * the result of the operation.
28785 * g_socket_client_connect_to_host_finish:
28786 * @client: a #GSocketClient.
28787 * @result: a #GAsyncResult.
28788 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28790 * Finishes an async connect operation. See g_socket_client_connect_to_host_async()
28792 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28798 * g_socket_client_connect_to_service:
28799 * @client: a #GSocketConnection
28800 * @domain: a domain name
28801 * @service: the name of the service to connect to
28802 * @cancellable: (allow-none): a #GCancellable, or %NULL
28803 * @error: a pointer to a #GError, or %NULL
28805 * Attempts to create a TCP connection to a service.
28807 * This call looks up the SRV record for @service at @domain for the
28808 * "tcp" protocol. It then attempts to connect, in turn, to each of
28809 * the hosts providing the service until either a connection succeeds
28810 * or there are no hosts remaining.
28812 * Upon a successful connection, a new #GSocketConnection is constructed
28813 * and returned. The caller owns this new object and must drop their
28814 * reference to it when finished with it.
28816 * In the event of any failure (DNS error, service not found, no hosts
28817 * connectable) %NULL is returned and @error (if non-%NULL) is set
28820 * Returns: (transfer full): a #GSocketConnection if successful, or %NULL on error
28825 * g_socket_client_connect_to_service_async:
28826 * @client: a #GSocketClient
28827 * @domain: a domain name
28828 * @service: the name of the service to connect to
28829 * @cancellable: (allow-none): a #GCancellable, or %NULL
28830 * @callback: (scope async): a #GAsyncReadyCallback
28831 * @user_data: (closure): user data for the callback
28833 * This is the asynchronous version of
28834 * g_socket_client_connect_to_service().
28841 * g_socket_client_connect_to_service_finish:
28842 * @client: a #GSocketClient.
28843 * @result: a #GAsyncResult.
28844 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28846 * Finishes an async connect operation. See g_socket_client_connect_to_service_async()
28848 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28854 * g_socket_client_connect_to_uri:
28855 * @client: a #GSocketClient
28856 * @uri: A network URI
28857 * @default_port: the default port to connect to
28858 * @cancellable: (allow-none): a #GCancellable, or %NULL
28859 * @error: a pointer to a #GError, or %NULL
28861 * This is a helper function for g_socket_client_connect().
28863 * Attempts to create a TCP connection with a network URI.
28865 * @uri may be any valid URI containing an "authority" (hostname/port)
28866 * component. If a port is not specified in the URI, @default_port
28867 * will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
28868 * (#GSocketClient does not know to automatically assume TLS for
28869 * certain URI schemes.)
28871 * Using this rather than g_socket_client_connect() or
28872 * g_socket_client_connect_to_host() allows #GSocketClient to
28873 * determine when to use application-specific proxy protocols.
28875 * Upon a successful connection, a new #GSocketConnection is constructed
28876 * and returned. The caller owns this new object and must drop their
28877 * reference to it when finished with it.
28879 * In the event of any failure (DNS error, service not found, no hosts
28880 * connectable) %NULL is returned and @error (if non-%NULL) is set
28883 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28889 * g_socket_client_connect_to_uri_async:
28890 * @client: a #GSocketClient
28891 * @uri: a network uri
28892 * @default_port: the default port to connect to
28893 * @cancellable: (allow-none): a #GCancellable, or %NULL
28894 * @callback: (scope async): a #GAsyncReadyCallback
28895 * @user_data: (closure): user data for the callback
28897 * This is the asynchronous version of g_socket_client_connect_to_uri().
28899 * When the operation is finished @callback will be
28900 * called. You can then call g_socket_client_connect_to_uri_finish() to get
28901 * the result of the operation.
28908 * g_socket_client_connect_to_uri_finish:
28909 * @client: a #GSocketClient.
28910 * @result: a #GAsyncResult.
28911 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28913 * Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
28915 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28921 * g_socket_client_get_enable_proxy:
28922 * @client: a #GSocketClient.
28924 * Gets the proxy enable state; see g_socket_client_set_enable_proxy()
28926 * Returns: whether proxying is enabled
28932 * g_socket_client_get_family:
28933 * @client: a #GSocketClient.
28935 * Gets the socket family of the socket client.
28937 * See g_socket_client_set_family() for details.
28939 * Returns: a #GSocketFamily
28945 * g_socket_client_get_local_address:
28946 * @client: a #GSocketClient.
28948 * Gets the local address of the socket client.
28950 * See g_socket_client_set_local_address() for details.
28952 * Returns: (transfer none): a #GSocketAddress or %NULL. Do not free.
28958 * g_socket_client_get_protocol:
28959 * @client: a #GSocketClient
28961 * Gets the protocol name type of the socket client.
28963 * See g_socket_client_set_protocol() for details.
28965 * Returns: a #GSocketProtocol
28971 * g_socket_client_get_socket_type:
28972 * @client: a #GSocketClient.
28974 * Gets the socket type of the socket client.
28976 * See g_socket_client_set_socket_type() for details.
28978 * Returns: a #GSocketFamily
28984 * g_socket_client_get_timeout:
28985 * @client: a #GSocketClient
28987 * Gets the I/O timeout time for sockets created by @client.
28989 * See g_socket_client_set_timeout() for details.
28991 * Returns: the timeout in seconds
28997 * g_socket_client_get_tls:
28998 * @client: a #GSocketClient.
29000 * Gets whether @client creates TLS connections. See
29001 * g_socket_client_set_tls() for details.
29003 * Returns: whether @client uses TLS
29009 * g_socket_client_get_tls_validation_flags:
29010 * @client: a #GSocketClient.
29012 * Gets the TLS validation flags used creating TLS connections via
29015 * Returns: the TLS validation flags
29021 * g_socket_client_new:
29023 * Creates a new #GSocketClient with the default options.
29025 * Returns: a #GSocketClient. Free the returned object with g_object_unref().
29031 * g_socket_client_set_enable_proxy:
29032 * @client: a #GSocketClient.
29033 * @enable: whether to enable proxies
29035 * Sets whether or not @client attempts to make connections via a
29036 * proxy server. When enabled (the default), #GSocketClient will use a
29037 * #GProxyResolver to determine if a proxy protocol such as SOCKS is
29038 * needed, and automatically do the necessary proxy negotiation.
29045 * g_socket_client_set_family:
29046 * @client: a #GSocketClient.
29047 * @family: a #GSocketFamily
29049 * Sets the socket family of the socket client.
29050 * If this is set to something other than %G_SOCKET_FAMILY_INVALID
29051 * then the sockets created by this object will be of the specified
29054 * This might be useful for instance if you want to force the local
29055 * connection to be an ipv4 socket, even though the address might
29056 * be an ipv6 mapped to ipv4 address.
29063 * g_socket_client_set_local_address:
29064 * @client: a #GSocketClient.
29065 * @address: (allow-none): a #GSocketAddress, or %NULL
29067 * Sets the local address of the socket client.
29068 * The sockets created by this object will bound to the
29069 * specified address (if not %NULL) before connecting.
29071 * This is useful if you want to ensure that the local
29072 * side of the connection is on a specific port, or on
29073 * a specific interface.
29080 * g_socket_client_set_protocol:
29081 * @client: a #GSocketClient.
29082 * @protocol: a #GSocketProtocol
29084 * Sets the protocol of the socket client.
29085 * The sockets created by this object will use of the specified
29088 * If @protocol is %0 that means to use the default
29089 * protocol for the socket family and type.
29096 * g_socket_client_set_socket_type:
29097 * @client: a #GSocketClient.
29098 * @type: a #GSocketType
29100 * Sets the socket type of the socket client.
29101 * The sockets created by this object will be of the specified
29104 * It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
29105 * as GSocketClient is used for connection oriented services.
29112 * g_socket_client_set_timeout:
29113 * @client: a #GSocketClient.
29114 * @timeout: the timeout
29116 * Sets the I/O timeout for sockets created by @client. @timeout is a
29117 * time in seconds, or 0 for no timeout (the default).
29119 * The timeout value affects the initial connection attempt as well,
29120 * so setting this may cause calls to g_socket_client_connect(), etc,
29121 * to fail with %G_IO_ERROR_TIMED_OUT.
29128 * g_socket_client_set_tls:
29129 * @client: a #GSocketClient.
29130 * @tls: whether to use TLS
29132 * Sets whether @client creates TLS (aka SSL) connections. If @tls is
29133 * %TRUE, @client will wrap its connections in a #GTlsClientConnection
29134 * and perform a TLS handshake when connecting.
29136 * Note that since #GSocketClient must return a #GSocketConnection,
29137 * but #GTlsClientConnection is not a #GSocketConnection, this
29138 * actually wraps the resulting #GTlsClientConnection in a
29139 * #GTcpWrapperConnection when returning it. You can use
29140 * g_tcp_wrapper_connection_get_base_io_stream() on the return value
29141 * to extract the #GTlsClientConnection.
29143 * If you need to modify the behavior of the TLS handshake (eg, by
29144 * setting a client-side certificate to use, or connecting to the
29145 * #GTlsConnection::accept-certificate signal), you can connect to
29146 * @client's #GSocketClient::event signal and wait for it to be
29147 * emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
29148 * a chance to see the #GTlsClientConnection before the handshake
29156 * g_socket_client_set_tls_validation_flags:
29157 * @client: a #GSocketClient.
29158 * @flags: the validation flags
29160 * Sets the TLS validation flags used when creating TLS connections
29161 * via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
29169 * @socket: a #GSocket
29170 * @error: #GError for error reporting, or %NULL to ignore.
29172 * Closes the socket, shutting down any active connection.
29174 * Closing a socket does not wait for all outstanding I/O operations
29175 * to finish, so the caller should not rely on them to be guaranteed
29176 * to complete even if the close returns with no error.
29178 * Once the socket is closed, all other operations will return
29179 * %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
29182 * Sockets will be automatically closed when the last reference
29183 * is dropped, but you might want to call this function to make sure
29184 * resources are released as early as possible.
29186 * Beware that due to the way that TCP works, it is possible for
29187 * recently-sent data to be lost if either you close a socket while the
29188 * %G_IO_IN condition is set, or else if the remote connection tries to
29189 * send something to you after you close the socket but before it has
29190 * finished reading all of the data you sent. There is no easy generic
29191 * way to avoid this problem; the easiest fix is to design the network
29192 * protocol such that the client will never send data "out of turn".
29193 * Another solution is for the server to half-close the connection by
29194 * calling g_socket_shutdown() with only the @shutdown_write flag set,
29195 * and then wait for the client to notice this and close its side of the
29196 * connection, after which the server can safely call g_socket_close().
29197 * (This is what #GTcpConnection does if you call
29198 * g_tcp_connection_set_graceful_disconnect(). But of course, this
29199 * only works if the client will close its connection after the server
29202 * Returns: %TRUE on success, %FALSE on error
29208 * g_socket_condition_check:
29209 * @socket: a #GSocket
29210 * @condition: a #GIOCondition mask to check
29212 * Checks on the readiness of @socket to perform operations.
29213 * The operations specified in @condition are checked for and masked
29214 * against the currently-satisfied conditions on @socket. The result
29217 * Note that on Windows, it is possible for an operation to return
29218 * %G_IO_ERROR_WOULD_BLOCK even immediately after
29219 * g_socket_condition_check() has claimed that the socket is ready for
29220 * writing. Rather than calling g_socket_condition_check() and then
29221 * writing to the socket if it succeeds, it is generally better to
29222 * simply try writing to the socket right away, and try again later if
29223 * the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
29225 * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
29226 * these conditions will always be set in the output if they are true.
29228 * This call never blocks.
29230 * Returns: the @GIOCondition mask of the current state
29236 * g_socket_condition_timed_wait:
29237 * @socket: a #GSocket
29238 * @condition: a #GIOCondition mask to wait for
29239 * @timeout: the maximum time (in microseconds) to wait, or -1
29240 * @cancellable: (allow-none): a #GCancellable, or %NULL
29241 * @error: a #GError pointer, or %NULL
29243 * Waits for up to @timeout microseconds for @condition to become true
29244 * on @socket. If the condition is met, %TRUE is returned.
29246 * If @cancellable is cancelled before the condition is met, or if
29247 * @timeout (or the socket's #GSocket:timeout) is reached before the
29248 * condition is met, then %FALSE is returned and @error, if non-%NULL,
29249 * is set to the appropriate value (%G_IO_ERROR_CANCELLED or
29250 * %G_IO_ERROR_TIMED_OUT).
29252 * If you don't want a timeout, use g_socket_condition_wait().
29253 * (Alternatively, you can pass -1 for @timeout.)
29255 * Note that although @timeout is in microseconds for consistency with
29256 * other GLib APIs, this function actually only has millisecond
29257 * resolution, and the behavior is undefined if @timeout is not an
29258 * exact number of milliseconds.
29260 * Returns: %TRUE if the condition was met, %FALSE otherwise
29266 * g_socket_condition_wait:
29267 * @socket: a #GSocket
29268 * @condition: a #GIOCondition mask to wait for
29269 * @cancellable: (allow-none): a #GCancellable, or %NULL
29270 * @error: a #GError pointer, or %NULL
29272 * Waits for @condition to become true on @socket. When the condition
29273 * is met, %TRUE is returned.
29275 * If @cancellable is cancelled before the condition is met, or if the
29276 * socket has a timeout set and it is reached before the condition is
29277 * met, then %FALSE is returned and @error, if non-%NULL, is set to
29278 * the appropriate value (%G_IO_ERROR_CANCELLED or
29279 * %G_IO_ERROR_TIMED_OUT).
29281 * See also g_socket_condition_timed_wait().
29283 * Returns: %TRUE if the condition was met, %FALSE otherwise
29289 * g_socket_connect:
29290 * @socket: a #GSocket.
29291 * @address: a #GSocketAddress specifying the remote address.
29292 * @cancellable: (allow-none): a %GCancellable or %NULL
29293 * @error: #GError for error reporting, or %NULL to ignore.
29295 * Connect the socket to the specified remote address.
29297 * For connection oriented socket this generally means we attempt to make
29298 * a connection to the @address. For a connection-less socket it sets
29299 * the default address for g_socket_send() and discards all incoming datagrams
29300 * from other sources.
29302 * Generally connection oriented sockets can only connect once, but
29303 * connection-less sockets can connect multiple times to change the
29306 * If the connect call needs to do network I/O it will block, unless
29307 * non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
29308 * and the user can be notified of the connection finishing by waiting
29309 * for the G_IO_OUT condition. The result of the connection must then be
29310 * checked with g_socket_check_connect_result().
29312 * Returns: %TRUE if connected, %FALSE on error.
29318 * g_socket_connectable_enumerate:
29319 * @connectable: a #GSocketConnectable
29321 * Creates a #GSocketAddressEnumerator for @connectable.
29323 * Returns: (transfer full): a new #GSocketAddressEnumerator.
29329 * g_socket_connectable_proxy_enumerate:
29330 * @connectable: a #GSocketConnectable
29332 * Creates a #GSocketAddressEnumerator for @connectable that will
29333 * return #GProxyAddress<!-- -->es for addresses that you must connect
29336 * If @connectable does not implement
29337 * g_socket_connectable_proxy_enumerate(), this will fall back to
29338 * calling g_socket_connectable_enumerate().
29340 * Returns: (transfer full): a new #GSocketAddressEnumerator.
29346 * g_socket_connection_connect:
29347 * @connection: a #GSocketConnection
29348 * @address: a #GSocketAddress specifying the remote address.
29349 * @cancellable: (allow-none): a %GCancellable or %NULL
29350 * @error: #GError for error reporting, or %NULL to ignore.
29352 * Connect @connection to the specified remote address.
29354 * Returns: %TRUE if the connection succeeded, %FALSE on error
29360 * g_socket_connection_connect_async:
29361 * @connection: a #GSocketConnection
29362 * @address: a #GSocketAddress specifying the remote address.
29363 * @cancellable: (allow-none): a %GCancellable or %NULL
29364 * @callback: (scope async): a #GAsyncReadyCallback
29365 * @user_data: (closure): user data for the callback
29367 * Asynchronously connect @connection to the specified remote address.
29369 * This clears the #GSocket:blocking flag on @connection's underlying
29370 * socket if it is currently set.
29372 * Use g_socket_connection_connect_finish() to retrieve the result.
29379 * g_socket_connection_connect_finish:
29380 * @connection: a #GSocketConnection
29381 * @result: the #GAsyncResult
29382 * @error: #GError for error reporting, or %NULL to ignore.
29384 * Gets the result of a g_socket_connection_connect_async() call.
29386 * Returns: %TRUE if the connection succeeded, %FALSE on error
29392 * g_socket_connection_factory_create_connection:
29393 * @socket: a #GSocket
29395 * Creates a #GSocketConnection subclass of the right type for
29398 * Returns: (transfer full): a #GSocketConnection
29404 * g_socket_connection_factory_lookup_type:
29405 * @family: a #GSocketFamily
29406 * @type: a #GSocketType
29407 * @protocol_id: a protocol id
29409 * Looks up the #GType to be used when creating socket connections on
29410 * sockets with the specified @family, @type and @protocol_id.
29412 * If no type is registered, the #GSocketConnection base type is returned.
29414 * Returns: a #GType
29420 * g_socket_connection_factory_register_type:
29421 * @g_type: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
29422 * @family: a #GSocketFamily
29423 * @type: a #GSocketType
29424 * @protocol: a protocol id
29426 * Looks up the #GType to be used when creating socket connections on
29427 * sockets with the specified @family, @type and @protocol.
29429 * If no type is registered, the #GSocketConnection base type is returned.
29436 * g_socket_connection_get_local_address:
29437 * @connection: a #GSocketConnection
29438 * @error: #GError for error reporting, or %NULL to ignore.
29440 * Try to get the local address of a socket connection.
29442 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29448 * g_socket_connection_get_remote_address:
29449 * @connection: a #GSocketConnection
29450 * @error: #GError for error reporting, or %NULL to ignore.
29452 * Try to get the remote address of a socket connection.
29454 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29460 * g_socket_connection_get_socket:
29461 * @connection: a #GSocketConnection
29463 * Gets the underlying #GSocket object of the connection.
29464 * This can be useful if you want to do something unusual on it
29465 * not supported by the #GSocketConnection APIs.
29467 * Returns: (transfer none): a #GSocketAddress or %NULL on error.
29473 * g_socket_connection_is_connected:
29474 * @connection: a #GSocketConnection
29476 * Checks if @connection is connected. This is equivalent to calling
29477 * g_socket_is_connected() on @connection's underlying #GSocket.
29479 * Returns: whether @connection is connected
29485 * g_socket_control_message_deserialize:
29486 * @level: a socket level
29487 * @type: a socket control message type for the given @level
29488 * @size: the size of the data in bytes
29489 * @data: (array length=size) (element-type guint8): pointer to the message data
29491 * Tries to deserialize a socket control message of a given
29492 * @level and @type. This will ask all known (to GType) subclasses
29493 * of #GSocketControlMessage if they can understand this kind
29494 * of message and if so deserialize it into a #GSocketControlMessage.
29496 * If there is no implementation for this kind of control message, %NULL
29497 * will be returned.
29499 * Returns: (transfer full): the deserialized message or %NULL
29505 * g_socket_control_message_get_level:
29506 * @message: a #GSocketControlMessage
29508 * Returns the "level" (i.e. the originating protocol) of the control message.
29509 * This is often SOL_SOCKET.
29511 * Returns: an integer describing the level
29517 * g_socket_control_message_get_msg_type:
29518 * @message: a #GSocketControlMessage
29520 * Returns the protocol specific type of the control message.
29521 * For instance, for UNIX fd passing this would be SCM_RIGHTS.
29523 * Returns: an integer describing the type of control message
29529 * g_socket_control_message_get_size:
29530 * @message: a #GSocketControlMessage
29532 * Returns the space required for the control message, not including
29533 * headers or alignment.
29535 * Returns: The number of bytes required.
29541 * g_socket_control_message_serialize:
29542 * @message: a #GSocketControlMessage
29543 * @data: A buffer to write data to
29545 * Converts the data in the message to bytes placed in the
29548 * @data is guaranteed to have enough space to fit the size
29549 * returned by g_socket_control_message_get_size() on this
29557 * g_socket_create_source: (skip)
29558 * @socket: a #GSocket
29559 * @condition: a #GIOCondition mask to monitor
29560 * @cancellable: (allow-none): a %GCancellable or %NULL
29562 * Creates a %GSource that can be attached to a %GMainContext to monitor
29563 * for the availibility of the specified @condition on the socket.
29565 * The callback on the source is of the #GSocketSourceFunc type.
29567 * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
29568 * these conditions will always be reported output if they are true.
29570 * @cancellable if not %NULL can be used to cancel the source, which will
29571 * cause the source to trigger, reporting the current condition (which
29572 * is likely 0 unless cancellation happened at the same time as a
29573 * condition change). You can check for this in the callback using
29574 * g_cancellable_is_cancelled().
29576 * If @socket has a timeout set, and it is reached before @condition
29577 * occurs, the source will then trigger anyway, reporting %G_IO_IN or
29578 * %G_IO_OUT depending on @condition. However, @socket will have been
29579 * marked as having had a timeout, and so the next #GSocket I/O method
29580 * you call will then fail with a %G_IO_ERROR_TIMED_OUT.
29582 * Returns: (transfer full): a newly allocated %GSource, free with g_source_unref().
29588 * g_socket_get_available_bytes:
29589 * @socket: a #GSocket
29591 * Get the amount of data pending in the OS input buffer.
29593 * Returns: the number of bytes that can be read from the socket without blocking or -1 on error.
29599 * g_socket_get_blocking:
29600 * @socket: a #GSocket.
29602 * Gets the blocking mode of the socket. For details on blocking I/O,
29603 * see g_socket_set_blocking().
29605 * Returns: %TRUE if blocking I/O is used, %FALSE otherwise.
29611 * g_socket_get_broadcast:
29612 * @socket: a #GSocket.
29614 * Gets the broadcast setting on @socket; if %TRUE,
29615 * it is possible to send packets to broadcast
29616 * addresses or receive from broadcast addresses.
29618 * Returns: the broadcast setting on @socket
29624 * g_socket_get_credentials:
29625 * @socket: a #GSocket.
29626 * @error: #GError for error reporting, or %NULL to ignore.
29628 * Returns the credentials of the foreign process connected to this
29629 * socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
29632 * If this operation isn't supported on the OS, the method fails with
29633 * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
29634 * by reading the %SO_PEERCRED option on the underlying socket.
29636 * Other ways to obtain credentials from a foreign peer includes the
29637 * #GUnixCredentialsMessage type and
29638 * g_unix_connection_send_credentials() /
29639 * g_unix_connection_receive_credentials() functions.
29641 * Returns: (transfer full): %NULL if @error is set, otherwise a #GCredentials object that must be freed with g_object_unref().
29647 * g_socket_get_family:
29648 * @socket: a #GSocket.
29650 * Gets the socket family of the socket.
29652 * Returns: a #GSocketFamily
29659 * @socket: a #GSocket.
29661 * Returns the underlying OS socket object. On unix this
29662 * is a socket file descriptor, and on Windows this is
29663 * a Winsock2 SOCKET handle. This may be useful for
29664 * doing platform specific or otherwise unusual operations
29667 * Returns: the file descriptor of the socket.
29673 * g_socket_get_keepalive:
29674 * @socket: a #GSocket.
29676 * Gets the keepalive mode of the socket. For details on this,
29677 * see g_socket_set_keepalive().
29679 * Returns: %TRUE if keepalive is active, %FALSE otherwise.
29685 * g_socket_get_listen_backlog:
29686 * @socket: a #GSocket.
29688 * Gets the listen backlog setting of the socket. For details on this,
29689 * see g_socket_set_listen_backlog().
29691 * Returns: the maximum number of pending connections.
29697 * g_socket_get_local_address:
29698 * @socket: a #GSocket.
29699 * @error: #GError for error reporting, or %NULL to ignore.
29701 * Try to get the local address of a bound socket. This is only
29702 * useful if the socket has been bound to a local address,
29703 * either explicitly or implicitly when connecting.
29705 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29711 * g_socket_get_multicast_loopback:
29712 * @socket: a #GSocket.
29714 * Gets the multicast loopback setting on @socket; if %TRUE (the
29715 * default), outgoing multicast packets will be looped back to
29716 * multicast listeners on the same host.
29718 * Returns: the multicast loopback setting on @socket
29724 * g_socket_get_multicast_ttl:
29725 * @socket: a #GSocket.
29727 * Gets the multicast time-to-live setting on @socket; see
29728 * g_socket_set_multicast_ttl() for more details.
29730 * Returns: the multicast time-to-live setting on @socket
29736 * g_socket_get_protocol:
29737 * @socket: a #GSocket.
29739 * Gets the socket protocol id the socket was created with.
29740 * In case the protocol is unknown, -1 is returned.
29742 * Returns: a protocol id, or -1 if unknown
29748 * g_socket_get_remote_address:
29749 * @socket: a #GSocket.
29750 * @error: #GError for error reporting, or %NULL to ignore.
29752 * Try to get the remove address of a connected socket. This is only
29753 * useful for connection oriented sockets that have been connected.
29755 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29761 * g_socket_get_socket_type:
29762 * @socket: a #GSocket.
29764 * Gets the socket type of the socket.
29766 * Returns: a #GSocketType
29772 * g_socket_get_timeout:
29773 * @socket: a #GSocket.
29775 * Gets the timeout setting of the socket. For details on this, see
29776 * g_socket_set_timeout().
29778 * Returns: the timeout in seconds
29784 * g_socket_get_ttl:
29785 * @socket: a #GSocket.
29787 * Gets the unicast time-to-live setting on @socket; see
29788 * g_socket_set_ttl() for more details.
29790 * Returns: the time-to-live setting on @socket
29796 * g_socket_is_closed:
29797 * @socket: a #GSocket
29799 * Checks whether a socket is closed.
29801 * Returns: %TRUE if socket is closed, %FALSE otherwise
29807 * g_socket_is_connected:
29808 * @socket: a #GSocket.
29810 * Check whether the socket is connected. This is only useful for
29811 * connection-oriented sockets.
29813 * Returns: %TRUE if socket is connected, %FALSE otherwise.
29819 * g_socket_join_multicast_group:
29820 * @socket: a #GSocket.
29821 * @group: a #GInetAddress specifying the group address to join.
29822 * @iface: (allow-none): Name of the interface to use, or %NULL
29823 * @source_specific: %TRUE if source-specific multicast should be used
29824 * @error: #GError for error reporting, or %NULL to ignore.
29826 * Registers @socket to receive multicast messages sent to @group.
29827 * @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
29828 * been bound to an appropriate interface and port with
29831 * If @iface is %NULL, the system will automatically pick an interface
29832 * to bind to based on @group.
29834 * If @source_specific is %TRUE, source-specific multicast as defined
29835 * in RFC 4604 is used. Note that on older platforms this may fail
29836 * with a %G_IO_ERROR_NOT_SUPPORTED error.
29838 * Returns: %TRUE on success, %FALSE on error.
29844 * g_socket_leave_multicast_group:
29845 * @socket: a #GSocket.
29846 * @group: a #GInetAddress specifying the group address to leave.
29847 * @iface: (allow-none): Interface used
29848 * @source_specific: %TRUE if source-specific multicast was used
29849 * @error: #GError for error reporting, or %NULL to ignore.
29851 * Removes @socket from the multicast group defined by @group, @iface,
29852 * and @source_specific (which must all have the same values they had
29853 * when you joined the group).
29855 * @socket remains bound to its address and port, and can still receive
29856 * unicast messages after calling this.
29858 * Returns: %TRUE on success, %FALSE on error.
29865 * @socket: a #GSocket.
29866 * @error: #GError for error reporting, or %NULL to ignore.
29868 * Marks the socket as a server socket, i.e. a socket that is used
29869 * to accept incoming requests using g_socket_accept().
29871 * Before calling this the socket must be bound to a local address using
29874 * To set the maximum amount of outstanding clients, use
29875 * g_socket_set_listen_backlog().
29877 * Returns: %TRUE on success, %FALSE on error.
29883 * g_socket_listener_accept:
29884 * @listener: a #GSocketListener
29885 * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL
29886 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29887 * @error: #GError for error reporting, or %NULL to ignore.
29889 * Blocks waiting for a client to connect to any of the sockets added
29890 * to the listener. Returns a #GSocketConnection for the socket that was
29893 * If @source_object is not %NULL it will be filled out with the source
29894 * object specified when the corresponding socket or address was added
29897 * If @cancellable is not %NULL, then the operation can be cancelled by
29898 * triggering the cancellable object from another thread. If the operation
29899 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29901 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29907 * g_socket_listener_accept_async:
29908 * @listener: a #GSocketListener
29909 * @cancellable: (allow-none): a #GCancellable, or %NULL
29910 * @callback: (scope async): a #GAsyncReadyCallback
29911 * @user_data: (closure): user data for the callback
29913 * This is the asynchronous version of g_socket_listener_accept().
29915 * When the operation is finished @callback will be
29916 * called. You can then call g_socket_listener_accept_socket()
29917 * to get the result of the operation.
29924 * g_socket_listener_accept_finish:
29925 * @listener: a #GSocketListener
29926 * @result: a #GAsyncResult.
29927 * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29928 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29930 * Finishes an async accept operation. See g_socket_listener_accept_async()
29932 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29938 * g_socket_listener_accept_socket:
29939 * @listener: a #GSocketListener
29940 * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL.
29941 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29942 * @error: #GError for error reporting, or %NULL to ignore.
29944 * Blocks waiting for a client to connect to any of the sockets added
29945 * to the listener. Returns the #GSocket that was accepted.
29947 * If you want to accept the high-level #GSocketConnection, not a #GSocket,
29948 * which is often the case, then you should use g_socket_listener_accept()
29951 * If @source_object is not %NULL it will be filled out with the source
29952 * object specified when the corresponding socket or address was added
29955 * If @cancellable is not %NULL, then the operation can be cancelled by
29956 * triggering the cancellable object from another thread. If the operation
29957 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29959 * Returns: (transfer full): a #GSocket on success, %NULL on error.
29965 * g_socket_listener_accept_socket_async:
29966 * @listener: a #GSocketListener
29967 * @cancellable: (allow-none): a #GCancellable, or %NULL
29968 * @callback: (scope async): a #GAsyncReadyCallback
29969 * @user_data: (closure): user data for the callback
29971 * This is the asynchronous version of g_socket_listener_accept_socket().
29973 * When the operation is finished @callback will be
29974 * called. You can then call g_socket_listener_accept_socket_finish()
29975 * to get the result of the operation.
29982 * g_socket_listener_accept_socket_finish:
29983 * @listener: a #GSocketListener
29984 * @result: a #GAsyncResult.
29985 * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29986 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29988 * Finishes an async accept operation. See g_socket_listener_accept_socket_async()
29990 * Returns: (transfer full): a #GSocket on success, %NULL on error.
29996 * g_socket_listener_add_address:
29997 * @listener: a #GSocketListener
29998 * @address: a #GSocketAddress
29999 * @type: a #GSocketType
30000 * @protocol: a #GSocketProtocol
30001 * @source_object: (allow-none): Optional #GObject identifying this source
30002 * @effective_address: (out) (allow-none): location to store the address that was bound to, or %NULL.
30003 * @error: #GError for error reporting, or %NULL to ignore.
30005 * Creates a socket of type @type and protocol @protocol, binds
30006 * it to @address and adds it to the set of sockets we're accepting
30009 * Note that adding an IPv6 address, depending on the platform,
30010 * may or may not result in a listener that also accepts IPv4
30011 * connections. For more deterministic behavior, see
30012 * g_socket_listener_add_inet_port().
30014 * @source_object will be passed out in the various calls
30015 * to accept to identify this particular source, which is
30016 * useful if you're listening on multiple addresses and do
30017 * different things depending on what address is connected to.
30019 * If successful and @effective_address is non-%NULL then it will
30020 * be set to the address that the binding actually occurred at. This
30021 * is helpful for determining the port number that was used for when
30022 * requesting a binding to port 0 (ie: "any port"). This address, if
30023 * requested, belongs to the caller and must be freed.
30025 * Returns: %TRUE on success, %FALSE on error.
30031 * g_socket_listener_add_any_inet_port:
30032 * @listener: a #GSocketListener
30033 * @source_object: (allow-none): Optional #GObject identifying this source
30034 * @error: a #GError location to store the error occurring, or %NULL to ignore.
30036 * Listens for TCP connections on any available port number for both
30037 * IPv6 and IPv4 (if each is available).
30039 * This is useful if you need to have a socket for incoming connections
30040 * but don't care about the specific port number.
30042 * @source_object will be passed out in the various calls
30043 * to accept to identify this particular source, which is
30044 * useful if you're listening on multiple addresses and do
30045 * different things depending on what address is connected to.
30047 * Returns: the port number, or 0 in case of failure.
30053 * g_socket_listener_add_inet_port:
30054 * @listener: a #GSocketListener
30055 * @port: an IP port number (non-zero)
30056 * @source_object: (allow-none): Optional #GObject identifying this source
30057 * @error: #GError for error reporting, or %NULL to ignore.
30059 * Helper function for g_socket_listener_add_address() that
30060 * creates a TCP/IP socket listening on IPv4 and IPv6 (if
30061 * supported) on the specified port on all interfaces.
30063 * @source_object will be passed out in the various calls
30064 * to accept to identify this particular source, which is
30065 * useful if you're listening on multiple addresses and do
30066 * different things depending on what address is connected to.
30068 * Returns: %TRUE on success, %FALSE on error.
30074 * g_socket_listener_add_socket:
30075 * @listener: a #GSocketListener
30076 * @socket: a listening #GSocket
30077 * @source_object: (allow-none): Optional #GObject identifying this source
30078 * @error: #GError for error reporting, or %NULL to ignore.
30080 * Adds @socket to the set of sockets that we try to accept
30081 * new clients from. The socket must be bound to a local
30082 * address and listened to.
30084 * @source_object will be passed out in the various calls
30085 * to accept to identify this particular source, which is
30086 * useful if you're listening on multiple addresses and do
30087 * different things depending on what address is connected to.
30089 * Returns: %TRUE on success, %FALSE on error.
30095 * g_socket_listener_close:
30096 * @listener: a #GSocketListener
30098 * Closes all the sockets in the listener.
30105 * g_socket_listener_new:
30107 * Creates a new #GSocketListener with no sockets to listen for.
30108 * New listeners can be added with e.g. g_socket_listener_add_address()
30109 * or g_socket_listener_add_inet_port().
30111 * Returns: a new #GSocketListener.
30117 * g_socket_listener_set_backlog:
30118 * @listener: a #GSocketListener
30119 * @listen_backlog: an integer
30121 * Sets the listen backlog on the sockets in the listener.
30123 * See g_socket_set_listen_backlog() for details
30131 * @family: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
30132 * @type: the socket type to use.
30133 * @protocol: the id of the protocol to use, or 0 for default.
30134 * @error: #GError for error reporting, or %NULL to ignore.
30136 * Creates a new #GSocket with the defined family, type and protocol.
30137 * If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
30138 * for the family and type is used.
30140 * The @protocol is a family and type specific int that specifies what
30141 * kind of protocol to use. #GSocketProtocol lists several common ones.
30142 * Many families only support one protocol, and use 0 for this, others
30143 * support several and using 0 means to use the default protocol for
30144 * the family and type.
30146 * The protocol id is passed directly to the operating
30147 * system, so you can use protocols not listed in #GSocketProtocol if you
30148 * know the protocol number used for it.
30150 * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
30156 * g_socket_new_from_fd:
30157 * @fd: a native socket file descriptor.
30158 * @error: #GError for error reporting, or %NULL to ignore.
30160 * Creates a new #GSocket from a native file descriptor
30161 * or winsock SOCKET handle.
30163 * This reads all the settings from the file descriptor so that
30164 * all properties should work. Note that the file descriptor
30165 * will be set to non-blocking mode, independent on the blocking
30166 * mode of the #GSocket.
30168 * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
30174 * g_socket_receive:
30175 * @socket: a #GSocket
30176 * @buffer: a buffer to read data into (which should be at least @size bytes long).
30177 * @size: the number of bytes you want to read from the socket
30178 * @cancellable: (allow-none): a %GCancellable or %NULL
30179 * @error: #GError for error reporting, or %NULL to ignore.
30181 * Receive data (up to @size bytes) from a socket. This is mainly used by
30182 * connection-oriented sockets; it is identical to g_socket_receive_from()
30183 * with @address set to %NULL.
30185 * For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
30186 * g_socket_receive() will always read either 0 or 1 complete messages from
30187 * the socket. If the received message is too large to fit in @buffer, then
30188 * the data beyond @size bytes will be discarded, without any explicit
30189 * indication that this has occurred.
30191 * For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
30192 * number of bytes, up to @size. If more than @size bytes have been
30193 * received, the additional data will be returned in future calls to
30194 * g_socket_receive().
30196 * If the socket is in blocking mode the call will block until there
30197 * is some data to receive, the connection is closed, or there is an
30198 * error. If there is no data available and the socket is in
30199 * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
30200 * returned. To be notified when data is available, wait for the
30201 * %G_IO_IN condition.
30203 * On error -1 is returned and @error is set accordingly.
30205 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30211 * g_socket_receive_from:
30212 * @socket: a #GSocket
30213 * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
30214 * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
30215 * @size: the number of bytes you want to read from the socket
30216 * @cancellable: (allow-none): a %GCancellable or %NULL
30217 * @error: #GError for error reporting, or %NULL to ignore.
30219 * Receive data (up to @size bytes) from a socket.
30221 * If @address is non-%NULL then @address will be set equal to the
30222 * source address of the received packet.
30223 * @address is owned by the caller.
30225 * See g_socket_receive() for additional information.
30227 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30233 * g_socket_receive_message:
30234 * @socket: a #GSocket
30235 * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
30236 * @vectors: (array length=num_vectors): an array of #GInputVector structs
30237 * @num_vectors: the number of elements in @vectors, or -1
30238 * @messages: (array length=num_messages) (allow-none): a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
30239 * @num_messages: a pointer which will be filled with the number of elements in @messages, or %NULL
30240 * @flags: a pointer to an int containing #GSocketMsgFlags flags
30241 * @cancellable: (allow-none): a %GCancellable or %NULL
30242 * @error: a #GError pointer, or %NULL
30244 * Receive data from a socket. This is the most complicated and
30245 * fully-featured version of this call. For easier use, see
30246 * g_socket_receive() and g_socket_receive_from().
30248 * If @address is non-%NULL then @address will be set equal to the
30249 * source address of the received packet.
30250 * @address is owned by the caller.
30252 * @vector must point to an array of #GInputVector structs and
30253 * @num_vectors must be the length of this array. These structs
30254 * describe the buffers that received data will be scattered into.
30255 * If @num_vectors is -1, then @vectors is assumed to be terminated
30256 * by a #GInputVector with a %NULL buffer pointer.
30258 * As a special case, if @num_vectors is 0 (in which case, @vectors
30259 * may of course be %NULL), then a single byte is received and
30260 * discarded. This is to facilitate the common practice of sending a
30261 * single '\0' byte for the purposes of transferring ancillary data.
30263 * @messages, if non-%NULL, will be set to point to a newly-allocated
30264 * array of #GSocketControlMessage instances or %NULL if no such
30265 * messages was received. These correspond to the control messages
30266 * received from the kernel, one #GSocketControlMessage per message
30267 * from the kernel. This array is %NULL-terminated and must be freed
30268 * by the caller using g_free() after calling g_object_unref() on each
30269 * element. If @messages is %NULL, any control messages received will
30272 * @num_messages, if non-%NULL, will be set to the number of control
30273 * messages received.
30275 * If both @messages and @num_messages are non-%NULL, then
30276 * @num_messages gives the number of #GSocketControlMessage instances
30277 * in @messages (ie: not including the %NULL terminator).
30279 * @flags is an in/out parameter. The commonly available arguments
30280 * for this are available in the #GSocketMsgFlags enum, but the
30281 * values there are the same as the system values, and the flags
30282 * are passed in as-is, so you can pass in system-specific flags too
30283 * (and g_socket_receive_message() may pass system-specific flags out).
30285 * As with g_socket_receive(), data may be discarded if @socket is
30286 * %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
30287 * provide enough buffer space to read a complete message. You can pass
30288 * %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
30289 * removing it from the receive queue, but there is no portable way to find
30290 * out the length of the message other than by reading it into a
30291 * sufficiently-large buffer.
30293 * If the socket is in blocking mode the call will block until there
30294 * is some data to receive, the connection is closed, or there is an
30295 * error. If there is no data available and the socket is in
30296 * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
30297 * returned. To be notified when data is available, wait for the
30298 * %G_IO_IN condition.
30300 * On error -1 is returned and @error is set accordingly.
30302 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30308 * g_socket_receive_with_blocking:
30309 * @socket: a #GSocket
30310 * @buffer: a buffer to read data into (which should be at least @size bytes long).
30311 * @size: the number of bytes you want to read from the socket
30312 * @blocking: whether to do blocking or non-blocking I/O
30313 * @cancellable: (allow-none): a %GCancellable or %NULL
30314 * @error: #GError for error reporting, or %NULL to ignore.
30316 * This behaves exactly the same as g_socket_receive(), except that
30317 * the choice of blocking or non-blocking behavior is determined by
30318 * the @blocking argument rather than by @socket's properties.
30320 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30327 * @socket: a #GSocket
30328 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
30329 * @size: the number of bytes to send
30330 * @cancellable: (allow-none): a %GCancellable or %NULL
30331 * @error: #GError for error reporting, or %NULL to ignore.
30333 * Tries to send @size bytes from @buffer on the socket. This is
30334 * mainly used by connection-oriented sockets; it is identical to
30335 * g_socket_send_to() with @address set to %NULL.
30337 * If the socket is in blocking mode the call will block until there is
30338 * space for the data in the socket queue. If there is no space available
30339 * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
30340 * will be returned. To be notified when space is available, wait for the
30341 * %G_IO_OUT condition. Note though that you may still receive
30342 * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
30343 * notified of a %G_IO_OUT condition. (On Windows in particular, this is
30344 * very common due to the way the underlying APIs work.)
30346 * On error -1 is returned and @error is set accordingly.
30348 * Returns: Number of bytes written (which may be less than @size), or -1 on error
30354 * g_socket_send_message:
30355 * @socket: a #GSocket
30356 * @address: (allow-none): a #GSocketAddress, or %NULL
30357 * @vectors: (array length=num_vectors): an array of #GOutputVector structs
30358 * @num_vectors: the number of elements in @vectors, or -1
30359 * @messages: (array length=num_messages) (allow-none): a pointer to an array of #GSocketControlMessages, or %NULL.
30360 * @num_messages: number of elements in @messages, or -1.
30361 * @flags: an int containing #GSocketMsgFlags flags
30362 * @cancellable: (allow-none): a %GCancellable or %NULL
30363 * @error: #GError for error reporting, or %NULL to ignore.
30365 * Send data to @address on @socket. This is the most complicated and
30366 * fully-featured version of this call. For easier use, see
30367 * g_socket_send() and g_socket_send_to().
30369 * If @address is %NULL then the message is sent to the default receiver
30370 * (set by g_socket_connect()).
30372 * @vectors must point to an array of #GOutputVector structs and
30373 * @num_vectors must be the length of this array. (If @num_vectors is -1,
30374 * then @vectors is assumed to be terminated by a #GOutputVector with a
30375 * %NULL buffer pointer.) The #GOutputVector structs describe the buffers
30376 * that the sent data will be gathered from. Using multiple
30377 * #GOutputVector<!-- -->s is more memory-efficient than manually copying
30378 * data from multiple sources into a single buffer, and more
30379 * network-efficient than making multiple calls to g_socket_send().
30381 * @messages, if non-%NULL, is taken to point to an array of @num_messages
30382 * #GSocketControlMessage instances. These correspond to the control
30383 * messages to be sent on the socket.
30384 * If @num_messages is -1 then @messages is treated as a %NULL-terminated
30387 * @flags modify how the message is sent. The commonly available arguments
30388 * for this are available in the #GSocketMsgFlags enum, but the
30389 * values there are the same as the system values, and the flags
30390 * are passed in as-is, so you can pass in system-specific flags too.
30392 * If the socket is in blocking mode the call will block until there is
30393 * space for the data in the socket queue. If there is no space available
30394 * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
30395 * will be returned. To be notified when space is available, wait for the
30396 * %G_IO_OUT condition. Note though that you may still receive
30397 * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
30398 * notified of a %G_IO_OUT condition. (On Windows in particular, this is
30399 * very common due to the way the underlying APIs work.)
30401 * On error -1 is returned and @error is set accordingly.
30403 * Returns: Number of bytes written (which may be less than @size), or -1 on error
30409 * g_socket_send_to:
30410 * @socket: a #GSocket
30411 * @address: (allow-none): a #GSocketAddress, or %NULL
30412 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
30413 * @size: the number of bytes to send
30414 * @cancellable: (allow-none): a %GCancellable or %NULL
30415 * @error: #GError for error reporting, or %NULL to ignore.
30417 * Tries to send @size bytes from @buffer to @address. If @address is
30418 * %NULL then the message is sent to the default receiver (set by
30419 * g_socket_connect()).
30421 * See g_socket_send() for additional information.
30423 * Returns: Number of bytes written (which may be less than @size), or -1 on error
30429 * g_socket_send_with_blocking:
30430 * @socket: a #GSocket
30431 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
30432 * @size: the number of bytes to send
30433 * @blocking: whether to do blocking or non-blocking I/O
30434 * @cancellable: (allow-none): a %GCancellable or %NULL
30435 * @error: #GError for error reporting, or %NULL to ignore.
30437 * This behaves exactly the same as g_socket_send(), except that
30438 * the choice of blocking or non-blocking behavior is determined by
30439 * the @blocking argument rather than by @socket's properties.
30441 * Returns: Number of bytes written (which may be less than @size), or -1 on error
30447 * g_socket_service_is_active:
30448 * @service: a #GSocketService
30450 * Check whether the service is active or not. An active
30451 * service will accept new clients that connect, while
30452 * a non-active service will let connecting clients queue
30453 * up until the service is started.
30455 * Returns: %TRUE if the service is active, %FALSE otherwise
30461 * g_socket_service_new:
30463 * Creates a new #GSocketService with no sockets to listen for.
30464 * New listeners can be added with e.g. g_socket_listener_add_address()
30465 * or g_socket_listener_add_inet_port().
30467 * Returns: a new #GSocketService.
30473 * g_socket_service_start:
30474 * @service: a #GSocketService
30476 * Starts the service, i.e. start accepting connections
30477 * from the added sockets when the mainloop runs.
30479 * This call is thread-safe, so it may be called from a thread
30480 * handling an incoming client request.
30487 * g_socket_service_stop:
30488 * @service: a #GSocketService
30490 * Stops the service, i.e. stops accepting connections
30491 * from the added sockets when the mainloop runs.
30493 * This call is thread-safe, so it may be called from a thread
30494 * handling an incoming client request.
30501 * g_socket_set_blocking:
30502 * @socket: a #GSocket.
30503 * @blocking: Whether to use blocking I/O or not.
30505 * Sets the blocking mode of the socket. In blocking mode
30506 * all operations block until they succeed or there is an error. In
30507 * non-blocking mode all functions return results immediately or
30508 * with a %G_IO_ERROR_WOULD_BLOCK error.
30510 * All sockets are created in blocking mode. However, note that the
30511 * platform level socket is always non-blocking, and blocking mode
30512 * is a GSocket level feature.
30519 * g_socket_set_broadcast:
30520 * @socket: a #GSocket.
30521 * @broadcast: whether @socket should allow sending to and receiving from broadcast addresses
30523 * Sets whether @socket should allow sending to and receiving from
30524 * broadcast addresses. This is %FALSE by default.
30531 * g_socket_set_keepalive:
30532 * @socket: a #GSocket.
30533 * @keepalive: Value for the keepalive flag
30535 * Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
30536 * this flag is set on a socket, the system will attempt to verify that the
30537 * remote socket endpoint is still present if a sufficiently long period of
30538 * time passes with no data being exchanged. If the system is unable to
30539 * verify the presence of the remote endpoint, it will automatically close
30542 * This option is only functional on certain kinds of sockets. (Notably,
30543 * %G_SOCKET_PROTOCOL_TCP sockets.)
30545 * The exact time between pings is system- and protocol-dependent, but will
30546 * normally be at least two hours. Most commonly, you would set this flag
30547 * on a server socket if you want to allow clients to remain idle for long
30548 * periods of time, but also want to ensure that connections are eventually
30549 * garbage-collected if clients crash or become unreachable.
30556 * g_socket_set_listen_backlog:
30557 * @socket: a #GSocket.
30558 * @backlog: the maximum number of pending connections.
30560 * Sets the maximum number of outstanding connections allowed
30561 * when listening on this socket. If more clients than this are
30562 * connecting to the socket and the application is not handling them
30563 * on time then the new connections will be refused.
30565 * Note that this must be called before g_socket_listen() and has no
30566 * effect if called after that.
30573 * g_socket_set_multicast_loopback:
30574 * @socket: a #GSocket.
30575 * @loopback: whether @socket should receive messages sent to its multicast groups from the local host
30577 * Sets whether outgoing multicast packets will be received by sockets
30578 * listening on that multicast address on the same host. This is %TRUE
30586 * g_socket_set_multicast_ttl:
30587 * @socket: a #GSocket.
30588 * @ttl: the time-to-live value for all multicast datagrams on @socket
30590 * Sets the time-to-live for outgoing multicast datagrams on @socket.
30591 * By default, this is 1, meaning that multicast packets will not leave
30592 * the local network.
30599 * g_socket_set_timeout:
30600 * @socket: a #GSocket.
30601 * @timeout: the timeout for @socket, in seconds, or 0 for none
30603 * Sets the time in seconds after which I/O operations on @socket will
30604 * time out if they have not yet completed.
30606 * On a blocking socket, this means that any blocking #GSocket
30607 * operation will time out after @timeout seconds of inactivity,
30608 * returning %G_IO_ERROR_TIMED_OUT.
30610 * On a non-blocking socket, calls to g_socket_condition_wait() will
30611 * also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
30612 * created with g_socket_create_source() will trigger after
30613 * @timeout seconds of inactivity, with the requested condition
30614 * set, at which point calling g_socket_receive(), g_socket_send(),
30615 * g_socket_check_connect_result(), etc, will fail with
30616 * %G_IO_ERROR_TIMED_OUT.
30618 * If @timeout is 0 (the default), operations will never time out
30621 * Note that if an I/O operation is interrupted by a signal, this may
30622 * cause the timeout to be reset.
30629 * g_socket_set_ttl:
30630 * @socket: a #GSocket.
30631 * @ttl: the time-to-live value for all unicast packets on @socket
30633 * Sets the time-to-live for outgoing unicast packets on @socket.
30634 * By default the platform-specific default value is used.
30641 * g_socket_shutdown:
30642 * @socket: a #GSocket
30643 * @shutdown_read: whether to shut down the read side
30644 * @shutdown_write: whether to shut down the write side
30645 * @error: #GError for error reporting, or %NULL to ignore.
30647 * Shut down part of a full-duplex connection.
30649 * If @shutdown_read is %TRUE then the receiving side of the connection
30650 * is shut down, and further reading is disallowed.
30652 * If @shutdown_write is %TRUE then the sending side of the connection
30653 * is shut down, and further writing is disallowed.
30655 * It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
30657 * One example where this is used is graceful disconnect for TCP connections
30658 * where you close the sending side, then wait for the other side to close
30659 * the connection, thus ensuring that the other side saw all sent data.
30661 * Returns: %TRUE on success, %FALSE on error
30667 * g_socket_speaks_ipv4:
30668 * @socket: a #GSocket
30670 * Checks if a socket is capable of speaking IPv4.
30672 * IPv4 sockets are capable of speaking IPv4. On some operating systems
30673 * and under some combinations of circumstances IPv6 sockets are also
30674 * capable of speaking IPv4. See RFC 3493 section 3.7 for more
30677 * No other types of sockets are currently considered as being capable
30678 * of speaking IPv4.
30680 * Returns: %TRUE if this socket can be used with IPv4.
30686 * g_srv_target_copy:
30687 * @target: a #GSrvTarget
30691 * Returns: a copy of @target
30697 * g_srv_target_free:
30698 * @target: a #GSrvTarget
30707 * g_srv_target_get_hostname:
30708 * @target: a #GSrvTarget
30710 * Gets @target's hostname (in ASCII form; if you are going to present
30711 * this to the user, you should use g_hostname_is_ascii_encoded() to
30712 * check if it contains encoded Unicode segments, and use
30713 * g_hostname_to_unicode() to convert it if it does.)
30715 * Returns: @target's hostname
30721 * g_srv_target_get_port:
30722 * @target: a #GSrvTarget
30724 * Gets @target's port
30726 * Returns: @target's port
30732 * g_srv_target_get_priority:
30733 * @target: a #GSrvTarget
30735 * Gets @target's priority. You should not need to look at this;
30736 * #GResolver already sorts the targets according to the algorithm in
30739 * Returns: @target's priority
30745 * g_srv_target_get_weight:
30746 * @target: a #GSrvTarget
30748 * Gets @target's weight. You should not need to look at this;
30749 * #GResolver already sorts the targets according to the algorithm in
30752 * Returns: @target's weight
30758 * g_srv_target_list_sort: (skip)
30759 * @targets: a #GList of #GSrvTarget
30761 * Sorts @targets in place according to the algorithm in RFC 2782.
30763 * Returns: (transfer full): the head of the sorted list.
30769 * g_srv_target_new:
30770 * @hostname: the host that the service is running on
30771 * @port: the port that the service is running on
30772 * @priority: the target's priority
30773 * @weight: the target's weight
30775 * Creates a new #GSrvTarget with the given parameters.
30777 * You should not need to use this; normally #GSrvTarget<!-- -->s are
30778 * created by #GResolver.
30780 * Returns: a new #GSrvTarget.
30786 * g_static_resource_fini:
30787 * @static_resource: pointer to a static #GStaticResource
30789 * Finalized a GResource initialized by g_static_resource_init().
30791 * This is normally used by code generated by
30792 * <link linkend="glib-compile-resources">glib-compile-resources</link>
30793 * and is not typically used by other code.
30800 * g_static_resource_get_resource:
30801 * @static_resource: pointer to a static #GStaticResource
30803 * Gets the GResource that was registered by a call to g_static_resource_init().
30805 * This is normally used by code generated by
30806 * <link linkend="glib-compile-resources">glib-compile-resources</link>
30807 * and is not typically used by other code.
30809 * Returns: (transfer none): a #GResource
30815 * g_static_resource_init:
30816 * @static_resource: pointer to a static #GStaticResource
30818 * Initializes a GResource from static data using a
30821 * This is normally used by code generated by
30822 * <link linkend="glib-compile-resources">glib-compile-resources</link>
30823 * and is not typically used by other code.
30830 * g_task_attach_source:
30832 * @source: the source to attach
30833 * @callback: the callback to invoke when @source triggers
30835 * A utility function for dealing with async operations where you need
30836 * to wait for a #GSource to trigger. Attaches @source to @task's
30837 * #GMainContext with @task's <link
30838 * linkend="io-priority">priority</link>, and sets @source's callback
30839 * to @callback, with @task as the callback's
30840 * <literal>user_data</literal>.
30842 * This takes a reference on @task until @source is destroyed.
30849 * g_task_get_cancellable:
30852 * Gets @task's #GCancellable
30854 * Returns: (transfer none): @task's #GCancellable
30860 * g_task_get_check_cancellable:
30861 * @task: the #GTask
30863 * Gets @task's check-cancellable flag. See
30864 * g_task_set_check_cancellable() for more details.
30871 * g_task_get_context:
30874 * Gets the #GMainContext that @task will return its result in (that
30875 * is, the context that was the <link
30876 * linkend="g-main-context-push-thread-default">thread-default main
30877 * context</link> at the point when @task was created).
30879 * This will always return a non-%NULL value, even if the task's
30880 * context is the default #GMainContext.
30882 * Returns: (transfer none): @task's #GMainContext
30888 * g_task_get_priority:
30891 * Gets @task's priority
30893 * Returns: @task's priority
30899 * g_task_get_return_on_cancel:
30900 * @task: the #GTask
30902 * Gets @task's return-on-cancel flag. See
30903 * g_task_set_return_on_cancel() for more details.
30910 * g_task_get_source_object:
30913 * Gets the source object from @task. Like
30914 * g_async_result_get_source_object(), but does not ref the object.
30916 * Returns: (transfer none): @task's source object, or %NULL
30922 * g_task_get_source_tag:
30925 * Gets @task's source tag. See g_task_set_source_tag().
30927 * Returns: (transfer none): @task's source tag
30933 * g_task_get_task_data:
30936 * Gets @task's <literal>task_data</literal>.
30938 * Returns: (transfer none): @task's <literal>task_data</literal>.
30944 * g_task_had_error:
30947 * Tests if @task resulted in an error.
30949 * Returns: %TRUE if the task resulted in an error, %FALSE otherwise.
30956 * @result: (type Gio.AsyncResult): A #GAsyncResult
30957 * @source_object: (allow-none): the source object expected to be associated with the task
30959 * Checks that @result is a #GTask, and that @source_object is its
30960 * source object (or that @source_object is %NULL and @result has no
30961 * source object). This can be used in g_return_if_fail() checks.
30963 * Returns: %TRUE if @result and @source_object are valid, %FALSE if not
30970 * @source_object: (allow-none): the #GObject that owns this task, or %NULL.
30971 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
30972 * @callback: (scope async): a #GAsyncReadyCallback.
30973 * @callback_data: (closure): user data passed to @callback.
30975 * Creates a #GTask acting on @source_object, which will eventually be
30976 * used to invoke @callback in the current <link
30977 * linkend="g-main-context-push-thread-default">thread-default main
30980 * Call this in the "start" method of your asynchronous method, and
30981 * pass the #GTask around throughout the asynchronous operation. You
30982 * can use g_task_set_task_data() to attach task-specific data to the
30983 * object, which you can retrieve later via g_task_get_task_data().
30985 * By default, if @cancellable is cancelled, then the return value of
30986 * the task will always be %G_IO_ERROR_CANCELLED, even if the task had
30987 * already completed before the cancellation. This allows for
30988 * simplified handling in cases where cancellation may imply that
30989 * other objects that the task depends on have been destroyed. If you
30990 * do not want this behavior, you can use
30991 * g_task_set_check_cancellable() to change it.
30993 * Returns: a #GTask.
30999 * g_task_propagate_boolean:
31001 * @error: return location for a #GError
31003 * Gets the result of @task as a #gboolean.
31005 * If the task resulted in an error, or was cancelled, then this will
31006 * instead return %FALSE and set @error.
31008 * Since this method transfers ownership of the return value (or
31009 * error) to the caller, you may only call it once.
31011 * Returns: the task result, or %FALSE on error
31017 * g_task_propagate_int:
31019 * @error: return location for a #GError
31021 * Gets the result of @task as an integer (#gssize).
31023 * If the task resulted in an error, or was cancelled, then this will
31024 * instead return -1 and set @error.
31026 * Since this method transfers ownership of the return value (or
31027 * error) to the caller, you may only call it once.
31029 * Returns: the task result, or -1 on error
31035 * g_task_propagate_pointer:
31037 * @error: return location for a #GError
31039 * Gets the result of @task as a pointer, and transfers ownership
31040 * of that value to the caller.
31042 * If the task resulted in an error, or was cancelled, then this will
31043 * instead return %NULL and set @error.
31045 * Since this method transfers ownership of the return value (or
31046 * error) to the caller, you may only call it once.
31048 * Returns: (transfer full): the task result, or %NULL on error
31054 * g_task_report_error:
31055 * @source_object: (allow-none): the #GObject that owns this task, or %NULL.
31056 * @callback: (scope async): a #GAsyncReadyCallback.
31057 * @callback_data: (closure): user data passed to @callback.
31058 * @source_tag: an opaque pointer indicating the source of this task
31059 * @error: (transfer full): error to report
31061 * Creates a #GTask and then immediately calls g_task_return_error()
31062 * on it. Use this in the wrapper function of an asynchronous method
31063 * when you want to avoid even calling the virtual method. You can
31064 * then use g_async_result_is_tagged() in the finish method wrapper to
31065 * check if the result there is tagged as having been created by the
31066 * wrapper method, and deal with it appropriately if so.
31068 * See also g_task_report_new_error().
31075 * g_task_report_new_error:
31076 * @source_object: (allow-none): the #GObject that owns this task, or %NULL.
31077 * @callback: (scope async): a #GAsyncReadyCallback.
31078 * @callback_data: (closure): user data passed to @callback.
31079 * @source_tag: an opaque pointer indicating the source of this task
31080 * @domain: a #GQuark.
31081 * @code: an error code.
31082 * @format: a string with format characters.
31083 * @...: a list of values to insert into @format.
31085 * Creates a #GTask and then immediately calls
31086 * g_task_return_new_error() on it. Use this in the wrapper function
31087 * of an asynchronous method when you want to avoid even calling the
31088 * virtual method. You can then use g_async_result_is_tagged() in the
31089 * finish method wrapper to check if the result there is tagged as
31090 * having been created by the wrapper method, and deal with it
31091 * appropriately if so.
31093 * See also g_task_report_error().
31100 * g_task_return_boolean:
31102 * @result: the #gboolean result of a task function.
31104 * Sets @task's result to @result and completes the task (see
31105 * g_task_return_pointer() for more discussion of exactly what this
31113 * g_task_return_error:
31115 * @error: (transfer full): the #GError result of a task function.
31117 * Sets @task's result to @error (which @task assumes ownership of)
31118 * and completes the task (see g_task_return_pointer() for more
31119 * discussion of exactly what this means).
31121 * Note that since the task takes ownership of @error, and since the
31122 * task may be completed before returning from g_task_return_error(),
31123 * you cannot assume that @error is still valid after calling this.
31124 * Call g_error_copy() on the error if you need to keep a local copy
31127 * See also g_task_return_new_error().
31134 * g_task_return_error_if_cancelled:
31137 * Checks if @task's #GCancellable has been cancelled, and if so, sets
31138 * @task's error accordingly and completes the task (see
31139 * g_task_return_pointer() for more discussion of exactly what this
31142 * Returns: %TRUE if @task has been cancelled, %FALSE if not
31148 * g_task_return_int:
31150 * @result: the integer (#gssize) result of a task function.
31152 * Sets @task's result to @result and completes the task (see
31153 * g_task_return_pointer() for more discussion of exactly what this
31161 * g_task_return_new_error:
31163 * @domain: a #GQuark.
31164 * @code: an error code.
31165 * @format: a string with format characters.
31166 * @...: a list of values to insert into @format.
31168 * Sets @task's result to a new #GError created from @domain, @code,
31169 * @format, and the remaining arguments, and completes the task (see
31170 * g_task_return_pointer() for more discussion of exactly what this
31173 * See also g_task_return_error().
31180 * g_task_return_pointer:
31182 * @result: (allow-none) (transfer full): the pointer result of a task function
31183 * @result_destroy: (allow-none): a #GDestroyNotify function.
31185 * Sets @task's result to @result and completes the task. If @result
31186 * is not %NULL, then @result_destroy will be used to free @result if
31187 * the caller does not take ownership of it with
31188 * g_task_propagate_pointer().
31190 * "Completes the task" means that for an ordinary asynchronous task
31191 * it will either invoke the task's callback, or else queue that
31192 * callback to be invoked in the proper #GMainContext, or in the next
31193 * iteration of the current #GMainContext. For a task run via
31194 * g_task_run_in_thread() or g_task_run_in_thread_sync(), calling this
31195 * method will save @result to be returned to the caller later, but
31196 * the task will not actually be completed until the #GTaskThreadFunc
31199 * Note that since the task may be completed before returning from
31200 * g_task_return_pointer(), you cannot assume that @result is still
31201 * valid after calling this, unless you are still holding another
31209 * g_task_run_in_thread:
31211 * @task_func: a #GTaskThreadFunc
31213 * Runs @task_func in another thread. When @task_func returns, @task's
31214 * #GAsyncReadyCallback will be invoked in @task's #GMainContext.
31216 * This takes a ref on @task until the task completes.
31218 * See #GTaskThreadFunc for more details about how @task_func is handled.
31225 * g_task_run_in_thread_sync:
31227 * @task_func: a #GTaskThreadFunc
31229 * Runs @task_func in another thread, and waits for it to return or be
31230 * cancelled. You can use g_task_propagate_pointer(), etc, afterward
31231 * to get the result of @task_func.
31233 * See #GTaskThreadFunc for more details about how @task_func is handled.
31235 * Normally this is used with tasks created with a %NULL
31236 * <literal>callback</literal>, but note that even if the task does
31237 * have a callback, it will not be invoked when @task_func returns.
31244 * g_task_set_check_cancellable:
31245 * @task: the #GTask
31246 * @check_cancellable: whether #GTask will check the state of its #GCancellable for you.
31248 * Sets or clears @task's check-cancellable flag. If this is %TRUE
31249 * (the default), then g_task_propagate_pointer(), etc, and
31250 * g_task_had_error() will check the task's #GCancellable first, and
31251 * if it has been cancelled, then they will consider the task to have
31252 * returned an "Operation was cancelled" error
31253 * (%G_IO_ERROR_CANCELLED), regardless of any other error or return
31254 * value the task may have had.
31256 * If @check_cancellable is %FALSE, then the #GTask will not check the
31257 * cancellable itself, and it is up to @task's owner to do this (eg,
31258 * via g_task_return_error_if_cancelled()).
31260 * If you are using g_task_set_return_on_cancel() as well, then
31261 * you must leave check-cancellable set %TRUE.
31268 * g_task_set_priority:
31269 * @task: the #GTask
31270 * @priority: the <link linkend="io-priority">priority</link> of the request.
31272 * Sets @task's priority. If you do not call this, it will default to
31273 * %G_PRIORITY_DEFAULT.
31275 * This will affect the priority of #GSources created with
31276 * g_task_attach_source() and the scheduling of tasks run in threads,
31277 * and can also be explicitly retrieved later via
31278 * g_task_get_priority().
31285 * g_task_set_return_on_cancel:
31286 * @task: the #GTask
31287 * @return_on_cancel: whether the task returns automatically when it is cancelled.
31289 * Sets or clears @task's return-on-cancel flag. This is only
31290 * meaningful for tasks run via g_task_run_in_thread() or
31291 * g_task_run_in_thread_sync().
31293 * If @return_on_cancel is %TRUE, then cancelling @task's
31294 * #GCancellable will immediately cause it to return, as though the
31295 * task's #GTaskThreadFunc had called
31296 * g_task_return_error_if_cancelled() and then returned.
31298 * This allows you to create a cancellable wrapper around an
31299 * uninterruptable function. The #GTaskThreadFunc just needs to be
31300 * careful that it does not modify any externally-visible state after
31301 * it has been cancelled. To do that, the thread should call
31302 * g_task_set_return_on_cancel() again to (atomically) set
31303 * return-on-cancel %FALSE before making externally-visible changes;
31304 * if the task gets cancelled before the return-on-cancel flag could
31305 * be changed, g_task_set_return_on_cancel() will indicate this by
31306 * returning %FALSE.
31308 * You can disable and re-enable this flag multiple times if you wish.
31309 * If the task's #GCancellable is cancelled while return-on-cancel is
31310 * %FALSE, then calling g_task_set_return_on_cancel() to set it %TRUE
31311 * again will cause the task to be cancelled at that point.
31313 * If the task's #GCancellable is already cancelled before you call
31314 * g_task_run_in_thread()/g_task_run_in_thread_sync(), then the
31315 * #GTaskThreadFunc will still be run (for consistency), but the task
31316 * will also be completed right away.
31318 * Returns: %TRUE if @task's return-on-cancel flag was changed to match @return_on_cancel. %FALSE if @task has already been cancelled.
31324 * g_task_set_source_tag:
31325 * @task: the #GTask
31326 * @source_tag: an opaque pointer indicating the source of this task
31328 * Sets @task's source tag. You can use this to tag a task return
31329 * value with a particular pointer (usually a pointer to the function
31330 * doing the tagging) and then later check it using
31331 * g_task_get_source_tag() (or g_async_result_is_tagged()) in the
31332 * task's "finish" function, to figure out if the response came from a
31333 * particular place.
31340 * g_task_set_task_data:
31341 * @task: the #GTask
31342 * @task_data: (allow-none): task-specific data
31343 * @task_data_destroy: (allow-none): #GDestroyNotify for @task_data
31345 * Sets @task's task data (freeing the existing task data, if any).
31352 * g_tcp_connection_get_graceful_disconnect:
31353 * @connection: a #GTcpConnection
31355 * Checks if graceful disconnects are used. See
31356 * g_tcp_connection_set_graceful_disconnect().
31358 * Returns: %TRUE if graceful disconnect is used on close, %FALSE otherwise
31364 * g_tcp_connection_set_graceful_disconnect:
31365 * @connection: a #GTcpConnection
31366 * @graceful_disconnect: Whether to do graceful disconnects or not
31368 * This enabled graceful disconnects on close. A graceful disconnect
31369 * means that we signal the receiving end that the connection is terminated
31370 * and wait for it to close the connection before closing the connection.
31372 * A graceful disconnect means that we can be sure that we successfully sent
31373 * all the outstanding data to the other end, or get an error reported.
31374 * However, it also means we have to wait for all the data to reach the
31375 * other side and for it to acknowledge this by closing the socket, which may
31376 * take a while. For this reason it is disabled by default.
31383 * g_tcp_wrapper_connection_get_base_io_stream:
31384 * @conn: a #GTcpWrapperConnection
31386 * Get's @conn's base #GIOStream
31388 * Returns: (transfer none): @conn's base #GIOStream
31393 * g_tcp_wrapper_connection_new:
31394 * @base_io_stream: the #GIOStream to wrap
31395 * @socket: the #GSocket associated with @base_io_stream
31397 * Wraps @base_io_stream and @socket together as a #GSocketConnection.
31399 * Returns: the new #GSocketConnection.
31405 * g_test_dbus_add_service_dir:
31406 * @self: a #GTestDBus
31407 * @path: path to a directory containing .service files
31409 * Add a path where dbus-daemon will lookup for .services files. This can't be
31410 * called after g_test_dbus_up().
31415 * g_test_dbus_down:
31416 * @self: a #GTestDBus
31418 * Stop the session bus started by g_test_dbus_up().
31420 * This will wait for the singleton returned by g_bus_get() or g_bus_get_sync()
31421 * is destroyed. This is done to ensure that the next unit test won't get a
31422 * leaked singleton from this test.
31427 * g_test_dbus_get_bus_address:
31428 * @self: a #GTestDBus
31430 * Get the address on which dbus-daemon is running. if g_test_dbus_up() has not
31431 * been called yet, %NULL is returned. This can be used with
31432 * g_dbus_connection_new_for_address()
31434 * Returns: the address of the bus, or %NULL.
31439 * g_test_dbus_get_flags:
31440 * @self: a #GTestDBus
31442 * Gets the flags of the #GTestDBus object.
31444 * Returns: the value of #GTestDBus:flags property
31450 * @flags: a #GTestDBusFlags
31452 * Create a new #GTestDBus object.
31454 * Returns: (transfer full): a new #GTestDBus.
31459 * g_test_dbus_stop:
31460 * @self: a #GTestDBus
31462 * Stop the session bus started by g_test_dbus_up().
31464 * Unlike g_test_dbus_down(), this won't verify the #GDBusConnection
31465 * singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit
31466 * tests wanting to verify behaviour after the session bus has been stopped
31467 * can use this function but should still call g_test_dbus_down() when done.
31472 * g_test_dbus_unset:
31474 * Unset DISPLAY and DBUS_SESSION_BUS_ADDRESS env variables to ensure the test
31475 * won't use user's session bus.
31477 * This is useful for unit tests that want to verify behaviour when no session
31478 * bus is running. It is not necessary to call this if unit test already calls
31479 * g_test_dbus_up() before acquiring the session bus.
31485 * @self: a #GTestDBus
31487 * Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this
31488 * call, it is safe for unit tests to start sending messages on the session bus.
31490 * If this function is called from setup callback of g_test_add(),
31491 * g_test_dbus_down() must be called in its teardown callback.
31493 * If this function is called from unit test's main(), then g_test_dbus_down()
31494 * must be called after g_test_run().
31499 * g_themed_icon_append_name:
31500 * @icon: a #GThemedIcon
31501 * @iconname: name of icon to append to list of icons from within @icon.
31503 * Append a name to the list of icons from within @icon.
31506 * Note that doing so invalidates the hash computed by prior calls
31507 * to g_icon_hash().
31513 * g_themed_icon_get_names:
31514 * @icon: a #GThemedIcon.
31516 * Gets the names of icons from within @icon.
31518 * Returns: (transfer none): a list of icon names.
31523 * g_themed_icon_new:
31524 * @iconname: a string containing an icon name.
31526 * Creates a new themed icon for @iconname.
31528 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
31533 * g_themed_icon_new_from_names:
31534 * @iconnames: (array length=len): an array of strings containing icon names.
31535 * @len: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
31537 * Creates a new themed icon for @iconnames.
31539 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon
31544 * g_themed_icon_new_with_default_fallbacks:
31545 * @iconname: a string containing an icon name
31547 * Creates a new themed icon for @iconname, and all the names
31548 * that can be created by shortening @iconname at '-' characters.
31550 * In the following example, @icon1 and @icon2 are equivalent:
31552 * const char *names[] = {
31553 * "gnome-dev-cdrom-audio",
31554 * "gnome-dev-cdrom",
31559 * icon1 = g_themed_icon_new_from_names (names, 4);
31560 * icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
31563 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
31568 * g_themed_icon_prepend_name:
31569 * @icon: a #GThemedIcon
31570 * @iconname: name of icon to prepend to list of icons from within @icon.
31572 * Prepend a name to the list of icons from within @icon.
31575 * Note that doing so invalidates the hash computed by prior calls
31576 * to g_icon_hash().
31584 * g_threaded_socket_service_new:
31585 * @max_threads: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
31587 * Creates a new #GThreadedSocketService with no listeners. Listeners
31588 * must be added with one of the #GSocketListener "add" methods.
31590 * Returns: a new #GSocketService.
31596 * g_tls_backend_get_certificate_type:
31597 * @backend: the #GTlsBackend
31599 * Gets the #GType of @backend's #GTlsCertificate implementation.
31601 * Returns: the #GType of @backend's #GTlsCertificate implementation.
31607 * g_tls_backend_get_client_connection_type:
31608 * @backend: the #GTlsBackend
31610 * Gets the #GType of @backend's #GTlsClientConnection implementation.
31612 * Returns: the #GType of @backend's #GTlsClientConnection implementation.
31618 * g_tls_backend_get_default:
31620 * Gets the default #GTlsBackend for the system.
31622 * Returns: (transfer none): a #GTlsBackend
31628 * g_tls_backend_get_default_database:
31629 * @backend: the #GTlsBackend
31631 * Gets the default #GTlsDatabase used to verify TLS connections.
31633 * Returns: (transfer full): the default database, which should be unreffed when done.
31639 * g_tls_backend_get_file_database_type:
31640 * @backend: the #GTlsBackend
31642 * Gets the #GType of @backend's #GTlsFileDatabase implementation.
31644 * Returns: the #GType of backend's #GTlsFileDatabase implementation.
31650 * g_tls_backend_get_server_connection_type:
31651 * @backend: the #GTlsBackend
31653 * Gets the #GType of @backend's #GTlsServerConnection implementation.
31655 * Returns: the #GType of @backend's #GTlsServerConnection implementation.
31661 * g_tls_backend_supports_tls:
31662 * @backend: the #GTlsBackend
31664 * Checks if TLS is supported; if this returns %FALSE for the default
31665 * #GTlsBackend, it means no "real" TLS backend is available.
31667 * Returns: whether or not TLS is supported
31673 * g_tls_certificate_get_issuer:
31674 * @cert: a #GTlsCertificate
31676 * Gets the #GTlsCertificate representing @cert's issuer, if known
31678 * Returns: (transfer none): The certificate of @cert's issuer, or %NULL if @cert is self-signed or signed with an unknown certificate.
31684 * g_tls_certificate_is_same:
31685 * @cert_one: first certificate to compare
31686 * @cert_two: second certificate to compare
31688 * Check if two #GTlsCertificate objects represent the same certificate.
31689 * The raw DER byte data of the two certificates are checked for equality.
31690 * This has the effect that two certificates may compare equal even if
31691 * their #GTlsCertificate:issuer, #GTlsCertificate:private-key, or
31692 * #GTlsCertificate:private-key-pem properties differ.
31694 * Returns: whether the same or not
31700 * g_tls_certificate_list_new_from_file:
31701 * @file: file containing PEM-encoded certificates to import
31702 * @error: #GError for error reporting, or %NULL to ignore.
31704 * Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
31705 * data in @file. If @file cannot be read or parsed, the function will
31706 * return %NULL and set @error. If @file does not contain any
31707 * PEM-encoded certificates, this will return an empty list and not
31710 * 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.
31716 * g_tls_certificate_new_from_file:
31717 * @file: file containing a PEM-encoded certificate to import
31718 * @error: #GError for error reporting, or %NULL to ignore.
31720 * Creates a #GTlsCertificate from the PEM-encoded data in @file. If
31721 * @file cannot be read or parsed, the function will return %NULL and
31722 * set @error. Otherwise, this behaves like
31723 * g_tls_certificate_new_from_pem().
31725 * Returns: the new certificate, or %NULL on error
31731 * g_tls_certificate_new_from_files:
31732 * @cert_file: file containing a PEM-encoded certificate to import
31733 * @key_file: file containing a PEM-encoded private key to import
31734 * @error: #GError for error reporting, or %NULL to ignore.
31736 * Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
31737 * and @key_file. If either file cannot be read or parsed, the
31738 * function will return %NULL and set @error. Otherwise, this behaves
31739 * like g_tls_certificate_new_from_pem().
31741 * Returns: the new certificate, or %NULL on error
31747 * g_tls_certificate_new_from_pem:
31748 * @data: PEM-encoded certificate data
31749 * @length: the length of @data, or -1 if it's 0-terminated.
31750 * @error: #GError for error reporting, or %NULL to ignore.
31752 * Creates a new #GTlsCertificate from the PEM-encoded data in @data.
31753 * If @data includes both a certificate and a private key, then the
31754 * returned certificate will include the private key data as well. (See
31755 * the #GTlsCertificate:private-key-pem property for information about
31756 * supported formats.)
31758 * If @data includes multiple certificates, only the first one will be
31761 * Returns: the new certificate, or %NULL if @data is invalid
31767 * g_tls_certificate_verify:
31768 * @cert: a #GTlsCertificate
31769 * @identity: (allow-none): the expected peer identity
31770 * @trusted_ca: (allow-none): the certificate of a trusted authority
31772 * This verifies @cert and returns a set of #GTlsCertificateFlags
31773 * indicating any problems found with it. This can be used to verify a
31774 * certificate outside the context of making a connection, or to
31775 * check a certificate against a CA that is not part of the system
31778 * If @identity is not %NULL, @cert's name(s) will be compared against
31779 * it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
31780 * value if it does not match. If @identity is %NULL, that bit will
31781 * never be set in the return value.
31783 * If @trusted_ca is not %NULL, then @cert (or one of the certificates
31784 * in its chain) must be signed by it, or else
31785 * %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
31786 * @trusted_ca is %NULL, that bit will never be set in the return
31789 * (All other #GTlsCertificateFlags values will always be set or unset
31792 * Returns: the appropriate #GTlsCertificateFlags
31798 * g_tls_client_connection_get_accepted_cas:
31799 * @conn: the #GTlsClientConnection
31801 * Gets the list of distinguished names of the Certificate Authorities
31802 * that the server will accept certificates from. This will be set
31803 * during the TLS handshake if the server requests a certificate.
31804 * Otherwise, it will be %NULL.
31806 * Each item in the list is a #GByteArray which contains the complete
31807 * subject DN of the certificate authority.
31809 * 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().
31815 * g_tls_client_connection_get_server_identity:
31816 * @conn: the #GTlsClientConnection
31818 * Gets @conn's expected server identity
31820 * Returns: (transfer none): a #GSocketConnectable describing the expected server identity, or %NULL if the expected identity is not known.
31826 * g_tls_client_connection_get_use_ssl3:
31827 * @conn: the #GTlsClientConnection
31829 * Gets whether @conn will use SSL 3.0 rather than the
31830 * highest-supported version of TLS; see
31831 * g_tls_client_connection_set_use_ssl3().
31833 * Returns: whether @conn will use SSL 3.0
31839 * g_tls_client_connection_get_validation_flags:
31840 * @conn: the #GTlsClientConnection
31842 * Gets @conn's validation flags
31844 * Returns: the validation flags
31850 * g_tls_client_connection_new:
31851 * @base_io_stream: the #GIOStream to wrap
31852 * @server_identity: (allow-none): the expected identity of the server
31853 * @error: #GError for error reporting, or %NULL to ignore.
31855 * Creates a new #GTlsClientConnection wrapping @base_io_stream (which
31856 * must have pollable input and output streams) which is assumed to
31857 * communicate with the server identified by @server_identity.
31859 * Returns: (transfer full) (type GTlsClientConnection): the new #GTlsClientConnection, or %NULL on error
31865 * g_tls_client_connection_set_server_identity:
31866 * @conn: the #GTlsClientConnection
31867 * @identity: a #GSocketConnectable describing the expected server identity
31869 * Sets @conn's expected server identity, which is used both to tell
31870 * servers on virtual hosts which certificate to present, and also
31871 * to let @conn know what name to look for in the certificate when
31872 * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
31879 * g_tls_client_connection_set_use_ssl3:
31880 * @conn: the #GTlsClientConnection
31881 * @use_ssl3: whether to use SSL 3.0
31883 * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
31884 * trying to properly negotiate the right version of TLS or SSL to use.
31885 * This can be used when talking to servers that do not implement the
31886 * fallbacks correctly and which will therefore fail to handshake with
31887 * a "modern" TLS handshake attempt.
31894 * g_tls_client_connection_set_validation_flags:
31895 * @conn: the #GTlsClientConnection
31896 * @flags: the #GTlsCertificateFlags to use
31898 * Sets @conn's validation flags, to override the default set of
31899 * checks performed when validating a server certificate. By default,
31900 * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
31907 * g_tls_connection_emit_accept_certificate:
31908 * @conn: a #GTlsConnection
31909 * @peer_cert: the peer's #GTlsCertificate
31910 * @errors: the problems with @peer_cert
31912 * Used by #GTlsConnection implementations to emit the
31913 * #GTlsConnection::accept-certificate signal.
31915 * Returns: %TRUE if one of the signal handlers has returned %TRUE to accept @peer_cert
31921 * g_tls_connection_get_certificate:
31922 * @conn: a #GTlsConnection
31924 * Gets @conn's certificate, as set by
31925 * g_tls_connection_set_certificate().
31927 * Returns: (transfer none): @conn's certificate, or %NULL
31933 * g_tls_connection_get_database:
31934 * @conn: a #GTlsConnection
31936 * Gets the certificate database that @conn uses to verify
31937 * peer certificates. See g_tls_connection_set_database().
31939 * Returns: (transfer none): the certificate database that @conn uses or %NULL
31945 * g_tls_connection_get_interaction:
31946 * @conn: a connection
31948 * Get the object that will be used to interact with the user. It will be used
31949 * for things like prompting the user for passwords. If %NULL is returned, then
31950 * no user interaction will occur for this connection.
31952 * Returns: (transfer none): The interaction object.
31958 * g_tls_connection_get_peer_certificate:
31959 * @conn: a #GTlsConnection
31961 * Gets @conn's peer's certificate after the handshake has completed.
31962 * (It is not set during the emission of
31963 * #GTlsConnection::accept-certificate.)
31965 * Returns: (transfer none): @conn's peer's certificate, or %NULL
31971 * g_tls_connection_get_peer_certificate_errors:
31972 * @conn: a #GTlsConnection
31974 * Gets the errors associated with validating @conn's peer's
31975 * certificate, after the handshake has completed. (It is not set
31976 * during the emission of #GTlsConnection::accept-certificate.)
31978 * Returns: @conn's peer's certificate errors
31984 * g_tls_connection_get_rehandshake_mode:
31985 * @conn: a #GTlsConnection
31987 * Gets @conn rehandshaking mode. See
31988 * g_tls_connection_set_rehandshake_mode() for details.
31990 * Returns: @conn's rehandshaking mode
31996 * g_tls_connection_get_require_close_notify:
31997 * @conn: a #GTlsConnection
31999 * Tests whether or not @conn expects a proper TLS close notification
32000 * when the connection is closed. See
32001 * g_tls_connection_set_require_close_notify() for details.
32003 * Returns: %TRUE if @conn requires a proper TLS close notification.
32009 * g_tls_connection_get_use_system_certdb:
32010 * @conn: a #GTlsConnection
32012 * Gets whether @conn uses the system certificate database to verify
32013 * peer certificates. See g_tls_connection_set_use_system_certdb().
32015 * Returns: whether @conn uses the system certificate database
32016 * Deprecated: 2.30: Use g_tls_connection_get_database() instead
32021 * g_tls_connection_handshake:
32022 * @conn: a #GTlsConnection
32023 * @cancellable: (allow-none): a #GCancellable, or %NULL
32024 * @error: a #GError, or %NULL
32026 * Attempts a TLS handshake on @conn.
32028 * On the client side, it is never necessary to call this method;
32029 * although the connection needs to perform a handshake after
32030 * connecting (or after sending a "STARTTLS"-type command) and may
32031 * need to rehandshake later if the server requests it,
32032 * #GTlsConnection will handle this for you automatically when you try
32033 * to send or receive data on the connection. However, you can call
32034 * g_tls_connection_handshake() manually if you want to know for sure
32035 * whether the initial handshake succeeded or failed (as opposed to
32036 * just immediately trying to write to @conn's output stream, in which
32037 * case if it fails, it may not be possible to tell if it failed
32038 * before or after completing the handshake).
32040 * Likewise, on the server side, although a handshake is necessary at
32041 * the beginning of the communication, you do not need to call this
32042 * function explicitly unless you want clearer error reporting.
32043 * However, you may call g_tls_connection_handshake() later on to
32044 * renegotiate parameters (encryption methods, etc) with the client.
32046 * #GTlsConnection::accept_certificate may be emitted during the
32049 * Returns: success or failure
32055 * g_tls_connection_handshake_async:
32056 * @conn: a #GTlsConnection
32057 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
32058 * @cancellable: (allow-none): a #GCancellable, or %NULL
32059 * @callback: callback to call when the handshake is complete
32060 * @user_data: the data to pass to the callback function
32062 * Asynchronously performs a TLS handshake on @conn. See
32063 * g_tls_connection_handshake() for more information.
32070 * g_tls_connection_handshake_finish:
32071 * @conn: a #GTlsConnection
32072 * @result: a #GAsyncResult.
32073 * @error: a #GError pointer, or %NULL
32075 * Finish an asynchronous TLS handshake operation. See
32076 * g_tls_connection_handshake() for more information.
32078 * Returns: %TRUE on success, %FALSE on failure, in which case @error will be set.
32084 * g_tls_connection_set_certificate:
32085 * @conn: a #GTlsConnection
32086 * @certificate: the certificate to use for @conn
32088 * This sets the certificate that @conn will present to its peer
32089 * during the TLS handshake. For a #GTlsServerConnection, it is
32090 * mandatory to set this, and that will normally be done at construct
32093 * For a #GTlsClientConnection, this is optional. If a handshake fails
32094 * with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
32095 * requires a certificate, and if you try connecting again, you should
32096 * call this method first. You can call
32097 * g_tls_client_connection_get_accepted_cas() on the failed connection
32098 * to get a list of Certificate Authorities that the server will
32099 * accept certificates from.
32101 * (It is also possible that a server will allow the connection with
32102 * or without a certificate; in that case, if you don't provide a
32103 * certificate, you can tell that the server requested one by the fact
32104 * that g_tls_client_connection_get_accepted_cas() will return
32112 * g_tls_connection_set_database:
32113 * @conn: a #GTlsConnection
32114 * @database: a #GTlsDatabase
32116 * Sets the certificate database that is used to verify peer certificates.
32117 * This is set to the default database by default. See
32118 * g_tls_backend_get_default_database(). If set to %NULL, then
32119 * peer certificate validation will always set the
32120 * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
32121 * #GTlsConnection::accept-certificate will always be emitted on
32122 * client-side connections, unless that bit is not set in
32123 * #GTlsClientConnection:validation-flags).
32130 * g_tls_connection_set_interaction:
32131 * @conn: a connection
32132 * @interaction: (allow-none): an interaction object, or %NULL
32134 * Set the object that will be used to interact with the user. It will be used
32135 * for things like prompting the user for passwords.
32137 * The @interaction argument will normally be a derived subclass of
32138 * #GTlsInteraction. %NULL can also be provided if no user interaction
32139 * should occur for this connection.
32146 * g_tls_connection_set_rehandshake_mode:
32147 * @conn: a #GTlsConnection
32148 * @mode: the rehandshaking mode
32150 * Sets how @conn behaves with respect to rehandshaking requests.
32152 * %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
32153 * rehandshake after the initial handshake is complete. (For a client,
32154 * this means it will refuse rehandshake requests from the server, and
32155 * for a server, this means it will close the connection with an error
32156 * if the client attempts to rehandshake.)
32158 * %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
32159 * rehandshake only if the other end of the connection supports the
32160 * TLS <literal>renegotiation_info</literal> extension. This is the
32161 * default behavior, but means that rehandshaking will not work
32162 * against older implementations that do not support that extension.
32164 * %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
32165 * rehandshaking even without the
32166 * <literal>renegotiation_info</literal> extension. On the server side
32167 * in particular, this is not recommended, since it leaves the server
32168 * open to certain attacks. However, this mode is necessary if you
32169 * need to allow renegotiation with older client software.
32176 * g_tls_connection_set_require_close_notify:
32177 * @conn: a #GTlsConnection
32178 * @require_close_notify: whether or not to require close notification
32180 * Sets whether or not @conn expects a proper TLS close notification
32181 * before the connection is closed. If this is %TRUE (the default),
32182 * then @conn will expect to receive a TLS close notification from its
32183 * peer before the connection is closed, and will return a
32184 * %G_TLS_ERROR_EOF error if the connection is closed without proper
32185 * notification (since this may indicate a network error, or
32186 * man-in-the-middle attack).
32188 * In some protocols, the application will know whether or not the
32189 * connection was closed cleanly based on application-level data
32190 * (because the application-level data includes a length field, or is
32191 * somehow self-delimiting); in this case, the close notify is
32192 * redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
32193 * in TLS 1.0 it is technically an error, but often done anyway.) You
32194 * can use g_tls_connection_set_require_close_notify() to tell @conn
32195 * to allow an "unannounced" connection close, in which case the close
32196 * will show up as a 0-length read, as in a non-TLS
32197 * #GSocketConnection, and it is up to the application to check that
32198 * the data has been fully received.
32200 * Note that this only affects the behavior when the peer closes the
32201 * connection; when the application calls g_io_stream_close() itself
32202 * on @conn, this will send a close notification regardless of the
32203 * setting of this property. If you explicitly want to do an unclean
32204 * close, you can close @conn's #GTlsConnection:base-io-stream rather
32205 * than closing @conn itself.
32212 * g_tls_connection_set_use_system_certdb:
32213 * @conn: a #GTlsConnection
32214 * @use_system_certdb: whether to use the system certificate database
32216 * Sets whether @conn uses the system certificate database to verify
32217 * peer certificates. This is %TRUE by default. If set to %FALSE, then
32218 * peer certificate validation will always set the
32219 * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
32220 * #GTlsConnection::accept-certificate will always be emitted on
32221 * client-side connections, unless that bit is not set in
32222 * #GTlsClientConnection:validation-flags).
32224 * Deprecated: 2.30: Use g_tls_connection_set_database() instead
32229 * g_tls_database_create_certificate_handle:
32230 * @self: a #GTlsDatabase
32231 * @certificate: certificate for which to create a handle.
32233 * Create a handle string for the certificate. The database will only be able
32234 * to create a handle for certificates that originate from the database. In
32235 * cases where the database cannot create a handle for a certificate, %NULL
32236 * will be returned.
32238 * This handle should be stable across various instances of the application,
32239 * and between applications. If a certificate is modified in the database,
32240 * then it is not guaranteed that this handle will continue to point to it.
32242 * Returns: (allow-none): a newly allocated string containing the handle.
32248 * g_tls_database_lookup_certificate_for_handle:
32249 * @self: a #GTlsDatabase
32250 * @handle: a certificate handle
32251 * @interaction: (allow-none): used to interact with the user if necessary
32252 * @flags: Flags which affect the lookup.
32253 * @cancellable: (allow-none): a #GCancellable, or %NULL
32254 * @error: (allow-none): a #GError, or %NULL
32256 * Lookup a certificate by its handle.
32258 * The handle should have been created by calling
32259 * g_tls_database_create_certificate_handle() on a #GTlsDatabase object of
32260 * the same TLS backend. The handle is designed to remain valid across
32261 * instantiations of the database.
32263 * If the handle is no longer valid, or does not point to a certificate in
32264 * this database, then %NULL will be returned.
32266 * This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
32267 * the lookup operation asynchronously.
32269 * Returns: (transfer full) (allow-none): a newly allocated #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
32275 * g_tls_database_lookup_certificate_for_handle_async:
32276 * @self: a #GTlsDatabase
32277 * @handle: a certificate handle
32278 * @interaction: (allow-none): used to interact with the user if necessary
32279 * @flags: Flags which affect the lookup.
32280 * @cancellable: (allow-none): a #GCancellable, or %NULL
32281 * @callback: callback to call when the operation completes
32282 * @user_data: the data to pass to the callback function
32284 * Asynchronously lookup a certificate by its handle in the database. See
32285 * g_tls_database_lookup_certificate_for_handle() for more information.
32292 * g_tls_database_lookup_certificate_for_handle_finish:
32293 * @self: a #GTlsDatabase
32294 * @result: a #GAsyncResult.
32295 * @error: a #GError pointer, or %NULL
32297 * Finish an asynchronous lookup of a certificate by its handle. See
32298 * g_tls_database_lookup_certificate_handle() for more information.
32300 * If the handle is no longer valid, or does not point to a certificate in
32301 * this database, then %NULL will be returned.
32303 * Returns: (transfer full): a newly allocated #GTlsCertificate object. Use g_object_unref() to release the certificate.
32309 * g_tls_database_lookup_certificate_issuer:
32310 * @self: a #GTlsDatabase
32311 * @certificate: a #GTlsCertificate
32312 * @interaction: (allow-none): used to interact with the user if necessary
32313 * @flags: flags which affect the lookup operation
32314 * @cancellable: (allow-none): a #GCancellable, or %NULL
32315 * @error: (allow-none): a #GError, or %NULL
32317 * Lookup the issuer of @certificate in the database.
32319 * The %issuer property
32320 * of @certificate is not modified, and the two certificates are not hooked
32323 * This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
32324 * the lookup operation asynchronously.
32326 * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
32332 * g_tls_database_lookup_certificate_issuer_async:
32333 * @self: a #GTlsDatabase
32334 * @certificate: a #GTlsCertificate
32335 * @interaction: (allow-none): used to interact with the user if necessary
32336 * @flags: flags which affect the lookup operation
32337 * @cancellable: (allow-none): a #GCancellable, or %NULL
32338 * @callback: callback to call when the operation completes
32339 * @user_data: the data to pass to the callback function
32341 * Asynchronously lookup the issuer of @certificate in the database. See
32342 * g_tls_database_lookup_certificate_issuer() for more information.
32349 * g_tls_database_lookup_certificate_issuer_finish:
32350 * @self: a #GTlsDatabase
32351 * @result: a #GAsyncResult.
32352 * @error: a #GError pointer, or %NULL
32354 * Finish an asynchronous lookup issuer operation. See
32355 * g_tls_database_lookup_certificate_issuer() for more information.
32357 * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
32363 * g_tls_database_lookup_certificates_issued_by:
32364 * @self: a #GTlsDatabase
32365 * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
32366 * @interaction: (allow-none): used to interact with the user if necessary
32367 * @flags: Flags which affect the lookup operation.
32368 * @cancellable: (allow-none): a #GCancellable, or %NULL
32369 * @error: (allow-none): a #GError, or %NULL
32371 * Lookup certificates issued by this issuer in the database.
32373 * This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
32374 * the lookup operation asynchronously.
32376 * 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.
32382 * g_tls_database_lookup_certificates_issued_by_async:
32383 * @self: a #GTlsDatabase
32384 * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
32385 * @interaction: (allow-none): used to interact with the user if necessary
32386 * @flags: Flags which affect the lookup operation.
32387 * @cancellable: (allow-none): a #GCancellable, or %NULL
32388 * @callback: callback to call when the operation completes
32389 * @user_data: the data to pass to the callback function
32391 * Asynchronously lookup certificates issued by this issuer in the database. See
32392 * g_tls_database_lookup_certificates_issued_by() for more information.
32394 * The database may choose to hold a reference to the issuer byte array for the duration
32395 * of of this asynchronous operation. The byte array should not be modified during
32403 * g_tls_database_lookup_certificates_issued_by_finish:
32404 * @self: a #GTlsDatabase
32405 * @result: a #GAsyncResult.
32406 * @error: a #GError pointer, or %NULL
32408 * Finish an asynchronous lookup of certificates. See
32409 * g_tls_database_lookup_certificates_issued_by() for more information.
32411 * 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.
32417 * g_tls_database_verify_chain:
32418 * @self: a #GTlsDatabase
32419 * @chain: a #GTlsCertificate chain
32420 * @purpose: the purpose that this certificate chain will be used for.
32421 * @identity: (allow-none): the expected peer identity
32422 * @interaction: (allow-none): used to interact with the user if necessary
32423 * @flags: additional verify flags
32424 * @cancellable: (allow-none): a #GCancellable, or %NULL
32425 * @error: (allow-none): a #GError, or %NULL
32427 * Verify's a certificate chain after looking up and adding any missing
32428 * certificates to the chain.
32430 * @chain is a chain of #GTlsCertificate objects each pointing to the next
32431 * certificate in the chain by its %issuer property. The chain may initially
32432 * consist of one or more certificates. After the verification process is
32433 * complete, @chain may be modified by adding missing certificates, or removing
32434 * extra certificates. If a certificate anchor was found, then it is added to
32437 * @purpose describes the purpose (or usage) for which the certificate
32438 * is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
32439 * which means that the certificate is being used to authenticate a server
32440 * (and we are acting as the client).
32442 * The @identity is used to check for pinned certificates (trust exceptions)
32443 * in the database. These will override the normal verification process on a
32444 * host by host basis.
32446 * Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
32449 * This function can block, use g_tls_database_verify_chain_async() to perform
32450 * the verification operation asynchronously.
32452 * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
32458 * g_tls_database_verify_chain_async:
32459 * @self: a #GTlsDatabase
32460 * @chain: a #GTlsCertificate chain
32461 * @purpose: the purpose that this certificate chain will be used for.
32462 * @identity: (allow-none): the expected peer identity
32463 * @interaction: (allow-none): used to interact with the user if necessary
32464 * @flags: additional verify flags
32465 * @cancellable: (allow-none): a #GCancellable, or %NULL
32466 * @callback: callback to call when the operation completes
32467 * @user_data: the data to pass to the callback function
32469 * Asynchronously verify's a certificate chain after looking up and adding
32470 * any missing certificates to the chain. See g_tls_database_verify_chain()
32471 * for more information.
32478 * g_tls_database_verify_chain_finish:
32479 * @self: a #GTlsDatabase
32480 * @result: a #GAsyncResult.
32481 * @error: a #GError pointer, or %NULL
32483 * Finish an asynchronous verify chain operation. See
32484 * g_tls_database_verify_chain() for more information. *
32486 * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
32492 * g_tls_error_quark:
32494 * Gets the TLS error quark.
32496 * Returns: a #GQuark.
32502 * g_tls_file_database_new:
32503 * @anchors: filename of anchor certificate authorities.
32504 * @error: #GError for error reporting, or %NULL to ignore.
32506 * Creates a new #GTlsFileDatabase which uses anchor certificate authorities
32507 * in @anchors to verify certificate chains.
32509 * The certificates in @anchors must be PEM encoded.
32511 * Returns: (transfer full) (type GTlsFileDatabase): the new #GTlsFileDatabase, or %NULL on error
32517 * g_tls_interaction_ask_password:
32518 * @interaction: a #GTlsInteraction object
32519 * @password: a #GTlsPassword object
32520 * @cancellable: an optional #GCancellable cancellation object
32521 * @error: an optional location to place an error on failure
32523 * Run synchronous interaction to ask the user for a password. In general,
32524 * g_tls_interaction_invoke_ask_password() should be used instead of this
32527 * Derived subclasses usually implement a password prompt, although they may
32528 * also choose to provide a password from elsewhere. The @password value will
32529 * be filled in and then @callback will be called. Alternatively the user may
32530 * abort this password request, which will usually abort the TLS connection.
32532 * If the interaction is cancelled by the cancellation object, or by the
32533 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32534 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
32535 * not support immediate cancellation.
32537 * Returns: The status of the ask password interaction.
32543 * g_tls_interaction_ask_password_async:
32544 * @interaction: a #GTlsInteraction object
32545 * @password: a #GTlsPassword object
32546 * @cancellable: an optional #GCancellable cancellation object
32547 * @callback: (allow-none): will be called when the interaction completes
32548 * @user_data: (allow-none): data to pass to the @callback
32550 * Run asynchronous interaction to ask the user for a password. In general,
32551 * g_tls_interaction_invoke_ask_password() should be used instead of this
32554 * Derived subclasses usually implement a password prompt, although they may
32555 * also choose to provide a password from elsewhere. The @password value will
32556 * be filled in and then @callback will be called. Alternatively the user may
32557 * abort this password request, which will usually abort the TLS connection.
32559 * If the interaction is cancelled by the cancellation object, or by the
32560 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32561 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
32562 * not support immediate cancellation.
32564 * Certain implementations may not support immediate cancellation.
32571 * g_tls_interaction_ask_password_finish:
32572 * @interaction: a #GTlsInteraction object
32573 * @result: the result passed to the callback
32574 * @error: an optional location to place an error on failure
32576 * Complete an ask password user interaction request. This should be once
32577 * the g_tls_interaction_ask_password_async() completion callback is called.
32579 * If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
32580 * to g_tls_interaction_ask_password() will have its password filled in.
32582 * If the interaction is cancelled by the cancellation object, or by the
32583 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32584 * contains a %G_IO_ERROR_CANCELLED error code.
32586 * Returns: The status of the ask password interaction.
32592 * g_tls_interaction_invoke_ask_password:
32593 * @interaction: a #GTlsInteraction object
32594 * @password: a #GTlsPassword object
32595 * @cancellable: an optional #GCancellable cancellation object
32596 * @error: an optional location to place an error on failure
32598 * Invoke the interaction to ask the user for a password. It invokes this
32599 * interaction in the main loop, specifically the #GMainContext returned by
32600 * g_main_context_get_thread_default() when the interaction is created. This
32601 * is called by called by #GTlsConnection or #GTlsDatabase to ask the user
32604 * Derived subclasses usually implement a password prompt, although they may
32605 * also choose to provide a password from elsewhere. The @password value will
32606 * be filled in and then @callback will be called. Alternatively the user may
32607 * abort this password request, which will usually abort the TLS connection.
32609 * The implementation can either be a synchronous (eg: modal dialog) or an
32610 * asynchronous one (eg: modeless dialog). This function will take care of
32611 * calling which ever one correctly.
32613 * If the interaction is cancelled by the cancellation object, or by the
32614 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32615 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
32616 * not support immediate cancellation.
32618 * Returns: The status of the ask password interaction.
32624 * g_tls_password_get_description:
32625 * @password: a #GTlsPassword object
32627 * Get a description string about what the password will be used for.
32629 * Returns: The description of the password.
32635 * g_tls_password_get_flags:
32636 * @password: a #GTlsPassword object
32638 * Get flags about the password.
32640 * Returns: The flags about the password.
32646 * g_tls_password_get_value:
32647 * @password: a #GTlsPassword object
32648 * @length: (allow-none): location to place the length of the password.
32650 * Get the password value. If @length is not %NULL then it will be
32651 * filled in with the length of the password value. (Note that the
32652 * password value is not nul-terminated, so you can only pass %NULL
32653 * for @length in contexts where you know the password will have a
32654 * certain fixed length.)
32656 * Returns: The password value (owned by the password object).
32662 * g_tls_password_get_warning:
32663 * @password: a #GTlsPassword object
32665 * Get a user readable translated warning. Usually this warning is a
32666 * representation of the password flags returned from
32667 * g_tls_password_get_flags().
32669 * Returns: The warning.
32675 * g_tls_password_new:
32676 * @flags: the password flags
32677 * @description: description of what the password is for
32679 * Create a new #GTlsPassword object.
32681 * Returns: (transfer full): The newly allocated password object
32686 * g_tls_password_set_description:
32687 * @password: a #GTlsPassword object
32688 * @description: The description of the password
32690 * Set a description string about what the password will be used for.
32697 * g_tls_password_set_flags:
32698 * @password: a #GTlsPassword object
32699 * @flags: The flags about the password
32701 * Set flags about the password.
32708 * g_tls_password_set_value:
32709 * @password: a #GTlsPassword object
32710 * @value: the new password value
32711 * @length: the length of the password, or -1
32713 * Set the value for this password. The @value will be copied by the password
32716 * Specify the @length, for a non-nul-terminated password. Pass -1 as
32717 * @length if using a nul-terminated password, and @length will be
32718 * calculated automatically. (Note that the terminating nul is not
32719 * considered part of the password in this case.)
32726 * g_tls_password_set_value_full:
32727 * @password: a #GTlsPassword object
32728 * @value: the value for the password
32729 * @length: the length of the password, or -1
32730 * @destroy: (allow-none): a function to use to free the password.
32732 * Provide the value for this password.
32734 * The @value will be owned by the password object, and later freed using
32735 * the @destroy function callback.
32737 * Specify the @length, for a non-nul-terminated password. Pass -1 as
32738 * @length if using a nul-terminated password, and @length will be
32739 * calculated automatically. (Note that the terminating nul is not
32740 * considered part of the password in this case.)
32742 * Virtual: set_value
32748 * g_tls_password_set_warning:
32749 * @password: a #GTlsPassword object
32750 * @warning: The user readable warning
32752 * Set a user readable translated warning. Usually this warning is a
32753 * representation of the password flags returned from
32754 * g_tls_password_get_flags().
32761 * g_tls_server_connection_new:
32762 * @base_io_stream: the #GIOStream to wrap
32763 * @certificate: (allow-none): the default server certificate, or %NULL
32764 * @error: #GError for error reporting, or %NULL to ignore.
32766 * Creates a new #GTlsServerConnection wrapping @base_io_stream (which
32767 * must have pollable input and output streams).
32769 * Returns: (transfer full) (type GTlsServerConnection): the new #GTlsServerConnection, or %NULL on error
32775 * g_unix_connection_receive_credentials:
32776 * @connection: A #GUnixConnection.
32777 * @cancellable: (allow-none): A #GCancellable or %NULL.
32778 * @error: Return location for error or %NULL.
32780 * Receives credentials from the sending end of the connection. The
32781 * sending end has to call g_unix_connection_send_credentials() (or
32782 * similar) for this to work.
32784 * As well as reading the credentials this also reads (and discards) a
32785 * single byte from the stream, as this is required for credentials
32786 * passing to work on some implementations.
32788 * Other ways to exchange credentials with a foreign peer includes the
32789 * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
32791 * Returns: (transfer full): Received credentials on success (free with g_object_unref()), %NULL if @error is set.
32797 * g_unix_connection_receive_credentials_async:
32798 * @connection: A #GUnixConnection.
32799 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32800 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
32801 * @user_data: (closure): the data to pass to callback function
32803 * Asynchronously receive credentials.
32805 * For more details, see g_unix_connection_receive_credentials() which is
32806 * the synchronous version of this call.
32808 * When the operation is finished, @callback will be called. You can then call
32809 * g_unix_connection_receive_credentials_finish() to get the result of the operation.
32816 * g_unix_connection_receive_credentials_finish:
32817 * @connection: A #GUnixConnection.
32818 * @result: a #GAsyncResult.
32819 * @error: a #GError, or %NULL
32821 * Finishes an asynchronous receive credentials operation started with
32822 * g_unix_connection_receive_credentials_async().
32824 * Returns: (transfer full): a #GCredentials, or %NULL on error. Free the returned object with g_object_unref().
32830 * g_unix_connection_receive_fd:
32831 * @connection: a #GUnixConnection
32832 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
32833 * @error: (allow-none): #GError for error reporting, or %NULL to ignore
32835 * Receives a file descriptor from the sending end of the connection.
32836 * The sending end has to call g_unix_connection_send_fd() for this
32839 * As well as reading the fd this also reads a single byte from the
32840 * stream, as this is required for fd passing to work on some
32843 * Returns: a file descriptor on success, -1 on error.
32849 * g_unix_connection_send_credentials:
32850 * @connection: A #GUnixConnection.
32851 * @cancellable: (allow-none): A #GCancellable or %NULL.
32852 * @error: Return location for error or %NULL.
32854 * Passes the credentials of the current user the receiving side
32855 * of the connection. The receiving end has to call
32856 * g_unix_connection_receive_credentials() (or similar) to accept the
32859 * As well as sending the credentials this also writes a single NUL
32860 * byte to the stream, as this is required for credentials passing to
32861 * work on some implementations.
32863 * Other ways to exchange credentials with a foreign peer includes the
32864 * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
32866 * Returns: %TRUE on success, %FALSE if @error is set.
32872 * g_unix_connection_send_credentials_async:
32873 * @connection: A #GUnixConnection.
32874 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32875 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
32876 * @user_data: (closure): the data to pass to callback function
32878 * Asynchronously send credentials.
32880 * For more details, see g_unix_connection_send_credentials() which is
32881 * the synchronous version of this call.
32883 * When the operation is finished, @callback will be called. You can then call
32884 * g_unix_connection_send_credentials_finish() to get the result of the operation.
32891 * g_unix_connection_send_credentials_finish:
32892 * @connection: A #GUnixConnection.
32893 * @result: a #GAsyncResult.
32894 * @error: a #GError, or %NULL
32896 * Finishes an asynchronous send credentials operation started with
32897 * g_unix_connection_send_credentials_async().
32899 * Returns: %TRUE if the operation was successful, otherwise %FALSE.
32905 * g_unix_connection_send_fd:
32906 * @connection: a #GUnixConnection
32907 * @fd: a file descriptor
32908 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32909 * @error: (allow-none): #GError for error reporting, or %NULL to ignore.
32911 * Passes a file descriptor to the receiving side of the
32912 * connection. The receiving end has to call g_unix_connection_receive_fd()
32913 * to accept the file descriptor.
32915 * As well as sending the fd this also writes a single byte to the
32916 * stream, as this is required for fd passing to work on some
32919 * Returns: a %TRUE on success, %NULL on error.
32925 * g_unix_credentials_message_get_credentials:
32926 * @message: A #GUnixCredentialsMessage.
32928 * Gets the credentials stored in @message.
32930 * Returns: (transfer none): A #GCredentials instance. Do not free, it is owned by @message.
32936 * g_unix_credentials_message_is_supported:
32938 * Checks if passing #GCredentials on a #GSocket is supported on this platform.
32940 * Returns: %TRUE if supported, %FALSE otherwise
32946 * g_unix_credentials_message_new:
32948 * Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
32950 * Returns: a new #GUnixCredentialsMessage
32956 * g_unix_credentials_message_new_with_credentials:
32957 * @credentials: A #GCredentials object.
32959 * Creates a new #GUnixCredentialsMessage holding @credentials.
32961 * Returns: a new #GUnixCredentialsMessage
32967 * g_unix_fd_list_append:
32968 * @list: a #GUnixFDList
32969 * @fd: a valid open file descriptor
32970 * @error: a #GError pointer
32972 * Adds a file descriptor to @list.
32974 * The file descriptor is duplicated using dup(). You keep your copy
32975 * of the descriptor and the copy contained in @list will be closed
32976 * when @list is finalized.
32978 * A possible cause of failure is exceeding the per-process or
32979 * system-wide file descriptor limit.
32981 * The index of the file descriptor in the list is returned. If you use
32982 * this index with g_unix_fd_list_get() then you will receive back a
32983 * duplicated copy of the same file descriptor.
32985 * Returns: the index of the appended fd in case of success, else -1 (and @error is set)
32991 * g_unix_fd_list_get:
32992 * @list: a #GUnixFDList
32993 * @index_: the index into the list
32994 * @error: a #GError pointer
32996 * Gets a file descriptor out of @list.
32998 * @index_ specifies the index of the file descriptor to get. It is a
32999 * programmer error for @index_ to be out of range; see
33000 * g_unix_fd_list_get_length().
33002 * The file descriptor is duplicated using dup() and set as
33003 * close-on-exec before being returned. You must call close() on it
33004 * when you are done.
33006 * A possible cause of failure is exceeding the per-process or
33007 * system-wide file descriptor limit.
33009 * Returns: the file descriptor, or -1 in case of error
33015 * g_unix_fd_list_get_length:
33016 * @list: a #GUnixFDList
33018 * Gets the length of @list (ie: the number of file descriptors
33019 * contained within).
33021 * Returns: the length of @list
33027 * g_unix_fd_list_new:
33029 * Creates a new #GUnixFDList containing no file descriptors.
33031 * Returns: a new #GUnixFDList
33037 * g_unix_fd_list_new_from_array:
33038 * @fds: (array length=n_fds): the initial list of file descriptors
33039 * @n_fds: the length of #fds, or -1
33041 * Creates a new #GUnixFDList containing the file descriptors given in
33042 * @fds. The file descriptors become the property of the new list and
33043 * may no longer be used by the caller. The array itself is owned by
33046 * Each file descriptor in the array should be set to close-on-exec.
33048 * If @n_fds is -1 then @fds must be terminated with -1.
33050 * Returns: a new #GUnixFDList
33056 * g_unix_fd_list_peek_fds:
33057 * @list: a #GUnixFDList
33058 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
33060 * Returns the array of file descriptors that is contained in this
33063 * After this call, the descriptors remain the property of @list. The
33064 * caller must not close them and must not free the array. The array is
33065 * valid only until @list is changed in any way.
33067 * If @length is non-%NULL then it is set to the number of file
33068 * descriptors in the returned array. The returned array is also
33069 * terminated with -1.
33071 * This function never returns %NULL. In case there are no file
33072 * descriptors contained in @list, an empty array is returned.
33074 * Returns: (array length=length) (transfer none): an array of file descriptors
33080 * g_unix_fd_list_steal_fds:
33081 * @list: a #GUnixFDList
33082 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
33084 * Returns the array of file descriptors that is contained in this
33087 * After this call, the descriptors are no longer contained in
33088 * @list. Further calls will return an empty list (unless more
33089 * descriptors have been added).
33091 * The return result of this function must be freed with g_free().
33092 * The caller is also responsible for closing all of the file
33093 * descriptors. The file descriptors in the array are set to
33096 * If @length is non-%NULL then it is set to the number of file
33097 * descriptors in the returned array. The returned array is also
33098 * terminated with -1.
33100 * This function never returns %NULL. In case there are no file
33101 * descriptors contained in @list, an empty array is returned.
33103 * Returns: (array length=length) (transfer full): an array of file descriptors
33109 * g_unix_fd_message_append_fd:
33110 * @message: a #GUnixFDMessage
33111 * @fd: a valid open file descriptor
33112 * @error: a #GError pointer
33114 * Adds a file descriptor to @message.
33116 * The file descriptor is duplicated using dup(). You keep your copy
33117 * of the descriptor and the copy contained in @message will be closed
33118 * when @message is finalized.
33120 * A possible cause of failure is exceeding the per-process or
33121 * system-wide file descriptor limit.
33123 * Returns: %TRUE in case of success, else %FALSE (and @error is set)
33129 * g_unix_fd_message_get_fd_list:
33130 * @message: a #GUnixFDMessage
33132 * Gets the #GUnixFDList contained in @message. This function does not
33133 * return a reference to the caller, but the returned list is valid for
33134 * the lifetime of @message.
33136 * Returns: (transfer none): the #GUnixFDList from @message
33142 * g_unix_fd_message_new:
33144 * Creates a new #GUnixFDMessage containing an empty file descriptor
33147 * Returns: a new #GUnixFDMessage
33153 * g_unix_fd_message_new_with_fd_list:
33154 * @fd_list: a #GUnixFDList
33156 * Creates a new #GUnixFDMessage containing @list.
33158 * Returns: a new #GUnixFDMessage
33164 * g_unix_fd_message_steal_fds:
33165 * @message: a #GUnixFDMessage
33166 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
33168 * Returns the array of file descriptors that is contained in this
33171 * After this call, the descriptors are no longer contained in
33172 * @message. Further calls will return an empty list (unless more
33173 * descriptors have been added).
33175 * The return result of this function must be freed with g_free().
33176 * The caller is also responsible for closing all of the file
33179 * If @length is non-%NULL then it is set to the number of file
33180 * descriptors in the returned array. The returned array is also
33181 * terminated with -1.
33183 * This function never returns %NULL. In case there are no file
33184 * descriptors contained in @message, an empty array is returned.
33186 * Returns: (array length=length) (transfer full): an array of file descriptors
33192 * g_unix_input_stream_get_close_fd:
33193 * @stream: a #GUnixInputStream
33195 * Returns whether the file descriptor of @stream will be
33196 * closed when the stream is closed.
33198 * Returns: %TRUE if the file descriptor is closed when done
33204 * g_unix_input_stream_get_fd:
33205 * @stream: a #GUnixInputStream
33207 * Return the UNIX file descriptor that the stream reads from.
33209 * Returns: The file descriptor of @stream
33215 * g_unix_input_stream_new:
33216 * @fd: a UNIX file descriptor
33217 * @close_fd: %TRUE to close the file descriptor when done
33219 * Creates a new #GUnixInputStream for the given @fd.
33221 * If @close_fd is %TRUE, the file descriptor will be closed
33222 * when the stream is closed.
33224 * Returns: a new #GUnixInputStream
33229 * g_unix_input_stream_set_close_fd:
33230 * @stream: a #GUnixInputStream
33231 * @close_fd: %TRUE to close the file descriptor when done
33233 * Sets whether the file descriptor of @stream shall be closed
33234 * when the stream is closed.
33241 * g_unix_is_mount_path_system_internal:
33242 * @mount_path: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
33244 * Determines if @mount_path is considered an implementation of the
33245 * OS. This is primarily used for hiding mountable and mounted volumes
33246 * that only are used in the OS and has little to no relevance to the
33249 * Returns: %TRUE if @mount_path is considered an implementation detail of the OS.
33254 * g_unix_mount_at: (skip)
33255 * @mount_path: path for a possible unix mount.
33256 * @time_read: (out) (allow-none): guint64 to contain a timestamp.
33258 * Gets a #GUnixMountEntry for a given mount path. If @time_read
33259 * is set, it will be filled with a unix timestamp for checking
33260 * if the mounts have changed since with g_unix_mounts_changed_since().
33262 * Returns: (transfer full): a #GUnixMountEntry.
33267 * g_unix_mount_compare:
33268 * @mount1: first #GUnixMountEntry to compare.
33269 * @mount2: second #GUnixMountEntry to compare.
33271 * Compares two unix mounts.
33273 * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
33278 * g_unix_mount_free:
33279 * @mount_entry: a #GUnixMountEntry.
33281 * Frees a unix mount.
33286 * g_unix_mount_get_device_path:
33287 * @mount_entry: a #GUnixMount.
33289 * Gets the device path for a unix mount.
33291 * Returns: a string containing the device path.
33296 * g_unix_mount_get_fs_type:
33297 * @mount_entry: a #GUnixMount.
33299 * Gets the filesystem type for the unix mount.
33301 * Returns: a string containing the file system type.
33306 * g_unix_mount_get_mount_path:
33307 * @mount_entry: input #GUnixMountEntry to get the mount path for.
33309 * Gets the mount path for a unix mount.
33311 * Returns: the mount path for @mount_entry.
33316 * g_unix_mount_guess_can_eject:
33317 * @mount_entry: a #GUnixMountEntry
33319 * Guesses whether a Unix mount can be ejected.
33321 * Returns: %TRUE if @mount_entry is deemed to be ejectable.
33326 * g_unix_mount_guess_icon:
33327 * @mount_entry: a #GUnixMountEntry
33329 * Guesses the icon of a Unix mount.
33331 * Returns: (transfer full): a #GIcon
33336 * g_unix_mount_guess_name:
33337 * @mount_entry: a #GUnixMountEntry
33339 * Guesses the name of a Unix mount.
33340 * The result is a translated string.
33342 * Returns: A newly allocated string that must be freed with g_free()
33347 * g_unix_mount_guess_should_display:
33348 * @mount_entry: a #GUnixMountEntry
33350 * Guesses whether a Unix mount should be displayed in the UI.
33352 * Returns: %TRUE if @mount_entry is deemed to be displayable.
33357 * g_unix_mount_guess_symbolic_icon:
33358 * @mount_entry: a #GUnixMountEntry
33360 * Guesses the symbolic icon of a Unix mount.
33362 * Returns: (transfer full): a #GIcon
33368 * g_unix_mount_is_readonly:
33369 * @mount_entry: a #GUnixMount.
33371 * Checks if a unix mount is mounted read only.
33373 * Returns: %TRUE if @mount_entry is read only.
33378 * g_unix_mount_is_system_internal:
33379 * @mount_entry: a #GUnixMount.
33381 * Checks if a unix mount is a system path.
33383 * Returns: %TRUE if the unix mount is for a system path.
33388 * g_unix_mount_monitor_new:
33390 * Gets a new #GUnixMountMonitor. The default rate limit for which the
33391 * monitor will report consecutive changes for the mount and mount
33392 * point entry files is the default for a #GFileMonitor. Use
33393 * g_unix_mount_monitor_set_rate_limit() to change this.
33395 * Returns: a #GUnixMountMonitor.
33400 * g_unix_mount_monitor_set_rate_limit:
33401 * @mount_monitor: a #GUnixMountMonitor
33402 * @limit_msec: a integer with the limit in milliseconds to poll for changes.
33404 * Sets the rate limit to which the @mount_monitor will report
33405 * consecutive change events to the mount and mount point entry files.
33412 * g_unix_mount_point_compare:
33413 * @mount1: a #GUnixMount.
33414 * @mount2: a #GUnixMount.
33416 * Compares two unix mount points.
33418 * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
33423 * g_unix_mount_point_free:
33424 * @mount_point: unix mount point to free.
33426 * Frees a unix mount point.
33431 * g_unix_mount_point_get_device_path:
33432 * @mount_point: a #GUnixMountPoint.
33434 * Gets the device path for a unix mount point.
33436 * Returns: a string containing the device path.
33441 * g_unix_mount_point_get_fs_type:
33442 * @mount_point: a #GUnixMountPoint.
33444 * Gets the file system type for the mount point.
33446 * Returns: a string containing the file system type.
33451 * g_unix_mount_point_get_mount_path:
33452 * @mount_point: a #GUnixMountPoint.
33454 * Gets the mount path for a unix mount point.
33456 * Returns: a string containing the mount path.
33461 * g_unix_mount_point_get_options:
33462 * @mount_point: a #GUnixMountPoint.
33464 * Gets the options for the mount point.
33466 * Returns: a string containing the options.
33472 * g_unix_mount_point_guess_can_eject:
33473 * @mount_point: a #GUnixMountPoint
33475 * Guesses whether a Unix mount point can be ejected.
33477 * Returns: %TRUE if @mount_point is deemed to be ejectable.
33482 * g_unix_mount_point_guess_icon:
33483 * @mount_point: a #GUnixMountPoint
33485 * Guesses the icon of a Unix mount point.
33487 * Returns: (transfer full): a #GIcon
33492 * g_unix_mount_point_guess_name:
33493 * @mount_point: a #GUnixMountPoint
33495 * Guesses the name of a Unix mount point.
33496 * The result is a translated string.
33498 * Returns: A newly allocated string that must be freed with g_free()
33503 * g_unix_mount_point_guess_symbolic_icon:
33504 * @mount_point: a #GUnixMountPoint
33506 * Guesses the symbolic icon of a Unix mount point.
33508 * Returns: (transfer full): a #GIcon
33514 * g_unix_mount_point_is_loopback:
33515 * @mount_point: a #GUnixMountPoint.
33517 * Checks if a unix mount point is a loopback device.
33519 * Returns: %TRUE if the mount point is a loopback. %FALSE otherwise.
33524 * g_unix_mount_point_is_readonly:
33525 * @mount_point: a #GUnixMountPoint.
33527 * Checks if a unix mount point is read only.
33529 * Returns: %TRUE if a mount point is read only.
33534 * g_unix_mount_point_is_user_mountable:
33535 * @mount_point: a #GUnixMountPoint.
33537 * Checks if a unix mount point is mountable by the user.
33539 * Returns: %TRUE if the mount point is user mountable.
33544 * g_unix_mount_points_changed_since:
33545 * @time: guint64 to contain a timestamp.
33547 * Checks if the unix mount points have changed since a given unix time.
33549 * Returns: %TRUE if the mount points have changed since @time.
33554 * g_unix_mount_points_get: (skip)
33555 * @time_read: (out) (allow-none): guint64 to contain a timestamp.
33557 * Gets a #GList of #GUnixMountPoint containing the unix mount points.
33558 * If @time_read is set, it will be filled with the mount timestamp,
33559 * allowing for checking if the mounts have changed with
33560 * g_unix_mount_points_changed_since().
33562 * Returns: (element-type GUnixMountPoint) (transfer full): a #GList of the UNIX mountpoints.
33567 * g_unix_mounts_changed_since:
33568 * @time: guint64 to contain a timestamp.
33570 * Checks if the unix mounts have changed since a given unix time.
33572 * Returns: %TRUE if the mounts have changed since @time.
33577 * g_unix_mounts_get: (skip)
33578 * @time_read: (out) (allow-none): guint64 to contain a timestamp, or %NULL
33580 * Gets a #GList of #GUnixMountEntry containing the unix mounts.
33581 * If @time_read is set, it will be filled with the mount
33582 * timestamp, allowing for checking if the mounts have changed
33583 * with g_unix_mounts_changed_since().
33585 * Returns: (element-type GUnixMountEntry) (transfer full): a #GList of the UNIX mounts.
33590 * g_unix_output_stream_get_close_fd:
33591 * @stream: a #GUnixOutputStream
33593 * Returns whether the file descriptor of @stream will be
33594 * closed when the stream is closed.
33596 * Returns: %TRUE if the file descriptor is closed when done
33602 * g_unix_output_stream_get_fd:
33603 * @stream: a #GUnixOutputStream
33605 * Return the UNIX file descriptor that the stream writes to.
33607 * Returns: The file descriptor of @stream
33613 * g_unix_output_stream_new:
33614 * @fd: a UNIX file descriptor
33615 * @close_fd: %TRUE to close the file descriptor when done
33617 * Creates a new #GUnixOutputStream for the given @fd.
33619 * If @close_fd, is %TRUE, the file descriptor will be closed when
33620 * the output stream is destroyed.
33622 * Returns: a new #GOutputStream
33627 * g_unix_output_stream_set_close_fd:
33628 * @stream: a #GUnixOutputStream
33629 * @close_fd: %TRUE to close the file descriptor when done
33631 * Sets whether the file descriptor of @stream shall be closed
33632 * when the stream is closed.
33639 * g_unix_socket_address_abstract_names_supported:
33641 * Checks if abstract UNIX domain socket names are supported.
33643 * Returns: %TRUE if supported, %FALSE otherwise
33649 * g_unix_socket_address_get_address_type:
33650 * @address: a #GInetSocketAddress
33652 * Gets @address's type.
33654 * Returns: a #GUnixSocketAddressType
33660 * g_unix_socket_address_get_is_abstract:
33661 * @address: a #GInetSocketAddress
33663 * Tests if @address is abstract.
33665 * Returns: %TRUE if the address is abstract, %FALSE otherwise
33667 * Deprecated: Use g_unix_socket_address_get_address_type()
33672 * g_unix_socket_address_get_path:
33673 * @address: a #GInetSocketAddress
33675 * Gets @address's path, or for abstract sockets the "name".
33677 * Guaranteed to be zero-terminated, but an abstract socket
33678 * may contain embedded zeros, and thus you should use
33679 * g_unix_socket_address_get_path_len() to get the true length
33682 * Returns: the path for @address
33688 * g_unix_socket_address_get_path_len:
33689 * @address: a #GInetSocketAddress
33691 * Gets the length of @address's path.
33693 * For details, see g_unix_socket_address_get_path().
33695 * Returns: the length of the path
33701 * g_unix_socket_address_new:
33702 * @path: the socket path
33704 * Creates a new #GUnixSocketAddress for @path.
33706 * To create abstract socket addresses, on systems that support that,
33707 * use g_unix_socket_address_new_abstract().
33709 * Returns: a new #GUnixSocketAddress
33715 * g_unix_socket_address_new_abstract:
33716 * @path: (array length=path_len) (element-type gchar): the abstract name
33717 * @path_len: the length of @path, or -1
33719 * Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
33720 * #GUnixSocketAddress for @path.
33722 * Returns: a new #GUnixSocketAddress
33723 * Deprecated: Use g_unix_socket_address_new_with_type().
33728 * g_unix_socket_address_new_with_type:
33729 * @path: (array length=path_len) (element-type gchar): the name
33730 * @path_len: the length of @path, or -1
33731 * @type: a #GUnixSocketAddressType
33733 * Creates a new #GUnixSocketAddress of type @type with name @path.
33735 * If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
33736 * calling g_unix_socket_address_new().
33738 * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
33739 * bytes of @path will be copied to the socket's path, and only those
33740 * bytes will be considered part of the name. (If @path_len is -1,
33741 * then @path is assumed to be NUL-terminated.) For example, if @path
33742 * was "test", then calling g_socket_address_get_native_size() on the
33743 * returned socket would return 7 (2 bytes of overhead, 1 byte for the
33744 * abstract-socket indicator byte, and 4 bytes for the name "test").
33746 * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
33747 * @path_len bytes of @path will be copied to the socket's path, the
33748 * rest of the path will be padded with 0 bytes, and the entire
33749 * zero-padded buffer will be considered the name. (As above, if
33750 * @path_len is -1, then @path is assumed to be NUL-terminated.) In
33751 * this case, g_socket_address_get_native_size() will always return
33752 * the full size of a <literal>struct sockaddr_un</literal>, although
33753 * g_unix_socket_address_get_path_len() will still return just the
33756 * %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
33757 * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
33758 * when connecting to a server created by another process, you must
33759 * use the appropriate type corresponding to how that process created
33760 * its listening socket.
33762 * Returns: a new #GUnixSocketAddress
33768 * g_vfs_get_default:
33770 * Gets the default #GVfs for the system.
33772 * Returns: (transfer none): a #GVfs.
33777 * g_vfs_get_file_for_path:
33779 * @path: a string containing a VFS path.
33781 * Gets a #GFile for @path.
33783 * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
33788 * g_vfs_get_file_for_uri:
33790 * @uri: a string containing a URI
33792 * Gets a #GFile for @uri.
33794 * This operation never fails, but the returned object
33795 * might not support any I/O operation if the URI
33796 * is malformed or if the URI scheme is not supported.
33798 * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
33805 * Gets the local #GVfs for the system.
33807 * Returns: (transfer none): a #GVfs.
33812 * g_vfs_get_supported_uri_schemes:
33815 * Gets a list of URI schemes supported by @vfs.
33817 * Returns: (transfer none): a %NULL-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
33825 * Checks if the VFS is active.
33827 * Returns: %TRUE if construction of the @vfs was successful and it is now active.
33832 * g_vfs_parse_name:
33834 * @parse_name: a string to be parsed by the VFS module.
33836 * This operation never fails, but the returned object might
33837 * not support any I/O operations if the @parse_name cannot
33838 * be parsed by the #GVfs module.
33840 * Returns: (transfer full): a #GFile for the given @parse_name. Free the returned object with g_object_unref().
33845 * g_volume_can_eject:
33846 * @volume: a #GVolume.
33848 * Checks if a volume can be ejected.
33850 * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise.
33855 * g_volume_can_mount:
33856 * @volume: a #GVolume.
33858 * Checks if a volume can be mounted.
33860 * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise.
33866 * @volume: a #GVolume.
33867 * @flags: flags affecting the unmount if required for eject
33868 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33869 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33870 * @user_data: user data that gets passed to @callback
33872 * Ejects a volume. This is an asynchronous operation, and is
33873 * finished by calling g_volume_eject_finish() with the @volume
33874 * and #GAsyncResult returned in the @callback.
33876 * Deprecated: 2.22: Use g_volume_eject_with_operation() instead.
33881 * g_volume_eject_finish:
33882 * @volume: pointer to a #GVolume.
33883 * @result: a #GAsyncResult.
33884 * @error: a #GError location to store an error, or %NULL to ignore
33886 * Finishes ejecting a volume. If any errors occurred during the operation,
33887 * @error will be set to contain the errors and %FALSE will be returned.
33889 * Returns: %TRUE, %FALSE if operation failed.
33890 * Deprecated: 2.22: Use g_volume_eject_with_operation_finish() instead.
33895 * g_volume_eject_with_operation:
33896 * @volume: a #GVolume.
33897 * @flags: flags affecting the unmount if required for eject
33898 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
33899 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33900 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33901 * @user_data: user data passed to @callback.
33903 * Ejects a volume. This is an asynchronous operation, and is
33904 * finished by calling g_volume_eject_with_operation_finish() with the @volume
33905 * and #GAsyncResult data returned in the @callback.
33912 * g_volume_eject_with_operation_finish:
33913 * @volume: a #GVolume.
33914 * @result: a #GAsyncResult.
33915 * @error: a #GError location to store the error occurring, or %NULL to ignore.
33917 * Finishes ejecting a volume. If any errors occurred during the operation,
33918 * @error will be set to contain the errors and %FALSE will be returned.
33920 * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise.
33926 * g_volume_enumerate_identifiers:
33927 * @volume: a #GVolume
33929 * Gets the kinds of <link linkend="volume-identifier">identifiers</link>
33930 * that @volume has. Use g_volume_get_identifier() to obtain
33931 * the identifiers themselves.
33933 * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
33938 * g_volume_get_activation_root:
33939 * @volume: a #GVolume
33941 * Gets the activation root for a #GVolume if it is known ahead of
33942 * mount time. Returns %NULL otherwise. If not %NULL and if @volume
33943 * is mounted, then the result of g_mount_get_root() on the
33944 * #GMount object obtained from g_volume_get_mount() will always
33945 * either be equal or a prefix of what this function returns. In
33946 * other words, in code
33950 * GFile *mount_root
33951 * GFile *volume_activation_root;
33953 * mount = g_volume_get_mount (volume); /* mounted, so never NULL */
33954 * mount_root = g_mount_get_root (mount);
33955 * volume_activation_root = g_volume_get_activation_root(volume); /* assume not NULL */
33956 * </programlisting>
33958 * then the expression
33961 * (g_file_has_prefix (volume_activation_root, mount_root) ||
33962 * g_file_equal (volume_activation_root, mount_root))
33963 * </programlisting>
33965 * will always be %TRUE.
33967 * Activation roots are typically used in #GVolumeMonitor
33968 * implementations to find the underlying mount to shadow, see
33969 * g_mount_is_shadowed() for more details.
33971 * Returns: (transfer full): the activation root of @volume or %NULL. Use g_object_unref() to free.
33977 * g_volume_get_drive:
33978 * @volume: a #GVolume.
33980 * Gets the drive for the @volume.
33982 * 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.
33987 * g_volume_get_icon:
33988 * @volume: a #GVolume.
33990 * Gets the icon for @volume.
33992 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
33997 * g_volume_get_identifier:
33998 * @volume: a #GVolume
33999 * @kind: the kind of identifier to return
34001 * Gets the identifier of the given kind for @volume.
34002 * See the <link linkend="volume-identifier">introduction</link>
34003 * for more information about volume identifiers.
34005 * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GVolume doesn't have this kind of identifier
34010 * g_volume_get_mount:
34011 * @volume: a #GVolume.
34013 * Gets the mount for the @volume.
34015 * 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.
34020 * g_volume_get_name:
34021 * @volume: a #GVolume.
34023 * Gets the name of @volume.
34025 * Returns: the name for the given @volume. The returned string should be freed with g_free() when no longer needed.
34030 * g_volume_get_sort_key:
34031 * @volume: A #GVolume.
34033 * Gets the sort key for @volume, if any.
34035 * Returns: Sorting key for @volume or %NULL if no such key is available.
34041 * g_volume_get_symbolic_icon:
34042 * @volume: a #GVolume.
34044 * Gets the symbolic icon for @volume.
34046 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
34052 * g_volume_get_uuid:
34053 * @volume: a #GVolume.
34055 * Gets the UUID for the @volume. The reference is typically based on
34056 * the file system UUID for the volume in question and should be
34057 * considered an opaque string. Returns %NULL if there is no UUID
34060 * 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.
34065 * g_volume_monitor_adopt_orphan_mount:
34066 * @mount: a #GMount object to find a parent for
34068 * This function should be called by any #GVolumeMonitor
34069 * implementation when a new #GMount object is created that is not
34070 * associated with a #GVolume object. It must be called just before
34071 * emitting the @mount_added signal.
34073 * If the return value is not %NULL, the caller must associate the
34074 * returned #GVolume object with the #GMount. This involves returning
34075 * it in its g_mount_get_volume() implementation. The caller must
34076 * also listen for the "removed" signal on the returned object
34077 * and give up its reference when handling that signal
34079 * Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
34080 * the implementor must take a reference to @mount and return it in
34081 * its g_volume_get_mount() implemented. Also, the implementor must
34082 * listen for the "unmounted" signal on @mount and give up its
34083 * reference upon handling that signal.
34085 * There are two main use cases for this function.
34087 * One is when implementing a user space file system driver that reads
34088 * blocks of a block device that is already represented by the native
34089 * volume monitor (for example a CD Audio file system driver). Such
34090 * a driver will generate its own #GMount object that needs to be
34091 * associated with the #GVolume object that represents the volume.
34093 * The other is for implementing a #GVolumeMonitor whose sole purpose
34094 * is to return #GVolume objects representing entries in the users
34095 * "favorite servers" list or similar.
34097 * Returns: (transfer full): the #GVolume object that is the parent for @mount or %NULL if no wants to adopt the #GMount.
34098 * 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.
34103 * g_volume_monitor_get:
34105 * Gets the volume monitor used by gio.
34107 * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call g_object_unref() when done with it.
34112 * g_volume_monitor_get_connected_drives:
34113 * @volume_monitor: a #GVolumeMonitor.
34115 * Gets a list of drives connected to the system.
34117 * The returned list should be freed with g_list_free(), after
34118 * its elements have been unreffed with g_object_unref().
34120 * Returns: (element-type GDrive) (transfer full): a #GList of connected #GDrive objects.
34125 * g_volume_monitor_get_mount_for_uuid:
34126 * @volume_monitor: a #GVolumeMonitor.
34127 * @uuid: the UUID to look for
34129 * Finds a #GMount object by its UUID (see g_mount_get_uuid())
34131 * Returns: (transfer full): a #GMount or %NULL if no such mount is available. Free the returned object with g_object_unref().
34136 * g_volume_monitor_get_mounts:
34137 * @volume_monitor: a #GVolumeMonitor.
34139 * Gets a list of the mounts on the system.
34141 * The returned list should be freed with g_list_free(), after
34142 * its elements have been unreffed with g_object_unref().
34144 * Returns: (element-type GMount) (transfer full): a #GList of #GMount objects.
34149 * g_volume_monitor_get_volume_for_uuid:
34150 * @volume_monitor: a #GVolumeMonitor.
34151 * @uuid: the UUID to look for
34153 * Finds a #GVolume object by its UUID (see g_volume_get_uuid())
34155 * Returns: (transfer full): a #GVolume or %NULL if no such volume is available. Free the returned object with g_object_unref().
34160 * g_volume_monitor_get_volumes:
34161 * @volume_monitor: a #GVolumeMonitor.
34163 * Gets a list of the volumes on the system.
34165 * The returned list should be freed with g_list_free(), after
34166 * its elements have been unreffed with g_object_unref().
34168 * Returns: (element-type GVolume) (transfer full): a #GList of #GVolume objects.
34174 * @volume: a #GVolume.
34175 * @flags: flags affecting the operation
34176 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
34177 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
34178 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
34179 * @user_data: user data that gets passed to @callback
34181 * Mounts a volume. This is an asynchronous operation, and is
34182 * finished by calling g_volume_mount_finish() with the @volume
34183 * and #GAsyncResult returned in the @callback.
34185 * Virtual: mount_fn
34190 * g_volume_mount_finish:
34191 * @volume: a #GVolume
34192 * @result: a #GAsyncResult
34193 * @error: a #GError location to store an error, or %NULL to ignore
34195 * Finishes mounting a volume. If any errors occurred during the operation,
34196 * @error will be set to contain the errors and %FALSE will be returned.
34198 * If the mount operation succeeded, g_volume_get_mount() on @volume
34199 * is guaranteed to return the mount right after calling this
34200 * function; there's no need to listen for the 'mount-added' signal on
34203 * Returns: %TRUE, %FALSE if operation failed.
34208 * g_volume_should_automount:
34209 * @volume: a #GVolume
34211 * Returns whether the volume should be automatically mounted.
34213 * Returns: %TRUE if the volume should be automatically mounted.
34218 * g_win32_input_stream_get_close_handle:
34219 * @stream: a #GWin32InputStream
34221 * Returns whether the handle of @stream will be
34222 * closed when the stream is closed.
34224 * Returns: %TRUE if the handle is closed when done
34230 * g_win32_input_stream_get_handle:
34231 * @stream: a #GWin32InputStream
34233 * Return the Windows file handle that the stream reads from.
34235 * Returns: The file handle of @stream
34241 * g_win32_input_stream_new:
34242 * @handle: a Win32 file handle
34243 * @close_handle: %TRUE to close the handle when done
34245 * Creates a new #GWin32InputStream for the given @handle.
34247 * If @close_handle is %TRUE, the handle will be closed
34248 * when the stream is closed.
34250 * Note that "handle" here means a Win32 HANDLE, not a "file descriptor"
34251 * as used in the Windows C libraries.
34253 * Returns: a new #GWin32InputStream
34258 * g_win32_input_stream_set_close_handle:
34259 * @stream: a #GWin32InputStream
34260 * @close_handle: %TRUE to close the handle when done
34262 * Sets whether the handle of @stream shall be closed
34263 * when the stream is closed.
34270 * g_win32_output_stream_get_close_handle:
34271 * @stream: a #GWin32OutputStream
34273 * Returns whether the handle of @stream will be closed when the
34274 * stream is closed.
34276 * Returns: %TRUE if the handle is closed when done
34282 * g_win32_output_stream_get_handle:
34283 * @stream: a #GWin32OutputStream
34285 * Return the Windows handle that the stream writes to.
34287 * Returns: The handle descriptor of @stream
34293 * g_win32_output_stream_new:
34294 * @handle: a Win32 file handle
34295 * @close_handle: %TRUE to close the handle when done
34297 * Creates a new #GWin32OutputStream for the given @handle.
34299 * If @close_handle, is %TRUE, the handle will be closed when the
34300 * output stream is destroyed.
34302 * Returns: a new #GOutputStream
34308 * g_win32_output_stream_set_close_handle:
34309 * @stream: a #GWin32OutputStream
34310 * @close_handle: %TRUE to close the handle when done
34312 * Sets whether the handle of @stream shall be closed when the stream
34320 * g_zlib_compressor_get_file_info:
34321 * @compressor: a #GZlibCompressor
34323 * Returns the #GZlibCompressor:file-info property.
34325 * Returns: (transfer none): a #GFileInfo, or %NULL
34331 * g_zlib_compressor_new:
34332 * @format: The format to use for the compressed data
34333 * @level: compression level (0-9), -1 for default
34335 * Creates a new #GZlibCompressor.
34337 * Returns: a new #GZlibCompressor
34343 * g_zlib_compressor_set_file_info:
34344 * @compressor: a #GZlibCompressor
34345 * @file_info: (allow-none): a #GFileInfo
34347 * Sets @file_info in @compressor. If non-%NULL, and @compressor's
34348 * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
34349 * it will be used to set the file name and modification time in
34350 * the GZIP header of the compressed data.
34352 * Note: it is an error to call this function while a compression is in
34353 * progress; it may only be called immediately after creation of @compressor,
34354 * or after resetting it with g_converter_reset().
34361 * g_zlib_decompressor_get_file_info:
34362 * @decompressor: a #GZlibDecompressor
34364 * Retrieves the #GFileInfo constructed from the GZIP header data
34365 * of compressed data processed by @compressor, or %NULL if @decompressor's
34366 * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
34367 * or the header data was not fully processed yet, or it not present in the
34368 * data stream at all.
34370 * Returns: (transfer none): a #GFileInfo, or %NULL
34376 * g_zlib_decompressor_new:
34377 * @format: The format to use for the compressed data
34379 * Creates a new #GZlibDecompressor.
34381 * Returns: a new #GZlibDecompressor
34387 * get_all_desktop_entries_for_mime_type:
34388 * @mime_type: a mime type.
34389 * @except: NULL or a strv list
34391 * Returns all the desktop ids for @mime_type. The desktop files
34392 * are listed in an order so that default applications are listed before
34393 * non-default ones, and handlers for inherited mimetypes are listed
34394 * after the base ones.
34396 * Optionally doesn't list the desktop ids given in the @except
34398 * Returns: a #GList containing the desktop ids which claim to handle @mime_type.
34403 * mime_info_cache_reload:
34404 * @dir: directory path which needs reloading.
34406 * Reload the mime information for the @dir.
34411 /************************************************************/
34412 /* THIS FILE IS GENERATED DO NOT EDIT */
34413 /************************************************************/