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 * GProxyAddressEnumerator:proxy-resolver:
1902 * The proxy resolver to use.
1909 * GRemoteActionGroupInterface:
1910 * @activate_action_full: the virtual function pointer for g_remote_action_group_activate_action_full()
1911 * @change_action_state_full: the virtual function pointer for g_remote_action_group_change_action_state_full()
1913 * The virtual function table for #GRemoteActionGroup.
1922 * The object that handles DNS resolution. Use g_resolver_get_default()
1923 * to get the default resolver.
1928 * GResolver::reload:
1929 * @resolver: a #GResolver
1931 * Emitted when the resolver notices that the system resolver
1932 * configuration has changed.
1937 * GSettings::change-event:
1938 * @settings: the object on which the signal was emitted
1939 * @keys: (array length=n_keys) (element-type GQuark) (allow-none): an array of #GQuark<!-- -->s for the changed keys, or %NULL
1940 * @n_keys: the length of the @keys array, or 0
1942 * The "change-event" signal is emitted once per change event that
1943 * affects this settings object. You should connect to this signal
1944 * only if you are interested in viewing groups of changes before they
1945 * are split out into multiple emissions of the "changed" signal.
1946 * For most use cases it is more appropriate to use the "changed" signal.
1948 * In the event that the change event applies to one or more specified
1949 * keys, @keys will be an array of #GQuark of length @n_keys. In the
1950 * event that the change event applies to the #GSettings object as a
1951 * whole (ie: potentially every key has been changed) then @keys will
1952 * be %NULL and @n_keys will be 0.
1954 * The default handler for this signal invokes the "changed" signal
1955 * for each affected key. If any other connected handler returns
1956 * %TRUE then this default functionality will be suppressed.
1958 * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
1963 * GSettings::changed:
1964 * @settings: the object on which the signal was emitted
1965 * @key: the name of the key that changed
1967 * The "changed" signal is emitted when a key has potentially changed.
1968 * You should call one of the g_settings_get() calls to check the new
1971 * This signal supports detailed connections. You can connect to the
1972 * detailed signal "changed::x" in order to only receive callbacks
1973 * when key "x" changes.
1978 * GSettings::writable-change-event:
1979 * @settings: the object on which the signal was emitted
1980 * @key: the quark of the key, or 0
1982 * The "writable-change-event" signal is emitted once per writability
1983 * change event that affects this settings object. You should connect
1984 * to this signal if you are interested in viewing groups of changes
1985 * before they are split out into multiple emissions of the
1986 * "writable-changed" signal. For most use cases it is more
1987 * appropriate to use the "writable-changed" signal.
1989 * In the event that the writability change applies only to a single
1990 * key, @key will be set to the #GQuark for that key. In the event
1991 * that the writability change affects the entire settings object,
1994 * The default handler for this signal invokes the "writable-changed"
1995 * and "changed" signals for each affected key. This is done because
1996 * changes in writability might also imply changes in value (if for
1997 * example, a new mandatory setting is introduced). If any other
1998 * connected handler returns %TRUE then this default functionality
1999 * will be suppressed.
2001 * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
2006 * GSettings::writable-changed:
2007 * @settings: the object on which the signal was emitted
2010 * The "writable-changed" signal is emitted when the writability of a
2011 * key has potentially changed. You should call
2012 * g_settings_is_writable() in order to determine the new status.
2014 * This signal supports detailed connections. You can connect to the
2015 * detailed signal "writable-changed::x" in order to only receive
2016 * callbacks when the writability of "x" changes.
2021 * GSettings:context:
2023 * The name of the context that the settings are stored in.
2028 * GSettings:delay-apply:
2030 * Whether the #GSettings object is in 'delay-apply' mode. See
2031 * g_settings_delay() for details.
2038 * GSettings:has-unapplied:
2040 * If this property is %TRUE, the #GSettings object has outstanding
2041 * changes that will be applied when g_settings_apply() is called.
2048 * The path within the backend where the settings are stored.
2055 * The name of the schema that describes the types of keys
2056 * for this #GSettings object.
2058 * The type of this property is *not* #GSettingsSchema.
2059 * #GSettingsSchema has only existed since version 2.32 and
2060 * unfortunately this name was used in previous versions to refer to
2061 * the schema ID rather than the schema itself. Take care to use the
2062 * 'settings-schema' property if you wish to pass in a
2065 * Deprecated: 2.32:Use the 'schema-id' property instead. In a future version, this property may instead refer to a #GSettingsSchema.
2070 * GSettings:schema-id:
2072 * The name of the schema that describes the types of keys
2073 * for this #GSettings object.
2078 * GSettings:settings-schema:
2080 * The #GSettingsSchema describing the types of keys for this
2081 * #GSettings object.
2083 * Ideally, this property would be called 'schema'. #GSettingsSchema
2084 * has only existed since version 2.32, however, and before then the
2085 * 'schema' property was used to refer to the ID of the schema rather
2086 * than the schema itself. Take care.
2093 * This is an opaque structure type. You may not access it directly.
2100 * GSettingsSchemaSource:
2102 * This is an opaque structure type. You may not access it directly.
2109 * GSimpleAction::activate:
2110 * @simple: the #GSimpleAction
2111 * @parameter: (allow-none): the parameter to the activation
2113 * Indicates that the action was just activated.
2115 * @parameter will always be of the expected type. In the event that
2116 * an incorrect type was given, no signal will be emitted.
2123 * GSimpleAction::change-state:
2124 * @simple: the #GSimpleAction
2125 * @value: (allow-none): the requested value for the state
2127 * Indicates that the action just received a request to change its
2130 * @value will always be of the correct state type. In the event that
2131 * an incorrect type was given, no signal will be emitted.
2133 * If no handler is connected to this signal then the default
2134 * behaviour is to call g_simple_action_set_state() to set the state
2135 * to the requested value. If you connect a signal handler then no
2136 * default action is taken. If the state should change then you must
2137 * call g_simple_action_set_state() from the handler.
2140 * <title>Example 'change-state' handler</title>
2143 * change_volume_state (GSimpleAction *action,
2145 * gpointer user_data)
2149 * requested = g_variant_get_int32 (value);
2151 * // Volume only goes from 0 to 10
2152 * if (0 <= requested && requested <= 10)
2153 * g_simple_action_set_state (action, value);
2158 * The handler need not set the state to the requested value. It
2159 * could set it to any value at all, or take some other action.
2166 * GSimpleAction:enabled:
2168 * If @action is currently enabled.
2170 * If the action is disabled then calls to g_action_activate() and
2171 * g_action_change_state() have no effect.
2178 * GSimpleAction:name:
2180 * The name of the action. This is mostly meaningful for identifying
2181 * the action once it has been added to a #GSimpleActionGroup.
2188 * GSimpleAction:parameter-type:
2190 * The type of the parameter that must be given when activating the
2198 * GSimpleAction:state:
2200 * The state of the action, or %NULL if the action is stateless.
2207 * GSimpleAction:state-type:
2209 * The #GVariantType of the state that the action has, or %NULL if the
2210 * action is stateless.
2217 * GSimplePermission:
2219 * #GSimplePermission is an opaque data structure. There are no methods
2220 * except for those defined by #GPermission.
2225 * GSimpleProxyResolver:default-proxy:
2227 * The default proxy URI that will be used for any URI that doesn't
2228 * match #GSimpleProxyResolver:ignore-hosts, and doesn't match any
2229 * of the schemes set with g_simple_proxy_resolver_set_uri_proxy().
2231 * Note that as a special case, if this URI starts with
2232 * "<literal>socks://</literal>", #GSimpleProxyResolver will treat
2233 * it as referring to all three of the <literal>socks5</literal>,
2234 * <literal>socks4a</literal>, and <literal>socks4</literal> proxy
2240 * GSimpleProxyResolver:ignore-hosts:
2242 * A list of hostnames and IP addresses that the resolver should
2243 * allow direct connections to.
2245 * Entries can be in one of 4 formats:
2249 * A hostname, such as "<literal>example.com</literal>",
2250 * "<literal>.example.com</literal>", or
2251 * "<literal>*.example.com</literal>", any of which match
2252 * "<literal>example.com</literal>" or any subdomain of it.
2255 * An IPv4 or IPv6 address, such as
2256 * "<literal>192.168.1.1</literal>", which matches only
2260 * A hostname or IP address followed by a port, such as
2261 * "<literal>example.com:80</literal>", which matches whatever
2262 * the hostname or IP address would match, but only for URLs
2263 * with the (explicitly) indicated port. In the case of an IPv6
2264 * address, the address part must appear in brackets:
2265 * "<literal>[::1]:443</literal>"
2268 * An IP address range, given by a base address and prefix length,
2269 * such as "<literal>fe80::/10</literal>", which matches any
2270 * address in that range.
2274 * Note that when dealing with Unicode hostnames, the matching is
2275 * done against the ASCII form of the name.
2277 * Also note that hostname exclusions apply only to connections made
2278 * to hosts identified by name, and IP address exclusions apply only
2279 * to connections made to hosts identified by address. That is, if
2280 * <literal>example.com</literal> has an address of
2281 * <literal>192.168.1.1</literal>, and the :ignore-hosts list
2282 * contains only "<literal>192.168.1.1</literal>", then a connection
2283 * to "<literal>example.com</literal>" (eg, via a #GNetworkAddress)
2284 * will use the proxy, and a connection to
2285 * "<literal>192.168.1.1</literal>" (eg, via a #GInetSocketAddress)
2288 * These rules match the "ignore-hosts"/"noproxy" rules most
2289 * commonly used by other applications.
2294 * GSocket:broadcast:
2296 * Whether the socket should allow sending to and receiving from broadcast addresses.
2303 * GSocket:multicast-loopback:
2305 * Whether outgoing multicast packets loop back to the local host.
2312 * GSocket:multicast-ttl:
2314 * Time-to-live out outgoing multicast packets
2323 * The timeout in seconds on socket I/O
2332 * Time-to-live for outgoing unicast packets
2341 * A socket endpoint address, corresponding to <type>struct sockaddr</type>
2342 * or one of its subtypes.
2347 * GSocketClient::event:
2348 * @client: the #GSocketClient
2349 * @event: the event that is occurring
2350 * @connectable: the #GSocketConnectable that @event is occurring on
2351 * @connection: the current representation of the connection
2353 * Emitted when @client's activity on @connectable changes state.
2354 * Among other things, this can be used to provide progress
2355 * information about a network connection in the UI. The meanings of
2356 * the different @event values are as follows:
2360 * <term>%G_SOCKET_CLIENT_RESOLVING:</term>
2362 * @client is about to look up @connectable in DNS.
2363 * @connection will be %NULL.
2364 * </para></listitem>
2367 * <term>%G_SOCKET_CLIENT_RESOLVED:</term>
2369 * @client has successfully resolved @connectable in DNS.
2370 * @connection will be %NULL.
2371 * </para></listitem>
2374 * <term>%G_SOCKET_CLIENT_CONNECTING:</term>
2376 * @client is about to make a connection to a remote host;
2377 * either a proxy server or the destination server itself.
2378 * @connection is the #GSocketConnection, which is not yet
2380 * </para></listitem>
2383 * <term>%G_SOCKET_CLIENT_CONNECTED:</term>
2385 * @client has successfully connected to a remote host.
2386 * @connection is the connected #GSocketConnection.
2387 * </para></listitem>
2390 * <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATING:</term>
2392 * @client is about to negotiate with a proxy to get it to
2393 * connect to @connectable. @connection is the
2394 * #GSocketConnection to the proxy server.
2395 * </para></listitem>
2398 * <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATED:</term>
2400 * @client has negotiated a connection to @connectable through
2401 * a proxy server. @connection is the stream returned from
2402 * g_proxy_connect(), which may or may not be a
2403 * #GSocketConnection.
2404 * </para></listitem>
2407 * <term>%G_SOCKET_CLIENT_TLS_HANDSHAKING:</term>
2409 * @client is about to begin a TLS handshake. @connection is a
2410 * #GTlsClientConnection.
2411 * </para></listitem>
2414 * <term>%G_SOCKET_CLIENT_TLS_HANDSHAKED:</term>
2416 * @client has successfully completed the TLS handshake.
2417 * @connection is a #GTlsClientConnection.
2418 * </para></listitem>
2421 * <term>%G_SOCKET_CLIENT_COMPLETE:</term>
2423 * @client has either successfully connected to @connectable
2424 * (in which case @connection is the #GSocketConnection that
2425 * it will be returning to the caller) or has failed (in which
2426 * case @connection is %NULL and the client is about to return
2428 * </para></listitem>
2432 * Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted
2433 * multiple times (or not at all) for a given connectable (in
2434 * particular, if @client ends up attempting to connect to more than
2435 * one address). However, if @client emits the #GSocketClient::event
2436 * signal at all for a given connectable, that it will always emit
2437 * it with %G_SOCKET_CLIENT_COMPLETE when it is done.
2439 * Note that there may be additional #GSocketClientEvent values in
2440 * the future; unrecognized @event values should be ignored.
2447 * GSocketClient:proxy-resolver:
2449 * The proxy resolver to use
2456 * GSocketService::incoming:
2457 * @service: the #GSocketService
2458 * @connection: a new #GSocketConnection object
2459 * @source_object: (allow-none): the source_object passed to g_socket_listener_add_address()
2461 * The ::incoming signal is emitted when a new incoming connection
2462 * to @service needs to be handled. The handler must initiate the
2463 * handling of @connection, but may not block; in essence,
2464 * asynchronous operations must be used.
2466 * @connection will be unreffed once the signal handler returns,
2467 * so you need to ref it yourself if you are planning to use it.
2469 * Returns: %TRUE to stop other handlers from being called
2477 * A single target host/port that a network service is running on.
2484 * The opaque object representing a synchronous or asynchronous task
2492 * @source_object: (type GObject): @task's source object
2493 * @task_data: @task's task data
2494 * @cancellable: @task's #GCancellable, or %NULL
2496 * The prototype for a task function to be run in a thread via
2497 * g_task_run_in_thread() or g_task_run_in_thread_sync().
2499 * If the return-on-cancel flag is set on @task, and @cancellable gets
2500 * cancelled, then the #GTask will be completed immediately (as though
2501 * g_task_return_error_if_cancelled() had been called), without
2502 * waiting for the task function to complete. However, the task
2503 * function will continue running in its thread in the background. The
2504 * function therefore needs to be careful about how it uses
2505 * externally-visible state in this case. See
2506 * g_task_set_return_on_cancel() for more details.
2508 * Other than in that case, @task will be completed when the
2509 * #GTaskThreadFunc returns, <emphasis>not</emphasis> when it calls
2510 * a <literal>g_task_return_</literal> function.
2519 * The #GTestDBus structure contains only private data and
2520 * should only be accessed using the provided API.
2529 * #GTestDBusFlags specifying the behaviour of the dbus session
2543 * GThemedIcon:names:
2545 * A %NULL-terminated array of icon names.
2550 * GThemedIcon:use-default-fallbacks:
2552 * Whether to use the default fallbacks found by shortening the icon name
2553 * at '-' characters. If the "names" array has more than one element,
2554 * ignores any past the first.
2556 * For example, if the icon name was "gnome-dev-cdrom-audio", the array
2560 * "gnome-dev-cdrom-audio",
2561 * "gnome-dev-cdrom",
2571 * GThreadedSocketService::run:
2572 * @service: the #GThreadedSocketService.
2573 * @connection: a new #GSocketConnection object.
2574 * @source_object: the source_object passed to g_socket_listener_add_address().
2576 * The ::run signal is emitted in a worker thread in response to an
2577 * incoming connection. This thread is dedicated to handling
2578 * @connection and may perform blocking IO. The signal handler need
2579 * not return until the connection is closed.
2581 * Returns: %TRUE to stop further signal handlers from being called
2588 * TLS (Transport Layer Security, aka SSL) backend. This is an
2589 * internal type used to coordinate the different classes implemented
2599 * Abstract base class for TLS certificate types.
2606 * GTlsCertificate:certificate:
2608 * The DER (binary) encoded representation of the certificate.
2609 * This property and the #GTlsCertificate:certificate-pem property
2610 * represent the same data, just in different forms.
2617 * GTlsCertificate:certificate-pem:
2619 * The PEM (ASCII) encoded representation of the certificate.
2620 * This property and the #GTlsCertificate:certificate
2621 * property represent the same data, just in different forms.
2628 * GTlsCertificate:issuer:
2630 * A #GTlsCertificate representing the entity that issued this
2631 * certificate. If %NULL, this means that the certificate is either
2632 * self-signed, or else the certificate of the issuer is not
2640 * GTlsCertificate:private-key:
2642 * The DER (binary) encoded representation of the certificate's
2643 * private key, in either PKCS#1 format or unencrypted PKCS#8
2644 * format. This property (or the #GTlsCertificate:private-key-pem
2645 * property) can be set when constructing a key (eg, from a file),
2646 * but cannot be read.
2648 * PKCS#8 format is supported since 2.32; earlier releases only
2649 * support PKCS#1. You can use the <literal>openssl rsa</literal>
2650 * tool to convert PKCS#8 keys to PKCS#1.
2657 * GTlsCertificate:private-key-pem:
2659 * The PEM (ASCII) encoded representation of the certificate's
2660 * private key in either PKCS#1 format ("<literal>BEGIN RSA PRIVATE
2661 * KEY</literal>") or unencrypted PKCS#8 format ("<literal>BEGIN
2662 * PRIVATE KEY</literal>"). This property (or the
2663 * #GTlsCertificate:private-key property) can be set when
2664 * constructing a key (eg, from a file), but cannot be read.
2666 * PKCS#8 format is supported since 2.32; earlier releases only
2667 * support PKCS#1. You can use the <literal>openssl rsa</literal>
2668 * tool to convert PKCS#8 keys to PKCS#1.
2675 * GTlsClientConnection:
2677 * Abstract base class for the backend-specific client connection
2685 * GTlsClientConnection:accepted-cas:
2687 * A list of the distinguished names of the Certificate Authorities
2688 * that the server will accept client certificates signed by. If the
2689 * server requests a client certificate during the handshake, then
2690 * this property will be set after the handshake completes.
2692 * Each item in the list is a #GByteArray which contains the complete
2693 * subject DN of the certificate authority.
2700 * GTlsClientConnection:server-identity:
2702 * A #GSocketConnectable describing the identity of the server that
2703 * is expected on the other end of the connection.
2705 * If the %G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in
2706 * #GTlsClientConnection:validation-flags, this object will be used
2707 * to determine the expected identify of the remote end of the
2708 * connection; if #GTlsClientConnection:server-identity is not set,
2709 * or does not match the identity presented by the server, then the
2710 * %G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail.
2712 * In addition to its use in verifying the server certificate,
2713 * this is also used to give a hint to the server about what
2714 * certificate we expect, which is useful for servers that serve
2722 * GTlsClientConnection:use-ssl3:
2724 * If %TRUE, tells the connection to use SSL 3.0 rather than trying
2725 * to negotiate the best version of TLS or SSL to use. This can be
2726 * used when talking to servers that don't implement version
2727 * negotiation correctly and therefore refuse to handshake at all with
2728 * a "modern" TLS handshake.
2735 * GTlsClientConnection:validation-flags:
2737 * What steps to perform when validating a certificate received from
2738 * a server. Server certificates that fail to validate in all of the
2739 * ways indicated here will be rejected unless the application
2740 * overrides the default via #GTlsConnection::accept-certificate.
2749 * Abstract base class for the backend-specific #GTlsClientConnection
2750 * and #GTlsServerConnection types.
2757 * GTlsConnection::accept-certificate:
2758 * @conn: a #GTlsConnection
2759 * @peer_cert: the peer's #GTlsCertificate
2760 * @errors: the problems with @peer_cert.
2762 * Emitted during the TLS handshake after the peer certificate has
2763 * been received. You can examine @peer_cert's certification path by
2764 * calling g_tls_certificate_get_issuer() on it.
2766 * For a client-side connection, @peer_cert is the server's
2767 * certificate, and the signal will only be emitted if the
2768 * certificate was not acceptable according to @conn's
2769 * #GTlsClientConnection:validation_flags. If you would like the
2770 * certificate to be accepted despite @errors, return %TRUE from the
2771 * signal handler. Otherwise, if no handler accepts the certificate,
2772 * the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE.
2774 * For a server-side connection, @peer_cert is the certificate
2775 * presented by the client, if this was requested via the server's
2776 * #GTlsServerConnection:authentication_mode. On the server side,
2777 * the signal is always emitted when the client presents a
2778 * certificate, and the certificate will only be accepted if a
2779 * handler returns %TRUE.
2781 * Note that if this signal is emitted as part of asynchronous I/O
2782 * in the main thread, then you should not attempt to interact with
2783 * the user before returning from the signal handler. If you want to
2784 * let the user decide whether or not to accept the certificate, you
2785 * would have to return %FALSE from the signal handler on the first
2786 * attempt, and then after the connection attempt returns a
2787 * %G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if
2788 * the user decides to accept the certificate, remember that fact,
2789 * create a new connection, and return %TRUE from the signal handler
2792 * If you are doing I/O in another thread, you do not
2793 * need to worry about this, and can simply block in the signal
2794 * handler until the UI thread returns an answer.
2796 * 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.
2802 * GTlsConnection:base-io-stream:
2804 * The #GIOStream that the connection wraps
2811 * GTlsConnection:certificate:
2813 * The connection's certificate; see
2814 * g_tls_connection_set_certificate().
2821 * GTlsConnection:database:
2823 * The certificate database to use when verifying this TLS connection.
2824 * If no cerificate database is set, then the default database will be
2825 * used. See g_tls_backend_get_default_database().
2832 * GTlsConnection:interaction:
2834 * A #GTlsInteraction object to be used when the connection or certificate
2835 * database need to interact with the user. This will be used to prompt the
2836 * user for passwords where necessary.
2843 * GTlsConnection:peer-certificate:
2845 * The connection's peer's certificate, after the TLS handshake has
2846 * completed and the certificate has been accepted. Note in
2847 * particular that this is not yet set during the emission of
2848 * #GTlsConnection::accept-certificate.
2850 * (You can watch for a #GObject::notify signal on this property to
2851 * detect when a handshake has occurred.)
2858 * GTlsConnection:peer-certificate-errors:
2860 * The errors noticed-and-ignored while verifying
2861 * #GTlsConnection:peer-certificate. Normally this should be 0, but
2862 * it may not be if #GTlsClientConnection:validation-flags is not
2863 * %G_TLS_CERTIFICATE_VALIDATE_ALL, or if
2864 * #GTlsConnection::accept-certificate overrode the default
2872 * GTlsConnection:rehandshake-mode:
2874 * The rehandshaking mode. See
2875 * g_tls_connection_set_rehandshake_mode().
2882 * GTlsConnection:require-close-notify:
2884 * Whether or not proper TLS close notification is required.
2885 * See g_tls_connection_set_require_close_notify().
2892 * GTlsConnection:use-system-certdb:
2894 * Whether or not the system certificate database will be used to
2895 * verify peer certificates. See
2896 * g_tls_connection_set_use_system_certdb().
2898 * Deprecated: 2.30: Use GTlsConnection:database instead
2905 * Abstract base class for the backend-specific database types.
2914 * Implemented by a #GTlsDatabase which allows you to load certificates
2922 * GTlsFileDatabase:anchors:
2924 * The path to a file containing PEM encoded certificate authority
2925 * root anchors. The certificates in this file will be treated as
2926 * root authorities for the purpose of verifying other certificates
2927 * via the g_tls_database_verify_chain() operation.
2936 * An object representing interaction that the TLS connection and database
2937 * might have with the user.
2944 * GTlsInteractionClass:
2945 * @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.
2946 * @ask_password_async: ask for a password asynchronously.
2947 * @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.
2949 * The class for #GTlsInteraction. Derived classes implement the various
2950 * virtual interaction methods to handle TLS interactions.
2952 * Derived classes can choose to implement whichever interactions methods they'd
2953 * like to support by overriding those virtual methods in their class
2954 * initialization function. If a derived class implements an async method,
2955 * it must also implement the corresponding finish method.
2957 * The synchronous interaction methods should implement to display modal dialogs,
2958 * and the asynchronous methods to display modeless dialogs.
2960 * If the user cancels an interaction, then the result should be
2961 * %G_TLS_INTERACTION_FAILED and the error should be set with a domain of
2962 * %G_IO_ERROR and code of %G_IO_ERROR_CANCELLED.
2971 * An abstract interface representing a password used in TLS. Often used in
2972 * user interaction such as unlocking a key storage token.
2979 * GTlsServerConnection:authentication-mode:
2981 * The #GTlsAuthenticationMode for the server. This can be changed
2982 * before calling g_tls_connection_handshake() if you want to
2983 * rehandshake with a different mode from the initial handshake.
2990 * GUnixCredentialsMessage:credentials:
2992 * The credentials stored in the message.
2999 * GUnixInputStream:close-fd:
3001 * Whether to close the file descriptor when the stream is closed.
3008 * GUnixInputStream:fd:
3010 * The file descriptor that the stream reads from.
3017 * GUnixMountMonitor::mountpoints-changed:
3018 * @monitor: the object on which the signal is emitted
3020 * Emitted when the unix mount points have changed.
3025 * GUnixMountMonitor::mounts-changed:
3026 * @monitor: the object on which the signal is emitted
3028 * Emitted when the unix mounts have changed.
3033 * GUnixOutputStream:close-fd:
3035 * Whether to close the file descriptor when the stream is closed.
3042 * GUnixOutputStream:fd:
3044 * The file descriptor that the stream writes to.
3051 * GUnixSocketAddress:
3053 * A UNIX-domain (local) socket address, corresponding to a
3054 * <type>struct sockaddr_un</type>.
3059 * GUnixSocketAddress:abstract:
3061 * Whether or not this is an abstract address
3063 * Deprecated: Use #GUnixSocketAddress:address-type, which distinguishes between zero-padded and non-zero-padded abstract addresses.
3070 * Emitted when the volume has been changed.
3077 * This signal is emitted when the #GVolume have been removed. If
3078 * the recipient is holding references to the object they should
3079 * release them so the object can be finalized.
3084 * GVolumeMonitor::drive-changed:
3085 * @volume_monitor: The volume monitor emitting the signal.
3086 * @drive: the drive that changed
3088 * Emitted when a drive changes.
3093 * GVolumeMonitor::drive-connected:
3094 * @volume_monitor: The volume monitor emitting the signal.
3095 * @drive: a #GDrive that was connected.
3097 * Emitted when a drive is connected to the system.
3102 * GVolumeMonitor::drive-disconnected:
3103 * @volume_monitor: The volume monitor emitting the signal.
3104 * @drive: a #GDrive that was disconnected.
3106 * Emitted when a drive is disconnected from the system.
3111 * GVolumeMonitor::drive-eject-button:
3112 * @volume_monitor: The volume monitor emitting the signal.
3113 * @drive: the drive where the eject button was pressed
3115 * Emitted when the eject button is pressed on @drive.
3122 * GVolumeMonitor::drive-stop-button:
3123 * @volume_monitor: The volume monitor emitting the signal.
3124 * @drive: the drive where the stop button was pressed
3126 * Emitted when the stop button is pressed on @drive.
3133 * GVolumeMonitor::mount-added:
3134 * @volume_monitor: The volume monitor emitting the signal.
3135 * @mount: a #GMount that was added.
3137 * Emitted when a mount is added.
3142 * GVolumeMonitor::mount-changed:
3143 * @volume_monitor: The volume monitor emitting the signal.
3144 * @mount: a #GMount that changed.
3146 * Emitted when a mount changes.
3151 * GVolumeMonitor::mount-pre-unmount:
3152 * @volume_monitor: The volume monitor emitting the signal.
3153 * @mount: a #GMount that is being unmounted.
3155 * Emitted when a mount is about to be removed.
3160 * GVolumeMonitor::mount-removed:
3161 * @volume_monitor: The volume monitor emitting the signal.
3162 * @mount: a #GMount that was removed.
3164 * Emitted when a mount is removed.
3169 * GVolumeMonitor::volume-added:
3170 * @volume_monitor: The volume monitor emitting the signal.
3171 * @volume: a #GVolume that was added.
3173 * Emitted when a mountable volume is added to the system.
3178 * GVolumeMonitor::volume-changed:
3179 * @volume_monitor: The volume monitor emitting the signal.
3180 * @volume: a #GVolume that changed.
3182 * Emitted when mountable volume is changed.
3187 * GVolumeMonitor::volume-removed:
3188 * @volume_monitor: The volume monitor emitting the signal.
3189 * @volume: a #GVolume that was removed.
3191 * Emitted when a mountable volume is removed from the system.
3196 * GWin32InputStream:close-handle:
3198 * Whether to close the file handle when the stream is closed.
3205 * GWin32InputStream:handle:
3207 * The handle that the stream reads from.
3214 * GWin32OutputStream:close-handle:
3216 * Whether to close the file handle when the stream is closed.
3223 * GWin32OutputStream:handle:
3225 * The file handle that the stream writes to.
3234 * Zlib decompression
3239 * GZlibCompressor:file-info:
3241 * If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is
3242 * %G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name
3243 * and modification time from the file info to the GZIP header.
3250 * GZlibDecompressor:
3252 * Zlib decompression
3257 * GZlibDecompressor:file-info:
3259 * A #GFileInfo containing the information found in the GZIP header
3260 * of the data stream processed, or %NULL if the header was not yet
3261 * fully processed, is not present at all, or the compressor's
3262 * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP.
3269 * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT:
3271 * The purpose used to verify the client certificate in a TLS connection.
3272 * Used by TLS servers.
3277 * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER:
3279 * The purpose used to verify the server certificate in a TLS connection. This
3280 * is the most common purpose in use. Used by TLS clients.
3285 * G_TYPE_SETTINGS_SCHEMA:
3287 * A boxed #GType corresponding to #GSettingsSchema.
3294 * G_TYPE_SETTINGS_SCHEMA_SOURCE:
3296 * A boxed #GType corresponding to #GSettingsSchemaSource.
3303 * SECTION:extensionpoints
3304 * @short_description: Extension Points
3306 * @see_also: <link linkend="extending-gio">Extending GIO</link>
3308 * #GIOExtensionPoint provides a mechanism for modules to extend the
3309 * functionality of the library or application that loaded it in an
3310 * organized fashion.
3312 * An extension point is identified by a name, and it may optionally
3313 * require that any implementation must by of a certain type (or derived
3314 * thereof). Use g_io_extension_point_register() to register an
3315 * extension point, and g_io_extension_point_set_required_type() to
3316 * set a required type.
3318 * A module can implement an extension point by specifying the #GType
3319 * that implements the functionality. Additionally, each implementation
3320 * of an extension point has a name, and a priority. Use
3321 * g_io_extension_point_implement() to implement an extension point.
3324 * GIOExtensionPoint *ep;
3326 * /* Register an extension point */
3327 * ep = g_io_extension_point_register ("my-extension-point");
3328 * g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE);
3332 * /* Implement an extension point */
3333 * G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
3334 * g_io_extension_point_implement ("my-extension-point",
3335 * my_example_impl_get_type (),
3340 * It is up to the code that registered the extension point how
3341 * it uses the implementations that have been associated with it.
3342 * Depending on the use case, it may use all implementations, or
3343 * only the one with the highest priority, or pick a specific
3346 * To avoid opening all modules just to find out what extension
3347 * points they implement, GIO makes use of a caching mechanism,
3348 * see <link linkend="gio-querymodules">gio-querymodules</link>.
3349 * You are expected to run this command after installing a
3352 * The <envar>GIO_EXTRA_MODULES</envar> environment variable can be
3353 * used to specify additional directories to automatically load modules
3354 * from. This environment variable has the same syntax as the
3355 * <envar>PATH</envar>. If two modules have the same base name in different
3356 * directories, then the latter one will be ignored. If additional
3357 * directories are specified GIO will load modules from the built-in
3365 * @short_description: An action interface
3367 * #GAction represents a single named action.
3369 * The main interface to an action is that it can be activated with
3370 * g_action_activate(). This results in the 'activate' signal being
3371 * emitted. An activation has a #GVariant parameter (which may be
3372 * %NULL). The correct type for the parameter is determined by a static
3373 * parameter type (which is given at construction time).
3375 * An action may optionally have a state, in which case the state may be
3376 * set with g_action_change_state(). This call takes a #GVariant. The
3377 * correct type for the state is determined by a static state type
3378 * (which is given at construction time).
3380 * The state may have a hint associated with it, specifying its valid
3383 * #GAction is merely the interface to the concept of an action, as
3384 * described above. Various implementations of actions exist, including
3385 * #GSimpleAction and #GtkAction.
3387 * In all cases, the implementing class is responsible for storing the
3388 * name of the action, the parameter type, the enabled state, the
3389 * optional state type and the state and emitting the appropriate
3390 * signals when these change. The implementor responsible for filtering
3391 * calls to g_action_activate() and g_action_change_state() for type
3392 * safety and for the state being enabled.
3394 * Probably the only useful thing to do with a #GAction is to put it
3395 * inside of a #GSimpleActionGroup.
3400 * SECTION:gactiongroup
3401 * @title: GActionGroup
3402 * @short_description: A group of actions
3403 * @see_also: #GAction
3405 * #GActionGroup represents a group of actions. Actions can be used to
3406 * expose functionality in a structured way, either from one part of a
3407 * program to another, or to the outside world. Action groups are often
3408 * used together with a #GMenuModel that provides additional
3409 * representation data for displaying the actions to the user, e.g. in
3412 * The main way to interact with the actions in a GActionGroup is to
3413 * activate them with g_action_group_activate_action(). Activating an
3414 * action may require a #GVariant parameter. The required type of the
3415 * parameter can be inquired with g_action_group_get_action_parameter_type().
3416 * Actions may be disabled, see g_action_group_get_action_enabled().
3417 * Activating a disabled action has no effect.
3419 * Actions may optionally have a state in the form of a #GVariant. The
3420 * current state of an action can be inquired with
3421 * g_action_group_get_action_state(). Activating a stateful action may
3422 * change its state, but it is also possible to set the state by calling
3423 * g_action_group_change_action_state().
3425 * As typical example, consider a text editing application which has an
3426 * option to change the current font to 'bold'. A good way to represent
3427 * this would be a stateful action, with a boolean state. Activating the
3428 * action would toggle the state.
3430 * Each action in the group has a unique name (which is a string). All
3431 * method calls, except g_action_group_list_actions() take the name of
3432 * an action as an argument.
3434 * The #GActionGroup API is meant to be the 'public' API to the action
3435 * group. The calls here are exactly the interaction that 'external
3436 * forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have
3437 * with actions. 'Internal' APIs (ie: ones meant only to be accessed by
3438 * the action group implementation) are found on subclasses. This is
3439 * why you will find - for example - g_action_group_get_action_enabled()
3440 * but not an equivalent <function>set()</function> call.
3442 * Signals are emitted on the action group in response to state changes
3443 * on individual actions.
3445 * Implementations of #GActionGroup should provide implementations for
3446 * the virtual functions g_action_group_list_actions() and
3447 * g_action_group_query_action(). The other virtual functions should
3448 * not be implemented - their "wrappers" are actually implemented with
3449 * calls to g_action_group_query_action().
3454 * SECTION:gactiongroupexporter
3455 * @title: GActionGroup exporter
3456 * @short_description: Export GActionGroups on D-Bus
3457 * @see_also: #GActionGroup, #GDBusActionGroup
3459 * These functions support exporting a #GActionGroup on D-Bus.
3460 * The D-Bus interface that is used is a private implementation
3463 * To access an exported #GActionGroup remotely, use
3464 * g_dbus_action_group_get() to obtain a #GDBusActionGroup.
3469 * SECTION:gactionmap
3470 * @title: GActionMap
3471 * @short_description: Interface for action containers
3473 * The GActionMap interface is implemented by #GActionGroup
3474 * implementations that operate by containing a number of
3475 * named #GAction instances, such as #GSimpleActionGroup.
3477 * One useful application of this interface is to map the
3478 * names of actions from various action groups to unique,
3479 * prefixed names (e.g. by prepending "app." or "win.").
3480 * This is the motivation for the 'Map' part of the interface
3489 * @short_description: Application information and launch contexts
3490 * @include: gio/gio.h
3492 * #GAppInfo and #GAppLaunchContext are used for describing and launching
3493 * applications installed on the system.
3495 * As of GLib 2.20, URIs will always be converted to POSIX paths
3496 * (using g_file_get_path()) when using g_app_info_launch() even if
3497 * the application requested an URI and not a POSIX path. For example
3498 * for an desktop-file based application with Exec key <literal>totem
3499 * %U</literal> and a single URI,
3500 * <literal>sftp://foo/file.avi</literal>, then
3501 * <literal>/home/user/.gvfs/sftp on foo/file.avi</literal> will be
3502 * passed. This will only work if a set of suitable GIO extensions
3503 * (such as gvfs 2.26 compiled with FUSE support), is available and
3504 * operational; if this is not the case, the URI will be passed
3505 * unmodified to the application. Some URIs, such as
3506 * <literal>mailto:</literal>, of course cannot be mapped to a POSIX
3507 * path (in gvfs there's no FUSE mount for it); such URIs will be
3508 * passed unmodified to the application.
3510 * Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
3511 * back to the GIO URI in the #GFile constructors (since gvfs
3512 * implements the #GVfs extension point). As such, if the application
3513 * needs to examine the URI, it needs to use g_file_get_uri() or
3514 * similar on #GFile. In other words, an application cannot assume
3515 * that the URI passed to e.g. g_file_new_for_commandline_arg() is
3516 * equal to the result of g_file_get_uri(). The following snippet
3523 * file = g_file_new_for_commandline_arg (uri_from_commandline);
3525 * uri = g_file_get_uri (file);
3526 * strcmp (uri, uri_from_commandline) == 0; // FALSE
3529 * if (g_file_has_uri_scheme (file, "cdda"))
3531 * // do something special with uri
3533 * g_object_unref (file);
3536 * This code will work when both <literal>cdda://sr0/Track
3537 * 1.wav</literal> and <literal>/home/user/.gvfs/cdda on sr0/Track
3538 * 1.wav</literal> is passed to the application. It should be noted
3539 * that it's generally not safe for applications to rely on the format
3540 * of a particular URIs. Different launcher applications (e.g. file
3541 * managers) may have different ideas of what a given URI means.
3546 * SECTION:gapplication
3547 * @title: GApplication
3548 * @short_description: Core application class
3550 * A #GApplication is the foundation of an application. It wraps some
3551 * low-level platform-specific services and is intended to act as the
3552 * foundation for higher-level application classes such as
3553 * #GtkApplication or #MxApplication. In general, you should not use
3554 * this class outside of a higher level framework.
3556 * GApplication provides convenient life cycle management by maintaining
3557 * a <firstterm>use count</firstterm> for the primary application instance.
3558 * The use count can be changed using g_application_hold() and
3559 * g_application_release(). If it drops to zero, the application exits.
3560 * Higher-level classes such as #GtkApplication employ the use count to
3561 * ensure that the application stays alive as long as it has any opened
3564 * Another feature that GApplication (optionally) provides is process
3565 * uniqueness. Applications can make use of this functionality by
3566 * providing a unique application ID. If given, only one application
3567 * with this ID can be running at a time per session. The session
3568 * concept is platform-dependent, but corresponds roughly to a graphical
3569 * desktop login. When your application is launched again, its
3570 * arguments are passed through platform communication to the already
3571 * running program. The already running instance of the program is
3572 * called the <firstterm>primary instance</firstterm>; for non-unique
3573 * applications this is the always the current instance.
3574 * On Linux, the D-Bus session bus is used for communication.
3576 * The use of #GApplication differs from some other commonly-used
3577 * uniqueness libraries (such as libunique) in important ways. The
3578 * application is not expected to manually register itself and check if
3579 * it is the primary instance. Instead, the <code>main()</code>
3580 * function of a #GApplication should do very little more than
3581 * instantiating the application instance, possibly connecting signal
3582 * handlers, then calling g_application_run(). All checks for
3583 * uniqueness are done internally. If the application is the primary
3584 * instance then the startup signal is emitted and the mainloop runs.
3585 * If the application is not the primary instance then a signal is sent
3586 * to the primary instance and g_application_run() promptly returns.
3587 * See the code examples below.
3589 * If used, the expected form of an application identifier is very close
3591 * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface">DBus bus name</ulink>.
3592 * Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator".
3593 * For details on valid application identifiers, see g_application_id_is_valid().
3595 * On Linux, the application identifier is claimed as a well-known bus name
3596 * on the user's session bus. This means that the uniqueness of your
3597 * application is scoped to the current session. It also means that your
3598 * application may provide additional services (through registration of other
3599 * object paths) at that bus name. The registration of these object paths
3600 * should be done with the shared GDBus session bus. Note that due to the
3601 * internal architecture of GDBus, method calls can be dispatched at any time
3602 * (even if a main loop is not running). For this reason, you must ensure that
3603 * any object paths that you wish to register are registered before #GApplication
3604 * attempts to acquire the bus name of your application (which happens in
3605 * g_application_register()). Unfortunately, this means that you cannot use
3606 * g_application_get_is_remote() to decide if you want to register object paths.
3608 * GApplication also implements the #GActionGroup and #GActionMap
3609 * interfaces and lets you easily export actions by adding them with
3610 * g_action_map_add_action(). When invoking an action by calling
3611 * g_action_group_activate_action() on the application, it is always
3612 * invoked in the primary instance. The actions are also exported on
3613 * the session bus, and GIO provides the #GDBusActionGroup wrapper to
3614 * conveniently access them remotely. GIO provides a #GDBusMenuModel wrapper
3615 * for remote access to exported #GMenuModels.
3617 * There is a number of different entry points into a GApplication:
3619 * <listitem>via 'Activate' (i.e. just starting the application)</listitem>
3620 * <listitem>via 'Open' (i.e. opening some files)</listitem>
3621 * <listitem>by handling a command-line</listitem>
3622 * <listitem>via activating an action</listitem>
3624 * The #GApplication::startup signal lets you handle the application
3625 * initialization for all of these in a single place.
3627 * Regardless of which of these entry points is used to start the application,
3628 * GApplication passes some <firstterm id="platform-data">platform
3629 * data</firstterm> from the launching instance to the primary instance,
3630 * in the form of a #GVariant dictionary mapping strings to variants.
3631 * To use platform data, override the @before_emit or @after_emit virtual
3632 * functions in your #GApplication subclass. When dealing with
3633 * #GApplicationCommandLine objects, the platform data is directly
3634 * available via g_application_command_line_get_cwd(),
3635 * g_application_command_line_get_environ() and
3636 * g_application_command_line_get_platform_data().
3638 * As the name indicates, the platform data may vary depending on the
3639 * operating system, but it always includes the current directory (key
3640 * "cwd"), and optionally the environment (ie the set of environment
3641 * variables and their values) of the calling process (key "environ").
3642 * The environment is only added to the platform data if the
3643 * %G_APPLICATION_SEND_ENVIRONMENT flag is set. #GApplication subclasses
3644 * can add their own platform data by overriding the @add_platform_data
3645 * virtual function. For instance, #GtkApplication adds startup notification
3648 * To parse commandline arguments you may handle the
3649 * #GApplication::command-line signal or override the local_command_line()
3650 * vfunc, to parse them in either the primary instance or the local instance,
3653 * <example id="gapplication-example-open"><title>Opening files with a GApplication</title>
3655 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-open.c">
3656 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3661 * <example id="gapplication-example-actions"><title>A GApplication with actions</title>
3663 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-actions.c">
3664 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3669 * <example id="gapplication-example-menu"><title>A GApplication with menus</title>
3671 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-menu.c">
3672 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3677 * <example id="gapplication-example-dbushooks"><title>Using extra D-Bus hooks with a GApplication</title>
3679 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-dbushooks.c">
3680 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3688 * SECTION:gapplicationcommandline
3689 * @title: GApplicationCommandLine
3690 * @short_description: A command-line invocation of an application
3691 * @see_also: #GApplication
3693 * #GApplicationCommandLine represents a command-line invocation of
3694 * an application. It is created by #GApplication and emitted
3695 * in the #GApplication::command-line signal and virtual function.
3697 * The class contains the list of arguments that the program was invoked
3698 * with. It is also possible to query if the commandline invocation was
3699 * local (ie: the current process is running in direct response to the
3700 * invocation) or remote (ie: some other process forwarded the
3701 * commandline to this process).
3703 * The GApplicationCommandLine object can provide the @argc and @argv
3704 * parameters for use with the #GOptionContext command-line parsing API,
3705 * with the g_application_command_line_get_arguments() function. See
3706 * <xref linkend="gapplication-example-cmdline3"/> for an example.
3708 * The exit status of the originally-invoked process may be set and
3709 * messages can be printed to stdout or stderr of that process. The
3710 * lifecycle of the originally-invoked process is tied to the lifecycle
3711 * of this object (ie: the process exits when the last reference is
3714 * The main use for #GApplicationCommandLine (and the
3715 * #GApplication::command-line signal) is 'Emacs server' like use cases:
3716 * You can set the <envar>EDITOR</envar> environment variable to have
3717 * e.g. git use your favourite editor to edit commit messages, and if you
3718 * already have an instance of the editor running, the editing will happen
3719 * in the running instance, instead of opening a new one. An important
3720 * aspect of this use case is that the process that gets started by git
3721 * does not return until the editing is done.
3723 * <example id="gapplication-example-cmdline"><title>Handling commandline arguments with GApplication</title>
3725 * A simple example where the commandline is completely handled
3726 * in the #GApplication::command-line handler. The launching instance exits
3727 * once the signal handler in the primary instance has returned, and the
3728 * return value of the signal handler becomes the exit status of the launching
3732 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline.c">
3733 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3738 * <example id="gapplication-example-cmdline2"><title>Split commandline handling</title>
3740 * An example of split commandline handling. Options that start with
3741 * <literal>--local-</literal> are handled locally, all other options are
3742 * passed to the #GApplication::command-line handler which runs in the primary
3746 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline2.c">
3747 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3752 * <example id="gapplication-example-cmdline3"><title>Deferred commandline handling</title>
3754 * An example of deferred commandline handling. Here, the commandline is
3755 * not completely handled before the #GApplication::command-line handler
3756 * returns. Instead, we keep a reference to the GApplicationCommandLine
3757 * object and handle it later(in this example, in an idle). Note that it
3758 * is necessary to hold the application until you are done with the
3762 * This example also shows how to use #GOptionContext for parsing the
3763 * commandline arguments. Note that it is necessary to disable the
3764 * built-in help-handling of #GOptionContext, since it calls exit()
3765 * after printing help, which is not what you want to happen in
3766 * the primary instance.
3769 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline3.c">
3770 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3778 * SECTION:gasyncinitable
3779 * @short_description: Asynchronously failable object initialization interface
3780 * @include: gio/gio.h
3781 * @see_also: #GInitable
3783 * This is the asynchronous version of #GInitable; it behaves the same
3784 * in all ways except that initialization is asynchronous. For more details
3785 * see the descriptions on #GInitable.
3787 * A class may implement both the #GInitable and #GAsyncInitable interfaces.
3789 * Users of objects implementing this are not intended to use the interface
3790 * method directly; instead it will be used automatically in various ways.
3791 * For C applications you generally just call g_async_initable_new_async()
3792 * directly, or indirectly via a foo_thing_new_async() wrapper. This will call
3793 * g_async_initable_init_async() under the cover, calling back with %NULL and
3794 * a set %GError on failure.
3796 * A typical implementation might look something like this:
3806 * _foo_ready_cb (Foo *self)
3810 * self->priv->state = INITIALIZED;
3812 * for (l = self->priv->init_results; l != NULL; l = l->next)
3814 * GTask *task = l->data;
3816 * if (self->priv->success)
3817 * g_task_return_boolean (task, TRUE);
3819 * g_task_return_new_error (task, ...);
3820 * g_object_unref (task);
3823 * g_list_free (self->priv->init_results);
3824 * self->priv->init_results = NULL;
3828 * foo_init_async (GAsyncInitable *initable,
3830 * GCancellable *cancellable,
3831 * GAsyncReadyCallback callback,
3832 * gpointer user_data)
3834 * Foo *self = FOO (initable);
3837 * task = g_task_new (initable, cancellable, callback, user_data);
3839 * switch (self->priv->state)
3841 * case NOT_INITIALIZED:
3842 * _foo_get_ready (self);
3843 * self->priv->init_results = g_list_append (self->priv->init_results,
3845 * self->priv->state = INITIALIZING;
3847 * case INITIALIZING:
3848 * self->priv->init_results = g_list_append (self->priv->init_results,
3852 * if (!self->priv->success)
3853 * g_task_return_new_error (task, ...);
3855 * g_task_return_boolean (task, TRUE);
3856 * g_object_unref (task);
3862 * foo_init_finish (GAsyncInitable *initable,
3863 * GAsyncResult *result,
3866 * g_return_val_if_fail (g_task_is_valid (result, initable), FALSE);
3868 * return g_task_propagate_boolean (G_TASK (result), error);
3872 * foo_async_initable_iface_init (gpointer g_iface,
3875 * GAsyncInitableIface *iface = g_iface;
3877 * iface->init_async = foo_init_async;
3878 * iface->init_finish = foo_init_finish;
3885 * SECTION:gasyncresult
3886 * @short_description: Asynchronous Function Results
3887 * @include: gio/gio.h
3890 * Provides a base class for implementing asynchronous function results.
3892 * Asynchronous operations are broken up into two separate operations
3893 * which are chained together by a #GAsyncReadyCallback. To begin
3894 * an asynchronous operation, provide a #GAsyncReadyCallback to the
3895 * asynchronous function. This callback will be triggered when the
3896 * operation has completed, and will be passed a #GAsyncResult instance
3897 * filled with the details of the operation's success or failure, the
3898 * object the asynchronous function was started for and any error codes
3899 * returned. The asynchronous callback function is then expected to call
3900 * the corresponding "_finish()" function, passing the object the
3901 * function was called for, the #GAsyncResult instance, and (optionally)
3902 * an @error to grab any error conditions that may have occurred.
3904 * The "_finish()" function for an operation takes the generic result
3905 * (of type #GAsyncResult) and returns the specific result that the
3906 * operation in question yields (e.g. a #GFileEnumerator for a
3907 * "enumerate children" operation). If the result or error status of the
3908 * operation is not needed, there is no need to call the "_finish()"
3909 * function; GIO will take care of cleaning up the result and error
3910 * information after the #GAsyncReadyCallback returns. You can pass
3911 * %NULL for the #GAsyncReadyCallback if you don't need to take any
3912 * action at all after the operation completes. Applications may also
3913 * take a reference to the #GAsyncResult and call "_finish()" later;
3914 * however, the "_finish()" function may be called at most once.
3916 * Example of a typical asynchronous operation flow:
3918 * void _theoretical_frobnitz_async (Theoretical *t,
3920 * GAsyncReadyCallback *cb,
3923 * gboolean _theoretical_frobnitz_finish (Theoretical *t,
3924 * GAsyncResult *res,
3928 * frobnitz_result_func (GObject *source_object,
3929 * GAsyncResult *res,
3930 * gpointer user_data)
3932 * gboolean success = FALSE;
3934 * success = _theoretical_frobnitz_finish (source_object, res, NULL);
3937 * g_printf ("Hurray!\n");
3939 * g_printf ("Uh oh!\n");
3941 * /<!-- -->* ... *<!-- -->/
3945 * int main (int argc, void *argv[])
3947 * /<!-- -->* ... *<!-- -->/
3949 * _theoretical_frobnitz_async (theoretical_data,
3951 * frobnitz_result_func,
3954 * /<!-- -->* ... *<!-- -->/
3958 * The callback for an asynchronous operation is called only once, and is
3959 * always called, even in the case of a cancelled operation. On cancellation
3960 * the result is a %G_IO_ERROR_CANCELLED error.
3962 * <para id="io-priority"><indexterm><primary>I/O
3963 * priority</primary></indexterm> Many I/O-related asynchronous
3964 * operations have a priority parameter, which is used in certain
3965 * cases to determine the order in which operations are executed. They
3966 * are <emphasis>not</emphasis> used to determine system-wide I/O
3967 * scheduling. Priorities are integers, with lower numbers indicating
3968 * higher priority. It is recommended to choose priorities between
3969 * %G_PRIORITY_LOW and %G_PRIORITY_HIGH, with %G_PRIORITY_DEFAULT as a
3975 * SECTION:gbufferedinputstream
3976 * @short_description: Buffered Input Stream
3977 * @include: gio/gio.h
3978 * @see_also: #GFilterInputStream, #GInputStream
3980 * Buffered input stream implements #GFilterInputStream and provides
3981 * for buffered reads.
3983 * By default, #GBufferedInputStream's buffer size is set at 4 kilobytes.
3985 * To create a buffered input stream, use g_buffered_input_stream_new(),
3986 * or g_buffered_input_stream_new_sized() to specify the buffer's size at
3989 * To get the size of a buffer within a buffered input stream, use
3990 * g_buffered_input_stream_get_buffer_size(). To change the size of a
3991 * buffered input stream's buffer, use
3992 * g_buffered_input_stream_set_buffer_size(). Note that the buffer's size
3993 * cannot be reduced below the size of the data within the buffer.
3998 * SECTION:gbufferedoutputstream
3999 * @short_description: Buffered Output Stream
4000 * @include: gio/gio.h
4001 * @see_also: #GFilterOutputStream, #GOutputStream
4003 * Buffered output stream implements #GFilterOutputStream and provides
4004 * for buffered writes.
4006 * By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.
4008 * To create a buffered output stream, use g_buffered_output_stream_new(),
4009 * or g_buffered_output_stream_new_sized() to specify the buffer's size
4012 * To get the size of a buffer within a buffered input stream, use
4013 * g_buffered_output_stream_get_buffer_size(). To change the size of a
4014 * buffered output stream's buffer, use
4015 * g_buffered_output_stream_set_buffer_size(). Note that the buffer's
4016 * size cannot be reduced below the size of the data within the buffer.
4021 * SECTION:gcancellable
4022 * @short_description: Thread-safe Operation Cancellation Stack
4023 * @include: gio/gio.h
4025 * GCancellable is a thread-safe operation cancellation stack used
4026 * throughout GIO to allow for cancellation of synchronous and
4027 * asynchronous operations.
4032 * SECTION:gcharsetconverter
4033 * @short_description: Convert between charsets
4034 * @include: gio/gio.h
4036 * #GCharsetConverter is an implementation of #GConverter based on
4042 * SECTION:gcontenttype
4043 * @short_description: Platform-specific content typing
4044 * @include: gio/gio.h
4046 * A content type is a platform specific string that defines the type
4047 * 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".
4048 * On Win32 it is an extension string like ".doc", ".txt" or a perceived
4049 * string like "audio". Such strings can be looked up in the registry at
4050 * HKEY_CLASSES_ROOT.
4055 * SECTION:gconverter
4056 * @short_description: Data conversion interface
4057 * @include: gio/gio.h
4058 * @see_also: #GInputStream, #GOutputStream
4060 * #GConverter is implemented by objects that convert
4061 * binary data in various ways. The conversion can be
4062 * stateful and may fail at any place.
4064 * Some example conversions are: character set conversion,
4065 * compression, decompression and regular expression
4073 * SECTION:gconverterinputstream
4074 * @short_description: Converter Input Stream
4075 * @include: gio/gio.h
4076 * @see_also: #GInputStream, #GConverter
4078 * Converter input stream implements #GInputStream and allows
4079 * conversion of data of various types during reading.
4081 * As of GLib 2.34, #GConverterInputStream implements
4082 * #GPollableInputStream.
4087 * SECTION:gconverteroutputstream
4088 * @short_description: Converter Output Stream
4089 * @include: gio/gio.h
4090 * @see_also: #GOutputStream, #GConverter
4092 * Converter output stream implements #GOutputStream and allows
4093 * conversion of data of various types during reading.
4095 * As of GLib 2.34, #GConverterOutputStream implements
4096 * #GPollableOutputStream.
4101 * SECTION:gcredentials
4102 * @short_description: An object containing credentials
4103 * @include: gio/gio.h
4105 * The #GCredentials type is a reference-counted wrapper for native
4106 * credentials. This information is typically used for identifying,
4107 * authenticating and authorizing other processes.
4109 * Some operating systems supports looking up the credentials of the
4110 * remote peer of a communication endpoint - see e.g.
4111 * g_socket_get_credentials().
4113 * Some operating systems supports securely sending and receiving
4114 * credentials over a Unix Domain Socket, see
4115 * #GUnixCredentialsMessage, g_unix_connection_send_credentials() and
4116 * g_unix_connection_receive_credentials() for details.
4118 * On Linux, the native credential type is a <type>struct ucred</type>
4120 * <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>
4121 * man page for details. This corresponds to
4122 * %G_CREDENTIALS_TYPE_LINUX_UCRED.
4124 * On FreeBSD, the native credential type is a <type>struct cmsgcred</type>.
4125 * This corresponds to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED.
4127 * On OpenBSD, the native credential type is a <type>struct sockpeercred</type>.
4128 * This corresponds to %G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED.
4133 * SECTION:gdatainputstream
4134 * @short_description: Data Input Stream
4135 * @include: gio/gio.h
4136 * @see_also: #GInputStream
4138 * Data input stream implements #GInputStream and includes functions for
4139 * reading structured data directly from a binary input stream.
4144 * SECTION:gdataoutputstream
4145 * @short_description: Data Output Stream
4146 * @include: gio/gio.h
4147 * @see_also: #GOutputStream
4149 * Data output stream implements #GOutputStream and includes functions for
4150 * writing data directly to an output stream.
4155 * SECTION:gdbusactiongroup
4156 * @title: GDBusActionGroup
4157 * @short_description: A D-Bus GActionGroup implementation
4158 * @see_also: <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
4160 * #GDBusActionGroup is an implementation of the #GActionGroup
4161 * interface that can be used as a proxy for an action group
4162 * that is exported over D-Bus with g_dbus_connection_export_action_group().
4167 * SECTION:gdbusaddress
4168 * @title: D-Bus Addresses
4169 * @short_description: D-Bus connection endpoints
4170 * @include: gio/gio.h
4172 * Routines for working with D-Bus addresses. A D-Bus address is a string
4173 * like "unix:tmpdir=/tmp/my-app-name". The exact format of addresses
4174 * is explained in detail in the <link linkend="http://dbus.freedesktop.org/doc/dbus-specification.html#addresses">D-Bus specification</link>.
4179 * SECTION:gdbusauthobserver
4180 * @short_description: Object used for authenticating connections
4181 * @include: gio/gio.h
4183 * The #GDBusAuthObserver type provides a mechanism for participating
4184 * in how a #GDBusServer (or a #GDBusConnection) authenticates remote
4185 * peers. Simply instantiate a #GDBusAuthObserver and connect to the
4186 * signals you are interested in. Note that new signals may be added
4189 * For example, if you only want to allow D-Bus connections from
4190 * processes owned by the same uid as the server, you would use a
4191 * signal handler like the following:
4192 * <example id="auth-observer"><title>Controlling Authentication</title><programlisting>
4194 * on_authorize_authenticated_peer (GDBusAuthObserver *observer,
4195 * GIOStream *stream,
4196 * GCredentials *credentials,
4197 * gpointer user_data)
4199 * gboolean authorized;
4201 * authorized = FALSE;
4202 * if (credentials != NULL)
4204 * GCredentials *own_credentials;
4205 * own_credentials = g_credentials_new ();
4206 * if (g_credentials_is_same_user (credentials, own_credentials, NULL))
4207 * authorized = TRUE;
4208 * g_object_unref (own_credentials);
4211 * return authorized;
4213 * </programlisting></example>
4218 * SECTION:gdbusconnection
4219 * @short_description: D-Bus Connections
4220 * @include: gio/gio.h
4222 * The #GDBusConnection type is used for D-Bus connections to remote
4223 * peers such as a message buses. It is a low-level API that offers a
4224 * lot of flexibility. For instance, it lets you establish a connection
4225 * over any transport that can by represented as an #GIOStream.
4227 * This class is rarely used directly in D-Bus clients. If you are writing
4228 * an D-Bus client, it is often easier to use the g_bus_own_name(),
4229 * g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs.
4231 * As an exception to the usual GLib rule that a particular object must not be
4232 * used by two threads at the same time, #GDBusConnection's methods may be
4233 * called from any thread<footnote>
4235 * This is so that g_bus_get() and g_bus_get_sync() can safely return the
4236 * same #GDBusConnection when called from any thread.
4240 * Most of the ways to obtain a #GDBusConnection automatically initialize it
4241 * (i.e. connect to D-Bus): for instance, g_dbus_connection_new() and
4242 * g_bus_get(), and the synchronous versions of those methods, give you an
4243 * initialized connection. Language bindings for GIO should use
4244 * g_initable_new() or g_async_initable_new_async(), which also initialize the
4247 * If you construct an uninitialized #GDBusConnection, such as via
4248 * g_object_new(), you must initialize it via g_initable_init() or
4249 * g_async_initable_init_async() before using its methods or properties.
4250 * Calling methods or accessing properties on a #GDBusConnection that has not
4251 * completed initialization successfully is considered to be invalid, and leads
4252 * to undefined behaviour. In particular, if initialization fails with a
4253 * #GError, the only valid thing you can do with that #GDBusConnection is to
4254 * free it with g_object_unref().
4256 * <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>
4258 * <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>
4260 * <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>
4262 * <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>
4267 * SECTION:gdbuserror
4268 * @title: GDBusError
4269 * @short_description: Mapping D-Bus errors to and from GError
4270 * @include: gio/gio.h
4272 * All facilities that return errors from remote methods (such as
4273 * g_dbus_connection_call_sync()) use #GError to represent both D-Bus
4274 * errors (e.g. errors returned from the other peer) and locally
4275 * in-process generated errors.
4277 * To check if a returned #GError is an error from a remote peer, use
4278 * g_dbus_error_is_remote_error(). To get the actual D-Bus error name,
4279 * use g_dbus_error_get_remote_error(). Before presenting an error,
4280 * always use g_dbus_error_strip_remote_error().
4282 * In addition, facilities used to return errors to a remote peer also
4283 * use #GError. See g_dbus_method_invocation_return_error() for
4284 * discussion about how the D-Bus error name is set.
4286 * Applications can associate a #GError error domain with a set of D-Bus errors in order to
4287 * automatically map from D-Bus errors to #GError and back. This
4288 * is typically done in the function returning the #GQuark for the
4290 * <example id="error-registration"><title>Error Registration</title><programlisting>
4291 * /<!-- -->* foo-bar-error.h: *<!-- -->/
4293 * #define FOO_BAR_ERROR (foo_bar_error_quark ())
4294 * GQuark foo_bar_error_quark (void);
4298 * FOO_BAR_ERROR_FAILED,
4299 * FOO_BAR_ERROR_ANOTHER_ERROR,
4300 * FOO_BAR_ERROR_SOME_THIRD_ERROR,
4301 * FOO_BAR_N_ERRORS /<!-- -->*< skip >*<!-- -->/
4304 * /<!-- -->* foo-bar-error.c: *<!-- -->/
4306 * static const GDBusErrorEntry foo_bar_error_entries[] =
4308 * {FOO_BAR_ERROR_FAILED, "org.project.Foo.Bar.Error.Failed"},
4309 * {FOO_BAR_ERROR_ANOTHER_ERROR, "org.project.Foo.Bar.Error.AnotherError"},
4310 * {FOO_BAR_ERROR_SOME_THIRD_ERROR, "org.project.Foo.Bar.Error.SomeThirdError"},
4313 * /<!-- -->* Ensure that every error code has an associated D-Bus error name *<!-- -->/
4314 * G_STATIC_ASSERT (G_N_ELEMENTS (foo_bar_error_entries) == FOO_BAR_N_ERRORS);
4317 * foo_bar_error_quark (void)
4319 * static volatile gsize quark_volatile = 0;
4320 * g_dbus_error_register_error_domain ("foo-bar-error-quark",
4322 * foo_bar_error_entries,
4323 * G_N_ELEMENTS (foo_bar_error_entries));
4324 * return (GQuark) quark_volatile;
4326 * </programlisting></example>
4327 * With this setup, a D-Bus peer can transparently pass e.g. %FOO_BAR_ERROR_ANOTHER_ERROR and
4328 * other peers will see the D-Bus error name <literal>org.project.Foo.Bar.Error.AnotherError</literal>.
4330 * If the other peer is using GDBus, and has registered the association with
4331 * g_dbus_error_register_error_domain() in advance (e.g. by invoking the %FOO_BAR_ERROR quark
4332 * generation itself in the previous example) the peer will see also %FOO_BAR_ERROR_ANOTHER_ERROR instead
4333 * of %G_IO_ERROR_DBUS_ERROR. Note that GDBus clients can still recover
4334 * <literal>org.project.Foo.Bar.Error.AnotherError</literal> using g_dbus_error_get_remote_error().
4336 * Note that errors in the %G_DBUS_ERROR error domain is intended only
4337 * for returning errors from a remote message bus process. Errors
4338 * generated locally in-process by e.g. #GDBusConnection is from the
4339 * %G_IO_ERROR domain.
4344 * SECTION:gdbusinterface
4345 * @short_description: Base type for D-Bus interfaces
4346 * @include: gio/gio.h
4348 * The #GDBusInterface type is the base type for D-Bus interfaces both
4349 * on the service side (see #GDBusInterfaceSkeleton) and client side
4350 * (see #GDBusProxy).
4355 * SECTION:gdbusinterfaceskeleton
4356 * @short_description: Service-side D-Bus interface
4357 * @include: gio/gio.h
4359 * Abstract base class for D-Bus interfaces on the service side.
4364 * SECTION:gdbusintrospection
4365 * @title: D-Bus Introspection Data
4366 * @short_description: Node and interface description data structures
4367 * @include: gio/gio.h
4369 * Various data structures and convenience routines to parse and
4370 * generate D-Bus introspection XML. Introspection information is
4371 * used when registering objects with g_dbus_connection_register_object().
4373 * The format of D-Bus introspection XML is specified in the
4374 * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format">D-Bus specification</ulink>.
4379 * SECTION:gdbusmenumodel
4380 * @title: GDBusMenuModel
4381 * @short_description: A D-Bus GMenuModel implementation
4382 * @see_also: <link linkend="gio-GMenuModel-exporter">GMenuModel Exporter</link>
4384 * #GDBusMenuModel is an implementation of #GMenuModel that can be used
4385 * as a proxy for a menu model that is exported over D-Bus with
4386 * g_dbus_connection_export_menu_model().
4391 * SECTION:gdbusmessage
4392 * @short_description: D-Bus Message
4393 * @include: gio/gio.h
4395 * A type for representing D-Bus messages that can be sent or received
4396 * on a #GDBusConnection.
4401 * SECTION:gdbusmethodinvocation
4402 * @short_description: Object for handling remote calls
4403 * @include: gio/gio.h
4405 * Instances of the #GDBusMethodInvocation class are used when
4406 * handling D-Bus method calls. It provides a way to asynchronously
4407 * return results and errors.
4409 * The normal way to obtain a #GDBusMethodInvocation object is to receive
4410 * it as an argument to the handle_method_call() function in a
4411 * #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
4416 * SECTION:gdbusnameowning
4417 * @title: Owning Bus Names
4418 * @short_description: Simple API for owning bus names
4419 * @include: gio/gio.h
4421 * Convenience API for owning bus names.
4423 * <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>
4428 * SECTION:gdbusnamewatching
4429 * @title: Watching Bus Names
4430 * @short_description: Simple API for watching bus names
4431 * @include: gio/gio.h
4433 * Convenience API for watching bus names.
4435 * <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>
4440 * SECTION:gdbusobject
4441 * @short_description: Base type for D-Bus objects
4442 * @include: gio/gio.h
4444 * The #GDBusObject type is the base type for D-Bus objects on both
4445 * the service side (see #GDBusObjectSkeleton) and the client side
4446 * (see #GDBusObjectProxy). It is essentially just a container of
4452 * SECTION:gdbusobjectmanager
4453 * @short_description: Base type for D-Bus object managers
4454 * @include: gio/gio.h
4456 * The #GDBusObjectManager type is the base type for service- and
4457 * client-side implementations of the standardized <ulink
4458 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4461 * See #GDBusObjectManagerClient for the client-side implementation
4462 * and #GDBusObjectManagerServer for the service-side implementation.
4467 * SECTION:gdbusobjectmanagerclient
4468 * @short_description: Client-side object manager
4469 * @include: gio/gio.h
4471 * #GDBusObjectManagerClient is used to create, monitor and delete object
4472 * proxies for remote objects exported by a #GDBusObjectManagerServer (or any
4473 * code implementing the <ulink
4474 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4477 * Once an instance of this type has been created, you can connect to
4478 * the #GDBusObjectManager::object-added and
4479 * #GDBusObjectManager::object-removed signals and inspect the
4480 * #GDBusObjectProxy objects returned by
4481 * g_dbus_object_manager_get_objects().
4483 * If the name for a #GDBusObjectManagerClient is not owned by anyone at
4484 * object construction time, the default behavior is to request the
4485 * message bus to launch an owner for the name. This behavior can be
4486 * disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
4487 * flag. It's also worth noting that this only works if the name of
4488 * interest is activatable in the first place. E.g. in some cases it
4489 * is not possible to launch an owner for the requested name. In this
4490 * case, #GDBusObjectManagerClient object construction still succeeds but
4491 * there will be no object proxies
4492 * (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
4493 * the #GDBusObjectManagerClient:name-owner property is %NULL.
4495 * The owner of the requested name can come and go (for example
4496 * consider a system service being restarted) – #GDBusObjectManagerClient
4497 * handles this case too; simply connect to the #GObject::notify
4498 * signal to watch for changes on the #GDBusObjectManagerClient:name-owner
4499 * property. When the name owner vanishes, the behavior is that
4500 * #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
4501 * emission of the #GObject::notify signal) and then
4502 * #GDBusObjectManager::object-removed signals are synthesized
4503 * for all currently existing object proxies. Since
4504 * #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
4505 * use this information to disambiguate a synthesized signal from a
4506 * genuine signal caused by object removal on the remote
4507 * #GDBusObjectManager. Similarly, when a new name owner appears,
4508 * #GDBusObjectManager::object-added signals are synthesized
4509 * while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
4510 * object proxies have been added, the #GDBusObjectManagerClient:name-owner
4511 * is set to the new name owner (this includes emission of the
4512 * #GObject::notify signal). Furthermore, you are guaranteed that
4513 * #GDBusObjectManagerClient:name-owner will alternate between a name owner
4514 * (e.g. <literal>:1.42</literal>) and %NULL even in the case where
4515 * the name of interest is atomically replaced
4517 * Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
4518 * instances. All signals (including the
4519 * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
4520 * signal) delivered to #GDBusProxy instances are guaranteed to
4521 * originate from the name owner. This guarantee along with the
4522 * behavior described above, means that certain race conditions
4523 * including the <emphasis><quote>half the proxy is from the old owner
4524 * and the other half is from the new owner</quote></emphasis> problem
4527 * To avoid having the application connect to signals on the returned
4528 * #GDBusObjectProxy and #GDBusProxy objects, the
4529 * #GDBusObject::interface-added,
4530 * #GDBusObject::interface-removed,
4531 * #GDBusProxy::g-properties-changed and
4532 * #GDBusProxy::g-signal signals
4533 * are also emitted on the #GDBusObjectManagerClient instance managing these
4534 * objects. The signals emitted are
4535 * #GDBusObjectManager::interface-added,
4536 * #GDBusObjectManager::interface-removed,
4537 * #GDBusObjectManagerClient::interface-proxy-properties-changed and
4538 * #GDBusObjectManagerClient::interface-proxy-signal.
4540 * Note that all callbacks and signals are emitted in the
4541 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4542 * that the #GDBusObjectManagerClient object was constructed
4543 * in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
4544 * originating from the #GDBusObjectManagerClient object will be created in
4545 * the same context and, consequently, will deliver signals in the
4551 * SECTION:gdbusobjectmanagerserver
4552 * @short_description: Service-side object manager
4553 * @include: gio/gio.h
4555 * #GDBusObjectManagerServer is used to export #GDBusObject instances using
4556 * the standardized <ulink
4557 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4558 * interface. For example, remote D-Bus clients can get all objects
4559 * and properties in a single call. Additionally, any change in the
4560 * object hierarchy is broadcast using signals. This means that D-Bus
4561 * clients can keep caches up to date by only listening to D-Bus
4564 * See #GDBusObjectManagerClient for the client-side code that is
4565 * intended to be used with #GDBusObjectManagerServer or any D-Bus
4566 * object implementing the org.freedesktop.DBus.ObjectManager
4572 * SECTION:gdbusobjectproxy
4573 * @short_description: Client-side D-Bus object
4574 * @include: gio/gio.h
4576 * A #GDBusObjectProxy is an object used to represent a remote object
4577 * with one or more D-Bus interfaces. Normally, you don't instantiate
4578 * a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
4579 * is used to obtain it.
4586 * SECTION:gdbusobjectskeleton
4587 * @short_description: Service-side D-Bus object
4588 * @include: gio/gio.h
4590 * A #GDBusObjectSkeleton instance is essentially a group of D-Bus
4591 * interfaces. The set of exported interfaces on the object may be
4592 * dynamic and change at runtime.
4594 * This type is intended to be used with #GDBusObjectManager.
4599 * SECTION:gdbusproxy
4600 * @short_description: Client-side D-Bus interface proxy
4601 * @include: gio/gio.h
4603 * #GDBusProxy is a base class used for proxies to access a D-Bus
4604 * interface on a remote object. A #GDBusProxy can be constructed for
4605 * both well-known and unique names.
4607 * By default, #GDBusProxy will cache all properties (and listen to
4608 * changes) of the remote object, and proxy all signals that gets
4609 * emitted. This behaviour can be changed by passing suitable
4610 * #GDBusProxyFlags when the proxy is created. If the proxy is for a
4611 * well-known name, the property cache is flushed when the name owner
4612 * vanishes and reloaded when a name owner appears.
4614 * If a #GDBusProxy is used for a well-known name, the owner of the
4615 * name is tracked and can be read from
4616 * #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
4617 * get notified of changes. Additionally, only signals and property
4618 * changes emitted from the current name owner are considered and
4619 * calls are always sent to the current name owner. This avoids a
4620 * number of race conditions when the name is lost by one owner and
4621 * claimed by another. However, if no name owner currently exists,
4622 * then calls will be sent to the well-known name which may result in
4623 * the message bus launching an owner (unless
4624 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
4626 * The generic #GDBusProxy::g-properties-changed and
4627 * #GDBusProxy::g-signal signals are not very convenient to work
4628 * with. Therefore, the recommended way of working with proxies is to
4629 * subclass #GDBusProxy, and have more natural properties and signals
4630 * in your derived class. See <xref linkend="gdbus-example-gdbus-codegen"/>
4631 * for how this can easily be done using the
4632 * <command><link linkend="gdbus-codegen">gdbus-codegen</link></command>
4635 * A #GDBusProxy instance can be used from multiple threads but note
4636 * that all signals (e.g. #GDBusProxy::g-signal, #GDBusProxy::g-properties-changed
4637 * and #GObject::notify) are emitted in the
4638 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4639 * of the thread where the instance was constructed.
4641 * <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>
4646 * SECTION:gdbusserver
4647 * @short_description: Helper for accepting connections
4648 * @include: gio/gio.h
4650 * #GDBusServer is a helper for listening to and accepting D-Bus
4651 * connections. This can be used to create a new D-Bus server, allowing two
4652 * peers to use the D-Bus protocol for their own specialized communication.
4653 * A server instance provided in this way will not perform message routing or
4654 * implement the org.freedesktop.DBus interface.
4656 * To just export an object on a well-known name on a message bus, such as the
4657 * session or system bus, you should instead use g_bus_own_name().
4659 * <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>
4664 * SECTION:gdbusutils
4665 * @title: D-Bus Utilities
4666 * @short_description: Various utilities related to D-Bus.
4667 * @include: gio/gio.h
4669 * Various utility routines related to D-Bus.
4674 * SECTION:gdesktopappinfo
4675 * @title: GDesktopAppInfo
4676 * @short_description: Application information from desktop files
4677 * @include: gio/gdesktopappinfo.h
4679 * #GDesktopAppInfo is an implementation of #GAppInfo based on
4682 * Note that <filename><gio/gdesktopappinfo.h></filename> belongs to
4683 * the UNIX-specific GIO interfaces, thus you have to use the
4684 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4690 * @short_description: Drive management
4691 * @include: gio/gio.h
4693 * #GDrive - this represent a piece of hardware connected to the machine.
4694 * It's generally only created for removable hardware or hardware with
4697 * #GDrive is a container class for #GVolume objects that stem from
4698 * the same piece of media. As such, #GDrive abstracts a drive with
4699 * (or without) removable media and provides operations for querying
4700 * whether media is available, determining whether media change is
4701 * automatically detected and ejecting the media.
4703 * If the #GDrive reports that media isn't automatically detected, one
4704 * can poll for media; typically one should not do this periodically
4705 * as a poll for media operation is potententially expensive and may
4706 * spin up the drive creating noise.
4708 * #GDrive supports starting and stopping drives with authentication
4709 * support for the former. This can be used to support a diverse set
4710 * of use cases including connecting/disconnecting iSCSI devices,
4711 * powering down external disk enclosures and starting/stopping
4712 * multi-disk devices such as RAID devices. Note that the actual
4713 * semantics and side-effects of starting/stopping a #GDrive may vary
4714 * according to implementation. To choose the correct verbs in e.g. a
4715 * file manager, use g_drive_get_start_stop_type().
4717 * For porting from GnomeVFS note that there is no equivalent of
4718 * #GDrive in that API.
4724 * @short_description: An object for emblems
4725 * @include: gio/gio.h
4726 * @see_also: #GIcon, #GEmblemedIcon, #GLoadableIcon, #GThemedIcon
4728 * #GEmblem is an implementation of #GIcon that supports
4729 * having an emblem, which is an icon with additional properties.
4730 * It can than be added to a #GEmblemedIcon.
4732 * Currently, only metainformation about the emblem's origin is
4733 * supported. More may be added in the future.
4738 * SECTION:gemblemedicon
4739 * @short_description: Icon with emblems
4740 * @include: gio/gio.h
4741 * @see_also: #GIcon, #GLoadableIcon, #GThemedIcon, #GEmblem
4743 * #GEmblemedIcon is an implementation of #GIcon that supports
4744 * adding an emblem to an icon. Adding multiple emblems to an
4745 * icon is ensured via g_emblemed_icon_add_emblem().
4747 * Note that #GEmblemedIcon allows no control over the position
4748 * of the emblems. See also #GEmblem for more information.
4754 * @short_description: File and Directory Handling
4755 * @include: gio/gio.h
4756 * @see_also: #GFileInfo, #GFileEnumerator
4758 * #GFile is a high level abstraction for manipulating files on a
4759 * virtual file system. #GFiles are lightweight, immutable objects
4760 * that do no I/O upon creation. It is necessary to understand that
4761 * #GFile objects do not represent files, merely an identifier for a
4762 * file. All file content I/O is implemented as streaming operations
4763 * (see #GInputStream and #GOutputStream).
4765 * To construct a #GFile, you can use:
4767 * <member>g_file_new_for_path() if you have a path.</member>
4768 * <member>g_file_new_for_uri() if you have a URI.</member>
4769 * <member>g_file_new_for_commandline_arg() for a command line argument.</member>
4770 * <member>g_file_new_tmp() to create a temporary file from a template.</member>
4771 * <member>g_file_parse_name() from a UTF-8 string gotten from g_file_get_parse_name().</member>
4774 * One way to think of a #GFile is as an abstraction of a pathname. For
4775 * normal files the system pathname is what is stored internally, but as
4776 * #GFiles are extensible it could also be something else that corresponds
4777 * to a pathname in a userspace implementation of a filesystem.
4779 * #GFiles make up hierarchies of directories and files that correspond to
4780 * the files on a filesystem. You can move through the file system with
4781 * #GFile using g_file_get_parent() to get an identifier for the parent
4782 * directory, g_file_get_child() to get a child within a directory,
4783 * g_file_resolve_relative_path() to resolve a relative path between two
4784 * #GFiles. There can be multiple hierarchies, so you may not end up at
4785 * the same root if you repeatedly call g_file_get_parent() on two different
4788 * All #GFiles have a basename (get with g_file_get_basename()). These names
4789 * are byte strings that are used to identify the file on the filesystem
4790 * (relative to its parent directory) and there is no guarantees that they
4791 * have any particular charset encoding or even make any sense at all. If
4792 * you want to use filenames in a user interface you should use the display
4793 * name that you can get by requesting the
4794 * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
4795 * This is guaranteed to be in UTF-8 and can be used in a user interface.
4796 * But always store the real basename or the #GFile to use to actually
4797 * access the file, because there is no way to go from a display name to
4800 * Using #GFile as an identifier has the same weaknesses as using a path
4801 * in that there may be multiple aliases for the same file. For instance,
4802 * hard or soft links may cause two different #GFiles to refer to the same
4803 * file. Other possible causes for aliases are: case insensitive filesystems,
4804 * short and long names on FAT/NTFS, or bind mounts in Linux. If you want to
4805 * check if two #GFiles point to the same file you can query for the
4806 * %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
4807 * canonicalization of pathnames passed in, so that trivial differences in
4808 * the path string used at creation (duplicated slashes, slash at end of
4809 * path, "." or ".." path segments, etc) does not create different #GFiles.
4811 * Many #GFile operations have both synchronous and asynchronous versions
4812 * to suit your application. Asynchronous versions of synchronous functions
4813 * simply have _async() appended to their function names. The asynchronous
4814 * I/O functions call a #GAsyncReadyCallback which is then used to finalize
4815 * the operation, producing a GAsyncResult which is then passed to the
4816 * function's matching _finish() operation.
4818 * Some #GFile operations do not have synchronous analogs, as they may
4819 * take a very long time to finish, and blocking may leave an application
4820 * unusable. Notable cases include:
4822 * <member>g_file_mount_mountable() to mount a mountable file.</member>
4823 * <member>g_file_unmount_mountable_with_operation() to unmount a mountable file.</member>
4824 * <member>g_file_eject_mountable_with_operation() to eject a mountable file.</member>
4827 * <para id="gfile-etag"><indexterm><primary>entity tag</primary></indexterm>
4828 * One notable feature of #GFiles are entity tags, or "etags" for
4829 * short. Entity tags are somewhat like a more abstract version of the
4830 * traditional mtime, and can be used to quickly determine if the file has
4831 * been modified from the version on the file system. See the HTTP 1.1
4832 * <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">specification</ulink>
4833 * for HTTP Etag headers, which are a very similar concept.
4839 * SECTION:gfileattribute
4840 * @short_description: Key-Value Paired File Attributes
4841 * @include: gio/gio.h
4842 * @see_also: #GFile, #GFileInfo
4844 * File attributes in GIO consist of a list of key-value pairs.
4846 * Keys are strings that contain a key namespace and a key name, separated
4847 * by a colon, e.g. "namespace::keyname". Namespaces are included to sort
4848 * key-value pairs by namespaces for relevance. Keys can be retrived
4849 * using wildcards, e.g. "standard::*" will return all of the keys in the
4850 * "standard" namespace.
4852 * The list of possible attributes for a filesystem (pointed to by a #GFile) is
4853 * available as a #GFileAttributeInfoList. This list is queryable by key names
4854 * as indicated earlier.
4856 * Information is stored within the list in #GFileAttributeInfo structures.
4857 * The info structure can store different types, listed in the enum
4858 * #GFileAttributeType. Upon creation of a #GFileAttributeInfo, the type will
4859 * be set to %G_FILE_ATTRIBUTE_TYPE_INVALID.
4861 * Classes that implement #GFileIface will create a #GFileAttributeInfoList and
4862 * install default keys and values for their given file system, architecture,
4863 * and other possible implementation details (e.g., on a UNIX system, a file
4864 * attribute key will be registered for the user id for a given file).
4868 * <title>GFileAttributes Default Namespaces</title>
4869 * <tgroup cols='2' align='left'><thead>
4870 * <row><entry>Namspace</entry><entry>Description</entry></row>
4873 * <row><entry>"standard"</entry><entry>The "Standard" namespace. General file
4874 * information that any application may need should be put in this namespace.
4875 * Examples include the file's name, type, and size.</entry></row>
4876 * <row><entry>"etag"</entry><entry>The <link linkend="gfile-etag">"Entity Tag"</link>
4877 * namespace. Currently, the only key in this namespace is "value", which contains
4878 * the value of the current entity tag.</entry></row>
4879 * <row><entry>"id"</entry><entry>The "Identification" namespace. This
4880 * namespace is used by file managers and applications that list directories
4881 * to check for loops and to uniquely identify files.</entry></row>
4882 * <row><entry>"access"</entry><entry>The "Access" namespace. Used to check
4883 * if a user has the proper privilidges to access files and perform
4884 * file operations. Keys in this namespace are made to be generic
4885 * and easily understood, e.g. the "can_read" key is %TRUE if
4886 * the current user has permission to read the file. UNIX permissions and
4887 * NTFS ACLs in Windows should be mapped to these values.</entry></row>
4888 * <row><entry>"mountable"</entry><entry>The "Mountable" namespace. Includes
4889 * simple boolean keys for checking if a file or path supports mount operations, e.g.
4890 * mount, unmount, eject. These are used for files of type %G_FILE_TYPE_MOUNTABLE.</entry></row>
4891 * <row><entry>"time"</entry><entry>The "Time" namespace. Includes file
4892 * access, changed, created times. </entry></row>
4893 * <row><entry>"unix"</entry><entry>The "Unix" namespace. Includes UNIX-specific
4894 * information and may not be available for all files. Examples include
4895 * the UNIX "UID", "GID", etc.</entry></row>
4896 * <row><entry>"dos"</entry><entry>The "DOS" namespace. Includes DOS-specific
4897 * information and may not be available for all files. Examples include
4898 * "is_system" for checking if a file is marked as a system file, and "is_archive"
4899 * for checking if a file is marked as an archive file.</entry></row>
4900 * <row><entry>"owner"</entry><entry>The "Owner" namespace. Includes information
4901 * about who owns a file. May not be available for all file systems. Examples include
4902 * "user" for getting the user name of the file owner. This information is often mapped from
4903 * some backend specific data such as a unix UID.</entry></row>
4904 * <row><entry>"thumbnail"</entry><entry>The "Thumbnail" namespace. Includes
4905 * information about file thumbnails and their location within the file system. Examples of
4906 * keys in this namespace include "path" to get the location of a thumbnail, and "failed"
4907 * to check if thumbnailing of the file failed.</entry></row>
4908 * <row><entry>"filesystem"</entry><entry>The "Filesystem" namespace. Gets information
4909 * about the file system where a file is located, such as its type, how much
4910 * space is left available, and the overall size of the file system.</entry></row>
4911 * <row><entry>"gvfs"</entry><entry>The "GVFS" namespace. Keys in this namespace
4912 * contain information about the current GVFS backend in use. </entry></row>
4913 * <row><entry>"xattr"</entry><entry>The "xattr" namespace. Gets information
4914 * about extended user attributes. See attr(5). The "user." prefix of the
4915 * extended user attribute name is stripped away when constructing keys in
4916 * this namespace, e.g. "xattr::mime_type" for the extended attribute with
4917 * the name "user.mime_type". Note that this information is only available
4918 * if GLib has been built with extended attribute support.</entry></row>
4919 * <row><entry>"xattr-sys"</entry><entry>The "xattr-sys" namespace.
4920 * Gets information about extended attributes which are not user-specific.
4921 * See attr(5). Note that this information is only available if GLib
4922 * has been built with extended attribute support.</entry></row>
4923 * <row><entry>"selinux"</entry><entry>The "SELinux" namespace. Includes
4924 * information about the SELinux context of files. Note that this information
4925 * is only available if GLib has been built with SELinux support.</entry></row>
4931 * Please note that these are not all of the possible namespaces.
4932 * More namespaces can be added from GIO modules or by individual applications.
4933 * For more information about writing GIO modules, see #GIOModule.
4935 * <!-- TODO: Implementation note about using extended attributes on supported
4939 * <title>GFileAttributes Built-in Keys and Value Types</title>
4940 * <tgroup cols='3' align='left'><thead>
4941 * <row><entry>Enum Value</entry><entry>Namespace::Key</entry><entry>Value Type</entry></row>
4943 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TYPE</entry><entry>standard::type</entry><entry>uint32 (#GFileType)</entry></row>
4944 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN</entry><entry>standard::is-hidden</entry><entry>boolean</entry></row>
4945 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP</entry><entry>standard::is-backup</entry><entry>boolean</entry></row>
4946 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK</entry><entry>standard::is-symlink</entry><entry>boolean</entry></row>
4947 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL</entry><entry>standard::is-virtual</entry><entry>boolean</entry></row>
4948 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_NAME</entry><entry>standard::name</entry><entry>byte string</entry></row>
4949 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</entry><entry>standard::display-name</entry><entry>string</entry></row>
4950 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME</entry><entry>standard::edit-name</entry><entry>string</entry></row>
4951 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ICON</entry><entry>standard::icon</entry><entry>object (#GIcon)</entry></row>
4952 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE</entry><entry>standard::content-type</entry><entry>string</entry></row>
4953 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE</entry><entry>standard::fast-content-type</entry><entry>string</entry></row>
4954 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SIZE</entry><entry>standard::size</entry><entry>uint64</entry></row>
4955 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE</entry><entry>standard::allocated-size</entry><entry>uint64</entry></row>
4956 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET</entry><entry>standard::symlink-target</entry><entry>byte string</entry></row>
4957 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TARGET_URI</entry><entry>standard::target-uri</entry><entry>string</entry></row>
4958 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER</entry><entry>standard::sort-order</entry><entry>int32</entry></row>
4959 * <row><entry>%G_FILE_ATTRIBUTE_ETAG_VALUE</entry><entry>etag::value</entry><entry>string</entry></row>
4960 * <row><entry>%G_FILE_ATTRIBUTE_ID_FILE</entry><entry>id::file</entry><entry>string</entry></row>
4961 * <row><entry>%G_FILE_ATTRIBUTE_ID_FILESYSTEM</entry><entry>id::filesystem</entry><entry>string</entry></row>
4962 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_READ</entry><entry>access::can-read</entry><entry>boolean</entry></row>
4963 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE</entry><entry>access::can-write</entry><entry>boolean</entry></row>
4964 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE</entry><entry>access::can-execute</entry><entry>boolean</entry></row>
4965 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE</entry><entry>access::can-delete</entry><entry>boolean</entry></row>
4966 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH</entry><entry>access::can-trash</entry><entry>boolean</entry></row>
4967 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME</entry><entry>access::can-rename</entry><entry>boolean</entry></row>
4968 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT</entry><entry>mountable::can-mount</entry><entry>boolean</entry></row>
4969 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT</entry><entry>mountable::can-unmount</entry><entry>boolean</entry></row>
4970 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT</entry><entry>mountable::can-eject</entry><entry>boolean</entry></row>
4971 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE</entry><entry>mountable::unix-device</entry><entry>uint32</entry></row>
4972 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE</entry><entry>mountable::unix-device-file</entry><entry>string</entry></row>
4973 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI</entry><entry>mountable::hal-udi</entry><entry>string</entry></row>
4974 * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED</entry><entry>time::modified</entry><entry>uint64</entry></row>
4975 * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC</entry><entry>time::modified-usec</entry><entry>uint32</entry></row>
4976 * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS</entry><entry>time::access</entry><entry>uint64</entry></row>
4977 * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS_USEC</entry><entry>time::access-usec</entry><entry>uint32</entry></row>
4978 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED</entry><entry>time::changed</entry><entry>uint64</entry></row>
4979 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED_USEC</entry><entry>time::changed-usec</entry><entry>uint32</entry></row>
4980 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED</entry><entry>time::created</entry><entry>uint64</entry></row>
4981 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED_USEC</entry><entry>time::created-usec</entry><entry>uint32</entry></row>
4982 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_DEVICE</entry><entry>unix::device</entry><entry>uint32</entry></row>
4983 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_INODE</entry><entry>unix::inode</entry><entry>uint64</entry></row>
4984 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_MODE</entry><entry>unix::mode</entry><entry>uint32</entry></row>
4985 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_NLINK</entry><entry>unix::nlink</entry><entry>uint32</entry></row>
4986 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_UID</entry><entry>unix::uid</entry><entry>uint32</entry></row>
4987 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_GID</entry><entry>unix::gid</entry><entry>uint32</entry></row>
4988 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_RDEV</entry><entry>unix::rdev</entry><entry>uint32</entry></row>
4989 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE</entry><entry>unix::block-size</entry><entry>uint32</entry></row>
4990 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCKS</entry><entry>unix::blocks</entry><entry>uint64</entry></row>
4991 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT</entry><entry>unix::is-mountpoint</entry><entry>boolean</entry></row>
4992 * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE</entry><entry>dos::is-archive</entry><entry>boolean</entry></row>
4993 * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_SYSTEM</entry><entry>dos::is-system</entry><entry>boolean</entry></row>
4994 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER</entry><entry>owner::user</entry><entry>string</entry></row>
4995 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER_REAL</entry><entry>owner::user-real</entry><entry>string</entry></row>
4996 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_GROUP</entry><entry>owner::group</entry><entry>string</entry></row>
4997 * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAIL_PATH</entry><entry>thumbnail::path</entry><entry>bytestring</entry></row>
4998 * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAILING_FAILED</entry><entry>thumbnail::failed</entry><entry>boolean</entry></row>
4999 * <row><entry>%G_FILE_ATTRIBUTE_PREVIEW_ICON</entry><entry>preview::icon</entry><entry>object (#GIcon)</entry></row>
5000 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_SIZE</entry><entry>filesystem::size</entry><entry>uint64</entry></row>
5001 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_FREE</entry><entry>filesystem::free</entry><entry>uint64</entry></row>
5002 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_USED</entry><entry>filesystem::used</entry><entry>uint64</entry></row>
5003 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_TYPE</entry><entry>filesystem::type</entry><entry>string</entry></row>
5004 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_READONLY</entry><entry>filesystem::readonly</entry><entry>boolean</entry></row>
5005 * <row><entry>%G_FILE_ATTRIBUTE_GVFS_BACKEND</entry><entry>gvfs::backend</entry><entry>string</entry></row>
5006 * <row><entry>%G_FILE_ATTRIBUTE_SELINUX_CONTEXT</entry><entry>selinux::context</entry><entry>string</entry></row>
5007 * </tbody></tgroup></table></para>
5009 * Note that there are no predefined keys in the "xattr" and "xattr-sys"
5010 * namespaces. Keys for the "xattr" namespace are constructed by stripping
5011 * away the "user." prefix from the extended user attribute, and prepending
5012 * "xattr::". Keys for the "xattr-sys" namespace are constructed by
5013 * concatenating "xattr-sys::" with the extended attribute name. All extended
5014 * attribute values are returned as hex-encoded strings in which bytes outside
5015 * the ASCII range are encoded as hexadecimal escape sequences of the form
5016 * \x<replaceable>nn</replaceable>.
5021 * SECTION:gfiledescriptorbased
5022 * @short_description: Interface for file descriptor based IO
5023 * @include: gio/gfiledescriptorbased.h
5024 * @see_also: #GInputStream, #GOutputStream
5026 * #GFileDescriptorBased is implemented by streams (implementations of
5027 * #GInputStream or #GOutputStream) that are based on file descriptors.
5029 * Note that <filename><gio/gfiledescriptorbased.h></filename> belongs to
5030 * the UNIX-specific GIO interfaces, thus you have to use the
5031 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
5038 * SECTION:gfileenumerator
5039 * @short_description: Enumerated Files Routines
5040 * @include: gio/gio.h
5042 * #GFileEnumerator allows you to operate on a set of #GFile<!-- -->s,
5043 * returning a #GFileInfo structure for each file enumerated (e.g.
5044 * g_file_enumerate_children() will return a #GFileEnumerator for each
5045 * of the children within a directory).
5047 * To get the next file's information from a #GFileEnumerator, use
5048 * g_file_enumerator_next_file() or its asynchronous version,
5049 * g_file_enumerator_next_files_async(). Note that the asynchronous
5050 * version will return a list of #GFileInfo<!---->s, whereas the
5051 * synchronous will only return the next file in the enumerator.
5053 * To close a #GFileEnumerator, use g_file_enumerator_close(), or
5054 * its asynchronous version, g_file_enumerator_close_async(). Once
5055 * a #GFileEnumerator is closed, no further actions may be performed
5056 * on it, and it should be freed with g_object_unref().
5062 * @short_description: Icons pointing to an image file
5063 * @include: gio/gio.h
5064 * @see_also: #GIcon, #GLoadableIcon
5066 * #GFileIcon specifies an icon by pointing to an image file
5067 * to be used as icon.
5073 * @short_description: File Information and Attributes
5074 * @include: gio/gio.h
5075 * @see_also: #GFile, <link linkend="gio-GFileAttribute">GFileAttribute</link>
5077 * Functionality for manipulating basic metadata for files. #GFileInfo
5078 * implements methods for getting information that all files should
5079 * contain, and allows for manipulation of extended attributes.
5081 * See <link linkend="gio-GFileAttribute">GFileAttribute</link> for more
5082 * information on how GIO handles file attributes.
5084 * To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
5085 * async variant). To obtain a #GFileInfo for a file input or output
5086 * stream, use g_file_input_stream_query_info() or
5087 * g_file_output_stream_query_info() (or their async variants).
5089 * To change the actual attributes of a file, you should then set the
5090 * attribute in the #GFileInfo and call g_file_set_attributes_from_info()
5091 * or g_file_set_attributes_async() on a GFile.
5093 * However, not all attributes can be changed in the file. For instance,
5094 * the actual size of a file cannot be changed via g_file_info_set_size().
5095 * You may call g_file_query_settable_attributes() and
5096 * g_file_query_writable_namespaces() to discover the settable attributes
5097 * of a particular file at runtime.
5099 * #GFileAttributeMatcher allows for searching through a #GFileInfo for
5105 * SECTION:gfileinputstream
5106 * @short_description: File input streaming operations
5107 * @include: gio/gio.h
5108 * @see_also: #GInputStream, #GDataInputStream, #GSeekable
5110 * GFileInputStream provides input streams that take their
5111 * content from a file.
5113 * GFileInputStream implements #GSeekable, which allows the input
5114 * stream to jump to arbitrary positions in the file, provided the
5115 * filesystem of the file allows it. To find the position of a file
5116 * input stream, use g_seekable_tell(). To find out if a file input
5117 * stream supports seeking, use g_seekable_can_seek().
5118 * To position a file input stream, use g_seekable_seek().
5123 * SECTION:gfileiostream
5124 * @short_description: File read and write streaming operations
5125 * @include: gio/gio.h
5126 * @see_also: #GIOStream, #GFileInputStream, #GFileOutputStream, #GSeekable
5128 * GFileIOStream provides io streams that both read and write to the same
5131 * GFileIOStream implements #GSeekable, which allows the io
5132 * stream to jump to arbitrary positions in the file and to truncate
5133 * the file, provided the filesystem of the file supports these
5136 * To find the position of a file io stream, use
5137 * g_seekable_tell().
5139 * To find out if a file io stream supports seeking, use g_seekable_can_seek().
5140 * To position a file io stream, use g_seekable_seek().
5141 * To find out if a file io stream supports truncating, use
5142 * g_seekable_can_truncate(). To truncate a file io
5143 * stream, use g_seekable_truncate().
5145 * The default implementation of all the #GFileIOStream operations
5146 * and the implementation of #GSeekable just call into the same operations
5147 * on the output stream.
5154 * SECTION:gfilemonitor
5155 * @short_description: File Monitor
5156 * @include: gio/gio.h
5158 * Monitors a file or directory for changes.
5160 * To obtain a #GFileMonitor for a file or directory, use
5161 * g_file_monitor(), g_file_monitor_file(), or
5162 * g_file_monitor_directory().
5164 * To get informed about changes to the file or directory you are
5165 * monitoring, connect to the #GFileMonitor::changed signal. The
5166 * signal will be emitted in the <link
5167 * linkend="g-main-context-push-thread-default">thread-default main
5168 * context</link> of the thread that the monitor was created in
5169 * (though if the global default main context is blocked, this may
5170 * cause notifications to be blocked even if the thread-default
5171 * context is still running).
5176 * SECTION:gfilenamecompleter
5177 * @short_description: Filename Completer
5178 * @include: gio/gio.h
5180 * Completes partial file and directory names given a partial string by
5181 * looking in the file system for clues. Can return a list of possible
5182 * completion strings for widget implementations.
5187 * SECTION:gfileoutputstream
5188 * @short_description: File output streaming operations
5189 * @include: gio/gio.h
5190 * @see_also: #GOutputStream, #GDataOutputStream, #GSeekable
5192 * GFileOutputStream provides output streams that write their
5193 * content to a file.
5195 * GFileOutputStream implements #GSeekable, which allows the output
5196 * stream to jump to arbitrary positions in the file and to truncate
5197 * the file, provided the filesystem of the file supports these
5200 * To find the position of a file output stream, use g_seekable_tell().
5201 * To find out if a file output stream supports seeking, use
5202 * g_seekable_can_seek().To position a file output stream, use
5203 * g_seekable_seek(). To find out if a file output stream supports
5204 * truncating, use g_seekable_can_truncate(). To truncate a file output
5205 * stream, use g_seekable_truncate().
5210 * SECTION:gfilterinputstream
5211 * @short_description: Filter Input Stream
5212 * @include: gio/gio.h
5214 * Base class for input stream implementations that perform some
5215 * kind of filtering operation on a base stream. Typical examples
5216 * of filtering operations are character set conversion, compression
5217 * and byte order flipping.
5222 * SECTION:gfilteroutputstream
5223 * @short_description: Filter Output Stream
5224 * @include: gio/gio.h
5226 * Base class for output stream implementations that perform some
5227 * kind of filtering operation on a base stream. Typical examples
5228 * of filtering operations are character set conversion, compression
5229 * and byte order flipping.
5235 * @short_description: Interface for icons
5236 * @include: gio/gio.h
5238 * #GIcon is a very minimal interface for icons. It provides functions
5239 * for checking the equality of two icons, hashing of icons and
5240 * serializing an icon to and from strings.
5242 * #GIcon does not provide the actual pixmap for the icon as this is out
5243 * of GIO's scope, however implementations of #GIcon may contain the name
5244 * of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
5246 * To obtain a hash of a #GIcon, see g_icon_hash().
5248 * To check if two #GIcons are equal, see g_icon_equal().
5250 * For serializing a #GIcon, use g_icon_to_string() and
5251 * g_icon_new_for_string().
5253 * If your application or library provides one or more #GIcon
5254 * implementations you need to ensure that each #GType is registered
5255 * with the type system prior to calling g_icon_new_for_string().
5260 * SECTION:ginetaddress
5261 * @short_description: An IPv4/IPv6 address
5263 * #GInetAddress represents an IPv4 or IPv6 internet address. Use
5264 * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
5265 * look up the #GInetAddress for a hostname. Use
5266 * g_resolver_lookup_by_address() or
5267 * g_resolver_lookup_by_address_async() to look up the hostname for a
5270 * To actually connect to a remote host, you will need a
5271 * #GInetSocketAddress (which includes a #GInetAddress as well as a
5277 * SECTION:ginetaddressmask
5278 * @short_description: An IPv4/IPv6 address mask
5280 * #GInetAddressMask represents a range of IPv4 or IPv6 addresses
5281 * described by a base address and a length indicating how many bits
5282 * of the base address are relevant for matching purposes. These are
5283 * often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".
5288 * SECTION:ginetsocketaddress
5289 * @short_description: Internet GSocketAddress
5291 * An IPv4 or IPv6 socket address; that is, the combination of a
5292 * #GInetAddress and a port number.
5298 * @short_description: Failable object initialization interface
5299 * @include: gio/gio.h
5300 * @see_also: #GAsyncInitable
5302 * #GInitable is implemented by objects that can fail during
5303 * initialization. If an object implements this interface then
5304 * it must be initialized as the first thing after construction,
5305 * either via g_initable_init() or g_async_initable_init_async()
5306 * (the latter is only available if it also implements #GAsyncInitable).
5308 * If the object is not initialized, or initialization returns with an
5309 * error, then all operations on the object except g_object_ref() and
5310 * g_object_unref() are considered to be invalid, and have undefined
5311 * behaviour. They will often fail with g_critical() or g_warning(), but
5312 * this must not be relied on.
5314 * Users of objects implementing this are not intended to use
5315 * the interface method directly, instead it will be used automatically
5316 * in various ways. For C applications you generally just call
5317 * g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
5318 * This will call g_initable_init() under the cover, returning %NULL and
5319 * setting a #GError on failure (at which point the instance is
5322 * For bindings in languages where the native constructor supports
5323 * exceptions the binding could check for objects implemention %GInitable
5324 * during normal construction and automatically initialize them, throwing
5325 * an exception on failure.
5330 * SECTION:ginputstream
5331 * @short_description: Base class for implementing streaming input
5332 * @include: gio/gio.h
5334 * #GInputStream has functions to read from a stream (g_input_stream_read()),
5335 * to close a stream (g_input_stream_close()) and to skip some content
5336 * (g_input_stream_skip()).
5338 * To copy the content of an input stream to an output stream without
5339 * manually handling the reads and writes, use g_output_stream_splice().
5341 * All of these functions have async variants too.
5347 * @short_description: Error helper functions
5348 * @include: gio/gio.h
5350 * Contains helper functions for reporting errors to the user.
5356 * @short_description: Loadable GIO Modules
5357 * @include: gio/gio.h
5359 * Provides an interface and default functions for loading and unloading
5360 * modules. This is used internally to make GIO extensible, but can also
5361 * be used by others to implement module loading.
5366 * SECTION:gioscheduler
5367 * @short_description: I/O Scheduler
5368 * @include: gio/gio.h
5371 * As of GLib 2.36, the <literal>g_io_scheduler</literal> methods
5372 * are deprecated in favor of #GThreadPool and #GTask.
5375 * Schedules asynchronous I/O operations. #GIOScheduler integrates
5376 * into the main event loop (#GMainLoop) and uses threads.
5382 * @short_description: Base class for implementing read/write streams
5383 * @include: gio/gio.h
5384 * @see_also: #GInputStream, #GOutputStream
5386 * GIOStream represents an object that has both read and write streams.
5387 * Generally the two streams acts as separate input and output streams,
5388 * but they share some common resources and state. For instance, for
5389 * seekable streams they may use the same position in both streams.
5391 * Examples of #GIOStream objects are #GSocketConnection which represents
5392 * a two-way network connection, and #GFileIOStream which represent a
5393 * file handle opened in read-write mode.
5395 * To do the actual reading and writing you need to get the substreams
5396 * with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
5398 * The #GIOStream object owns the input and the output streams, not the other
5399 * way around, so keeping the substreams alive will not keep the #GIOStream
5400 * object alive. If the #GIOStream object is freed it will be closed, thus
5401 * closing the substream, so even if the substreams stay alive they will
5402 * always just return a %G_IO_ERROR_CLOSED for all operations.
5404 * To close a stream use g_io_stream_close() which will close the common
5405 * stream object and also the individual substreams. You can also close
5406 * the substreams themselves. In most cases this only marks the
5407 * substream as closed, so further I/O on it fails. However, some streams
5408 * may support "half-closed" states where one direction of the stream
5409 * is actually shut down.
5416 * SECTION:gloadableicon
5417 * @short_description: Loadable Icons
5418 * @include: gio/gio.h
5419 * @see_also: #GIcon, #GThemedIcon
5421 * Extends the #GIcon interface and adds the ability to
5422 * load icons from streams.
5427 * SECTION:gmemoryinputstream
5428 * @short_description: Streaming input operations on memory chunks
5429 * @include: gio/gio.h
5430 * @see_also: #GMemoryOutputStream
5432 * #GMemoryInputStream is a class for using arbitrary
5433 * memory chunks as input for GIO streaming input operations.
5435 * As of GLib 2.34, #GMemoryInputStream implements
5436 * #GPollableInputStream.
5441 * SECTION:gmemoryoutputstream
5442 * @short_description: Streaming output operations on memory chunks
5443 * @include: gio/gio.h
5444 * @see_also: #GMemoryInputStream
5446 * #GMemoryOutputStream is a class for using arbitrary
5447 * memory chunks as output for GIO streaming output operations.
5449 * As of GLib 2.34, #GMemoryOutputStream implements
5450 * #GPollableOutputStream.
5457 * @short_description: A simple implementation of GMenuModel
5459 * #GMenu is a simple implementation of #GMenuModel.
5460 * You populate a #GMenu by adding #GMenuItem instances to it.
5462 * There are some convenience functions to allow you to directly
5463 * add items (avoiding #GMenuItem) for the common cases. To add
5464 * a regular item, use g_menu_insert(). To add a section, use
5465 * g_menu_insert_section(). To add a submenu, use
5466 * g_menu_insert_submenu().
5471 * SECTION:gmenuexporter
5472 * @title: GMenuModel exporter
5473 * @short_description: Export GMenuModels on D-Bus
5474 * @see_also: #GMenuModel, #GDBusMenuModel
5476 * These functions support exporting a #GMenuModel on D-Bus.
5477 * The D-Bus interface that is used is a private implementation
5480 * To access an exported #GMenuModel remotely, use
5481 * g_dbus_menu_model_get() to obtain a #GDBusMenuModel.
5486 * SECTION:gmenumodel
5487 * @title: GMenuModel
5488 * @short_description: An abstract class representing the contents of a menu
5489 * @see_also: #GActionGroup
5491 * #GMenuModel represents the contents of a menu -- an ordered list of
5492 * menu items. The items are associated with actions, which can be
5493 * activated through them. Items can be grouped in sections, and may
5494 * have submenus associated with them. Both items and sections usually
5495 * have some representation data, such as labels or icons. The type of
5496 * the associated action (ie whether it is stateful, and what kind of
5497 * state it has) can influence the representation of the item.
5499 * The conceptual model of menus in #GMenuModel is hierarchical:
5500 * sections and submenus are again represented by #GMenuModels.
5501 * Menus themselves do not define their own roles. Rather, the role
5502 * of a particular #GMenuModel is defined by the item that references
5503 * it (or, in the case of the 'root' menu, is defined by the context
5504 * in which it is used).
5506 * As an example, consider the visible portions of the menu in
5507 * <xref linkend="menu-example"/>.
5509 * <figure id="menu-example">
5510 * <title>An example menu</title>
5511 * <graphic fileref="menu-example.png" format="PNG"></graphic>
5514 * There are 8 "menus" visible in the screenshot: one menubar, two
5515 * submenus and 5 sections:
5517 * <listitem>the toplevel menubar (containing 4 items)</listitem>
5518 * <listitem>the View submenu (containing 3 sections)</listitem>
5519 * <listitem>the first section of the View submenu (containing 2 items)</listitem>
5520 * <listitem>the second section of the View submenu (containing 1 item)</listitem>
5521 * <listitem>the final section of the View submenu (containing 1 item)</listitem>
5522 * <listitem>the Highlight Mode submenu (containing 2 sections)</listitem>
5523 * <listitem>the Sources section (containing 2 items)</listitem>
5524 * <listitem>the Markup section (containing 2 items)</listitem>
5527 * <xref linkend="menu-model"/> illustrates the conceptual connection between
5528 * these 8 menus. Each large block in the figure represents a menu and the
5529 * smaller blocks within the large block represent items in that menu. Some
5530 * items contain references to other menus.
5532 * <figure id="menu-model">
5533 * <title>A menu model</title>
5534 * <graphic fileref="menu-model.png" format="PNG"></graphic>
5537 * Notice that the separators visible in <xref linkend="menu-example"/>
5538 * appear nowhere in <xref linkend="menu-model"/>. This is because
5539 * separators are not explicitly represented in the menu model. Instead,
5540 * a separator is inserted between any two non-empty sections of a menu.
5541 * Section items can have labels just like any other item. In that case,
5542 * a display system may show a section header instead of a separator.
5544 * The motivation for this abstract model of application controls is
5545 * that modern user interfaces tend to make these controls available
5546 * outside the application. Examples include global menus, jumplists,
5547 * dash boards, etc. To support such uses, it is necessary to 'export'
5548 * information about actions and their representation in menus, which
5549 * is exactly what the
5550 * <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
5552 * <link linkend="gio-GMenuModel-exporter">GMenuModel exporter</link>
5553 * do for #GActionGroup and #GMenuModel. The client-side counterparts
5554 * to make use of the exported information are #GDBusActionGroup and
5557 * The API of #GMenuModel is very generic, with iterators for the
5558 * attributes and links of an item, see g_menu_model_iterate_item_attributes()
5559 * and g_menu_model_iterate_item_links(). The 'standard' attributes and
5560 * link types have predefined names: %G_MENU_ATTRIBUTE_LABEL,
5561 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, %G_MENU_LINK_SECTION
5562 * and %G_MENU_LINK_SUBMENU.
5564 * Items in a #GMenuModel represent active controls if they refer to
5565 * an action that can get activated when the user interacts with the
5566 * menu item. The reference to the action is encoded by the string id
5567 * in the %G_MENU_ATTRIBUTE_ACTION attribute. An action id uniquely
5568 * identifies an action in an action group. Which action group(s) provide
5569 * actions depends on the context in which the menu model is used.
5570 * E.g. when the model is exported as the application menu of a
5571 * #GtkApplication, actions can be application-wide or window-specific
5572 * (and thus come from two different action groups). By convention, the
5573 * application-wide actions have names that start with "app.", while the
5574 * names of window-specific actions start with "win.".
5576 * While a wide variety of stateful actions is possible, the following
5577 * is the minimum that is expected to be supported by all users of exported
5580 * <listitem>an action with no parameter type and no state</listitem>
5581 * <listitem>an action with no parameter type and boolean state</listitem>
5582 * <listitem>an action with string parameter type and string state</listitem>
5585 * <formalpara><title>Stateless</title>
5587 * A stateless action typically corresponds to an ordinary menu item.
5590 * Selecting such a menu item will activate the action (with no parameter).
5594 * <formalpara><title>Boolean State</title>
5596 * An action with a boolean state will most typically be used with a "toggle"
5597 * or "switch" menu item. The state can be set directly, but activating the
5598 * action (with no parameter) results in the state being toggled.
5601 * Selecting a toggle menu item will activate the action. The menu item should
5602 * be rendered as "checked" when the state is true.
5606 * <formalpara><title>String Parameter and State</title>
5608 * Actions with string parameters and state will most typically be used to
5609 * represent an enumerated choice over the items available for a group of
5610 * radio menu items. Activating the action with a string parameter is
5611 * equivalent to setting that parameter as the state.
5614 * Radio menu items, in addition to being associated with the action, will
5615 * have a target value. Selecting that menu item will result in activation
5616 * of the action with the target value as the parameter. The menu item should
5617 * be rendered as "selected" when the state of the action is equal to the
5618 * target value of the menu item.
5626 * @short_description: Mount management
5627 * @include: gio/gio.h
5628 * @see_also: GVolume, GUnixMountEntry, GUnixMountPoint
5630 * The #GMount interface represents user-visible mounts. Note, when
5631 * porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
5633 * #GMount is a "mounted" filesystem that you can access. Mounted is in
5634 * quotes because it's not the same as a unix mount, it might be a gvfs
5635 * mount, but you can still access the files on it if you use GIO. Might or
5636 * might not be related to a volume object.
5638 * Unmounting a #GMount instance is an asynchronous operation. For
5639 * more information about asynchronous operations, see #GAsyncResult
5640 * and #GTask. To unmount a #GMount instance, first call
5641 * g_mount_unmount_with_operation() with (at least) the #GMount instance and a
5642 * #GAsyncReadyCallback. The callback will be fired when the
5643 * operation has resolved (either with success or failure), and a
5644 * #GAsyncReady structure will be passed to the callback. That
5645 * callback should then call g_mount_unmount_with_operation_finish() with the #GMount
5646 * and the #GAsyncReady data to see if the operation was completed
5647 * successfully. If an @error is present when g_mount_unmount_with_operation_finish()
5648 * is called, then it will be filled with any error information.
5653 * SECTION:gmountoperation
5654 * @short_description: Object used for authentication and user interaction
5655 * @include: gio/gio.h
5657 * #GMountOperation provides a mechanism for interacting with the user.
5658 * It can be used for authenticating mountable operations, such as loop
5659 * mounting files, hard drive partitions or server locations. It can
5660 * also be used to ask the user questions or show a list of applications
5661 * preventing unmount or eject operations from completing.
5663 * Note that #GMountOperation is used for more than just #GMount
5664 * objects – for example it is also used in g_drive_start() and
5667 * Users should instantiate a subclass of this that implements all the
5668 * various callbacks to show the required dialogs, such as
5669 * #GtkMountOperation. If no user interaction is desired (for example
5670 * when automounting filesystems at login time), usually %NULL can be
5671 * passed, see each method taking a #GMountOperation for details.
5676 * SECTION:gnetworkaddress
5677 * @short_description: A GSocketConnectable for resolving hostnames
5678 * @include: gio/gio.h
5680 * #GNetworkAddress provides an easy way to resolve a hostname and
5681 * then attempt to connect to that host, handling the possibility of
5682 * multiple IP addresses and multiple address families.
5684 * See #GSocketConnectable for and example of using the connectable
5690 * SECTION:gnetworking
5691 * @title: gnetworking.h
5692 * @short_description: System networking includes
5693 * @include: gio/gnetworking.h
5695 * The <literal>gnetworking.h</literal> header can be included to get
5696 * various low-level networking-related system headers, automatically
5697 * taking care of certain portability issues for you.
5699 * This can be used, for example, if you want to call setsockopt()
5702 * Note that while WinSock has many of the same APIs as the
5703 * traditional UNIX socket API, most of them behave at least slightly
5704 * differently (particularly with respect to error handling). If you
5705 * want your code to work under both UNIX and Windows, you will need
5706 * to take these differences into account.
5708 * Also, under glibc, certain non-portable functions are only visible
5709 * in the headers if you define <literal>_GNU_SOURCE</literal> before
5710 * including them. Note that this symbol must be defined before
5711 * including <emphasis>any</emphasis> headers, or it may not take
5717 * SECTION:gnetworkmonitor
5718 * @title: GNetworkMonitor
5719 * @short_description: Network status monitor
5720 * @include: gio/gio.h
5722 * #GNetworkMonitor provides an easy-to-use cross-platform API
5723 * for monitoring network connectivity. On Linux, the implementation
5724 * is based on the kernel's netlink interface.
5729 * SECTION:gnetworkservice
5730 * @short_description: A GSocketConnectable for resolving SRV records
5731 * @include: gio/gio.h
5733 * Like #GNetworkAddress does with hostnames, #GNetworkService
5734 * provides an easy way to resolve a SRV record, and then attempt to
5735 * connect to one of the hosts that implements that service, handling
5736 * service priority/weighting, multiple IP addresses, and multiple
5739 * See #GSrvTarget for more information about SRV records, and see
5740 * #GSocketConnectable for and example of using the connectable
5746 * SECTION:goutputstream
5747 * @short_description: Base class for implementing streaming output
5748 * @include: gio/gio.h
5750 * #GOutputStream has functions to write to a stream (g_output_stream_write()),
5751 * to close a stream (g_output_stream_close()) and to flush pending writes
5752 * (g_output_stream_flush()).
5754 * To copy the content of an input stream to an output stream without
5755 * manually handling the reads and writes, use g_output_stream_splice().
5757 * All of these functions have async variants too.
5762 * SECTION:gpermission
5763 * @title: GPermission
5764 * @short_description: An object representing the permission to perform a certain action
5766 * A #GPermission represents the status of the caller's permission to
5767 * perform a certain action.
5769 * You can query if the action is currently allowed and if it is
5770 * possible to acquire the permission so that the action will be allowed
5773 * There is also an API to actually acquire the permission and one to
5776 * As an example, a #GPermission might represent the ability for the
5777 * user to write to a #GSettings object. This #GPermission object could
5778 * then be used to decide if it is appropriate to show a "Click here to
5779 * unlock" button in a dialog and to provide the mechanism to invoke
5780 * when that button is clicked.
5785 * SECTION:gpollableinputstream
5786 * @short_description: Interface for pollable input streams
5787 * @include: gio/gio.h
5788 * @see_also: #GInputStream, #GPollableOutputStream, #GFileDescriptorBased
5790 * #GPollableInputStream is implemented by #GInputStreams that
5791 * can be polled for readiness to read. This can be used when
5792 * interfacing with a non-GIO API that expects
5793 * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5800 * SECTION:gpollableoutputstream
5801 * @short_description: Interface for pollable output streams
5802 * @include: gio/gio.h
5803 * @see_also: #GOutputStream, #GFileDescriptorBased, #GPollableInputStream
5805 * #GPollableOutputStream is implemented by #GOutputStreams that
5806 * can be polled for readiness to write. This can be used when
5807 * interfacing with a non-GIO API that expects
5808 * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5815 * SECTION:gpollableutils
5816 * @short_description: #GPollableInputStream / #GPollableOutputStream utilities
5817 * @include: gio/gio.h
5819 * Utility functions for #GPollableInputStream and
5820 * #GPollableOutputStream implementations.
5826 * @short_description: Interface for proxy handling
5828 * A #GProxy handles connecting to a remote host via a given type of
5829 * proxy server. It is implemented by the 'gio-proxy' extension point.
5830 * The extensions are named after their proxy protocol name. As an
5831 * example, a SOCKS5 proxy implementation can be retrieved with the
5832 * name 'socks5' using the function
5833 * g_io_extension_point_get_extension_by_name().
5840 * SECTION:gproxyaddress
5841 * @short_description: An internet address with proxy information
5843 * Support for proxied #GInetSocketAddress.
5848 * SECTION:gproxyresolver
5849 * @short_description: Asynchronous and cancellable network proxy resolver
5850 * @include: gio/gio.h
5852 * #GProxyResolver provides synchronous and asynchronous network proxy
5853 * resolution. #GProxyResolver is used within #GSocketClient through
5854 * the method g_socket_connectable_proxy_enumerate().
5859 * SECTION:gremoteactiongroup
5860 * @title: GRemoteActionGroup
5861 * @short_description: a #GActionGroup that interacts with other processes
5863 * The GRemoteActionGroup interface is implemented by #GActionGroup
5864 * instances that either transmit action invocations to other processes
5865 * or receive action invocations in the local process from other
5868 * The interface has <literal>_full</literal> variants of the two
5869 * methods on #GActionGroup used to activate actions:
5870 * g_action_group_activate_action() and
5871 * g_action_group_change_action_state(). These variants allow a
5872 * "platform data" #GVariant to be specified: a dictionary providing
5873 * context for the action invocation (for example: timestamps, startup
5874 * notification IDs, etc).
5876 * #GDBusActionGroup implements #GRemoteActionGroup. This provides a
5877 * mechanism to send platform data for action invocations over D-Bus.
5879 * Additionally, g_dbus_connection_export_action_group() will check if
5880 * the exported #GActionGroup implements #GRemoteActionGroup and use the
5881 * <literal>_full</literal> variants of the calls if available. This
5882 * provides a mechanism by which to receive platform data for action
5883 * invocations that arrive by way of D-Bus.
5891 * @short_description: Asynchronous and cancellable DNS resolver
5892 * @include: gio/gio.h
5894 * #GResolver provides cancellable synchronous and asynchronous DNS
5895 * resolution, for hostnames (g_resolver_lookup_by_address(),
5896 * g_resolver_lookup_by_name() and their async variants) and SRV
5897 * (service) records (g_resolver_lookup_service()).
5899 * #GNetworkAddress and #GNetworkService provide wrappers around
5900 * #GResolver functionality that also implement #GSocketConnectable,
5901 * making it easy to connect to a remote host/service.
5907 * @short_description: Resource framework
5908 * @include: gio/gio.h
5910 * Applications and libraries often contain binary or textual data that is really part of the
5911 * application, rather than user data. For instance #GtkBuilder .ui files, splashscreen images,
5912 * GMenu markup xml, CSS files, icons, etc. These are often shipped as files in <filename>$datadir/appname</filename>, or
5913 * manually included as literal strings in the code.
5915 * The #GResource API and the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5916 * provide a convenient and efficient alternative to this which has some nice properties. You
5917 * maintain the files as normal files, so its easy to edit them, but during the build the files
5918 * are combined into a binary bundle that is linked into the executable. This means that loading
5919 * the resource files are efficient (as they are already in memory, shared with other instances) and
5920 * simple (no need to check for things like I/O errors or locate the files in the filesystem). It
5921 * also makes it easier to create relocatable applications.
5923 * Resource files can also be marked as compressed. Such files will be included in the resource bundle
5924 * in a compressed form, but will be automatically uncompressed when the resource is used. This
5925 * is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away.
5927 * Resource files can also be marked to be preprocessed, by setting the value of the
5928 * <literal>preprocess</literal> attribute to a comma-separated list of preprocessing options.
5929 * The only options currently supported are:
5931 * <literal>xml-stripblanks</literal> which will use <command>xmllint</command> to strip
5932 * ignorable whitespace from the xml file. For this to work, the <envar>XMLLINT</envar>
5933 * environment variable must be set to the full path to the xmllint executable, or xmllint
5934 * must be in the PATH; otherwise the preprocessing step is skipped.
5936 * <literal>to-pixdata</literal> which will use <command>gdk-pixbuf-pixdata</command> to convert
5937 * images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside
5938 * the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata
5939 * program must be in the PATH, or the <envar>GDK_PIXBUF_PIXDATA</envar> environment variable must be
5940 * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will
5943 * Resource bundles are created by the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5944 * which takes an xml file that describes the bundle, and a set of files that the xml references. These
5945 * are combined into a binary resource bundle.
5947 * <example id="resource-example"><title>Example resource description</title>
5948 * <programlisting><![CDATA[
5949 * <?xml version="1.0" encoding="UTF-8"?>
5951 * <gresource prefix="/org/gtk/Example">
5952 * <file>data/splashscreen.png</file>
5953 * <file compressed="true">dialog.ui</file>
5954 * <file preprocess="xml-stripblanks">menumarkup.xml</file>
5957 * ]]></programlisting></example>
5959 * This will create a resource bundle with the following files:
5960 * <programlisting><![CDATA[
5961 * /org/gtk/Example/data/splashscreen.png
5962 * /org/gtk/Example/dialog.ui
5963 * /org/gtk/Example/menumarkup.xml
5964 * ]]></programlisting>
5966 * Note that all resources in the process share the same namespace, so use java-style
5967 * path prefixes (like in the above example) to avoid conflicts.
5969 * You can then use <link linkend="glib-compile-resources">glib-compile-resources</link> to compile the xml to a
5970 * binary bundle that you can load with g_resource_load(). However, its more common to use the --generate-source and
5971 * --generate-header arguments to create a source file and header to link directly into your application.
5973 * Once a #GResource has been created and registered all the data in it can be accessed globally in the process by
5974 * using API calls like g_resources_open_stream() to stream the data or g_resources_lookup_data() to get a direct pointer
5975 * to the data. You can also use uris like "resource:///org/gtk/Example/data/splashscreen.png" with #GFile to access
5976 * the resource data.
5978 * There are two forms of the generated source, the default version uses the compiler support for constructor
5979 * and destructor functions (where available) to automatically create and register the #GResource on startup
5980 * or library load time. If you pass --manual-register two functions to register/unregister the resource is instead
5981 * created. This requires an explicit initialization call in your application/library, but it works on all platforms,
5982 * even on the minor ones where this is not available. (Constructor support is available for at least Win32, MacOS and Linux.)
5984 * Note that resource data can point directly into the data segment of e.g. a library, so if you are unloading libraries
5985 * during runtime you need to be very careful with keeping around pointers to data from a resource, as this goes away
5986 * when the library is unloaded. However, in practice this is not generally a problem, since most resource accesses
5987 * is for your own resources, and resource data is often used once, during parsing, and then released.
5995 * @short_description: Stream seeking interface
5996 * @include: gio/gio.h
5997 * @see_also: #GInputStream, #GOutputStream
5999 * #GSeekable is implemented by streams (implementations of
6000 * #GInputStream or #GOutputStream) that support seeking.
6006 * @short_description: High-level API for application settings
6008 * The #GSettings class provides a convenient API for storing and retrieving
6009 * application settings.
6011 * Reads and writes can be considered to be non-blocking. Reading
6012 * settings with #GSettings is typically extremely fast: on
6013 * approximately the same order of magnitude (but slower than) a
6014 * #GHashTable lookup. Writing settings is also extremely fast in terms
6015 * of time to return to your application, but can be extremely expensive
6016 * for other threads and other processes. Many settings backends
6017 * (including dconf) have lazy initialisation which means in the common
6018 * case of the user using their computer without modifying any settings
6019 * a lot of work can be avoided. For dconf, the D-Bus service doesn't
6020 * even need to be started in this case. For this reason, you should
6021 * only ever modify #GSettings keys in response to explicit user action.
6022 * Particular care should be paid to ensure that modifications are not
6023 * made during startup -- for example, when setting the initial value
6024 * of preferences widgets. The built-in g_settings_bind() functionality
6025 * is careful not to write settings in response to notify signals as a
6026 * result of modifications that it makes to widgets.
6028 * When creating a GSettings instance, you have to specify a schema
6029 * that describes the keys in your settings and their types and default
6030 * values, as well as some other information.
6032 * Normally, a schema has as fixed path that determines where the settings
6033 * are stored in the conceptual global tree of settings. However, schemas
6034 * can also be 'relocatable', i.e. not equipped with a fixed path. This is
6035 * useful e.g. when the schema describes an 'account', and you want to be
6036 * able to store a arbitrary number of accounts.
6038 * Paths must start with and end with a forward slash character ('/')
6039 * and must not contain two sequential slash characters. Paths should
6040 * be chosen based on a domain name associated with the program or
6041 * library to which the settings belong. Examples of paths are
6042 * "/org/gtk/settings/file-chooser/" and "/ca/desrt/dconf-editor/".
6043 * Paths should not start with "/apps/", "/desktop/" or "/system/" as
6044 * they often did in GConf.
6046 * Unlike other configuration systems (like GConf), GSettings does not
6047 * restrict keys to basic types like strings and numbers. GSettings stores
6048 * values as #GVariant, and allows any #GVariantType for keys. Key names
6049 * are restricted to lowercase characters, numbers and '-'. Furthermore,
6050 * the names must begin with a lowercase character, must not end
6051 * with a '-', and must not contain consecutive dashes.
6053 * Similar to GConf, the default values in GSettings schemas can be
6054 * localized, but the localized values are stored in gettext catalogs
6055 * and looked up with the domain that is specified in the
6056 * <tag class="attribute">gettext-domain</tag> attribute of the
6057 * <tag class="starttag">schemalist</tag> or <tag class="starttag">schema</tag>
6058 * elements and the category that is specified in the l10n attribute of the
6059 * <tag class="starttag">key</tag> element.
6061 * GSettings uses schemas in a compact binary form that is created
6062 * by the <link linkend="glib-compile-schemas">glib-compile-schemas</link>
6063 * utility. The input is a schema description in an XML format that can be
6064 * described by the following DTD:
6065 * |[<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>]|
6067 * glib-compile-schemas expects schema files to have the extension <filename>.gschema.xml</filename>
6069 * At runtime, schemas are identified by their id (as specified
6070 * in the <tag class="attribute">id</tag> attribute of the
6071 * <tag class="starttag">schema</tag> element). The
6072 * convention for schema ids is to use a dotted name, similar in
6073 * style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
6074 * if the settings are for a specific service that owns a D-Bus bus name,
6075 * the D-Bus bus name and schema id should match. For schemas which deal
6076 * with settings not associated with one named application, the id should
6077 * not use StudlyCaps, e.g. "org.gnome.font-rendering".
6079 * In addition to #GVariant types, keys can have types that have enumerated
6080 * types. These can be described by a <tag class="starttag">choice</tag>,
6081 * <tag class="starttag">enum</tag> or <tag class="starttag">flags</tag> element, see
6082 * <xref linkend="schema-enumerated"/>. The underlying type of
6083 * such a key is string, but you can use g_settings_get_enum(),
6084 * g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags()
6085 * access the numeric values corresponding to the string value of enum
6088 * <example id="schema-default-values"><title>Default values</title>
6089 * <programlisting><![CDATA[
6091 * <schema id="org.gtk.Test" path="/org/gtk/Test/" gettext-domain="test">
6093 * <key name="greeting" type="s">
6094 * <default l10n="messages">"Hello, earthlings"</default>
6095 * <summary>A greeting</summary>
6097 * Greeting of the invading martians
6101 * <key name="box" type="(ii)">
6102 * <default>(20,30)</default>
6107 * ]]></programlisting></example>
6109 * <example id="schema-enumerated"><title>Ranges, choices and enumerated types</title>
6110 * <programlisting><![CDATA[
6113 * <enum id="org.gtk.Test.myenum">
6114 * <value nick="first" value="1"/>
6115 * <value nick="second" value="2"/>
6118 * <flags id="org.gtk.Test.myflags">
6119 * <value nick="flag1" value="1"/>
6120 * <value nick="flag2" value="2"/>
6121 * <value nick="flag3" value="4"/>
6124 * <schema id="org.gtk.Test">
6126 * <key name="key-with-range" type="i">
6127 * <range min="1" max="100"/>
6128 * <default>10</default>
6131 * <key name="key-with-choices" type="s">
6133 * <choice value='Elisabeth'/>
6134 * <choice value='Annabeth'/>
6135 * <choice value='Joe'/>
6138 * <alias value='Anna' target='Annabeth'/>
6139 * <alias value='Beth' target='Elisabeth'/>
6141 * <default>'Joe'</default>
6144 * <key name='enumerated-key' enum='org.gtk.Test.myenum'>
6145 * <default>'first'</default>
6148 * <key name='flags-key' flags='org.gtk.Test.myflags'>
6149 * <default>["flag1",flag2"]</default>
6153 * ]]></programlisting></example>
6156 * <title>Vendor overrides</title>
6158 * Default values are defined in the schemas that get installed by
6159 * an application. Sometimes, it is necessary for a vendor or distributor
6160 * to adjust these defaults. Since patching the XML source for the schema
6161 * is inconvenient and error-prone,
6162 * <link linkend="glib-compile-schemas">glib-compile-schemas</link> reads
6163 * so-called 'vendor override' files. These are keyfiles in the same
6164 * directory as the XML schema sources which can override default values.
6165 * The schema id serves as the group name in the key file, and the values
6166 * are expected in serialized GVariant form, as in the following example:
6167 * <informalexample><programlisting>
6171 * </programlisting></informalexample>
6174 * glib-compile-schemas expects schema files to have the extension
6175 * <filename>.gschema.override</filename>
6180 * <title>Binding</title>
6182 * A very convenient feature of GSettings lets you bind #GObject properties
6183 * directly to settings, using g_settings_bind(). Once a GObject property
6184 * has been bound to a setting, changes on either side are automatically
6185 * propagated to the other side. GSettings handles details like
6186 * mapping between GObject and GVariant types, and preventing infinite
6190 * This makes it very easy to hook up a preferences dialog to the
6191 * underlying settings. To make this even more convenient, GSettings
6192 * looks for a boolean property with the name "sensitivity" and
6193 * automatically binds it to the writability of the bound setting.
6194 * If this 'magic' gets in the way, it can be suppressed with the
6195 * #G_SETTINGS_BIND_NO_SENSITIVITY flag.
6202 * SECTION:gsettingsbackend
6203 * @title: GSettingsBackend
6204 * @short_description: Interface for settings backend implementations
6205 * @include: gio/gsettingsbackend.h
6206 * @see_also: #GSettings, #GIOExtensionPoint
6208 * The #GSettingsBackend interface defines a generic interface for
6209 * non-strictly-typed data that is stored in a hierarchy. To implement
6210 * an alternative storage backend for #GSettings, you need to implement
6211 * the #GSettingsBackend interface and then make it implement the
6212 * extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.
6214 * The interface defines methods for reading and writing values, a
6215 * method for determining if writing of certain values will fail
6216 * (lockdown) and a change notification mechanism.
6218 * The semantics of the interface are very precisely defined and
6219 * implementations must carefully adhere to the expectations of
6220 * callers that are documented on each of the interface methods.
6222 * Some of the GSettingsBackend functions accept or return a #GTree.
6223 * These trees always have strings as keys and #GVariant as values.
6224 * g_settings_backend_create_tree() is a convenience function to create
6228 * The #GSettingsBackend API is exported to allow third-party
6229 * implementations, but does not carry the same stability guarantees
6230 * as the public GIO API. For this reason, you have to define the
6231 * C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including
6232 * <filename>gio/gsettingsbackend.h</filename>
6238 * SECTION:gsettingsschema
6239 * @short_description: introspecting and controlling the loading of GSettings schemas
6241 * The #GSettingsSchemaSource and #GSettingsSchema APIs provide a
6242 * mechanism for advanced control over the loading of schemas and a
6243 * mechanism for introspecting their content.
6245 * Plugin loading systems that wish to provide plugins a way to access
6246 * settings face the problem of how to make the schemas for these
6247 * settings visible to GSettings. Typically, a plugin will want to ship
6248 * the schema along with itself and it won't be installed into the
6249 * standard system directories for schemas.
6251 * #GSettingsSchemaSource provides a mechanism for dealing with this by
6252 * allowing the creation of a new 'schema source' from which schemas can
6253 * be acquired. This schema source can then become part of the metadata
6254 * associated with the plugin and queried whenever the plugin requires
6255 * access to some settings.
6257 * Consider the following example:
6263 * GSettingsSchemaSource *schema_source;
6268 * initialise_plugin (const gchar *dir)
6274 * plugin->schema_source =
6275 * g_settings_new_schema_source_from_directory (dir,
6276 * g_settings_schema_source_get_default (), FALSE, NULL);
6286 * plugin_get_settings (Plugin *plugin,
6287 * const gchar *schema_id)
6289 * GSettingsSchema *schema;
6291 * if (schema_id == NULL)
6292 * schema_id = plugin->identifier;
6294 * schema = g_settings_schema_source_lookup (plugin->schema_source,
6295 * schema_id, FALSE);
6297 * if (schema == NULL)
6299 * ... disable the plugin or abort, etc ...
6302 * return g_settings_new_full (schema, NULL, NULL);
6306 * The code above shows how hooks should be added to the code that
6307 * initialises (or enables) the plugin to create the schema source and
6308 * how an API can be added to the plugin system to provide a convenient
6309 * way for the plugin to access its settings, using the schemas that it
6312 * From the standpoint of the plugin, it would need to ensure that it
6313 * ships a gschemas.compiled file as part of itself, and then simply do
6318 * GSettings *settings;
6321 * settings = plugin_get_settings (self, NULL);
6322 * some_value = g_settings_get_int (settings, "some-value");
6327 * It's also possible that the plugin system expects the schema source
6328 * files (ie: .gschema.xml files) instead of a gschemas.compiled file.
6329 * In that case, the plugin loading system must compile the schemas for
6330 * itself before attempting to create the settings source.
6337 * SECTION:gsimpleaction
6338 * @title: GSimpleAction
6339 * @short_description: A simple GAction implementation
6341 * A #GSimpleAction is the obvious simple implementation of the #GAction
6342 * interface. This is the easiest way to create an action for purposes of
6343 * adding it to a #GSimpleActionGroup.
6345 * See also #GtkAction.
6350 * SECTION:gsimpleactiongroup
6351 * @title: GSimpleActionGroup
6352 * @short_description: A simple GActionGroup implementation
6354 * #GSimpleActionGroup is a hash table filled with #GAction objects,
6355 * implementing the #GActionGroup and #GActionMap interfaces.
6360 * SECTION:gsimpleasyncresult
6361 * @short_description: Simple asynchronous results implementation
6362 * @include: gio/gio.h
6363 * @see_also: #GAsyncResult
6366 * As of GLib 2.36, #GSimpleAsyncResult is deprecated in favor of
6367 * #GTask, which provides a simpler API.
6370 * #GSimpleAsyncResult implements #GAsyncResult.
6372 * GSimpleAsyncResult handles #GAsyncReadyCallback<!-- -->s, error
6373 * reporting, operation cancellation and the final state of an operation,
6374 * completely transparent to the application. Results can be returned
6375 * as a pointer e.g. for functions that return data that is collected
6376 * asynchronously, a boolean value for checking the success or failure
6377 * of an operation, or a #gssize for operations which return the number
6378 * of bytes modified by the operation; all of the simple return cases
6381 * Most of the time, an application will not need to know of the details
6382 * of this API; it is handled transparently, and any necessary operations
6383 * are handled by #GAsyncResult's interface. However, if implementing a
6384 * new GIO module, for writing language bindings, or for complex
6385 * applications that need better control of how asynchronous operations
6386 * are completed, it is important to understand this functionality.
6388 * GSimpleAsyncResults are tagged with the calling function to ensure
6389 * that asynchronous functions and their finishing functions are used
6390 * together correctly.
6392 * To create a new #GSimpleAsyncResult, call g_simple_async_result_new().
6393 * If the result needs to be created for a #GError, use
6394 * g_simple_async_result_new_from_error() or
6395 * g_simple_async_result_new_take_error(). If a #GError is not available
6396 * (e.g. the asynchronous operation's doesn't take a #GError argument),
6397 * but the result still needs to be created for an error condition, use
6398 * g_simple_async_result_new_error() (or g_simple_async_result_set_error_va()
6399 * if your application or binding requires passing a variable argument list
6400 * directly), and the error can then be propagated through the use of
6401 * g_simple_async_result_propagate_error().
6403 * An asynchronous operation can be made to ignore a cancellation event by
6404 * calling g_simple_async_result_set_handle_cancellation() with a
6405 * #GSimpleAsyncResult for the operation and %FALSE. This is useful for
6406 * operations that are dangerous to cancel, such as close (which would
6407 * cause a leak if cancelled before being run).
6409 * GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
6410 * or it can use #GThread<!-- -->s.
6411 * g_simple_async_result_complete() will finish an I/O task directly
6412 * from the point where it is called. g_simple_async_result_complete_in_idle()
6413 * will finish it from an idle handler in the <link
6414 * linkend="g-main-context-push-thread-default">thread-default main
6415 * context</link>. g_simple_async_result_run_in_thread() will run the
6416 * job in a separate thread and then deliver the result to the
6417 * thread-default main context.
6419 * To set the results of an asynchronous function,
6420 * g_simple_async_result_set_op_res_gpointer(),
6421 * g_simple_async_result_set_op_res_gboolean(), and
6422 * g_simple_async_result_set_op_res_gssize()
6423 * are provided, setting the operation's result to a gpointer, gboolean, or
6424 * gssize, respectively.
6426 * Likewise, to get the result of an asynchronous function,
6427 * g_simple_async_result_get_op_res_gpointer(),
6428 * g_simple_async_result_get_op_res_gboolean(), and
6429 * g_simple_async_result_get_op_res_gssize() are
6430 * provided, getting the operation's result as a gpointer, gboolean, and
6431 * gssize, respectively.
6433 * For the details of the requirements implementations must respect, see
6434 * #GAsyncResult. A typical implementation of an asynchronous operation
6435 * using GSimpleAsyncResult looks something like this:
6439 * baked_cb (Cake *cake,
6440 * gpointer user_data)
6442 * /* In this example, this callback is not given a reference to the cake, so
6443 * * the GSimpleAsyncResult has to take a reference to it.
6445 * GSimpleAsyncResult *result = user_data;
6448 * g_simple_async_result_set_error (result,
6450 * BAKER_ERROR_NO_FLOUR,
6451 * "Go to the supermarket");
6453 * g_simple_async_result_set_op_res_gpointer (result,
6454 * g_object_ref (cake),
6458 * /* In this example, we assume that baked_cb is called as a callback from
6459 * * the mainloop, so it's safe to complete the operation synchronously here.
6460 * * If, however, _baker_prepare_cake () might call its callback without
6461 * * first returning to the mainloop — inadvisable, but some APIs do so —
6462 * * we would need to use g_simple_async_result_complete_in_idle().
6464 * g_simple_async_result_complete (result);
6465 * g_object_unref (result);
6469 * baker_bake_cake_async (Baker *self,
6471 * GAsyncReadyCallback callback,
6472 * gpointer user_data)
6474 * GSimpleAsyncResult *simple;
6479 * g_simple_async_report_error_in_idle (G_OBJECT (self),
6483 * BAKER_ERROR_TOO_SMALL,
6484 * "%ucm radius cakes are silly",
6489 * simple = g_simple_async_result_new (G_OBJECT (self),
6492 * baker_bake_cake_async);
6493 * cake = _baker_get_cached_cake (self, radius);
6497 * g_simple_async_result_set_op_res_gpointer (simple,
6498 * g_object_ref (cake),
6500 * g_simple_async_result_complete_in_idle (simple);
6501 * g_object_unref (simple);
6502 * /* Drop the reference returned by _baker_get_cached_cake(); the
6503 * * GSimpleAsyncResult has taken its own reference.
6505 * g_object_unref (cake);
6509 * _baker_prepare_cake (self, radius, baked_cb, simple);
6513 * baker_bake_cake_finish (Baker *self,
6514 * GAsyncResult *result,
6517 * GSimpleAsyncResult *simple;
6520 * g_return_val_if_fail (g_simple_async_result_is_valid (result,
6522 * baker_bake_cake_async),
6525 * simple = (GSimpleAsyncResult *) result;
6527 * if (g_simple_async_result_propagate_error (simple, error))
6530 * cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
6531 * return g_object_ref (cake);
6538 * SECTION:gsimplepermission
6539 * @title: GSimplePermission
6540 * @short_description: A GPermission that doesn't change value
6542 * #GSimplePermission is a trivial implementation of #GPermission that
6543 * represents a permission that is either always or never allowed. The
6544 * value is given at construction and doesn't change.
6546 * Calling request or release will result in errors.
6551 * SECTION:gsimpleproxyresolver
6552 * @short_description: Simple proxy resolver implementation
6553 * @include: gio/gio.h
6554 * @see_also: g_socket_client_set_proxy_resolver()
6556 * #GSimpleProxyResolver is a simple #GProxyResolver implementation
6557 * that handles a single default proxy, multiple URI-scheme-specific
6558 * proxies, and a list of hosts that proxies should not be used for.
6560 * #GSimpleProxyResolver is never the default proxy resolver, but it
6561 * can be used as the base class for another proxy resolver
6562 * implementation, or it can be created and used manually, such as
6563 * with g_socket_client_set_proxy_resolver().
6571 * @short_description: Low-level socket object
6572 * @include: gio/gio.h
6573 * @see_also: #GInitable, <link linkend="gio-gnetworking.h">gnetworking.h</link>
6575 * A #GSocket is a low-level networking primitive. It is a more or less
6576 * direct mapping of the BSD socket API in a portable GObject based API.
6577 * It supports both the UNIX socket implementations and winsock2 on Windows.
6579 * #GSocket is the platform independent base upon which the higher level
6580 * network primitives are based. Applications are not typically meant to
6581 * use it directly, but rather through classes like #GSocketClient,
6582 * #GSocketService and #GSocketConnection. However there may be cases where
6583 * direct use of #GSocket is useful.
6585 * #GSocket implements the #GInitable interface, so if it is manually constructed
6586 * by e.g. g_object_new() you must call g_initable_init() and check the
6587 * results before using the object. This is done automatically in
6588 * g_socket_new() and g_socket_new_from_fd(), so these functions can return
6591 * Sockets operate in two general modes, blocking or non-blocking. When
6592 * in blocking mode all operations block until the requested operation
6593 * is finished or there is an error. In non-blocking mode all calls that
6594 * would block return immediately with a %G_IO_ERROR_WOULD_BLOCK error.
6595 * To know when a call would successfully run you can call g_socket_condition_check(),
6596 * or g_socket_condition_wait(). You can also use g_socket_create_source() and
6597 * attach it to a #GMainContext to get callbacks when I/O is possible.
6598 * Note that all sockets are always set to non blocking mode in the system, and
6599 * blocking mode is emulated in GSocket.
6601 * When working in non-blocking mode applications should always be able to
6602 * handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other
6603 * function said that I/O was possible. This can easily happen in case
6604 * of a race condition in the application, but it can also happen for other
6605 * reasons. For instance, on Windows a socket is always seen as writable
6606 * until a write returns %G_IO_ERROR_WOULD_BLOCK.
6608 * #GSocket<!-- -->s can be either connection oriented or datagram based.
6609 * For connection oriented types you must first establish a connection by
6610 * either connecting to an address or accepting a connection from another
6611 * address. For connectionless socket types the target/source address is
6612 * specified or received in each I/O operation.
6614 * All socket file descriptors are set to be close-on-exec.
6616 * Note that creating a #GSocket causes the signal %SIGPIPE to be
6617 * ignored for the remainder of the program. If you are writing a
6618 * command-line utility that uses #GSocket, you may need to take into
6619 * account the fact that your program will not automatically be killed
6620 * if it tries to write to %stdout after it has been closed.
6627 * SECTION:gsocketaddress
6628 * @short_description: Abstract base class representing endpoints for socket communication
6630 * #GSocketAddress is the equivalent of <type>struct sockaddr</type>
6631 * in the BSD sockets API. This is an abstract class; use
6632 * #GInetSocketAddress for internet sockets, or #GUnixSocketAddress
6633 * for UNIX domain sockets.
6638 * SECTION:gsocketclient
6639 * @short_description: Helper for connecting to a network service
6640 * @include: gio/gio.h
6641 * @see_also: #GSocketConnection, #GSocketListener
6643 * #GSocketClient is a lightweight high-level utility class for connecting to
6644 * a network host using a connection oriented socket type.
6646 * You create a #GSocketClient object, set any options you want, and then
6647 * call a sync or async connect operation, which returns a #GSocketConnection
6648 * subclass on success.
6650 * The type of the #GSocketConnection object returned depends on the type of
6651 * the underlying socket that is in use. For instance, for a TCP/IP connection
6652 * it will be a #GTcpConnection.
6654 * As #GSocketClient is a lightweight object, you don't need to cache it. You
6655 * can just create a new one any time you need one.
6662 * SECTION:gsocketconnectable
6663 * @short_description: Interface for potential socket endpoints
6665 * Objects that describe one or more potential socket endpoints
6666 * implement #GSocketConnectable. Callers can then use
6667 * g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator
6668 * to try out each socket address in turn until one succeeds, as shown
6669 * in the sample code below.
6672 * MyConnectionType *
6673 * connect_to_host (const char *hostname,
6675 * GCancellable *cancellable,
6678 * MyConnection *conn = NULL;
6679 * GSocketConnectable *addr;
6680 * GSocketAddressEnumerator *enumerator;
6681 * GSocketAddress *sockaddr;
6682 * GError *conn_error = NULL;
6684 * addr = g_network_address_new ("www.gnome.org", 80);
6685 * enumerator = g_socket_connectable_enumerate (addr);
6686 * g_object_unref (addr);
6688 * /<!-- -->* Try each sockaddr until we succeed. Record the first
6689 * * connection error, but not any further ones (since they'll probably
6690 * * be basically the same as the first).
6692 * while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error))
6694 * conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error);
6695 * g_object_unref (sockaddr);
6697 * g_object_unref (enumerator);
6703 * /<!-- -->* We couldn't connect to the first address, but we succeeded
6704 * * in connecting to a later address.
6706 * g_error_free (conn_error);
6712 * /<!-- -->* Either the initial lookup failed, or else the caller
6716 * g_error_free (conn_error);
6721 * g_error_propagate (error, conn_error);
6730 * SECTION:gsocketconnection
6731 * @short_description: A socket connection
6732 * @include: gio/gio.h
6733 * @see_also: #GIOStream, #GSocketClient, #GSocketListener
6735 * #GSocketConnection is a #GIOStream for a connected socket. They
6736 * can be created either by #GSocketClient when connecting to a host,
6737 * or by #GSocketListener when accepting a new client.
6739 * The type of the #GSocketConnection object returned from these calls
6740 * depends on the type of the underlying socket that is in use. For
6741 * instance, for a TCP/IP connection it will be a #GTcpConnection.
6743 * Choosing what type of object to construct is done with the socket
6744 * connection factory, and it is possible for 3rd parties to register
6745 * custom socket connection types for specific combination of socket
6746 * family/type/protocol using g_socket_connection_factory_register_type().
6753 * SECTION:gsocketcontrolmessage
6754 * @title: GSocketControlMessage
6755 * @short_description: A GSocket control message
6756 * @see_also: #GSocket.
6758 * A #GSocketControlMessage is a special-purpose utility message that
6759 * can be sent to or received from a #GSocket. These types of
6760 * messages are often called "ancillary data".
6762 * The message can represent some sort of special instruction to or
6763 * information from the socket or can represent a special kind of
6764 * transfer to the peer (for example, sending a file description over
6767 * These messages are sent with g_socket_send_message() and received
6768 * with g_socket_receive_message().
6770 * To extend the set of control message that can be sent, subclass this
6771 * class and override the get_size, get_level, get_type and serialize
6774 * To extend the set of control messages that can be received, subclass
6775 * this class and implement the deserialize method. Also, make sure your
6776 * class is registered with the GType typesystem before calling
6777 * g_socket_receive_message() to read such a message.
6784 * SECTION:gsocketlistener
6785 * @title: GSocketListener
6786 * @short_description: Helper for accepting network client connections
6787 * @see_also: #GThreadedSocketService, #GSocketService.
6789 * A #GSocketListener is an object that keeps track of a set
6790 * of server sockets and helps you accept sockets from any of the
6791 * socket, either sync or async.
6793 * If you want to implement a network server, also look at #GSocketService
6794 * and #GThreadedSocketService which are subclass of #GSocketListener
6795 * that makes this even easier.
6802 * SECTION:gsocketservice
6803 * @title: GSocketService
6804 * @short_description: Make it easy to implement a network service
6805 * @see_also: #GThreadedSocketService, #GSocketListener.
6807 * A #GSocketService is an object that represents a service that
6808 * is provided to the network or over local sockets. When a new
6809 * connection is made to the service the #GSocketService::incoming
6810 * signal is emitted.
6812 * A #GSocketService is a subclass of #GSocketListener and you need
6813 * to add the addresses you want to accept connections on with the
6814 * #GSocketListener APIs.
6816 * There are two options for implementing a network service based on
6817 * #GSocketService. The first is to create the service using
6818 * g_socket_service_new() and to connect to the #GSocketService::incoming
6819 * signal. The second is to subclass #GSocketService and override the
6820 * default signal handler implementation.
6822 * In either case, the handler must immediately return, or else it
6823 * will block additional incoming connections from being serviced.
6824 * If you are interested in writing connection handlers that contain
6825 * blocking code then see #GThreadedSocketService.
6827 * The socket service runs on the main loop of the <link
6828 * linkend="g-main-context-push-thread-default-context">thread-default
6829 * context</link> of the thread it is created in, and is not
6830 * threadsafe in general. However, the calls to start and stop the
6831 * service are thread-safe so these can be used from threads that
6832 * handle incoming clients.
6839 * SECTION:gsrvtarget
6840 * @short_description: DNS SRV record target
6841 * @include: gio/gio.h
6843 * SRV (service) records are used by some network protocols to provide
6844 * service-specific aliasing and load-balancing. For example, XMPP
6845 * (Jabber) uses SRV records to locate the XMPP server for a domain;
6846 * rather than connecting directly to "example.com" or assuming a
6847 * specific server hostname like "xmpp.example.com", an XMPP client
6848 * would look up the "xmpp-client" SRV record for "example.com", and
6849 * then connect to whatever host was pointed to by that record.
6851 * You can use g_resolver_lookup_service() or
6852 * g_resolver_lookup_service_async() to find the #GSrvTarget<!-- -->s
6853 * for a given service. However, if you are simply planning to connect
6854 * to the remote service, you can use #GNetworkService's
6855 * #GSocketConnectable interface and not need to worry about
6856 * #GSrvTarget at all.
6862 * @short_description: Cancellable synchronous or asynchronous task and result
6863 * @include: gio/gio.h
6864 * @see_also: #GAsyncResult
6867 * A #GTask represents and manages a cancellable "task".
6870 * <title>Asynchronous operations</title>
6872 * The most common usage of #GTask is as a #GAsyncResult, to
6873 * manage data during an asynchronous operation. You call
6874 * g_task_new() in the "start" method, followed by
6875 * g_task_set_task_data() and the like if you need to keep some
6876 * additional data associated with the task, and then pass the
6877 * task object around through your asynchronous operation.
6878 * Eventually, you will call a method such as
6879 * g_task_return_pointer() or g_task_return_error(), which will
6880 * save the value you give it and then invoke the task's callback
6881 * function (waiting until the next next iteration of the main
6882 * loop first, if necessary). The caller will pass the #GTask back
6883 * to the operation's finish function (as a #GAsyncResult), and
6884 * you can use g_task_propagate_pointer() or the like to extract
6887 * <example id="gtask-async"><title>GTask as a GAsyncResult</title>
6890 * CakeFrostingType frosting;
6895 * decoration_data_free (DecorationData *decoration)
6897 * g_free (decoration->message);
6898 * g_slice_free (DecorationData, decoration);
6902 * baked_cb (Cake *cake,
6903 * gpointer user_data)
6905 * GTask *task = user_data;
6906 * DecorationData *decoration = g_task_get_task_data (task);
6907 * GError *error = NULL;
6911 * g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_NO_FLOUR,
6912 * "Go to the supermarket");
6913 * g_object_unref (task);
6917 * if (!cake_decorate (cake, decoration->frosting, decoration->message, &error))
6919 * g_object_unref (cake);
6920 * /* g_task_return_error() takes ownership of error */
6921 * g_task_return_error (task, error);
6922 * g_object_unref (task);
6926 * g_task_return_pointer (result, cake, g_object_unref);
6927 * g_object_unref (task);
6931 * baker_bake_cake_async (Baker *self,
6933 * CakeFlavor flavor,
6934 * CakeFrostingType frosting,
6935 * const char *message,
6936 * GCancellable *cancellable,
6937 * GAsyncReadyCallback callback,
6938 * gpointer user_data)
6941 * DecorationData *decoration;
6944 * task = g_task_new (self, cancellable, callback, user_data);
6947 * g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_TOO_SMALL,
6948 * "%ucm radius cakes are silly",
6950 * g_object_unref (task);
6954 * cake = _baker_get_cached_cake (self, radius, flavor, frosting, message);
6957 * /* _baker_get_cached_cake() returns a reffed cake */
6958 * g_task_return_pointer (task, cake, g_object_unref);
6959 * g_object_unref (task);
6963 * decoration = g_slice_new (DecorationData);
6964 * decoration->frosting = frosting;
6965 * decoration->message = g_strdup (message);
6966 * g_task_set_task_data (task, decoration, (GDestroyNotify) decoration_data_free);
6968 * _baker_begin_cake (self, radius, flavor, cancellable, baked_cb, task);
6972 * baker_bake_cake_finish (Baker *self,
6973 * GAsyncResult *result,
6976 * g_return_val_if_fail (g_task_is_valid (result, self), NULL);
6978 * return g_task_propagate_pointer (G_TASK (result), error);
6984 * <title>Chained asynchronous operations</title>
6986 * #GTask also tries to simplify asynchronous operations that
6987 * internally chain together several smaller asynchronous
6988 * operations. g_task_get_cancellable(), g_task_get_context(), and
6989 * g_task_get_priority() allow you to get back the task's
6990 * #GCancellable, #GMainContext, and <link
6991 * linkend="io-priority">I/O priority</link> when starting a new
6992 * subtask, so you don't have to keep track of them yourself.
6993 * g_task_attach_source() simplifies the case of waiting for a
6994 * source to fire (automatically using the correct #GMainContext
6997 * <example id="gtask-chained"><title>Chained asynchronous operations</title>
7001 * CakeFrostingType frosting;
7006 * decoration_data_free (BakingData *bd)
7009 * g_object_unref (bd->cake);
7010 * g_free (bd->message);
7011 * g_slice_free (BakingData, bd);
7015 * decorated_cb (Cake *cake,
7016 * GAsyncResult *result,
7017 * gpointer user_data)
7019 * GTask *task = user_data;
7020 * GError *error = NULL;
7022 * if (!cake_decorate_finish (cake, result, &error))
7024 * g_object_unref (cake);
7025 * g_task_return_error (task, error);
7026 * g_object_unref (task);
7030 * /* baking_data_free() will drop its ref on the cake, so
7031 * * we have to take another here to give to the caller.
7033 * g_task_return_pointer (result, g_object_ref (cake), g_object_unref);
7034 * g_object_unref (task);
7038 * decorator_ready (gpointer user_data)
7040 * GTask *task = user_data;
7041 * BakingData *bd = g_task_get_task_data (task);
7043 * cake_decorate_async (bd->cake, bd->frosting, bd->message,
7044 * g_task_get_cancellable (task),
7045 * decorated_cb, task);
7049 * baked_cb (Cake *cake,
7050 * gpointer user_data)
7052 * GTask *task = user_data;
7053 * BakingData *bd = g_task_get_task_data (task);
7054 * GError *error = NULL;
7058 * g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_NO_FLOUR,
7059 * "Go to the supermarket");
7060 * g_object_unref (task);
7066 * /* Bail out now if the user has already cancelled */
7067 * if (g_task_return_error_if_cancelled (g_task_get_cancellable (task)))
7069 * g_object_unref (task);
7073 * if (cake_decorator_available (cake))
7074 * decorator_ready (task);
7079 * source = cake_decorator_wait_source_new (cake);
7080 * /* Attach @source to @task's GMainContext and have it call
7081 * * decorator_ready() when it is ready.
7083 * g_task_attach_source (task, source,
7084 * G_CALLBACK (decorator_ready));
7085 * g_source_unref (source);
7090 * baker_bake_cake_async (Baker *self,
7092 * CakeFlavor flavor,
7093 * CakeFrostingType frosting,
7094 * const char *message,
7096 * GCancellable *cancellable,
7097 * GAsyncReadyCallback callback,
7098 * gpointer user_data)
7103 * task = g_task_new (self, cancellable, callback, user_data);
7104 * g_task_set_priority (task, priority);
7106 * bd = g_slice_new0 (BakingData);
7107 * bd->frosting = frosting;
7108 * bd->message = g_strdup (message);
7109 * g_task_set_task_data (task, bd, (GDestroyNotify) baking_data_free);
7111 * _baker_begin_cake (self, radius, flavor, cancellable, baked_cb, task);
7115 * baker_bake_cake_finish (Baker *self,
7116 * GAsyncResult *result,
7119 * g_return_val_if_fail (g_task_is_valid (result, self), NULL);
7121 * return g_task_propagate_pointer (G_TASK (result), error);
7127 * <title>Asynchronous operations from synchronous ones</title>
7129 * You can use g_task_run_in_thread() to turn a synchronous
7130 * operation into an asynchronous one, by running it in a thread
7131 * which will then dispatch the result back to the caller's
7132 * #GMainContext when it completes.
7134 * <example id="gtask-run-in-thread"><title>g_task_run_in_thread()</title>
7138 * CakeFlavor flavor;
7139 * CakeFrostingType frosting;
7144 * cake_data_free (CakeData *cake_data)
7146 * g_free (cake_data->message);
7147 * g_slice_free (CakeData, cake_data);
7151 * bake_cake_thread (GTask *task,
7152 * gpointer source_object,
7153 * gpointer task_data,
7154 * GCancellable *cancellable)
7156 * Baker *self = source_object;
7157 * CakeData *cake_data = task_data;
7159 * GError *error = NULL;
7161 * cake = bake_cake (baker, cake_data->radius, cake_data->flavor,
7162 * cake_data->frosting, cake_data->message,
7163 * cancellable, &error);
7165 * g_task_return_pointer (task, cake, g_object_unref);
7167 * g_task_return_error (task, error);
7171 * baker_bake_cake_async (Baker *self,
7173 * CakeFlavor flavor,
7174 * CakeFrostingType frosting,
7175 * const char *message,
7176 * GCancellable *cancellable,
7177 * GAsyncReadyCallback callback,
7178 * gpointer user_data)
7180 * CakeData *cake_data;
7183 * cake_data = g_slice_new (CakeData);
7184 * cake_data->radius = radius;
7185 * cake_data->flavor = flavor;
7186 * cake_data->frosting = frosting;
7187 * cake_data->message = g_strdup (message);
7188 * task = g_task_new (self, cancellable, callback, user_data);
7189 * g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7190 * g_task_run_in_thread (task, bake_cake_thread);
7194 * baker_bake_cake_finish (Baker *self,
7195 * GAsyncResult *result,
7198 * g_return_val_if_fail (g_task_is_valid (result, self), NULL);
7200 * return g_task_propagate_pointer (G_TASK (result), error);
7206 * <title>Adding cancellability to uncancellable tasks</title>
7208 * Finally, g_task_run_in_thread() and g_task_run_in_thread_sync()
7209 * can be used to turn an uncancellable operation into a
7210 * cancellable one. If you call g_task_set_return_on_cancel(),
7211 * passing %TRUE, then if the task's #GCancellable is cancelled,
7212 * it will return control back to the caller immediately, while
7213 * allowing the task thread to continue running in the background
7214 * (and simply discarding its result when it finally does finish).
7215 * Provided that the task thread is careful about how it uses
7216 * locks and other externally-visible resources, this allows you
7217 * to make "GLib-friendly" asynchronous and cancellable
7218 * synchronous variants of blocking APIs.
7220 * <example id="gtask-cancellable"><title>g_task_set_return_on_cancel()</title>
7223 * bake_cake_thread (GTask *task,
7224 * gpointer source_object,
7225 * gpointer task_data,
7226 * GCancellable *cancellable)
7228 * Baker *self = source_object;
7229 * CakeData *cake_data = task_data;
7231 * GError *error = NULL;
7233 * cake = bake_cake (baker, cake_data->radius, cake_data->flavor,
7234 * cake_data->frosting, cake_data->message,
7238 * g_task_return_error (task, error);
7242 * /* If the task has already been cancelled, then we don't
7243 * * want to add the cake to the cake cache. Likewise, we don't
7244 * * want to have the task get cancelled in the middle of
7245 * * updating the cache. g_task_set_return_on_cancel() will
7246 * * return %TRUE here if it managed to disable return-on-cancel,
7247 * * or %FALSE if the task was cancelled before it could.
7249 * if (g_task_set_return_on_cancel (task, FALSE))
7251 * /* If the caller cancels at this point, their
7252 * * GAsyncReadyCallback won't be invoked until we return,
7253 * * so we don't have to worry that this code will run at
7254 * * the same time as that code does. But if there were
7255 * * other functions that might look at the cake cache,
7256 * * then we'd probably need a GMutex here as well.
7258 * baker_add_cake_to_cache (baker, cake);
7259 * g_task_return_pointer (task, cake, g_object_unref);
7264 * baker_bake_cake_async (Baker *self,
7266 * CakeFlavor flavor,
7267 * CakeFrostingType frosting,
7268 * const char *message,
7269 * GCancellable *cancellable,
7270 * GAsyncReadyCallback callback,
7271 * gpointer user_data)
7273 * CakeData *cake_data;
7276 * cake_data = g_slice_new (CakeData);
7279 * task = g_task_new (self, cancellable, callback, user_data);
7280 * g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7281 * g_task_set_return_on_cancel (task, TRUE);
7282 * g_task_run_in_thread (task, bake_cake_thread);
7286 * baker_bake_cake_sync (Baker *self,
7288 * CakeFlavor flavor,
7289 * CakeFrostingType frosting,
7290 * const char *message,
7291 * GCancellable *cancellable,
7294 * CakeData *cake_data;
7298 * cake_data = g_slice_new (CakeData);
7301 * task = g_task_new (self, cancellable, NULL, NULL);
7302 * g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7303 * g_task_set_return_on_cancel (task, TRUE);
7304 * g_task_run_in_thread_sync (task, bake_cake_thread);
7306 * cake = g_task_propagate_pointer (task, error);
7307 * g_object_unref (task);
7314 * <title>Porting from <literal>GSimpleAsyncResult</literal></title>
7316 * #GTask's API attempts to be simpler than #GSimpleAsyncResult's
7321 * You can save task-specific data with g_task_set_task_data(), and
7322 * retrieve it later with g_task_get_task_data(). This replaces the
7323 * abuse of g_simple_async_result_set_op_res_gpointer() for the same
7324 * purpose with #GSimpleAsyncResult.
7325 * </para></listitem>
7327 * In addition to the task data, #GTask also keeps track of the
7328 * <link linkend="io-priority">priority</link>, #GCancellable, and
7329 * #GMainContext associated with the task, so tasks that consist of
7330 * a chain of simpler asynchronous operations will have easy access
7331 * to those values when starting each sub-task.
7332 * </para></listitem>
7334 * g_task_return_error_if_cancelled() provides simplified
7335 * handling for cancellation. In addition, cancellation
7336 * overrides any other #GTask return value by default, like
7337 * #GSimpleAsyncResult does when
7338 * g_simple_async_result_set_check_cancellable() is called.
7339 * (You can use g_task_set_check_cancellable() to turn off that
7340 * behavior.) On the other hand, g_task_run_in_thread()
7341 * guarantees that it will always run your
7342 * <literal>task_func</literal>, even if the task's #GCancellable
7343 * is already cancelled before the task gets a chance to run;
7344 * you can start your <literal>task_func</literal> with a
7345 * g_task_return_error_if_cancelled() check if you need the
7347 * </para></listitem>
7349 * The "return" methods (eg, g_task_return_pointer())
7350 * automatically cause the task to be "completed" as well, and
7351 * there is no need to worry about the "complete" vs "complete
7352 * in idle" distinction. (#GTask automatically figures out
7353 * whether the task's callback can be invoked directly, or
7354 * if it needs to be sent to another #GMainContext, or delayed
7355 * until the next iteration of the current #GMainContext.)
7356 * </para></listitem>
7358 * The "finish" functions for #GTask-based operations are generally
7359 * much simpler than #GSimpleAsyncResult ones, normally consisting
7360 * of only a single call to g_task_propagate_pointer() or the like.
7361 * Since g_task_propagate_pointer() "steals" the return value from
7362 * the #GTask, it is not necessary to juggle pointers around to
7363 * prevent it from being freed twice.
7364 * </para></listitem>
7366 * With #GSimpleAsyncResult, it was common to call
7367 * g_simple_async_result_propagate_error() from the
7368 * <literal>_finish()</literal> wrapper function, and have
7369 * virtual method implementations only deal with successful
7370 * returns. This behavior is deprecated, because it makes it
7371 * difficult for a subclass to chain to a parent class's async
7372 * methods. Instead, the wrapper function should just be a
7373 * simple wrapper, and the virtual method should call an
7374 * appropriate <literal>g_task_propagate_</literal> function.
7375 * Note that wrapper methods can now use
7376 * g_async_result_legacy_propagate_error() to do old-style
7377 * #GSimpleAsyncResult error-returning behavior, and
7378 * g_async_result_is_tagged() to check if a result is tagged as
7379 * having come from the <literal>_async()</literal> wrapper
7380 * function (for "short-circuit" results, such as when passing
7381 * 0 to g_input_stream_read_async()).
7382 * </para></listitem>
7389 * SECTION:gtcpconnection
7390 * @title: GTcpConnection
7391 * @short_description: A TCP GSocketConnection
7392 * @see_also: #GSocketConnection.
7394 * This is the subclass of #GSocketConnection that is created
7395 * for TCP/IP sockets.
7402 * SECTION:gtcpwrapperconnection
7403 * @title: GTcpWrapperConnection
7404 * @short_description: wrapper for non-GSocketConnection-based, GSocket-based GIOStreams
7405 * @see_also: #GSocketConnection.
7407 * A #GTcpWrapperConnection can be used to wrap a #GIOStream that is
7408 * based on a #GSocket, but which is not actually a
7409 * #GSocketConnection. This is used by #GSocketClient so that it can
7410 * always return a #GSocketConnection, even when the connection it has
7411 * actually created is not directly a #GSocketConnection.
7419 * @short_description: D-Bus testing helper
7420 * @include: gio/gio.h
7422 * A helper class for testing code which uses D-Bus without touching the user's
7428 * SECTION:gthemedicon
7429 * @short_description: Icon theming support
7430 * @include: gio/gio.h
7431 * @see_also: #GIcon, #GLoadableIcon
7433 * #GThemedIcon is an implementation of #GIcon that supports icon themes.
7434 * #GThemedIcon contains a list of all of the icons present in an icon
7435 * theme, so that icons can be looked up quickly. #GThemedIcon does
7436 * not provide actual pixmaps for icons, just the icon names.
7437 * Ideally something like gtk_icon_theme_choose_icon() should be used to
7438 * resolve the list of names so that fallback icons work nicely with
7439 * themes that inherit other themes.
7444 * SECTION:gthreadedsocketservice
7445 * @title: GThreadedSocketService
7446 * @short_description: A threaded GSocketService
7447 * @see_also: #GSocketService.
7449 * A #GThreadedSocketService is a simple subclass of #GSocketService
7450 * that handles incoming connections by creating a worker thread and
7451 * dispatching the connection to it by emitting the
7452 * #GThreadedSocketService::run signal in the new thread.
7454 * The signal handler may perform blocking IO and need not return
7455 * until the connection is closed.
7457 * The service is implemented using a thread pool, so there is a
7458 * limited amount of threads available to serve incoming requests.
7459 * The service automatically stops the #GSocketService from accepting
7460 * new connections when all threads are busy.
7462 * As with #GSocketService, you may connect to #GThreadedSocketService::run,
7463 * or subclass and override the default handler.
7469 * @title: TLS Overview
7470 * @short_description: TLS (aka SSL) support for GSocketConnection
7471 * @include: gio/gio.h
7473 * #GTlsConnection and related classes provide TLS (Transport Layer
7474 * Security, previously known as SSL, Secure Sockets Layer) support for
7475 * gio-based network streams.
7477 * In the simplest case, for a client connection, you can just set the
7478 * #GSocketClient:tls flag on a #GSocketClient, and then any
7479 * connections created by that client will have TLS negotiated
7480 * automatically, using appropriate default settings, and rejecting
7481 * any invalid or self-signed certificates (unless you change that
7482 * default by setting the #GSocketClient:tls-validation-flags
7483 * property). The returned object will be a #GTcpWrapperConnection,
7484 * which wraps the underlying #GTlsClientConnection.
7486 * For greater control, you can create your own #GTlsClientConnection,
7487 * wrapping a #GSocketConnection (or an arbitrary #GIOStream with
7488 * pollable input and output streams) and then connect to its signals,
7489 * such as #GTlsConnection::accept-certificate, before starting the
7492 * Server-side TLS is similar, using #GTlsServerConnection. At the
7493 * moment, there is no support for automatically wrapping server-side
7494 * connections in the way #GSocketClient does for client-side
7500 * SECTION:gtlsbackend
7501 * @title: GTlsBackend
7502 * @short_description: TLS backend implementation
7503 * @include: gio/gio.h
7508 * SECTION:gtlscertificate
7509 * @title: GTlsCertificate
7510 * @short_description: TLS certificate
7511 * @see_also: #GTlsConnection
7513 * A certificate used for TLS authentication and encryption.
7514 * This can represent either a certificate only (eg, the certificate
7515 * received by a client from a server), or the combination of
7516 * a certificate and a private key (which is needed when acting as a
7517 * #GTlsServerConnection).
7524 * SECTION:gtlsclientconnection
7525 * @short_description: TLS client-side connection
7526 * @include: gio/gio.h
7528 * #GTlsClientConnection is the client-side subclass of
7529 * #GTlsConnection, representing a client-side TLS connection.
7534 * SECTION:gtlsconnection
7535 * @short_description: TLS connection type
7536 * @include: gio/gio.h
7538 * #GTlsConnection is the base TLS connection class type, which wraps
7539 * a #GIOStream and provides TLS encryption on top of it. Its
7540 * subclasses, #GTlsClientConnection and #GTlsServerConnection,
7541 * implement client-side and server-side TLS, respectively.
7548 * SECTION:gtlsdatabase
7549 * @short_description: TLS database type
7550 * @include: gio/gio.h
7552 * #GTlsDatabase is used to lookup certificates and other information
7553 * from a certificate or key store. It is an abstract base class which
7554 * TLS library specific subtypes override.
7556 * Most common client applications will not directly interact with
7557 * #GTlsDatabase. It is used internally by #GTlsConnection.
7564 * SECTION:gtlsfiledatabase
7565 * @short_description: TLS file based database type
7566 * @include: gio/gio.h
7568 * #GTlsFileDatabase is implemented by #GTlsDatabase objects which load
7569 * their certificate information from a file. It is in interface which
7570 * TLS library specific subtypes implement.
7577 * SECTION:gtlsinteraction
7578 * @short_description: Interaction with the user during TLS operations.
7579 * @include: gio/gio.h
7581 * #GTlsInteraction provides a mechanism for the TLS connection and database
7582 * code to interact with the user. It can be used to ask the user for passwords.
7584 * To use a #GTlsInteraction with a TLS connection use
7585 * g_tls_connection_set_interaction().
7587 * Callers should instantiate a derived class that implements the various
7588 * interaction methods to show the required dialogs.
7590 * Callers should use the 'invoke' functions like
7591 * g_tls_interaction_invoke_ask_password() to run interaction methods. These
7592 * functions make sure that the interaction is invoked in the main loop
7593 * and not in the current thread, if the current thread is not running the
7596 * Derived classes can choose to implement whichever interactions methods they'd
7597 * like to support by overriding those virtual methods in their class
7598 * initialization function. Any interactions not implemented will return
7599 * %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
7600 * it must also implement the corresponding finish method.
7605 * SECTION:gtlspassword
7606 * @title: GTlsPassword
7607 * @short_description: TLS Passwords for prompting
7608 * @include: gio/gio.h
7610 * Holds a password used in TLS.
7615 * SECTION:gtlsserverconnection
7616 * @short_description: TLS server-side connection
7617 * @include: gio/gio.h
7619 * #GTlsServerConnection is the server-side subclass of #GTlsConnection,
7620 * representing a server-side TLS connection.
7627 * SECTION:gunixconnection
7628 * @title: GUnixConnection
7629 * @short_description: A UNIX domain GSocketConnection
7630 * @include: gio/gunixconnection.h
7631 * @see_also: #GSocketConnection.
7633 * This is the subclass of #GSocketConnection that is created
7634 * for UNIX domain sockets.
7636 * It contains functions to do some of the UNIX socket specific
7637 * functionality like passing file descriptors.
7639 * Note that <filename><gio/gunixconnection.h></filename> belongs to
7640 * the UNIX-specific GIO interfaces, thus you have to use the
7641 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7648 * SECTION:gunixcredentialsmessage
7649 * @title: GUnixCredentialsMessage
7650 * @short_description: A GSocketControlMessage containing credentials
7651 * @include: gio/gunixcredentialsmessage.h
7652 * @see_also: #GUnixConnection, #GSocketControlMessage
7654 * This #GSocketControlMessage contains a #GCredentials instance. It
7655 * may be sent using g_socket_send_message() and received using
7656 * g_socket_receive_message() over UNIX sockets (ie: sockets in the
7657 * %G_SOCKET_FAMILY_UNIX family).
7659 * For an easier way to send and receive credentials over
7660 * stream-oriented UNIX sockets, see
7661 * g_unix_connection_send_credentials() and
7662 * g_unix_connection_receive_credentials(). To receive credentials of
7663 * a foreign process connected to a socket, use
7664 * g_socket_get_credentials().
7669 * SECTION:gunixfdlist
7670 * @title: GUnixFDList
7671 * @short_description: An object containing a set of UNIX file descriptors
7672 * @include: gio/gunixfdlist.h
7673 * @see_also: #GUnixFDMessage
7675 * A #GUnixFDList contains a list of file descriptors. It owns the file
7676 * descriptors that it contains, closing them when finalized.
7678 * It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
7679 * the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
7680 * and received using g_socket_receive_message().
7682 * Note that <filename><gio/gunixfdlist.h></filename> belongs to
7683 * the UNIX-specific GIO interfaces, thus you have to use the
7684 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7689 * SECTION:gunixfdmessage
7690 * @title: GUnixFDMessage
7691 * @short_description: A GSocketControlMessage containing a GUnixFDList
7692 * @include: gio/gunixfdmessage.h
7693 * @see_also: #GUnixConnection, #GUnixFDList, #GSocketControlMessage
7695 * This #GSocketControlMessage contains a #GUnixFDList.
7696 * It may be sent using g_socket_send_message() and received using
7697 * g_socket_receive_message() over UNIX sockets (ie: sockets in the
7698 * %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied
7699 * between processes by the kernel.
7701 * For an easier way to send and receive file descriptors over
7702 * stream-oriented UNIX sockets, see g_unix_connection_send_fd() and
7703 * g_unix_connection_receive_fd().
7705 * Note that <filename><gio/gunixfdmessage.h></filename> belongs to
7706 * the UNIX-specific GIO interfaces, thus you have to use the
7707 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7712 * SECTION:gunixinputstream
7713 * @short_description: Streaming input operations for UNIX file descriptors
7714 * @include: gio/gunixinputstream.h
7715 * @see_also: #GInputStream
7717 * #GUnixInputStream implements #GInputStream for reading from a UNIX
7718 * file descriptor, including asynchronous operations. (If the file
7719 * descriptor refers to a socket or pipe, this will use poll() to do
7720 * asynchronous I/O. If it refers to a regular file, it will fall back
7721 * to doing asynchronous I/O in another thread.)
7723 * Note that <filename><gio/gunixinputstream.h></filename> belongs
7724 * to the UNIX-specific GIO interfaces, thus you have to use the
7725 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7730 * SECTION:gunixmounts
7731 * @include: gio/gunixmounts.h
7732 * @short_description: UNIX mounts
7734 * Routines for managing mounted UNIX mount points and paths.
7736 * Note that <filename><gio/gunixmounts.h></filename> belongs to the
7737 * UNIX-specific GIO interfaces, thus you have to use the
7738 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7743 * SECTION:gunixoutputstream
7744 * @short_description: Streaming output operations for UNIX file descriptors
7745 * @include: gio/gunixoutputstream.h
7746 * @see_also: #GOutputStream
7748 * #GUnixOutputStream implements #GOutputStream for writing to a UNIX
7749 * file descriptor, including asynchronous operations. (If the file
7750 * descriptor refers to a socket or pipe, this will use poll() to do
7751 * asynchronous I/O. If it refers to a regular file, it will fall back
7752 * to doing asynchronous I/O in another thread.)
7754 * Note that <filename><gio/gunixoutputstream.h></filename> belongs
7755 * to the UNIX-specific GIO interfaces, thus you have to use the
7756 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7761 * SECTION:gunixsocketaddress
7762 * @short_description: UNIX GSocketAddress
7763 * @include: gio/gunixsocketaddress.h
7765 * Support for UNIX-domain (also known as local) sockets.
7767 * UNIX domain sockets are generally visible in the filesystem.
7768 * However, some systems support abstract socket names which are not
7769 * visible in the filesystem and not affected by the filesystem
7770 * permissions, visibility, etc. Currently this is only supported
7771 * under Linux. If you attempt to use abstract sockets on other
7772 * systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED
7773 * errors. You can use g_unix_socket_address_abstract_names_supported()
7774 * to see if abstract names are supported.
7776 * Note that <filename><gio/gunixsocketaddress.h></filename> belongs to
7777 * the UNIX-specific GIO interfaces, thus you have to use the
7778 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7784 * @short_description: Virtual File System
7785 * @include: gio/gio.h
7787 * Entry point for using GIO functionality.
7793 * @short_description: Volume management
7794 * @include: gio/gio.h
7796 * The #GVolume interface represents user-visible objects that can be
7797 * mounted. Note, when porting from GnomeVFS, #GVolume is the moral
7798 * equivalent of #GnomeVFSDrive.
7800 * Mounting a #GVolume instance is an asynchronous operation. For more
7801 * information about asynchronous operations, see #GAsyncResult and
7802 * #GTask. To mount a #GVolume, first call g_volume_mount() with (at
7803 * least) the #GVolume instance, optionally a #GMountOperation object
7804 * and a #GAsyncReadyCallback.
7806 * Typically, one will only want to pass %NULL for the
7807 * #GMountOperation if automounting all volumes when a desktop session
7808 * starts since it's not desirable to put up a lot of dialogs asking
7811 * The callback will be fired when the operation has resolved (either
7812 * with success or failure), and a #GAsyncReady structure will be
7813 * passed to the callback. That callback should then call
7814 * g_volume_mount_finish() with the #GVolume instance and the
7815 * #GAsyncReady data to see if the operation was completed
7816 * successfully. If an @error is present when g_volume_mount_finish()
7817 * is called, then it will be filled with any error information.
7819 * <para id="volume-identifier">
7820 * It is sometimes necessary to directly access the underlying
7821 * operating system object behind a volume (e.g. for passing a volume
7822 * to an application via the commandline). For this purpose, GIO
7823 * allows to obtain an 'identifier' for the volume. There can be
7824 * different kinds of identifiers, such as Hal UDIs, filesystem labels,
7825 * traditional Unix devices (e.g. <filename>/dev/sda2</filename>),
7826 * uuids. GIO uses predefind strings as names for the different kinds
7827 * of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
7828 * #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
7829 * to obtain an identifier for a volume.
7832 * Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
7833 * when the gvfs hal volume monitor is in use. Other volume monitors
7834 * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
7835 * identifier, which can be used to obtain a hal device by means of
7836 * libhal_manager_find_device_string_match().
7841 * SECTION:gvolumemonitor
7842 * @short_description: Volume Monitor
7843 * @include: gio/gio.h
7844 * @see_also: #GFileMonitor
7846 * #GVolumeMonitor is for listing the user interesting devices and volumes
7847 * on the computer. In other words, what a file selector or file manager
7848 * would show in a sidebar.
7850 * #GVolumeMonitor is not <link
7851 * linkend="g-main-context-push-thread-default">thread-default-context
7852 * aware</link>, and so should not be used other than from the main
7853 * thread, with no thread-default-context active.
7858 * SECTION:gwin32inputstream
7859 * @short_description: Streaming input operations for Windows file handles
7860 * @include: gio/gwin32inputstream.h
7861 * @see_also: #GInputStream
7863 * #GWin32InputStream implements #GInputStream for reading from a
7864 * Windows file handle.
7866 * Note that <filename><gio/gwin32inputstream.h></filename> belongs
7867 * to the Windows-specific GIO interfaces, thus you have to use the
7868 * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7873 * SECTION:gwin32outputstream
7874 * @short_description: Streaming output operations for Windows file handles
7875 * @include: gio/gwin32outputstream.h
7876 * @see_also: #GOutputStream
7878 * #GWin32OutputStream implements #GOutputStream for writing to a
7879 * Windows file handle.
7881 * Note that <filename><gio/gwin32outputstream.h></filename> belongs
7882 * to the Windows-specific GIO interfaces, thus you have to use the
7883 * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7888 * SECTION:gzcompressor
7889 * @short_description: Zlib compressor
7890 * @include: gio/gio.h
7892 * #GZlibCompressor is an implementation of #GConverter that
7893 * compresses data using zlib.
7898 * SECTION:gzdecompressor
7899 * @short_description: Zlib decompressor
7900 * @include: gio/gio.h
7902 * #GZlibDecompressor is an implementation of #GConverter that
7903 * decompresses data compressed with zlib.
7908 * _g_io_module_get_default:
7909 * @extension_point: the name of an extension point
7910 * @envvar: (allow-none): the name of an environment variable to override the default implementation.
7911 * @verify_func: (allow-none): a function to call to verify that a given implementation is usable in the current environment.
7913 * Retrieves the default object implementing @extension_point.
7915 * If @envvar is not %NULL, and the environment variable with that
7916 * name is set, then the implementation it specifies will be tried
7917 * first. After that, or if @envvar is not set, all other
7918 * implementations will be tried in order of decreasing priority.
7920 * If an extension point implementation implements #GInitable, then
7921 * that implementation will only be used if it initializes
7922 * successfully. Otherwise, if @verify_func is not %NULL, then it will
7923 * be called on each candidate implementation after construction, to
7924 * check if it is actually usable or not.
7926 * The result is cached after it is generated the first time, and
7927 * the function is thread-safe.
7929 * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
7934 * _g_io_module_get_default_type:
7935 * @extension_point: the name of an extension point
7936 * @envvar: (allow-none): the name of an environment variable to override the default implementation.
7937 * @is_supported_offset: a vtable offset, or zero
7939 * Retrieves the default class implementing @extension_point.
7941 * If @envvar is not %NULL, and the environment variable with that
7942 * name is set, then the implementation it specifies will be tried
7943 * first. After that, or if @envvar is not set, all other
7944 * implementations will be tried in order of decreasing priority.
7946 * If @is_supported_offset is non-zero, then it is the offset into the
7947 * class vtable at which there is a function that takes no arguments and
7948 * returns a boolean. This function will be called on each candidate
7949 * implementation to check if it is actually usable or not.
7951 * The result is cached after it is generated the first time, and
7952 * the function is thread-safe.
7954 * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
7959 * g_action_activate:
7960 * @action: a #GAction
7961 * @parameter: (allow-none): the parameter to the activation
7963 * Activates the action.
7965 * @parameter must be the correct type of parameter for the action (ie:
7966 * the parameter type given at construction time). If the parameter
7967 * type was %NULL then @parameter must also be %NULL.
7974 * g_action_change_state:
7975 * @action: a #GAction
7976 * @value: the new state
7978 * Request for the state of @action to be changed to @value.
7980 * The action must be stateful and @value must be of the correct type.
7981 * See g_action_get_state_type().
7983 * This call merely requests a change. The action may refuse to change
7984 * its state or may change its state to something other than @value.
7985 * See g_action_get_state_hint().
7987 * If the @value GVariant is floating, it is consumed.
7994 * g_action_get_enabled:
7995 * @action: a #GAction
7997 * Checks if @action is currently enabled.
7999 * An action must be enabled in order to be activated or in order to
8000 * have its state changed from outside callers.
8002 * Returns: whether the action is enabled
8008 * g_action_get_name:
8009 * @action: a #GAction
8011 * Queries the name of @action.
8013 * Returns: the name of the action
8019 * g_action_get_parameter_type:
8020 * @action: a #GAction
8022 * Queries the type of the parameter that must be given when activating
8025 * When activating the action using g_action_activate(), the #GVariant
8026 * given to that function must be of the type returned by this function.
8028 * In the case that this function returns %NULL, you must not give any
8029 * #GVariant, but %NULL instead.
8031 * Returns: (allow-none): the parameter type
8037 * g_action_get_state:
8038 * @action: a #GAction
8040 * Queries the current state of @action.
8042 * If the action is not stateful then %NULL will be returned. If the
8043 * action is stateful then the type of the return value is the type
8044 * given by g_action_get_state_type().
8046 * The return value (if non-%NULL) should be freed with
8047 * g_variant_unref() when it is no longer required.
8049 * Returns: (transfer full): the current state of the action
8055 * g_action_get_state_hint:
8056 * @action: a #GAction
8058 * Requests a hint about the valid range of values for the state of
8061 * If %NULL is returned it either means that the action is not stateful
8062 * or that there is no hint about the valid range of values for the
8063 * state of the action.
8065 * If a #GVariant array is returned then each item in the array is a
8066 * possible value for the state. If a #GVariant pair (ie: two-tuple) is
8067 * returned then the tuple specifies the inclusive lower and upper bound
8068 * of valid values for the state.
8070 * In any case, the information is merely a hint. It may be possible to
8071 * have a state value outside of the hinted range and setting a value
8072 * within the range may fail.
8074 * The return value (if non-%NULL) should be freed with
8075 * g_variant_unref() when it is no longer required.
8077 * Returns: (transfer full): the state range hint
8083 * g_action_get_state_type:
8084 * @action: a #GAction
8086 * Queries the type of the state of @action.
8088 * If the action is stateful (e.g. created with
8089 * g_simple_action_new_stateful()) then this function returns the
8090 * #GVariantType of the state. This is the type of the initial value
8091 * given as the state. All calls to g_action_change_state() must give a
8092 * #GVariant of this type and g_action_get_state() will return a
8093 * #GVariant of the same type.
8095 * If the action is not stateful (e.g. created with g_simple_action_new())
8096 * then this function will return %NULL. In that case, g_action_get_state()
8097 * will return %NULL and you must not call g_action_change_state().
8099 * Returns: (allow-none): the state type, if the action is stateful
8105 * g_action_group_action_added:
8106 * @action_group: a #GActionGroup
8107 * @action_name: the name of an action in the group
8109 * Emits the #GActionGroup::action-added signal on @action_group.
8111 * This function should only be called by #GActionGroup implementations.
8118 * g_action_group_action_enabled_changed:
8119 * @action_group: a #GActionGroup
8120 * @action_name: the name of an action in the group
8121 * @enabled: whether or not the action is now enabled
8123 * Emits the #GActionGroup::action-enabled-changed signal on @action_group.
8125 * This function should only be called by #GActionGroup implementations.
8132 * g_action_group_action_removed:
8133 * @action_group: a #GActionGroup
8134 * @action_name: the name of an action in the group
8136 * Emits the #GActionGroup::action-removed signal on @action_group.
8138 * This function should only be called by #GActionGroup implementations.
8145 * g_action_group_action_state_changed:
8146 * @action_group: a #GActionGroup
8147 * @action_name: the name of an action in the group
8148 * @state: the new state of the named action
8150 * Emits the #GActionGroup::action-state-changed signal on @action_group.
8152 * This function should only be called by #GActionGroup implementations.
8159 * g_action_group_activate_action:
8160 * @action_group: a #GActionGroup
8161 * @action_name: the name of the action to activate
8162 * @parameter: (allow-none): parameters to the activation
8164 * Activate the named action within @action_group.
8166 * If the action is expecting a parameter, then the correct type of
8167 * parameter must be given as @parameter. If the action is expecting no
8168 * parameters then @parameter must be %NULL. See
8169 * g_action_group_get_action_parameter_type().
8176 * g_action_group_change_action_state:
8177 * @action_group: a #GActionGroup
8178 * @action_name: the name of the action to request the change on
8179 * @value: the new state
8181 * Request for the state of the named action within @action_group to be
8182 * changed to @value.
8184 * The action must be stateful and @value must be of the correct type.
8185 * See g_action_group_get_action_state_type().
8187 * This call merely requests a change. The action may refuse to change
8188 * its state or may change its state to something other than @value.
8189 * See g_action_group_get_action_state_hint().
8191 * If the @value GVariant is floating, it is consumed.
8198 * g_action_group_get_action_enabled:
8199 * @action_group: a #GActionGroup
8200 * @action_name: the name of the action to query
8202 * Checks if the named action within @action_group is currently enabled.
8204 * An action must be enabled in order to be activated or in order to
8205 * have its state changed from outside callers.
8207 * Returns: whether or not the action is currently enabled
8213 * g_action_group_get_action_parameter_type:
8214 * @action_group: a #GActionGroup
8215 * @action_name: the name of the action to query
8217 * Queries the type of the parameter that must be given when activating
8218 * the named action within @action_group.
8220 * When activating the action using g_action_group_activate_action(),
8221 * the #GVariant given to that function must be of the type returned
8224 * In the case that this function returns %NULL, you must not give any
8225 * #GVariant, but %NULL instead.
8227 * The parameter type of a particular action will never change but it is
8228 * possible for an action to be removed and for a new action to be added
8229 * with the same name but a different parameter type.
8231 * Returns: the parameter type
8237 * g_action_group_get_action_state:
8238 * @action_group: a #GActionGroup
8239 * @action_name: the name of the action to query
8241 * Queries the current state of the named action within @action_group.
8243 * If the action is not stateful then %NULL will be returned. If the
8244 * action is stateful then the type of the return value is the type
8245 * given by g_action_group_get_action_state_type().
8247 * The return value (if non-%NULL) should be freed with
8248 * g_variant_unref() when it is no longer required.
8250 * Returns: (allow-none): the current state of the action
8256 * g_action_group_get_action_state_hint:
8257 * @action_group: a #GActionGroup
8258 * @action_name: the name of the action to query
8260 * Requests a hint about the valid range of values for the state of the
8261 * named action within @action_group.
8263 * If %NULL is returned it either means that the action is not stateful
8264 * or that there is no hint about the valid range of values for the
8265 * state of the action.
8267 * If a #GVariant array is returned then each item in the array is a
8268 * possible value for the state. If a #GVariant pair (ie: two-tuple) is
8269 * returned then the tuple specifies the inclusive lower and upper bound
8270 * of valid values for the state.
8272 * In any case, the information is merely a hint. It may be possible to
8273 * have a state value outside of the hinted range and setting a value
8274 * within the range may fail.
8276 * The return value (if non-%NULL) should be freed with
8277 * g_variant_unref() when it is no longer required.
8279 * Returns: (transfer full): the state range hint
8285 * g_action_group_get_action_state_type:
8286 * @action_group: a #GActionGroup
8287 * @action_name: the name of the action to query
8289 * Queries the type of the state of the named action within
8292 * If the action is stateful then this function returns the
8293 * #GVariantType of the state. All calls to
8294 * g_action_group_change_action_state() must give a #GVariant of this
8295 * type and g_action_group_get_action_state() will return a #GVariant
8298 * If the action is not stateful then this function will return %NULL.
8299 * In that case, g_action_group_get_action_state() will return %NULL
8300 * and you must not call g_action_group_change_action_state().
8302 * The state type of a particular action will never change but it is
8303 * possible for an action to be removed and for a new action to be added
8304 * with the same name but a different state type.
8306 * Returns: (transfer full): the state type, if the action is stateful
8312 * g_action_group_has_action:
8313 * @action_group: a #GActionGroup
8314 * @action_name: the name of the action to check for
8316 * Checks if the named action exists within @action_group.
8318 * Returns: whether the named action exists
8324 * g_action_group_list_actions:
8325 * @action_group: a #GActionGroup
8327 * Lists the actions contained within @action_group.
8329 * The caller is responsible for freeing the list with g_strfreev() when
8330 * it is no longer required.
8332 * Returns: (transfer full): a %NULL-terminated array of the names of the actions in the groupb
8338 * g_action_group_query_action:
8339 * @action_group: a #GActionGroup
8340 * @action_name: the name of an action in the group
8341 * @enabled: (out): if the action is presently enabled
8342 * @parameter_type: (out) (allow-none): the parameter type, or %NULL if none needed
8343 * @state_type: (out) (allow-none): the state type, or %NULL if stateless
8344 * @state_hint: (out) (allow-none): the state hint, or %NULL if none
8345 * @state: (out) (allow-none): the current state, or %NULL if stateless
8347 * Queries all aspects of the named action within an @action_group.
8349 * This function acquires the information available from
8350 * g_action_group_has_action(), g_action_group_get_action_enabled(),
8351 * g_action_group_get_action_parameter_type(),
8352 * g_action_group_get_action_state_type(),
8353 * g_action_group_get_action_state_hint() and
8354 * g_action_group_get_action_state() with a single function call.
8356 * This provides two main benefits.
8358 * The first is the improvement in efficiency that comes with not having
8359 * to perform repeated lookups of the action in order to discover
8360 * different things about it. The second is that implementing
8361 * #GActionGroup can now be done by only overriding this one virtual
8364 * The interface provides a default implementation of this function that
8365 * calls the individual functions, as required, to fetch the
8366 * information. The interface also provides default implementations of
8367 * those functions that call this function. All implementations,
8368 * therefore, must override either this function or all of the others.
8370 * If the action exists, %TRUE is returned and any of the requested
8371 * fields (as indicated by having a non-%NULL reference passed in) are
8372 * filled. If the action doesn't exist, %FALSE is returned and the
8373 * fields may or may not have been modified.
8375 * Returns: %TRUE if the action exists, else %FALSE
8381 * g_action_map_add_action:
8382 * @action_map: a #GActionMap
8383 * @action: a #GAction
8385 * Adds an action to the @action_map.
8387 * If the action map already contains an action with the same name
8388 * as @action then the old action is dropped from the action map.
8390 * The action map takes its own reference on @action.
8397 * g_action_map_add_action_entries:
8398 * @action_map: a #GActionMap
8399 * @entries: (array length=n_entries) (element-type GActionEntry): a pointer to the first item in an array of #GActionEntry structs
8400 * @n_entries: the length of @entries, or -1 if @entries is %NULL-terminated
8401 * @user_data: the user data for signal connections
8403 * A convenience function for creating multiple #GSimpleAction instances
8404 * and adding them to a #GActionMap.
8406 * Each action is constructed as per one #GActionEntry.
8409 * <title>Using g_action_map_add_action_entries()</title>
8412 * activate_quit (GSimpleAction *simple,
8413 * GVariant *parameter,
8414 * gpointer user_data)
8420 * activate_print_string (GSimpleAction *simple,
8421 * GVariant *parameter,
8422 * gpointer user_data)
8424 * g_print ("%s\n", g_variant_get_string (parameter, NULL));
8427 * static GActionGroup *
8428 * create_action_group (void)
8430 * const GActionEntry entries[] = {
8431 * { "quit", activate_quit },
8432 * { "print-string", activate_print_string, "s" }
8434 * GSimpleActionGroup *group;
8436 * group = g_simple_action_group_new ();
8437 * g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
8439 * return G_ACTION_GROUP (group);
8449 * g_action_map_lookup_action:
8450 * @action_map: a #GActionMap
8451 * @action_name: the name of an action
8453 * Looks up the action with the name @action_name in @action_map.
8455 * If no such action exists, returns %NULL.
8457 * Returns: (transfer none): a #GAction, or %NULL
8463 * g_action_map_remove_action:
8464 * @action_map: a #GActionMap
8465 * @action_name: the name of the action
8467 * Removes the named action from the action map.
8469 * If no action of this name is in the map then nothing happens.
8476 * g_app_info_add_supports_type:
8477 * @appinfo: a #GAppInfo.
8478 * @content_type: a string.
8479 * @error: a #GError.
8481 * Adds a content type to the application information to indicate the
8482 * application is capable of opening files with the given content type.
8484 * Returns: %TRUE on success, %FALSE on error.
8489 * g_app_info_can_delete:
8490 * @appinfo: a #GAppInfo
8492 * Obtains the information whether the #GAppInfo can be deleted.
8493 * See g_app_info_delete().
8495 * Returns: %TRUE if @appinfo can be deleted
8501 * g_app_info_can_remove_supports_type:
8502 * @appinfo: a #GAppInfo.
8504 * Checks if a supported content type can be removed from an application.
8506 * Returns: %TRUE if it is possible to remove supported content types from a given @appinfo, %FALSE if not.
8511 * g_app_info_create_from_commandline:
8512 * @commandline: the commandline to use
8513 * @application_name: (allow-none): the application name, or %NULL to use @commandline
8514 * @flags: flags that can specify details of the created #GAppInfo
8515 * @error: a #GError location to store the error occurring, %NULL to ignore.
8517 * Creates a new #GAppInfo from the given information.
8519 * Note that for @commandline, the quoting rules of the Exec key of the
8520 * <ulink url="http://freedesktop.org/Standards/desktop-entry-spec">freedesktop.org Desktop
8521 * Entry Specification</ulink> are applied. For example, if the @commandline contains
8522 * percent-encoded URIs, the percent-character must be doubled in order to prevent it from
8523 * being swallowed by Exec key unquoting. See the specification for exact quoting rules.
8525 * Returns: (transfer full): new #GAppInfo for given command.
8530 * g_app_info_delete:
8531 * @appinfo: a #GAppInfo
8533 * Tries to delete a #GAppInfo.
8535 * On some platforms, there may be a difference between user-defined
8536 * #GAppInfo<!-- -->s which can be deleted, and system-wide ones which
8537 * cannot. See g_app_info_can_delete().
8539 * Virtual: do_delete
8540 * Returns: %TRUE if @appinfo has been deleted
8547 * @appinfo: a #GAppInfo.
8549 * Creates a duplicate of a #GAppInfo.
8551 * Returns: (transfer full): a duplicate of @appinfo.
8557 * @appinfo1: the first #GAppInfo.
8558 * @appinfo2: the second #GAppInfo.
8560 * Checks if two #GAppInfo<!-- -->s are equal.
8562 * Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
8567 * g_app_info_get_all:
8569 * Gets a list of all of the applications currently registered
8572 * For desktop files, this includes applications that have
8573 * <literal>NoDisplay=true</literal> set or are excluded from
8574 * display by means of <literal>OnlyShowIn</literal> or
8575 * <literal>NotShowIn</literal>. See g_app_info_should_show().
8576 * The returned list does not include applications which have
8577 * the <literal>Hidden</literal> key set.
8579 * Returns: (element-type GAppInfo) (transfer full): a newly allocated #GList of references to #GAppInfo<!---->s.
8584 * g_app_info_get_all_for_type:
8585 * @content_type: the content type to find a #GAppInfo for
8587 * Gets a list of all #GAppInfos for a given content type,
8588 * including the recommended and fallback #GAppInfos. See
8589 * g_app_info_get_recommended_for_type() and
8590 * g_app_info_get_fallback_for_type().
8592 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
8597 * g_app_info_get_commandline:
8598 * @appinfo: a #GAppInfo
8600 * Gets the commandline with which the application will be
8603 * Returns: a string containing the @appinfo's commandline, or %NULL if this information is not available
8609 * g_app_info_get_default_for_type:
8610 * @content_type: the content type to find a #GAppInfo for
8611 * @must_support_uris: if %TRUE, the #GAppInfo is expected to support URIs
8613 * Gets the default #GAppInfo for a given content type.
8615 * Returns: (transfer full): #GAppInfo for given @content_type or %NULL on error.
8620 * g_app_info_get_default_for_uri_scheme:
8621 * @uri_scheme: a string containing a URI scheme.
8623 * Gets the default application for handling URIs with
8624 * the given URI scheme. A URI scheme is the initial part
8625 * of the URI, up to but not including the ':', e.g. "http",
8628 * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
8633 * g_app_info_get_description:
8634 * @appinfo: a #GAppInfo.
8636 * Gets a human-readable description of an installed application.
8638 * Returns: a string containing a description of the application @appinfo, or %NULL if none.
8643 * g_app_info_get_display_name:
8644 * @appinfo: a #GAppInfo.
8646 * Gets the display name of the application. The display name is often more
8647 * descriptive to the user than the name itself.
8649 * Returns: the display name of the application for @appinfo, or the name if no display name is available.
8655 * g_app_info_get_executable:
8656 * @appinfo: a #GAppInfo
8658 * Gets the executable's name for the installed application.
8660 * Returns: a string containing the @appinfo's application binaries name
8665 * g_app_info_get_fallback_for_type:
8666 * @content_type: the content type to find a #GAppInfo for
8668 * Gets a list of fallback #GAppInfos for a given content type, i.e.
8669 * those applications which claim to support the given content type
8670 * by MIME type subclassing and not directly.
8672 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
8678 * g_app_info_get_icon:
8679 * @appinfo: a #GAppInfo.
8681 * Gets the icon for the application.
8683 * Returns: (transfer none): the default #GIcon for @appinfo or %NULL if there is no default icon.
8688 * g_app_info_get_id:
8689 * @appinfo: a #GAppInfo.
8691 * Gets the ID of an application. An id is a string that
8692 * identifies the application. The exact format of the id is
8693 * platform dependent. For instance, on Unix this is the
8694 * desktop file id from the xdg menu specification.
8696 * Note that the returned ID may be %NULL, depending on how
8697 * the @appinfo has been constructed.
8699 * Returns: a string containing the application's ID.
8704 * g_app_info_get_name:
8705 * @appinfo: a #GAppInfo.
8707 * Gets the installed name of the application.
8709 * Returns: the name of the application for @appinfo.
8714 * g_app_info_get_recommended_for_type:
8715 * @content_type: the content type to find a #GAppInfo for
8717 * Gets a list of recommended #GAppInfos for a given content type, i.e.
8718 * those applications which claim to support the given content type exactly,
8719 * and not by MIME type subclassing.
8720 * Note that the first application of the list is the last used one, i.e.
8721 * the last one for which g_app_info_set_as_last_used_for_type() has been
8724 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
8730 * g_app_info_get_supported_types:
8731 * @appinfo: a #GAppInfo that can handle files
8733 * Retrieves the list of content types that @app_info claims to support.
8734 * If this information is not provided by the environment, this function
8735 * will return %NULL.
8736 * This function does not take in consideration associations added with
8737 * g_app_info_add_supports_type(), but only those exported directly by
8740 * Returns: (transfer none) (array zero-terminated=1) (element-type utf8): a list of content types.
8746 * g_app_info_launch:
8747 * @appinfo: a #GAppInfo
8748 * @files: (allow-none) (element-type GFile): a #GList of #GFile objects
8749 * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
8752 * Launches the application. Passes @files to the launched application
8753 * as arguments, using the optional @launch_context to get information
8754 * about the details of the launcher (like what screen it is on).
8755 * On error, @error will be set accordingly.
8757 * To launch the application without arguments pass a %NULL @files list.
8759 * Note that even if the launch is successful the application launched
8760 * can fail to start if it runs into problems during startup. There is
8761 * no way to detect this.
8763 * Some URIs can be changed when passed through a GFile (for instance
8764 * unsupported URIs with strange formats like mailto:), so if you have
8765 * a textual URI you want to pass in as argument, consider using
8766 * g_app_info_launch_uris() instead.
8768 * The launched application inherits the environment of the launching
8769 * process, but it can be modified with g_app_launch_context_setenv() and
8770 * g_app_launch_context_unsetenv().
8772 * On UNIX, this function sets the <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>
8773 * environment variable with the path of the launched desktop file and
8774 * <envar>GIO_LAUNCHED_DESKTOP_FILE_PID</envar> to the process
8775 * id of the launched process. This can be used to ignore
8776 * <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>, should it be inherited
8777 * by further processes. The <envar>DISPLAY</envar> and
8778 * <envar>DESKTOP_STARTUP_ID</envar> environment variables are also
8779 * set, based on information provided in @launch_context.
8781 * Returns: %TRUE on successful launch, %FALSE otherwise.
8786 * g_app_info_launch_default_for_uri:
8787 * @uri: the uri to show
8788 * @launch_context: (allow-none): an optional #GAppLaunchContext.
8789 * @error: a #GError.
8791 * Utility function that launches the default application
8792 * registered to handle the specified uri. Synchronous I/O
8793 * is done on the uri to detect the type of the file if
8796 * Returns: %TRUE on success, %FALSE on error.
8801 * g_app_info_launch_uris:
8802 * @appinfo: a #GAppInfo
8803 * @uris: (allow-none) (element-type utf8): a #GList containing URIs to launch.
8804 * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
8807 * Launches the application. This passes the @uris to the launched application
8808 * as arguments, using the optional @launch_context to get information
8809 * about the details of the launcher (like what screen it is on).
8810 * On error, @error will be set accordingly.
8812 * To launch the application without arguments pass a %NULL @uris list.
8814 * Note that even if the launch is successful the application launched
8815 * can fail to start if it runs into problems during startup. There is
8816 * no way to detect this.
8818 * Returns: %TRUE on successful launch, %FALSE otherwise.
8823 * g_app_info_remove_supports_type:
8824 * @appinfo: a #GAppInfo.
8825 * @content_type: a string.
8826 * @error: a #GError.
8828 * Removes a supported type from an application, if possible.
8830 * Returns: %TRUE on success, %FALSE on error.
8835 * g_app_info_reset_type_associations:
8836 * @content_type: a content type
8838 * Removes all changes to the type associations done by
8839 * g_app_info_set_as_default_for_type(),
8840 * g_app_info_set_as_default_for_extension(),
8841 * g_app_info_add_supports_type() or
8842 * g_app_info_remove_supports_type().
8849 * g_app_info_set_as_default_for_extension:
8850 * @appinfo: a #GAppInfo.
8851 * @extension: a string containing the file extension (without the dot).
8852 * @error: a #GError.
8854 * Sets the application as the default handler for the given file extension.
8856 * Returns: %TRUE on success, %FALSE on error.
8861 * g_app_info_set_as_default_for_type:
8862 * @appinfo: a #GAppInfo.
8863 * @content_type: the content type.
8864 * @error: a #GError.
8866 * Sets the application as the default handler for a given type.
8868 * Returns: %TRUE on success, %FALSE on error.
8873 * g_app_info_set_as_last_used_for_type:
8874 * @appinfo: a #GAppInfo.
8875 * @content_type: the content type.
8876 * @error: a #GError.
8878 * Sets the application as the last used application for a given type.
8879 * This will make the application appear as first in the list returned
8880 * by g_app_info_get_recommended_for_type(), regardless of the default
8881 * application for that content type.
8883 * Returns: %TRUE on success, %FALSE on error.
8888 * g_app_info_should_show:
8889 * @appinfo: a #GAppInfo.
8891 * Checks if the application info should be shown in menus that
8892 * list available applications.
8894 * Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
8899 * g_app_info_supports_files:
8900 * @appinfo: a #GAppInfo.
8902 * Checks if the application accepts files as arguments.
8904 * Returns: %TRUE if the @appinfo supports files.
8909 * g_app_info_supports_uris:
8910 * @appinfo: a #GAppInfo.
8912 * Checks if the application supports reading files and directories from URIs.
8914 * Returns: %TRUE if the @appinfo supports URIs.
8919 * g_app_launch_context_get_display:
8920 * @context: a #GAppLaunchContext
8921 * @info: a #GAppInfo
8922 * @files: (element-type GFile): a #GList of #GFile objects
8924 * Gets the display string for the @context. This is used to ensure new
8925 * applications are started on the same display as the launching
8926 * application, by setting the <envar>DISPLAY</envar> environment variable.
8928 * Returns: a display string for the display.
8933 * g_app_launch_context_get_environment:
8934 * @context: a #GAppLaunchContext
8936 * Gets the complete environment variable list to be passed to
8937 * the child process when @context is used to launch an application.
8938 * This is a %NULL-terminated array of strings, where each string has
8939 * the form <literal>KEY=VALUE</literal>.
8941 * Returns: (array zero-terminated=1) (transfer full): the child's environment
8947 * g_app_launch_context_get_startup_notify_id:
8948 * @context: a #GAppLaunchContext
8949 * @info: a #GAppInfo
8950 * @files: (element-type GFile): a #GList of of #GFile objects
8952 * Initiates startup notification for the application and returns the
8953 * <envar>DESKTOP_STARTUP_ID</envar> for the launched operation,
8956 * Startup notification IDs are defined in the <ulink
8957 * url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
8958 * FreeDesktop.Org Startup Notifications standard</ulink>.
8960 * Returns: a startup notification ID for the application, or %NULL if not supported.
8965 * g_app_launch_context_launch_failed:
8966 * @context: a #GAppLaunchContext.
8967 * @startup_notify_id: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
8969 * Called when an application has failed to launch, so that it can cancel
8970 * the application startup notification started in g_app_launch_context_get_startup_notify_id().
8975 * g_app_launch_context_new:
8977 * Creates a new application launch context. This is not normally used,
8978 * instead you instantiate a subclass of this, such as #GdkAppLaunchContext.
8980 * Returns: a #GAppLaunchContext.
8985 * g_app_launch_context_setenv:
8986 * @context: a #GAppLaunchContext
8987 * @variable: the environment variable to set
8988 * @value: the value for to set the variable to.
8990 * Arranges for @variable to be set to @value in the child's
8991 * environment when @context is used to launch an application.
8998 * g_app_launch_context_unsetenv:
8999 * @context: a #GAppLaunchContext
9000 * @variable: the environment variable to remove
9002 * Arranges for @variable to be unset in the child's environment
9003 * when @context is used to launch an application.
9010 * g_application_activate:
9011 * @application: a #GApplication
9013 * Activates the application.
9015 * In essence, this results in the #GApplication::activate signal being
9016 * emitted in the primary instance.
9018 * The application must be registered before calling this function.
9025 * g_application_command_line_create_file_for_arg:
9026 * @cmdline: a #GApplicationCommandLine
9027 * @arg: an argument from @cmdline
9029 * Creates a #GFile corresponding to a filename that was given as part
9030 * of the invocation of @cmdline.
9032 * This differs from g_file_new_for_commandline_arg() in that it
9033 * resolves relative pathnames using the current working directory of
9034 * the invoking process rather than the local process.
9036 * Returns: (transfer full): a new #GFile
9042 * g_application_command_line_get_arguments:
9043 * @cmdline: a #GApplicationCommandLine
9044 * @argc: (out) (allow-none): the length of the arguments array, or %NULL
9046 * Gets the list of arguments that was passed on the command line.
9048 * The strings in the array may contain non-utf8 data.
9050 * The return value is %NULL-terminated and should be freed using
9053 * Returns: (array length=argc) (transfer full): the string array containing the arguments (the argv)
9059 * g_application_command_line_get_cwd:
9060 * @cmdline: a #GApplicationCommandLine
9062 * Gets the working directory of the command line invocation.
9063 * The string may contain non-utf8 data.
9065 * It is possible that the remote application did not send a working
9066 * directory, so this may be %NULL.
9068 * The return value should not be modified or freed and is valid for as
9069 * long as @cmdline exists.
9071 * Returns: the current directory, or %NULL
9077 * g_application_command_line_get_environ:
9078 * @cmdline: a #GApplicationCommandLine
9080 * Gets the contents of the 'environ' variable of the command line
9081 * invocation, as would be returned by g_get_environ(), ie as a
9082 * %NULL-terminated list of strings in the form 'NAME=VALUE'.
9083 * The strings may contain non-utf8 data.
9085 * The remote application usually does not send an environment. Use
9086 * %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
9087 * set it is possible that the environment is still not available (due
9088 * to invocation messages from other applications).
9090 * The return value should not be modified or freed and is valid for as
9091 * long as @cmdline exists.
9093 * See g_application_command_line_getenv() if you are only interested
9094 * in the value of a single environment variable.
9096 * Returns: (array zero-terminated=1) (transfer none): the environment strings, or %NULL if they were not sent
9102 * g_application_command_line_get_exit_status:
9103 * @cmdline: a #GApplicationCommandLine
9105 * Gets the exit status of @cmdline. See
9106 * g_application_command_line_set_exit_status() for more information.
9108 * Returns: the exit status
9114 * g_application_command_line_get_is_remote:
9115 * @cmdline: a #GApplicationCommandLine
9117 * Determines if @cmdline represents a remote invocation.
9119 * Returns: %TRUE if the invocation was remote
9125 * g_application_command_line_get_platform_data:
9126 * @cmdline: #GApplicationCommandLine
9128 * Gets the platform data associated with the invocation of @cmdline.
9130 * This is a #GVariant dictionary containing information about the
9131 * context in which the invocation occurred. It typically contains
9132 * information like the current working directory and the startup
9135 * For local invocation, it will be %NULL.
9137 * Returns: (allow-none): the platform data, or %NULL
9143 * g_application_command_line_get_stdin:
9144 * @cmdline: a #GApplicationCommandLine
9146 * Gets the stdin of the invoking process.
9148 * The #GInputStream can be used to read data passed to the standard
9149 * input of the invoking process.
9150 * This doesn't work on all platforms. Presently, it is only available
9151 * on UNIX when using a DBus daemon capable of passing file descriptors.
9152 * If stdin is not available then %NULL will be returned. In the
9153 * future, support may be expanded to other platforms.
9155 * You must only call this function once per commandline invocation.
9157 * Returns: (transfer full): a #GInputStream for stdin
9163 * g_application_command_line_getenv:
9164 * @cmdline: a #GApplicationCommandLine
9165 * @name: the environment variable to get
9167 * Gets the value of a particular environment variable of the command
9168 * line invocation, as would be returned by g_getenv(). The strings may
9169 * contain non-utf8 data.
9171 * The remote application usually does not send an environment. Use
9172 * %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
9173 * set it is possible that the environment is still not available (due
9174 * to invocation messages from other applications).
9176 * The return value should not be modified or freed and is valid for as
9177 * long as @cmdline exists.
9179 * Returns: the value of the variable, or %NULL if unset or unsent
9185 * g_application_command_line_print:
9186 * @cmdline: a #GApplicationCommandLine
9187 * @format: a printf-style format string
9188 * @...: arguments, as per @format
9190 * Formats a message and prints it using the stdout print handler in the
9193 * If @cmdline is a local invocation then this is exactly equivalent to
9194 * g_print(). If @cmdline is remote then this is equivalent to calling
9195 * g_print() in the invoking process.
9202 * g_application_command_line_printerr:
9203 * @cmdline: a #GApplicationCommandLine
9204 * @format: a printf-style format string
9205 * @...: arguments, as per @format
9207 * Formats a message and prints it using the stderr print handler in the
9210 * If @cmdline is a local invocation then this is exactly equivalent to
9211 * g_printerr(). If @cmdline is remote then this is equivalent to
9212 * calling g_printerr() in the invoking process.
9219 * g_application_command_line_set_exit_status:
9220 * @cmdline: a #GApplicationCommandLine
9221 * @exit_status: the exit status
9223 * Sets the exit status that will be used when the invoking process
9226 * The return value of the #GApplication::command-line signal is
9227 * passed to this function when the handler returns. This is the usual
9228 * way of setting the exit status.
9230 * In the event that you want the remote invocation to continue running
9231 * and want to decide on the exit status in the future, you can use this
9232 * call. For the case of a remote invocation, the remote process will
9233 * typically exit when the last reference is dropped on @cmdline. The
9234 * exit status of the remote process will be equal to the last value
9235 * that was set with this function.
9237 * In the case that the commandline invocation is local, the situation
9238 * is slightly more complicated. If the commandline invocation results
9239 * in the mainloop running (ie: because the use-count of the application
9240 * increased to a non-zero value) then the application is considered to
9241 * have been 'successful' in a certain sense, and the exit status is
9242 * always zero. If the application use count is zero, though, the exit
9243 * status of the local #GApplicationCommandLine is used.
9250 * g_application_get_application_id:
9251 * @application: a #GApplication
9253 * Gets the unique identifier for @application.
9255 * Returns: the identifier for @application, owned by @application
9261 * g_application_get_dbus_connection:
9262 * @application: a #GApplication
9264 * Gets the #GDBusConnection being used by the application, or %NULL.
9266 * If #GApplication is using its D-Bus backend then this function will
9267 * return the #GDBusConnection being used for uniqueness and
9268 * communication with the desktop environment and other instances of the
9271 * If #GApplication is not using D-Bus then this function will return
9272 * %NULL. This includes the situation where the D-Bus backend would
9273 * normally be in use but we were unable to connect to the bus.
9275 * This function must not be called before the application has been
9276 * registered. See g_application_get_is_registered().
9278 * Returns: (transfer none): a #GDBusConnection, or %NULL
9284 * g_application_get_dbus_object_path:
9285 * @application: a #GApplication
9287 * Gets the D-Bus object path being used by the application, or %NULL.
9289 * If #GApplication is using its D-Bus backend then this function will
9290 * return the D-Bus object path that #GApplication is using. If the
9291 * application is the primary instance then there is an object published
9292 * at this path. If the application is not the primary instance then
9293 * the result of this function is undefined.
9295 * If #GApplication is not using D-Bus then this function will return
9296 * %NULL. This includes the situation where the D-Bus backend would
9297 * normally be in use but we were unable to connect to the bus.
9299 * This function must not be called before the application has been
9300 * registered. See g_application_get_is_registered().
9302 * Returns: the object path, or %NULL
9308 * g_application_get_default:
9310 * Returns the default #GApplication instance for this process.
9312 * Normally there is only one #GApplication per process and it becomes
9313 * the default when it is created. You can exercise more control over
9314 * this by using g_application_set_default().
9316 * If there is no default application then %NULL is returned.
9318 * Returns: (transfer none): the default application for this process, or %NULL
9324 * g_application_get_flags:
9325 * @application: a #GApplication
9327 * Gets the flags for @application.
9329 * See #GApplicationFlags.
9331 * Returns: the flags for @application
9337 * g_application_get_inactivity_timeout:
9338 * @application: a #GApplication
9340 * Gets the current inactivity timeout for the application.
9342 * This is the amount of time (in milliseconds) after the last call to
9343 * g_application_release() before the application stops running.
9345 * Returns: the timeout, in milliseconds
9351 * g_application_get_is_registered:
9352 * @application: a #GApplication
9354 * Checks if @application is registered.
9356 * An application is registered if g_application_register() has been
9357 * successfully called.
9359 * Returns: %TRUE if @application is registered
9365 * g_application_get_is_remote:
9366 * @application: a #GApplication
9368 * Checks if @application is remote.
9370 * If @application is remote then it means that another instance of
9371 * application already exists (the 'primary' instance). Calls to
9372 * perform actions on @application will result in the actions being
9373 * performed by the primary instance.
9375 * The value of this property cannot be accessed before
9376 * g_application_register() has been called. See
9377 * g_application_get_is_registered().
9379 * Returns: %TRUE if @application is remote
9385 * g_application_hold:
9386 * @application: a #GApplication
9388 * Increases the use count of @application.
9390 * Use this function to indicate that the application has a reason to
9391 * continue to run. For example, g_application_hold() is called by GTK+
9392 * when a toplevel window is on the screen.
9394 * To cancel the hold, call g_application_release().
9399 * g_application_id_is_valid:
9400 * @application_id: a potential application identifier
9402 * Checks if @application_id is a valid application identifier.
9404 * A valid ID is required for calls to g_application_new() and
9405 * g_application_set_application_id().
9407 * For convenience, the restrictions on application identifiers are
9410 * <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-." and must not begin with a digit.</listitem>
9411 * <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least three elements).</listitem>
9412 * <listitem>Application identifiers must not begin or end with a '.' (period) character.</listitem>
9413 * <listitem>Application identifiers must not contain consecutive '.' (period) characters.</listitem>
9414 * <listitem>Application identifiers must not exceed 255 characters.</listitem>
9417 * Returns: %TRUE if @application_id is valid
9422 * g_application_new:
9423 * @application_id: (allow-none): the application id
9424 * @flags: the application flags
9426 * Creates a new #GApplication instance.
9428 * If non-%NULL, the application id must be valid. See
9429 * g_application_id_is_valid().
9431 * If no application ID is given then some features of #GApplication
9432 * (most notably application uniqueness) will be disabled.
9434 * Returns: a new #GApplication instance
9439 * g_application_open:
9440 * @application: a #GApplication
9441 * @files: (array length=n_files): an array of #GFiles to open
9442 * @n_files: the length of the @files array
9443 * @hint: a hint (or ""), but never %NULL
9445 * Opens the given files.
9447 * In essence, this results in the #GApplication::open signal being emitted
9448 * in the primary instance.
9450 * @n_files must be greater than zero.
9452 * @hint is simply passed through to the ::open signal. It is
9453 * intended to be used by applications that have multiple modes for
9454 * opening files (eg: "view" vs "edit", etc). Unless you have a need
9455 * for this functionality, you should use "".
9457 * The application must be registered before calling this function
9458 * and it must have the %G_APPLICATION_HANDLES_OPEN flag set.
9465 * g_application_quit:
9466 * @application: a #GApplication
9468 * Immediately quits the application.
9470 * Upon return to the mainloop, g_application_run() will return,
9471 * calling only the 'shutdown' function before doing so.
9473 * The hold count is ignored.
9475 * The result of calling g_application_run() again after it returns is
9483 * g_application_register:
9484 * @application: a #GApplication
9485 * @cancellable: (allow-none): a #GCancellable, or %NULL
9486 * @error: a pointer to a NULL #GError, or %NULL
9488 * Attempts registration of the application.
9490 * This is the point at which the application discovers if it is the
9491 * primary instance or merely acting as a remote for an already-existing
9492 * primary instance. This is implemented by attempting to acquire the
9493 * application identifier as a unique bus name on the session bus using
9496 * If there is no application ID or if %G_APPLICATION_NON_UNIQUE was
9497 * given, then this process will always become the primary instance.
9499 * Due to the internal architecture of GDBus, method calls can be
9500 * dispatched at any time (even if a main loop is not running). For
9501 * this reason, you must ensure that any object paths that you wish to
9502 * register are registered before calling this function.
9504 * If the application has already been registered then %TRUE is
9505 * returned with no work performed.
9507 * The #GApplication::startup signal is emitted if registration succeeds
9508 * and @application is the primary instance (including the non-unique
9511 * In the event of an error (such as @cancellable being cancelled, or a
9512 * failure to connect to the session bus), %FALSE is returned and @error
9513 * is set appropriately.
9515 * Note: the return value of this function is not an indicator that this
9516 * instance is or is not the primary instance of the application. See
9517 * g_application_get_is_remote() for that.
9519 * Returns: %TRUE if registration succeeded
9525 * g_application_release:
9526 * @application: a #GApplication
9528 * Decrease the use count of @application.
9530 * When the use count reaches zero, the application will stop running.
9532 * Never call this function except to cancel the effect of a previous
9533 * call to g_application_hold().
9538 * g_application_run:
9539 * @application: a #GApplication
9540 * @argc: the argc from main() (or 0 if @argv is %NULL)
9541 * @argv: (array length=argc) (allow-none): the argv from main(), or %NULL
9543 * Runs the application.
9545 * This function is intended to be run from main() and its return value
9546 * is intended to be returned by main(). Although you are expected to pass
9547 * the @argc, @argv parameters from main() to this function, it is possible
9548 * to pass %NULL if @argv is not available or commandline handling is not
9551 * First, the local_command_line() virtual function is invoked.
9552 * This function always runs on the local instance. It gets passed a pointer
9553 * to a %NULL-terminated copy of @argv and is expected to remove the arguments
9554 * that it handled (shifting up remaining arguments). See
9555 * <xref linkend="gapplication-example-cmdline2"/> for an example of
9556 * parsing @argv manually. Alternatively, you may use the #GOptionContext API,
9557 * after setting <literal>argc = g_strv_length (argv);</literal>.
9559 * The last argument to local_command_line() is a pointer to the @status
9560 * variable which can used to set the exit status that is returned from
9561 * g_application_run().
9563 * If local_command_line() returns %TRUE, the command line is expected
9564 * to be completely handled, including possibly registering as the primary
9565 * instance, calling g_application_activate() or g_application_open(), etc.
9567 * If local_command_line() returns %FALSE then the application is registered
9568 * and the #GApplication::command-line signal is emitted in the primary
9569 * instance (which may or may not be this instance). The signal handler
9570 * gets passed a #GApplicationCommandLine object that (among other things)
9571 * contains the remaining commandline arguments that have not been handled
9572 * by local_command_line().
9574 * If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE
9575 * flag set then the default implementation of local_command_line()
9576 * always returns %FALSE immediately, resulting in the commandline
9577 * always being handled in the primary instance.
9579 * Otherwise, the default implementation of local_command_line() tries
9580 * to do a couple of things that are probably reasonable for most
9581 * applications. First, g_application_register() is called to attempt
9582 * to register the application. If that works, then the command line
9583 * arguments are inspected. If no commandline arguments are given, then
9584 * g_application_activate() is called. If commandline arguments are
9585 * given and the %G_APPLICATION_HANDLES_OPEN flag is set then they
9586 * are assumed to be filenames and g_application_open() is called.
9588 * If you need to handle commandline arguments that are not filenames,
9589 * and you don't mind commandline handling to happen in the primary
9590 * instance, you should set %G_APPLICATION_HANDLES_COMMAND_LINE and
9591 * process the commandline arguments in your #GApplication::command-line
9592 * signal handler, either manually or using the #GOptionContext API.
9594 * If you are interested in doing more complicated local handling of the
9595 * commandline then you should implement your own #GApplication subclass
9596 * and override local_command_line(). In this case, you most likely want
9597 * to return %TRUE from your local_command_line() implementation to
9598 * suppress the default handling. See
9599 * <xref linkend="gapplication-example-cmdline2"/> for an example.
9601 * If, after the above is done, the use count of the application is zero
9602 * then the exit status is returned immediately. If the use count is
9603 * non-zero then the default main context is iterated until the use count
9604 * falls to zero, at which point 0 is returned.
9606 * If the %G_APPLICATION_IS_SERVICE flag is set, then the service will
9607 * run for as much as 10 seconds with a use count of zero while waiting
9608 * for the message that caused the activation to arrive. After that,
9609 * if the use count falls to zero the application will exit immediately,
9610 * except in the case that g_application_set_inactivity_timeout() is in
9613 * Returns: the exit status
9619 * g_application_set_action_group:
9620 * @application: a #GApplication
9621 * @action_group: (allow-none): a #GActionGroup, or %NULL
9623 * This used to be how actions were associated with a #GApplication.
9624 * Now there is #GActionMap for that.
9627 * 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.
9632 * g_application_set_application_id:
9633 * @application: a #GApplication
9634 * @application_id: (allow-none): the identifier for @application
9636 * Sets the unique identifier for @application.
9638 * The application id can only be modified if @application has not yet
9641 * If non-%NULL, the application id must be valid. See
9642 * g_application_id_is_valid().
9649 * g_application_set_default:
9650 * @application: (allow-none): the application to set as default, or %NULL
9652 * Sets or unsets the default application for the process, as returned
9653 * by g_application_get_default().
9655 * This function does not take its own reference on @application. If
9656 * @application is destroyed then the default application will revert
9664 * g_application_set_flags:
9665 * @application: a #GApplication
9666 * @flags: the flags for @application
9668 * Sets the flags for @application.
9670 * The flags can only be modified if @application has not yet been
9673 * See #GApplicationFlags.
9680 * g_application_set_inactivity_timeout:
9681 * @application: a #GApplication
9682 * @inactivity_timeout: the timeout, in milliseconds
9684 * Sets the current inactivity timeout for the application.
9686 * This is the amount of time (in milliseconds) after the last call to
9687 * g_application_release() before the application stops running.
9689 * This call has no side effects of its own. The value set here is only
9690 * used for next time g_application_release() drops the use count to
9691 * zero. Any timeouts currently in progress are not impacted.
9698 * g_async_initable_init_async:
9699 * @initable: a #GAsyncInitable.
9700 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
9701 * @cancellable: optional #GCancellable object, %NULL to ignore.
9702 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
9703 * @user_data: the data to pass to callback function
9705 * Starts asynchronous initialization of the object implementing the
9706 * interface. This must be done before any real use of the object after
9707 * initial construction. If the object also implements #GInitable you can
9708 * optionally call g_initable_init() instead.
9710 * When the initialization is finished, @callback will be called. You can
9711 * then call g_async_initable_init_finish() to get the result of the
9714 * Implementations may also support cancellation. If @cancellable is not
9715 * %NULL, then initialization can be cancelled by triggering the cancellable
9716 * object from another thread. If the operation was cancelled, the error
9717 * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
9718 * the object doesn't support cancellable initialization, the error
9719 * %G_IO_ERROR_NOT_SUPPORTED will be returned.
9721 * As with #GInitable, if the object is not initialized, or initialization
9722 * returns with an error, then all operations on the object except
9723 * g_object_ref() and g_object_unref() are considered to be invalid, and
9724 * have undefined behaviour. They will often fail with g_critical() or
9725 * g_warning(), but this must not be relied on.
9727 * Implementations of this method must be idempotent: i.e. multiple calls
9728 * to this function with the same argument should return the same results.
9729 * Only the first call initializes the object; further calls return the result
9730 * of the first call. This is so that it's safe to implement the singleton
9731 * pattern in the GObject constructor function.
9733 * For classes that also support the #GInitable interface, the default
9734 * implementation of this method will run the g_initable_init() function
9735 * in a thread, so if you want to support asynchronous initialization via
9736 * threads, just implement the #GAsyncInitable interface without overriding
9737 * any interface methods.
9744 * g_async_initable_init_finish:
9745 * @initable: a #GAsyncInitable.
9746 * @res: a #GAsyncResult.
9747 * @error: a #GError location to store the error occurring, or %NULL to ignore.
9749 * Finishes asynchronous initialization and returns the result.
9750 * See g_async_initable_init_async().
9752 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
9758 * g_async_initable_new_async:
9759 * @object_type: a #GType supporting #GAsyncInitable.
9760 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
9761 * @cancellable: optional #GCancellable object, %NULL to ignore.
9762 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
9763 * @user_data: the data to pass to callback function
9764 * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
9765 * @...: the value of the first property, followed by other property value pairs, and ended by %NULL.
9767 * Helper function for constructing #GAsyncInitable object. This is
9768 * similar to g_object_new() but also initializes the object asynchronously.
9770 * When the initialization is finished, @callback will be called. You can
9771 * then call g_async_initable_new_finish() to get the new object and check
9779 * g_async_initable_new_finish:
9780 * @initable: the #GAsyncInitable from the callback
9781 * @res: the #GAsyncResult from the callback
9782 * @error: return location for errors, or %NULL to ignore
9784 * Finishes the async construction for the various g_async_initable_new
9785 * calls, returning the created object or %NULL on error.
9787 * Returns: (type GObject.Object) (transfer full): a newly created #GObject, or %NULL on error. Free with g_object_unref().
9793 * g_async_initable_new_valist_async:
9794 * @object_type: a #GType supporting #GAsyncInitable.
9795 * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
9796 * @var_args: The var args list generated from @first_property_name.
9797 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
9798 * @cancellable: optional #GCancellable object, %NULL to ignore.
9799 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
9800 * @user_data: the data to pass to callback function
9802 * Helper function for constructing #GAsyncInitable object. This is
9803 * similar to g_object_new_valist() but also initializes the object
9806 * When the initialization is finished, @callback will be called. You can
9807 * then call g_async_initable_new_finish() to get the new object and check
9815 * g_async_initable_newv_async:
9816 * @object_type: a #GType supporting #GAsyncInitable.
9817 * @n_parameters: the number of parameters in @parameters
9818 * @parameters: the parameters to use to construct the object
9819 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
9820 * @cancellable: optional #GCancellable object, %NULL to ignore.
9821 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
9822 * @user_data: the data to pass to callback function
9824 * Helper function for constructing #GAsyncInitable object. This is
9825 * similar to g_object_newv() but also initializes the object asynchronously.
9827 * When the initialization is finished, @callback will be called. You can
9828 * then call g_async_initable_new_finish() to get the new object and check
9836 * g_async_result_get_source_object:
9837 * @res: a #GAsyncResult
9839 * Gets the source object from a #GAsyncResult.
9841 * Returns: (transfer full): a new reference to the source object for the @res, or %NULL if there is none.
9846 * g_async_result_get_user_data:
9847 * @res: a #GAsyncResult.
9849 * Gets the user data from a #GAsyncResult.
9851 * Returns: (transfer full): the user data for @res.
9856 * g_async_result_is_tagged:
9857 * @res: a #GAsyncResult
9858 * @source_tag: an application-defined tag
9860 * Checks if @res has the given @source_tag (generally a function
9861 * pointer indicating the function @res was created by).
9863 * Returns: %TRUE if @res has the indicated @source_tag, %FALSE if not.
9869 * g_async_result_legacy_propagate_error:
9870 * @res: a #GAsyncResult
9871 * @error: (out): a location to propagate the error to.
9873 * If @res is a #GSimpleAsyncResult, this is equivalent to
9874 * g_simple_async_result_propagate_error(). Otherwise it returns
9877 * This can be used for legacy error handling in async
9878 * <literal>_finish ()</literal> wrapper functions that traditionally
9879 * handled #GSimpleAsyncResult error returns themselves rather than
9880 * calling into the virtual method. This should not be used in new
9881 * code; #GAsyncResult errors that are set by virtual methods should
9882 * also be extracted by virtual methods, to enable subclasses to chain
9885 * Returns: %TRUE if @error is has been filled in with an error from @res, %FALSE if not.
9891 * g_buffered_input_stream_fill:
9892 * @stream: a #GBufferedInputStream
9893 * @count: the number of bytes that will be read from the stream
9894 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
9895 * @error: location to store the error occurring, or %NULL to ignore
9897 * Tries to read @count bytes from the stream into the buffer.
9898 * Will block during this read.
9900 * If @count is zero, returns zero and does nothing. A value of @count
9901 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
9903 * On success, the number of bytes read into the buffer is returned.
9904 * It is not an error if this is not the same as the requested size, as it
9905 * can happen e.g. near the end of a file. Zero is returned on end of file
9906 * (or if @count is zero), but never otherwise.
9908 * If @count is -1 then the attempted read size is equal to the number of
9909 * bytes that are required to fill the buffer.
9911 * If @cancellable is not %NULL, then the operation can be cancelled by
9912 * triggering the cancellable object from another thread. If the operation
9913 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
9914 * operation was partially finished when the operation was cancelled the
9915 * partial result will be returned, without an error.
9917 * On error -1 is returned and @error is set accordingly.
9919 * For the asynchronous, non-blocking, version of this function, see
9920 * g_buffered_input_stream_fill_async().
9922 * Returns: the number of bytes read into @stream's buffer, up to @count, or -1 on error.
9927 * g_buffered_input_stream_fill_async:
9928 * @stream: a #GBufferedInputStream
9929 * @count: the number of bytes that will be read from the stream
9930 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
9931 * @cancellable: (allow-none): optional #GCancellable object
9932 * @callback: (scope async): a #GAsyncReadyCallback
9933 * @user_data: (closure): a #gpointer
9935 * Reads data into @stream's buffer asynchronously, up to @count size.
9936 * @io_priority can be used to prioritize reads. For the synchronous
9937 * version of this function, see g_buffered_input_stream_fill().
9939 * If @count is -1 then the attempted read size is equal to the number
9940 * of bytes that are required to fill the buffer.
9945 * g_buffered_input_stream_fill_finish:
9946 * @stream: a #GBufferedInputStream
9947 * @result: a #GAsyncResult
9950 * Finishes an asynchronous read.
9952 * Returns: a #gssize of the read stream, or %-1 on an error.
9957 * g_buffered_input_stream_get_available:
9958 * @stream: #GBufferedInputStream
9960 * Gets the size of the available data within the stream.
9962 * Returns: size of the available stream.
9967 * g_buffered_input_stream_get_buffer_size:
9968 * @stream: a #GBufferedInputStream
9970 * Gets the size of the input buffer.
9972 * Returns: the current buffer size.
9977 * g_buffered_input_stream_new:
9978 * @base_stream: a #GInputStream
9980 * Creates a new #GInputStream from the given @base_stream, with
9981 * a buffer set to the default size (4 kilobytes).
9983 * Returns: a #GInputStream for the given @base_stream.
9988 * g_buffered_input_stream_new_sized:
9989 * @base_stream: a #GInputStream
9992 * Creates a new #GBufferedInputStream from the given @base_stream,
9993 * with a buffer set to @size.
9995 * Returns: a #GInputStream.
10000 * g_buffered_input_stream_peek:
10001 * @stream: a #GBufferedInputStream
10002 * @buffer: (array length=count) (element-type guint8): a pointer to an allocated chunk of memory
10003 * @offset: a #gsize
10006 * Peeks in the buffer, copying data of size @count into @buffer,
10007 * offset @offset bytes.
10009 * Returns: a #gsize of the number of bytes peeked, or -1 on error.
10014 * g_buffered_input_stream_peek_buffer:
10015 * @stream: a #GBufferedInputStream
10016 * @count: (out): a #gsize to get the number of bytes available in the buffer
10018 * Returns the buffer with the currently available bytes. The returned
10019 * buffer must not be modified and will become invalid when reading from
10020 * the stream or filling the buffer.
10022 * Returns: (array length=count) (element-type guint8) (transfer none): read-only buffer
10027 * g_buffered_input_stream_read_byte:
10028 * @stream: a #GBufferedInputStream
10029 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10030 * @error: location to store the error occurring, or %NULL to ignore
10032 * Tries to read a single byte from the stream or the buffer. Will block
10033 * during this read.
10035 * On success, the byte read from the stream is returned. On end of stream
10036 * -1 is returned but it's not an exceptional error and @error is not set.
10038 * If @cancellable is not %NULL, then the operation can be cancelled by
10039 * triggering the cancellable object from another thread. If the operation
10040 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
10041 * operation was partially finished when the operation was cancelled the
10042 * partial result will be returned, without an error.
10044 * On error -1 is returned and @error is set accordingly.
10046 * Returns: the byte read from the @stream, or -1 on end of stream or error.
10051 * g_buffered_input_stream_set_buffer_size:
10052 * @stream: a #GBufferedInputStream
10055 * Sets the size of the internal buffer of @stream to @size, or to the
10056 * size of the contents of the buffer. The buffer can never be resized
10057 * smaller than its current contents.
10062 * g_buffered_output_stream_get_auto_grow:
10063 * @stream: a #GBufferedOutputStream.
10065 * Checks if the buffer automatically grows as data is added.
10067 * Returns: %TRUE if the @stream's buffer automatically grows, %FALSE otherwise.
10072 * g_buffered_output_stream_get_buffer_size:
10073 * @stream: a #GBufferedOutputStream.
10075 * Gets the size of the buffer in the @stream.
10077 * Returns: the current size of the buffer.
10082 * g_buffered_output_stream_new:
10083 * @base_stream: a #GOutputStream.
10085 * Creates a new buffered output stream for a base stream.
10087 * Returns: a #GOutputStream for the given @base_stream.
10092 * g_buffered_output_stream_new_sized:
10093 * @base_stream: a #GOutputStream.
10096 * Creates a new buffered output stream with a given buffer size.
10098 * Returns: a #GOutputStream with an internal buffer set to @size.
10103 * g_buffered_output_stream_set_auto_grow:
10104 * @stream: a #GBufferedOutputStream.
10105 * @auto_grow: a #gboolean.
10107 * Sets whether or not the @stream's buffer should automatically grow.
10108 * If @auto_grow is true, then each write will just make the buffer
10109 * larger, and you must manually flush the buffer to actually write out
10110 * the data to the underlying stream.
10115 * g_buffered_output_stream_set_buffer_size:
10116 * @stream: a #GBufferedOutputStream.
10119 * Sets the size of the internal buffer to @size.
10125 * @bus_type: A #GBusType.
10126 * @cancellable: (allow-none): A #GCancellable or %NULL.
10127 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
10128 * @user_data: The data to pass to @callback.
10130 * Asynchronously connects to the message bus specified by @bus_type.
10132 * When the operation is finished, @callback will be invoked. You can
10133 * then call g_bus_get_finish() to get the result of the operation.
10135 * This is a asynchronous failable function. See g_bus_get_sync() for
10136 * the synchronous version.
10143 * g_bus_get_finish:
10144 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
10145 * @error: Return location for error or %NULL.
10147 * Finishes an operation started with g_bus_get().
10149 * The returned object is a singleton, that is, shared with other
10150 * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10151 * event that you need a private message bus connection, use
10152 * g_dbus_address_get_for_bus_sync() and
10153 * g_dbus_connection_new_for_address().
10155 * Note that the returned #GDBusConnection object will (usually) have
10156 * the #GDBusConnection:exit-on-close property set to %TRUE.
10158 * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10165 * @bus_type: A #GBusType.
10166 * @cancellable: (allow-none): A #GCancellable or %NULL.
10167 * @error: Return location for error or %NULL.
10169 * Synchronously connects to the message bus specified by @bus_type.
10170 * Note that the returned object may shared with other callers,
10171 * e.g. if two separate parts of a process calls this function with
10172 * the same @bus_type, they will share the same object.
10174 * This is a synchronous failable function. See g_bus_get() and
10175 * g_bus_get_finish() for the asynchronous version.
10177 * The returned object is a singleton, that is, shared with other
10178 * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10179 * event that you need a private message bus connection, use
10180 * g_dbus_address_get_for_bus_sync() and
10181 * g_dbus_connection_new_for_address().
10183 * Note that the returned #GDBusConnection object will (usually) have
10184 * the #GDBusConnection:exit-on-close property set to %TRUE.
10186 * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10193 * @bus_type: The type of bus to own a name on.
10194 * @name: The well-known name to own.
10195 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10196 * @bus_acquired_handler: (allow-none): Handler to invoke when connected to the bus of type @bus_type or %NULL.
10197 * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10198 * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10199 * @user_data: User data to pass to handlers.
10200 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10202 * Starts acquiring @name on the bus specified by @bus_type and calls
10203 * @name_acquired_handler and @name_lost_handler when the name is
10204 * acquired respectively lost. Callbacks will be invoked in the <link
10205 * linkend="g-main-context-push-thread-default">thread-default main
10206 * loop</link> of the thread you are calling this function from.
10208 * You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
10209 * callbacks will be invoked after calling this function - there are three
10213 * @name_lost_handler with a %NULL connection (if a connection to the bus can't be made).
10214 * </para></listitem>
10216 * @bus_acquired_handler then @name_lost_handler (if the name can't be obtained)
10217 * </para></listitem>
10219 * @bus_acquired_handler then @name_acquired_handler (if the name was obtained).
10220 * </para></listitem>
10222 * When you are done owning the name, just call g_bus_unown_name()
10223 * with the owner id this function returns.
10225 * If the name is acquired or lost (for example another application
10226 * could acquire the name if you allow replacement or the application
10227 * currently owning the name exits), the handlers are also invoked. If the
10228 * #GDBusConnection that is used for attempting to own the name
10229 * closes, then @name_lost_handler is invoked since it is no
10230 * longer possible for other processes to access the process.
10232 * You cannot use g_bus_own_name() several times for the same name (unless
10233 * interleaved with calls to g_bus_unown_name()) - only the first call
10236 * Another guarantee is that invocations of @name_acquired_handler
10237 * and @name_lost_handler are guaranteed to alternate; that
10238 * is, if @name_acquired_handler is invoked then you are
10239 * guaranteed that the next time one of the handlers is invoked, it
10240 * will be @name_lost_handler. The reverse is also true.
10242 * If you plan on exporting objects (using e.g.
10243 * g_dbus_connection_register_object()), note that it is generally too late
10244 * to export the objects in @name_acquired_handler. Instead, you can do this
10245 * in @bus_acquired_handler since you are guaranteed that this will run
10246 * before @name is requested from the bus.
10248 * This behavior makes it very simple to write applications that wants
10249 * to own names and export objects, see <xref linkend="gdbus-owning-names"/>.
10250 * Simply register objects to be exported in @bus_acquired_handler and
10251 * unregister the objects (if any) in @name_lost_handler.
10253 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10259 * g_bus_own_name_on_connection:
10260 * @connection: A #GDBusConnection.
10261 * @name: The well-known name to own.
10262 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10263 * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10264 * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10265 * @user_data: User data to pass to handlers.
10266 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10268 * Like g_bus_own_name() but takes a #GDBusConnection instead of a
10271 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10277 * g_bus_own_name_on_connection_with_closures:
10278 * @connection: A #GDBusConnection.
10279 * @name: The well-known name to own.
10280 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10281 * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10282 * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10284 * Version of g_bus_own_name_on_connection() using closures instead of callbacks for
10285 * easier binding in other languages.
10287 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10288 * Rename to: g_bus_own_name_on_connection
10294 * g_bus_own_name_with_closures:
10295 * @bus_type: The type of bus to own a name on.
10296 * @name: The well-known name to own.
10297 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10298 * @bus_acquired_closure: (allow-none): #GClosure to invoke when connected to the bus of type @bus_type or %NULL.
10299 * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10300 * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10302 * Version of g_bus_own_name() using closures instead of callbacks for
10303 * easier binding in other languages.
10305 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10306 * Rename to: g_bus_own_name
10312 * g_bus_unown_name:
10313 * @owner_id: An identifier obtained from g_bus_own_name()
10315 * Stops owning a name.
10322 * g_bus_unwatch_name:
10323 * @watcher_id: An identifier obtained from g_bus_watch_name()
10325 * Stops watching a name.
10332 * g_bus_watch_name:
10333 * @bus_type: The type of bus to watch a name on.
10334 * @name: The name (well-known or unique) to watch.
10335 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10336 * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
10337 * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
10338 * @user_data: User data to pass to handlers.
10339 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10341 * Starts watching @name on the bus specified by @bus_type and calls
10342 * @name_appeared_handler and @name_vanished_handler when the name is
10343 * known to have a owner respectively known to lose its
10344 * owner. Callbacks will be invoked in the <link
10345 * linkend="g-main-context-push-thread-default">thread-default main
10346 * loop</link> of the thread you are calling this function from.
10348 * You are guaranteed that one of the handlers will be invoked after
10349 * calling this function. When you are done watching the name, just
10350 * call g_bus_unwatch_name() with the watcher id this function
10353 * If the name vanishes or appears (for example the application owning
10354 * the name could restart), the handlers are also invoked. If the
10355 * #GDBusConnection that is used for watching the name disconnects, then
10356 * @name_vanished_handler is invoked since it is no longer
10357 * possible to access the name.
10359 * Another guarantee is that invocations of @name_appeared_handler
10360 * and @name_vanished_handler are guaranteed to alternate; that
10361 * is, if @name_appeared_handler is invoked then you are
10362 * guaranteed that the next time one of the handlers is invoked, it
10363 * will be @name_vanished_handler. The reverse is also true.
10365 * This behavior makes it very simple to write applications that wants
10366 * to take action when a certain name exists, see <xref
10367 * linkend="gdbus-watching-names"/>. Basically, the application
10368 * should create object proxies in @name_appeared_handler and destroy
10369 * them again (if any) in @name_vanished_handler.
10371 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10377 * g_bus_watch_name_on_connection:
10378 * @connection: A #GDBusConnection.
10379 * @name: The name (well-known or unique) to watch.
10380 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10381 * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
10382 * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
10383 * @user_data: User data to pass to handlers.
10384 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10386 * Like g_bus_watch_name() but takes a #GDBusConnection instead of a
10389 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10395 * g_bus_watch_name_on_connection_with_closures:
10396 * @connection: A #GDBusConnection.
10397 * @name: The name (well-known or unique) to watch.
10398 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10399 * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
10400 * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
10402 * Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
10403 * easier binding in other languages.
10405 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10406 * Rename to: g_bus_watch_name_on_connection
10412 * g_bus_watch_name_with_closures:
10413 * @bus_type: The type of bus to watch a name on.
10414 * @name: The name (well-known or unique) to watch.
10415 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10416 * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
10417 * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
10419 * Version of g_bus_watch_name() using closures instead of callbacks for
10420 * easier binding in other languages.
10422 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10423 * Rename to: g_bus_watch_name
10429 * g_cancellable_cancel:
10430 * @cancellable: a #GCancellable object.
10432 * Will set @cancellable to cancelled, and will emit the
10433 * #GCancellable::cancelled signal. (However, see the warning about
10434 * race conditions in the documentation for that signal if you are
10435 * planning to connect to it.)
10437 * This function is thread-safe. In other words, you can safely call
10438 * it from a thread other than the one running the operation that was
10439 * passed the @cancellable.
10441 * The convention within gio is that cancelling an asynchronous
10442 * operation causes it to complete asynchronously. That is, if you
10443 * cancel the operation from the same thread in which it is running,
10444 * then the operation's #GAsyncReadyCallback will not be invoked until
10445 * the application returns to the main loop.
10450 * g_cancellable_connect:
10451 * @cancellable: A #GCancellable.
10452 * @callback: The #GCallback to connect.
10453 * @data: Data to pass to @callback.
10454 * @data_destroy_func: (allow-none): Free function for @data or %NULL.
10456 * Convenience function to connect to the #GCancellable::cancelled
10457 * signal. Also handles the race condition that may happen
10458 * if the cancellable is cancelled right before connecting.
10460 * @callback is called at most once, either directly at the
10461 * time of the connect if @cancellable is already cancelled,
10462 * or when @cancellable is cancelled in some thread.
10464 * @data_destroy_func will be called when the handler is
10465 * disconnected, or immediately if the cancellable is already
10468 * See #GCancellable::cancelled for details on how to use this.
10470 * Returns: The id of the signal handler or 0 if @cancellable has already been cancelled.
10476 * g_cancellable_disconnect:
10477 * @cancellable: (allow-none): A #GCancellable or %NULL.
10478 * @handler_id: Handler id of the handler to be disconnected, or %0.
10480 * Disconnects a handler from a cancellable instance similar to
10481 * g_signal_handler_disconnect(). Additionally, in the event that a
10482 * signal handler is currently running, this call will block until the
10483 * handler has finished. Calling this function from a
10484 * #GCancellable::cancelled signal handler will therefore result in a
10487 * This avoids a race condition where a thread cancels at the
10488 * same time as the cancellable operation is finished and the
10489 * signal handler is removed. See #GCancellable::cancelled for
10490 * details on how to use this.
10492 * If @cancellable is %NULL or @handler_id is %0 this function does
10500 * g_cancellable_get_current:
10502 * Gets the top cancellable from the stack.
10504 * Returns: (transfer none): a #GCancellable from the top of the stack, or %NULL if the stack is empty.
10509 * g_cancellable_get_fd:
10510 * @cancellable: a #GCancellable.
10512 * Gets the file descriptor for a cancellable job. This can be used to
10513 * implement cancellable operations on Unix systems. The returned fd will
10514 * turn readable when @cancellable is cancelled.
10516 * You are not supposed to read from the fd yourself, just check for
10517 * readable status. Reading to unset the readable status is done
10518 * with g_cancellable_reset().
10520 * After a successful return from this function, you should use
10521 * g_cancellable_release_fd() to free up resources allocated for
10522 * the returned file descriptor.
10524 * See also g_cancellable_make_pollfd().
10526 * Returns: A valid file descriptor. %-1 if the file descriptor is not supported, or on errors.
10531 * g_cancellable_is_cancelled:
10532 * @cancellable: (allow-none): a #GCancellable or %NULL
10534 * Checks if a cancellable job has been cancelled.
10536 * Returns: %TRUE if @cancellable is cancelled, FALSE if called with %NULL or if item is not cancelled.
10541 * g_cancellable_make_pollfd:
10542 * @cancellable: (allow-none): a #GCancellable or %NULL
10543 * @pollfd: a pointer to a #GPollFD
10545 * Creates a #GPollFD corresponding to @cancellable; this can be passed
10546 * to g_poll() and used to poll for cancellation. This is useful both
10547 * for unix systems without a native poll and for portability to
10550 * When this function returns %TRUE, you should use
10551 * g_cancellable_release_fd() to free up resources allocated for the
10552 * @pollfd. After a %FALSE return, do not call g_cancellable_release_fd().
10554 * If this function returns %FALSE, either no @cancellable was given or
10555 * resource limits prevent this function from allocating the necessary
10556 * structures for polling. (On Linux, you will likely have reached
10557 * the maximum number of file descriptors.) The suggested way to handle
10558 * these cases is to ignore the @cancellable.
10560 * You are not supposed to read from the fd yourself, just check for
10561 * readable status. Reading to unset the readable status is done
10562 * with g_cancellable_reset().
10564 * Returns: %TRUE if @pollfd was successfully initialized, %FALSE on failure to prepare the cancellable.
10570 * g_cancellable_new:
10572 * Creates a new #GCancellable object.
10574 * Applications that want to start one or more operations
10575 * that should be cancellable should create a #GCancellable
10576 * and pass it to the operations.
10578 * One #GCancellable can be used in multiple consecutive
10579 * operations or in multiple concurrent operations.
10581 * Returns: a #GCancellable.
10586 * g_cancellable_pop_current:
10587 * @cancellable: a #GCancellable object
10589 * Pops @cancellable off the cancellable stack (verifying that @cancellable
10590 * is on the top of the stack).
10595 * g_cancellable_push_current:
10596 * @cancellable: a #GCancellable object
10598 * Pushes @cancellable onto the cancellable stack. The current
10599 * cancellable can then be received using g_cancellable_get_current().
10601 * This is useful when implementing cancellable operations in
10602 * code that does not allow you to pass down the cancellable object.
10604 * This is typically called automatically by e.g. #GFile operations,
10605 * so you rarely have to call this yourself.
10610 * g_cancellable_release_fd:
10611 * @cancellable: a #GCancellable
10613 * Releases a resources previously allocated by g_cancellable_get_fd()
10614 * or g_cancellable_make_pollfd().
10616 * For compatibility reasons with older releases, calling this function
10617 * is not strictly required, the resources will be automatically freed
10618 * when the @cancellable is finalized. However, the @cancellable will
10619 * block scarce file descriptors until it is finalized if this function
10620 * is not called. This can cause the application to run out of file
10621 * descriptors when many #GCancellables are used at the same time.
10628 * g_cancellable_reset:
10629 * @cancellable: a #GCancellable object.
10631 * Resets @cancellable to its uncancelled state.
10633 * If cancellable is currently in use by any cancellable operation
10634 * then the behavior of this function is undefined.
10639 * g_cancellable_set_error_if_cancelled:
10640 * @cancellable: (allow-none): a #GCancellable or %NULL
10641 * @error: #GError to append error state to
10643 * If the @cancellable is cancelled, sets the error to notify
10644 * that the operation was cancelled.
10646 * Returns: %TRUE if @cancellable was cancelled, %FALSE if it was not
10651 * g_cancellable_source_new: (skip)
10652 * @cancellable: (allow-none): a #GCancellable, or %NULL
10654 * Creates a source that triggers if @cancellable is cancelled and
10655 * calls its callback of type #GCancellableSourceFunc. This is
10656 * primarily useful for attaching to another (non-cancellable) source
10657 * with g_source_add_child_source() to add cancellability to it.
10659 * For convenience, you can call this with a %NULL #GCancellable,
10660 * in which case the source will never trigger.
10662 * Returns: (transfer full): the new #GSource.
10668 * g_charset_converter_get_num_fallbacks:
10669 * @converter: a #GCharsetConverter
10671 * Gets the number of fallbacks that @converter has applied so far.
10673 * Returns: the number of fallbacks that @converter has applied
10679 * g_charset_converter_get_use_fallback:
10680 * @converter: a #GCharsetConverter
10682 * Gets the #GCharsetConverter:use-fallback property.
10684 * Returns: %TRUE if fallbacks are used by @converter
10690 * g_charset_converter_new:
10691 * @to_charset: destination charset
10692 * @from_charset: source charset
10693 * @error: #GError for error reporting, or %NULL to ignore.
10695 * Creates a new #GCharsetConverter.
10697 * Returns: a new #GCharsetConverter or %NULL on error.
10703 * g_charset_converter_set_use_fallback:
10704 * @converter: a #GCharsetConverter
10705 * @use_fallback: %TRUE to use fallbacks
10707 * Sets the #GCharsetConverter:use-fallback property.
10714 * g_content_type_can_be_executable:
10715 * @type: a content type string
10717 * Checks if a content type can be executable. Note that for instance
10718 * things like text files can be executables (i.e. scripts and batch files).
10720 * Returns: %TRUE if the file type corresponds to a type that can be executable, %FALSE otherwise.
10725 * g_content_type_equals:
10726 * @type1: a content type string
10727 * @type2: a content type string
10729 * Compares two content types for equality.
10731 * Returns: %TRUE if the two strings are identical or equivalent, %FALSE otherwise.
10736 * g_content_type_from_mime_type:
10737 * @mime_type: a mime type string
10739 * Tries to find a content type based on the mime type name.
10741 * Returns: (allow-none): Newly allocated string with content type or %NULL. Free with g_free()
10747 * g_content_type_get_description:
10748 * @type: a content type string
10750 * Gets the human readable description of the content type.
10752 * Returns: a short description of the content type @type. Free the returned string with g_free()
10757 * g_content_type_get_generic_icon_name:
10758 * @type: a content type string
10760 * Gets the generic icon name for a content type.
10762 * See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
10763 * specification for more on the generic icon name.
10765 * Returns: (allow-none): the registered generic icon name for the given @type, or %NULL if unknown. Free with g_free()
10771 * g_content_type_get_icon:
10772 * @type: a content type string
10774 * Gets the icon for a content type.
10776 * Returns: (transfer full): #GIcon corresponding to the content type. Free the returned object with g_object_unref()
10781 * g_content_type_get_mime_type:
10782 * @type: a content type string
10784 * Gets the mime type for the content type, if one is registered.
10786 * Returns: (allow-none): the registered mime type for the given @type, or %NULL if unknown.
10791 * g_content_type_get_symbolic_icon:
10792 * @type: a content type string
10794 * Gets the symbolic icon for a content type.
10796 * Returns: (transfer full): symbolic #GIcon corresponding to the content type. Free the returned object with g_object_unref()
10802 * g_content_type_guess:
10803 * @filename: (allow-none): a string, or %NULL
10804 * @data: (allow-none) (array length=data_size): a stream of data, or %NULL
10805 * @data_size: the size of @data
10806 * @result_uncertain: (allow-none) (out): return location for the certainty of the result, or %NULL
10808 * Guesses the content type based on example data. If the function is
10809 * uncertain, @result_uncertain will be set to %TRUE. Either @filename
10810 * or @data may be %NULL, in which case the guess will be based solely
10811 * on the other argument.
10813 * Returns: a string indicating a guessed content type for the given data. Free with g_free()
10818 * g_content_type_guess_for_tree:
10819 * @root: the root of the tree to guess a type for
10821 * Tries to guess the type of the tree with root @root, by
10822 * looking at the files it contains. The result is an array
10823 * of content types, with the best guess coming first.
10825 * The types returned all have the form x-content/foo, e.g.
10826 * x-content/audio-cdda (for audio CDs) or x-content/image-dcf
10827 * (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
10828 * specification for more on x-content types.
10830 * This function is useful in the implementation of
10831 * g_mount_guess_content_type().
10833 * Returns: (transfer full) (array zero-terminated=1): an %NULL-terminated array of zero or more content types. Free with g_strfreev()
10839 * g_content_type_is_a:
10840 * @type: a content type string
10841 * @supertype: a content type string
10843 * Determines if @type is a subset of @supertype.
10845 * Returns: %TRUE if @type is a kind of @supertype, %FALSE otherwise.
10850 * g_content_type_is_unknown:
10851 * @type: a content type string
10853 * Checks if the content type is the generic "unknown" type.
10854 * On UNIX this is the "application/octet-stream" mimetype,
10855 * while on win32 it is "*".
10857 * Returns: %TRUE if the type is the unknown type.
10862 * g_content_types_get_registered:
10864 * Gets a list of strings containing all the registered content types
10865 * known to the system. The list and its data should be freed using
10867 * g_list_free_full (list, g_free);
10868 * </programlisting>
10870 * Returns: (element-type utf8) (transfer full): #GList of the registered content types
10875 * g_converter_convert:
10876 * @converter: a #GConverter.
10877 * @inbuf: (array length=inbuf_size) (element-type guint8): the buffer containing the data to convert.
10878 * @inbuf_size: the number of bytes in @inbuf
10879 * @outbuf: a buffer to write converted data in.
10880 * @outbuf_size: the number of bytes in @outbuf, must be at least one
10881 * @flags: a #GConverterFlags controlling the conversion details
10882 * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success
10883 * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success
10884 * @error: location to store the error occurring, or %NULL to ignore
10886 * This is the main operation used when converting data. It is to be called
10887 * multiple times in a loop, and each time it will do some work, i.e.
10888 * producing some output (in @outbuf) or consuming some input (from @inbuf) or
10889 * both. If its not possible to do any work an error is returned.
10891 * Note that a single call may not consume all input (or any input at all).
10892 * Also a call may produce output even if given no input, due to state stored
10893 * in the converter producing output.
10895 * If any data was either produced or consumed, and then an error happens, then
10896 * only the successful conversion is reported and the error is returned on the
10899 * A full conversion loop involves calling this method repeatedly, each time
10900 * giving it new input and space output space. When there is no more input
10901 * data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
10902 * The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
10903 * each time until all data is consumed and all output is produced, then
10904 * %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
10905 * may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
10906 * in a decompression converter where the end of data is detectable from the
10907 * data (and there might even be other data after the end of the compressed data).
10909 * When some data has successfully been converted @bytes_read and is set to
10910 * the number of bytes read from @inbuf, and @bytes_written is set to indicate
10911 * how many bytes was written to @outbuf. If there are more data to output
10912 * or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
10913 * %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
10914 * then %G_CONVERTER_FINISHED is returned.
10916 * On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
10917 * Some errors need special handling:
10919 * %G_IO_ERROR_NO_SPACE is returned if there is not enough space
10920 * to write the resulting converted data, the application should
10921 * call the function again with a larger @outbuf to continue.
10923 * %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
10924 * input to fully determine what the conversion should produce,
10925 * and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
10926 * example with an incomplete multibyte sequence when converting text,
10927 * or when a regexp matches up to the end of the input (and may match
10928 * further input). It may also happen when @inbuf_size is zero and
10929 * there is no more data to produce.
10931 * When this happens the application should read more input and then
10932 * call the function again. If further input shows that there is no
10933 * more data call the function again with the same data but with
10934 * the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
10935 * to finish as e.g. in the regexp match case (or, to fail again with
10936 * %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
10937 * input is actually partial).
10939 * After g_converter_convert() has returned %G_CONVERTER_FINISHED the
10940 * converter object is in an invalid state where its not allowed
10941 * to call g_converter_convert() anymore. At this time you can only
10942 * free the object or call g_converter_reset() to reset it to the
10945 * If the flag %G_CONVERTER_FLUSH is set then conversion is modified
10946 * to try to write out all internal state to the output. The application
10947 * has to call the function multiple times with the flag set, and when
10948 * the available input has been consumed and all internal state has
10949 * been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
10950 * really at the end) is returned instead of %G_CONVERTER_CONVERTED.
10951 * This is somewhat similar to what happens at the end of the input stream,
10952 * but done in the middle of the data.
10954 * This has different meanings for different conversions. For instance
10955 * in a compression converter it would mean that we flush all the
10956 * compression state into output such that if you uncompress the
10957 * compressed data you get back all the input data. Doing this may
10958 * make the final file larger due to padding though. Another example
10959 * is a regexp conversion, where if you at the end of the flushed data
10960 * have a match, but there is also a potential longer match. In the
10961 * non-flushed case we would ask for more input, but when flushing we
10962 * treat this as the end of input and do the match.
10964 * Flushing is not always possible (like if a charset converter flushes
10965 * at a partial multibyte sequence). Converters are supposed to try
10966 * to produce as much output as possible and then return an error
10967 * (typically %G_IO_ERROR_PARTIAL_INPUT).
10969 * Returns: a #GConverterResult, %G_CONVERTER_ERROR on error.
10975 * g_converter_input_stream_get_converter:
10976 * @converter_stream: a #GConverterInputStream
10978 * Gets the #GConverter that is used by @converter_stream.
10980 * Returns: (transfer none): the converter of the converter input stream
10986 * g_converter_input_stream_new:
10987 * @base_stream: a #GInputStream
10988 * @converter: a #GConverter
10990 * Creates a new converter input stream for the @base_stream.
10992 * Returns: a new #GInputStream.
10997 * g_converter_output_stream_get_converter:
10998 * @converter_stream: a #GConverterOutputStream
11000 * Gets the #GConverter that is used by @converter_stream.
11002 * Returns: (transfer none): the converter of the converter output stream
11008 * g_converter_output_stream_new:
11009 * @base_stream: a #GOutputStream
11010 * @converter: a #GConverter
11012 * Creates a new converter output stream for the @base_stream.
11014 * Returns: a new #GOutputStream.
11019 * g_converter_reset:
11020 * @converter: a #GConverter.
11022 * Resets all internal state in the converter, making it behave
11023 * as if it was just created. If the converter has any internal
11024 * state that would produce output then that output is lost.
11031 * g_credentials_get_native: (skip)
11032 * @credentials: A #GCredentials.
11033 * @native_type: The type of native credentials to get.
11035 * Gets a pointer to native credentials of type @native_type from
11038 * It is a programming error (which will cause an warning to be
11039 * logged) to use this method if there is no #GCredentials support for
11040 * the OS or if @native_type isn't supported by the OS.
11042 * 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.
11048 * g_credentials_get_unix_pid:
11049 * @credentials: A #GCredentials
11050 * @error: Return location for error or %NULL.
11052 * Tries to get the UNIX process identifier from @credentials. This
11053 * method is only available on UNIX platforms.
11055 * This operation can fail if #GCredentials is not supported on the
11056 * OS or if the native credentials type does not contain information
11057 * about the UNIX process ID.
11059 * Returns: The UNIX process ID, or -1 if @error is set.
11065 * g_credentials_get_unix_user:
11066 * @credentials: A #GCredentials
11067 * @error: Return location for error or %NULL.
11069 * Tries to get the UNIX user identifier from @credentials. This
11070 * method is only available on UNIX platforms.
11072 * This operation can fail if #GCredentials is not supported on the
11073 * OS or if the native credentials type does not contain information
11074 * about the UNIX user.
11076 * Returns: The UNIX user identifier or -1 if @error is set.
11082 * g_credentials_is_same_user:
11083 * @credentials: A #GCredentials.
11084 * @other_credentials: A #GCredentials.
11085 * @error: Return location for error or %NULL.
11087 * Checks if @credentials and @other_credentials is the same user.
11089 * This operation can fail if #GCredentials is not supported on the
11092 * Returns: %TRUE if @credentials and @other_credentials has the same user, %FALSE otherwise or if @error is set.
11098 * g_credentials_new:
11100 * Creates a new #GCredentials object with credentials matching the
11101 * the current process.
11103 * Returns: A #GCredentials. Free with g_object_unref().
11109 * g_credentials_set_native:
11110 * @credentials: A #GCredentials.
11111 * @native_type: The type of native credentials to set.
11112 * @native: A pointer to native credentials.
11114 * Copies the native credentials of type @native_type from @native
11115 * into @credentials.
11117 * It is a programming error (which will cause an warning to be
11118 * logged) to use this method if there is no #GCredentials support for
11119 * the OS or if @native_type isn't supported by the OS.
11126 * g_credentials_set_unix_user:
11127 * @credentials: A #GCredentials.
11128 * @uid: The UNIX user identifier to set.
11129 * @error: Return location for error or %NULL.
11131 * Tries to set the UNIX user identifier on @credentials. This method
11132 * is only available on UNIX platforms.
11134 * This operation can fail if #GCredentials is not supported on the
11135 * OS or if the native credentials type does not contain information
11136 * about the UNIX user.
11138 * Returns: %TRUE if @uid was set, %FALSE if error is set.
11144 * g_credentials_to_string:
11145 * @credentials: A #GCredentials object.
11147 * Creates a human-readable textual representation of @credentials
11148 * that can be used in logging and debug messages. The format of the
11149 * returned string may change in future GLib release.
11151 * Returns: A string that should be freed with g_free().
11157 * g_data_input_stream_get_byte_order:
11158 * @stream: a given #GDataInputStream.
11160 * Gets the byte order for the data input stream.
11162 * Returns: the @stream's current #GDataStreamByteOrder.
11167 * g_data_input_stream_get_newline_type:
11168 * @stream: a given #GDataInputStream.
11170 * Gets the current newline type for the @stream.
11172 * Returns: #GDataStreamNewlineType for the given @stream.
11177 * g_data_input_stream_new:
11178 * @base_stream: a #GInputStream.
11180 * Creates a new data input stream for the @base_stream.
11182 * Returns: a new #GDataInputStream.
11187 * g_data_input_stream_read_byte:
11188 * @stream: a given #GDataInputStream.
11189 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11190 * @error: #GError for error reporting.
11192 * Reads an unsigned 8-bit/1-byte value from @stream.
11194 * Returns: an unsigned 8-bit/1-byte value read from the @stream or %0 if an error occurred.
11199 * g_data_input_stream_read_int16:
11200 * @stream: a given #GDataInputStream.
11201 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11202 * @error: #GError for error reporting.
11204 * Reads a 16-bit/2-byte value from @stream.
11206 * In order to get the correct byte order for this read operation,
11207 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11209 * Returns: a signed 16-bit/2-byte value read from @stream or %0 if an error occurred.
11214 * g_data_input_stream_read_int32:
11215 * @stream: a given #GDataInputStream.
11216 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11217 * @error: #GError for error reporting.
11219 * Reads a signed 32-bit/4-byte value from @stream.
11221 * In order to get the correct byte order for this read operation,
11222 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11224 * If @cancellable is not %NULL, then the operation can be cancelled by
11225 * triggering the cancellable object from another thread. If the operation
11226 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11228 * Returns: a signed 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11233 * g_data_input_stream_read_int64:
11234 * @stream: a given #GDataInputStream.
11235 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11236 * @error: #GError for error reporting.
11238 * Reads a 64-bit/8-byte value from @stream.
11240 * In order to get the correct byte order for this read operation,
11241 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11243 * If @cancellable is not %NULL, then the operation can be cancelled by
11244 * triggering the cancellable object from another thread. If the operation
11245 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11247 * Returns: a signed 64-bit/8-byte value read from @stream or %0 if an error occurred.
11252 * g_data_input_stream_read_line:
11253 * @stream: a given #GDataInputStream.
11254 * @length: (out): a #gsize to get the length of the data read in.
11255 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11256 * @error: #GError for error reporting.
11258 * Reads a line from the data input stream. Note that no encoding
11259 * checks or conversion is performed; the input is not guaranteed to
11260 * be UTF-8, and may in fact have embedded NUL characters.
11262 * If @cancellable is not %NULL, then the operation can be cancelled by
11263 * triggering the cancellable object from another thread. If the operation
11264 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11266 * 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.
11271 * g_data_input_stream_read_line_async:
11272 * @stream: a given #GDataInputStream.
11273 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11274 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11275 * @callback: (scope async): callback to call when the request is satisfied.
11276 * @user_data: (closure): the data to pass to callback function.
11278 * The asynchronous version of g_data_input_stream_read_line(). It is
11279 * an error to have two outstanding calls to this function.
11281 * When the operation is finished, @callback will be called. You
11282 * can then call g_data_input_stream_read_line_finish() to get
11283 * the result of the operation.
11290 * g_data_input_stream_read_line_finish:
11291 * @stream: a given #GDataInputStream.
11292 * @result: the #GAsyncResult that was provided to the callback.
11293 * @length: (out): a #gsize to get the length of the data read in.
11294 * @error: #GError for error reporting.
11296 * Finish an asynchronous call started by
11297 * g_data_input_stream_read_line_async(). Note the warning about
11298 * string encoding in g_data_input_stream_read_line() applies here as
11301 * 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.
11307 * g_data_input_stream_read_line_finish_utf8:
11308 * @stream: a given #GDataInputStream.
11309 * @result: the #GAsyncResult that was provided to the callback.
11310 * @length: (out): a #gsize to get the length of the data read in.
11311 * @error: #GError for error reporting.
11313 * Finish an asynchronous call started by
11314 * g_data_input_stream_read_line_async().
11316 * 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.
11322 * g_data_input_stream_read_line_utf8:
11323 * @stream: a given #GDataInputStream.
11324 * @length: (out): a #gsize to get the length of the data read in.
11325 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11326 * @error: #GError for error reporting.
11328 * Reads a UTF-8 encoded line from the data input stream.
11330 * If @cancellable is not %NULL, then the operation can be cancelled by
11331 * triggering the cancellable object from another thread. If the operation
11332 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11334 * 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.
11340 * g_data_input_stream_read_uint16:
11341 * @stream: a given #GDataInputStream.
11342 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11343 * @error: #GError for error reporting.
11345 * Reads an unsigned 16-bit/2-byte value from @stream.
11347 * In order to get the correct byte order for this read operation,
11348 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11350 * Returns: an unsigned 16-bit/2-byte value read from the @stream or %0 if an error occurred.
11355 * g_data_input_stream_read_uint32:
11356 * @stream: a given #GDataInputStream.
11357 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11358 * @error: #GError for error reporting.
11360 * Reads an unsigned 32-bit/4-byte value from @stream.
11362 * In order to get the correct byte order for this read operation,
11363 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11365 * If @cancellable is not %NULL, then the operation can be cancelled by
11366 * triggering the cancellable object from another thread. If the operation
11367 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11369 * Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11374 * g_data_input_stream_read_uint64:
11375 * @stream: a given #GDataInputStream.
11376 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11377 * @error: #GError for error reporting.
11379 * Reads an unsigned 64-bit/8-byte value from @stream.
11381 * In order to get the correct byte order for this read operation,
11382 * see g_data_input_stream_get_byte_order().
11384 * If @cancellable is not %NULL, then the operation can be cancelled by
11385 * triggering the cancellable object from another thread. If the operation
11386 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11388 * Returns: an unsigned 64-bit/8-byte read from @stream or %0 if an error occurred.
11393 * g_data_input_stream_read_until:
11394 * @stream: a given #GDataInputStream.
11395 * @stop_chars: characters to terminate the read.
11396 * @length: (out): a #gsize to get the length of the data read in.
11397 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11398 * @error: #GError for error reporting.
11400 * Reads a string from the data input stream, up to the first
11401 * occurrence of any of the stop characters.
11403 * Note that, in contrast to g_data_input_stream_read_until_async(),
11404 * this function consumes the stop character that it finds.
11406 * Don't use this function in new code. Its functionality is
11407 * inconsistent with g_data_input_stream_read_until_async(). Both
11408 * functions will be marked as deprecated in a future release. Use
11409 * g_data_input_stream_read_upto() instead, but note that that function
11410 * does not consume the stop character.
11412 * 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.
11417 * g_data_input_stream_read_until_async:
11418 * @stream: a given #GDataInputStream.
11419 * @stop_chars: characters to terminate the read.
11420 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11421 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11422 * @callback: (scope async): callback to call when the request is satisfied.
11423 * @user_data: (closure): the data to pass to callback function.
11425 * The asynchronous version of g_data_input_stream_read_until().
11426 * It is an error to have two outstanding calls to this function.
11428 * Note that, in contrast to g_data_input_stream_read_until(),
11429 * this function does not consume the stop character that it finds. You
11430 * must read it for yourself.
11432 * When the operation is finished, @callback will be called. You
11433 * can then call g_data_input_stream_read_until_finish() to get
11434 * the result of the operation.
11436 * Don't use this function in new code. Its functionality is
11437 * inconsistent with g_data_input_stream_read_until(). Both functions
11438 * will be marked as deprecated in a future release. Use
11439 * g_data_input_stream_read_upto_async() instead.
11446 * g_data_input_stream_read_until_finish:
11447 * @stream: a given #GDataInputStream.
11448 * @result: the #GAsyncResult that was provided to the callback.
11449 * @length: (out): a #gsize to get the length of the data read in.
11450 * @error: #GError for error reporting.
11452 * Finish an asynchronous call started by
11453 * g_data_input_stream_read_until_async().
11456 * 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.
11461 * g_data_input_stream_read_upto:
11462 * @stream: a #GDataInputStream
11463 * @stop_chars: characters to terminate the read
11464 * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
11465 * @length: (out): a #gsize to get the length of the data read in
11466 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
11467 * @error: #GError for error reporting
11469 * Reads a string from the data input stream, up to the first
11470 * occurrence of any of the stop characters.
11472 * In contrast to g_data_input_stream_read_until(), this function
11473 * does <emphasis>not</emphasis> consume the stop character. You have
11474 * to use g_data_input_stream_read_byte() to get it before calling
11475 * g_data_input_stream_read_upto() again.
11477 * Note that @stop_chars may contain '\0' if @stop_chars_len is
11480 * 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
11486 * g_data_input_stream_read_upto_async:
11487 * @stream: a #GDataInputStream
11488 * @stop_chars: characters to terminate the read
11489 * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
11490 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11491 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
11492 * @callback: (scope async): callback to call when the request is satisfied
11493 * @user_data: (closure): the data to pass to callback function
11495 * The asynchronous version of g_data_input_stream_read_upto().
11496 * It is an error to have two outstanding calls to this function.
11498 * In contrast to g_data_input_stream_read_until(), this function
11499 * does <emphasis>not</emphasis> consume the stop character. You have
11500 * to use g_data_input_stream_read_byte() to get it before calling
11501 * g_data_input_stream_read_upto() again.
11503 * Note that @stop_chars may contain '\0' if @stop_chars_len is
11506 * When the operation is finished, @callback will be called. You
11507 * can then call g_data_input_stream_read_upto_finish() to get
11508 * the result of the operation.
11515 * g_data_input_stream_read_upto_finish:
11516 * @stream: a #GDataInputStream
11517 * @result: the #GAsyncResult that was provided to the callback
11518 * @length: (out): a #gsize to get the length of the data read in
11519 * @error: #GError for error reporting
11521 * Finish an asynchronous call started by
11522 * g_data_input_stream_read_upto_async().
11524 * Note that this function does <emphasis>not</emphasis> consume the
11525 * stop character. You have to use g_data_input_stream_read_byte() to
11526 * get it before calling g_data_input_stream_read_upto_async() again.
11528 * 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.
11534 * g_data_input_stream_set_byte_order:
11535 * @stream: a given #GDataInputStream.
11536 * @order: a #GDataStreamByteOrder to set.
11538 * This function sets the byte order for the given @stream. All subsequent
11539 * reads from the @stream will be read in the given @order.
11544 * g_data_input_stream_set_newline_type:
11545 * @stream: a #GDataInputStream.
11546 * @type: the type of new line return as #GDataStreamNewlineType.
11548 * Sets the newline type for the @stream.
11550 * Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
11551 * chunk ends in "CR" we must read an additional byte to know if this is "CR" or
11552 * "CR LF", and this might block if there is no more data available.
11557 * g_data_output_stream_get_byte_order:
11558 * @stream: a #GDataOutputStream.
11560 * Gets the byte order for the stream.
11562 * Returns: the #GDataStreamByteOrder for the @stream.
11567 * g_data_output_stream_new:
11568 * @base_stream: a #GOutputStream.
11570 * Creates a new data output stream for @base_stream.
11572 * Returns: #GDataOutputStream.
11577 * g_data_output_stream_put_byte:
11578 * @stream: a #GDataOutputStream.
11579 * @data: a #guchar.
11580 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11581 * @error: a #GError, %NULL to ignore.
11583 * Puts a byte into the output stream.
11585 * Returns: %TRUE if @data was successfully added to the @stream.
11590 * g_data_output_stream_put_int16:
11591 * @stream: a #GDataOutputStream.
11592 * @data: a #gint16.
11593 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11594 * @error: a #GError, %NULL to ignore.
11596 * Puts a signed 16-bit integer into the output stream.
11598 * Returns: %TRUE if @data was successfully added to the @stream.
11603 * g_data_output_stream_put_int32:
11604 * @stream: a #GDataOutputStream.
11605 * @data: a #gint32.
11606 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11607 * @error: a #GError, %NULL to ignore.
11609 * Puts a signed 32-bit integer into the output stream.
11611 * Returns: %TRUE if @data was successfully added to the @stream.
11616 * g_data_output_stream_put_int64:
11617 * @stream: a #GDataOutputStream.
11618 * @data: a #gint64.
11619 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11620 * @error: a #GError, %NULL to ignore.
11622 * Puts a signed 64-bit integer into the stream.
11624 * Returns: %TRUE if @data was successfully added to the @stream.
11629 * g_data_output_stream_put_string:
11630 * @stream: a #GDataOutputStream.
11632 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11633 * @error: a #GError, %NULL to ignore.
11635 * Puts a string into the output stream.
11637 * Returns: %TRUE if @string was successfully added to the @stream.
11642 * g_data_output_stream_put_uint16:
11643 * @stream: a #GDataOutputStream.
11644 * @data: a #guint16.
11645 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11646 * @error: a #GError, %NULL to ignore.
11648 * Puts an unsigned 16-bit integer into the output stream.
11650 * Returns: %TRUE if @data was successfully added to the @stream.
11655 * g_data_output_stream_put_uint32:
11656 * @stream: a #GDataOutputStream.
11657 * @data: a #guint32.
11658 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11659 * @error: a #GError, %NULL to ignore.
11661 * Puts an unsigned 32-bit integer into the stream.
11663 * Returns: %TRUE if @data was successfully added to the @stream.
11668 * g_data_output_stream_put_uint64:
11669 * @stream: a #GDataOutputStream.
11670 * @data: a #guint64.
11671 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11672 * @error: a #GError, %NULL to ignore.
11674 * Puts an unsigned 64-bit integer into the stream.
11676 * Returns: %TRUE if @data was successfully added to the @stream.
11681 * g_data_output_stream_set_byte_order:
11682 * @stream: a #GDataOutputStream.
11683 * @order: a %GDataStreamByteOrder.
11685 * Sets the byte order of the data output stream to @order.
11690 * g_dbus_action_group_get:
11691 * @connection: A #GDBusConnection
11692 * @bus_name: the bus name which exports the action group
11693 * @object_path: the object path at which the action group is exported
11695 * Obtains a #GDBusActionGroup for the action group which is exported at
11696 * the given @bus_name and @object_path.
11698 * The thread default main context is taken at the time of this call.
11699 * All signals on the menu model (and any linked models) are reported
11700 * with respect to this context. All calls on the returned menu model
11701 * (and linked models) must also originate from this same context, with
11702 * the thread default main context unchanged.
11704 * This call is non-blocking. The returned action group may or may not
11705 * already be filled in. The correct thing to do is connect the signals
11706 * for the action group to monitor for changes and then to call
11707 * g_action_group_list_actions() to get the initial list.
11709 * Returns: (transfer full): a #GDBusActionGroup
11715 * g_dbus_address_escape_value:
11716 * @string: an unescaped string to be included in a D-Bus address as the value in a key-value pair
11718 * Escape @string so it can appear in a D-Bus address as the value
11719 * part of a key-value pair.
11721 * For instance, if @string is <code>/run/bus-for-:0</code>,
11722 * this function would return <code>/run/bus-for-%3A0</code>,
11723 * which could be used in a D-Bus address like
11724 * <code>unix:nonce-tcp:host=127.0.0.1,port=42,noncefile=/run/bus-for-%3A0</code>.
11726 * Returns: (transfer full): a copy of @string with all non-optionally-escaped bytes escaped
11732 * g_dbus_address_get_for_bus_sync:
11733 * @bus_type: A #GBusType.
11734 * @cancellable: (allow-none): A #GCancellable or %NULL.
11735 * @error: Return location for error or %NULL.
11737 * Synchronously looks up the D-Bus address for the well-known message
11738 * bus instance specified by @bus_type. This may involve using various
11739 * platform specific mechanisms.
11741 * Returns: A valid D-Bus address string for @bus_type or %NULL if @error is set.
11747 * g_dbus_address_get_stream:
11748 * @address: A valid D-Bus address.
11749 * @cancellable: (allow-none): A #GCancellable or %NULL.
11750 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
11751 * @user_data: Data to pass to @callback.
11753 * Asynchronously connects to an endpoint specified by @address and
11754 * sets up the connection so it is in a state to run the client-side
11755 * of the D-Bus authentication conversation.
11757 * When the operation is finished, @callback will be invoked. You can
11758 * then call g_dbus_address_get_stream_finish() to get the result of
11761 * This is an asynchronous failable function. See
11762 * g_dbus_address_get_stream_sync() for the synchronous version.
11769 * g_dbus_address_get_stream_finish:
11770 * @res: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
11771 * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
11772 * @error: Return location for error or %NULL.
11774 * Finishes an operation started with g_dbus_address_get_stream().
11776 * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
11782 * g_dbus_address_get_stream_sync:
11783 * @address: A valid D-Bus address.
11784 * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
11785 * @cancellable: (allow-none): A #GCancellable or %NULL.
11786 * @error: Return location for error or %NULL.
11788 * Synchronously connects to an endpoint specified by @address and
11789 * sets up the connection so it is in a state to run the client-side
11790 * of the D-Bus authentication conversation.
11792 * This is a synchronous failable function. See
11793 * g_dbus_address_get_stream() for the asynchronous version.
11795 * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
11801 * g_dbus_annotation_info_lookup:
11802 * @annotations: (array zero-terminated=1) (allow-none): A %NULL-terminated array of annotations or %NULL.
11803 * @name: The name of the annotation to look up.
11805 * Looks up the value of an annotation.
11807 * The cost of this function is O(n) in number of annotations.
11809 * Returns: The value or %NULL if not found. Do not free, it is owned by @annotations.
11815 * g_dbus_annotation_info_ref:
11816 * @info: A #GDBusNodeInfo
11818 * If @info is statically allocated does nothing. Otherwise increases
11819 * the reference count.
11821 * Returns: The same @info.
11827 * g_dbus_annotation_info_unref:
11828 * @info: A #GDBusAnnotationInfo.
11830 * If @info is statically allocated, does nothing. Otherwise decreases
11831 * the reference count of @info. When its reference count drops to 0,
11832 * the memory used is freed.
11839 * g_dbus_arg_info_ref:
11840 * @info: A #GDBusArgInfo
11842 * If @info is statically allocated does nothing. Otherwise increases
11843 * the reference count.
11845 * Returns: The same @info.
11851 * g_dbus_arg_info_unref:
11852 * @info: A #GDBusArgInfo.
11854 * If @info is statically allocated, does nothing. Otherwise decreases
11855 * the reference count of @info. When its reference count drops to 0,
11856 * the memory used is freed.
11863 * g_dbus_auth_observer_allow_mechanism:
11864 * @observer: A #GDBusAuthObserver.
11865 * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
11867 * Emits the #GDBusAuthObserver::allow-mechanism signal on @observer.
11869 * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
11875 * g_dbus_auth_observer_authorize_authenticated_peer:
11876 * @observer: A #GDBusAuthObserver.
11877 * @stream: A #GIOStream for the #GDBusConnection.
11878 * @credentials: (allow-none): Credentials received from the peer or %NULL.
11880 * Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
11882 * Returns: %TRUE if the peer is authorized, %FALSE if not.
11888 * g_dbus_auth_observer_new:
11890 * Creates a new #GDBusAuthObserver object.
11892 * Returns: A #GDBusAuthObserver. Free with g_object_unref().
11898 * g_dbus_connection_add_filter:
11899 * @connection: A #GDBusConnection.
11900 * @filter_function: A filter function.
11901 * @user_data: User data to pass to @filter_function.
11902 * @user_data_free_func: Function to free @user_data with when filter is removed or %NULL.
11904 * Adds a message filter. Filters are handlers that are run on all
11905 * incoming and outgoing messages, prior to standard dispatch. Filters
11906 * are run in the order that they were added. The same handler can be
11907 * added as a filter more than once, in which case it will be run more
11908 * than once. Filters added during a filter callback won't be run on
11909 * the message being processed. Filter functions are allowed to modify
11910 * and even drop messages.
11912 * Note that filters are run in a dedicated message handling thread so
11913 * they can't block and, generally, can't do anything but signal a
11914 * worker thread. Also note that filters are rarely needed - use API
11915 * such as g_dbus_connection_send_message_with_reply(),
11916 * g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
11918 * If a filter consumes an incoming message the message is not
11919 * dispatched anywhere else - not even the standard dispatch machinery
11920 * (that API such as g_dbus_connection_signal_subscribe() and
11921 * g_dbus_connection_send_message_with_reply() relies on) will see the
11922 * message. Similary, if a filter consumes an outgoing message, the
11923 * message will not be sent to the other peer.
11925 * Returns: A filter identifier that can be used with g_dbus_connection_remove_filter().
11931 * g_dbus_connection_call:
11932 * @connection: A #GDBusConnection.
11933 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
11934 * @object_path: Path of remote object.
11935 * @interface_name: D-Bus interface to invoke method on.
11936 * @method_name: The name of the method to invoke.
11937 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
11938 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
11939 * @flags: Flags from the #GDBusCallFlags enumeration.
11940 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
11941 * @cancellable: (allow-none): A #GCancellable or %NULL.
11942 * @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.
11943 * @user_data: The data to pass to @callback.
11945 * Asynchronously invokes the @method_name method on the
11946 * @interface_name D-Bus interface on the remote object at
11947 * @object_path owned by @bus_name.
11949 * If @connection is closed then the operation will fail with
11950 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
11951 * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
11952 * not compatible with the D-Bus protocol, the operation fails with
11953 * %G_IO_ERROR_INVALID_ARGUMENT.
11955 * If @reply_type is non-%NULL then the reply will be checked for having this type and an
11956 * error will be raised if it does not match. Said another way, if you give a @reply_type
11957 * then any non-%NULL return value will be of this type.
11959 * If the @parameters #GVariant is floating, it is consumed. This allows
11960 * convenient 'inline' use of g_variant_new(), e.g.:
11962 * g_dbus_connection_call (connection,
11963 * "org.freedesktop.StringThings",
11964 * "/org/freedesktop/StringThings",
11965 * "org.freedesktop.StringThings",
11967 * g_variant_new ("(ss)",
11971 * G_DBUS_CALL_FLAGS_NONE,
11974 * (GAsyncReadyCallback) two_strings_done,
11978 * This is an asynchronous method. When the operation is finished, @callback will be invoked
11979 * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
11980 * of the thread you are calling this method from. You can then call
11981 * g_dbus_connection_call_finish() to get the result of the operation.
11982 * See g_dbus_connection_call_sync() for the synchronous version of this
11985 * If @callback is %NULL then the D-Bus method call message will be sent with
11986 * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
11993 * g_dbus_connection_call_finish:
11994 * @connection: A #GDBusConnection.
11995 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
11996 * @error: Return location for error or %NULL.
11998 * Finishes an operation started with g_dbus_connection_call().
12000 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12006 * g_dbus_connection_call_sync:
12007 * @connection: A #GDBusConnection.
12008 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12009 * @object_path: Path of remote object.
12010 * @interface_name: D-Bus interface to invoke method on.
12011 * @method_name: The name of the method to invoke.
12012 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12013 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12014 * @flags: Flags from the #GDBusCallFlags enumeration.
12015 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12016 * @cancellable: (allow-none): A #GCancellable or %NULL.
12017 * @error: Return location for error or %NULL.
12019 * Synchronously invokes the @method_name method on the
12020 * @interface_name D-Bus interface on the remote object at
12021 * @object_path owned by @bus_name.
12023 * If @connection is closed then the operation will fail with
12024 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
12025 * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
12026 * contains a value not compatible with the D-Bus protocol, the operation
12027 * fails with %G_IO_ERROR_INVALID_ARGUMENT.
12029 * If @reply_type is non-%NULL then the reply will be checked for having
12030 * this type and an error will be raised if it does not match. Said
12031 * another way, if you give a @reply_type then any non-%NULL return
12032 * value will be of this type.
12034 * If the @parameters #GVariant is floating, it is consumed.
12035 * This allows convenient 'inline' use of g_variant_new(), e.g.:
12037 * g_dbus_connection_call_sync (connection,
12038 * "org.freedesktop.StringThings",
12039 * "/org/freedesktop/StringThings",
12040 * "org.freedesktop.StringThings",
12042 * g_variant_new ("(ss)",
12046 * G_DBUS_CALL_FLAGS_NONE,
12052 * The calling thread is blocked until a reply is received. See
12053 * g_dbus_connection_call() for the asynchronous version of
12056 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12062 * g_dbus_connection_call_with_unix_fd_list:
12063 * @connection: A #GDBusConnection.
12064 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12065 * @object_path: Path of remote object.
12066 * @interface_name: D-Bus interface to invoke method on.
12067 * @method_name: The name of the method to invoke.
12068 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12069 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12070 * @flags: Flags from the #GDBusCallFlags enumeration.
12071 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12072 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12073 * @cancellable: (allow-none): A #GCancellable or %NULL.
12074 * @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.
12075 * @user_data: The data to pass to @callback.
12077 * Like g_dbus_connection_call() but also takes a #GUnixFDList object.
12079 * This method is only available on UNIX.
12086 * g_dbus_connection_call_with_unix_fd_list_finish:
12087 * @connection: A #GDBusConnection.
12088 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12089 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
12090 * @error: Return location for error or %NULL.
12092 * Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
12094 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12100 * g_dbus_connection_call_with_unix_fd_list_sync:
12101 * @connection: A #GDBusConnection.
12102 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12103 * @object_path: Path of remote object.
12104 * @interface_name: D-Bus interface to invoke method on.
12105 * @method_name: The name of the method to invoke.
12106 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12107 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12108 * @flags: Flags from the #GDBusCallFlags enumeration.
12109 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12110 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12111 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12112 * @cancellable: (allow-none): A #GCancellable or %NULL.
12113 * @error: Return location for error or %NULL.
12115 * Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
12117 * This method is only available on UNIX.
12119 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12125 * g_dbus_connection_close:
12126 * @connection: A #GDBusConnection.
12127 * @cancellable: (allow-none): A #GCancellable or %NULL.
12128 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12129 * @user_data: The data to pass to @callback.
12131 * Closes @connection. Note that this never causes the process to
12132 * exit (this might only happen if the other end of a shared message
12133 * bus connection disconnects, see #GDBusConnection:exit-on-close).
12135 * Once the connection is closed, operations such as sending a message
12136 * will return with the error %G_IO_ERROR_CLOSED. Closing a connection
12137 * will not automatically flush the connection so queued messages may
12138 * be lost. Use g_dbus_connection_flush() if you need such guarantees.
12140 * If @connection is already closed, this method fails with
12141 * %G_IO_ERROR_CLOSED.
12143 * When @connection has been closed, the #GDBusConnection::closed
12144 * signal is emitted in the <link
12145 * linkend="g-main-context-push-thread-default">thread-default main
12146 * loop</link> of the thread that @connection was constructed in.
12148 * This is an asynchronous method. When the operation is finished,
12149 * @callback will be invoked in the <link
12150 * linkend="g-main-context-push-thread-default">thread-default main
12151 * loop</link> of the thread you are calling this method from. You can
12152 * then call g_dbus_connection_close_finish() to get the result of the
12153 * operation. See g_dbus_connection_close_sync() for the synchronous
12161 * g_dbus_connection_close_finish:
12162 * @connection: A #GDBusConnection.
12163 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
12164 * @error: Return location for error or %NULL.
12166 * Finishes an operation started with g_dbus_connection_close().
12168 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12174 * g_dbus_connection_close_sync:
12175 * @connection: A #GDBusConnection.
12176 * @cancellable: (allow-none): A #GCancellable or %NULL.
12177 * @error: Return location for error or %NULL.
12179 * Synchronously closees @connection. The calling thread is blocked
12180 * until this is done. See g_dbus_connection_close() for the
12181 * asynchronous version of this method and more details about what it
12184 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12190 * g_dbus_connection_emit_signal:
12191 * @connection: A #GDBusConnection.
12192 * @destination_bus_name: (allow-none): The unique bus name for the destination for the signal or %NULL to emit to all listeners.
12193 * @object_path: Path of remote object.
12194 * @interface_name: D-Bus interface to emit a signal on.
12195 * @signal_name: The name of the signal to emit.
12196 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
12197 * @error: Return location for error or %NULL.
12201 * If the parameters GVariant is floating, it is consumed.
12203 * This can only fail if @parameters is not compatible with the D-Bus protocol.
12205 * Returns: %TRUE unless @error is set.
12211 * g_dbus_connection_export_action_group:
12212 * @connection: a #GDBusConnection
12213 * @object_path: a D-Bus object path
12214 * @action_group: a #GActionGroup
12215 * @error: a pointer to a %NULL #GError, or %NULL
12217 * Exports @action_group on @connection at @object_path.
12219 * The implemented D-Bus API should be considered private. It is
12220 * subject to change in the future.
12222 * A given object path can only have one action group exported on it.
12223 * If this constraint is violated, the export will fail and 0 will be
12224 * returned (with @error set accordingly).
12226 * You can unexport the action group using
12227 * g_dbus_connection_unexport_action_group() with the return value of
12230 * The thread default main context is taken at the time of this call.
12231 * All incoming action activations and state change requests are
12232 * reported from this context. Any changes on the action group that
12233 * cause it to emit signals must also come from this same context.
12234 * Since incoming action activations and state change requests are
12235 * rather likely to cause changes on the action group, this effectively
12236 * limits a given action group to being exported from only one main
12239 * Returns: the ID of the export (never zero), or 0 in case of failure
12245 * g_dbus_connection_export_menu_model:
12246 * @connection: a #GDBusConnection
12247 * @object_path: a D-Bus object path
12248 * @menu: a #GMenuModel
12249 * @error: return location for an error, or %NULL
12251 * Exports @menu on @connection at @object_path.
12253 * The implemented D-Bus API should be considered private.
12254 * It is subject to change in the future.
12256 * An object path can only have one menu model exported on it. If this
12257 * constraint is violated, the export will fail and 0 will be
12258 * returned (with @error set accordingly).
12260 * You can unexport the menu model using
12261 * g_dbus_connection_unexport_menu_model() with the return value of
12264 * Returns: the ID of the export (never zero), or 0 in case of failure
12270 * g_dbus_connection_flush:
12271 * @connection: A #GDBusConnection.
12272 * @cancellable: (allow-none): A #GCancellable or %NULL.
12273 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12274 * @user_data: The data to pass to @callback.
12276 * Asynchronously flushes @connection, that is, writes all queued
12277 * outgoing message to the transport and then flushes the transport
12278 * (using g_output_stream_flush_async()). This is useful in programs
12279 * that wants to emit a D-Bus signal and then exit
12280 * immediately. Without flushing the connection, there is no guarantee
12281 * that the message has been sent to the networking buffers in the OS
12284 * This is an asynchronous method. When the operation is finished,
12285 * @callback will be invoked in the <link
12286 * linkend="g-main-context-push-thread-default">thread-default main
12287 * loop</link> of the thread you are calling this method from. You can
12288 * then call g_dbus_connection_flush_finish() to get the result of the
12289 * operation. See g_dbus_connection_flush_sync() for the synchronous
12297 * g_dbus_connection_flush_finish:
12298 * @connection: A #GDBusConnection.
12299 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
12300 * @error: Return location for error or %NULL.
12302 * Finishes an operation started with g_dbus_connection_flush().
12304 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12310 * g_dbus_connection_flush_sync:
12311 * @connection: A #GDBusConnection.
12312 * @cancellable: (allow-none): A #GCancellable or %NULL.
12313 * @error: Return location for error or %NULL.
12315 * Synchronously flushes @connection. The calling thread is blocked
12316 * until this is done. See g_dbus_connection_flush() for the
12317 * asynchronous version of this method and more details about what it
12320 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12326 * g_dbus_connection_get_capabilities:
12327 * @connection: A #GDBusConnection.
12329 * Gets the capabilities negotiated with the remote peer
12331 * Returns: Zero or more flags from the #GDBusCapabilityFlags enumeration.
12337 * g_dbus_connection_get_exit_on_close:
12338 * @connection: A #GDBusConnection.
12340 * Gets whether the process is terminated when @connection is
12341 * closed by the remote peer. See
12342 * #GDBusConnection:exit-on-close for more details.
12344 * Returns: Whether the process is terminated when @connection is closed by the remote peer.
12350 * g_dbus_connection_get_guid:
12351 * @connection: A #GDBusConnection.
12353 * The GUID of the peer performing the role of server when
12354 * authenticating. See #GDBusConnection:guid for more details.
12356 * Returns: The GUID. Do not free this string, it is owned by @connection.
12362 * g_dbus_connection_get_last_serial:
12363 * @connection: A #GDBusConnection.
12365 * Retrieves the last serial number assigned to a #GDBusMessage on
12366 * the current thread. This includes messages sent via both low-level
12367 * API such as g_dbus_connection_send_message() as well as
12368 * high-level API such as g_dbus_connection_emit_signal(),
12369 * g_dbus_connection_call() or g_dbus_proxy_call().
12371 * Returns: the last used serial or zero when no message has been sent within the current thread.
12377 * g_dbus_connection_get_peer_credentials:
12378 * @connection: A #GDBusConnection.
12380 * Gets the credentials of the authenticated peer. This will always
12381 * return %NULL unless @connection acted as a server
12382 * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
12383 * when set up and the client passed credentials as part of the
12384 * authentication process.
12386 * In a message bus setup, the message bus is always the server and
12387 * each application is a client. So this method will always return
12388 * %NULL for message bus clients.
12390 * Returns: (transfer none): A #GCredentials or %NULL if not available. Do not free this object, it is owned by @connection.
12396 * g_dbus_connection_get_stream:
12397 * @connection: a #GDBusConnection
12399 * Gets the underlying stream used for IO.
12401 * While the #GDBusConnection is active, it will interact with this
12402 * stream from a worker thread, so it is not safe to interact with
12403 * the stream directly.
12405 * Returns: (transfer none): the stream used for IO
12411 * g_dbus_connection_get_unique_name:
12412 * @connection: A #GDBusConnection.
12414 * Gets the unique name of @connection as assigned by the message
12415 * bus. This can also be used to figure out if @connection is a
12416 * message bus connection.
12418 * Returns: The unique name or %NULL if @connection is not a message bus connection. Do not free this string, it is owned by @connection.
12424 * g_dbus_connection_is_closed:
12425 * @connection: A #GDBusConnection.
12427 * Gets whether @connection is closed.
12429 * Returns: %TRUE if the connection is closed, %FALSE otherwise.
12435 * g_dbus_connection_new:
12436 * @stream: A #GIOStream.
12437 * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
12438 * @flags: Flags describing how to make the connection.
12439 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12440 * @cancellable: (allow-none): A #GCancellable or %NULL.
12441 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12442 * @user_data: The data to pass to @callback.
12444 * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
12445 * with the end represented by @stream.
12447 * If @stream is a #GSocketConnection, then the corresponding #GSocket
12448 * will be put into non-blocking mode.
12450 * The D-Bus connection will interact with @stream from a worker thread.
12451 * As a result, the caller should not interact with @stream after this
12452 * method has been called, except by calling g_object_unref() on it.
12454 * If @observer is not %NULL it may be used to control the
12455 * authentication process.
12457 * When the operation is finished, @callback will be invoked. You can
12458 * then call g_dbus_connection_new_finish() to get the result of the
12461 * This is a asynchronous failable constructor. See
12462 * g_dbus_connection_new_sync() for the synchronous
12470 * g_dbus_connection_new_finish:
12471 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
12472 * @error: Return location for error or %NULL.
12474 * Finishes an operation started with g_dbus_connection_new().
12476 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
12482 * g_dbus_connection_new_for_address:
12483 * @address: A D-Bus address.
12484 * @flags: Flags describing how to make the connection.
12485 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12486 * @cancellable: (allow-none): A #GCancellable or %NULL.
12487 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12488 * @user_data: The data to pass to @callback.
12490 * Asynchronously connects and sets up a D-Bus client connection for
12491 * exchanging D-Bus messages with an endpoint specified by @address
12492 * which must be in the D-Bus address format.
12494 * This constructor can only be used to initiate client-side
12495 * connections - use g_dbus_connection_new() if you need to act as the
12496 * server. In particular, @flags cannot contain the
12497 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
12498 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
12500 * When the operation is finished, @callback will be invoked. You can
12501 * then call g_dbus_connection_new_finish() to get the result of the
12504 * If @observer is not %NULL it may be used to control the
12505 * authentication process.
12507 * This is a asynchronous failable constructor. See
12508 * g_dbus_connection_new_for_address_sync() for the synchronous
12516 * g_dbus_connection_new_for_address_finish:
12517 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
12518 * @error: Return location for error or %NULL.
12520 * Finishes an operation started with g_dbus_connection_new_for_address().
12522 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
12528 * g_dbus_connection_new_for_address_sync:
12529 * @address: A D-Bus address.
12530 * @flags: Flags describing how to make the connection.
12531 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12532 * @cancellable: (allow-none): A #GCancellable or %NULL.
12533 * @error: Return location for error or %NULL.
12535 * Synchronously connects and sets up a D-Bus client connection for
12536 * exchanging D-Bus messages with an endpoint specified by @address
12537 * which must be in the D-Bus address format.
12539 * This constructor can only be used to initiate client-side
12540 * connections - use g_dbus_connection_new_sync() if you need to act
12541 * as the server. In particular, @flags cannot contain the
12542 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
12543 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
12545 * This is a synchronous failable constructor. See
12546 * g_dbus_connection_new_for_address() for the asynchronous version.
12548 * If @observer is not %NULL it may be used to control the
12549 * authentication process.
12551 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
12557 * g_dbus_connection_new_sync:
12558 * @stream: A #GIOStream.
12559 * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
12560 * @flags: Flags describing how to make the connection.
12561 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12562 * @cancellable: (allow-none): A #GCancellable or %NULL.
12563 * @error: Return location for error or %NULL.
12565 * Synchronously sets up a D-Bus connection for exchanging D-Bus messages
12566 * with the end represented by @stream.
12568 * If @stream is a #GSocketConnection, then the corresponding #GSocket
12569 * will be put into non-blocking mode.
12571 * The D-Bus connection will interact with @stream from a worker thread.
12572 * As a result, the caller should not interact with @stream after this
12573 * method has been called, except by calling g_object_unref() on it.
12575 * If @observer is not %NULL it may be used to control the
12576 * authentication process.
12578 * This is a synchronous failable constructor. See
12579 * g_dbus_connection_new() for the asynchronous version.
12581 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
12587 * g_dbus_connection_register_object:
12588 * @connection: A #GDBusConnection.
12589 * @object_path: The object path to register at.
12590 * @interface_info: Introspection data for the interface.
12591 * @vtable: (allow-none): A #GDBusInterfaceVTable to call into or %NULL.
12592 * @user_data: (allow-none): Data to pass to functions in @vtable.
12593 * @user_data_free_func: Function to call when the object path is unregistered.
12594 * @error: Return location for error or %NULL.
12596 * Registers callbacks for exported objects at @object_path with the
12597 * D-Bus interface that is described in @interface_info.
12599 * Calls to functions in @vtable (and @user_data_free_func) will
12600 * happen in the <link linkend="g-main-context-push-thread-default">thread-default main
12601 * loop</link> of the thread you are calling this method from.
12603 * Note that all #GVariant values passed to functions in @vtable will match
12604 * the signature given in @interface_info - if a remote caller passes
12605 * incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
12606 * is returned to the remote caller.
12608 * Additionally, if the remote caller attempts to invoke methods or
12609 * access properties not mentioned in @interface_info the
12610 * <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
12611 * <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
12612 * are returned to the caller.
12614 * It is considered a programming error if the
12615 * #GDBusInterfaceGetPropertyFunc function in @vtable returns a
12616 * #GVariant of incorrect type.
12618 * If an existing callback is already registered at @object_path and
12619 * @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
12621 * GDBus automatically implements the standard D-Bus interfaces
12622 * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
12623 * and org.freedesktop.Peer, so you don't have to implement those for
12624 * the objects you export. You <emphasis>can</emphasis> implement
12625 * org.freedesktop.DBus.Properties yourself, e.g. to handle getting
12626 * and setting of properties asynchronously.
12628 * Note that the reference count on @interface_info will be
12629 * incremented by 1 (unless allocated statically, e.g. if the
12630 * reference count is -1, see g_dbus_interface_info_ref()) for as long
12631 * as the object is exported. Also note that @vtable will be copied.
12633 * See <xref linkend="gdbus-server"/> for an example of how to use this method.
12635 * Returns: 0 if @error is set, otherwise a registration id (never 0) that can be used with g_dbus_connection_unregister_object() .
12641 * g_dbus_connection_register_subtree:
12642 * @connection: A #GDBusConnection.
12643 * @object_path: The object path to register the subtree at.
12644 * @vtable: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
12645 * @flags: Flags used to fine tune the behavior of the subtree.
12646 * @user_data: Data to pass to functions in @vtable.
12647 * @user_data_free_func: Function to call when the subtree is unregistered.
12648 * @error: Return location for error or %NULL.
12650 * Registers a whole subtree of <quote>dynamic</quote> objects.
12652 * The @enumerate and @introspection functions in @vtable are used to
12653 * convey, to remote callers, what nodes exist in the subtree rooted
12656 * When handling remote calls into any node in the subtree, first the
12657 * @enumerate function is used to check if the node exists. If the node exists
12658 * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
12659 * the @introspection function is used to check if the node supports the
12660 * requested method. If so, the @dispatch function is used to determine
12661 * where to dispatch the call. The collected #GDBusInterfaceVTable and
12662 * #gpointer will be used to call into the interface vtable for processing
12665 * All calls into user-provided code will be invoked in the <link
12666 * linkend="g-main-context-push-thread-default">thread-default main
12667 * loop</link> of the thread you are calling this method from.
12669 * If an existing subtree is already registered at @object_path or
12670 * then @error is set to #G_IO_ERROR_EXISTS.
12672 * Note that it is valid to register regular objects (using
12673 * g_dbus_connection_register_object()) in a subtree registered with
12674 * g_dbus_connection_register_subtree() - if so, the subtree handler
12675 * is tried as the last resort. One way to think about a subtree
12676 * handler is to consider it a <quote>fallback handler</quote>
12677 * for object paths not registered via g_dbus_connection_register_object()
12678 * or other bindings.
12680 * Note that @vtable will be copied so you cannot change it after
12683 * See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
12685 * Returns: 0 if @error is set, otherwise a subtree registration id (never 0) that can be used with g_dbus_connection_unregister_subtree() .
12691 * g_dbus_connection_remove_filter:
12692 * @connection: a #GDBusConnection
12693 * @filter_id: an identifier obtained from g_dbus_connection_add_filter()
12695 * Removes a filter.
12702 * g_dbus_connection_send_message:
12703 * @connection: A #GDBusConnection.
12704 * @message: A #GDBusMessage
12705 * @flags: Flags affecting how the message is sent.
12706 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
12707 * @error: Return location for error or %NULL.
12709 * Asynchronously sends @message to the peer represented by @connection.
12711 * Unless @flags contain the
12712 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
12713 * will be assigned by @connection and set on @message via
12714 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
12715 * serial number used will be written to this location prior to
12716 * submitting the message to the underlying transport.
12718 * If @connection is closed then the operation will fail with
12719 * %G_IO_ERROR_CLOSED. If @message is not well-formed,
12720 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
12722 * See <xref linkend="gdbus-server"/> and <xref
12723 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
12724 * low-level API to send and receive UNIX file descriptors.
12726 * Note that @message must be unlocked, unless @flags contain the
12727 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
12729 * Returns: %TRUE if the message was well-formed and queued for transmission, %FALSE if @error is set.
12735 * g_dbus_connection_send_message_with_reply:
12736 * @connection: A #GDBusConnection.
12737 * @message: A #GDBusMessage.
12738 * @flags: Flags affecting how the message is sent.
12739 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12740 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
12741 * @cancellable: (allow-none): A #GCancellable or %NULL.
12742 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12743 * @user_data: The data to pass to @callback.
12745 * Asynchronously sends @message to the peer represented by @connection.
12747 * Unless @flags contain the
12748 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
12749 * will be assigned by @connection and set on @message via
12750 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
12751 * serial number used will be written to this location prior to
12752 * submitting the message to the underlying transport.
12754 * If @connection is closed then the operation will fail with
12755 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
12756 * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
12757 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
12759 * This is an asynchronous method. When the operation is finished, @callback will be invoked
12760 * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
12761 * of the thread you are calling this method from. You can then call
12762 * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
12763 * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
12765 * Note that @message must be unlocked, unless @flags contain the
12766 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
12768 * See <xref linkend="gdbus-server"/> and <xref
12769 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
12770 * low-level API to send and receive UNIX file descriptors.
12777 * g_dbus_connection_send_message_with_reply_finish:
12778 * @connection: a #GDBusConnection
12779 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
12780 * @error: Return location for error or %NULL.
12782 * Finishes an operation started with g_dbus_connection_send_message_with_reply().
12784 * Note that @error is only set if a local in-process error
12785 * occurred. That is to say that the returned #GDBusMessage object may
12786 * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
12787 * g_dbus_message_to_gerror() to transcode this to a #GError.
12789 * See <xref linkend="gdbus-server"/> and <xref
12790 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
12791 * low-level API to send and receive UNIX file descriptors.
12793 * Returns: (transfer full): A locked #GDBusMessage or %NULL if @error is set.
12799 * g_dbus_connection_send_message_with_reply_sync:
12800 * @connection: A #GDBusConnection.
12801 * @message: A #GDBusMessage.
12802 * @flags: Flags affecting how the message is sent.
12803 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12804 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
12805 * @cancellable: (allow-none): A #GCancellable or %NULL.
12806 * @error: Return location for error or %NULL.
12808 * Synchronously sends @message to the peer represented by @connection
12809 * and blocks the calling thread until a reply is received or the
12810 * timeout is reached. See g_dbus_connection_send_message_with_reply()
12811 * for the asynchronous version of this method.
12813 * Unless @flags contain the
12814 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
12815 * will be assigned by @connection and set on @message via
12816 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
12817 * serial number used will be written to this location prior to
12818 * submitting the message to the underlying transport.
12820 * If @connection is closed then the operation will fail with
12821 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
12822 * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
12823 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
12825 * Note that @error is only set if a local in-process error
12826 * occurred. That is to say that the returned #GDBusMessage object may
12827 * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
12828 * g_dbus_message_to_gerror() to transcode this to a #GError.
12830 * See <xref linkend="gdbus-server"/> and <xref
12831 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
12832 * low-level API to send and receive UNIX file descriptors.
12834 * Note that @message must be unlocked, unless @flags contain the
12835 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
12837 * Returns: (transfer full): A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
12843 * g_dbus_connection_set_exit_on_close:
12844 * @connection: A #GDBusConnection.
12845 * @exit_on_close: Whether the process should be terminated when @connection is closed by the remote peer.
12847 * Sets whether the process should be terminated when @connection is
12848 * closed by the remote peer. See #GDBusConnection:exit-on-close for
12851 * Note that this function should be used with care. Most modern UNIX
12852 * desktops tie the notion of a user session the session bus, and expect
12853 * all of a users applications to quit when their bus connection goes away.
12854 * If you are setting @exit_on_close to %FALSE for the shared session
12855 * bus connection, you should make sure that your application exits
12856 * when the user session ends.
12863 * g_dbus_connection_signal_subscribe:
12864 * @connection: A #GDBusConnection.
12865 * @sender: (allow-none): Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
12866 * @interface_name: (allow-none): D-Bus interface name to match on or %NULL to match on all interfaces.
12867 * @member: (allow-none): D-Bus signal name to match on or %NULL to match on all signals.
12868 * @object_path: (allow-none): Object path to match on or %NULL to match on all object paths.
12869 * @arg0: (allow-none): Contents of first string argument to match on or %NULL to match on all kinds of arguments.
12870 * @flags: Flags describing how to subscribe to the signal (currently unused).
12871 * @callback: Callback to invoke when there is a signal matching the requested data.
12872 * @user_data: User data to pass to @callback.
12873 * @user_data_free_func: (allow-none): Function to free @user_data with when subscription is removed or %NULL.
12875 * Subscribes to signals on @connection and invokes @callback with a
12876 * whenever the signal is received. Note that @callback
12877 * will be invoked in the <link
12878 * linkend="g-main-context-push-thread-default">thread-default main
12879 * loop</link> of the thread you are calling this method from.
12881 * If @connection is not a message bus connection, @sender must be
12884 * If @sender is a well-known name note that @callback is invoked with
12885 * the unique name for the owner of @sender, not the well-known name
12886 * as one would expect. This is because the message bus rewrites the
12887 * name. As such, to avoid certain race conditions, users should be
12888 * tracking the name owner of the well-known name and use that when
12889 * processing the received signal.
12891 * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
12897 * g_dbus_connection_signal_unsubscribe:
12898 * @connection: A #GDBusConnection.
12899 * @subscription_id: A subscription id obtained from g_dbus_connection_signal_subscribe().
12901 * Unsubscribes from signals.
12908 * g_dbus_connection_start_message_processing:
12909 * @connection: A #GDBusConnection.
12911 * If @connection was created with
12912 * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
12913 * starts processing messages. Does nothing on if @connection wasn't
12914 * created with this flag or if the method has already been called.
12921 * g_dbus_connection_unexport_action_group:
12922 * @connection: a #GDBusConnection
12923 * @export_id: the ID from g_dbus_connection_export_action_group()
12925 * Reverses the effect of a previous call to
12926 * g_dbus_connection_export_action_group().
12928 * It is an error to call this function with an ID that wasn't returned
12929 * from g_dbus_connection_export_action_group() or to call it with the
12930 * same ID more than once.
12937 * g_dbus_connection_unexport_menu_model:
12938 * @connection: a #GDBusConnection
12939 * @export_id: the ID from g_dbus_connection_export_menu_model()
12941 * Reverses the effect of a previous call to
12942 * g_dbus_connection_export_menu_model().
12944 * It is an error to call this function with an ID that wasn't returned
12945 * from g_dbus_connection_export_menu_model() or to call it with the
12946 * same ID more than once.
12953 * g_dbus_connection_unregister_object:
12954 * @connection: A #GDBusConnection.
12955 * @registration_id: A registration id obtained from g_dbus_connection_register_object().
12957 * Unregisters an object.
12959 * Returns: %TRUE if the object was unregistered, %FALSE otherwise.
12965 * g_dbus_connection_unregister_subtree:
12966 * @connection: A #GDBusConnection.
12967 * @registration_id: A subtree registration id obtained from g_dbus_connection_register_subtree().
12969 * Unregisters a subtree.
12971 * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise.
12977 * g_dbus_error_encode_gerror:
12978 * @error: A #GError.
12980 * Creates a D-Bus error name to use for @error. If @error matches
12981 * a registered error (cf. g_dbus_error_register_error()), the corresponding
12982 * D-Bus error name will be returned.
12984 * Otherwise the a name of the form
12985 * <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
12986 * will be used. This allows other GDBus applications to map the error
12987 * on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
12989 * This function is typically only used in object mappings to put a
12990 * #GError on the wire. Regular applications should not use it.
12992 * Returns: A D-Bus error name (never %NULL). Free with g_free().
12998 * g_dbus_error_get_remote_error:
12999 * @error: A #GError.
13001 * Gets the D-Bus error name used for @error, if any.
13003 * This function is guaranteed to return a D-Bus error name for all
13004 * #GError<!-- -->s returned from functions handling remote method
13005 * calls (e.g. g_dbus_connection_call_finish()) unless
13006 * g_dbus_error_strip_remote_error() has been used on @error.
13008 * Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
13014 * g_dbus_error_is_remote_error:
13015 * @error: A #GError.
13017 * Checks if @error represents an error received via D-Bus from a remote peer. If so,
13018 * use g_dbus_error_get_remote_error() to get the name of the error.
13020 * Returns: %TRUE if @error represents an error from a remote peer, %FALSE otherwise.
13026 * g_dbus_error_new_for_dbus_error:
13027 * @dbus_error_name: D-Bus error name.
13028 * @dbus_error_message: D-Bus error message.
13030 * Creates a #GError based on the contents of @dbus_error_name and
13031 * @dbus_error_message.
13033 * Errors registered with g_dbus_error_register_error() will be looked
13034 * up using @dbus_error_name and if a match is found, the error domain
13035 * and code is used. Applications can use g_dbus_error_get_remote_error()
13036 * to recover @dbus_error_name.
13038 * If a match against a registered error is not found and the D-Bus
13039 * error name is in a form as returned by g_dbus_error_encode_gerror()
13040 * the error domain and code encoded in the name is used to
13041 * create the #GError. Also, @dbus_error_name is added to the error message
13042 * such that it can be recovered with g_dbus_error_get_remote_error().
13044 * Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
13045 * in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
13046 * added to the error message such that it can be recovered with
13047 * g_dbus_error_get_remote_error().
13049 * In all three cases, @dbus_error_name can always be recovered from the
13050 * returned #GError using the g_dbus_error_get_remote_error() function
13051 * (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
13053 * This function is typically only used in object mappings to prepare
13054 * #GError instances for applications. Regular applications should not use
13057 * Returns: An allocated #GError. Free with g_error_free().
13063 * g_dbus_error_register_error:
13064 * @error_domain: A #GQuark for a error domain.
13065 * @error_code: An error code.
13066 * @dbus_error_name: A D-Bus error name.
13068 * Creates an association to map between @dbus_error_name and
13069 * #GError<!-- -->s specified by @error_domain and @error_code.
13071 * This is typically done in the routine that returns the #GQuark for
13074 * Returns: %TRUE if the association was created, %FALSE if it already exists.
13080 * g_dbus_error_register_error_domain:
13081 * @error_domain_quark_name: The error domain name.
13082 * @quark_volatile: A pointer where to store the #GQuark.
13083 * @entries: A pointer to @num_entries #GDBusErrorEntry struct items.
13084 * @num_entries: Number of items to register.
13086 * Helper function for associating a #GError error domain with D-Bus error names.
13093 * g_dbus_error_set_dbus_error:
13094 * @error: A pointer to a #GError or %NULL.
13095 * @dbus_error_name: D-Bus error name.
13096 * @dbus_error_message: D-Bus error message.
13097 * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13098 * @...: Arguments for @format.
13100 * Does nothing if @error is %NULL. Otherwise sets *@error to
13101 * a new #GError created with g_dbus_error_new_for_dbus_error()
13102 * with @dbus_error_message prepend with @format (unless %NULL).
13109 * g_dbus_error_set_dbus_error_valist:
13110 * @error: A pointer to a #GError or %NULL.
13111 * @dbus_error_name: D-Bus error name.
13112 * @dbus_error_message: D-Bus error message.
13113 * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13114 * @var_args: Arguments for @format.
13116 * Like g_dbus_error_set_dbus_error() but intended for language bindings.
13123 * g_dbus_error_strip_remote_error:
13124 * @error: A #GError.
13126 * Looks for extra information in the error message used to recover
13127 * the D-Bus error name and strips it if found. If stripped, the
13128 * message field in @error will correspond exactly to what was
13129 * received on the wire.
13131 * This is typically used when presenting errors to the end user.
13133 * Returns: %TRUE if information was stripped, %FALSE otherwise.
13139 * g_dbus_error_unregister_error:
13140 * @error_domain: A #GQuark for a error domain.
13141 * @error_code: An error code.
13142 * @dbus_error_name: A D-Bus error name.
13144 * Destroys an association previously set up with g_dbus_error_register_error().
13146 * Returns: %TRUE if the association was destroyed, %FALSE if it wasn't found.
13152 * g_dbus_generate_guid:
13154 * Generate a D-Bus GUID that can be used with
13155 * e.g. g_dbus_connection_new().
13157 * See the D-Bus specification regarding what strings are valid D-Bus
13158 * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
13160 * Returns: A valid D-Bus GUID. Free with g_free().
13166 * g_dbus_gvalue_to_gvariant:
13167 * @gvalue: A #GValue to convert to a #GVariant.
13168 * @type: A #GVariantType.
13170 * Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
13172 * The conversion is using the following rules:
13173 * <table frame='all'>
13174 * <title>#GValue / #GVariant conversion rules</title>
13175 * <tgroup cols='2' align='left' colsep='1' rowsep='1'>
13178 * <entry>If the #GType for @gvalue is...</entry>
13179 * <entry>... then @type must be</entry>
13184 * <entry>#G_TYPE_STRING</entry>
13185 * <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>
13188 * <entry>#G_TYPE_STRV</entry>
13189 * <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>
13192 * <entry>#G_TYPE_BOOLEAN</entry>
13193 * <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
13196 * <entry>#G_TYPE_UCHAR</entry>
13197 * <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
13200 * <entry>#G_TYPE_INT</entry>
13201 * <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
13204 * <entry>#G_TYPE_UINT</entry>
13205 * <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
13208 * <entry>#G_TYPE_INT64</entry>
13209 * <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
13212 * <entry>#G_TYPE_UINT64</entry>
13213 * <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
13216 * <entry>#G_TYPE_DOUBLE</entry>
13217 * <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
13220 * <entry>#G_TYPE_VARIANT</entry>
13221 * <entry>Any #GVariantType</entry>
13226 * This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
13227 * is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
13228 * also fail for any #GType (including e.g. #G_TYPE_OBJECT and
13229 * #G_TYPE_BOXED derived-types) not in the table above.
13231 * Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
13232 * %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
13233 * %NULL) for @type is returned (e.g. 0 for scalar types, the empty
13234 * string for string types, <literal>'/'</literal> for object path
13235 * types, the empty array for any array type and so on).
13237 * See the g_dbus_gvariant_to_gvalue() function for how to convert a
13238 * #GVariant to a #GValue.
13240 * Returns: A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or %NULL in case of failure. Free with g_variant_unref().
13246 * g_dbus_gvariant_to_gvalue:
13247 * @value: A #GVariant.
13248 * @out_gvalue: (out): Return location pointing to a zero-filled (uninitialized) #GValue.
13250 * Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
13252 * The rules specified in the g_dbus_gvalue_to_gvariant() function are
13253 * used - this function is essentially its reverse form.
13255 * The conversion never fails - a valid #GValue is always returned in
13263 * g_dbus_interface_dup_object:
13264 * @interface_: An exported D-Bus interface.
13266 * Gets the #GDBusObject that @interface_ belongs to, if any.
13268 * Returns: (transfer full): A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
13270 * Rename to: g_dbus_interface_get_object
13275 * g_dbus_interface_get_info:
13276 * @interface_: An exported D-Bus interface.
13278 * Gets D-Bus introspection information for the D-Bus interface
13279 * implemented by @interface_.
13281 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
13287 * g_dbus_interface_get_object: (skip)
13288 * @interface_: An exported D-Bus interface.
13290 * Gets the #GDBusObject that @interface_ belongs to, if any.
13292 * <warning>It is not safe to use the returned object if @interface_
13293 * or the returned object is being used from other threads. See
13294 * g_dbus_interface_dup_object() for a thread-safe
13295 * alternative.</warning>
13297 * Returns: (transfer none): A #GDBusObject or %NULL. The returned reference belongs to @interface_ and should not be freed.
13303 * g_dbus_interface_info_cache_build:
13304 * @info: A #GDBusInterfaceInfo.
13306 * Builds a lookup-cache to speed up
13307 * g_dbus_interface_info_lookup_method(),
13308 * g_dbus_interface_info_lookup_signal() and
13309 * g_dbus_interface_info_lookup_property().
13311 * If this has already been called with @info, the existing cache is
13312 * used and its use count is increased.
13314 * Note that @info cannot be modified until
13315 * g_dbus_interface_info_cache_release() is called.
13322 * g_dbus_interface_info_cache_release:
13323 * @info: A GDBusInterfaceInfo
13325 * Decrements the usage count for the cache for @info built by
13326 * g_dbus_interface_info_cache_build() (if any) and frees the
13327 * resources used by the cache if the usage count drops to zero.
13334 * g_dbus_interface_info_generate_xml:
13335 * @info: A #GDBusNodeInfo
13336 * @indent: Indentation level.
13337 * @string_builder: (out): A #GString to to append XML data to.
13339 * Appends an XML representation of @info (and its children) to @string_builder.
13341 * This function is typically used for generating introspection XML
13342 * documents at run-time for handling the
13343 * <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
13351 * g_dbus_interface_info_lookup_method:
13352 * @info: A #GDBusInterfaceInfo.
13353 * @name: A D-Bus method name (typically in CamelCase)
13355 * Looks up information about a method.
13357 * The cost of this function is O(n) in number of methods unless
13358 * g_dbus_interface_info_cache_build() has been used on @info.
13360 * Returns: (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
13366 * g_dbus_interface_info_lookup_property:
13367 * @info: A #GDBusInterfaceInfo.
13368 * @name: A D-Bus property name (typically in CamelCase).
13370 * Looks up information about a property.
13372 * The cost of this function is O(n) in number of properties unless
13373 * g_dbus_interface_info_cache_build() has been used on @info.
13375 * Returns: (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
13381 * g_dbus_interface_info_lookup_signal:
13382 * @info: A #GDBusInterfaceInfo.
13383 * @name: A D-Bus signal name (typically in CamelCase)
13385 * Looks up information about a signal.
13387 * The cost of this function is O(n) in number of signals unless
13388 * g_dbus_interface_info_cache_build() has been used on @info.
13390 * Returns: (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
13396 * g_dbus_interface_info_ref:
13397 * @info: A #GDBusInterfaceInfo
13399 * If @info is statically allocated does nothing. Otherwise increases
13400 * the reference count.
13402 * Returns: The same @info.
13408 * g_dbus_interface_info_unref:
13409 * @info: A #GDBusInterfaceInfo.
13411 * If @info is statically allocated, does nothing. Otherwise decreases
13412 * the reference count of @info. When its reference count drops to 0,
13413 * the memory used is freed.
13420 * g_dbus_interface_set_object:
13421 * @interface_: An exported D-Bus interface.
13422 * @object: (allow-none): A #GDBusObject or %NULL.
13424 * Sets the #GDBusObject for @interface_ to @object.
13426 * Note that @interface_ will hold a weak reference to @object.
13433 * g_dbus_interface_skeleton_export:
13434 * @interface_: The D-Bus interface to export.
13435 * @connection: A #GDBusConnection to export @interface_ on.
13436 * @object_path: The path to export the interface at.
13437 * @error: Return location for error or %NULL.
13439 * Exports @interface_ at @object_path on @connection.
13441 * This can be called multiple times to export the same @interface_
13442 * onto multiple connections however the @object_path provided must be
13443 * the same for all connections.
13445 * Use g_dbus_interface_skeleton_unexport() to unexport the object.
13447 * Returns: %TRUE if the interface was exported on @connection, otherwise %FALSE with @error set.
13453 * g_dbus_interface_skeleton_flush:
13454 * @interface_: A #GDBusInterfaceSkeleton.
13456 * If @interface_ has outstanding changes, request for these changes to be
13457 * emitted immediately.
13459 * For example, an exported D-Bus interface may queue up property
13460 * changes and emit the
13461 * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
13462 * signal later (e.g. in an idle handler). This technique is useful
13463 * for collapsing multiple property changes into one.
13470 * g_dbus_interface_skeleton_get_connection:
13471 * @interface_: A #GDBusInterfaceSkeleton.
13473 * Gets the first connection that @interface_ is exported on, if any.
13475 * Returns: (transfer none): A #GDBusConnection or %NULL if @interface_ is not exported anywhere. Do not free, the object belongs to @interface_.
13481 * g_dbus_interface_skeleton_get_connections:
13482 * @interface_: A #GDBusInterfaceSkeleton.
13484 * Gets a list of the connections that @interface_ is exported on.
13486 * 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().
13492 * g_dbus_interface_skeleton_get_flags:
13493 * @interface_: A #GDBusInterfaceSkeleton.
13495 * Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
13498 * Returns: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
13504 * g_dbus_interface_skeleton_get_info:
13505 * @interface_: A #GDBusInterfaceSkeleton.
13507 * Gets D-Bus introspection information for the D-Bus interface
13508 * implemented by @interface_.
13510 * Returns: (transfer none): A #GDBusInterfaceInfo (never %NULL). Do not free.
13516 * g_dbus_interface_skeleton_get_object_path:
13517 * @interface_: A #GDBusInterfaceSkeleton.
13519 * Gets the object path that @interface_ is exported on, if any.
13521 * Returns: A string owned by @interface_ or %NULL if @interface_ is not exported anywhere. Do not free, the string belongs to @interface_.
13527 * g_dbus_interface_skeleton_get_properties:
13528 * @interface_: A #GDBusInterfaceSkeleton.
13530 * Gets all D-Bus properties for @interface_.
13532 * Returns: (transfer full): A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
13538 * g_dbus_interface_skeleton_get_vtable: (skip)
13539 * @interface_: A #GDBusInterfaceSkeleton.
13541 * Gets the interface vtable for the D-Bus interface implemented by
13542 * @interface_. The returned function pointers should expect @interface_
13543 * itself to be passed as @user_data.
13545 * Returns: A #GDBusInterfaceVTable (never %NULL).
13551 * g_dbus_interface_skeleton_has_connection:
13552 * @interface_: A #GDBusInterfaceSkeleton.
13553 * @connection: A #GDBusConnection.
13555 * Checks if @interface_ is exported on @connection.
13557 * Returns: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
13563 * g_dbus_interface_skeleton_set_flags:
13564 * @interface_: A #GDBusInterfaceSkeleton.
13565 * @flags: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
13567 * Sets flags describing what the behavior of @skeleton should be.
13574 * g_dbus_interface_skeleton_unexport:
13575 * @interface_: A #GDBusInterfaceSkeleton.
13577 * Stops exporting @interface_ on all connections it is exported on.
13579 * To unexport @interface_ from only a single connection, use
13580 * g_dbus_interface_skeleton_unexport_from_connection()
13587 * g_dbus_interface_skeleton_unexport_from_connection:
13588 * @interface_: A #GDBusInterfaceSkeleton.
13589 * @connection: A #GDBusConnection.
13591 * Stops exporting @interface_ on @connection.
13593 * To stop exporting on all connections the interface is exported on,
13594 * use g_dbus_interface_skeleton_unexport().
13601 * g_dbus_is_address:
13602 * @string: A string.
13604 * Checks if @string is a D-Bus address.
13606 * This doesn't check if @string is actually supported by #GDBusServer
13607 * or #GDBusConnection - use g_dbus_is_supported_address() to do more
13610 * Returns: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
13617 * @string: The string to check.
13619 * Checks if @string is a D-Bus GUID.
13621 * See the D-Bus specification regarding what strings are valid D-Bus
13622 * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
13624 * Returns: %TRUE if @string is a guid, %FALSE otherwise.
13630 * g_dbus_is_interface_name:
13631 * @string: The string to check.
13633 * Checks if @string is a valid D-Bus interface name.
13635 * Returns: %TRUE if valid, %FALSE otherwise.
13641 * g_dbus_is_member_name:
13642 * @string: The string to check.
13644 * Checks if @string is a valid D-Bus member (e.g. signal or method) name.
13646 * Returns: %TRUE if valid, %FALSE otherwise.
13653 * @string: The string to check.
13655 * Checks if @string is a valid D-Bus bus name (either unique or well-known).
13657 * Returns: %TRUE if valid, %FALSE otherwise.
13663 * g_dbus_is_supported_address:
13664 * @string: A string.
13665 * @error: Return location for error or %NULL.
13667 * Like g_dbus_is_address() but also checks if the library suppors the
13668 * transports in @string and that key/value pairs for each transport
13671 * Returns: %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set.
13677 * g_dbus_is_unique_name:
13678 * @string: The string to check.
13680 * Checks if @string is a valid D-Bus unique bus name.
13682 * Returns: %TRUE if valid, %FALSE otherwise.
13688 * g_dbus_menu_model_get:
13689 * @connection: a #GDBusConnection
13690 * @bus_name: the bus name which exports the menu model
13691 * @object_path: the object path at which the menu model is exported
13693 * Obtains a #GDBusMenuModel for the menu model which is exported
13694 * at the given @bus_name and @object_path.
13696 * The thread default main context is taken at the time of this call.
13697 * All signals on the menu model (and any linked models) are reported
13698 * with respect to this context. All calls on the returned menu model
13699 * (and linked models) must also originate from this same context, with
13700 * the thread default main context unchanged.
13702 * Returns: (transfer full): a #GDBusMenuModel object. Free with g_object_unref().
13708 * g_dbus_message_bytes_needed:
13709 * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
13710 * @blob_len: The length of @blob (must be at least 16).
13711 * @error: Return location for error or %NULL.
13713 * Utility function to calculate how many bytes are needed to
13714 * completely deserialize the D-Bus message stored at @blob.
13716 * 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).
13722 * g_dbus_message_copy:
13723 * @message: A #GDBusMessage.
13724 * @error: Return location for error or %NULL.
13726 * Copies @message. The copy is a deep copy and the returned
13727 * #GDBusMessage is completely identical except that it is guaranteed
13728 * to not be locked.
13730 * This operation can fail if e.g. @message contains file descriptors
13731 * and the per-process or system-wide open files limit is reached.
13733 * Returns: (transfer full): A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
13739 * g_dbus_message_get_arg0:
13740 * @message: A #GDBusMessage.
13742 * Convenience to get the first item in the body of @message.
13744 * Returns: The string item or %NULL if the first item in the body of @message is not a string.
13750 * g_dbus_message_get_body:
13751 * @message: A #GDBusMessage.
13753 * Gets the body of a message.
13755 * Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
13761 * g_dbus_message_get_byte_order:
13762 * @message: A #GDBusMessage.
13764 * Gets the byte order of @message.
13766 * Returns: The byte order.
13771 * g_dbus_message_get_destination:
13772 * @message: A #GDBusMessage.
13774 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
13776 * Returns: The value.
13782 * g_dbus_message_get_error_name:
13783 * @message: A #GDBusMessage.
13785 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
13787 * Returns: The value.
13793 * g_dbus_message_get_flags:
13794 * @message: A #GDBusMessage.
13796 * Gets the flags for @message.
13798 * Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
13804 * g_dbus_message_get_header:
13805 * @message: A #GDBusMessage.
13806 * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
13808 * Gets a header field on @message.
13810 * Returns: A #GVariant with the value if the header was found, %NULL otherwise. Do not free, it is owned by @message.
13816 * g_dbus_message_get_header_fields:
13817 * @message: A #GDBusMessage.
13819 * Gets an array of all header fields on @message that are set.
13821 * 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().
13827 * g_dbus_message_get_interface:
13828 * @message: A #GDBusMessage.
13830 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
13832 * Returns: The value.
13838 * g_dbus_message_get_locked:
13839 * @message: A #GDBusMessage.
13841 * Checks whether @message is locked. To monitor changes to this
13842 * value, conncet to the #GObject::notify signal to listen for changes
13843 * on the #GDBusMessage:locked property.
13845 * Returns: %TRUE if @message is locked, %FALSE otherwise.
13851 * g_dbus_message_get_member:
13852 * @message: A #GDBusMessage.
13854 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
13856 * Returns: The value.
13862 * g_dbus_message_get_message_type:
13863 * @message: A #GDBusMessage.
13865 * Gets the type of @message.
13867 * Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
13873 * g_dbus_message_get_num_unix_fds:
13874 * @message: A #GDBusMessage.
13876 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
13878 * Returns: The value.
13884 * g_dbus_message_get_path:
13885 * @message: A #GDBusMessage.
13887 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
13889 * Returns: The value.
13895 * g_dbus_message_get_reply_serial:
13896 * @message: A #GDBusMessage.
13898 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
13900 * Returns: The value.
13906 * g_dbus_message_get_sender:
13907 * @message: A #GDBusMessage.
13909 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
13911 * Returns: The value.
13917 * g_dbus_message_get_serial:
13918 * @message: A #GDBusMessage.
13920 * Gets the serial for @message.
13922 * Returns: A #guint32.
13928 * g_dbus_message_get_signature:
13929 * @message: A #GDBusMessage.
13931 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
13933 * Returns: The value.
13939 * g_dbus_message_get_unix_fd_list:
13940 * @message: A #GDBusMessage.
13942 * Gets the UNIX file descriptors associated with @message, if any.
13944 * This method is only available on UNIX.
13946 * Returns: (transfer none): A #GUnixFDList or %NULL if no file descriptors are associated. Do not free, this object is owned by @message.
13952 * g_dbus_message_lock:
13953 * @message: A #GDBusMessage.
13955 * If @message is locked, does nothing. Otherwise locks the message.
13962 * g_dbus_message_new:
13964 * Creates a new empty #GDBusMessage.
13966 * Returns: A #GDBusMessage. Free with g_object_unref().
13972 * g_dbus_message_new_from_blob:
13973 * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
13974 * @blob_len: The length of @blob.
13975 * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
13976 * @error: Return location for error or %NULL.
13978 * Creates a new #GDBusMessage from the data stored at @blob. The byte
13979 * order that the message was in can be retrieved using
13980 * g_dbus_message_get_byte_order().
13982 * Returns: A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
13988 * g_dbus_message_new_method_call:
13989 * @name: (allow-none): A valid D-Bus name or %NULL.
13990 * @path: A valid object path.
13991 * @interface_: (allow-none): A valid D-Bus interface name or %NULL.
13992 * @method: A valid method name.
13994 * Creates a new #GDBusMessage for a method call.
13996 * Returns: A #GDBusMessage. Free with g_object_unref().
14002 * g_dbus_message_new_method_error:
14003 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14004 * @error_name: A valid D-Bus error name.
14005 * @error_message_format: The D-Bus error message in a printf() format.
14006 * @...: Arguments for @error_message_format.
14008 * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14010 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14016 * g_dbus_message_new_method_error_literal:
14017 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14018 * @error_name: A valid D-Bus error name.
14019 * @error_message: The D-Bus error message.
14021 * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14023 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14029 * g_dbus_message_new_method_error_valist:
14030 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14031 * @error_name: A valid D-Bus error name.
14032 * @error_message_format: The D-Bus error message in a printf() format.
14033 * @var_args: Arguments for @error_message_format.
14035 * Like g_dbus_message_new_method_error() but intended for language bindings.
14037 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14043 * g_dbus_message_new_method_reply:
14044 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14046 * Creates a new #GDBusMessage that is a reply to @method_call_message.
14048 * Returns: (transfer full): #GDBusMessage. Free with g_object_unref().
14054 * g_dbus_message_new_signal:
14055 * @path: A valid object path.
14056 * @interface_: A valid D-Bus interface name.
14057 * @signal: A valid signal name.
14059 * Creates a new #GDBusMessage for a signal emission.
14061 * Returns: A #GDBusMessage. Free with g_object_unref().
14067 * g_dbus_message_print:
14068 * @message: A #GDBusMessage.
14069 * @indent: Indentation level.
14071 * Produces a human-readable multi-line description of @message.
14073 * The contents of the description has no ABI guarantees, the contents
14074 * and formatting is subject to change at any time. Typical output
14075 * looks something like this:
14077 * Type: method-call
14078 * Flags: none
14082 * path -> objectpath '/org/gtk/GDBus/TestObject'
14083 * interface -> 'org.gtk.GDBus.TestInterface'
14084 * member -> 'GimmeStdout'
14085 * destination -> ':1.146'
14087 * UNIX File Descriptors:
14089 * </programlisting>
14092 * Type: method-return
14093 * Flags: no-reply-expected
14095 * Serial: 477
14097 * reply-serial -> uint32 4
14098 * destination -> ':1.159'
14099 * sender -> ':1.146'
14100 * num-unix-fds -> uint32 1
14102 * UNIX File Descriptors:
14103 * fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
14104 * </programlisting>
14106 * Returns: A string that should be freed with g_free().
14112 * g_dbus_message_set_body:
14113 * @message: A #GDBusMessage.
14114 * @body: Either %NULL or a #GVariant that is a tuple.
14116 * Sets the body @message. As a side-effect the
14117 * %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
14118 * type string of @body (or cleared if @body is %NULL).
14120 * If @body is floating, @message assumes ownership of @body.
14127 * g_dbus_message_set_byte_order:
14128 * @message: A #GDBusMessage.
14129 * @byte_order: The byte order.
14131 * Sets the byte order of @message.
14136 * g_dbus_message_set_destination:
14137 * @message: A #GDBusMessage.
14138 * @value: The value to set.
14140 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14147 * g_dbus_message_set_error_name:
14148 * @message: A #GDBusMessage.
14149 * @value: The value to set.
14151 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14158 * g_dbus_message_set_flags:
14159 * @message: A #GDBusMessage.
14160 * @flags: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14162 * Sets the flags to set on @message.
14169 * g_dbus_message_set_header:
14170 * @message: A #GDBusMessage.
14171 * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14172 * @value: (allow-none): A #GVariant to set the header field or %NULL to clear the header field.
14174 * Sets a header field on @message.
14176 * If @value is floating, @message assumes ownership of @value.
14183 * g_dbus_message_set_interface:
14184 * @message: A #GDBusMessage.
14185 * @value: The value to set.
14187 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14194 * g_dbus_message_set_member:
14195 * @message: A #GDBusMessage.
14196 * @value: The value to set.
14198 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14205 * g_dbus_message_set_message_type:
14206 * @message: A #GDBusMessage.
14207 * @type: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14209 * Sets @message to be of @type.
14216 * g_dbus_message_set_num_unix_fds:
14217 * @message: A #GDBusMessage.
14218 * @value: The value to set.
14220 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14227 * g_dbus_message_set_path:
14228 * @message: A #GDBusMessage.
14229 * @value: The value to set.
14231 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14238 * g_dbus_message_set_reply_serial:
14239 * @message: A #GDBusMessage.
14240 * @value: The value to set.
14242 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14249 * g_dbus_message_set_sender:
14250 * @message: A #GDBusMessage.
14251 * @value: The value to set.
14253 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14260 * g_dbus_message_set_serial:
14261 * @message: A #GDBusMessage.
14262 * @serial: A #guint32.
14264 * Sets the serial for @message.
14271 * g_dbus_message_set_signature:
14272 * @message: A #GDBusMessage.
14273 * @value: The value to set.
14275 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14282 * g_dbus_message_set_unix_fd_list:
14283 * @message: A #GDBusMessage.
14284 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
14286 * Sets the UNIX file descriptors associated with @message. As a
14287 * side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
14288 * field is set to the number of fds in @fd_list (or cleared if
14289 * @fd_list is %NULL).
14291 * This method is only available on UNIX.
14298 * g_dbus_message_to_blob:
14299 * @message: A #GDBusMessage.
14300 * @out_size: Return location for size of generated blob.
14301 * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14302 * @error: Return location for error.
14304 * Serializes @message to a blob. The byte order returned by
14305 * g_dbus_message_get_byte_order() will be used.
14307 * 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().
14313 * g_dbus_message_to_gerror:
14314 * @message: A #GDBusMessage.
14315 * @error: The #GError to set.
14317 * If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
14318 * nothing and returns %FALSE.
14320 * Otherwise this method encodes the error in @message as a #GError
14321 * using g_dbus_error_set_dbus_error() using the information in the
14322 * %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
14323 * well as the first string item in @message's body.
14325 * Returns: %TRUE if @error was set, %FALSE otherwise.
14331 * g_dbus_method_info_ref:
14332 * @info: A #GDBusMethodInfo
14334 * If @info is statically allocated does nothing. Otherwise increases
14335 * the reference count.
14337 * Returns: The same @info.
14343 * g_dbus_method_info_unref:
14344 * @info: A #GDBusMethodInfo.
14346 * If @info is statically allocated, does nothing. Otherwise decreases
14347 * the reference count of @info. When its reference count drops to 0,
14348 * the memory used is freed.
14355 * g_dbus_method_invocation_get_connection:
14356 * @invocation: A #GDBusMethodInvocation.
14358 * Gets the #GDBusConnection the method was invoked on.
14360 * Returns: (transfer none): A #GDBusConnection. Do not free, it is owned by @invocation.
14366 * g_dbus_method_invocation_get_interface_name:
14367 * @invocation: A #GDBusMethodInvocation.
14369 * Gets the name of the D-Bus interface the method was invoked on.
14371 * Returns: A string. Do not free, it is owned by @invocation.
14377 * g_dbus_method_invocation_get_message:
14378 * @invocation: A #GDBusMethodInvocation.
14380 * Gets the #GDBusMessage for the method invocation. This is useful if
14381 * you need to use low-level protocol features, such as UNIX file
14382 * descriptor passing, that cannot be properly expressed in the
14385 * See <xref linkend="gdbus-server"/> and <xref
14386 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
14387 * low-level API to send and receive UNIX file descriptors.
14389 * Returns: (transfer none): #GDBusMessage. Do not free, it is owned by @invocation.
14395 * g_dbus_method_invocation_get_method_info:
14396 * @invocation: A #GDBusMethodInvocation.
14398 * Gets information about the method call, if any.
14400 * Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
14406 * g_dbus_method_invocation_get_method_name:
14407 * @invocation: A #GDBusMethodInvocation.
14409 * Gets the name of the method that was invoked.
14411 * Returns: A string. Do not free, it is owned by @invocation.
14417 * g_dbus_method_invocation_get_object_path:
14418 * @invocation: A #GDBusMethodInvocation.
14420 * Gets the object path the method was invoked on.
14422 * Returns: A string. Do not free, it is owned by @invocation.
14428 * g_dbus_method_invocation_get_parameters:
14429 * @invocation: A #GDBusMethodInvocation.
14431 * Gets the parameters of the method invocation. If there are no input
14432 * parameters then this will return a GVariant with 0 children rather than NULL.
14434 * Returns: (transfer none): A #GVariant tuple. Do not unref this because it is owned by @invocation.
14440 * g_dbus_method_invocation_get_sender:
14441 * @invocation: A #GDBusMethodInvocation.
14443 * Gets the bus name that invoked the method.
14445 * Returns: A string. Do not free, it is owned by @invocation.
14451 * g_dbus_method_invocation_get_user_data: (skip)
14452 * @invocation: A #GDBusMethodInvocation.
14454 * Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
14456 * Returns: A #gpointer.
14462 * g_dbus_method_invocation_return_dbus_error:
14463 * @invocation: (transfer full): A #GDBusMethodInvocation.
14464 * @error_name: A valid D-Bus error name.
14465 * @error_message: A valid D-Bus error message.
14467 * Finishes handling a D-Bus method call by returning an error.
14469 * This method will free @invocation, you cannot use it afterwards.
14476 * g_dbus_method_invocation_return_error:
14477 * @invocation: (transfer full): A #GDBusMethodInvocation.
14478 * @domain: A #GQuark for the #GError error domain.
14479 * @code: The error code.
14480 * @format: printf()-style format.
14481 * @...: Parameters for @format.
14483 * Finishes handling a D-Bus method call by returning an error.
14485 * See g_dbus_error_encode_gerror() for details about what error name
14486 * will be returned on the wire. In a nutshell, if the given error is
14487 * registered using g_dbus_error_register_error() the name given
14488 * during registration is used. Otherwise, a name of the form
14489 * <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
14490 * used. This provides transparent mapping of #GError between
14491 * applications using GDBus.
14493 * If you are writing an application intended to be portable,
14494 * <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
14495 * or use g_dbus_method_invocation_return_dbus_error().
14497 * This method will free @invocation, you cannot use it afterwards.
14504 * g_dbus_method_invocation_return_error_literal:
14505 * @invocation: (transfer full): A #GDBusMethodInvocation.
14506 * @domain: A #GQuark for the #GError error domain.
14507 * @code: The error code.
14508 * @message: The error message.
14510 * Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
14512 * This method will free @invocation, you cannot use it afterwards.
14519 * g_dbus_method_invocation_return_error_valist:
14520 * @invocation: (transfer full): A #GDBusMethodInvocation.
14521 * @domain: A #GQuark for the #GError error domain.
14522 * @code: The error code.
14523 * @format: printf()-style format.
14524 * @var_args: #va_list of parameters for @format.
14526 * Like g_dbus_method_invocation_return_error() but intended for
14527 * language bindings.
14529 * This method will free @invocation, you cannot use it afterwards.
14536 * g_dbus_method_invocation_return_gerror:
14537 * @invocation: (transfer full): A #GDBusMethodInvocation.
14538 * @error: A #GError.
14540 * Like g_dbus_method_invocation_return_error() but takes a #GError
14541 * instead of the error domain, error code and message.
14543 * This method will free @invocation, you cannot use it afterwards.
14550 * g_dbus_method_invocation_return_value:
14551 * @invocation: (transfer full): A #GDBusMethodInvocation.
14552 * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
14554 * Finishes handling a D-Bus method call by returning @parameters.
14555 * If the @parameters GVariant is floating, it is consumed.
14557 * It is an error if @parameters is not of the right format.
14559 * This method will free @invocation, you cannot use it afterwards.
14566 * g_dbus_method_invocation_return_value_with_unix_fd_list:
14567 * @invocation: (transfer full): A #GDBusMethodInvocation.
14568 * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
14569 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
14571 * Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
14573 * This method is only available on UNIX.
14575 * This method will free @invocation, you cannot use it afterwards.
14582 * g_dbus_method_invocation_take_error: (skip)
14583 * @invocation: (transfer full): A #GDBusMethodInvocation.
14584 * @error: (transfer full): A #GError.
14586 * Like g_dbus_method_invocation_return_gerror() but takes ownership
14587 * of @error so the caller does not need to free it.
14589 * This method will free @invocation, you cannot use it afterwards.
14596 * g_dbus_node_info_generate_xml:
14597 * @info: A #GDBusNodeInfo.
14598 * @indent: Indentation level.
14599 * @string_builder: (out): A #GString to to append XML data to.
14601 * Appends an XML representation of @info (and its children) to @string_builder.
14603 * This function is typically used for generating introspection XML documents at run-time for
14604 * handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
14611 * g_dbus_node_info_lookup_interface:
14612 * @info: A #GDBusNodeInfo.
14613 * @name: A D-Bus interface name.
14615 * Looks up information about an interface.
14617 * The cost of this function is O(n) in number of interfaces.
14619 * Returns: (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
14625 * g_dbus_node_info_new_for_xml:
14626 * @xml_data: Valid D-Bus introspection XML.
14627 * @error: Return location for error.
14629 * Parses @xml_data and returns a #GDBusNodeInfo representing the data.
14631 * The introspection XML must contain exactly one top-level
14632 * <tag class="starttag">node</tag> element.
14634 * Note that this routine is using a
14635 * <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
14636 * parser that only accepts a subset of valid XML documents.
14638 * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free with g_dbus_node_info_unref().
14644 * g_dbus_node_info_ref:
14645 * @info: A #GDBusNodeInfo
14647 * If @info is statically allocated does nothing. Otherwise increases
14648 * the reference count.
14650 * Returns: The same @info.
14656 * g_dbus_node_info_unref:
14657 * @info: A #GDBusNodeInfo.
14659 * If @info is statically allocated, does nothing. Otherwise decreases
14660 * the reference count of @info. When its reference count drops to 0,
14661 * the memory used is freed.
14668 * g_dbus_object_get_interface:
14669 * @object: A #GDBusObject.
14670 * @interface_name: A D-Bus interface name.
14672 * Gets the D-Bus interface with name @interface_name associated with
14675 * Returns: (transfer full): %NULL if not found, otherwise a #GDBusInterface that must be freed with g_object_unref().
14681 * g_dbus_object_get_interfaces:
14682 * @object: A #GDBusObject.
14684 * Gets the D-Bus interfaces associated with @object.
14686 * 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().
14692 * g_dbus_object_get_object_path:
14693 * @object: A #GDBusObject.
14695 * Gets the object path for @object.
14697 * Returns: A string owned by @object. Do not free.
14703 * g_dbus_object_manager_client_get_connection:
14704 * @manager: A #GDBusObjectManagerClient
14706 * Gets the #GDBusConnection used by @manager.
14708 * Returns: (transfer none): A #GDBusConnection object. Do not free, the object belongs to @manager.
14714 * g_dbus_object_manager_client_get_flags:
14715 * @manager: A #GDBusObjectManagerClient
14717 * Gets the flags that @manager was constructed with.
14719 * Returns: Zero of more flags from the #GDBusObjectManagerClientFlags enumeration.
14725 * g_dbus_object_manager_client_get_name:
14726 * @manager: A #GDBusObjectManagerClient
14728 * Gets the name that @manager is for, or %NULL if not a message bus
14731 * Returns: A unique or well-known name. Do not free, the string belongs to @manager.
14737 * g_dbus_object_manager_client_get_name_owner:
14738 * @manager: A #GDBusObjectManagerClient.
14740 * The unique name that owns the name that @manager is for or %NULL if
14741 * no-one currently owns that name. You can connect to the
14742 * #GObject::notify signal to track changes to the
14743 * #GDBusObjectManagerClient:name-owner property.
14745 * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
14751 * g_dbus_object_manager_client_new:
14752 * @connection: A #GDBusConnection.
14753 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
14754 * @name: The owner of the control object (unique or well-known name).
14755 * @object_path: The object path of the control object.
14756 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
14757 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
14758 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
14759 * @cancellable: (allow-none): A #GCancellable or %NULL
14760 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
14761 * @user_data: The data to pass to @callback.
14763 * Asynchronously creates a new #GDBusObjectManagerClient object.
14765 * This is an asynchronous failable constructor. When the result is
14766 * ready, @callback will be invoked in the
14767 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
14768 * of the thread you are calling this method from. You can
14769 * then call g_dbus_object_manager_client_new_finish() to get the result. See
14770 * g_dbus_object_manager_client_new_sync() for the synchronous version.
14777 * g_dbus_object_manager_client_new_finish:
14778 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
14779 * @error: Return location for error or %NULL.
14781 * Finishes an operation started with g_dbus_object_manager_client_new().
14783 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
14789 * g_dbus_object_manager_client_new_for_bus:
14790 * @bus_type: A #GBusType.
14791 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
14792 * @name: The owner of the control object (unique or well-known name).
14793 * @object_path: The object path of the control object.
14794 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
14795 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
14796 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
14797 * @cancellable: (allow-none): A #GCancellable or %NULL
14798 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
14799 * @user_data: The data to pass to @callback.
14801 * Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
14802 * #GDBusConnection.
14804 * This is an asynchronous failable constructor. When the result is
14805 * ready, @callback will be invoked in the
14806 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
14807 * of the thread you are calling this method from. You can
14808 * then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
14809 * g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
14816 * g_dbus_object_manager_client_new_for_bus_finish:
14817 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
14818 * @error: Return location for error or %NULL.
14820 * Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
14822 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
14828 * g_dbus_object_manager_client_new_for_bus_sync:
14829 * @bus_type: A #GBusType.
14830 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
14831 * @name: The owner of the control object (unique or well-known name).
14832 * @object_path: The object path of the control object.
14833 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
14834 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
14835 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
14836 * @cancellable: (allow-none): A #GCancellable or %NULL
14837 * @error: Return location for error or %NULL.
14839 * Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
14840 * of a #GDBusConnection.
14842 * This is a synchronous failable constructor - the calling thread is
14843 * blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
14844 * for the asynchronous version.
14846 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
14852 * g_dbus_object_manager_client_new_sync:
14853 * @connection: A #GDBusConnection.
14854 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
14855 * @name: (allow-none): The owner of the control object (unique or well-known name), or %NULL when not using a message bus connection.
14856 * @object_path: The object path of the control object.
14857 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
14858 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
14859 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
14860 * @cancellable: (allow-none): A #GCancellable or %NULL
14861 * @error: Return location for error or %NULL.
14863 * Creates a new #GDBusObjectManagerClient object.
14865 * This is a synchronous failable constructor - the calling thread is
14866 * blocked until a reply is received. See g_dbus_object_manager_client_new()
14867 * for the asynchronous version.
14869 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
14875 * g_dbus_object_manager_get_interface:
14876 * @manager: A #GDBusObjectManager.
14877 * @object_path: Object path to lookup.
14878 * @interface_name: D-Bus interface name to lookup.
14880 * Gets the interface proxy for @interface_name at @object_path, if
14883 * Returns: (transfer full): A #GDBusInterface instance or %NULL. Free with g_object_unref().
14889 * g_dbus_object_manager_get_object:
14890 * @manager: A #GDBusObjectManager.
14891 * @object_path: Object path to lookup.
14893 * Gets the #GDBusObjectProxy at @object_path, if any.
14895 * Returns: (transfer full): A #GDBusObject or %NULL. Free with g_object_unref().
14901 * g_dbus_object_manager_get_object_path:
14902 * @manager: A #GDBusObjectManager.
14904 * Gets the object path that @manager is for.
14906 * Returns: A string owned by @manager. Do not free.
14912 * g_dbus_object_manager_get_objects:
14913 * @manager: A #GDBusObjectManager.
14915 * Gets all #GDBusObject objects known to @manager.
14917 * 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().
14923 * g_dbus_object_manager_server_export:
14924 * @manager: A #GDBusObjectManagerServer.
14925 * @object: A #GDBusObjectSkeleton.
14927 * Exports @object on @manager.
14929 * If there is already a #GDBusObject exported at the object path,
14930 * then the old object is removed.
14932 * The object path for @object must be in the hierarchy rooted by the
14933 * object path for @manager.
14935 * Note that @manager will take a reference on @object for as long as
14943 * g_dbus_object_manager_server_export_uniquely:
14944 * @manager: A #GDBusObjectManagerServer.
14945 * @object: An object.
14947 * Like g_dbus_object_manager_server_export() but appends a string of
14948 * the form <literal>_N</literal> (with N being a natural number) to
14949 * @object<!-- -->'s object path if an object with the given path
14950 * already exists. As such, the #GDBusObjectProxy:g-object-path property
14951 * of @object may be modified.
14958 * g_dbus_object_manager_server_get_connection:
14959 * @manager: A #GDBusObjectManagerServer
14961 * Gets the #GDBusConnection used by @manager.
14963 * 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().
14969 * g_dbus_object_manager_server_is_exported:
14970 * @manager: A #GDBusObjectManagerServer.
14971 * @object: An object.
14973 * Returns whether @object is currently exported on @manager.
14975 * Returns: %TRUE if @object is exported
14981 * g_dbus_object_manager_server_new:
14982 * @object_path: The object path to export the manager object at.
14984 * Creates a new #GDBusObjectManagerServer object.
14986 * The returned server isn't yet exported on any connection. To do so,
14987 * use g_dbus_object_manager_server_set_connection(). Normally you
14988 * want to export all of your objects before doing so to avoid <ulink
14989 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
14990 * signals being emitted.
14992 * Returns: A #GDBusObjectManagerServer object. Free with g_object_unref().
14998 * g_dbus_object_manager_server_set_connection:
14999 * @manager: A #GDBusObjectManagerServer.
15000 * @connection: (allow-none): A #GDBusConnection or %NULL.
15002 * Exports all objects managed by @manager on @connection. If
15003 * @connection is %NULL, stops exporting objects.
15008 * g_dbus_object_manager_server_unexport:
15009 * @manager: A #GDBusObjectManagerServer.
15010 * @object_path: An object path.
15012 * If @manager has an object at @path, removes the object. Otherwise
15015 * Note that @object_path must be in the hierarchy rooted by the
15016 * object path for @manager.
15018 * Returns: %TRUE if object at @object_path was removed, %FALSE otherwise.
15024 * g_dbus_object_proxy_get_connection:
15025 * @proxy: a #GDBusObjectProxy
15027 * Gets the connection that @proxy is for.
15029 * Returns: (transfer none): A #GDBusConnection. Do not free, the object is owned by @proxy.
15035 * g_dbus_object_proxy_new:
15036 * @connection: a #GDBusConnection
15037 * @object_path: the object path
15039 * Creates a new #GDBusObjectProxy for the given connection and
15042 * Returns: a new #GDBusObjectProxy
15048 * g_dbus_object_skeleton_add_interface:
15049 * @object: A #GDBusObjectSkeleton.
15050 * @interface_: A #GDBusInterfaceSkeleton.
15052 * Adds @interface_ to @object.
15054 * If @object already contains a #GDBusInterfaceSkeleton with the same
15055 * interface name, it is removed before @interface_ is added.
15057 * Note that @object takes its own reference on @interface_ and holds
15058 * it until removed.
15065 * g_dbus_object_skeleton_flush:
15066 * @object: A #GDBusObjectSkeleton.
15068 * This method simply calls g_dbus_interface_skeleton_flush() on all
15069 * interfaces belonging to @object. See that method for when flushing
15077 * g_dbus_object_skeleton_new:
15078 * @object_path: An object path.
15080 * Creates a new #GDBusObjectSkeleton.
15082 * Returns: A #GDBusObjectSkeleton. Free with g_object_unref().
15088 * g_dbus_object_skeleton_remove_interface:
15089 * @object: A #GDBusObjectSkeleton.
15090 * @interface_: A #GDBusInterfaceSkeleton.
15092 * Removes @interface_ from @object.
15099 * g_dbus_object_skeleton_remove_interface_by_name:
15100 * @object: A #GDBusObjectSkeleton.
15101 * @interface_name: A D-Bus interface name.
15103 * Removes the #GDBusInterface with @interface_name from @object.
15105 * If no D-Bus interface of the given interface exists, this function
15113 * g_dbus_object_skeleton_set_object_path:
15114 * @object: A #GDBusObjectSkeleton.
15115 * @object_path: A valid D-Bus object path.
15117 * Sets the object path for @object.
15124 * g_dbus_property_info_ref:
15125 * @info: A #GDBusPropertyInfo
15127 * If @info is statically allocated does nothing. Otherwise increases
15128 * the reference count.
15130 * Returns: The same @info.
15136 * g_dbus_property_info_unref:
15137 * @info: A #GDBusPropertyInfo.
15139 * If @info is statically allocated, does nothing. Otherwise decreases
15140 * the reference count of @info. When its reference count drops to 0,
15141 * the memory used is freed.
15148 * g_dbus_proxy_call:
15149 * @proxy: A #GDBusProxy.
15150 * @method_name: Name of method to invoke.
15151 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15152 * @flags: Flags from the #GDBusCallFlags enumeration.
15153 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15154 * @cancellable: (allow-none): A #GCancellable or %NULL.
15155 * @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.
15156 * @user_data: The data to pass to @callback.
15158 * Asynchronously invokes the @method_name method on @proxy.
15160 * If @method_name contains any dots, then @name is split into interface and
15161 * method name parts. This allows using @proxy for invoking methods on
15162 * other interfaces.
15164 * If the #GDBusConnection associated with @proxy is closed then
15165 * the operation will fail with %G_IO_ERROR_CLOSED. If
15166 * @cancellable is canceled, the operation will fail with
15167 * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15168 * compatible with the D-Bus protocol, the operation fails with
15169 * %G_IO_ERROR_INVALID_ARGUMENT.
15171 * If the @parameters #GVariant is floating, it is consumed. This allows
15172 * convenient 'inline' use of g_variant_new(), e.g.:
15174 * g_dbus_proxy_call (proxy,
15176 * g_variant_new ("(ss)",
15179 * G_DBUS_CALL_FLAGS_NONE,
15182 * (GAsyncReadyCallback) two_strings_done,
15186 * If @proxy has an expected interface (see
15187 * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15188 * then the return value is checked against the return type.
15190 * This is an asynchronous method. When the operation is finished,
15191 * @callback will be invoked in the
15192 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15193 * of the thread you are calling this method from.
15194 * You can then call g_dbus_proxy_call_finish() to get the result of
15195 * the operation. See g_dbus_proxy_call_sync() for the synchronous
15196 * version of this method.
15198 * If @callback is %NULL then the D-Bus method call message will be sent with
15199 * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
15206 * g_dbus_proxy_call_finish:
15207 * @proxy: A #GDBusProxy.
15208 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
15209 * @error: Return location for error or %NULL.
15211 * Finishes an operation started with g_dbus_proxy_call().
15213 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15219 * g_dbus_proxy_call_sync:
15220 * @proxy: A #GDBusProxy.
15221 * @method_name: Name of method to invoke.
15222 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15223 * @flags: Flags from the #GDBusCallFlags enumeration.
15224 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15225 * @cancellable: (allow-none): A #GCancellable or %NULL.
15226 * @error: Return location for error or %NULL.
15228 * Synchronously invokes the @method_name method on @proxy.
15230 * If @method_name contains any dots, then @name is split into interface and
15231 * method name parts. This allows using @proxy for invoking methods on
15232 * other interfaces.
15234 * If the #GDBusConnection associated with @proxy is disconnected then
15235 * the operation will fail with %G_IO_ERROR_CLOSED. If
15236 * @cancellable is canceled, the operation will fail with
15237 * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15238 * compatible with the D-Bus protocol, the operation fails with
15239 * %G_IO_ERROR_INVALID_ARGUMENT.
15241 * If the @parameters #GVariant is floating, it is consumed. This allows
15242 * convenient 'inline' use of g_variant_new(), e.g.:
15244 * g_dbus_proxy_call_sync (proxy,
15246 * g_variant_new ("(ss)",
15249 * G_DBUS_CALL_FLAGS_NONE,
15255 * The calling thread is blocked until a reply is received. See
15256 * g_dbus_proxy_call() for the asynchronous version of this
15259 * If @proxy has an expected interface (see
15260 * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15261 * then the return value is checked against the return type.
15263 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15269 * g_dbus_proxy_call_with_unix_fd_list:
15270 * @proxy: A #GDBusProxy.
15271 * @method_name: Name of method to invoke.
15272 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15273 * @flags: Flags from the #GDBusCallFlags enumeration.
15274 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15275 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15276 * @cancellable: (allow-none): A #GCancellable or %NULL.
15277 * @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.
15278 * @user_data: The data to pass to @callback.
15280 * Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
15282 * This method is only available on UNIX.
15289 * g_dbus_proxy_call_with_unix_fd_list_finish:
15290 * @proxy: A #GDBusProxy.
15291 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15292 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
15293 * @error: Return location for error or %NULL.
15295 * Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
15297 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15303 * g_dbus_proxy_call_with_unix_fd_list_sync:
15304 * @proxy: A #GDBusProxy.
15305 * @method_name: Name of method to invoke.
15306 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15307 * @flags: Flags from the #GDBusCallFlags enumeration.
15308 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15309 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15310 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15311 * @cancellable: (allow-none): A #GCancellable or %NULL.
15312 * @error: Return location for error or %NULL.
15314 * Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
15316 * This method is only available on UNIX.
15318 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15324 * g_dbus_proxy_get_cached_property:
15325 * @proxy: A #GDBusProxy.
15326 * @property_name: Property name.
15328 * Looks up the value for a property from the cache. This call does no
15331 * If @proxy has an expected interface (see
15332 * #GDBusProxy:g-interface-info) and @property_name is referenced by
15333 * it, then @value is checked against the type of the property.
15335 * 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().
15341 * g_dbus_proxy_get_cached_property_names:
15342 * @proxy: A #GDBusProxy.
15344 * Gets the names of all cached properties on @proxy.
15346 * Returns: (transfer full): A %NULL-terminated array of strings or %NULL if @proxy has no cached properties. Free the returned array with g_strfreev().
15352 * g_dbus_proxy_get_connection:
15353 * @proxy: A #GDBusProxy.
15355 * Gets the connection @proxy is for.
15357 * Returns: (transfer none): A #GDBusConnection owned by @proxy. Do not free.
15363 * g_dbus_proxy_get_default_timeout:
15364 * @proxy: A #GDBusProxy.
15366 * Gets the timeout to use if -1 (specifying default timeout) is
15367 * passed as @timeout_msec in the g_dbus_proxy_call() and
15368 * g_dbus_proxy_call_sync() functions.
15370 * See the #GDBusProxy:g-default-timeout property for more details.
15372 * Returns: Timeout to use for @proxy.
15378 * g_dbus_proxy_get_flags:
15379 * @proxy: A #GDBusProxy.
15381 * Gets the flags that @proxy was constructed with.
15383 * Returns: Flags from the #GDBusProxyFlags enumeration.
15389 * g_dbus_proxy_get_interface_info:
15390 * @proxy: A #GDBusProxy
15392 * Returns the #GDBusInterfaceInfo, if any, specifying the interface
15393 * that @proxy conforms to. See the #GDBusProxy:g-interface-info
15394 * property for more details.
15396 * Returns: A #GDBusInterfaceInfo or %NULL. Do not unref the returned object, it is owned by @proxy.
15402 * g_dbus_proxy_get_interface_name:
15403 * @proxy: A #GDBusProxy.
15405 * Gets the D-Bus interface name @proxy is for.
15407 * Returns: A string owned by @proxy. Do not free.
15413 * g_dbus_proxy_get_name:
15414 * @proxy: A #GDBusProxy.
15416 * Gets the name that @proxy was constructed for.
15418 * Returns: A string owned by @proxy. Do not free.
15424 * g_dbus_proxy_get_name_owner:
15425 * @proxy: A #GDBusProxy.
15427 * The unique name that owns the name that @proxy is for or %NULL if
15428 * no-one currently owns that name. You may connect to the
15429 * #GObject::notify signal to track changes to the
15430 * #GDBusProxy:g-name-owner property.
15432 * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15438 * g_dbus_proxy_get_object_path:
15439 * @proxy: A #GDBusProxy.
15441 * Gets the object path @proxy is for.
15443 * Returns: A string owned by @proxy. Do not free.
15449 * g_dbus_proxy_new:
15450 * @connection: A #GDBusConnection.
15451 * @flags: Flags used when constructing the proxy.
15452 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15453 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
15454 * @object_path: An object path.
15455 * @interface_name: A D-Bus interface name.
15456 * @cancellable: (allow-none): A #GCancellable or %NULL.
15457 * @callback: Callback function to invoke when the proxy is ready.
15458 * @user_data: User data to pass to @callback.
15460 * Creates a proxy for accessing @interface_name on the remote object
15461 * at @object_path owned by @name at @connection and asynchronously
15462 * loads D-Bus properties unless the
15463 * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
15464 * the #GDBusProxy::g-properties-changed signal to get notified about
15465 * property changes.
15467 * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
15468 * match rules for signals. Connect to the #GDBusProxy::g-signal signal
15469 * to handle signals from the remote object.
15471 * If @name is a well-known name and the
15472 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
15473 * owner currently exists, the message bus will be requested to launch
15474 * a name owner for the name.
15476 * This is a failable asynchronous constructor - when the proxy is
15477 * ready, @callback will be invoked and you can use
15478 * g_dbus_proxy_new_finish() to get the result.
15480 * See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
15482 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
15489 * g_dbus_proxy_new_finish:
15490 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
15491 * @error: Return location for error or %NULL.
15493 * Finishes creating a #GDBusProxy.
15495 * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
15501 * g_dbus_proxy_new_for_bus:
15502 * @bus_type: A #GBusType.
15503 * @flags: Flags used when constructing the proxy.
15504 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15505 * @name: A bus name (well-known or unique).
15506 * @object_path: An object path.
15507 * @interface_name: A D-Bus interface name.
15508 * @cancellable: (allow-none): A #GCancellable or %NULL.
15509 * @callback: Callback function to invoke when the proxy is ready.
15510 * @user_data: User data to pass to @callback.
15512 * Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
15514 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
15521 * g_dbus_proxy_new_for_bus_finish:
15522 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
15523 * @error: Return location for error or %NULL.
15525 * Finishes creating a #GDBusProxy.
15527 * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
15533 * g_dbus_proxy_new_for_bus_sync:
15534 * @bus_type: A #GBusType.
15535 * @flags: Flags used when constructing the proxy.
15536 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15537 * @name: A bus name (well-known or unique).
15538 * @object_path: An object path.
15539 * @interface_name: A D-Bus interface name.
15540 * @cancellable: (allow-none): A #GCancellable or %NULL.
15541 * @error: Return location for error or %NULL.
15543 * Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
15545 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
15547 * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
15553 * g_dbus_proxy_new_sync:
15554 * @connection: A #GDBusConnection.
15555 * @flags: Flags used when constructing the proxy.
15556 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15557 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
15558 * @object_path: An object path.
15559 * @interface_name: A D-Bus interface name.
15560 * @cancellable: (allow-none): A #GCancellable or %NULL.
15561 * @error: (allow-none): Return location for error or %NULL.
15563 * Creates a proxy for accessing @interface_name on the remote object
15564 * at @object_path owned by @name at @connection and synchronously
15565 * loads D-Bus properties unless the
15566 * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
15568 * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
15569 * match rules for signals. Connect to the #GDBusProxy::g-signal signal
15570 * to handle signals from the remote object.
15572 * If @name is a well-known name and the
15573 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
15574 * owner currently exists, the message bus will be requested to launch
15575 * a name owner for the name.
15577 * This is a synchronous failable constructor. See g_dbus_proxy_new()
15578 * and g_dbus_proxy_new_finish() for the asynchronous version.
15580 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
15582 * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
15588 * g_dbus_proxy_set_cached_property:
15589 * @proxy: A #GDBusProxy
15590 * @property_name: Property name.
15591 * @value: (allow-none): Value for the property or %NULL to remove it from the cache.
15593 * If @value is not %NULL, sets the cached value for the property with
15594 * name @property_name to the value in @value.
15596 * If @value is %NULL, then the cached value is removed from the
15599 * If @proxy has an expected interface (see
15600 * #GDBusProxy:g-interface-info) and @property_name is referenced by
15601 * it, then @value is checked against the type of the property.
15603 * If the @value #GVariant is floating, it is consumed. This allows
15604 * convenient 'inline' use of g_variant_new(), e.g.
15606 * g_dbus_proxy_set_cached_property (proxy,
15608 * g_variant_new ("(si)",
15613 * Normally you will not need to use this method since @proxy is
15614 * tracking changes using the
15615 * <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
15616 * D-Bus signal. However, for performance reasons an object may decide
15617 * to not use this signal for some properties and instead use a
15618 * proprietary out-of-band mechanism to transmit changes.
15620 * As a concrete example, consider an object with a property
15621 * <literal>ChatroomParticipants</literal> which is an array of
15622 * strings. Instead of transmitting the same (long) array every time
15623 * the property changes, it is more efficient to only transmit the
15624 * delta using e.g. signals <literal>ChatroomParticipantJoined(String
15625 * name)</literal> and <literal>ChatroomParticipantParted(String
15633 * g_dbus_proxy_set_default_timeout:
15634 * @proxy: A #GDBusProxy.
15635 * @timeout_msec: Timeout in milliseconds.
15637 * Sets the timeout to use if -1 (specifying default timeout) is
15638 * passed as @timeout_msec in the g_dbus_proxy_call() and
15639 * g_dbus_proxy_call_sync() functions.
15641 * See the #GDBusProxy:g-default-timeout property for more details.
15648 * g_dbus_proxy_set_interface_info:
15649 * @proxy: A #GDBusProxy
15650 * @info: (allow-none): Minimum interface this proxy conforms to or %NULL to unset.
15652 * Ensure that interactions with @proxy conform to the given
15653 * interface. See the #GDBusProxy:g-interface-info property for more
15661 * g_dbus_server_get_client_address:
15662 * @server: A #GDBusServer.
15664 * Gets a D-Bus address string that can be used by clients to connect
15667 * Returns: A D-Bus address string. Do not free, the string is owned by @server.
15673 * g_dbus_server_get_flags:
15674 * @server: A #GDBusServer.
15676 * Gets the flags for @server.
15678 * Returns: A set of flags from the #GDBusServerFlags enumeration.
15684 * g_dbus_server_get_guid:
15685 * @server: A #GDBusServer.
15687 * Gets the GUID for @server.
15689 * Returns: A D-Bus GUID. Do not free this string, it is owned by @server.
15695 * g_dbus_server_is_active:
15696 * @server: A #GDBusServer.
15698 * Gets whether @server is active.
15700 * Returns: %TRUE if server is active, %FALSE otherwise.
15706 * g_dbus_server_new_sync:
15707 * @address: A D-Bus address.
15708 * @flags: Flags from the #GDBusServerFlags enumeration.
15709 * @guid: A D-Bus GUID.
15710 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
15711 * @cancellable: (allow-none): A #GCancellable or %NULL.
15712 * @error: Return location for server or %NULL.
15714 * Creates a new D-Bus server that listens on the first address in
15715 * @address that works.
15717 * Once constructed, you can use g_dbus_server_get_client_address() to
15718 * get a D-Bus address string that clients can use to connect.
15720 * Connect to the #GDBusServer::new-connection signal to handle
15721 * incoming connections.
15723 * The returned #GDBusServer isn't active - you have to start it with
15724 * g_dbus_server_start().
15726 * See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
15729 * This is a synchronous failable constructor. See
15730 * g_dbus_server_new() for the asynchronous version.
15732 * Returns: A #GDBusServer or %NULL if @error is set. Free with g_object_unref().
15738 * g_dbus_server_start:
15739 * @server: A #GDBusServer.
15748 * g_dbus_server_stop:
15749 * @server: A #GDBusServer.
15758 * g_dbus_signal_info_ref:
15759 * @info: A #GDBusSignalInfo
15761 * If @info is statically allocated does nothing. Otherwise increases
15762 * the reference count.
15764 * Returns: The same @info.
15770 * g_dbus_signal_info_unref:
15771 * @info: A #GDBusSignalInfo.
15773 * If @info is statically allocated, does nothing. Otherwise decreases
15774 * the reference count of @info. When its reference count drops to 0,
15775 * the memory used is freed.
15782 * g_desktop_app_info_get_boolean:
15783 * @info: a #GDesktopAppInfo
15784 * @key: the key to look up
15786 * Looks up a boolean value in the keyfile backing @info.
15788 * The @key is looked up in the "Desktop Entry" group.
15790 * Returns: the boolean value, or %FALSE if the key is not found
15796 * g_desktop_app_info_get_categories:
15797 * @info: a #GDesktopAppInfo
15799 * Gets the categories from the desktop file.
15801 * Returns: The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by ';' or validate it.
15806 * g_desktop_app_info_get_filename:
15807 * @info: a #GDesktopAppInfo
15809 * When @info was created from a known filename, return it. In some
15810 * situations such as the #GDesktopAppInfo returned from
15811 * g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
15813 * Returns: The full path to the file for @info, or %NULL if not known.
15819 * g_desktop_app_info_get_generic_name:
15820 * @info: a #GDesktopAppInfo
15822 * Gets the generic name from the destkop file.
15824 * Returns: The value of the GenericName key
15829 * g_desktop_app_info_get_is_hidden:
15830 * @info: a #GDesktopAppInfo.
15832 * A desktop file is hidden if the Hidden key in it is
15835 * Returns: %TRUE if hidden, %FALSE otherwise.
15840 * g_desktop_app_info_get_keywords:
15841 * @info: a #GDesktopAppInfo
15843 * Gets the keywords from the desktop file.
15845 * Returns: (transfer none): The value of the Keywords key
15851 * g_desktop_app_info_get_nodisplay:
15852 * @info: a #GDesktopAppInfo
15854 * Gets the value of the NoDisplay key, which helps determine if the
15855 * application info should be shown in menus. See
15856 * #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
15858 * Returns: The value of the NoDisplay key
15864 * g_desktop_app_info_get_show_in:
15865 * @info: a #GDesktopAppInfo
15866 * @desktop_env: a string specifying a desktop name
15868 * Checks if the application info should be shown in menus that list available
15869 * applications for a specific name of the desktop, based on the
15870 * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
15872 * If @desktop_env is %NULL, then the name of the desktop set with
15873 * g_desktop_app_info_set_desktop_env() is used.
15875 * Note that g_app_info_should_show() for @info will include this check (with
15876 * %NULL for @desktop_env) as well as additional checks.
15878 * Returns: %TRUE if the @info should be shown in @desktop_env according to the <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE otherwise.
15884 * g_desktop_app_info_get_startup_wm_class:
15885 * @info: a #GDesktopAppInfo that supports startup notify
15887 * Retrieves the StartupWMClass field from @info. This represents the
15888 * WM_CLASS property of the main window of the application, if launched
15891 * Returns: (transfer none): the startup WM class, or %NULL if none is set in the desktop file.
15897 * g_desktop_app_info_get_string:
15898 * @info: a #GDesktopAppInfo
15899 * @key: the key to look up
15901 * Looks up a string value in the keyfile backing @info.
15903 * The @key is looked up in the "Desktop Entry" group.
15905 * Returns: a newly allocated string, or %NULL if the key is not found
15911 * g_desktop_app_info_has_key:
15912 * @info: a #GDesktopAppInfo
15913 * @key: the key to look up
15915 * Returns whether @key exists in the "Desktop Entry" group
15916 * of the keyfile backing @info.
15918 * Returns: %TRUE if the @key exists
15924 * g_desktop_app_info_launch_uris_as_manager:
15925 * @appinfo: a #GDesktopAppInfo
15926 * @uris: (element-type utf8): List of URIs
15927 * @launch_context: a #GAppLaunchContext
15928 * @spawn_flags: #GSpawnFlags, used for each process
15929 * @user_setup: (scope call): a #GSpawnChildSetupFunc, used once for each process.
15930 * @user_setup_data: (closure user_setup): User data for @user_setup
15931 * @pid_callback: (scope call): Callback for child processes
15932 * @pid_callback_data: (closure pid_callback): User data for @callback
15933 * @error: return location for a #GError, or %NULL
15935 * This function performs the equivalent of g_app_info_launch_uris(),
15936 * but is intended primarily for operating system components that
15937 * launch applications. Ordinary applications should use
15938 * g_app_info_launch_uris().
15940 * In contrast to g_app_info_launch_uris(), all processes created will
15941 * always be run directly as children as if by the UNIX fork()/exec()
15944 * This guarantee allows additional control over the exact environment
15945 * of the child processes, which is provided via a setup function
15946 * @user_setup, as well as the process identifier of each child process
15947 * via @pid_callback. See g_spawn_async() for more information about the
15948 * semantics of the @user_setup function.
15950 * Returns: %TRUE on successful launch, %FALSE otherwise.
15955 * g_desktop_app_info_lookup_get_default_for_uri_scheme:
15956 * @lookup: a #GDesktopAppInfoLookup
15957 * @uri_scheme: a string containing a URI scheme.
15959 * Gets the default application for launching applications
15960 * using this URI scheme for a particular GDesktopAppInfoLookup
15963 * The GDesktopAppInfoLookup interface and this function is used
15964 * to implement g_app_info_get_default_for_uri_scheme() backends
15965 * in a GIO module. There is no reason for applications to use it
15966 * directly. Applications should use g_app_info_get_default_for_uri_scheme().
15968 * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
15969 * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
15974 * g_desktop_app_info_new:
15975 * @desktop_id: the desktop file id
15977 * Creates a new #GDesktopAppInfo based on a desktop file id.
15979 * A desktop file id is the basename of the desktop file, including the
15980 * .desktop extension. GIO is looking for a desktop file with this name
15981 * in the <filename>applications</filename> subdirectories of the XDG data
15982 * directories (i.e. the directories specified in the
15983 * <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
15984 * variables). GIO also supports the prefix-to-subdirectory mapping that is
15985 * described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
15986 * (i.e. a desktop id of kde-foo.desktop will match
15987 * <filename>/usr/share/applications/kde/foo.desktop</filename>).
15989 * Returns: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
15994 * g_desktop_app_info_new_from_filename:
15995 * @filename: the path of a desktop file, in the GLib filename encoding
15997 * Creates a new #GDesktopAppInfo.
15999 * Returns: a new #GDesktopAppInfo or %NULL on error.
16004 * g_desktop_app_info_new_from_keyfile:
16005 * @key_file: an opened #GKeyFile
16007 * Creates a new #GDesktopAppInfo.
16009 * Returns: a new #GDesktopAppInfo or %NULL on error.
16015 * g_desktop_app_info_set_desktop_env:
16016 * @desktop_env: a string specifying what desktop this is
16018 * Sets the name of the desktop that the application is running in.
16019 * This is used by g_app_info_should_show() and
16020 * g_desktop_app_info_get_show_in() to evaluate the
16021 * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
16022 * desktop entry fields.
16024 * The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
16025 * Menu specification</ulink> recognizes the following:
16027 * <member>GNOME</member>
16028 * <member>KDE</member>
16029 * <member>ROX</member>
16030 * <member>XFCE</member>
16031 * <member>LXDE</member>
16032 * <member>Unity</member>
16033 * <member>Old</member>
16036 * Should be called only once; subsequent calls are ignored.
16041 * g_drive_can_eject:
16042 * @drive: a #GDrive.
16044 * Checks if a drive can be ejected.
16046 * Returns: %TRUE if the @drive can be ejected, %FALSE otherwise.
16051 * g_drive_can_poll_for_media:
16052 * @drive: a #GDrive.
16054 * Checks if a drive can be polled for media changes.
16056 * Returns: %TRUE if the @drive can be polled for media changes, %FALSE otherwise.
16061 * g_drive_can_start:
16062 * @drive: a #GDrive.
16064 * Checks if a drive can be started.
16066 * Returns: %TRUE if the @drive can be started, %FALSE otherwise.
16072 * g_drive_can_start_degraded:
16073 * @drive: a #GDrive.
16075 * Checks if a drive can be started degraded.
16077 * Returns: %TRUE if the @drive can be started degraded, %FALSE otherwise.
16083 * g_drive_can_stop:
16084 * @drive: a #GDrive.
16086 * Checks if a drive can be stopped.
16088 * Returns: %TRUE if the @drive can be stopped, %FALSE otherwise.
16095 * @drive: a #GDrive.
16096 * @flags: flags affecting the unmount if required for eject
16097 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16098 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16099 * @user_data: user data to pass to @callback
16101 * Asynchronously ejects a drive.
16103 * When the operation is finished, @callback will be called.
16104 * You can then call g_drive_eject_finish() to obtain the
16105 * result of the operation.
16107 * Deprecated: 2.22: Use g_drive_eject_with_operation() instead.
16112 * g_drive_eject_finish:
16113 * @drive: a #GDrive.
16114 * @result: a #GAsyncResult.
16115 * @error: a #GError, or %NULL
16117 * Finishes ejecting a drive.
16119 * Returns: %TRUE if the drive has been ejected successfully, %FALSE otherwise.
16120 * Deprecated: 2.22: Use g_drive_eject_with_operation_finish() instead.
16125 * g_drive_eject_with_operation:
16126 * @drive: a #GDrive.
16127 * @flags: flags affecting the unmount if required for eject
16128 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16129 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16130 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16131 * @user_data: user data passed to @callback.
16133 * Ejects a drive. This is an asynchronous operation, and is
16134 * finished by calling g_drive_eject_with_operation_finish() with the @drive
16135 * and #GAsyncResult data returned in the @callback.
16142 * g_drive_eject_with_operation_finish:
16143 * @drive: a #GDrive.
16144 * @result: a #GAsyncResult.
16145 * @error: a #GError location to store the error occurring, or %NULL to ignore.
16147 * Finishes ejecting a drive. If any errors occurred during the operation,
16148 * @error will be set to contain the errors and %FALSE will be returned.
16150 * Returns: %TRUE if the drive was successfully ejected. %FALSE otherwise.
16156 * g_drive_enumerate_identifiers:
16157 * @drive: a #GDrive
16159 * Gets the kinds of identifiers that @drive has.
16160 * Use g_drive_get_identifier() to obtain the identifiers
16163 * Returns: (transfer full) (array zero-terminated=1): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
16168 * g_drive_get_icon:
16169 * @drive: a #GDrive.
16171 * Gets the icon for @drive.
16173 * Returns: (transfer full): #GIcon for the @drive. Free the returned object with g_object_unref().
16178 * g_drive_get_identifier:
16179 * @drive: a #GDrive
16180 * @kind: the kind of identifier to return
16182 * Gets the identifier of the given kind for @drive.
16184 * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GDrive doesn't have this kind of identifier.
16189 * g_drive_get_name:
16190 * @drive: a #GDrive.
16192 * Gets the name of @drive.
16194 * Returns: a string containing @drive's name. The returned string should be freed when no longer needed.
16199 * g_drive_get_sort_key:
16200 * @drive: A #GDrive.
16202 * Gets the sort key for @drive, if any.
16204 * Returns: Sorting key for @drive or %NULL if no such key is available.
16210 * g_drive_get_start_stop_type:
16211 * @drive: a #GDrive.
16213 * Gets a hint about how a drive can be started/stopped.
16215 * Returns: A value from the #GDriveStartStopType enumeration.
16221 * g_drive_get_symbolic_icon:
16222 * @drive: a #GDrive.
16224 * Gets the icon for @drive.
16226 * Returns: (transfer full): symbolic #GIcon for the @drive. Free the returned object with g_object_unref().
16232 * g_drive_get_volumes:
16233 * @drive: a #GDrive.
16235 * Get a list of mountable volumes for @drive.
16237 * The returned list should be freed with g_list_free(), after
16238 * its elements have been unreffed with g_object_unref().
16240 * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive.
16245 * g_drive_has_media:
16246 * @drive: a #GDrive.
16248 * Checks if the @drive has media. Note that the OS may not be polling
16249 * the drive for media changes; see g_drive_is_media_check_automatic()
16250 * for more details.
16252 * Returns: %TRUE if @drive has media, %FALSE otherwise.
16257 * g_drive_has_volumes:
16258 * @drive: a #GDrive.
16260 * Check if @drive has any mountable volumes.
16262 * Returns: %TRUE if the @drive contains volumes, %FALSE otherwise.
16267 * g_drive_is_media_check_automatic:
16268 * @drive: a #GDrive.
16270 * Checks if @drive is capabable of automatically detecting media changes.
16272 * Returns: %TRUE if the @drive is capabable of automatically detecting media changes, %FALSE otherwise.
16277 * g_drive_is_media_removable:
16278 * @drive: a #GDrive.
16280 * Checks if the @drive supports removable media.
16282 * Returns: %TRUE if @drive supports removable media, %FALSE otherwise.
16287 * g_drive_poll_for_media:
16288 * @drive: a #GDrive.
16289 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16290 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16291 * @user_data: user data to pass to @callback
16293 * Asynchronously polls @drive to see if media has been inserted or removed.
16295 * When the operation is finished, @callback will be called.
16296 * You can then call g_drive_poll_for_media_finish() to obtain the
16297 * result of the operation.
16302 * g_drive_poll_for_media_finish:
16303 * @drive: a #GDrive.
16304 * @result: a #GAsyncResult.
16305 * @error: a #GError, or %NULL
16307 * Finishes an operation started with g_drive_poll_for_media() on a drive.
16309 * Returns: %TRUE if the drive has been poll_for_mediaed successfully, %FALSE otherwise.
16315 * @drive: a #GDrive.
16316 * @flags: flags affecting the start operation.
16317 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16318 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16319 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16320 * @user_data: user data to pass to @callback
16322 * Asynchronously starts a drive.
16324 * When the operation is finished, @callback will be called.
16325 * You can then call g_drive_start_finish() to obtain the
16326 * result of the operation.
16333 * g_drive_start_finish:
16334 * @drive: a #GDrive.
16335 * @result: a #GAsyncResult.
16336 * @error: a #GError, or %NULL
16338 * Finishes starting a drive.
16340 * Returns: %TRUE if the drive has been started successfully, %FALSE otherwise.
16347 * @drive: a #GDrive.
16348 * @flags: flags affecting the unmount if required for stopping.
16349 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16350 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16351 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16352 * @user_data: user data to pass to @callback
16354 * Asynchronously stops a drive.
16356 * When the operation is finished, @callback will be called.
16357 * You can then call g_drive_stop_finish() to obtain the
16358 * result of the operation.
16365 * g_drive_stop_finish:
16366 * @drive: a #GDrive.
16367 * @result: a #GAsyncResult.
16368 * @error: a #GError, or %NULL
16370 * Finishes stopping a drive.
16372 * Returns: %TRUE if the drive has been stopped successfully, %FALSE otherwise.
16378 * g_emblem_get_icon:
16379 * @emblem: a #GEmblem from which the icon should be extracted.
16381 * Gives back the icon from @emblem.
16383 * Returns: (transfer none): a #GIcon. The returned object belongs to the emblem and should not be modified or freed.
16389 * g_emblem_get_origin:
16390 * @emblem: a #GEmblem
16392 * Gets the origin of the emblem.
16394 * Returns: (transfer none): the origin of the emblem
16401 * @icon: a GIcon containing the icon.
16403 * Creates a new emblem for @icon.
16405 * Returns: a new #GEmblem.
16411 * g_emblem_new_with_origin:
16412 * @icon: a GIcon containing the icon.
16413 * @origin: a GEmblemOrigin enum defining the emblem's origin
16415 * Creates a new emblem for @icon.
16417 * Returns: a new #GEmblem.
16423 * g_emblemed_icon_add_emblem:
16424 * @emblemed: a #GEmblemedIcon
16425 * @emblem: a #GEmblem
16427 * Adds @emblem to the #GList of #GEmblem <!-- -->s.
16434 * g_emblemed_icon_clear_emblems:
16435 * @emblemed: a #GEmblemedIcon
16437 * Removes all the emblems from @icon.
16444 * g_emblemed_icon_get_emblems:
16445 * @emblemed: a #GEmblemedIcon
16447 * Gets the list of emblems for the @icon.
16449 * Returns: (element-type Gio.Emblem) (transfer none): a #GList of #GEmblem <!-- -->s that is owned by @emblemed
16455 * g_emblemed_icon_get_icon:
16456 * @emblemed: a #GEmblemedIcon
16458 * Gets the main icon for @emblemed.
16460 * Returns: (transfer none): a #GIcon that is owned by @emblemed
16466 * g_emblemed_icon_new:
16468 * @emblem: (allow-none): a #GEmblem, or %NULL
16470 * Creates a new emblemed icon for @icon with the emblem @emblem.
16472 * Returns: (transfer full) (type GEmblemedIcon): a new #GIcon
16478 * g_file_append_to:
16479 * @file: input #GFile
16480 * @flags: a set of #GFileCreateFlags
16481 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16482 * @error: a #GError, or %NULL
16484 * Gets an output stream for appending data to the file.
16485 * If the file doesn't already exist it is created.
16487 * By default files created are generally readable by everyone,
16488 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
16489 * will be made readable only to the current user, to the level that
16490 * is supported on the target filesystem.
16492 * If @cancellable is not %NULL, then the operation can be cancelled
16493 * by triggering the cancellable object from another thread. If the
16494 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
16497 * Some file systems don't allow all file names, and may return an
16498 * %G_IO_ERROR_INVALID_FILENAME error. If the file is a directory the
16499 * %G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are
16500 * possible too, and depend on what kind of filesystem the file is on.
16502 * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
16507 * g_file_append_to_async:
16508 * @file: input #GFile
16509 * @flags: a set of #GFileCreateFlags
16510 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
16511 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16512 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
16513 * @user_data: (closure): the data to pass to callback function
16515 * Asynchronously opens @file for appending.
16517 * For more details, see g_file_append_to() which is
16518 * the synchronous version of this call.
16520 * When the operation is finished, @callback will be called.
16521 * You can then call g_file_append_to_finish() to get the result
16522 * of the operation.
16527 * g_file_append_to_finish:
16528 * @file: input #GFile
16529 * @res: #GAsyncResult
16530 * @error: a #GError, or %NULL
16532 * Finishes an asynchronous file append operation started with
16533 * g_file_append_to_async().
16535 * Returns: (transfer full): a valid #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
16540 * g_file_attribute_info_list_add:
16541 * @list: a #GFileAttributeInfoList.
16542 * @name: the name of the attribute to add.
16543 * @type: the #GFileAttributeType for the attribute.
16544 * @flags: #GFileAttributeInfoFlags for the attribute.
16546 * Adds a new attribute with @name to the @list, setting
16547 * its @type and @flags.
16552 * g_file_attribute_info_list_dup:
16553 * @list: a #GFileAttributeInfoList to duplicate.
16555 * Makes a duplicate of a file attribute info list.
16557 * Returns: a copy of the given @list.
16562 * g_file_attribute_info_list_lookup:
16563 * @list: a #GFileAttributeInfoList.
16564 * @name: the name of the attribute to lookup.
16566 * Gets the file attribute with the name @name from @list.
16568 * Returns: a #GFileAttributeInfo for the @name, or %NULL if an attribute isn't found.
16573 * g_file_attribute_info_list_new:
16575 * Creates a new file attribute info list.
16577 * Returns: a #GFileAttributeInfoList.
16582 * g_file_attribute_info_list_ref:
16583 * @list: a #GFileAttributeInfoList to reference.
16585 * References a file attribute info list.
16587 * Returns: #GFileAttributeInfoList or %NULL on error.
16592 * g_file_attribute_info_list_unref:
16593 * @list: The #GFileAttributeInfoList to unreference.
16595 * Removes a reference from the given @list. If the reference count
16596 * falls to zero, the @list is deleted.
16601 * g_file_attribute_matcher_enumerate_namespace:
16602 * @matcher: a #GFileAttributeMatcher.
16603 * @ns: a string containing a file attribute namespace.
16605 * Checks if the matcher will match all of the keys in a given namespace.
16606 * This will always return %TRUE if a wildcard character is in use (e.g. if
16607 * matcher was created with "standard::*" and @ns is "standard", or if matcher was created
16608 * using "*" and namespace is anything.)
16610 * TODO: this is awkwardly worded.
16612 * Returns: %TRUE if the matcher matches all of the entries in the given @ns, %FALSE otherwise.
16617 * g_file_attribute_matcher_enumerate_next:
16618 * @matcher: a #GFileAttributeMatcher.
16620 * Gets the next matched attribute from a #GFileAttributeMatcher.
16622 * Returns: a string containing the next attribute or %NULL if no more attribute exist.
16627 * g_file_attribute_matcher_matches:
16628 * @matcher: a #GFileAttributeMatcher.
16629 * @attribute: a file attribute key.
16631 * Checks if an attribute will be matched by an attribute matcher. If
16632 * the matcher was created with the "*" matching string, this function
16633 * will always return %TRUE.
16635 * Returns: %TRUE if @attribute matches @matcher. %FALSE otherwise.
16640 * g_file_attribute_matcher_matches_only:
16641 * @matcher: a #GFileAttributeMatcher.
16642 * @attribute: a file attribute key.
16644 * Checks if a attribute matcher only matches a given attribute. Always
16645 * returns %FALSE if "*" was used when creating the matcher.
16647 * Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
16652 * g_file_attribute_matcher_new:
16653 * @attributes: an attribute string to match.
16655 * Creates a new file attribute matcher, which matches attributes
16656 * against a given string. #GFileAttributeMatcher<!-- -->s are reference
16657 * counted structures, and are created with a reference count of 1. If
16658 * the number of references falls to 0, the #GFileAttributeMatcher is
16659 * automatically destroyed.
16661 * The @attribute string should be formatted with specific keys separated
16662 * from namespaces with a double colon. Several "namespace::key" strings may be
16663 * concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
16664 * The wildcard "*" may be used to match all keys and namespaces, or
16665 * "namespace::*" will match all keys in a given namespace.
16667 * Examples of strings to use:
16669 * <title>File Attribute Matcher strings and results</title>
16670 * <tgroup cols='2' align='left'><thead>
16671 * <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
16673 * <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
16674 * <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
16675 * <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
16676 * all keys in the unix namespace.</entry></row>
16677 * </tbody></tgroup>
16680 * Returns: a #GFileAttributeMatcher.
16685 * g_file_attribute_matcher_ref:
16686 * @matcher: a #GFileAttributeMatcher.
16688 * References a file attribute matcher.
16690 * Returns: a #GFileAttributeMatcher.
16695 * g_file_attribute_matcher_subtract:
16696 * @matcher: Matcher to subtract from
16697 * @subtract: The matcher to subtract
16699 * Subtracts all attributes of @subtract from @matcher and returns
16700 * a matcher that supports those attributes.
16702 * Note that currently it is not possible to remove a single
16703 * attribute when the @matcher matches the whole namespace - or remove
16704 * a namespace or attribute when the matcher matches everything. This
16705 * is a limitation of the current implementation, but may be fixed
16708 * Returns: A file attribute matcher matching all attributes of @matcher that are not matched by @subtract
16713 * g_file_attribute_matcher_to_string:
16714 * @matcher: (allow-none): a #GFileAttributeMatcher.
16716 * Prints what the matcher is matching against. The format will be
16717 * equal to the format passed to g_file_attribute_matcher_new().
16718 * The output however, might not be identical, as the matcher may
16719 * decide to use a different order or omit needless parts.
16721 * Returns: a string describing the attributes the matcher matches against or %NULL if @matcher was %NULL.
16727 * g_file_attribute_matcher_unref:
16728 * @matcher: a #GFileAttributeMatcher.
16730 * Unreferences @matcher. If the reference count falls below 1,
16731 * the @matcher is automatically freed.
16737 * @source: input #GFile
16738 * @destination: destination #GFile
16739 * @flags: set of #GFileCopyFlags
16740 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16741 * @progress_callback: (allow-none) (scope call): function to callback with progress information, or %NULL if progress information is not needed
16742 * @progress_callback_data: (closure): user data to pass to @progress_callback
16743 * @error: #GError to set on error, or %NULL
16745 * Copies the file @source to the location specified by @destination.
16746 * Can not handle recursive copies of directories.
16748 * If the flag #G_FILE_COPY_OVERWRITE is specified an already
16749 * existing @destination file is overwritten.
16751 * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
16752 * will be copied as symlinks, otherwise the target of the
16753 * @source symlink will be copied.
16755 * If @cancellable is not %NULL, then the operation can be cancelled by
16756 * triggering the cancellable object from another thread. If the operation
16757 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
16759 * If @progress_callback is not %NULL, then the operation can be monitored
16760 * by setting this to a #GFileProgressCallback function.
16761 * @progress_callback_data will be passed to this function. It is guaranteed
16762 * that this callback will be called after all data has been transferred with
16763 * the total number of bytes copied during the operation.
16765 * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND error
16766 * is returned, independent on the status of the @destination.
16768 * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then
16769 * the error %G_IO_ERROR_EXISTS is returned.
16771 * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
16772 * error is returned. If trying to overwrite a directory with a directory the
16773 * %G_IO_ERROR_WOULD_MERGE error is returned.
16775 * If the source is a directory and the target does not exist, or
16776 * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
16777 * %G_IO_ERROR_WOULD_RECURSE error is returned.
16779 * If you are interested in copying the #GFile object itself (not the on-disk
16780 * file), see g_file_dup().
16782 * Returns: %TRUE on success, %FALSE otherwise.
16787 * g_file_copy_async: (skip)
16788 * @source: input #GFile
16789 * @destination: destination #GFile
16790 * @flags: set of #GFileCopyFlags
16791 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
16792 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16793 * @progress_callback: (allow-none): function to callback with progress information, or %NULL if progress information is not needed
16794 * @progress_callback_data: (closure): user data to pass to @progress_callback
16795 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
16796 * @user_data: the data to pass to callback function
16798 * Copies the file @source to the location specified by @destination
16799 * asynchronously. For details of the behaviour, see g_file_copy().
16801 * If @progress_callback is not %NULL, then that function that will be called
16802 * just like in g_file_copy(), however the callback will run in the main loop,
16803 * not in the thread that is doing the I/O operation.
16805 * When the operation is finished, @callback will be called. You can then call
16806 * g_file_copy_finish() to get the result of the operation.
16811 * g_file_copy_attributes:
16812 * @source: a #GFile with attributes
16813 * @destination: a #GFile to copy attributes to
16814 * @flags: a set of #GFileCopyFlags
16815 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16816 * @error: a #GError, %NULL to ignore
16818 * Copies the file attributes from @source to @destination.
16820 * Normally only a subset of the file attributes are copied,
16821 * those that are copies in a normal file copy operation
16822 * (which for instance does not include e.g. owner). However
16823 * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
16824 * all the metadata that is possible to copy is copied. This
16825 * is useful when implementing move by copy + delete source.
16827 * Returns: %TRUE if the attributes were copied successfully, %FALSE otherwise.
16832 * g_file_copy_finish:
16833 * @file: input #GFile
16834 * @res: a #GAsyncResult
16835 * @error: a #GError, or %NULL
16837 * Finishes copying the file started with g_file_copy_async().
16839 * Returns: a %TRUE on success, %FALSE on error.
16845 * @file: input #GFile
16846 * @flags: a set of #GFileCreateFlags
16847 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16848 * @error: a #GError, or %NULL
16850 * Creates a new file and returns an output stream for writing to it.
16851 * The file must not already exist.
16853 * By default files created are generally readable by everyone,
16854 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
16855 * will be made readable only to the current user, to the level
16856 * that is supported on the target filesystem.
16858 * If @cancellable is not %NULL, then the operation can be cancelled
16859 * by triggering the cancellable object from another thread. If the
16860 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
16863 * If a file or directory with this name already exists the
16864 * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
16865 * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
16866 * error, and if the name is to long %G_IO_ERROR_FILENAME_TOO_LONG will
16867 * be returned. Other errors are possible too, and depend on what kind
16868 * of filesystem the file is on.
16870 * Returns: (transfer full): a #GFileOutputStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
16875 * g_file_create_async:
16876 * @file: input #GFile
16877 * @flags: a set of #GFileCreateFlags
16878 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
16879 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16880 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
16881 * @user_data: (closure): the data to pass to callback function
16883 * Asynchronously creates a new file and returns an output stream
16884 * for writing to it. The file must not already exist.
16886 * For more details, see g_file_create() which is
16887 * the synchronous version of this call.
16889 * When the operation is finished, @callback will be called.
16890 * You can then call g_file_create_finish() to get the result
16891 * of the operation.
16896 * g_file_create_finish:
16897 * @file: input #GFile
16898 * @res: a #GAsyncResult
16899 * @error: a #GError, or %NULL
16901 * Finishes an asynchronous file create operation started with
16902 * g_file_create_async().
16904 * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
16909 * g_file_create_readwrite:
16911 * @flags: a set of #GFileCreateFlags
16912 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16913 * @error: return location for a #GError, or %NULL
16915 * Creates a new file and returns a stream for reading and
16916 * writing to it. The file must not already exist.
16918 * By default files created are generally readable by everyone,
16919 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
16920 * will be made readable only to the current user, to the level
16921 * that is supported on the target filesystem.
16923 * If @cancellable is not %NULL, then the operation can be cancelled
16924 * by triggering the cancellable object from another thread. If the
16925 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
16928 * If a file or directory with this name already exists, the
16929 * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
16930 * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
16931 * error, and if the name is too long, %G_IO_ERROR_FILENAME_TOO_LONG
16932 * will be returned. Other errors are possible too, and depend on what
16933 * kind of filesystem the file is on.
16935 * Note that in many non-local file cases read and write streams are
16936 * not supported, so make sure you really need to do read and write
16937 * streaming, rather than just opening for reading or writing.
16939 * Returns: (transfer full): a #GFileIOStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
16945 * g_file_create_readwrite_async:
16946 * @file: input #GFile
16947 * @flags: a set of #GFileCreateFlags
16948 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
16949 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16950 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
16951 * @user_data: (closure): the data to pass to callback function
16953 * Asynchronously creates a new file and returns a stream
16954 * for reading and writing to it. The file must not already exist.
16956 * For more details, see g_file_create_readwrite() which is
16957 * the synchronous version of this call.
16959 * When the operation is finished, @callback will be called.
16960 * You can then call g_file_create_readwrite_finish() to get
16961 * the result of the operation.
16968 * g_file_create_readwrite_finish:
16969 * @file: input #GFile
16970 * @res: a #GAsyncResult
16971 * @error: a #GError, or %NULL
16973 * Finishes an asynchronous file create operation started with
16974 * g_file_create_readwrite_async().
16976 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
16983 * @file: input #GFile
16984 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16985 * @error: a #GError, or %NULL
16987 * Deletes a file. If the @file is a directory, it will only be
16988 * deleted if it is empty. This has the same semantics as g_unlink().
16990 * If @cancellable is not %NULL, then the operation can be cancelled by
16991 * triggering the cancellable object from another thread. If the operation
16992 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
16994 * Virtual: delete_file
16995 * Returns: %TRUE if the file was deleted. %FALSE otherwise.
17000 * g_file_delete_async:
17001 * @file: input #GFile
17002 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17003 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17004 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17005 * @user_data: the data to pass to callback function
17007 * Asynchronously delete a file. If the @file is a directory, it will
17008 * only be deleted if it is empty. This has the same semantics as
17011 * Virtual: delete_file_async
17017 * g_file_delete_finish:
17018 * @file: input #GFile
17019 * @result: a #GAsyncResult
17020 * @error: a #GError, or %NULL
17022 * Finishes deleting a file started with g_file_delete_async().
17024 * Virtual: delete_file_finish
17030 * g_file_descriptor_based_get_fd:
17031 * @fd_based: a #GFileDescriptorBased.
17033 * Gets the underlying file descriptor.
17035 * Returns: The file descriptor
17042 * @file: input #GFile
17044 * Duplicates a #GFile handle. This operation does not duplicate
17045 * the actual file or directory represented by the #GFile; see
17046 * g_file_copy() if attempting to copy a file.
17048 * This call does no blocking I/O.
17050 * Returns: (transfer full): a new #GFile that is a duplicate of the given #GFile.
17055 * g_file_eject_mountable:
17056 * @file: input #GFile
17057 * @flags: flags affecting the operation
17058 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17059 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17060 * @user_data: (closure): the data to pass to callback function
17062 * Starts an asynchronous eject on a mountable.
17063 * When this operation has completed, @callback will be called with
17064 * @user_user data, and the operation can be finalized with
17065 * g_file_eject_mountable_finish().
17067 * If @cancellable is not %NULL, then the operation can be cancelled by
17068 * triggering the cancellable object from another thread. If the operation
17069 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17071 * Deprecated: 2.22: Use g_file_eject_mountable_with_operation() instead.
17076 * g_file_eject_mountable_finish:
17077 * @file: input #GFile
17078 * @result: a #GAsyncResult
17079 * @error: a #GError, or %NULL
17081 * Finishes an asynchronous eject operation started by
17082 * g_file_eject_mountable().
17084 * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17085 * Deprecated: 2.22: Use g_file_eject_mountable_with_operation_finish() instead.
17090 * g_file_eject_mountable_with_operation:
17091 * @file: input #GFile
17092 * @flags: flags affecting the operation
17093 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
17094 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17095 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17096 * @user_data: (closure): the data to pass to callback function
17098 * Starts an asynchronous eject on a mountable.
17099 * When this operation has completed, @callback will be called with
17100 * @user_user data, and the operation can be finalized with
17101 * g_file_eject_mountable_with_operation_finish().
17103 * If @cancellable is not %NULL, then the operation can be cancelled by
17104 * triggering the cancellable object from another thread. If the operation
17105 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17112 * g_file_eject_mountable_with_operation_finish:
17113 * @file: input #GFile
17114 * @result: a #GAsyncResult
17115 * @error: a #GError, or %NULL
17117 * Finishes an asynchronous eject operation started by
17118 * g_file_eject_mountable_with_operation().
17120 * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17126 * g_file_enumerate_children:
17127 * @file: input #GFile
17128 * @attributes: an attribute query string
17129 * @flags: a set of #GFileQueryInfoFlags
17130 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17131 * @error: #GError for error reporting
17133 * Gets the requested information about the files in a directory.
17134 * The result is a #GFileEnumerator object that will give out
17135 * #GFileInfo objects for all the files in the directory.
17137 * The @attributes value is a string that specifies the file
17138 * attributes that should be gathered. It is not an error if
17139 * it's not possible to read a particular requested attribute
17140 * from a file - it just won't be set. @attributes should
17141 * be a comma-separated list of attributes or attribute wildcards.
17142 * The wildcard "*" means all attributes, and a wildcard like
17143 * "standard::*" means all attributes in the standard namespace.
17144 * An example attribute query be "standard::*,owner::user".
17145 * The standard attributes are available as defines, like
17146 * #G_FILE_ATTRIBUTE_STANDARD_NAME.
17148 * If @cancellable is not %NULL, then the operation can be cancelled
17149 * by triggering the cancellable object from another thread. If the
17150 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17153 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
17154 * be returned. If the file is not a directory, the %G_IO_ERROR_NOT_DIRECTORY
17155 * error will be returned. Other errors are possible too.
17157 * Returns: (transfer full): A #GFileEnumerator if successful, %NULL on error. Free the returned object with g_object_unref().
17162 * g_file_enumerate_children_async:
17163 * @file: input #GFile
17164 * @attributes: an attribute query string
17165 * @flags: a set of #GFileQueryInfoFlags
17166 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17167 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17168 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17169 * @user_data: (closure): the data to pass to callback function
17171 * Asynchronously gets the requested information about the files
17172 * in a directory. The result is a #GFileEnumerator object that will
17173 * give out #GFileInfo objects for all the files in the directory.
17175 * For more details, see g_file_enumerate_children() which is
17176 * the synchronous version of this call.
17178 * When the operation is finished, @callback will be called. You can
17179 * then call g_file_enumerate_children_finish() to get the result of
17185 * g_file_enumerate_children_finish:
17186 * @file: input #GFile
17187 * @res: a #GAsyncResult
17188 * @error: a #GError
17190 * Finishes an async enumerate children operation.
17191 * See g_file_enumerate_children_async().
17193 * Returns: (transfer full): a #GFileEnumerator or %NULL if an error occurred. Free the returned object with g_object_unref().
17198 * g_file_enumerator_close:
17199 * @enumerator: a #GFileEnumerator.
17200 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17201 * @error: location to store the error occurring, or %NULL to ignore
17203 * Releases all resources used by this enumerator, making the
17204 * enumerator return %G_IO_ERROR_CLOSED on all calls.
17206 * This will be automatically called when the last reference
17207 * is dropped, but you might want to call this function to make
17208 * sure resources are released as early as possible.
17210 * Returns: #TRUE on success or #FALSE on error.
17215 * g_file_enumerator_close_async:
17216 * @enumerator: a #GFileEnumerator.
17217 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17218 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17219 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17220 * @user_data: (closure): the data to pass to callback function
17222 * Asynchronously closes the file enumerator.
17224 * If @cancellable is not %NULL, then the operation can be cancelled by
17225 * triggering the cancellable object from another thread. If the operation
17226 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
17227 * g_file_enumerator_close_finish().
17232 * g_file_enumerator_close_finish:
17233 * @enumerator: a #GFileEnumerator.
17234 * @result: a #GAsyncResult.
17235 * @error: a #GError location to store the error occurring, or %NULL to ignore.
17237 * Finishes closing a file enumerator, started from g_file_enumerator_close_async().
17239 * If the file enumerator was already closed when g_file_enumerator_close_async()
17240 * was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
17241 * return %FALSE. If the file enumerator had pending operation when the close
17242 * operation was started, then this function will report %G_IO_ERROR_PENDING, and
17243 * return %FALSE. If @cancellable was not %NULL, then the operation may have been
17244 * cancelled by triggering the cancellable object from another thread. If the operation
17245 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
17248 * Returns: %TRUE if the close operation has finished successfully.
17253 * g_file_enumerator_get_child:
17254 * @enumerator: a #GFileEnumerator
17255 * @info: a #GFileInfo gotten from g_file_enumerator_next_file() or the async equivalents.
17257 * Return a new #GFile which refers to the file named by @info in the source
17258 * directory of @enumerator. This function is primarily intended to be used
17259 * inside loops with g_file_enumerator_next_file().
17261 * This is a convenience method that's equivalent to:
17263 * gchar *name = g_file_info_get_name (info);
17264 * GFile *child = g_file_get_child (g_file_enumerator_get_container (enumr),
17268 * Returns: (transfer full): a #GFile for the #GFileInfo passed it.
17274 * g_file_enumerator_get_container:
17275 * @enumerator: a #GFileEnumerator
17277 * Get the #GFile container which is being enumerated.
17279 * Returns: (transfer none): the #GFile which is being enumerated.
17285 * g_file_enumerator_has_pending:
17286 * @enumerator: a #GFileEnumerator.
17288 * Checks if the file enumerator has pending operations.
17290 * Returns: %TRUE if the @enumerator has pending operations.
17295 * g_file_enumerator_is_closed:
17296 * @enumerator: a #GFileEnumerator.
17298 * Checks if the file enumerator has been closed.
17300 * Returns: %TRUE if the @enumerator is closed.
17305 * g_file_enumerator_next_file:
17306 * @enumerator: a #GFileEnumerator.
17307 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17308 * @error: location to store the error occurring, or %NULL to ignore
17310 * Returns information for the next file in the enumerated object.
17311 * Will block until the information is available. The #GFileInfo
17312 * returned from this function will contain attributes that match the
17313 * attribute string that was passed when the #GFileEnumerator was created.
17315 * On error, returns %NULL and sets @error to the error. If the
17316 * enumerator is at the end, %NULL will be returned and @error will
17319 * 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.
17324 * g_file_enumerator_next_files_async:
17325 * @enumerator: a #GFileEnumerator.
17326 * @num_files: the number of file info objects to request
17327 * @io_priority: the <link linkend="io-priority">io priority</link> of the request.
17328 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17329 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17330 * @user_data: (closure): the data to pass to callback function
17332 * Request information for a number of files from the enumerator asynchronously.
17333 * When all i/o for the operation is finished the @callback will be called with
17334 * the requested information.
17336 * The callback can be called with less than @num_files files in case of error
17337 * or at the end of the enumerator. In case of a partial error the callback will
17338 * be called with any succeeding items and no error, and on the next request the
17339 * error will be reported. If a request is cancelled the callback will be called
17340 * with %G_IO_ERROR_CANCELLED.
17342 * During an async request no other sync and async calls are allowed, and will
17343 * result in %G_IO_ERROR_PENDING errors.
17345 * Any outstanding i/o request with higher priority (lower numerical value) will
17346 * be executed before an outstanding request with lower priority. Default
17347 * priority is %G_PRIORITY_DEFAULT.
17352 * g_file_enumerator_next_files_finish:
17353 * @enumerator: a #GFileEnumerator.
17354 * @result: a #GAsyncResult.
17355 * @error: a #GError location to store the error occurring, or %NULL to ignore.
17357 * Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
17359 * 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.
17364 * g_file_enumerator_set_pending:
17365 * @enumerator: a #GFileEnumerator.
17366 * @pending: a boolean value.
17368 * Sets the file enumerator as having pending operations.
17374 * @file1: the first #GFile
17375 * @file2: the second #GFile
17377 * Checks equality of two given #GFiles.
17379 * Note that two #GFiles that differ can still refer to the same
17380 * file on the filesystem due to various forms of filename
17383 * This call does no blocking I/O.
17385 * Returns: %TRUE if @file1 and @file2 are equal. %FALSE if either is not a #GFile.
17390 * g_file_find_enclosing_mount:
17391 * @file: input #GFile
17392 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17393 * @error: a #GError
17395 * Gets a #GMount for the #GFile.
17397 * If the #GFileIface for @file does not have a mount (e.g.
17398 * possibly a remote share), @error will be set to %G_IO_ERROR_NOT_FOUND
17399 * and %NULL will be returned.
17401 * If @cancellable is not %NULL, then the operation can be cancelled by
17402 * triggering the cancellable object from another thread. If the operation
17403 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17405 * Returns: (transfer full): a #GMount where the @file is located or %NULL on error. Free the returned object with g_object_unref().
17410 * g_file_find_enclosing_mount_async:
17412 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17413 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17414 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17415 * @user_data: (closure): the data to pass to callback function
17417 * Asynchronously gets the mount for the file.
17419 * For more details, see g_file_find_enclosing_mount() which is
17420 * the synchronous version of this call.
17422 * When the operation is finished, @callback will be called.
17423 * You can then call g_file_find_enclosing_mount_finish() to
17424 * get the result of the operation.
17429 * g_file_find_enclosing_mount_finish:
17431 * @res: a #GAsyncResult
17432 * @error: a #GError
17434 * Finishes an asynchronous find mount request.
17435 * See g_file_find_enclosing_mount_async().
17437 * Returns: (transfer full): #GMount for given @file or %NULL on error. Free the returned object with g_object_unref().
17442 * g_file_get_basename:
17443 * @file: input #GFile
17445 * Gets the base name (the last component of the path) for a given #GFile.
17447 * If called for the top level of a system (such as the filesystem root
17448 * or a uri like sftp://host/) it will return a single directory separator
17449 * (and on Windows, possibly a drive letter).
17451 * The base name is a byte string (not UTF-8). It has no defined encoding
17452 * or rules other than it may not contain zero bytes. If you want to use
17453 * filenames in a user interface you should use the display name that you
17454 * can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
17455 * attribute with g_file_query_info().
17457 * This call does no blocking I/O.
17459 * 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.
17464 * g_file_get_child:
17465 * @file: input #GFile
17466 * @name: string containing the child's basename
17468 * Gets a child of @file with basename equal to @name.
17470 * Note that the file with that specific name might not exist, but
17471 * you can still have a #GFile that points to it. You can use this
17472 * for instance to create that file.
17474 * This call does no blocking I/O.
17476 * Returns: (transfer full): a #GFile to a child specified by @name. Free the returned object with g_object_unref().
17481 * g_file_get_child_for_display_name:
17482 * @file: input #GFile
17483 * @display_name: string to a possible child
17484 * @error: return location for an error
17486 * Gets the child of @file for a given @display_name (i.e. a UTF-8
17487 * version of the name). If this function fails, it returns %NULL
17488 * and @error will be set. This is very useful when constructing a
17489 * #GFile for a new file and the user entered the filename in the
17490 * user interface, for instance when you select a directory and
17491 * type a filename in the file selector.
17493 * This call does no blocking I/O.
17495 * 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().
17500 * g_file_get_parent:
17501 * @file: input #GFile
17503 * Gets the parent directory for the @file.
17504 * If the @file represents the root directory of the
17505 * file system, then %NULL will be returned.
17507 * This call does no blocking I/O.
17509 * 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().
17514 * g_file_get_parse_name:
17515 * @file: input #GFile
17517 * Gets the parse name of the @file.
17518 * A parse name is a UTF-8 string that describes the
17519 * file such that one can get the #GFile back using
17520 * g_file_parse_name().
17522 * This is generally used to show the #GFile as a nice
17523 * full-pathname kind of string in a user interface,
17524 * like in a location entry.
17526 * For local files with names that can safely be converted
17527 * to UTF-8 the pathname is used, otherwise the IRI is used
17528 * (a form of URI that allows UTF-8 characters unescaped).
17530 * This call does no blocking I/O.
17532 * Returns: a string containing the #GFile's parse name. The returned string should be freed with g_free() when no longer needed.
17538 * @file: input #GFile
17540 * Gets the local pathname for #GFile, if one exists.
17542 * This call does no blocking I/O.
17544 * 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.
17549 * g_file_get_relative_path:
17550 * @parent: input #GFile
17551 * @descendant: input #GFile
17553 * Gets the path for @descendant relative to @parent.
17555 * This call does no blocking I/O.
17557 * 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.
17563 * @file: input #GFile
17565 * Gets the URI for the @file.
17567 * This call does no blocking I/O.
17569 * Returns: a string containing the #GFile's URI. The returned string should be freed with g_free() when no longer needed.
17574 * g_file_get_uri_scheme:
17575 * @file: input #GFile
17577 * Gets the URI scheme for a #GFile.
17578 * RFC 3986 decodes the scheme as:
17580 * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
17581 * </programlisting>
17582 * Common schemes include "file", "http", "ftp", etc.
17584 * This call does no blocking I/O.
17586 * Returns: a string containing the URI scheme for the given #GFile. The returned string should be freed with g_free() when no longer needed.
17591 * g_file_has_parent:
17592 * @file: input #GFile
17593 * @parent: (allow-none): the parent to check for, or %NULL
17595 * Checks if @file has a parent, and optionally, if it is @parent.
17597 * If @parent is %NULL then this function returns %TRUE if @file has any
17598 * parent at all. If @parent is non-%NULL then %TRUE is only returned
17599 * if @file is a child of @parent.
17601 * Returns: %TRUE if @file is a child of @parent (or any parent in the case that @parent is %NULL).
17607 * g_file_has_prefix:
17608 * @file: input #GFile
17609 * @prefix: input #GFile
17611 * Checks whether @file has the prefix specified by @prefix.
17613 * In other words, if the names of initial elements of @file's
17614 * pathname match @prefix. Only full pathname elements are matched,
17615 * so a path like /foo is not considered a prefix of /foobar, only
17618 * This call does no I/O, as it works purely on names. As such it can
17619 * sometimes return %FALSE even if @file is inside a @prefix (from a
17620 * filesystem point of view), because the prefix of @file is an alias
17623 * Virtual: prefix_matches
17624 * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix, %FALSE otherwise.
17629 * g_file_has_uri_scheme:
17630 * @file: input #GFile
17631 * @uri_scheme: a string containing a URI scheme
17633 * Checks to see if a #GFile has a given URI scheme.
17635 * This call does no blocking I/O.
17637 * Returns: %TRUE if #GFile's backend supports the given URI scheme, %FALSE if URI scheme is %NULL, not supported, or #GFile is invalid.
17643 * @file: (type GFile): #gconstpointer to a #GFile
17645 * Creates a hash value for a #GFile.
17647 * This call does no blocking I/O.
17650 * 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.
17655 * g_file_icon_get_file:
17658 * Gets the #GFile associated with the given @icon.
17660 * Returns: (transfer none): a #GFile, or %NULL.
17668 * Creates a new icon for a file.
17670 * Returns: (transfer full) (type GFileIcon): a #GIcon for the given @file, or %NULL on error.
17675 * g_file_info_clear_status:
17676 * @info: a #GFileInfo.
17678 * Clears the status information from @info.
17683 * g_file_info_copy_into:
17684 * @src_info: source to copy attributes from.
17685 * @dest_info: destination to copy attributes to.
17687 * Copies all of the <link linkend="gio-GFileAttribute">GFileAttribute</link>s
17688 * from @src_info to @dest_info.
17694 * @other: a #GFileInfo.
17696 * Duplicates a file info structure.
17698 * Returns: (transfer full): a duplicate #GFileInfo of @other.
17703 * g_file_info_get_attribute_as_string:
17704 * @info: a #GFileInfo.
17705 * @attribute: a file attribute key.
17707 * Gets the value of a attribute, formated as a string.
17708 * This escapes things as needed to make the string valid
17711 * Returns: a UTF-8 string associated with the given @attribute. When you're done with the string it must be freed with g_free().
17716 * g_file_info_get_attribute_boolean:
17717 * @info: a #GFileInfo.
17718 * @attribute: a file attribute key.
17720 * Gets the value of a boolean attribute. If the attribute does not
17721 * contain a boolean value, %FALSE will be returned.
17723 * Returns: the boolean value contained within the attribute.
17728 * g_file_info_get_attribute_byte_string:
17729 * @info: a #GFileInfo.
17730 * @attribute: a file attribute key.
17732 * Gets the value of a byte string attribute. If the attribute does
17733 * not contain a byte string, %NULL will be returned.
17735 * Returns: the contents of the @attribute value as a byte string, or %NULL otherwise.
17740 * g_file_info_get_attribute_data:
17741 * @info: a #GFileInfo
17742 * @attribute: a file attribute key
17743 * @type: (out) (allow-none): return location for the attribute type, or %NULL
17744 * @value_pp: (out) (allow-none): return location for the attribute value, or %NULL
17745 * @status: (out) (allow-none): return location for the attribute status, or %NULL
17747 * Gets the attribute type, value and status for an attribute key.
17749 * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
17754 * g_file_info_get_attribute_int32:
17755 * @info: a #GFileInfo.
17756 * @attribute: a file attribute key.
17758 * Gets a signed 32-bit integer contained within the attribute. If the
17759 * attribute does not contain a signed 32-bit integer, or is invalid,
17760 * 0 will be returned.
17762 * Returns: a signed 32-bit integer from the attribute.
17767 * g_file_info_get_attribute_int64:
17768 * @info: a #GFileInfo.
17769 * @attribute: a file attribute key.
17771 * Gets a signed 64-bit integer contained within the attribute. If the
17772 * attribute does not contain an signed 64-bit integer, or is invalid,
17773 * 0 will be returned.
17775 * Returns: a signed 64-bit integer from the attribute.
17780 * g_file_info_get_attribute_object:
17781 * @info: a #GFileInfo.
17782 * @attribute: a file attribute key.
17784 * Gets the value of a #GObject attribute. If the attribute does
17785 * not contain a #GObject, %NULL will be returned.
17787 * Returns: (transfer none): a #GObject associated with the given @attribute, or %NULL otherwise.
17792 * g_file_info_get_attribute_status:
17793 * @info: a #GFileInfo
17794 * @attribute: a file attribute key
17796 * Gets the attribute status for an attribute key.
17798 * Returns: a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
17803 * g_file_info_get_attribute_string:
17804 * @info: a #GFileInfo.
17805 * @attribute: a file attribute key.
17807 * Gets the value of a string attribute. If the attribute does
17808 * not contain a string, %NULL will be returned.
17810 * Returns: the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
17815 * g_file_info_get_attribute_stringv:
17816 * @info: a #GFileInfo.
17817 * @attribute: a file attribute key.
17819 * Gets the value of a stringv attribute. If the attribute does
17820 * not contain a stringv, %NULL will be returned.
17822 * Returns: (transfer none): the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
17828 * g_file_info_get_attribute_type:
17829 * @info: a #GFileInfo.
17830 * @attribute: a file attribute key.
17832 * Gets the attribute type for an attribute key.
17834 * Returns: a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
17839 * g_file_info_get_attribute_uint32:
17840 * @info: a #GFileInfo.
17841 * @attribute: a file attribute key.
17843 * Gets an unsigned 32-bit integer contained within the attribute. If the
17844 * attribute does not contain an unsigned 32-bit integer, or is invalid,
17845 * 0 will be returned.
17847 * Returns: an unsigned 32-bit integer from the attribute.
17852 * g_file_info_get_attribute_uint64:
17853 * @info: a #GFileInfo.
17854 * @attribute: a file attribute key.
17856 * Gets a unsigned 64-bit integer contained within the attribute. If the
17857 * attribute does not contain an unsigned 64-bit integer, or is invalid,
17858 * 0 will be returned.
17860 * Returns: a unsigned 64-bit integer from the attribute.
17865 * g_file_info_get_content_type:
17866 * @info: a #GFileInfo.
17868 * Gets the file's content type.
17870 * Returns: a string containing the file's content type.
17875 * g_file_info_get_deletion_date:
17876 * @info: a #GFileInfo.
17878 * Returns the #GDateTime representing the deletion date of the file, as
17879 * available in G_FILE_ATTRIBUTE_TRASH_DELETION_DATE. If the
17880 * G_FILE_ATTRIBUTE_TRASH_DELETION_DATE attribute is unset, %NULL is returned.
17882 * Returns: a #GDateTime, or %NULL.
17888 * g_file_info_get_display_name:
17889 * @info: a #GFileInfo.
17891 * Gets a display name for a file.
17893 * Returns: a string containing the display name.
17898 * g_file_info_get_edit_name:
17899 * @info: a #GFileInfo.
17901 * Gets the edit name for a file.
17903 * Returns: a string containing the edit name.
17908 * g_file_info_get_etag:
17909 * @info: a #GFileInfo.
17911 * Gets the <link linkend="gfile-etag">entity tag</link> for a given
17912 * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
17914 * Returns: a string containing the value of the "etag:value" attribute.
17919 * g_file_info_get_file_type:
17920 * @info: a #GFileInfo.
17922 * Gets a file's type (whether it is a regular file, symlink, etc).
17923 * This is different from the file's content type, see g_file_info_get_content_type().
17925 * Returns: a #GFileType for the given file.
17930 * g_file_info_get_icon:
17931 * @info: a #GFileInfo.
17933 * Gets the icon for a file.
17935 * Returns: (transfer none): #GIcon for the given @info.
17940 * g_file_info_get_is_backup:
17941 * @info: a #GFileInfo.
17943 * Checks if a file is a backup file.
17945 * Returns: %TRUE if file is a backup file, %FALSE otherwise.
17950 * g_file_info_get_is_hidden:
17951 * @info: a #GFileInfo.
17953 * Checks if a file is hidden.
17955 * Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
17960 * g_file_info_get_is_symlink:
17961 * @info: a #GFileInfo.
17963 * Checks if a file is a symlink.
17965 * Returns: %TRUE if the given @info is a symlink.
17970 * g_file_info_get_modification_time:
17971 * @info: a #GFileInfo.
17972 * @result: (out caller-allocates): a #GTimeVal.
17974 * Gets the modification time of the current @info and sets it
17980 * g_file_info_get_name:
17981 * @info: a #GFileInfo.
17983 * Gets the name for a file.
17985 * Returns: a string containing the file name.
17990 * g_file_info_get_size:
17991 * @info: a #GFileInfo.
17993 * Gets the file's size.
17995 * Returns: a #goffset containing the file's size.
18000 * g_file_info_get_sort_order:
18001 * @info: a #GFileInfo.
18003 * Gets the value of the sort_order attribute from the #GFileInfo.
18004 * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18006 * Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
18011 * g_file_info_get_symbolic_icon:
18012 * @info: a #GFileInfo.
18014 * Gets the symbolic icon for a file.
18016 * Returns: (transfer none): #GIcon for the given @info.
18022 * g_file_info_get_symlink_target:
18023 * @info: a #GFileInfo.
18025 * Gets the symlink target for a given #GFileInfo.
18027 * Returns: a string containing the symlink target.
18032 * g_file_info_has_attribute:
18033 * @info: a #GFileInfo.
18034 * @attribute: a file attribute key.
18036 * Checks if a file info structure has an attribute named @attribute.
18038 * Returns: %TRUE if @Ginfo has an attribute named @attribute, %FALSE otherwise.
18043 * g_file_info_has_namespace:
18044 * @info: a #GFileInfo.
18045 * @name_space: a file attribute namespace.
18047 * Checks if a file info structure has an attribute in the
18048 * specified @name_space.
18050 * Returns: %TRUE if @Ginfo has an attribute in @name_space, %FALSE otherwise.
18056 * g_file_info_list_attributes:
18057 * @info: a #GFileInfo.
18058 * @name_space: a file attribute key's namespace.
18060 * Lists the file info structure's attributes.
18062 * 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.
18069 * Creates a new file info structure.
18071 * Returns: a #GFileInfo.
18076 * g_file_info_remove_attribute:
18077 * @info: a #GFileInfo.
18078 * @attribute: a file attribute key.
18080 * Removes all cases of @attribute from @info if it exists.
18085 * g_file_info_set_attribute:
18086 * @info: a #GFileInfo.
18087 * @attribute: a file attribute key.
18088 * @type: a #GFileAttributeType
18089 * @value_p: pointer to the value
18091 * Sets the @attribute to contain the given value, if possible. To unset the
18092 * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
18097 * g_file_info_set_attribute_boolean:
18098 * @info: a #GFileInfo.
18099 * @attribute: a file attribute key.
18100 * @attr_value: a boolean value.
18102 * Sets the @attribute to contain the given @attr_value,
18108 * g_file_info_set_attribute_byte_string:
18109 * @info: a #GFileInfo.
18110 * @attribute: a file attribute key.
18111 * @attr_value: a byte string.
18113 * Sets the @attribute to contain the given @attr_value,
18119 * g_file_info_set_attribute_int32:
18120 * @info: a #GFileInfo.
18121 * @attribute: a file attribute key.
18122 * @attr_value: a signed 32-bit integer
18124 * Sets the @attribute to contain the given @attr_value,
18130 * g_file_info_set_attribute_int64:
18131 * @info: a #GFileInfo.
18132 * @attribute: attribute name to set.
18133 * @attr_value: int64 value to set attribute to.
18135 * Sets the @attribute to contain the given @attr_value,
18141 * g_file_info_set_attribute_mask:
18142 * @info: a #GFileInfo.
18143 * @mask: a #GFileAttributeMatcher.
18145 * Sets @mask on @info to match specific attribute types.
18150 * g_file_info_set_attribute_object:
18151 * @info: a #GFileInfo.
18152 * @attribute: a file attribute key.
18153 * @attr_value: a #GObject.
18155 * Sets the @attribute to contain the given @attr_value,
18161 * g_file_info_set_attribute_status:
18162 * @info: a #GFileInfo
18163 * @attribute: a file attribute key
18164 * @status: a #GFileAttributeStatus
18166 * Sets the attribute status for an attribute key. This is only
18167 * needed by external code that implement g_file_set_attributes_from_info()
18168 * or similar functions.
18170 * The attribute must exist in @info for this to work. Otherwise %FALSE
18171 * is returned and @info is unchanged.
18173 * Returns: %TRUE if the status was changed, %FALSE if the key was not set.
18179 * g_file_info_set_attribute_string:
18180 * @info: a #GFileInfo.
18181 * @attribute: a file attribute key.
18182 * @attr_value: a UTF-8 string.
18184 * Sets the @attribute to contain the given @attr_value,
18190 * g_file_info_set_attribute_stringv:
18191 * @info: a #GFileInfo.
18192 * @attribute: a file attribute key
18193 * @attr_value: (array) (element-type utf8): a %NULL terminated array of UTF-8 strings.
18195 * Sets the @attribute to contain the given @attr_value,
18203 * g_file_info_set_attribute_uint32:
18204 * @info: a #GFileInfo.
18205 * @attribute: a file attribute key.
18206 * @attr_value: an unsigned 32-bit integer.
18208 * Sets the @attribute to contain the given @attr_value,
18214 * g_file_info_set_attribute_uint64:
18215 * @info: a #GFileInfo.
18216 * @attribute: a file attribute key.
18217 * @attr_value: an unsigned 64-bit integer.
18219 * Sets the @attribute to contain the given @attr_value,
18225 * g_file_info_set_content_type:
18226 * @info: a #GFileInfo.
18227 * @content_type: a content type. See <link linkend="gio-GContentType">GContentType</link>.
18229 * Sets the content type attribute for a given #GFileInfo.
18230 * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
18235 * g_file_info_set_display_name:
18236 * @info: a #GFileInfo.
18237 * @display_name: a string containing a display name.
18239 * Sets the display name for the current #GFileInfo.
18240 * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
18245 * g_file_info_set_edit_name:
18246 * @info: a #GFileInfo.
18247 * @edit_name: a string containing an edit name.
18249 * Sets the edit name for the current file.
18250 * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
18255 * g_file_info_set_file_type:
18256 * @info: a #GFileInfo.
18257 * @type: a #GFileType.
18259 * Sets the file type in a #GFileInfo to @type.
18260 * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
18265 * g_file_info_set_icon:
18266 * @info: a #GFileInfo.
18269 * Sets the icon for a given #GFileInfo.
18270 * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
18275 * g_file_info_set_is_hidden:
18276 * @info: a #GFileInfo.
18277 * @is_hidden: a #gboolean.
18279 * Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
18280 * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
18285 * g_file_info_set_is_symlink:
18286 * @info: a #GFileInfo.
18287 * @is_symlink: a #gboolean.
18289 * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
18290 * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
18295 * g_file_info_set_modification_time:
18296 * @info: a #GFileInfo.
18297 * @mtime: a #GTimeVal.
18299 * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
18300 * info to the given time value.
18305 * g_file_info_set_name:
18306 * @info: a #GFileInfo.
18307 * @name: a string containing a name.
18309 * Sets the name attribute for the current #GFileInfo.
18310 * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
18315 * g_file_info_set_size:
18316 * @info: a #GFileInfo.
18317 * @size: a #goffset containing the file's size.
18319 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
18320 * to the given size.
18325 * g_file_info_set_sort_order:
18326 * @info: a #GFileInfo.
18327 * @sort_order: a sort order integer.
18329 * Sets the sort order attribute in the file info structure. See
18330 * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18335 * g_file_info_set_symbolic_icon:
18336 * @info: a #GFileInfo.
18339 * Sets the symbolic icon for a given #GFileInfo.
18340 * See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
18347 * g_file_info_set_symlink_target:
18348 * @info: a #GFileInfo.
18349 * @symlink_target: a static string containing a path to a symlink target.
18351 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
18352 * to the given symlink target.
18357 * g_file_info_unset_attribute_mask:
18358 * @info: #GFileInfo.
18360 * Unsets a mask set by g_file_info_set_attribute_mask(), if one
18366 * g_file_input_stream_query_info:
18367 * @stream: a #GFileInputStream.
18368 * @attributes: a file attribute query string.
18369 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18370 * @error: a #GError location to store the error occurring, or %NULL to ignore.
18372 * Queries a file input stream the given @attributes. This function blocks
18373 * while querying the stream. For the asynchronous (non-blocking) version
18374 * of this function, see g_file_input_stream_query_info_async(). While the
18375 * stream is blocked, the stream will set the pending flag internally, and
18376 * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
18378 * Returns: (transfer full): a #GFileInfo, or %NULL on error.
18383 * g_file_input_stream_query_info_async:
18384 * @stream: a #GFileInputStream.
18385 * @attributes: a file attribute query string.
18386 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18387 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18388 * @callback: (scope async): callback to call when the request is satisfied
18389 * @user_data: (closure): the data to pass to callback function
18391 * Queries the stream information asynchronously.
18392 * When the operation is finished @callback will be called.
18393 * You can then call g_file_input_stream_query_info_finish()
18394 * to get the result of the operation.
18396 * For the synchronous version of this function,
18397 * see g_file_input_stream_query_info().
18399 * If @cancellable is not %NULL, then the operation can be cancelled by
18400 * triggering the cancellable object from another thread. If the operation
18401 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set
18406 * g_file_input_stream_query_info_finish:
18407 * @stream: a #GFileInputStream.
18408 * @result: a #GAsyncResult.
18409 * @error: a #GError location to store the error occurring, or %NULL to ignore.
18411 * Finishes an asynchronous info query operation.
18413 * Returns: (transfer full): #GFileInfo.
18418 * g_file_io_stream_get_etag:
18419 * @stream: a #GFileIOStream.
18421 * Gets the entity tag for the file when it has been written.
18422 * This must be called after the stream has been written
18423 * and closed, as the etag can change while writing.
18425 * Returns: the entity tag for the stream.
18431 * g_file_io_stream_query_info:
18432 * @stream: a #GFileIOStream.
18433 * @attributes: a file attribute query string.
18434 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18435 * @error: a #GError, %NULL to ignore.
18437 * Queries a file io stream for the given @attributes.
18438 * This function blocks while querying the stream. For the asynchronous
18439 * version of this function, see g_file_io_stream_query_info_async().
18440 * While the stream is blocked, the stream will set the pending flag
18441 * internally, and any other operations on the stream will fail with
18442 * %G_IO_ERROR_PENDING.
18444 * Can fail if the stream was already closed (with @error being set to
18445 * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
18446 * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
18447 * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
18448 * all cases of failure, %NULL will be returned.
18450 * If @cancellable is not %NULL, then the operation can be cancelled by
18451 * triggering the cancellable object from another thread. If the operation
18452 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
18455 * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
18461 * g_file_io_stream_query_info_async:
18462 * @stream: a #GFileIOStream.
18463 * @attributes: a file attribute query string.
18464 * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
18465 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18466 * @callback: (scope async): callback to call when the request is satisfied
18467 * @user_data: (closure): the data to pass to callback function
18469 * Asynchronously queries the @stream for a #GFileInfo. When completed,
18470 * @callback will be called with a #GAsyncResult which can be used to
18471 * finish the operation with g_file_io_stream_query_info_finish().
18473 * For the synchronous version of this function, see
18474 * g_file_io_stream_query_info().
18481 * g_file_io_stream_query_info_finish:
18482 * @stream: a #GFileIOStream.
18483 * @result: a #GAsyncResult.
18484 * @error: a #GError, %NULL to ignore.
18486 * Finalizes the asynchronous query started
18487 * by g_file_io_stream_query_info_async().
18489 * Returns: (transfer full): A #GFileInfo for the finished query.
18495 * g_file_is_native:
18496 * @file: input #GFile
18498 * Checks to see if a file is native to the platform.
18500 * A native file s one expressed in the platform-native filename format,
18501 * e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
18502 * as it might be on a locally mounted remote filesystem.
18504 * On some systems non-native files may be available using the native
18505 * filesystem via a userspace filesystem (FUSE), in these cases this call
18506 * will return %FALSE, but g_file_get_path() will still return a native path.
18508 * This call does no blocking I/O.
18510 * Returns: %TRUE if @file is native
18515 * g_file_load_contents:
18516 * @file: input #GFile
18517 * @cancellable: optional #GCancellable object, %NULL to ignore
18518 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
18519 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
18520 * @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
18521 * @error: a #GError, or %NULL
18523 * Loads the content of the file into memory. The data is always
18524 * zero-terminated, but this is not included in the resultant @length.
18525 * The returned @content should be freed with g_free() when no longer
18528 * If @cancellable is not %NULL, then the operation can be cancelled by
18529 * triggering the cancellable object from another thread. If the operation
18530 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18532 * Returns: %TRUE if the @file's contents were successfully loaded. %FALSE if there were errors.
18537 * g_file_load_contents_async:
18538 * @file: input #GFile
18539 * @cancellable: optional #GCancellable object, %NULL to ignore
18540 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
18541 * @user_data: the data to pass to callback function
18543 * Starts an asynchronous load of the @file's contents.
18545 * For more details, see g_file_load_contents() which is
18546 * the synchronous version of this call.
18548 * When the load operation has completed, @callback will be called
18549 * with @user data. To finish the operation, call
18550 * g_file_load_contents_finish() with the #GAsyncResult returned by
18553 * If @cancellable is not %NULL, then the operation can be cancelled by
18554 * triggering the cancellable object from another thread. If the operation
18555 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18560 * g_file_load_contents_finish:
18561 * @file: input #GFile
18562 * @res: a #GAsyncResult
18563 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
18564 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
18565 * @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
18566 * @error: a #GError, or %NULL
18568 * Finishes an asynchronous load of the @file's contents.
18569 * The contents are placed in @contents, and @length is set to the
18570 * size of the @contents string. The @content should be freed with
18571 * g_free() when no longer needed. If @etag_out is present, it will be
18572 * set to the new entity tag for the @file.
18574 * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
18579 * g_file_load_partial_contents_async: (skip)
18580 * @file: input #GFile
18581 * @cancellable: optional #GCancellable object, %NULL to ignore
18582 * @read_more_callback: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read
18583 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
18584 * @user_data: the data to pass to the callback functions
18586 * Reads the partial contents of a file. A #GFileReadMoreCallback should
18587 * be used to stop reading from the file when appropriate, else this
18588 * function will behave exactly as g_file_load_contents_async(). This
18589 * operation can be finished by g_file_load_partial_contents_finish().
18591 * Users of this function should be aware that @user_data is passed to
18592 * both the @read_more_callback and the @callback.
18594 * If @cancellable is not %NULL, then the operation can be cancelled by
18595 * triggering the cancellable object from another thread. If the operation
18596 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18601 * g_file_load_partial_contents_finish:
18602 * @file: input #GFile
18603 * @res: a #GAsyncResult
18604 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
18605 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
18606 * @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
18607 * @error: a #GError, or %NULL
18609 * Finishes an asynchronous partial load operation that was started
18610 * with g_file_load_partial_contents_async(). The data is always
18611 * zero-terminated, but this is not included in the resultant @length.
18612 * The returned @content should be freed with g_free() when no longer
18615 * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
18620 * g_file_make_directory:
18621 * @file: input #GFile
18622 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18623 * @error: a #GError, or %NULL
18625 * Creates a directory. Note that this will only create a child directory
18626 * of the immediate parent directory of the path or URI given by the #GFile.
18627 * To recursively create directories, see g_file_make_directory_with_parents().
18628 * This function will fail if the parent directory does not exist, setting
18629 * @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support
18630 * creating directories, this function will fail, setting @error to
18631 * %G_IO_ERROR_NOT_SUPPORTED.
18633 * For a local #GFile the newly created directory will have the default
18634 * (current) ownership and permissions of the current process.
18636 * If @cancellable is not %NULL, then the operation can be cancelled by
18637 * triggering the cancellable object from another thread. If the operation
18638 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18640 * Returns: %TRUE on successful creation, %FALSE otherwise.
18645 * g_file_make_directory_with_parents:
18646 * @file: input #GFile
18647 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18648 * @error: a #GError, or %NULL
18650 * Creates a directory and any parent directories that may not
18651 * exist similar to 'mkdir -p'. If the file system does not support
18652 * creating directories, this function will fail, setting @error to
18653 * %G_IO_ERROR_NOT_SUPPORTED. If the directory itself already exists,
18654 * this function will fail setting @error to %G_IO_ERROR_EXISTS, unlike
18655 * the similar g_mkdir_with_parents().
18657 * For a local #GFile the newly created directories will have the default
18658 * (current) ownership and permissions of the current process.
18660 * If @cancellable is not %NULL, then the operation can be cancelled by
18661 * triggering the cancellable object from another thread. If the operation
18662 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18664 * Returns: %TRUE if all directories have been successfully created, %FALSE otherwise.
18670 * g_file_make_symbolic_link:
18671 * @file: a #GFile with the name of the symlink to create
18672 * @symlink_value: a string with the path for the target of the new symlink
18673 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18674 * @error: a #GError
18676 * Creates a symbolic link named @file which contains the string
18679 * If @cancellable is not %NULL, then the operation can be cancelled by
18680 * triggering the cancellable object from another thread. If the operation
18681 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18683 * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
18689 * @file: input #GFile
18690 * @flags: a set of #GFileMonitorFlags
18691 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18692 * @error: a #GError, or %NULL
18694 * Obtains a file or directory monitor for the given file,
18695 * depending on the type of the file.
18697 * If @cancellable is not %NULL, then the operation can be cancelled by
18698 * triggering the cancellable object from another thread. If the operation
18699 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18701 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
18707 * g_file_monitor_cancel:
18708 * @monitor: a #GFileMonitor.
18710 * Cancels a file monitor.
18712 * Returns: %TRUE if monitor was cancelled.
18717 * g_file_monitor_directory:
18718 * @file: input #GFile
18719 * @flags: a set of #GFileMonitorFlags
18720 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18721 * @error: a #GError, or %NULL
18723 * Obtains a directory monitor for the given file.
18724 * This may fail if directory monitoring is not supported.
18726 * If @cancellable is not %NULL, then the operation can be cancelled by
18727 * triggering the cancellable object from another thread. If the operation
18728 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18730 * It does not make sense for @flags to contain
18731 * %G_FILE_MONITOR_WATCH_HARD_LINKS, since hard links can not be made to
18732 * directories. It is not possible to monitor all the files in a
18733 * directory for changes made via hard links; if you want to do this then
18734 * you must register individual watches with g_file_monitor().
18736 * Virtual: monitor_dir
18737 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
18742 * g_file_monitor_emit_event:
18743 * @monitor: a #GFileMonitor.
18744 * @child: a #GFile.
18745 * @other_file: a #GFile.
18746 * @event_type: a set of #GFileMonitorEvent flags.
18748 * Emits the #GFileMonitor::changed signal if a change
18749 * has taken place. Should be called from file monitor
18750 * implementations only.
18752 * The signal will be emitted from an idle handler (in the <link
18753 * linkend="g-main-context-push-thread-default">thread-default main
18759 * g_file_monitor_file:
18760 * @file: input #GFile
18761 * @flags: a set of #GFileMonitorFlags
18762 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18763 * @error: a #GError, or %NULL
18765 * Obtains a file monitor for the given file. If no file notification
18766 * mechanism exists, then regular polling of the file is used.
18768 * If @cancellable is not %NULL, then the operation can be cancelled by
18769 * triggering the cancellable object from another thread. If the operation
18770 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18772 * If @flags contains %G_FILE_MONITOR_WATCH_HARD_LINKS then the monitor
18773 * will also attempt to report changes made to the file via another
18774 * filename (ie, a hard link). Without this flag, you can only rely on
18775 * changes made through the filename contained in @file to be
18776 * reported. Using this flag may result in an increase in resource
18777 * usage, and may not have any effect depending on the #GFileMonitor
18778 * backend and/or filesystem type.
18780 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
18785 * g_file_monitor_is_cancelled:
18786 * @monitor: a #GFileMonitor
18788 * Returns whether the monitor is canceled.
18790 * Returns: %TRUE if monitor is canceled. %FALSE otherwise.
18795 * g_file_monitor_set_rate_limit:
18796 * @monitor: a #GFileMonitor.
18797 * @limit_msecs: a non-negative integer with the limit in milliseconds to poll for changes
18799 * Sets the rate limit to which the @monitor will report
18800 * consecutive change events to the same file.
18805 * g_file_mount_enclosing_volume:
18806 * @location: input #GFile
18807 * @flags: flags affecting the operation
18808 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction
18809 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18810 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
18811 * @user_data: the data to pass to callback function
18813 * Starts a @mount_operation, mounting the volume that contains
18814 * the file @location.
18816 * When this operation has completed, @callback will be called with
18817 * @user_user data, and the operation can be finalized with
18818 * g_file_mount_enclosing_volume_finish().
18820 * If @cancellable is not %NULL, then the operation can be cancelled by
18821 * triggering the cancellable object from another thread. If the operation
18822 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18827 * g_file_mount_enclosing_volume_finish:
18828 * @location: input #GFile
18829 * @result: a #GAsyncResult
18830 * @error: a #GError, or %NULL
18832 * Finishes a mount operation started by g_file_mount_enclosing_volume().
18834 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
18839 * g_file_mount_mountable:
18840 * @file: input #GFile
18841 * @flags: flags affecting the operation
18842 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
18843 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18844 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
18845 * @user_data: (closure): the data to pass to callback function
18847 * Mounts a file of type G_FILE_TYPE_MOUNTABLE.
18848 * Using @mount_operation, you can request callbacks when, for instance,
18849 * passwords are needed during authentication.
18851 * If @cancellable is not %NULL, then the operation can be cancelled by
18852 * triggering the cancellable object from another thread. If the operation
18853 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18855 * When the operation is finished, @callback will be called.
18856 * You can then call g_file_mount_mountable_finish() to get
18857 * the result of the operation.
18862 * g_file_mount_mountable_finish:
18863 * @file: input #GFile
18864 * @result: a #GAsyncResult
18865 * @error: a #GError, or %NULL
18867 * Finishes a mount operation. See g_file_mount_mountable() for details.
18869 * Finish an asynchronous mount operation that was started
18870 * with g_file_mount_mountable().
18872 * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
18878 * @source: #GFile pointing to the source location
18879 * @destination: #GFile pointing to the destination location
18880 * @flags: set of #GFileCopyFlags
18881 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18882 * @progress_callback: (allow-none) (scope call): #GFileProgressCallback function for updates
18883 * @progress_callback_data: (closure): gpointer to user data for the callback function
18884 * @error: #GError for returning error conditions, or %NULL
18886 * Tries to move the file or directory @source to the location specified
18887 * by @destination. If native move operations are supported then this is
18888 * used, otherwise a copy + delete fallback is used. The native
18889 * implementation may support moving directories (for instance on moves
18890 * inside the same filesystem), but the fallback code does not.
18892 * If the flag #G_FILE_COPY_OVERWRITE is specified an already
18893 * existing @destination file is overwritten.
18895 * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
18896 * will be copied as symlinks, otherwise the target of the
18897 * @source symlink will be copied.
18899 * If @cancellable is not %NULL, then the operation can be cancelled by
18900 * triggering the cancellable object from another thread. If the operation
18901 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18903 * If @progress_callback is not %NULL, then the operation can be monitored
18904 * by setting this to a #GFileProgressCallback function.
18905 * @progress_callback_data will be passed to this function. It is
18906 * guaranteed that this callback will be called after all data has been
18907 * transferred with the total number of bytes copied during the operation.
18909 * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND
18910 * error is returned, independent on the status of the @destination.
18912 * If #G_FILE_COPY_OVERWRITE is not specified and the target exists,
18913 * then the error %G_IO_ERROR_EXISTS is returned.
18915 * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
18916 * error is returned. If trying to overwrite a directory with a directory the
18917 * %G_IO_ERROR_WOULD_MERGE error is returned.
18919 * If the source is a directory and the target does not exist, or
18920 * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then
18921 * the %G_IO_ERROR_WOULD_RECURSE error may be returned (if the native
18922 * move operation isn't available).
18924 * Returns: %TRUE on successful move, %FALSE otherwise.
18929 * g_file_new_for_commandline_arg:
18930 * @arg: a command line string
18932 * Creates a #GFile with the given argument from the command line.
18933 * The value of @arg can be either a URI, an absolute path or a
18934 * relative path resolved relative to the current working directory.
18935 * This operation never fails, but the returned object might not
18936 * support any I/O operation if @arg points to a malformed path.
18938 * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
18943 * g_file_new_for_commandline_arg_and_cwd:
18944 * @arg: a command line string
18945 * @cwd: the current working directory of the commandline
18947 * Creates a #GFile with the given argument from the command line.
18949 * This function is similar to g_file_new_for_commandline_arg() except
18950 * that it allows for passing the current working directory as an
18951 * argument instead of using the current working directory of the
18954 * This is useful if the commandline argument was given in a context
18955 * other than the invocation of the current process.
18957 * See also g_application_command_line_create_file_for_arg().
18959 * Returns: (transfer full): a new #GFile
18965 * g_file_new_for_path:
18966 * @path: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
18968 * Constructs a #GFile for a given path. This operation never
18969 * fails, but the returned object might not support any I/O
18970 * operation if @path is malformed.
18972 * Returns: (transfer full): a new #GFile for the given @path. Free the returned object with g_object_unref().
18977 * g_file_new_for_uri:
18978 * @uri: a UTF-8 string containing a URI
18980 * Constructs a #GFile for a given URI. This operation never
18981 * fails, but the returned object might not support any I/O
18982 * operation if @uri is malformed or if the uri type is
18985 * Returns: (transfer full): a new #GFile for the given @uri. Free the returned object with g_object_unref().
18991 * @tmpl: (type filename) (allow-none): Template for the file name, as in g_file_open_tmp(), or %NULL for a default template
18992 * @iostream: (out): on return, a #GFileIOStream for the created file
18993 * @error: a #GError, or %NULL
18995 * Opens a file in the preferred directory for temporary files (as
18996 * returned by g_get_tmp_dir()) and returns a #GFile and
18997 * #GFileIOStream pointing to it.
18999 * @tmpl should be a string in the GLib file name encoding
19000 * containing a sequence of six 'X' characters, and containing no
19001 * directory components. If it is %NULL, a default template is used.
19003 * Unlike the other #GFile constructors, this will return %NULL if
19004 * a temporary file could not be created.
19006 * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19012 * g_file_open_readwrite:
19013 * @file: #GFile to open
19014 * @cancellable: (allow-none): a #GCancellable
19015 * @error: a #GError, or %NULL
19017 * Opens an existing file for reading and writing. The result is
19018 * a #GFileIOStream that can be used to read and write the contents
19021 * If @cancellable is not %NULL, then the operation can be cancelled
19022 * by triggering the cancellable object from another thread. If the
19023 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19026 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19027 * be returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
19028 * error will be returned. Other errors are possible too, and depend on
19029 * what kind of filesystem the file is on. Note that in many non-local
19030 * file cases read and write streams are not supported, so make sure you
19031 * really need to do read and write streaming, rather than just opening
19032 * for reading or writing.
19034 * Returns: (transfer full): #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19040 * g_file_open_readwrite_async:
19041 * @file: input #GFile
19042 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19043 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19044 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19045 * @user_data: (closure): the data to pass to callback function
19047 * Asynchronously opens @file for reading and writing.
19049 * For more details, see g_file_open_readwrite() which is
19050 * the synchronous version of this call.
19052 * When the operation is finished, @callback will be called.
19053 * You can then call g_file_open_readwrite_finish() to get
19054 * the result of the operation.
19061 * g_file_open_readwrite_finish:
19062 * @file: input #GFile
19063 * @res: a #GAsyncResult
19064 * @error: a #GError, or %NULL
19066 * Finishes an asynchronous file read operation started with
19067 * g_file_open_readwrite_async().
19069 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19075 * g_file_output_stream_get_etag:
19076 * @stream: a #GFileOutputStream.
19078 * Gets the entity tag for the file when it has been written.
19079 * This must be called after the stream has been written
19080 * and closed, as the etag can change while writing.
19082 * Returns: the entity tag for the stream.
19087 * g_file_output_stream_query_info:
19088 * @stream: a #GFileOutputStream.
19089 * @attributes: a file attribute query string.
19090 * @cancellable: optional #GCancellable object, %NULL to ignore.
19091 * @error: a #GError, %NULL to ignore.
19093 * Queries a file output stream for the given @attributes.
19094 * This function blocks while querying the stream. For the asynchronous
19095 * version of this function, see g_file_output_stream_query_info_async().
19096 * While the stream is blocked, the stream will set the pending flag
19097 * internally, and any other operations on the stream will fail with
19098 * %G_IO_ERROR_PENDING.
19100 * Can fail if the stream was already closed (with @error being set to
19101 * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19102 * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19103 * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
19104 * all cases of failure, %NULL will be returned.
19106 * If @cancellable is not %NULL, then the operation can be cancelled by
19107 * triggering the cancellable object from another thread. If the operation
19108 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19111 * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19116 * g_file_output_stream_query_info_async:
19117 * @stream: a #GFileOutputStream.
19118 * @attributes: a file attribute query string.
19119 * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19120 * @cancellable: optional #GCancellable object, %NULL to ignore.
19121 * @callback: callback to call when the request is satisfied
19122 * @user_data: the data to pass to callback function
19124 * Asynchronously queries the @stream for a #GFileInfo. When completed,
19125 * @callback will be called with a #GAsyncResult which can be used to
19126 * finish the operation with g_file_output_stream_query_info_finish().
19128 * For the synchronous version of this function, see
19129 * g_file_output_stream_query_info().
19134 * g_file_output_stream_query_info_finish:
19135 * @stream: a #GFileOutputStream.
19136 * @result: a #GAsyncResult.
19137 * @error: a #GError, %NULL to ignore.
19139 * Finalizes the asynchronous query started
19140 * by g_file_output_stream_query_info_async().
19142 * Returns: (transfer full): A #GFileInfo for the finished query.
19147 * g_file_parse_name:
19148 * @parse_name: a file name or path to be parsed
19150 * Constructs a #GFile with the given @parse_name (i.e. something
19151 * given by g_file_get_parse_name()). This operation never fails,
19152 * but the returned object might not support any I/O operation if
19153 * the @parse_name cannot be parsed.
19155 * Returns: (transfer full): a new #GFile.
19160 * g_file_poll_mountable:
19161 * @file: input #GFile
19162 * @cancellable: optional #GCancellable object, %NULL to ignore
19163 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19164 * @user_data: the data to pass to callback function
19166 * Polls a file of type #G_FILE_TYPE_MOUNTABLE.
19168 * If @cancellable is not %NULL, then the operation can be cancelled by
19169 * triggering the cancellable object from another thread. If the operation
19170 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19172 * When the operation is finished, @callback will be called.
19173 * You can then call g_file_mount_mountable_finish() to get
19174 * the result of the operation.
19181 * g_file_poll_mountable_finish:
19182 * @file: input #GFile
19183 * @result: a #GAsyncResult
19184 * @error: a #GError, or %NULL
19186 * Finishes a poll operation. See g_file_poll_mountable() for details.
19188 * Finish an asynchronous poll operation that was polled
19189 * with g_file_poll_mountable().
19191 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
19197 * g_file_query_default_handler:
19198 * @file: a #GFile to open
19199 * @cancellable: optional #GCancellable object, %NULL to ignore
19200 * @error: a #GError, or %NULL
19202 * Returns the #GAppInfo that is registered as the default
19203 * application to handle the file specified by @file.
19205 * If @cancellable is not %NULL, then the operation can be cancelled by
19206 * triggering the cancellable object from another thread. If the operation
19207 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19209 * 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()
19214 * g_file_query_exists:
19215 * @file: input #GFile
19216 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19218 * Utility function to check if a particular file exists. This is
19219 * implemented using g_file_query_info() and as such does blocking I/O.
19221 * Note that in many cases it is racy to first check for file existence
19222 * and then execute something based on the outcome of that, because the
19223 * file might have been created or removed in between the operations. The
19224 * general approach to handling that is to not check, but just do the
19225 * operation and handle the errors as they come.
19227 * As an example of race-free checking, take the case of reading a file,
19228 * and if it doesn't exist, creating it. There are two racy versions: read
19229 * it, and on error create it; and: check if it exists, if not create it.
19230 * These can both result in two processes creating the file (with perhaps
19231 * a partially written file as the result). The correct approach is to
19232 * always try to create the file with g_file_create() which will either
19233 * atomically create the file or fail with a %G_IO_ERROR_EXISTS error.
19235 * However, in many cases an existence check is useful in a user interface,
19236 * for instance to make a menu item sensitive/insensitive, so that you don't
19237 * have to fool users that something is possible and then just show an error
19238 * dialog. If you do this, you should make sure to also handle the errors
19239 * that can happen due to races when you execute the operation.
19241 * Returns: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
19246 * g_file_query_file_type:
19247 * @file: input #GFile
19248 * @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info()
19249 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19251 * Utility function to inspect the #GFileType of a file. This is
19252 * implemented using g_file_query_info() and as such does blocking I/O.
19254 * The primary use case of this method is to check if a file is
19255 * a regular file, directory, or symlink.
19257 * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist
19263 * g_file_query_filesystem_info:
19264 * @file: input #GFile
19265 * @attributes: an attribute query string
19266 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19267 * @error: a #GError
19269 * Similar to g_file_query_info(), but obtains information
19270 * about the filesystem the @file is on, rather than the file itself.
19271 * For instance the amount of space available and the type of
19274 * The @attributes value is a string that specifies the attributes
19275 * that should be gathered. It is not an error if it's not possible
19276 * to read a particular requested attribute from a file - it just
19277 * won't be set. @attributes should be a comma-separated list of
19278 * attributes or attribute wildcards. The wildcard "*" means all
19279 * attributes, and a wildcard like "filesystem::*" means all attributes
19280 * in the filesystem namespace. The standard namespace for filesystem
19281 * attributes is "filesystem". Common attributes of interest are
19282 * #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem
19283 * in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available),
19284 * and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
19286 * If @cancellable is not %NULL, then the operation can be cancelled
19287 * by triggering the cancellable object from another thread. If the
19288 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19291 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19292 * be returned. Other errors are possible too, and depend on what
19293 * kind of filesystem the file is on.
19295 * Returns: (transfer full): a #GFileInfo or %NULL if there was an error. Free the returned object with g_object_unref().
19300 * g_file_query_filesystem_info_async:
19301 * @file: input #GFile
19302 * @attributes: an attribute query string
19303 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19304 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19305 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19306 * @user_data: (closure): the data to pass to callback function
19308 * Asynchronously gets the requested information about the filesystem
19309 * that the specified @file is on. The result is a #GFileInfo object
19310 * that contains key-value attributes (such as type or size for the
19313 * For more details, see g_file_query_filesystem_info() which is the
19314 * synchronous version of this call.
19316 * When the operation is finished, @callback will be called. You can
19317 * then call g_file_query_info_finish() to get the result of the
19323 * g_file_query_filesystem_info_finish:
19324 * @file: input #GFile
19325 * @res: a #GAsyncResult
19326 * @error: a #GError
19328 * Finishes an asynchronous filesystem info query.
19329 * See g_file_query_filesystem_info_async().
19331 * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19336 * g_file_query_info:
19337 * @file: input #GFile
19338 * @attributes: an attribute query string
19339 * @flags: a set of #GFileQueryInfoFlags
19340 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19341 * @error: a #GError
19343 * Gets the requested information about specified @file.
19344 * The result is a #GFileInfo object that contains key-value
19345 * attributes (such as the type or size of the file).
19347 * The @attributes value is a string that specifies the file
19348 * attributes that should be gathered. It is not an error if
19349 * it's not possible to read a particular requested attribute
19350 * from a file - it just won't be set. @attributes should be a
19351 * comma-separated list of attributes or attribute wildcards.
19352 * The wildcard "*" means all attributes, and a wildcard like
19353 * "standard::*" means all attributes in the standard namespace.
19354 * An example attribute query be "standard::*,owner::user".
19355 * The standard attributes are available as defines, like
19356 * #G_FILE_ATTRIBUTE_STANDARD_NAME.
19358 * If @cancellable is not %NULL, then the operation can be cancelled
19359 * by triggering the cancellable object from another thread. If the
19360 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19363 * For symlinks, normally the information about the target of the
19364 * symlink is returned, rather than information about the symlink
19365 * itself. However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS
19366 * in @flags the information about the symlink itself will be returned.
19367 * Also, for symlinks that point to non-existing files the information
19368 * about the symlink itself will be returned.
19370 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
19371 * returned. Other errors are possible too, and depend on what kind of
19372 * filesystem the file is on.
19374 * Returns: (transfer full): a #GFileInfo for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19379 * g_file_query_info_async:
19380 * @file: input #GFile
19381 * @attributes: an attribute query string
19382 * @flags: a set of #GFileQueryInfoFlags
19383 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19384 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19385 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19386 * @user_data: (closure): the data to pass to callback function
19388 * Asynchronously gets the requested information about specified @file.
19389 * The result is a #GFileInfo object that contains key-value attributes
19390 * (such as type or size for the file).
19392 * For more details, see g_file_query_info() which is the synchronous
19393 * version of this call.
19395 * When the operation is finished, @callback will be called. You can
19396 * then call g_file_query_info_finish() to get the result of the operation.
19401 * g_file_query_info_finish:
19402 * @file: input #GFile
19403 * @res: a #GAsyncResult
19404 * @error: a #GError
19406 * Finishes an asynchronous file info query.
19407 * See g_file_query_info_async().
19409 * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19414 * g_file_query_settable_attributes:
19415 * @file: input #GFile
19416 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19417 * @error: a #GError, or %NULL
19419 * Obtain the list of settable attributes for the file.
19421 * Returns the type and full attribute name of all the attributes
19422 * that can be set on this file. This doesn't mean setting it will
19423 * always succeed though, you might get an access failure, or some
19424 * specific file may not support a specific attribute.
19426 * If @cancellable is not %NULL, then the operation can be cancelled by
19427 * triggering the cancellable object from another thread. If the operation
19428 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19430 * Returns: a #GFileAttributeInfoList describing the settable attributes. When you are done with it, release it with g_file_attribute_info_list_unref()
19435 * g_file_query_writable_namespaces:
19436 * @file: input #GFile
19437 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19438 * @error: a #GError, or %NULL
19440 * Obtain the list of attribute namespaces where new attributes
19441 * can be created by a user. An example of this is extended
19442 * attributes (in the "xattr" namespace).
19444 * If @cancellable is not %NULL, then the operation can be cancelled by
19445 * triggering the cancellable object from another thread. If the operation
19446 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19448 * Returns: a #GFileAttributeInfoList describing the writable namespaces. When you are done with it, release it with g_file_attribute_info_list_unref()
19454 * @file: #GFile to read
19455 * @cancellable: (allow-none): a #GCancellable
19456 * @error: a #GError, or %NULL
19458 * Opens a file for reading. The result is a #GFileInputStream that
19459 * can be used to read the contents of the file.
19461 * If @cancellable is not %NULL, then the operation can be cancelled by
19462 * triggering the cancellable object from another thread. If the operation
19463 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19465 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
19466 * returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
19467 * error will be returned. Other errors are possible too, and depend
19468 * on what kind of filesystem the file is on.
19471 * Returns: (transfer full): #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
19476 * g_file_read_async:
19477 * @file: input #GFile
19478 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19479 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19480 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19481 * @user_data: (closure): the data to pass to callback function
19483 * Asynchronously opens @file for reading.
19485 * For more details, see g_file_read() which is
19486 * the synchronous version of this call.
19488 * When the operation is finished, @callback will be called.
19489 * You can then call g_file_read_finish() to get the result
19490 * of the operation.
19495 * g_file_read_finish:
19496 * @file: input #GFile
19497 * @res: a #GAsyncResult
19498 * @error: a #GError, or %NULL
19500 * Finishes an asynchronous file read operation started with
19501 * g_file_read_async().
19503 * Returns: (transfer full): a #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
19509 * @file: input #GFile
19510 * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
19511 * @make_backup: %TRUE if a backup should be created
19512 * @flags: a set of #GFileCreateFlags
19513 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19514 * @error: a #GError, or %NULL
19516 * Returns an output stream for overwriting the file, possibly
19517 * creating a backup copy of the file first. If the file doesn't exist,
19518 * it will be created.
19520 * This will try to replace the file in the safest way possible so
19521 * that any errors during the writing will not affect an already
19522 * existing copy of the file. For instance, for local files it
19523 * may write to a temporary file and then atomically rename over
19524 * the destination when the stream is closed.
19526 * By default files created are generally readable by everyone,
19527 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
19528 * will be made readable only to the current user, to the level that
19529 * is supported on the target filesystem.
19531 * If @cancellable is not %NULL, then the operation can be cancelled
19532 * by triggering the cancellable object from another thread. If the
19533 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19536 * If you pass in a non-%NULL @etag value, then this value is
19537 * compared to the current entity tag of the file, and if they differ
19538 * an %G_IO_ERROR_WRONG_ETAG error is returned. This generally means
19539 * that the file has been changed since you last read it. You can get
19540 * the new etag from g_file_output_stream_get_etag() after you've
19541 * finished writing and closed the #GFileOutputStream. When you load
19542 * a new file you can use g_file_input_stream_query_info() to get
19543 * the etag of the file.
19545 * If @make_backup is %TRUE, this function will attempt to make a
19546 * backup of the current file before overwriting it. If this fails
19547 * a %G_IO_ERROR_CANT_CREATE_BACKUP error will be returned. If you
19548 * want to replace anyway, try again with @make_backup set to %FALSE.
19550 * If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will
19551 * be returned, and if the file is some other form of non-regular file
19552 * then a %G_IO_ERROR_NOT_REGULAR_FILE error will be returned. Some
19553 * file systems don't allow all file names, and may return an
19554 * %G_IO_ERROR_INVALID_FILENAME error, and if the name is to long
19555 * %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are
19556 * possible too, and depend on what kind of filesystem the file is on.
19558 * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
19563 * g_file_replace_async:
19564 * @file: input #GFile
19565 * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
19566 * @make_backup: %TRUE if a backup should be created
19567 * @flags: a set of #GFileCreateFlags
19568 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19569 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19570 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19571 * @user_data: (closure): the data to pass to callback function
19573 * Asynchronously overwrites the file, replacing the contents,
19574 * possibly creating a backup copy of the file first.
19576 * For more details, see g_file_replace() which is
19577 * the synchronous version of this call.
19579 * When the operation is finished, @callback will be called.
19580 * You can then call g_file_replace_finish() to get the result
19581 * of the operation.
19586 * g_file_replace_contents:
19587 * @file: input #GFile
19588 * @contents: (element-type guint8) (array length=length): a string containing the new contents for @file
19589 * @length: the length of @contents in bytes
19590 * @etag: (allow-none): the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
19591 * @make_backup: %TRUE if a backup should be created
19592 * @flags: a set of #GFileCreateFlags
19593 * @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
19594 * @cancellable: optional #GCancellable object, %NULL to ignore
19595 * @error: a #GError, or %NULL
19597 * Replaces the contents of @file with @contents of @length bytes.
19599 * If @etag is specified (not %NULL), any existing file must have that etag,
19600 * or the error %G_IO_ERROR_WRONG_ETAG will be returned.
19602 * If @make_backup is %TRUE, this function will attempt to make a backup
19605 * If @cancellable is not %NULL, then the operation can be cancelled by
19606 * triggering the cancellable object from another thread. If the operation
19607 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19609 * The returned @new_etag can be used to verify that the file hasn't
19610 * changed the next time it is saved over.
19612 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19617 * g_file_replace_contents_async:
19618 * @file: input #GFile
19619 * @contents: (element-type guint8) (array length=length): string of contents to replace the file with
19620 * @length: the length of @contents in bytes
19621 * @etag: (allow-none): a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
19622 * @make_backup: %TRUE if a backup should be created
19623 * @flags: a set of #GFileCreateFlags
19624 * @cancellable: optional #GCancellable object, %NULL to ignore
19625 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19626 * @user_data: the data to pass to callback function
19628 * Starts an asynchronous replacement of @file with the given
19629 * @contents of @length bytes. @etag will replace the document's
19630 * current entity tag.
19632 * When this operation has completed, @callback will be called with
19633 * @user_user data, and the operation can be finalized with
19634 * g_file_replace_contents_finish().
19636 * If @cancellable is not %NULL, then the operation can be cancelled by
19637 * triggering the cancellable object from another thread. If the operation
19638 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19640 * If @make_backup is %TRUE, this function will attempt to
19641 * make a backup of @file.
19646 * g_file_replace_contents_finish:
19647 * @file: input #GFile
19648 * @res: a #GAsyncResult
19649 * @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
19650 * @error: a #GError, or %NULL
19652 * Finishes an asynchronous replace of the given @file. See
19653 * g_file_replace_contents_async(). Sets @new_etag to the new entity
19654 * tag for the document, if present.
19656 * Returns: %TRUE on success, %FALSE on failure.
19661 * g_file_replace_finish:
19662 * @file: input #GFile
19663 * @res: a #GAsyncResult
19664 * @error: a #GError, or %NULL
19666 * Finishes an asynchronous file replace operation started with
19667 * g_file_replace_async().
19669 * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
19674 * g_file_replace_readwrite:
19676 * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
19677 * @make_backup: %TRUE if a backup should be created
19678 * @flags: a set of #GFileCreateFlags
19679 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19680 * @error: return location for a #GError, or %NULL
19682 * Returns an output stream for overwriting the file in readwrite mode,
19683 * possibly creating a backup copy of the file first. If the file doesn't
19684 * exist, it will be created.
19686 * For details about the behaviour, see g_file_replace() which does the
19687 * same thing but returns an output stream only.
19689 * Note that in many non-local file cases read and write streams are not
19690 * supported, so make sure you really need to do read and write streaming,
19691 * rather than just opening for reading or writing.
19693 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19699 * g_file_replace_readwrite_async:
19700 * @file: input #GFile
19701 * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
19702 * @make_backup: %TRUE if a backup should be created
19703 * @flags: a set of #GFileCreateFlags
19704 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19705 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19706 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19707 * @user_data: (closure): the data to pass to callback function
19709 * Asynchronously overwrites the file in read-write mode,
19710 * replacing the contents, possibly creating a backup copy
19711 * of the file first.
19713 * For more details, see g_file_replace_readwrite() which is
19714 * the synchronous version of this call.
19716 * When the operation is finished, @callback will be called.
19717 * You can then call g_file_replace_readwrite_finish() to get
19718 * the result of the operation.
19725 * g_file_replace_readwrite_finish:
19726 * @file: input #GFile
19727 * @res: a #GAsyncResult
19728 * @error: a #GError, or %NULL
19730 * Finishes an asynchronous file replace operation started with
19731 * g_file_replace_readwrite_async().
19733 * Returns: (transfer full): a #GFileIOStream, or %NULL on error. Free the returned object with g_object_unref().
19739 * g_file_resolve_relative_path:
19740 * @file: input #GFile
19741 * @relative_path: a given relative path string
19743 * Resolves a relative path for @file to an absolute path.
19745 * This call does no blocking I/O.
19747 * 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().
19752 * g_file_set_attribute:
19753 * @file: input #GFile
19754 * @attribute: a string containing the attribute's name
19755 * @type: The type of the attribute
19756 * @value_p: (allow-none): a pointer to the value (or the pointer itself if the type is a pointer type)
19757 * @flags: a set of #GFileQueryInfoFlags
19758 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19759 * @error: a #GError, or %NULL
19761 * Sets an attribute in the file with attribute name @attribute to @value.
19763 * Some attributes can be unset by setting @attribute to
19764 * %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
19766 * If @cancellable is not %NULL, then the operation can be cancelled by
19767 * triggering the cancellable object from another thread. If the operation
19768 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19770 * Returns: %TRUE if the attribute was set, %FALSE otherwise.
19775 * g_file_set_attribute_byte_string:
19776 * @file: input #GFile
19777 * @attribute: a string containing the attribute's name
19778 * @value: a string containing the attribute's new value
19779 * @flags: a #GFileQueryInfoFlags
19780 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19781 * @error: a #GError, or %NULL
19783 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
19784 * If @attribute is of a different type, this operation will fail,
19785 * returning %FALSE.
19787 * If @cancellable is not %NULL, then the operation can be cancelled by
19788 * triggering the cancellable object from another thread. If the operation
19789 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19791 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
19796 * g_file_set_attribute_int32:
19797 * @file: input #GFile
19798 * @attribute: a string containing the attribute's name
19799 * @value: a #gint32 containing the attribute's new value
19800 * @flags: a #GFileQueryInfoFlags
19801 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19802 * @error: a #GError, or %NULL
19804 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
19805 * If @attribute is of a different type, this operation will fail.
19807 * If @cancellable is not %NULL, then the operation can be cancelled by
19808 * triggering the cancellable object from another thread. If the operation
19809 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19811 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
19816 * g_file_set_attribute_int64:
19817 * @file: input #GFile
19818 * @attribute: a string containing the attribute's name
19819 * @value: a #guint64 containing the attribute's new value
19820 * @flags: a #GFileQueryInfoFlags
19821 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19822 * @error: a #GError, or %NULL
19824 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
19825 * If @attribute is of a different type, this operation will fail.
19827 * If @cancellable is not %NULL, then the operation can be cancelled by
19828 * triggering the cancellable object from another thread. If the operation
19829 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19831 * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
19836 * g_file_set_attribute_string:
19837 * @file: input #GFile
19838 * @attribute: a string containing the attribute's name
19839 * @value: a string containing the attribute's value
19840 * @flags: #GFileQueryInfoFlags
19841 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19842 * @error: a #GError, or %NULL
19844 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
19845 * If @attribute is of a different type, this operation will fail.
19847 * If @cancellable is not %NULL, then the operation can be cancelled by
19848 * triggering the cancellable object from another thread. If the operation
19849 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19851 * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
19856 * g_file_set_attribute_uint32:
19857 * @file: input #GFile
19858 * @attribute: a string containing the attribute's name
19859 * @value: a #guint32 containing the attribute's new value
19860 * @flags: a #GFileQueryInfoFlags
19861 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19862 * @error: a #GError, or %NULL
19864 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
19865 * If @attribute is of a different type, this operation will fail.
19867 * If @cancellable is not %NULL, then the operation can be cancelled by
19868 * triggering the cancellable object from another thread. If the operation
19869 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19871 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
19876 * g_file_set_attribute_uint64:
19877 * @file: input #GFile
19878 * @attribute: a string containing the attribute's name
19879 * @value: a #guint64 containing the attribute's new value
19880 * @flags: a #GFileQueryInfoFlags
19881 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19882 * @error: a #GError, or %NULL
19884 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
19885 * If @attribute is of a different type, this operation will fail.
19887 * If @cancellable is not %NULL, then the operation can be cancelled by
19888 * triggering the cancellable object from another thread. If the operation
19889 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19891 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
19896 * g_file_set_attributes_async:
19897 * @file: input #GFile
19898 * @info: a #GFileInfo
19899 * @flags: a #GFileQueryInfoFlags
19900 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19901 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19902 * @callback: (scope async): a #GAsyncReadyCallback
19903 * @user_data: (closure): a #gpointer
19905 * Asynchronously sets the attributes of @file with @info.
19907 * For more details, see g_file_set_attributes_from_info(),
19908 * which is the synchronous version of this call.
19910 * When the operation is finished, @callback will be called.
19911 * You can then call g_file_set_attributes_finish() to get
19912 * the result of the operation.
19917 * g_file_set_attributes_finish:
19918 * @file: input #GFile
19919 * @result: a #GAsyncResult
19920 * @info: (out) (transfer full): a #GFileInfo
19921 * @error: a #GError, or %NULL
19923 * Finishes setting an attribute started in g_file_set_attributes_async().
19925 * Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
19930 * g_file_set_attributes_from_info:
19931 * @file: input #GFile
19932 * @info: a #GFileInfo
19933 * @flags: #GFileQueryInfoFlags
19934 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19935 * @error: a #GError, or %NULL
19937 * Tries to set all attributes in the #GFileInfo on the target
19938 * values, not stopping on the first error.
19940 * If there is any error during this operation then @error will
19941 * be set to the first error. Error on particular fields are flagged
19942 * by setting the "status" field in the attribute value to
19943 * %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can
19944 * also detect further errors.
19946 * If @cancellable is not %NULL, then the operation can be cancelled by
19947 * triggering the cancellable object from another thread. If the operation
19948 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19950 * Returns: %FALSE if there was any error, %TRUE otherwise.
19955 * g_file_set_display_name:
19956 * @file: input #GFile
19957 * @display_name: a string
19958 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19959 * @error: a #GError, or %NULL
19961 * Renames @file to the specified display name.
19963 * The display name is converted from UTF-8 to the correct encoding
19964 * for the target filesystem if possible and the @file is renamed to this.
19966 * If you want to implement a rename operation in the user interface the
19967 * edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
19968 * initial value in the rename widget, and then the result after editing
19969 * should be passed to g_file_set_display_name().
19971 * On success the resulting converted filename is returned.
19973 * If @cancellable is not %NULL, then the operation can be cancelled by
19974 * triggering the cancellable object from another thread. If the operation
19975 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19977 * 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().
19982 * g_file_set_display_name_async:
19983 * @file: input #GFile
19984 * @display_name: a string
19985 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19986 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19987 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19988 * @user_data: (closure): the data to pass to callback function
19990 * Asynchronously sets the display name for a given #GFile.
19992 * For more details, see g_file_set_display_name() which is
19993 * the synchronous version of this call.
19995 * When the operation is finished, @callback will be called.
19996 * You can then call g_file_set_display_name_finish() to get
19997 * the result of the operation.
20002 * g_file_set_display_name_finish:
20003 * @file: input #GFile
20004 * @res: a #GAsyncResult
20005 * @error: a #GError, or %NULL
20007 * Finishes setting a display name started with
20008 * g_file_set_display_name_async().
20010 * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
20015 * g_file_start_mountable:
20016 * @file: input #GFile
20017 * @flags: flags affecting the operation
20018 * @start_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20019 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20020 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20021 * @user_data: the data to pass to callback function
20023 * Starts a file of type #G_FILE_TYPE_MOUNTABLE.
20024 * Using @start_operation, you can request callbacks when, for instance,
20025 * passwords are needed during authentication.
20027 * If @cancellable is not %NULL, then the operation can be cancelled by
20028 * triggering the cancellable object from another thread. If the operation
20029 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20031 * When the operation is finished, @callback will be called.
20032 * You can then call g_file_mount_mountable_finish() to get
20033 * the result of the operation.
20040 * g_file_start_mountable_finish:
20041 * @file: input #GFile
20042 * @result: a #GAsyncResult
20043 * @error: a #GError, or %NULL
20045 * Finishes a start operation. See g_file_start_mountable() for details.
20047 * Finish an asynchronous start operation that was started
20048 * with g_file_start_mountable().
20050 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20056 * g_file_stop_mountable:
20057 * @file: input #GFile
20058 * @flags: flags affecting the operation
20059 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
20060 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20061 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20062 * @user_data: the data to pass to callback function
20064 * Stops a file of type #G_FILE_TYPE_MOUNTABLE.
20066 * If @cancellable is not %NULL, then the operation can be cancelled by
20067 * triggering the cancellable object from another thread. If the operation
20068 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20070 * When the operation is finished, @callback will be called.
20071 * You can then call g_file_stop_mountable_finish() to get
20072 * the result of the operation.
20079 * g_file_stop_mountable_finish:
20080 * @file: input #GFile
20081 * @result: a #GAsyncResult
20082 * @error: a #GError, or %NULL
20084 * Finishes an stop operation, see g_file_stop_mountable() for details.
20086 * Finish an asynchronous stop operation that was started
20087 * with g_file_stop_mountable().
20089 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20095 * g_file_supports_thread_contexts:
20098 * Checks if @file supports <link
20099 * linkend="g-main-context-push-thread-default-context">thread-default
20100 * contexts</link>. If this returns %FALSE, you cannot perform
20101 * asynchronous operations on @file in a thread that has a
20102 * thread-default context.
20104 * Returns: Whether or not @file supports thread-default contexts.
20111 * @file: #GFile to send to trash
20112 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20113 * @error: a #GError, or %NULL
20115 * Sends @file to the "Trashcan", if possible. This is similar to
20116 * deleting it, but the user can recover it before emptying the trashcan.
20117 * Not all file systems support trashing, so this call can return the
20118 * %G_IO_ERROR_NOT_SUPPORTED error.
20120 * If @cancellable is not %NULL, then the operation can be cancelled by
20121 * triggering the cancellable object from another thread. If the operation
20122 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20124 * Returns: %TRUE on successful trash, %FALSE otherwise.
20129 * g_file_unmount_mountable:
20130 * @file: input #GFile
20131 * @flags: flags affecting the operation
20132 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20133 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20134 * @user_data: (closure): the data to pass to callback function
20136 * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
20138 * If @cancellable is not %NULL, then the operation can be cancelled by
20139 * triggering the cancellable object from another thread. If the operation
20140 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20142 * When the operation is finished, @callback will be called.
20143 * You can then call g_file_unmount_mountable_finish() to get
20144 * the result of the operation.
20146 * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation() instead.
20151 * g_file_unmount_mountable_finish:
20152 * @file: input #GFile
20153 * @result: a #GAsyncResult
20154 * @error: a #GError, or %NULL
20156 * Finishes an unmount operation, see g_file_unmount_mountable() for details.
20158 * Finish an asynchronous unmount operation that was started
20159 * with g_file_unmount_mountable().
20161 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20162 * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation_finish() instead.
20167 * g_file_unmount_mountable_with_operation:
20168 * @file: input #GFile
20169 * @flags: flags affecting the operation
20170 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20171 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20172 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20173 * @user_data: (closure): the data to pass to callback function
20175 * Unmounts a file of type #G_FILE_TYPE_MOUNTABLE.
20177 * If @cancellable is not %NULL, then the operation can be cancelled by
20178 * triggering the cancellable object from another thread. If the operation
20179 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20181 * When the operation is finished, @callback will be called.
20182 * You can then call g_file_unmount_mountable_finish() to get
20183 * the result of the operation.
20190 * g_file_unmount_mountable_with_operation_finish:
20191 * @file: input #GFile
20192 * @result: a #GAsyncResult
20193 * @error: a #GError, or %NULL
20195 * Finishes an unmount operation,
20196 * see g_file_unmount_mountable_with_operation() for details.
20198 * Finish an asynchronous unmount operation that was started
20199 * with g_file_unmount_mountable_with_operation().
20201 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20207 * g_filename_completer_get_completion_suffix:
20208 * @completer: the filename completer.
20209 * @initial_text: text to be completed.
20211 * Obtains a completion for @initial_text from @completer.
20213 * 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.
20218 * g_filename_completer_get_completions:
20219 * @completer: the filename completer.
20220 * @initial_text: text to be completed.
20222 * Gets an array of completion strings for a given initial text.
20224 * 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.
20229 * g_filename_completer_new:
20231 * Creates a new filename completer.
20233 * Returns: a #GFilenameCompleter.
20238 * g_filename_completer_set_dirs_only:
20239 * @completer: the filename completer.
20240 * @dirs_only: a #gboolean.
20242 * If @dirs_only is %TRUE, @completer will only
20243 * complete directory names, and not file names.
20248 * g_filter_input_stream_get_base_stream:
20249 * @stream: a #GFilterInputStream.
20251 * Gets the base stream for the filter stream.
20253 * Returns: (transfer none): a #GInputStream.
20258 * g_filter_input_stream_get_close_base_stream:
20259 * @stream: a #GFilterInputStream.
20261 * Returns whether the base stream will be closed when @stream is
20264 * Returns: %TRUE if the base stream will be closed.
20269 * g_filter_input_stream_set_close_base_stream:
20270 * @stream: a #GFilterInputStream.
20271 * @close_base: %TRUE to close the base stream.
20273 * Sets whether the base stream will be closed when @stream is closed.
20278 * g_filter_output_stream_get_base_stream:
20279 * @stream: a #GFilterOutputStream.
20281 * Gets the base stream for the filter stream.
20283 * Returns: (transfer none): a #GOutputStream.
20288 * g_filter_output_stream_get_close_base_stream:
20289 * @stream: a #GFilterOutputStream.
20291 * Returns whether the base stream will be closed when @stream is
20294 * Returns: %TRUE if the base stream will be closed.
20299 * g_filter_output_stream_set_close_base_stream:
20300 * @stream: a #GFilterOutputStream.
20301 * @close_base: %TRUE to close the base stream.
20303 * Sets whether the base stream will be closed when @stream is closed.
20309 * @icon1: (allow-none): pointer to the first #GIcon.
20310 * @icon2: (allow-none): pointer to the second #GIcon.
20312 * Checks if two icons are equal.
20314 * Returns: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
20320 * @icon: #gconstpointer to an icon object.
20322 * Gets a hash for an icon.
20325 * Returns: a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure.
20330 * g_icon_new_for_string:
20331 * @str: A string obtained via g_icon_to_string().
20332 * @error: Return location for error.
20334 * Generate a #GIcon instance from @str. This function can fail if
20335 * @str is not valid - see g_icon_to_string() for discussion.
20337 * If your application or library provides one or more #GIcon
20338 * implementations you need to ensure that each #GType is registered
20339 * with the type system prior to calling g_icon_new_for_string().
20341 * Returns: (transfer full): An object implementing the #GIcon interface or %NULL if @error is set.
20347 * g_icon_to_string:
20350 * Generates a textual representation of @icon that can be used for
20351 * serialization such as when passing @icon to a different process or
20352 * saving it to persistent storage. Use g_icon_new_for_string() to
20353 * get @icon back from the returned string.
20355 * The encoding of the returned string is proprietary to #GIcon except
20356 * in the following two cases
20360 * If @icon is a #GFileIcon, the returned string is a native path
20361 * (such as <literal>/path/to/my icon.png</literal>) without escaping
20362 * if the #GFile for @icon is a native file. If the file is not
20363 * native, the returned string is the result of g_file_get_uri()
20364 * (such as <literal>sftp://path/to/my%20icon.png</literal>).
20365 * </para></listitem>
20367 * If @icon is a #GThemedIcon with exactly one name, the encoding is
20368 * simply the name (such as <literal>network-server</literal>).
20369 * </para></listitem>
20372 * Virtual: to_tokens
20373 * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't be serialized. Use g_free() to free.
20379 * g_inet_address_equal:
20380 * @address: A #GInetAddress.
20381 * @other_address: Another #GInetAddress.
20383 * Checks if two #GInetAddress instances are equal, e.g. the same address.
20385 * Returns: %TRUE if @address and @other_address are equal, %FALSE otherwise.
20391 * g_inet_address_get_family:
20392 * @address: a #GInetAddress
20394 * Gets @address's family
20396 * Returns: @address's family
20402 * g_inet_address_get_is_any:
20403 * @address: a #GInetAddress
20405 * Tests whether @address is the "any" address for its family.
20407 * Returns: %TRUE if @address is the "any" address for its family.
20413 * g_inet_address_get_is_link_local:
20414 * @address: a #GInetAddress
20416 * Tests whether @address is a link-local address (that is, if it
20417 * identifies a host on a local network that is not connected to the
20420 * Returns: %TRUE if @address is a link-local address.
20426 * g_inet_address_get_is_loopback:
20427 * @address: a #GInetAddress
20429 * Tests whether @address is the loopback address for its family.
20431 * Returns: %TRUE if @address is the loopback address for its family.
20437 * g_inet_address_get_is_mc_global:
20438 * @address: a #GInetAddress
20440 * Tests whether @address is a global multicast address.
20442 * Returns: %TRUE if @address is a global multicast address.
20448 * g_inet_address_get_is_mc_link_local:
20449 * @address: a #GInetAddress
20451 * Tests whether @address is a link-local multicast address.
20453 * Returns: %TRUE if @address is a link-local multicast address.
20459 * g_inet_address_get_is_mc_node_local:
20460 * @address: a #GInetAddress
20462 * Tests whether @address is a node-local multicast address.
20464 * Returns: %TRUE if @address is a node-local multicast address.
20470 * g_inet_address_get_is_mc_org_local:
20471 * @address: a #GInetAddress
20473 * Tests whether @address is an organization-local multicast address.
20475 * Returns: %TRUE if @address is an organization-local multicast address.
20481 * g_inet_address_get_is_mc_site_local:
20482 * @address: a #GInetAddress
20484 * Tests whether @address is a site-local multicast address.
20486 * Returns: %TRUE if @address is a site-local multicast address.
20492 * g_inet_address_get_is_multicast:
20493 * @address: a #GInetAddress
20495 * Tests whether @address is a multicast address.
20497 * Returns: %TRUE if @address is a multicast address.
20503 * g_inet_address_get_is_site_local:
20504 * @address: a #GInetAddress
20506 * Tests whether @address is a site-local address such as 10.0.0.1
20507 * (that is, the address identifies a host on a local network that can
20508 * not be reached directly from the Internet, but which may have
20509 * outgoing Internet connectivity via a NAT or firewall).
20511 * Returns: %TRUE if @address is a site-local address.
20517 * g_inet_address_get_native_size:
20518 * @address: a #GInetAddress
20520 * Gets the size of the native raw binary address for @address. This
20521 * is the size of the data that you get from g_inet_address_to_bytes().
20523 * Returns: the number of bytes used for the native version of @address.
20529 * g_inet_address_mask_equal:
20530 * @mask: a #GInetAddressMask
20531 * @mask2: another #GInetAddressMask
20533 * Tests if @mask and @mask2 are the same mask.
20535 * Returns: whether @mask and @mask2 are the same mask
20541 * g_inet_address_mask_get_address:
20542 * @mask: a #GInetAddressMask
20544 * Gets @mask's base address
20546 * Returns: (transfer none): @mask's base address
20552 * g_inet_address_mask_get_family:
20553 * @mask: a #GInetAddressMask
20555 * Gets the #GSocketFamily of @mask's address
20557 * Returns: the #GSocketFamily of @mask's address
20563 * g_inet_address_mask_get_length:
20564 * @mask: a #GInetAddressMask
20566 * Gets @mask's length
20568 * Returns: @mask's length
20574 * g_inet_address_mask_matches:
20575 * @mask: a #GInetAddressMask
20576 * @address: a #GInetAddress
20578 * Tests if @address falls within the range described by @mask.
20580 * Returns: whether @address falls within the range described by @mask.
20586 * g_inet_address_mask_new:
20587 * @addr: a #GInetAddress
20588 * @length: number of bits of @addr to use
20589 * @error: return location for #GError, or %NULL
20591 * Creates a new #GInetAddressMask representing all addresses whose
20592 * first @length bits match @addr.
20594 * Returns: a new #GInetAddressMask, or %NULL on error
20600 * g_inet_address_mask_new_from_string:
20601 * @mask_string: an IP address or address/length string
20602 * @error: return location for #GError, or %NULL
20604 * Parses @mask_string as an IP address and (optional) length, and
20605 * creates a new #GInetAddressMask. The length, if present, is
20606 * delimited by a "/". If it is not present, then the length is
20607 * assumed to be the full length of the address.
20609 * Returns: a new #GInetAddressMask corresponding to @string, or %NULL on error.
20615 * g_inet_address_mask_to_string:
20616 * @mask: a #GInetAddressMask
20618 * Converts @mask back to its corresponding string form.
20620 * Returns: a string corresponding to @mask.
20626 * g_inet_address_new_any:
20627 * @family: the address family
20629 * Creates a #GInetAddress for the "any" address (unassigned/"don't
20630 * care") for @family.
20632 * Returns: a new #GInetAddress corresponding to the "any" address for @family.
20638 * g_inet_address_new_from_bytes:
20639 * @bytes: (array) (element-type guint8): raw address data
20640 * @family: the address family of @bytes
20642 * Creates a new #GInetAddress from the given @family and @bytes.
20643 * @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
20644 * %G_SOCKET_FAMILY_IPV6.
20646 * Returns: a new #GInetAddress corresponding to @family and @bytes.
20652 * g_inet_address_new_from_string:
20653 * @string: a string representation of an IP address
20655 * Parses @string as an IP address and creates a new #GInetAddress.
20657 * Returns: a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed.
20663 * g_inet_address_new_loopback:
20664 * @family: the address family
20666 * Creates a #GInetAddress for the loopback address for @family.
20668 * Returns: a new #GInetAddress corresponding to the loopback address for @family.
20674 * g_inet_address_to_bytes: (skip)
20675 * @address: a #GInetAddress
20677 * Gets the raw binary address data from @address.
20679 * 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().
20685 * g_inet_address_to_string:
20686 * @address: a #GInetAddress
20688 * Converts @address to string form.
20690 * Returns: a representation of @address as a string, which should be freed after use.
20696 * g_inet_socket_address_get_address:
20697 * @address: a #GInetSocketAddress
20699 * Gets @address's #GInetAddress.
20701 * Returns: (transfer none): the #GInetAddress for @address, which must be g_object_ref()'d if it will be stored
20707 * g_inet_socket_address_get_flowinfo:
20708 * @address: a %G_SOCKET_FAMILY_IPV6 #GInetSocketAddress
20710 * Gets the <literal>sin6_flowinfo</literal> field from @address,
20711 * which must be an IPv6 address.
20713 * Returns: the flowinfo field
20719 * g_inet_socket_address_get_port:
20720 * @address: a #GInetSocketAddress
20722 * Gets @address's port.
20724 * Returns: the port for @address
20730 * g_inet_socket_address_get_scope_id:
20731 * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress
20733 * Gets the <literal>sin6_scope_id</literal> field from @address,
20734 * which must be an IPv6 address.
20736 * Returns: the scope id field
20742 * g_inet_socket_address_new:
20743 * @address: a #GInetAddress
20744 * @port: a port number
20746 * Creates a new #GInetSocketAddress for @address and @port.
20748 * Returns: a new #GInetSocketAddress
20755 * @initable: a #GInitable.
20756 * @cancellable: optional #GCancellable object, %NULL to ignore.
20757 * @error: a #GError location to store the error occurring, or %NULL to ignore.
20759 * Initializes the object implementing the interface.
20761 * The object must be initialized before any real use after initial
20762 * construction, either with this function or g_async_initable_init_async().
20764 * Implementations may also support cancellation. If @cancellable is not %NULL,
20765 * then initialization can be cancelled by triggering the cancellable object
20766 * from another thread. If the operation was cancelled, the error
20767 * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
20768 * the object doesn't support cancellable initialization the error
20769 * %G_IO_ERROR_NOT_SUPPORTED will be returned.
20771 * If the object is not initialized, or initialization returns with an
20772 * error, then all operations on the object except g_object_ref() and
20773 * g_object_unref() are considered to be invalid, and have undefined
20774 * behaviour. See the <xref linkend="ginitable"/> section introduction
20775 * for more details.
20777 * Implementations of this method must be idempotent, i.e. multiple calls
20778 * to this function with the same argument should return the same results.
20779 * Only the first call initializes the object, further calls return the result
20780 * of the first call. This is so that it's safe to implement the singleton
20781 * pattern in the GObject constructor function.
20783 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
20790 * @object_type: a #GType supporting #GInitable.
20791 * @cancellable: optional #GCancellable object, %NULL to ignore.
20792 * @error: a #GError location to store the error occurring, or %NULL to ignore.
20793 * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
20794 * @...: the value if the first property, followed by and other property value pairs, and ended by %NULL.
20796 * Helper function for constructing #GInitable object. This is
20797 * similar to g_object_new() but also initializes the object
20798 * and returns %NULL, setting an error on failure.
20800 * Returns: (type GObject.Object) (transfer full): a newly allocated #GObject, or %NULL on error
20806 * g_initable_new_valist:
20807 * @object_type: a #GType supporting #GInitable.
20808 * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
20809 * @var_args: The var args list generated from @first_property_name.
20810 * @cancellable: optional #GCancellable object, %NULL to ignore.
20811 * @error: a #GError location to store the error occurring, or %NULL to ignore.
20813 * Helper function for constructing #GInitable object. This is
20814 * similar to g_object_new_valist() but also initializes the object
20815 * and returns %NULL, setting an error on failure.
20817 * Returns: (type GObject.Object) (transfer full): a newly allocated #GObject, or %NULL on error
20824 * @object_type: a #GType supporting #GInitable.
20825 * @n_parameters: the number of parameters in @parameters
20826 * @parameters: (array length=n_parameters): the parameters to use to construct the object
20827 * @cancellable: optional #GCancellable object, %NULL to ignore.
20828 * @error: a #GError location to store the error occurring, or %NULL to ignore.
20830 * Helper function for constructing #GInitable object. This is
20831 * similar to g_object_newv() but also initializes the object
20832 * and returns %NULL, setting an error on failure.
20834 * Returns: (type GObject.Object) (transfer full): a newly allocated #GObject, or %NULL on error
20840 * g_input_stream_clear_pending:
20841 * @stream: input stream
20843 * Clears the pending flag on @stream.
20848 * g_input_stream_close:
20849 * @stream: A #GInputStream.
20850 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20851 * @error: location to store the error occurring, or %NULL to ignore
20853 * Closes the stream, releasing resources related to it.
20855 * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
20856 * Closing a stream multiple times will not return an error.
20858 * Streams will be automatically closed when the last reference
20859 * is dropped, but you might want to call this function to make sure
20860 * resources are released as early as possible.
20862 * Some streams might keep the backing store of the stream (e.g. a file descriptor)
20863 * open after the stream is closed. See the documentation for the individual
20864 * stream for details.
20866 * On failure the first error that happened will be reported, but the close
20867 * operation will finish as much as possible. A stream that failed to
20868 * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
20869 * is important to check and report the error to the user.
20871 * If @cancellable is not %NULL, then the operation can be cancelled by
20872 * triggering the cancellable object from another thread. If the operation
20873 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20874 * Cancelling a close will still leave the stream closed, but some streams
20875 * can use a faster close that doesn't block to e.g. check errors.
20877 * Returns: %TRUE on success, %FALSE on failure
20882 * g_input_stream_close_async:
20883 * @stream: A #GInputStream.
20884 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
20885 * @cancellable: (allow-none): optional cancellable object
20886 * @callback: (scope async): callback to call when the request is satisfied
20887 * @user_data: (closure): the data to pass to callback function
20889 * Requests an asynchronous closes of the stream, releasing resources related to it.
20890 * When the operation is finished @callback will be called.
20891 * You can then call g_input_stream_close_finish() to get the result of the
20894 * For behaviour details see g_input_stream_close().
20896 * The asyncronous methods have a default fallback that uses threads to implement
20897 * asynchronicity, so they are optional for inheriting classes. However, if you
20898 * override one you must override all.
20903 * g_input_stream_close_finish:
20904 * @stream: a #GInputStream.
20905 * @result: a #GAsyncResult.
20906 * @error: a #GError location to store the error occurring, or %NULL to ignore.
20908 * Finishes closing a stream asynchronously, started from g_input_stream_close_async().
20910 * Returns: %TRUE if the stream was closed successfully.
20915 * g_input_stream_has_pending:
20916 * @stream: input stream.
20918 * Checks if an input stream has pending actions.
20920 * Returns: %TRUE if @stream has pending actions.
20925 * g_input_stream_is_closed:
20926 * @stream: input stream.
20928 * Checks if an input stream is closed.
20930 * Returns: %TRUE if the stream is closed.
20935 * g_input_stream_read:
20936 * @stream: a #GInputStream.
20937 * @buffer: (array length=count) (element-type guint8): a buffer to read data into (which should be at least count bytes long).
20938 * @count: the number of bytes that will be read from the stream
20939 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20940 * @error: location to store the error occurring, or %NULL to ignore
20942 * Tries to read @count bytes from the stream into the buffer starting at
20943 * @buffer. Will block during this read.
20945 * If count is zero returns zero and does nothing. A value of @count
20946 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
20948 * On success, the number of bytes read into the buffer is returned.
20949 * It is not an error if this is not the same as the requested size, as it
20950 * can happen e.g. near the end of a file. Zero is returned on end of file
20951 * (or if @count is zero), but never otherwise.
20953 * If @cancellable is not %NULL, then the operation can be cancelled by
20954 * triggering the cancellable object from another thread. If the operation
20955 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
20956 * operation was partially finished when the operation was cancelled the
20957 * partial result will be returned, without an error.
20959 * On error -1 is returned and @error is set accordingly.
20961 * Returns: Number of bytes read, or -1 on error, or 0 on end of file.
20966 * g_input_stream_read_all:
20967 * @stream: a #GInputStream.
20968 * @buffer: (array length=count) (element-type guint8): a buffer to read data into (which should be at least count bytes long).
20969 * @count: the number of bytes that will be read from the stream
20970 * @bytes_read: (out): location to store the number of bytes that was read from the stream
20971 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20972 * @error: location to store the error occurring, or %NULL to ignore
20974 * Tries to read @count bytes from the stream into the buffer starting at
20975 * @buffer. Will block during this read.
20977 * This function is similar to g_input_stream_read(), except it tries to
20978 * read as many bytes as requested, only stopping on an error or end of stream.
20980 * On a successful read of @count bytes, or if we reached the end of the
20981 * stream, %TRUE is returned, and @bytes_read is set to the number of bytes
20982 * read into @buffer.
20984 * If there is an error during the operation %FALSE is returned and @error
20985 * is set to indicate the error status, @bytes_read is updated to contain
20986 * the number of bytes read into @buffer before the error occurred.
20988 * Returns: %TRUE on success, %FALSE if there was an error
20993 * g_input_stream_read_async:
20994 * @stream: A #GInputStream.
20995 * @buffer: (array length=count) (element-type guint8): a buffer to read data into (which should be at least count bytes long).
20996 * @count: the number of bytes that will be read from the stream
20997 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
20998 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20999 * @callback: (scope async): callback to call when the request is satisfied
21000 * @user_data: (closure): the data to pass to callback function
21002 * Request an asynchronous read of @count bytes from the stream into the buffer
21003 * starting at @buffer. When the operation is finished @callback will be called.
21004 * You can then call g_input_stream_read_finish() to get the result of the
21007 * During an async request no other sync and async calls are allowed on @stream, and will
21008 * result in %G_IO_ERROR_PENDING errors.
21010 * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21012 * On success, the number of bytes read into the buffer will be passed to the
21013 * callback. It is not an error if this is not the same as the requested size, as it
21014 * can happen e.g. near the end of a file, but generally we try to read
21015 * as many bytes as requested. Zero is returned on end of file
21016 * (or if @count is zero), but never otherwise.
21018 * Any outstanding i/o request with higher priority (lower numerical value) will
21019 * be executed before an outstanding request with lower priority. Default
21020 * priority is %G_PRIORITY_DEFAULT.
21022 * The asyncronous methods have a default fallback that uses threads to implement
21023 * asynchronicity, so they are optional for inheriting classes. However, if you
21024 * override one you must override all.
21029 * g_input_stream_read_bytes:
21030 * @stream: a #GInputStream.
21031 * @count: maximum number of bytes that will be read from the stream. Common values include 4096 and 8192.
21032 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21033 * @error: location to store the error occurring, or %NULL to ignore
21035 * Like g_input_stream_read(), this tries to read @count bytes from
21036 * the stream in a blocking fashion. However, rather than reading into
21037 * a user-supplied buffer, this will create a new #GBytes containing
21038 * the data that was read. This may be easier to use from language
21041 * If count is zero, returns a zero-length #GBytes and does nothing. A
21042 * value of @count larger than %G_MAXSSIZE will cause a
21043 * %G_IO_ERROR_INVALID_ARGUMENT error.
21045 * On success, a new #GBytes is returned. It is not an error if the
21046 * size of this object is not the same as the requested size, as it
21047 * can happen e.g. near the end of a file. A zero-length #GBytes is
21048 * returned on end of file (or if @count is zero), but never
21051 * If @cancellable is not %NULL, then the operation can be cancelled by
21052 * triggering the cancellable object from another thread. If the operation
21053 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21054 * operation was partially finished when the operation was cancelled the
21055 * partial result will be returned, without an error.
21057 * On error %NULL is returned and @error is set accordingly.
21059 * Returns: a new #GBytes, or %NULL on error
21064 * g_input_stream_read_bytes_async:
21065 * @stream: A #GInputStream.
21066 * @count: the number of bytes that will be read from the stream
21067 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21068 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21069 * @callback: (scope async): callback to call when the request is satisfied
21070 * @user_data: (closure): the data to pass to callback function
21072 * Request an asynchronous read of @count bytes from the stream into a
21073 * new #GBytes. When the operation is finished @callback will be
21074 * called. You can then call g_input_stream_read_bytes_finish() to get the
21075 * result of the operation.
21077 * During an async request no other sync and async calls are allowed
21078 * on @stream, and will result in %G_IO_ERROR_PENDING errors.
21080 * A value of @count larger than %G_MAXSSIZE will cause a
21081 * %G_IO_ERROR_INVALID_ARGUMENT error.
21083 * On success, the new #GBytes will be passed to the callback. It is
21084 * not an error if this is smaller than the requested size, as it can
21085 * happen e.g. near the end of a file, but generally we try to read as
21086 * many bytes as requested. Zero is returned on end of file (or if
21087 * @count is zero), but never otherwise.
21089 * Any outstanding I/O request with higher priority (lower numerical
21090 * value) will be executed before an outstanding request with lower
21091 * priority. Default priority is %G_PRIORITY_DEFAULT.
21096 * g_input_stream_read_bytes_finish:
21097 * @stream: a #GInputStream.
21098 * @result: a #GAsyncResult.
21099 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21101 * Finishes an asynchronous stream read-into-#GBytes operation.
21103 * Returns: the newly-allocated #GBytes, or %NULL on error
21108 * g_input_stream_read_finish:
21109 * @stream: a #GInputStream.
21110 * @result: a #GAsyncResult.
21111 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21113 * Finishes an asynchronous stream read operation.
21115 * Returns: number of bytes read in, or -1 on error, or 0 on end of file.
21120 * g_input_stream_set_pending:
21121 * @stream: input stream
21122 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21124 * Sets @stream to have actions pending. If the pending flag is
21125 * already set or @stream is closed, it will return %FALSE and set
21128 * Returns: %TRUE if pending was previously unset and is now set.
21133 * g_input_stream_skip:
21134 * @stream: a #GInputStream.
21135 * @count: the number of bytes that will be skipped from the stream
21136 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21137 * @error: location to store the error occurring, or %NULL to ignore
21139 * Tries to skip @count bytes from the stream. Will block during the operation.
21141 * This is identical to g_input_stream_read(), from a behaviour standpoint,
21142 * but the bytes that are skipped are not returned to the user. Some
21143 * streams have an implementation that is more efficient than reading the data.
21145 * This function is optional for inherited classes, as the default implementation
21146 * emulates it using read.
21148 * If @cancellable is not %NULL, then the operation can be cancelled by
21149 * triggering the cancellable object from another thread. If the operation
21150 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21151 * operation was partially finished when the operation was cancelled the
21152 * partial result will be returned, without an error.
21154 * Returns: Number of bytes skipped, or -1 on error
21159 * g_input_stream_skip_async:
21160 * @stream: A #GInputStream.
21161 * @count: the number of bytes that will be skipped from the stream
21162 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21163 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21164 * @callback: (scope async): callback to call when the request is satisfied
21165 * @user_data: (closure): the data to pass to callback function
21167 * Request an asynchronous skip of @count bytes from the stream.
21168 * When the operation is finished @callback will be called.
21169 * You can then call g_input_stream_skip_finish() to get the result
21170 * of the operation.
21172 * During an async request no other sync and async calls are allowed,
21173 * and will result in %G_IO_ERROR_PENDING errors.
21175 * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21177 * On success, the number of bytes skipped will be passed to the callback.
21178 * It is not an error if this is not the same as the requested size, as it
21179 * can happen e.g. near the end of a file, but generally we try to skip
21180 * as many bytes as requested. Zero is returned on end of file
21181 * (or if @count is zero), but never otherwise.
21183 * Any outstanding i/o request with higher priority (lower numerical value)
21184 * will be executed before an outstanding request with lower priority.
21185 * Default priority is %G_PRIORITY_DEFAULT.
21187 * The asynchronous methods have a default fallback that uses threads to
21188 * implement asynchronicity, so they are optional for inheriting classes.
21189 * However, if you override one, you must override all.
21194 * g_input_stream_skip_finish:
21195 * @stream: a #GInputStream.
21196 * @result: a #GAsyncResult.
21197 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21199 * Finishes a stream skip operation.
21201 * Returns: the size of the bytes skipped, or %-1 on error.
21206 * g_io_error_from_errno:
21207 * @err_no: Error number as defined in errno.h.
21209 * Converts errno.h error codes into GIO error codes.
21211 * Returns: #GIOErrorEnum value for the given errno.h error number.
21216 * g_io_error_from_win32_error:
21217 * @error_code: Windows error number.
21219 * Converts some common error codes into GIO error codes. The
21220 * fallback value G_IO_ERROR_FAILED is returned for error codes not
21223 * Returns: #GIOErrorEnum value for the given error number.
21229 * g_io_error_quark:
21231 * Gets the GIO Error Quark.
21233 * Returns: a #GQuark.
21238 * g_io_extension_get_name:
21239 * @extension: a #GIOExtension
21241 * Gets the name under which @extension was registered.
21243 * Note that the same type may be registered as extension
21244 * for multiple extension points, under different names.
21246 * Returns: the name of @extension.
21251 * g_io_extension_get_priority:
21252 * @extension: a #GIOExtension
21254 * Gets the priority with which @extension was registered.
21256 * Returns: the priority of @extension
21261 * g_io_extension_get_type:
21262 * @extension: a #GIOExtension
21264 * Gets the type associated with @extension.
21266 * Returns: the type of @extension
21271 * g_io_extension_point_get_extension_by_name:
21272 * @extension_point: a #GIOExtensionPoint
21273 * @name: the name of the extension to get
21275 * Finds a #GIOExtension for an extension point by name.
21277 * Returns: (transfer none): the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name
21282 * g_io_extension_point_get_extensions:
21283 * @extension_point: a #GIOExtensionPoint
21285 * Gets a list of all extensions that implement this extension point.
21286 * The list is sorted by priority, beginning with the highest priority.
21288 * Returns: (element-type GIOExtension) (transfer none): a #GList of #GIOExtension<!-- -->s. The list is owned by GIO and should not be modified.
21293 * g_io_extension_point_get_required_type:
21294 * @extension_point: a #GIOExtensionPoint
21296 * Gets the required type for @extension_point.
21298 * Returns: the #GType that all implementations must have, or #G_TYPE_INVALID if the extension point has no required type
21303 * g_io_extension_point_implement:
21304 * @extension_point_name: the name of the extension point
21305 * @type: the #GType to register as extension
21306 * @extension_name: the name for the extension
21307 * @priority: the priority for the extension
21309 * Registers @type as extension for the extension point with name
21310 * @extension_point_name.
21312 * If @type has already been registered as an extension for this
21313 * extension point, the existing #GIOExtension object is returned.
21315 * Returns: (transfer none): a #GIOExtension object for #GType
21320 * g_io_extension_point_lookup:
21321 * @name: the name of the extension point
21323 * Looks up an existing extension point.
21325 * Returns: (transfer none): the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name.
21330 * g_io_extension_point_register:
21331 * @name: The name of the extension point
21333 * Registers an extension point.
21335 * Returns: (transfer none): the new #GIOExtensionPoint. This object is owned by GIO and should not be freed.
21340 * g_io_extension_point_set_required_type:
21341 * @extension_point: a #GIOExtensionPoint
21342 * @type: the #GType to require
21344 * Sets the required type for @extension_point to @type.
21345 * All implementations must henceforth have this type.
21350 * g_io_extension_ref_class:
21351 * @extension: a #GIOExtension
21353 * Gets a reference to the class for the type that is
21354 * associated with @extension.
21356 * Returns: (transfer full): the #GTypeClass for the type of @extension
21362 * @filename: filename of the shared library module.
21364 * Creates a new GIOModule that will load the specific
21365 * shared library when in use.
21367 * Returns: a #GIOModule from given @filename, or %NULL on error.
21372 * g_io_module_scope_block:
21373 * @scope: a module loading scope
21374 * @basename: the basename to block
21376 * Block modules with the given @basename from being loaded when
21377 * this scope is used with g_io_modules_scan_all_in_directory_with_scope()
21378 * or g_io_modules_load_all_in_directory_with_scope().
21385 * g_io_module_scope_free:
21386 * @scope: a module loading scope
21388 * Free a module scope.
21395 * g_io_module_scope_new:
21396 * @flags: flags for the new scope
21398 * Create a new scope for loading of IO modules. A scope can be used for
21399 * blocking duplicate modules, or blocking a module you don't want to load.
21401 * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
21402 * which have the same base name as a module that has already been seen
21405 * Returns: (transfer full): the new module scope
21411 * g_io_modules_load_all_in_directory:
21412 * @dirname: pathname for a directory containing modules to load.
21414 * Loads all the modules in the specified directory.
21416 * If don't require all modules to be initialized (and thus registering
21417 * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21418 * which allows delayed/lazy loading of modules.
21420 * 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().
21425 * g_io_modules_load_all_in_directory_with_scope:
21426 * @dirname: pathname for a directory containing modules to load.
21427 * @scope: a scope to use when scanning the modules.
21429 * Loads all the modules in the specified directory.
21431 * If don't require all modules to be initialized (and thus registering
21432 * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21433 * which allows delayed/lazy loading of modules.
21435 * 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().
21441 * g_io_modules_scan_all_in_directory:
21442 * @dirname: pathname for a directory containing modules to scan.
21444 * Scans all the modules in the specified directory, ensuring that
21445 * any extension point implemented by a module is registered.
21447 * This may not actually load and initialize all the types in each
21448 * module, some modules may be lazily loaded and initialized when
21449 * an extension point it implementes is used with e.g.
21450 * g_io_extension_point_get_extensions() or
21451 * g_io_extension_point_get_extension_by_name().
21453 * If you need to guarantee that all types are loaded in all the modules,
21454 * use g_io_modules_load_all_in_directory().
21461 * g_io_modules_scan_all_in_directory_with_scope:
21462 * @dirname: pathname for a directory containing modules to scan.
21463 * @scope: a scope to use when scanning the modules
21465 * Scans all the modules in the specified directory, ensuring that
21466 * any extension point implemented by a module is registered.
21468 * This may not actually load and initialize all the types in each
21469 * module, some modules may be lazily loaded and initialized when
21470 * an extension point it implementes is used with e.g.
21471 * g_io_extension_point_get_extensions() or
21472 * g_io_extension_point_get_extension_by_name().
21474 * If you need to guarantee that all types are loaded in all the modules,
21475 * use g_io_modules_load_all_in_directory().
21482 * g_io_scheduler_cancel_all_jobs:
21484 * Cancels all cancellable I/O jobs.
21486 * A job is cancellable if a #GCancellable was passed into
21487 * g_io_scheduler_push_job().
21489 * Deprecated: You should never call this function, since you don't know how other libraries in your program might be making use of gioscheduler.
21494 * g_io_scheduler_job_send_to_mainloop:
21495 * @job: a #GIOSchedulerJob
21496 * @func: a #GSourceFunc callback that will be called in the original thread
21497 * @user_data: data to pass to @func
21498 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
21500 * Used from an I/O job to send a callback to be run in the thread
21501 * that the job was started from, waiting for the result (and thus
21502 * blocking the I/O job).
21504 * Returns: The return value of @func
21505 * Deprecated: Use g_main_context_invoke().
21510 * g_io_scheduler_job_send_to_mainloop_async:
21511 * @job: a #GIOSchedulerJob
21512 * @func: a #GSourceFunc callback that will be called in the original thread
21513 * @user_data: data to pass to @func
21514 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
21516 * Used from an I/O job to send a callback to be run asynchronously in
21517 * the thread that the job was started from. The callback will be run
21518 * when the main loop is available, but at that time the I/O job might
21519 * have finished. The return value from the callback is ignored.
21521 * Note that if you are passing the @user_data from g_io_scheduler_push_job()
21522 * on to this function you have to ensure that it is not freed before
21523 * @func is called, either by passing %NULL as @notify to
21524 * g_io_scheduler_push_job() or by using refcounting for @user_data.
21526 * Deprecated: Use g_main_context_invoke().
21531 * g_io_scheduler_push_job:
21532 * @job_func: a #GIOSchedulerJobFunc.
21533 * @user_data: data to pass to @job_func
21534 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
21535 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21536 * @cancellable: optional #GCancellable object, %NULL to ignore.
21538 * Schedules the I/O job to run in another thread.
21540 * @notify will be called on @user_data after @job_func has returned,
21541 * regardless whether the job was cancelled or has run to completion.
21543 * If @cancellable is not %NULL, it can be used to cancel the I/O job
21544 * by calling g_cancellable_cancel() or by calling
21545 * g_io_scheduler_cancel_all_jobs().
21547 * Deprecated: use #GThreadPool or g_task_run_in_thread()
21552 * g_io_stream_clear_pending:
21553 * @stream: a #GIOStream
21555 * Clears the pending flag on @stream.
21562 * g_io_stream_close:
21563 * @stream: a #GIOStream
21564 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21565 * @error: location to store the error occurring, or %NULL to ignore
21567 * Closes the stream, releasing resources related to it. This will also
21568 * closes the individual input and output streams, if they are not already
21571 * Once the stream is closed, all other operations will return
21572 * %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
21575 * Closing a stream will automatically flush any outstanding buffers
21578 * Streams will be automatically closed when the last reference
21579 * is dropped, but you might want to call this function to make sure
21580 * resources are released as early as possible.
21582 * Some streams might keep the backing store of the stream (e.g. a file
21583 * descriptor) open after the stream is closed. See the documentation for
21584 * the individual stream for details.
21586 * On failure the first error that happened will be reported, but the
21587 * close operation will finish as much as possible. A stream that failed
21588 * to close will still return %G_IO_ERROR_CLOSED for all operations.
21589 * Still, it is important to check and report the error to the user,
21590 * otherwise there might be a loss of data as all data might not be written.
21592 * If @cancellable is not NULL, then the operation can be cancelled by
21593 * triggering the cancellable object from another thread. If the operation
21594 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21595 * Cancelling a close will still leave the stream closed, but some streams
21596 * can use a faster close that doesn't block to e.g. check errors.
21598 * The default implementation of this method just calls close on the
21599 * individual input/output streams.
21601 * Returns: %TRUE on success, %FALSE on failure
21607 * g_io_stream_close_async:
21608 * @stream: a #GIOStream
21609 * @io_priority: the io priority of the request
21610 * @cancellable: (allow-none): optional cancellable object
21611 * @callback: (scope async): callback to call when the request is satisfied
21612 * @user_data: (closure): the data to pass to callback function
21614 * Requests an asynchronous close of the stream, releasing resources
21615 * related to it. When the operation is finished @callback will be
21616 * called. You can then call g_io_stream_close_finish() to get
21617 * the result of the operation.
21619 * For behaviour details see g_io_stream_close().
21621 * The asynchronous methods have a default fallback that uses threads
21622 * to implement asynchronicity, so they are optional for inheriting
21623 * classes. However, if you override one you must override all.
21630 * g_io_stream_close_finish:
21631 * @stream: a #GIOStream
21632 * @result: a #GAsyncResult
21633 * @error: a #GError location to store the error occurring, or %NULL to ignore
21637 * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
21643 * g_io_stream_get_input_stream:
21644 * @stream: a #GIOStream
21646 * Gets the input stream for this object. This is used
21649 * Returns: (transfer none): a #GInputStream, owned by the #GIOStream. Do not free.
21655 * g_io_stream_get_output_stream:
21656 * @stream: a #GIOStream
21658 * Gets the output stream for this object. This is used for
21661 * Returns: (transfer none): a #GOutputStream, owned by the #GIOStream. Do not free.
21667 * g_io_stream_has_pending:
21668 * @stream: a #GIOStream
21670 * Checks if a stream has pending actions.
21672 * Returns: %TRUE if @stream has pending actions.
21678 * g_io_stream_is_closed:
21679 * @stream: a #GIOStream
21681 * Checks if a stream is closed.
21683 * Returns: %TRUE if the stream is closed.
21689 * g_io_stream_set_pending:
21690 * @stream: a #GIOStream
21691 * @error: a #GError location to store the error occurring, or %NULL to ignore
21693 * Sets @stream to have actions pending. If the pending flag is
21694 * already set or @stream is closed, it will return %FALSE and set
21697 * Returns: %TRUE if pending was previously unset and is now set.
21703 * g_io_stream_splice_async:
21704 * @stream1: a #GIOStream.
21705 * @stream2: a #GIOStream.
21706 * @flags: a set of #GIOStreamSpliceFlags.
21707 * @io_priority: the io priority of the request.
21708 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21709 * @callback: (scope async): a #GAsyncReadyCallback.
21710 * @user_data: (closure): user data passed to @callback.
21712 * Asyncronously splice the output stream of @stream1 to the input stream of
21713 * @stream2, and splice the output stream of @stream2 to the input stream of
21716 * When the operation is finished @callback will be called.
21717 * You can then call g_io_stream_splice_finish() to get the
21718 * result of the operation.
21725 * g_io_stream_splice_finish:
21726 * @result: a #GAsyncResult.
21727 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21729 * Finishes an asynchronous io stream splice operation.
21731 * Returns: %TRUE on success, %FALSE otherwise.
21737 * g_keyfile_settings_backend_new:
21738 * @filename: the filename of the keyfile
21739 * @root_path: the path under which all settings keys appear
21740 * @root_group: (allow-none): the group name corresponding to @root_path, or %NULL
21742 * Creates a keyfile-backed #GSettingsBackend.
21744 * The filename of the keyfile to use is given by @filename.
21746 * All settings read to or written from the backend must fall under the
21747 * path given in @root_path (which must start and end with a slash and
21748 * not contain two consecutive slashes). @root_path may be "/".
21750 * If @root_group is non-%NULL then it specifies the name of the keyfile
21751 * group used for keys that are written directly below @root_path. For
21752 * example, if @root_path is "/apps/example/" and @root_group is
21753 * "toplevel", then settings the key "/apps/example/enabled" to a value
21754 * of %TRUE will cause the following to appear in the keyfile:
21761 * If @root_group is %NULL then it is not permitted to store keys
21762 * directly below the @root_path.
21764 * For keys not stored directly below @root_path (ie: in a sub-path),
21765 * the name of the subpath (with the final slash stripped) is used as
21766 * the name of the keyfile group. To continue the example, if
21767 * "/apps/example/profiles/default/font-size" were set to
21768 * 12 then the following would appear in the keyfile:
21771 * [profiles/default]
21775 * The backend will refuse writes (and return writability as being
21776 * %FALSE) for keys outside of @root_path and, in the event that
21777 * @root_group is %NULL, also for keys directly under @root_path.
21778 * Writes will also be refused if the backend detects that it has the
21779 * inability to rewrite the keyfile (ie: the containing directory is not
21782 * There is no checking done for your key namespace clashing with the
21783 * syntax of the key file format. For example, if you have '[' or ']'
21784 * characters in your path names or '=' in your key names you may be in
21787 * Returns: (transfer full): a keyfile-backed #GSettingsBackend
21792 * g_loadable_icon_load:
21793 * @icon: a #GLoadableIcon.
21794 * @size: an integer.
21795 * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
21796 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21797 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21799 * Loads a loadable icon. For the asynchronous version of this function,
21800 * see g_loadable_icon_load_async().
21802 * Returns: (transfer full): a #GInputStream to read the icon from.
21807 * g_loadable_icon_load_async:
21808 * @icon: a #GLoadableIcon.
21809 * @size: an integer.
21810 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21811 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
21812 * @user_data: (closure): the data to pass to callback function
21814 * Loads an icon asynchronously. To finish this function, see
21815 * g_loadable_icon_load_finish(). For the synchronous, blocking
21816 * version of this function, see g_loadable_icon_load().
21821 * g_loadable_icon_load_finish:
21822 * @icon: a #GLoadableIcon.
21823 * @res: a #GAsyncResult.
21824 * @type: a location to store the type of the loaded icon, %NULL to ignore.
21825 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21827 * Finishes an asynchronous icon load started in g_loadable_icon_load_async().
21829 * Returns: (transfer full): a #GInputStream to read the icon from.
21836 * Returns a new #GVfs handle for a local vfs.
21838 * Returns: a new #GVfs handle.
21843 * g_memory_input_stream_add_bytes:
21844 * @stream: a #GMemoryInputStream
21845 * @bytes: input data
21847 * Appends @bytes to data that can be read from the input stream.
21854 * g_memory_input_stream_add_data:
21855 * @stream: a #GMemoryInputStream
21856 * @data: (array length=len) (element-type guint8) (transfer full): input data
21857 * @len: length of the data, may be -1 if @data is a nul-terminated string
21858 * @destroy: (allow-none): function that is called to free @data, or %NULL
21860 * Appends @data to data that can be read from the input stream
21865 * g_memory_input_stream_new:
21867 * Creates a new empty #GMemoryInputStream.
21869 * Returns: a new #GInputStream
21874 * g_memory_input_stream_new_from_bytes:
21875 * @bytes: a #GBytes
21877 * Creates a new #GMemoryInputStream with data from the given @bytes.
21879 * Returns: new #GInputStream read from @bytes
21885 * g_memory_input_stream_new_from_data:
21886 * @data: (array length=len) (element-type guint8) (transfer full): input data
21887 * @len: length of the data, may be -1 if @data is a nul-terminated string
21888 * @destroy: (allow-none): function that is called to free @data, or %NULL
21890 * Creates a new #GMemoryInputStream with data in memory of a given size.
21892 * Returns: new #GInputStream read from @data of @len bytes.
21897 * g_memory_output_stream_get_data:
21898 * @ostream: a #GMemoryOutputStream
21900 * Gets any loaded data from the @ostream.
21902 * Note that the returned pointer may become invalid on the next
21903 * write or truncate operation on the stream.
21905 * Returns: (transfer none): pointer to the stream's data
21910 * g_memory_output_stream_get_data_size:
21911 * @ostream: a #GMemoryOutputStream
21913 * Returns the number of bytes from the start up
21914 * to including the last byte written in the stream
21915 * that has not been truncated away.
21917 * Returns: the number of bytes written to the stream
21923 * g_memory_output_stream_get_size:
21924 * @ostream: a #GMemoryOutputStream
21926 * Gets the size of the currently allocated data area (available from
21927 * g_memory_output_stream_get_data()). If the stream isn't
21928 * growable (no realloc was passed to g_memory_output_stream_new()) then
21929 * this is the maximum size of the stream and further writes
21930 * will return %G_IO_ERROR_NO_SPACE.
21932 * Note that for growable streams the returned size may become invalid on
21933 * the next write or truncate operation on the stream.
21935 * If you want the number of bytes currently written to the stream, use
21936 * g_memory_output_stream_get_data_size().
21938 * Returns: the number of bytes allocated for the data buffer
21943 * g_memory_output_stream_new: (skip)
21944 * @data: (allow-none): pointer to a chunk of memory to use, or %NULL
21945 * @size: the size of @data
21946 * @realloc_function: (allow-none): a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
21947 * @destroy_function: (allow-none): a function to be called on @data when the stream is finalized, or %NULL
21949 * Creates a new #GMemoryOutputStream.
21951 * If @data is non-%NULL, the stream will use that for its internal storage.
21952 * If @realloc_fn is non-%NULL, it will be used for resizing the internal
21953 * storage when necessary. To construct a fixed-size output stream,
21954 * pass %NULL as @realloc_fn.
21957 * /* a stream that can grow */
21958 * stream = g_memory_output_stream_new (NULL, 0, realloc, free);
21960 * /* another stream that can grow */
21961 * stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
21963 * /* a fixed-size stream */
21964 * data = malloc (200);
21965 * stream3 = g_memory_output_stream_new (data, 200, NULL, free);
21968 * Returns: A newly created #GMemoryOutputStream object.
21973 * g_memory_output_stream_new_resizable:
21975 * Creates a new #GMemoryOutputStream, using g_realloc() and g_free()
21976 * for memory allocation.
21983 * g_memory_output_stream_steal_as_bytes:
21984 * @ostream: a #GMemoryOutputStream
21986 * Returns data from the @ostream as a #GBytes. @ostream must be
21987 * closed before calling this function.
21989 * Returns: (transfer full): the stream's data
21995 * g_memory_output_stream_steal_data:
21996 * @ostream: a #GMemoryOutputStream
21998 * Gets any loaded data from the @ostream. Ownership of the data
21999 * is transferred to the caller; when no longer needed it must be
22000 * freed using the free function set in @ostream's
22001 * #GMemoryOutputStream:destroy-function property.
22003 * @ostream must be closed before calling this function.
22005 * Returns: (transfer full): the stream's data
22011 * g_memory_settings_backend_new:
22013 * Creates a memory-backed #GSettingsBackend.
22015 * This backend allows changes to settings, but does not write them
22016 * to any backing storage, so the next time you run your application,
22017 * the memory backend will start out with the default values again.
22019 * Returns: (transfer full): a newly created #GSettingsBackend
22027 * @label: (allow-none): the section label, or %NULL
22028 * @detailed_action: (allow-none): the detailed action string, or %NULL
22030 * Convenience function for appending a normal menu item to the end of
22031 * @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
22032 * flexible alternative.
22039 * g_menu_append_item:
22041 * @item: a #GMenuItem to append
22043 * Appends @item to the end of @menu.
22045 * See g_menu_insert_item() for more information.
22052 * g_menu_append_section:
22054 * @label: (allow-none): the section label, or %NULL
22055 * @section: a #GMenuModel with the items of the section
22057 * Convenience function for appending a section menu item to the end of
22058 * @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for a
22059 * more flexible alternative.
22066 * g_menu_append_submenu:
22068 * @label: (allow-none): the section label, or %NULL
22069 * @submenu: a #GMenuModel with the items of the submenu
22071 * Convenience function for appending a submenu menu item to the end of
22072 * @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for a
22073 * more flexible alternative.
22080 * g_menu_attribute_iter_get_name:
22081 * @iter: a #GMenuAttributeIter
22083 * Gets the name of the attribute at the current iterator position, as
22086 * The iterator is not advanced.
22088 * Returns: the name of the attribute
22094 * g_menu_attribute_iter_get_next:
22095 * @iter: a #GMenuAttributeIter
22096 * @out_name: (out) (allow-none) (transfer none): the type of the attribute
22097 * @value: (out) (allow-none) (transfer full): the attribute value
22099 * This function combines g_menu_attribute_iter_next() with
22100 * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
22102 * First the iterator is advanced to the next (possibly first) attribute.
22103 * If that fails, then %FALSE is returned and there are no other
22106 * If successful, @name and @value are set to the name and value of the
22107 * attribute that has just been advanced to. At this point,
22108 * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will
22109 * return the same values again.
22111 * The value returned in @name remains valid for as long as the iterator
22112 * remains at the current position. The value returned in @value must
22113 * be unreffed using g_variant_unref() when it is no longer in use.
22115 * Returns: %TRUE on success, or %FALSE if there is no additional attribute
22121 * g_menu_attribute_iter_get_value:
22122 * @iter: a #GMenuAttributeIter
22124 * Gets the value of the attribute at the current iterator position.
22126 * The iterator is not advanced.
22128 * Returns: (transfer full): the value of the current attribute
22134 * g_menu_attribute_iter_next:
22135 * @iter: a #GMenuAttributeIter
22137 * Attempts to advance the iterator to the next (possibly first)
22140 * %TRUE is returned on success, or %FALSE if there are no more
22143 * You must call this function when you first acquire the iterator
22144 * to advance it to the first attribute (and determine if the first
22145 * attribute exists at all).
22147 * Returns: %TRUE on success, or %FALSE when there are no more attributes
22156 * Marks @menu as frozen.
22158 * After the menu is frozen, it is an error to attempt to make any
22159 * changes to it. In effect this means that the #GMenu API must no
22162 * This function causes g_menu_model_is_mutable() to begin returning
22163 * %FALSE, which has some positive performance implications.
22172 * @position: the position at which to insert the item
22173 * @label: (allow-none): the section label, or %NULL
22174 * @detailed_action: (allow-none): the detailed action string, or %NULL
22176 * Convenience function for inserting a normal menu item into @menu.
22177 * Combine g_menu_item_new() and g_menu_insert_item() for a more flexible
22185 * g_menu_insert_item:
22187 * @position: the position at which to insert the item
22188 * @item: the #GMenuItem to insert
22190 * Inserts @item into @menu.
22192 * The "insertion" is actually done by copying all of the attribute and
22193 * link values of @item and using them to form a new item within @menu.
22194 * As such, @item itself is not really inserted, but rather, a menu item
22195 * that is exactly the same as the one presently described by @item.
22197 * This means that @item is essentially useless after the insertion
22198 * occurs. Any changes you make to it are ignored unless it is inserted
22199 * again (at which point its updated values will be copied).
22201 * You should probably just free @item once you're done.
22203 * There are many convenience functions to take care of common cases.
22204 * See g_menu_insert(), g_menu_insert_section() and
22205 * g_menu_insert_submenu() as well as "prepend" and "append" variants of
22206 * each of these functions.
22213 * g_menu_insert_section:
22215 * @position: the position at which to insert the item
22216 * @label: (allow-none): the section label, or %NULL
22217 * @section: a #GMenuModel with the items of the section
22219 * Convenience function for inserting a section menu item into @menu.
22220 * Combine g_menu_item_new_section() and g_menu_insert_item() for a more
22221 * flexible alternative.
22228 * g_menu_insert_submenu:
22230 * @position: the position at which to insert the item
22231 * @label: (allow-none): the section label, or %NULL
22232 * @submenu: a #GMenuModel with the items of the submenu
22234 * Convenience function for inserting a submenu menu item into @menu.
22235 * Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more
22236 * flexible alternative.
22243 * g_menu_item_get_attribute:
22244 * @menu_item: a #GMenuItem
22245 * @attribute: the attribute name to query
22246 * @format_string: a #GVariant format string
22247 * @...: positional parameters, as per @format_string
22249 * Queries the named @attribute on @menu_item.
22251 * If the attribute exists and matches the #GVariantType corresponding
22252 * to @format_string then @format_string is used to deconstruct the
22253 * value into the positional parameters and %TRUE is returned.
22255 * If the attribute does not exist, or it does exist but has the wrong
22256 * type, then the positional parameters are ignored and %FALSE is
22259 * Returns: %TRUE if the named attribute was found with the expected type
22265 * g_menu_item_get_attribute_value:
22266 * @menu_item: a #GMenuItem
22267 * @attribute: the attribute name to query
22268 * @expected_type: (allow-none): the expected type of the attribute
22270 * Queries the named @attribute on @menu_item.
22272 * If @expected_type is specified and the attribute does not have this
22273 * type, %NULL is returned. %NULL is also returned if the attribute
22274 * simply does not exist.
22276 * Returns: (transfer full): the attribute value, or %NULL
22282 * g_menu_item_get_link:
22283 * @menu_item: a #GMenuItem
22284 * @link: the link name to query
22286 * Queries the named @link on @menu_item.
22288 * Returns: (transfer full): the link, or %NULL
22295 * @label: (allow-none): the section label, or %NULL
22296 * @detailed_action: (allow-none): the detailed action string, or %NULL
22298 * Creates a new #GMenuItem.
22300 * If @label is non-%NULL it is used to set the "label" attribute of the
22303 * If @detailed_action is non-%NULL it is used to set the "action" and
22304 * possibly the "target" attribute of the new item. See
22305 * g_menu_item_set_detailed_action() for more information.
22307 * Returns: a new #GMenuItem
22313 * g_menu_item_new_from_model:
22314 * @model: a #GMenuModel
22315 * @item_index: the index of an item in @model
22317 * Creates a #GMenuItem as an exact copy of an existing menu item in a
22320 * @item_index must be valid (ie: be sure to call
22321 * g_menu_model_get_n_items() first).
22323 * Returns: a new #GMenuItem.
22329 * g_menu_item_new_section:
22330 * @label: (allow-none): the section label, or %NULL
22331 * @section: a #GMenuModel with the items of the section
22333 * Creates a new #GMenuItem representing a section.
22335 * This is a convenience API around g_menu_item_new() and
22336 * g_menu_item_set_section().
22338 * The effect of having one menu appear as a section of another is
22339 * exactly as it sounds: the items from @section become a direct part of
22340 * the menu that @menu_item is added to.
22342 * Visual separation is typically displayed between two non-empty
22343 * sections. If @label is non-%NULL then it will be encorporated into
22344 * this visual indication. This allows for labeled subsections of a
22347 * As a simple example, consider a typical "Edit" menu from a simple
22348 * program. It probably contains an "Undo" and "Redo" item, followed by
22349 * a separator, followed by "Cut", "Copy" and "Paste".
22351 * This would be accomplished by creating three #GMenu instances. The
22352 * first would be populated with the "Undo" and "Redo" items, and the
22353 * second with the "Cut", "Copy" and "Paste" items. The first and
22354 * second menus would then be added as submenus of the third. In XML
22355 * format, this would look something like the following:
22357 * <informalexample><programlisting><![CDATA[
22358 * <menu id='edit-menu'>
22360 * <item label='Undo'/>
22361 * <item label='Redo'/>
22364 * <item label='Cut'/>
22365 * <item label='Copy'/>
22366 * <item label='Paste'/>
22369 * ]]></programlisting></informalexample>
22371 * The following example is exactly equivalent. It is more illustrative
22372 * of the exact relationship between the menus and items (keeping in
22373 * mind that the 'link' element defines a new menu that is linked to the
22374 * containing one). The style of the second example is more verbose and
22375 * difficult to read (and therefore not recommended except for the
22376 * purpose of understanding what is really going on).
22378 * <informalexample><programlisting><![CDATA[
22379 * <menu id='edit-menu'>
22381 * <link name='section'>
22382 * <item label='Undo'/>
22383 * <item label='Redo'/>
22387 * <link name='section'>
22388 * <item label='Cut'/>
22389 * <item label='Copy'/>
22390 * <item label='Paste'/>
22394 * ]]></programlisting></informalexample>
22396 * Returns: a new #GMenuItem
22402 * g_menu_item_new_submenu:
22403 * @label: (allow-none): the section label, or %NULL
22404 * @submenu: a #GMenuModel with the items of the submenu
22406 * Creates a new #GMenuItem representing a submenu.
22408 * This is a convenience API around g_menu_item_new() and
22409 * g_menu_item_set_submenu().
22411 * Returns: a new #GMenuItem
22417 * g_menu_item_set_action_and_target:
22418 * @menu_item: a #GMenuItem
22419 * @action: (allow-none): the name of the action for this item
22420 * @format_string: (allow-none): a GVariant format string
22421 * @...: positional parameters, as per @format_string
22423 * Sets or unsets the "action" and "target" attributes of @menu_item.
22425 * If @action is %NULL then both the "action" and "target" attributes
22426 * are unset (and @format_string is ignored along with the positional
22429 * If @action is non-%NULL then the "action" attribute is set.
22430 * @format_string is then inspected. If it is non-%NULL then the proper
22431 * position parameters are collected to create a #GVariant instance to
22432 * use as the target value. If it is %NULL then the positional
22433 * parameters are ignored and the "target" attribute is unset.
22435 * See also g_menu_item_set_action_and_target_value() for an equivalent
22436 * call that directly accepts a #GVariant. See
22437 * g_menu_item_set_detailed_action() for a more convenient version that
22438 * works with string-typed targets.
22440 * See also g_menu_item_set_action_and_target_value() for a
22441 * description of the semantics of the action and target attributes.
22448 * g_menu_item_set_action_and_target_value:
22449 * @menu_item: a #GMenuItem
22450 * @action: (allow-none): the name of the action for this item
22451 * @target_value: (allow-none): a #GVariant to use as the action target
22453 * Sets or unsets the "action" and "target" attributes of @menu_item.
22455 * If @action is %NULL then both the "action" and "target" attributes
22456 * are unset (and @target_value is ignored).
22458 * If @action is non-%NULL then the "action" attribute is set. The
22459 * "target" attribute is then set to the value of @target_value if it is
22460 * non-%NULL or unset otherwise.
22462 * Normal menu items (ie: not submenu, section or other custom item
22463 * types) are expected to have the "action" attribute set to identify
22464 * the action that they are associated with. The state type of the
22465 * action help to determine the disposition of the menu item. See
22466 * #GAction and #GActionGroup for an overview of actions.
22468 * In general, clicking on the menu item will result in activation of
22469 * the named action with the "target" attribute given as the parameter
22470 * to the action invocation. If the "target" attribute is not set then
22471 * the action is invoked with no parameter.
22473 * If the action has no state then the menu item is usually drawn as a
22474 * plain menu item (ie: with no additional decoration).
22476 * If the action has a boolean state then the menu item is usually drawn
22477 * as a toggle menu item (ie: with a checkmark or equivalent
22478 * indication). The item should be marked as 'toggled' or 'checked'
22479 * when the boolean state is %TRUE.
22481 * If the action has a string state then the menu item is usually drawn
22482 * as a radio menu item (ie: with a radio bullet or equivalent
22483 * indication). The item should be marked as 'selected' when the string
22484 * state is equal to the value of the @target property.
22486 * See g_menu_item_set_action_and_target() or
22487 * g_menu_item_set_detailed_action() for two equivalent calls that are
22488 * probably more convenient for most uses.
22495 * g_menu_item_set_attribute:
22496 * @menu_item: a #GMenuItem
22497 * @attribute: the attribute to set
22498 * @format_string: (allow-none): a #GVariant format string, or %NULL
22499 * @...: positional parameters, as per @format_string
22501 * Sets or unsets an attribute on @menu_item.
22503 * The attribute to set or unset is specified by @attribute. This
22504 * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
22505 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
22507 * Attribute names are restricted to lowercase characters, numbers
22508 * and '-'. Furthermore, the names must begin with a lowercase character,
22509 * must not end with a '-', and must not contain consecutive dashes.
22511 * If @format_string is non-%NULL then the proper position parameters
22512 * are collected to create a #GVariant instance to use as the attribute
22513 * value. If it is %NULL then the positional parameterrs are ignored
22514 * and the named attribute is unset.
22516 * See also g_menu_item_set_attribute_value() for an equivalent call
22517 * that directly accepts a #GVariant.
22524 * g_menu_item_set_attribute_value:
22525 * @menu_item: a #GMenuItem
22526 * @attribute: the attribute to set
22527 * @value: (allow-none): a #GVariant to use as the value, or %NULL
22529 * Sets or unsets an attribute on @menu_item.
22531 * The attribute to set or unset is specified by @attribute. This
22532 * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
22533 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
22535 * Attribute names are restricted to lowercase characters, numbers
22536 * and '-'. Furthermore, the names must begin with a lowercase character,
22537 * must not end with a '-', and must not contain consecutive dashes.
22539 * must consist only of lowercase
22540 * ASCII characters, digits and '-'.
22542 * If @value is non-%NULL then it is used as the new value for the
22543 * attribute. If @value is %NULL then the attribute is unset. If
22544 * the @value #GVariant is floating, it is consumed.
22546 * See also g_menu_item_set_attribute() for a more convenient way to do
22554 * g_menu_item_set_detailed_action:
22555 * @menu_item: a #GMenuItem
22556 * @detailed_action: the "detailed" action string
22558 * Sets the "action" and possibly the "target" attribute of @menu_item.
22560 * If @detailed_action contains a double colon ("::") then it is used as
22561 * a separator between an action name and a target string. In this
22562 * case, this call is equivalent to calling
22563 * g_menu_item_set_action_and_target() with the part before the "::" and
22564 * with a string-type #GVariant containing the part following the "::".
22566 * If @detailed_action doesn't contain "::" then the action is set to
22567 * the given string (verbatim) and the target value is unset.
22569 * See g_menu_item_set_action_and_target() or
22570 * g_menu_item_set_action_and_target_value() for more flexible (but
22571 * slightly less convenient) alternatives.
22573 * See also g_menu_item_set_action_and_target_value() for a description of
22574 * the semantics of the action and target attributes.
22581 * g_menu_item_set_label:
22582 * @menu_item: a #GMenuItem
22583 * @label: (allow-none): the label to set, or %NULL to unset
22585 * Sets or unsets the "label" attribute of @menu_item.
22587 * If @label is non-%NULL it is used as the label for the menu item. If
22588 * it is %NULL then the label attribute is unset.
22595 * g_menu_item_set_link:
22596 * @menu_item: a #GMenuItem
22597 * @link: type of link to establish or unset
22598 * @model: (allow-none): the #GMenuModel to link to (or %NULL to unset)
22600 * Creates a link from @menu_item to @model if non-%NULL, or unsets it.
22602 * Links are used to establish a relationship between a particular menu
22603 * item and another menu. For example, %G_MENU_LINK_SUBMENU is used to
22604 * associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
22605 * is used to create a section. Other types of link can be used, but there
22606 * is no guarantee that clients will be able to make sense of them.
22607 * Link types are restricted to lowercase characters, numbers
22608 * and '-'. Furthermore, the names must begin with a lowercase character,
22609 * must not end with a '-', and must not contain consecutive dashes.
22616 * g_menu_item_set_section:
22617 * @menu_item: a #GMenuItem
22618 * @section: (allow-none): a #GMenuModel, or %NULL
22620 * Sets or unsets the "section" link of @menu_item to @section.
22622 * The effect of having one menu appear as a section of another is
22623 * exactly as it sounds: the items from @section become a direct part of
22624 * the menu that @menu_item is added to. See g_menu_item_new_section()
22625 * for more information about what it means for a menu item to be a
22633 * g_menu_item_set_submenu:
22634 * @menu_item: a #GMenuItem
22635 * @submenu: (allow-none): a #GMenuModel, or %NULL
22637 * Sets or unsets the "submenu" link of @menu_item to @submenu.
22639 * If @submenu is non-%NULL, it is linked to. If it is %NULL then the
22642 * The effect of having one menu appear as a submenu of another is
22643 * exactly as it sounds.
22650 * g_menu_link_iter_get_name:
22651 * @iter: a #GMenuLinkIter
22653 * Gets the name of the link at the current iterator position.
22655 * The iterator is not advanced.
22657 * Returns: the type of the link
22663 * g_menu_link_iter_get_next:
22664 * @iter: a #GMenuLinkIter
22665 * @out_link: (out) (allow-none) (transfer none): the name of the link
22666 * @value: (out) (allow-none) (transfer full): the linked #GMenuModel
22668 * This function combines g_menu_link_iter_next() with
22669 * g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
22671 * First the iterator is advanced to the next (possibly first) link.
22672 * If that fails, then %FALSE is returned and there are no other effects.
22674 * If successful, @out_link and @value are set to the name and #GMenuModel
22675 * of the link that has just been advanced to. At this point,
22676 * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
22677 * same values again.
22679 * The value returned in @out_link remains valid for as long as the iterator
22680 * remains at the current position. The value returned in @value must
22681 * be unreffed using g_object_unref() when it is no longer in use.
22683 * Returns: %TRUE on success, or %FALSE if there is no additional link
22689 * g_menu_link_iter_get_value:
22690 * @iter: a #GMenuLinkIter
22692 * Gets the linked #GMenuModel at the current iterator position.
22694 * The iterator is not advanced.
22696 * Returns: (transfer full): the #GMenuModel that is linked to
22702 * g_menu_link_iter_next:
22703 * @iter: a #GMenuLinkIter
22705 * Attempts to advance the iterator to the next (possibly first)
22708 * %TRUE is returned on success, or %FALSE if there are no more links.
22710 * You must call this function when you first acquire the iterator to
22711 * advance it to the first link (and determine if the first link exists
22714 * Returns: %TRUE on success, or %FALSE when there are no more links
22720 * g_menu_model_get_item_attribute:
22721 * @model: a #GMenuModel
22722 * @item_index: the index of the item
22723 * @attribute: the attribute to query
22724 * @format_string: a #GVariant format string
22725 * @...: positional parameters, as per @format_string
22727 * Queries item at position @item_index in @model for the attribute
22728 * specified by @attribute.
22730 * If the attribute exists and matches the #GVariantType corresponding
22731 * to @format_string then @format_string is used to deconstruct the
22732 * value into the positional parameters and %TRUE is returned.
22734 * If the attribute does not exist, or it does exist but has the wrong
22735 * type, then the positional parameters are ignored and %FALSE is
22738 * This function is a mix of g_menu_model_get_item_attribute_value() and
22739 * g_variant_get(), followed by a g_variant_unref(). As such,
22740 * @format_string must make a complete copy of the data (since the
22741 * #GVariant may go away after the call to g_variant_unref()). In
22742 * particular, no '&' characters are allowed in @format_string.
22744 * Returns: %TRUE if the named attribute was found with the expected type
22750 * g_menu_model_get_item_attribute_value:
22751 * @model: a #GMenuModel
22752 * @item_index: the index of the item
22753 * @attribute: the attribute to query
22754 * @expected_type: (allow-none): the expected type of the attribute, or %NULL
22756 * Queries the item at position @item_index in @model for the attribute
22757 * specified by @attribute.
22759 * If @expected_type is non-%NULL then it specifies the expected type of
22760 * the attribute. If it is %NULL then any type will be accepted.
22762 * If the attribute exists and matches @expected_type (or if the
22763 * expected type is unspecified) then the value is returned.
22765 * If the attribute does not exist, or does not match the expected type
22766 * then %NULL is returned.
22768 * Returns: (transfer full): the value of the attribute
22774 * g_menu_model_get_item_link:
22775 * @model: a #GMenuModel
22776 * @item_index: the index of the item
22777 * @link: the link to query
22779 * Queries the item at position @item_index in @model for the link
22780 * specified by @link.
22782 * If the link exists, the linked #GMenuModel is returned. If the link
22783 * does not exist, %NULL is returned.
22785 * Returns: (transfer full): the linked #GMenuModel, or %NULL
22791 * g_menu_model_get_n_items:
22792 * @model: a #GMenuModel
22794 * Query the number of items in @model.
22796 * Returns: the number of items
22802 * g_menu_model_is_mutable:
22803 * @model: a #GMenuModel
22805 * Queries if @model is mutable.
22807 * An immutable #GMenuModel will never emit the #GMenuModel::items-changed
22808 * signal. Consumers of the model may make optimisations accordingly.
22810 * Returns: %TRUE if the model is mutable (ie: "items-changed" may be emitted).
22816 * g_menu_model_items_changed:
22817 * @model: a #GMenuModel
22818 * @position: the position of the change
22819 * @removed: the number of items removed
22820 * @added: the number of items added
22822 * Requests emission of the #GMenuModel::items-changed signal on @model.
22824 * This function should never be called except by #GMenuModel
22825 * subclasses. Any other calls to this function will very likely lead
22826 * to a violation of the interface of the model.
22828 * The implementation should update its internal representation of the
22829 * menu before emitting the signal. The implementation should further
22830 * expect to receive queries about the new state of the menu (and
22831 * particularly added menu items) while signal handlers are running.
22833 * The implementation must dispatch this call directly from a mainloop
22834 * entry and not in response to calls -- particularly those from the
22835 * #GMenuModel API. Said another way: the menu must not change while
22836 * user code is running without returning to the mainloop.
22843 * g_menu_model_iterate_item_attributes:
22844 * @model: a #GMenuModel
22845 * @item_index: the index of the item
22847 * Creates a #GMenuAttributeIter to iterate over the attributes of
22848 * the item at position @item_index in @model.
22850 * You must free the iterator with g_object_unref() when you are done.
22852 * Returns: (transfer full): a new #GMenuAttributeIter
22858 * g_menu_model_iterate_item_links:
22859 * @model: a #GMenuModel
22860 * @item_index: the index of the item
22862 * Creates a #GMenuLinkIter to iterate over the links of the item at
22863 * position @item_index in @model.
22865 * You must free the iterator with g_object_unref() when you are done.
22867 * Returns: (transfer full): a new #GMenuLinkIter
22875 * Creates a new #GMenu.
22877 * The new menu has no items.
22879 * Returns: a new #GMenu
22887 * @label: (allow-none): the section label, or %NULL
22888 * @detailed_action: (allow-none): the detailed action string, or %NULL
22890 * Convenience function for prepending a normal menu item to the start
22891 * of @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
22892 * flexible alternative.
22899 * g_menu_prepend_item:
22901 * @item: a #GMenuItem to prepend
22903 * Prepends @item to the start of @menu.
22905 * See g_menu_insert_item() for more information.
22912 * g_menu_prepend_section:
22914 * @label: (allow-none): the section label, or %NULL
22915 * @section: a #GMenuModel with the items of the section
22917 * Convenience function for prepending a section menu item to the start
22918 * of @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for
22919 * a more flexible alternative.
22926 * g_menu_prepend_submenu:
22928 * @label: (allow-none): the section label, or %NULL
22929 * @submenu: a #GMenuModel with the items of the submenu
22931 * Convenience function for prepending a submenu menu item to the start
22932 * of @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for
22933 * a more flexible alternative.
22942 * @position: the position of the item to remove
22944 * Removes an item from the menu.
22946 * @position gives the index of the item to remove.
22948 * It is an error if position is not in range the range from 0 to one
22949 * less than the number of items in the menu.
22951 * It is not possible to remove items by identity since items are added
22952 * to the menu simply by copying their links and attributes (ie:
22953 * identity of the item itself is not preserved).
22960 * g_mount_can_eject:
22961 * @mount: a #GMount.
22963 * Checks if @mount can be eject.
22965 * Returns: %TRUE if the @mount can be ejected.
22970 * g_mount_can_unmount:
22971 * @mount: a #GMount.
22973 * Checks if @mount can be mounted.
22975 * Returns: %TRUE if the @mount can be unmounted.
22981 * @mount: a #GMount.
22982 * @flags: flags affecting the unmount if required for eject
22983 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22984 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
22985 * @user_data: user data passed to @callback.
22987 * Ejects a mount. This is an asynchronous operation, and is
22988 * finished by calling g_mount_eject_finish() with the @mount
22989 * and #GAsyncResult data returned in the @callback.
22991 * Deprecated: 2.22: Use g_mount_eject_with_operation() instead.
22996 * g_mount_eject_finish:
22997 * @mount: a #GMount.
22998 * @result: a #GAsyncResult.
22999 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23001 * Finishes ejecting a mount. If any errors occurred during the operation,
23002 * @error will be set to contain the errors and %FALSE will be returned.
23004 * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23005 * Deprecated: 2.22: Use g_mount_eject_with_operation_finish() instead.
23010 * g_mount_eject_with_operation:
23011 * @mount: a #GMount.
23012 * @flags: flags affecting the unmount if required for eject
23013 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23014 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23015 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23016 * @user_data: user data passed to @callback.
23018 * Ejects a mount. This is an asynchronous operation, and is
23019 * finished by calling g_mount_eject_with_operation_finish() with the @mount
23020 * and #GAsyncResult data returned in the @callback.
23027 * g_mount_eject_with_operation_finish:
23028 * @mount: a #GMount.
23029 * @result: a #GAsyncResult.
23030 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23032 * Finishes ejecting a mount. If any errors occurred during the operation,
23033 * @error will be set to contain the errors and %FALSE will be returned.
23035 * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23041 * g_mount_get_default_location:
23042 * @mount: a #GMount.
23044 * Gets the default location of @mount. The default location of the given
23045 * @mount is a path that reflects the main entry point for the user (e.g.
23046 * the home directory, or the root of the volume).
23048 * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23053 * g_mount_get_drive:
23054 * @mount: a #GMount.
23056 * Gets the drive for the @mount.
23058 * This is a convenience method for getting the #GVolume and then
23059 * using that object to get the #GDrive.
23061 * 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.
23066 * g_mount_get_icon:
23067 * @mount: a #GMount.
23069 * Gets the icon for @mount.
23071 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23076 * g_mount_get_name:
23077 * @mount: a #GMount.
23079 * Gets the name of @mount.
23081 * Returns: the name for the given @mount. The returned string should be freed with g_free() when no longer needed.
23086 * g_mount_get_root:
23087 * @mount: a #GMount.
23089 * Gets the root directory on @mount.
23091 * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23096 * g_mount_get_sort_key:
23097 * @mount: A #GMount.
23099 * Gets the sort key for @mount, if any.
23101 * Returns: Sorting key for @mount or %NULL if no such key is available.
23107 * g_mount_get_symbolic_icon:
23108 * @mount: a #GMount.
23110 * Gets the symbolic icon for @mount.
23112 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23118 * g_mount_get_uuid:
23119 * @mount: a #GMount.
23121 * Gets the UUID for the @mount. The reference is typically based on
23122 * the file system UUID for the mount in question and should be
23123 * considered an opaque string. Returns %NULL if there is no UUID
23126 * 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.
23131 * g_mount_get_volume:
23132 * @mount: a #GMount.
23134 * Gets the volume for the @mount.
23136 * 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.
23141 * g_mount_guess_content_type:
23142 * @mount: a #GMount
23143 * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23144 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23145 * @callback: a #GAsyncReadyCallback
23146 * @user_data: user data passed to @callback
23148 * Tries to guess the type of content stored on @mount. Returns one or
23149 * more textual identifiers of well-known content types (typically
23150 * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23151 * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23152 * specification for more on x-content types.
23154 * This is an asynchronous operation (see
23155 * g_mount_guess_content_type_sync() for the synchronous version), and
23156 * is finished by calling g_mount_guess_content_type_finish() with the
23157 * @mount and #GAsyncResult data returned in the @callback.
23164 * g_mount_guess_content_type_finish:
23165 * @mount: a #GMount
23166 * @result: a #GAsyncResult
23167 * @error: a #GError location to store the error occurring, or %NULL to ignore
23169 * Finishes guessing content types of @mount. If any errors occurred
23170 * during the operation, @error will be set to contain the errors and
23171 * %FALSE will be returned. In particular, you may get an
23172 * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
23175 * 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.
23181 * g_mount_guess_content_type_sync:
23182 * @mount: a #GMount
23183 * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23184 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23185 * @error: a #GError location to store the error occurring, or %NULL to ignore
23187 * Tries to guess the type of content stored on @mount. Returns one or
23188 * more textual identifiers of well-known content types (typically
23189 * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23190 * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23191 * specification for more on x-content types.
23193 * This is an synchronous operation and as such may block doing IO;
23194 * see g_mount_guess_content_type() for the asynchronous version.
23196 * 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.
23202 * g_mount_is_shadowed:
23203 * @mount: A #GMount.
23205 * Determines if @mount is shadowed. Applications or libraries should
23206 * avoid displaying @mount in the user interface if it is shadowed.
23208 * A mount is said to be shadowed if there exists one or more user
23209 * visible objects (currently #GMount objects) with a root that is
23210 * inside the root of @mount.
23212 * One application of shadow mounts is when exposing a single file
23213 * system that is used to address several logical volumes. In this
23214 * situation, a #GVolumeMonitor implementation would create two
23215 * #GVolume objects (for example, one for the camera functionality of
23216 * the device and one for a SD card reader on the device) with
23217 * activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
23218 * and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
23219 * underlying mount (with root
23220 * <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
23221 * #GVolumeMonitor implementation would create two #GMount objects
23222 * (each with their root matching the corresponding volume activation
23223 * root) that would shadow the original mount.
23225 * The proxy monitor in GVfs 2.26 and later, automatically creates and
23226 * manage shadow mounts (and shadows the underlying mount) if the
23227 * activation root on a #GVolume is set.
23229 * Returns: %TRUE if @mount is shadowed.
23235 * g_mount_operation_get_anonymous:
23236 * @op: a #GMountOperation.
23238 * Check to see whether the mount operation is being used
23239 * for an anonymous user.
23241 * Returns: %TRUE if mount operation is anonymous.
23246 * g_mount_operation_get_choice:
23247 * @op: a #GMountOperation.
23249 * Gets a choice from the mount operation.
23251 * Returns: an integer containing an index of the user's choice from the choice's list, or %0.
23256 * g_mount_operation_get_domain:
23257 * @op: a #GMountOperation.
23259 * Gets the domain of the mount operation.
23261 * Returns: a string set to the domain.
23266 * g_mount_operation_get_password:
23267 * @op: a #GMountOperation.
23269 * Gets a password from the mount operation.
23271 * Returns: a string containing the password within @op.
23276 * g_mount_operation_get_password_save:
23277 * @op: a #GMountOperation.
23279 * Gets the state of saving passwords for the mount operation.
23281 * Returns: a #GPasswordSave flag.
23286 * g_mount_operation_get_username:
23287 * @op: a #GMountOperation.
23289 * Get the user name from the mount operation.
23291 * Returns: a string containing the user name.
23296 * g_mount_operation_new:
23298 * Creates a new mount operation.
23300 * Returns: a #GMountOperation.
23305 * g_mount_operation_reply:
23306 * @op: a #GMountOperation
23307 * @result: a #GMountOperationResult
23309 * Emits the #GMountOperation::reply signal.
23314 * g_mount_operation_set_anonymous:
23315 * @op: a #GMountOperation.
23316 * @anonymous: boolean value.
23318 * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
23323 * g_mount_operation_set_choice:
23324 * @op: a #GMountOperation.
23325 * @choice: an integer.
23327 * Sets a default choice for the mount operation.
23332 * g_mount_operation_set_domain:
23333 * @op: a #GMountOperation.
23334 * @domain: the domain to set.
23336 * Sets the mount operation's domain.
23341 * g_mount_operation_set_password:
23342 * @op: a #GMountOperation.
23343 * @password: password to set.
23345 * Sets the mount operation's password to @password.
23350 * g_mount_operation_set_password_save:
23351 * @op: a #GMountOperation.
23352 * @save: a set of #GPasswordSave flags.
23354 * Sets the state of saving passwords for the mount operation.
23359 * g_mount_operation_set_username:
23360 * @op: a #GMountOperation.
23361 * @username: input username.
23363 * Sets the user name within @op to @username.
23369 * @mount: a #GMount.
23370 * @flags: flags affecting the operation
23371 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23372 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23373 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23374 * @user_data: user data passed to @callback.
23376 * Remounts a mount. This is an asynchronous operation, and is
23377 * finished by calling g_mount_remount_finish() with the @mount
23378 * and #GAsyncResults data returned in the @callback.
23380 * Remounting is useful when some setting affecting the operation
23381 * of the volume has been changed, as these may need a remount to
23382 * take affect. While this is semantically equivalent with unmounting
23383 * and then remounting not all backends might need to actually be
23389 * g_mount_remount_finish:
23390 * @mount: a #GMount.
23391 * @result: a #GAsyncResult.
23392 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23394 * Finishes remounting a mount. If any errors occurred during the operation,
23395 * @error will be set to contain the errors and %FALSE will be returned.
23397 * Returns: %TRUE if the mount was successfully remounted. %FALSE otherwise.
23403 * @mount: A #GMount.
23405 * Increments the shadow count on @mount. Usually used by
23406 * #GVolumeMonitor implementations when creating a shadow mount for
23407 * @mount, see g_mount_is_shadowed() for more information. The caller
23408 * will need to emit the #GMount::changed signal on @mount manually.
23416 * @mount: a #GMount.
23417 * @flags: flags affecting the operation
23418 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23419 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23420 * @user_data: user data passed to @callback.
23422 * Unmounts a mount. This is an asynchronous operation, and is
23423 * finished by calling g_mount_unmount_finish() with the @mount
23424 * and #GAsyncResult data returned in the @callback.
23426 * Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
23431 * g_mount_unmount_finish:
23432 * @mount: a #GMount.
23433 * @result: a #GAsyncResult.
23434 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23436 * Finishes unmounting a mount. If any errors occurred during the operation,
23437 * @error will be set to contain the errors and %FALSE will be returned.
23439 * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23440 * Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
23445 * g_mount_unmount_with_operation:
23446 * @mount: a #GMount.
23447 * @flags: flags affecting the operation
23448 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23449 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23450 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23451 * @user_data: user data passed to @callback.
23453 * Unmounts a mount. This is an asynchronous operation, and is
23454 * finished by calling g_mount_unmount_with_operation_finish() with the @mount
23455 * and #GAsyncResult data returned in the @callback.
23462 * g_mount_unmount_with_operation_finish:
23463 * @mount: a #GMount.
23464 * @result: a #GAsyncResult.
23465 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23467 * Finishes unmounting a mount. If any errors occurred during the operation,
23468 * @error will be set to contain the errors and %FALSE will be returned.
23470 * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23476 * g_mount_unshadow:
23477 * @mount: A #GMount.
23479 * Decrements the shadow count on @mount. Usually used by
23480 * #GVolumeMonitor implementations when destroying a shadow mount for
23481 * @mount, see g_mount_is_shadowed() for more information. The caller
23482 * will need to emit the #GMount::changed signal on @mount manually.
23489 * g_network_address_get_hostname:
23490 * @addr: a #GNetworkAddress
23492 * Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
23493 * depending on what @addr was created with.
23495 * Returns: @addr's hostname
23501 * g_network_address_get_port:
23502 * @addr: a #GNetworkAddress
23504 * Gets @addr's port number
23506 * Returns: @addr's port (which may be 0)
23512 * g_network_address_get_scheme:
23513 * @addr: a #GNetworkAddress
23515 * Gets @addr's scheme
23517 * Returns: @addr's scheme (%NULL if not built from URI)
23523 * g_network_address_new:
23524 * @hostname: the hostname
23527 * Creates a new #GSocketConnectable for connecting to the given
23528 * @hostname and @port.
23530 * Returns: (transfer full) (type GNetworkAddress): the new #GNetworkAddress
23536 * g_network_address_parse:
23537 * @host_and_port: the hostname and optionally a port
23538 * @default_port: the default port if not in @host_and_port
23539 * @error: a pointer to a #GError, or %NULL
23541 * Creates a new #GSocketConnectable for connecting to the given
23542 * @hostname and @port. May fail and return %NULL in case
23543 * parsing @host_and_port fails.
23545 * @host_and_port may be in any of a number of recognised formats; an IPv6
23546 * address, an IPv4 address, or a domain name (in which case a DNS
23547 * lookup is performed). Quoting with [] is supported for all address
23548 * types. A port override may be specified in the usual way with a
23551 * If no port is specified in @host_and_port then @default_port will be
23552 * used as the port number to connect to.
23554 * In general, @host_and_port is expected to be provided by the user
23555 * (allowing them to give the hostname, and a port overide if necessary)
23556 * and @default_port is expected to be provided by the application.
23558 * (The port component of @host_and_port can also be specified as a
23559 * service name rather than as a numeric port, but this functionality
23560 * is deprecated, because it depends on the contents of /etc/services,
23561 * which is generally quite sparse on platforms other than Linux.)
23563 * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
23569 * g_network_address_parse_uri:
23570 * @uri: the hostname and optionally a port
23571 * @default_port: The default port if none is found in the URI
23572 * @error: a pointer to a #GError, or %NULL
23574 * Creates a new #GSocketConnectable for connecting to the given
23575 * @uri. May fail and return %NULL in case parsing @uri fails.
23577 * Using this rather than g_network_address_new() or
23578 * g_network_address_parse() allows #GSocketClient to determine
23579 * when to use application-specific proxy protocols.
23581 * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
23587 * g_network_monitor_base_add_network:
23588 * @monitor: the #GNetworkMonitorBase
23589 * @network: a #GInetAddressMask
23591 * Adds @network to @monitor's list of available networks.
23598 * g_network_monitor_base_remove_network:
23599 * @monitor: the #GNetworkMonitorBase
23600 * @network: a #GInetAddressMask
23602 * Removes @network from @monitor's list of available networks.
23609 * g_network_monitor_base_set_networks:
23610 * @monitor: the #GNetworkMonitorBase
23611 * @networks: (array length=length): an array of #GInetAddressMask
23612 * @length: length of @networks
23614 * Drops @monitor's current list of available networks and replaces
23615 * it with @networks.
23620 * g_network_monitor_can_reach:
23621 * @monitor: a #GNetworkMonitor
23622 * @connectable: a #GSocketConnectable
23623 * @cancellable: (allow-none): a #GCancellable, or %NULL
23624 * @error: return location for a #GError, or %NULL
23626 * Attempts to determine whether or not the host pointed to by
23627 * @connectable can be reached, without actually trying to connect to
23630 * This may return %TRUE even when #GNetworkMonitor:network-available
23631 * is %FALSE, if, for example, @monitor can determine that
23632 * @connectable refers to a host on a local network.
23634 * If @monitor believes that an attempt to connect to @connectable
23635 * will succeed, it will return %TRUE. Otherwise, it will return
23636 * %FALSE and set @error to an appropriate error (such as
23637 * %G_IO_ERROR_HOST_UNREACHABLE).
23639 * Note that although this does not attempt to connect to
23640 * @connectable, it may still block for a brief period of time (eg,
23641 * trying to do multicast DNS on the local network), so if you do not
23642 * want to block, you should use g_network_monitor_can_reach_async().
23644 * Returns: %TRUE if @connectable is reachable, %FALSE if not.
23650 * g_network_monitor_can_reach_async:
23651 * @monitor: a #GNetworkMonitor
23652 * @connectable: a #GSocketConnectable
23653 * @cancellable: (allow-none): a #GCancellable, or %NULL
23654 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
23655 * @user_data: (closure): the data to pass to callback function
23657 * Asynchronously attempts to determine whether or not the host
23658 * pointed to by @connectable can be reached, without actually
23659 * trying to connect to it.
23661 * For more details, see g_network_monitor_can_reach().
23663 * When the operation is finished, @callback will be called.
23664 * You can then call g_network_monitor_can_reach_finish()
23665 * to get the result of the operation.
23670 * g_network_monitor_can_reach_finish:
23671 * @monitor: a #GNetworkMonitor
23672 * @result: a #GAsyncResult
23673 * @error: return location for errors, or %NULL
23675 * Finishes an async network connectivity test.
23676 * See g_network_monitor_can_reach_async().
23678 * Returns: %TRUE if network is reachable, %FALSE if not.
23683 * g_network_monitor_get_default:
23685 * Gets the default #GNetworkMonitor for the system.
23687 * Returns: (transfer none): a #GNetworkMonitor
23693 * g_network_monitor_get_network_available:
23694 * @monitor: the #GNetworkMonitor
23696 * Checks if the network is available. "Available" here means that the
23697 * system has a default route available for at least one of IPv4 or
23698 * IPv6. It does not necessarily imply that the public Internet is
23699 * reachable. See #GNetworkMonitor:network-available for more details.
23701 * Returns: whether the network is available
23707 * g_network_service_get_domain:
23708 * @srv: a #GNetworkService
23710 * Gets the domain that @srv serves. This might be either UTF-8 or
23711 * ASCII-encoded, depending on what @srv was created with.
23713 * Returns: @srv's domain name
23719 * g_network_service_get_protocol:
23720 * @srv: a #GNetworkService
23722 * Gets @srv's protocol name (eg, "tcp").
23724 * Returns: @srv's protocol name
23730 * g_network_service_get_scheme:
23731 * @srv: a #GNetworkService
23733 * Get's the URI scheme used to resolve proxies. By default, the service name
23734 * is used as scheme.
23736 * Returns: @srv's scheme name
23742 * g_network_service_get_service:
23743 * @srv: a #GNetworkService
23745 * Gets @srv's service name (eg, "ldap").
23747 * Returns: @srv's service name
23753 * g_network_service_new:
23754 * @service: the service type to look up (eg, "ldap")
23755 * @protocol: the networking protocol to use for @service (eg, "tcp")
23756 * @domain: the DNS domain to look up the service in
23758 * Creates a new #GNetworkService representing the given @service,
23759 * @protocol, and @domain. This will initially be unresolved; use the
23760 * #GSocketConnectable interface to resolve it.
23762 * Returns: (transfer full) (type GNetworkService): a new #GNetworkService
23768 * g_network_service_set_scheme:
23769 * @srv: a #GNetworkService
23770 * @scheme: a URI scheme
23772 * Set's the URI scheme used to resolve proxies. By default, the service name
23773 * is used as scheme.
23780 * g_networking_init:
23782 * Initializes the platform networking libraries (eg, on Windows, this
23783 * calls WSAStartup()). GLib will call this itself if it is needed, so
23784 * you only need to call it if you directly call system networking
23785 * functions (without calling any GLib networking functions first).
23792 * g_null_settings_backend_new:
23794 * Creates a readonly #GSettingsBackend.
23796 * This backend does not allow changes to settings, so all settings
23797 * will always have their default values.
23799 * Returns: (transfer full): a newly created #GSettingsBackend
23805 * g_output_stream_clear_pending:
23806 * @stream: output stream
23808 * Clears the pending flag on @stream.
23813 * g_output_stream_close:
23814 * @stream: A #GOutputStream.
23815 * @cancellable: (allow-none): optional cancellable object
23816 * @error: location to store the error occurring, or %NULL to ignore
23818 * Closes the stream, releasing resources related to it.
23820 * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
23821 * Closing a stream multiple times will not return an error.
23823 * Closing a stream will automatically flush any outstanding buffers in the
23826 * Streams will be automatically closed when the last reference
23827 * is dropped, but you might want to call this function to make sure
23828 * resources are released as early as possible.
23830 * Some streams might keep the backing store of the stream (e.g. a file descriptor)
23831 * open after the stream is closed. See the documentation for the individual
23832 * stream for details.
23834 * On failure the first error that happened will be reported, but the close
23835 * operation will finish as much as possible. A stream that failed to
23836 * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
23837 * is important to check and report the error to the user, otherwise
23838 * there might be a loss of data as all data might not be written.
23840 * If @cancellable is not %NULL, then the operation can be cancelled by
23841 * triggering the cancellable object from another thread. If the operation
23842 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
23843 * Cancelling a close will still leave the stream closed, but there some streams
23844 * can use a faster close that doesn't block to e.g. check errors. On
23845 * cancellation (as with any error) there is no guarantee that all written
23846 * data will reach the target.
23848 * Returns: %TRUE on success, %FALSE on failure
23853 * g_output_stream_close_async:
23854 * @stream: A #GOutputStream.
23855 * @io_priority: the io priority of the request.
23856 * @cancellable: (allow-none): optional cancellable object
23857 * @callback: (scope async): callback to call when the request is satisfied
23858 * @user_data: (closure): the data to pass to callback function
23860 * Requests an asynchronous close of the stream, releasing resources
23861 * related to it. When the operation is finished @callback will be
23862 * called. You can then call g_output_stream_close_finish() to get
23863 * the result of the operation.
23865 * For behaviour details see g_output_stream_close().
23867 * The asyncronous methods have a default fallback that uses threads
23868 * to implement asynchronicity, so they are optional for inheriting
23869 * classes. However, if you override one you must override all.
23874 * g_output_stream_close_finish:
23875 * @stream: a #GOutputStream.
23876 * @result: a #GAsyncResult.
23877 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23879 * Closes an output stream.
23881 * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
23886 * g_output_stream_flush:
23887 * @stream: a #GOutputStream.
23888 * @cancellable: (allow-none): optional cancellable object
23889 * @error: location to store the error occurring, or %NULL to ignore
23891 * Forces a write of all user-space buffered data for the given
23892 * @stream. Will block during the operation. Closing the stream will
23893 * implicitly cause a flush.
23895 * This function is optional for inherited classes.
23897 * If @cancellable is not %NULL, then the operation can be cancelled by
23898 * triggering the cancellable object from another thread. If the operation
23899 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
23901 * Returns: %TRUE on success, %FALSE on error
23906 * g_output_stream_flush_async:
23907 * @stream: a #GOutputStream.
23908 * @io_priority: the io priority of the request.
23909 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23910 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
23911 * @user_data: (closure): the data to pass to callback function
23913 * Forces an asynchronous write of all user-space buffered data for
23914 * the given @stream.
23915 * For behaviour details see g_output_stream_flush().
23917 * When the operation is finished @callback will be
23918 * called. You can then call g_output_stream_flush_finish() to get the
23919 * result of the operation.
23924 * g_output_stream_flush_finish:
23925 * @stream: a #GOutputStream.
23926 * @result: a GAsyncResult.
23927 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23929 * Finishes flushing an output stream.
23931 * Returns: %TRUE if flush operation succeeded, %FALSE otherwise.
23936 * g_output_stream_has_pending:
23937 * @stream: a #GOutputStream.
23939 * Checks if an ouput stream has pending actions.
23941 * Returns: %TRUE if @stream has pending actions.
23946 * g_output_stream_is_closed:
23947 * @stream: a #GOutputStream.
23949 * Checks if an output stream has already been closed.
23951 * Returns: %TRUE if @stream is closed. %FALSE otherwise.
23956 * g_output_stream_is_closing:
23957 * @stream: a #GOutputStream.
23959 * Checks if an output stream is being closed. This can be
23960 * used inside e.g. a flush implementation to see if the
23961 * flush (or other i/o operation) is called from within
23962 * the closing operation.
23964 * Returns: %TRUE if @stream is being closed. %FALSE otherwise.
23970 * g_output_stream_set_pending:
23971 * @stream: a #GOutputStream.
23972 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23974 * Sets @stream to have actions pending. If the pending flag is
23975 * already set or @stream is closed, it will return %FALSE and set
23978 * Returns: %TRUE if pending was previously unset and is now set.
23983 * g_output_stream_splice:
23984 * @stream: a #GOutputStream.
23985 * @source: a #GInputStream.
23986 * @flags: a set of #GOutputStreamSpliceFlags.
23987 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23988 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23990 * Splices an input stream into an output stream.
23992 * 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.
23997 * g_output_stream_splice_async:
23998 * @stream: a #GOutputStream.
23999 * @source: a #GInputStream.
24000 * @flags: a set of #GOutputStreamSpliceFlags.
24001 * @io_priority: the io priority of the request.
24002 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24003 * @callback: (scope async): a #GAsyncReadyCallback.
24004 * @user_data: (closure): user data passed to @callback.
24006 * Splices a stream asynchronously.
24007 * When the operation is finished @callback will be called.
24008 * You can then call g_output_stream_splice_finish() to get the
24009 * result of the operation.
24011 * For the synchronous, blocking version of this function, see
24012 * g_output_stream_splice().
24017 * g_output_stream_splice_finish:
24018 * @stream: a #GOutputStream.
24019 * @result: a #GAsyncResult.
24020 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24022 * Finishes an asynchronous stream splice operation.
24024 * 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.
24029 * g_output_stream_write:
24030 * @stream: a #GOutputStream.
24031 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24032 * @count: the number of bytes to write
24033 * @cancellable: (allow-none): optional cancellable object
24034 * @error: location to store the error occurring, or %NULL to ignore
24036 * Tries to write @count bytes from @buffer into the stream. Will block
24037 * during the operation.
24039 * If count is 0, returns 0 and does nothing. A value of @count
24040 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24042 * On success, the number of bytes written to the stream is returned.
24043 * It is not an error if this is not the same as the requested size, as it
24044 * can happen e.g. on a partial I/O error, or if there is not enough
24045 * storage in the stream. All writes block until at least one byte
24046 * is written or an error occurs; 0 is never returned (unless
24049 * If @cancellable is not %NULL, then the operation can be cancelled by
24050 * triggering the cancellable object from another thread. If the operation
24051 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24052 * operation was partially finished when the operation was cancelled the
24053 * partial result will be returned, without an error.
24055 * On error -1 is returned and @error is set accordingly.
24057 * Virtual: write_fn
24058 * Returns: Number of bytes written, or -1 on error
24063 * g_output_stream_write_all:
24064 * @stream: a #GOutputStream.
24065 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24066 * @count: the number of bytes to write
24067 * @bytes_written: (out): location to store the number of bytes that was written to the stream
24068 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24069 * @error: location to store the error occurring, or %NULL to ignore
24071 * Tries to write @count bytes from @buffer into the stream. Will block
24072 * during the operation.
24074 * This function is similar to g_output_stream_write(), except it tries to
24075 * write as many bytes as requested, only stopping on an error.
24077 * On a successful write of @count bytes, %TRUE is returned, and @bytes_written
24078 * is set to @count.
24080 * If there is an error during the operation %FALSE is returned and @error
24081 * is set to indicate the error status, @bytes_written is updated to contain
24082 * the number of bytes written into the stream before the error occurred.
24084 * Returns: %TRUE on success, %FALSE if there was an error
24089 * g_output_stream_write_async:
24090 * @stream: A #GOutputStream.
24091 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24092 * @count: the number of bytes to write
24093 * @io_priority: the io priority of the request.
24094 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24095 * @callback: (scope async): callback to call when the request is satisfied
24096 * @user_data: (closure): the data to pass to callback function
24098 * Request an asynchronous write of @count bytes from @buffer into
24099 * the stream. When the operation is finished @callback will be called.
24100 * You can then call g_output_stream_write_finish() to get the result of the
24103 * During an async request no other sync and async calls are allowed,
24104 * and will result in %G_IO_ERROR_PENDING errors.
24106 * A value of @count larger than %G_MAXSSIZE will cause a
24107 * %G_IO_ERROR_INVALID_ARGUMENT error.
24109 * On success, the number of bytes written will be passed to the
24110 * @callback. It is not an error if this is not the same as the
24111 * requested size, as it can happen e.g. on a partial I/O error,
24112 * but generally we try to write as many bytes as requested.
24114 * You are guaranteed that this method will never fail with
24115 * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24116 * method will just wait until this changes.
24118 * Any outstanding I/O request with higher priority (lower numerical
24119 * value) will be executed before an outstanding request with lower
24120 * priority. Default priority is %G_PRIORITY_DEFAULT.
24122 * The asyncronous methods have a default fallback that uses threads
24123 * to implement asynchronicity, so they are optional for inheriting
24124 * classes. However, if you override one you must override all.
24126 * For the synchronous, blocking version of this function, see
24127 * g_output_stream_write().
24132 * g_output_stream_write_bytes:
24133 * @stream: a #GOutputStream.
24134 * @bytes: the #GBytes to write
24135 * @cancellable: (allow-none): optional cancellable object
24136 * @error: location to store the error occurring, or %NULL to ignore
24138 * Tries to write the data from @bytes into the stream. Will block
24139 * during the operation.
24141 * If @bytes is 0-length, returns 0 and does nothing. A #GBytes larger
24142 * than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24144 * On success, the number of bytes written to the stream is returned.
24145 * It is not an error if this is not the same as the requested size, as it
24146 * can happen e.g. on a partial I/O error, or if there is not enough
24147 * storage in the stream. All writes block until at least one byte
24148 * is written or an error occurs; 0 is never returned (unless
24149 * the size of @bytes is 0).
24151 * If @cancellable is not %NULL, then the operation can be cancelled by
24152 * triggering the cancellable object from another thread. If the operation
24153 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24154 * operation was partially finished when the operation was cancelled the
24155 * partial result will be returned, without an error.
24157 * On error -1 is returned and @error is set accordingly.
24159 * Returns: Number of bytes written, or -1 on error
24164 * g_output_stream_write_bytes_async:
24165 * @stream: A #GOutputStream.
24166 * @bytes: The bytes to write
24167 * @io_priority: the io priority of the request.
24168 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24169 * @callback: (scope async): callback to call when the request is satisfied
24170 * @user_data: (closure): the data to pass to callback function
24172 * Request an asynchronous write of the data in @bytes to the stream.
24173 * When the operation is finished @callback will be called. You can
24174 * then call g_output_stream_write_bytes_finish() to get the result of
24177 * During an async request no other sync and async calls are allowed,
24178 * and will result in %G_IO_ERROR_PENDING errors.
24180 * A #GBytes larger than %G_MAXSSIZE will cause a
24181 * %G_IO_ERROR_INVALID_ARGUMENT error.
24183 * On success, the number of bytes written will be passed to the
24184 * @callback. It is not an error if this is not the same as the
24185 * requested size, as it can happen e.g. on a partial I/O error,
24186 * but generally we try to write as many bytes as requested.
24188 * You are guaranteed that this method will never fail with
24189 * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24190 * method will just wait until this changes.
24192 * Any outstanding I/O request with higher priority (lower numerical
24193 * value) will be executed before an outstanding request with lower
24194 * priority. Default priority is %G_PRIORITY_DEFAULT.
24196 * For the synchronous, blocking version of this function, see
24197 * g_output_stream_write_bytes().
24202 * g_output_stream_write_bytes_finish:
24203 * @stream: a #GOutputStream.
24204 * @result: a #GAsyncResult.
24205 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24207 * Finishes a stream write-from-#GBytes operation.
24209 * Returns: a #gssize containing the number of bytes written to the stream.
24214 * g_output_stream_write_finish:
24215 * @stream: a #GOutputStream.
24216 * @result: a #GAsyncResult.
24217 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24219 * Finishes a stream write operation.
24221 * Returns: a #gssize containing the number of bytes written to the stream.
24226 * g_permission_acquire:
24227 * @permission: a #GPermission instance
24228 * @cancellable: (allow-none): a #GCancellable, or %NULL
24229 * @error: a pointer to a %NULL #GError, or %NULL
24231 * Attempts to acquire the permission represented by @permission.
24233 * The precise method by which this happens depends on the permission
24234 * and the underlying authentication mechanism. A simple example is
24235 * that a dialog may appear asking the user to enter their password.
24237 * You should check with g_permission_get_can_acquire() before calling
24240 * If the permission is acquired then %TRUE is returned. Otherwise,
24241 * %FALSE is returned and @error is set appropriately.
24243 * This call is blocking, likely for a very long time (in the case that
24244 * user interaction is required). See g_permission_acquire_async() for
24245 * the non-blocking version.
24247 * Returns: %TRUE if the permission was successfully acquired
24253 * g_permission_acquire_async:
24254 * @permission: a #GPermission instance
24255 * @cancellable: (allow-none): a #GCancellable, or %NULL
24256 * @callback: the #GAsyncReadyCallback to call when done
24257 * @user_data: the user data to pass to @callback
24259 * Attempts to acquire the permission represented by @permission.
24261 * This is the first half of the asynchronous version of
24262 * g_permission_acquire().
24269 * g_permission_acquire_finish:
24270 * @permission: a #GPermission instance
24271 * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24272 * @error: a pointer to a %NULL #GError, or %NULL
24274 * Collects the result of attempting to acquire the permission
24275 * represented by @permission.
24277 * This is the second half of the asynchronous version of
24278 * g_permission_acquire().
24280 * Returns: %TRUE if the permission was successfully acquired
24286 * g_permission_get_allowed:
24287 * @permission: a #GPermission instance
24289 * Gets the value of the 'allowed' property. This property is %TRUE if
24290 * the caller currently has permission to perform the action that
24291 * @permission represents the permission to perform.
24293 * Returns: the value of the 'allowed' property
24299 * g_permission_get_can_acquire:
24300 * @permission: a #GPermission instance
24302 * Gets the value of the 'can-acquire' property. This property is %TRUE
24303 * if it is generally possible to acquire the permission by calling
24304 * g_permission_acquire().
24306 * Returns: the value of the 'can-acquire' property
24312 * g_permission_get_can_release:
24313 * @permission: a #GPermission instance
24315 * Gets the value of the 'can-release' property. This property is %TRUE
24316 * if it is generally possible to release the permission by calling
24317 * g_permission_release().
24319 * Returns: the value of the 'can-release' property
24325 * g_permission_impl_update:
24326 * @permission: a #GPermission instance
24327 * @allowed: the new value for the 'allowed' property
24328 * @can_acquire: the new value for the 'can-acquire' property
24329 * @can_release: the new value for the 'can-release' property
24331 * This function is called by the #GPermission implementation to update
24332 * the properties of the permission. You should never call this
24333 * function except from a #GPermission implementation.
24335 * GObject notify signals are generated, as appropriate.
24342 * g_permission_release:
24343 * @permission: a #GPermission instance
24344 * @cancellable: (allow-none): a #GCancellable, or %NULL
24345 * @error: a pointer to a %NULL #GError, or %NULL
24347 * Attempts to release the permission represented by @permission.
24349 * The precise method by which this happens depends on the permission
24350 * and the underlying authentication mechanism. In most cases the
24351 * permission will be dropped immediately without further action.
24353 * You should check with g_permission_get_can_release() before calling
24356 * If the permission is released then %TRUE is returned. Otherwise,
24357 * %FALSE is returned and @error is set appropriately.
24359 * This call is blocking, likely for a very long time (in the case that
24360 * user interaction is required). See g_permission_release_async() for
24361 * the non-blocking version.
24363 * Returns: %TRUE if the permission was successfully released
24369 * g_permission_release_async:
24370 * @permission: a #GPermission instance
24371 * @cancellable: (allow-none): a #GCancellable, or %NULL
24372 * @callback: the #GAsyncReadyCallback to call when done
24373 * @user_data: the user data to pass to @callback
24375 * Attempts to release the permission represented by @permission.
24377 * This is the first half of the asynchronous version of
24378 * g_permission_release().
24385 * g_permission_release_finish:
24386 * @permission: a #GPermission instance
24387 * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24388 * @error: a pointer to a %NULL #GError, or %NULL
24390 * Collects the result of attempting to release the permission
24391 * represented by @permission.
24393 * This is the second half of the asynchronous version of
24394 * g_permission_release().
24396 * Returns: %TRUE if the permission was successfully released
24402 * g_poll_file_monitor_new:
24405 * Polls @file for changes.
24407 * Returns: a new #GFileMonitor for the given #GFile.
24412 * g_pollable_input_stream_can_poll:
24413 * @stream: a #GPollableInputStream.
24415 * Checks if @stream is actually pollable. Some classes may implement
24416 * #GPollableInputStream but have only certain instances of that class
24417 * be pollable. If this method returns %FALSE, then the behavior of
24418 * other #GPollableInputStream methods is undefined.
24420 * For any given stream, the value returned by this method is constant;
24421 * a stream cannot switch from pollable to non-pollable or vice versa.
24423 * Returns: %TRUE if @stream is pollable, %FALSE if not.
24429 * g_pollable_input_stream_create_source:
24430 * @stream: a #GPollableInputStream.
24431 * @cancellable: (allow-none): a #GCancellable, or %NULL
24433 * Creates a #GSource that triggers when @stream can be read, or
24434 * @cancellable is triggered or an error occurs. The callback on the
24435 * source is of the #GPollableSourceFunc type.
24437 * As with g_pollable_input_stream_is_readable(), it is possible that
24438 * the stream may not actually be readable even after the source
24439 * triggers, so you should use g_pollable_input_stream_read_nonblocking()
24440 * rather than g_input_stream_read() from the callback.
24442 * Returns: (transfer full): a new #GSource
24448 * g_pollable_input_stream_is_readable:
24449 * @stream: a #GPollableInputStream.
24451 * Checks if @stream can be read.
24453 * Note that some stream types may not be able to implement this 100%
24454 * reliably, and it is possible that a call to g_input_stream_read()
24455 * after this returns %TRUE would still block. To guarantee
24456 * non-blocking behavior, you should always use
24457 * g_pollable_input_stream_read_nonblocking(), which will return a
24458 * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
24460 * 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.
24466 * g_pollable_input_stream_read_nonblocking:
24467 * @stream: a #GPollableInputStream
24468 * @buffer: a buffer to read data into (which should be at least @count bytes long).
24469 * @count: the number of bytes you want to read
24470 * @cancellable: (allow-none): a #GCancellable, or %NULL
24471 * @error: #GError for error reporting, or %NULL to ignore.
24473 * Attempts to read up to @count bytes from @stream into @buffer, as
24474 * with g_input_stream_read(). If @stream is not currently readable,
24475 * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
24476 * use g_pollable_input_stream_create_source() to create a #GSource
24477 * that will be triggered when @stream is readable.
24479 * Note that since this method never blocks, you cannot actually
24480 * use @cancellable to cancel it. However, it will return an error
24481 * if @cancellable has already been cancelled when you call, which
24482 * may happen if you call this method after a source triggers due
24483 * to having been cancelled.
24485 * Virtual: read_nonblocking
24486 * Returns: the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
24491 * g_pollable_output_stream_can_poll:
24492 * @stream: a #GPollableOutputStream.
24494 * Checks if @stream is actually pollable. Some classes may implement
24495 * #GPollableOutputStream but have only certain instances of that
24496 * class be pollable. If this method returns %FALSE, then the behavior
24497 * of other #GPollableOutputStream methods is undefined.
24499 * For any given stream, the value returned by this method is constant;
24500 * a stream cannot switch from pollable to non-pollable or vice versa.
24502 * Returns: %TRUE if @stream is pollable, %FALSE if not.
24508 * g_pollable_output_stream_create_source:
24509 * @stream: a #GPollableOutputStream.
24510 * @cancellable: (allow-none): a #GCancellable, or %NULL
24512 * Creates a #GSource that triggers when @stream can be written, or
24513 * @cancellable is triggered or an error occurs. The callback on the
24514 * source is of the #GPollableSourceFunc type.
24516 * As with g_pollable_output_stream_is_writable(), it is possible that
24517 * the stream may not actually be writable even after the source
24518 * triggers, so you should use g_pollable_output_stream_write_nonblocking()
24519 * rather than g_output_stream_write() from the callback.
24521 * Returns: (transfer full): a new #GSource
24527 * g_pollable_output_stream_is_writable:
24528 * @stream: a #GPollableOutputStream.
24530 * Checks if @stream can be written.
24532 * Note that some stream types may not be able to implement this 100%
24533 * reliably, and it is possible that a call to g_output_stream_write()
24534 * after this returns %TRUE would still block. To guarantee
24535 * non-blocking behavior, you should always use
24536 * g_pollable_output_stream_write_nonblocking(), which will return a
24537 * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
24539 * 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.
24545 * g_pollable_output_stream_write_nonblocking:
24546 * @stream: a #GPollableOutputStream
24547 * @buffer: (array length=count) (element-type guint8): a buffer to write data from
24548 * @count: the number of bytes you want to write
24549 * @cancellable: (allow-none): a #GCancellable, or %NULL
24550 * @error: #GError for error reporting, or %NULL to ignore.
24552 * Attempts to write up to @count bytes from @buffer to @stream, as
24553 * with g_output_stream_write(). If @stream is not currently writable,
24554 * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
24555 * use g_pollable_output_stream_create_source() to create a #GSource
24556 * that will be triggered when @stream is writable.
24558 * Note that since this method never blocks, you cannot actually
24559 * use @cancellable to cancel it. However, it will return an error
24560 * if @cancellable has already been cancelled when you call, which
24561 * may happen if you call this method after a source triggers due
24562 * to having been cancelled.
24564 * Virtual: write_nonblocking
24565 * Returns: the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
24570 * g_pollable_source_new:
24571 * @pollable_stream: the stream associated with the new source
24573 * Utility method for #GPollableInputStream and #GPollableOutputStream
24574 * implementations. Creates a new #GSource that expects a callback of
24575 * type #GPollableSourceFunc. The new source does not actually do
24576 * anything on its own; use g_source_add_child_source() to add other
24577 * sources to it to cause it to trigger.
24579 * Returns: (transfer full): the new #GSource.
24585 * g_pollable_source_new_full:
24586 * @pollable_stream: (type GObject): the stream associated with the new source
24587 * @child_source: (allow-none): optional child source to attach
24588 * @cancellable: (allow-none): optional #GCancellable to attach
24590 * Utility method for #GPollableInputStream and #GPollableOutputStream
24591 * implementations. Creates a new #GSource, as with
24592 * g_pollable_source_new(), but also attaching @child_source (with a
24593 * dummy callback), and @cancellable, if they are non-%NULL.
24595 * Returns: (transfer full): the new #GSource.
24601 * g_pollable_stream_read:
24602 * @stream: a #GInputStream
24603 * @buffer: a buffer to read data into
24604 * @count: the number of bytes to read
24605 * @blocking: whether to do blocking I/O
24606 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24607 * @error: location to store the error occurring, or %NULL to ignore
24609 * Tries to read from @stream, as with g_input_stream_read() (if
24610 * @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
24611 * (if @blocking is %FALSE). This can be used to more easily share
24612 * code between blocking and non-blocking implementations of a method.
24614 * If @blocking is %FALSE, then @stream must be a
24615 * #GPollableInputStream for which g_pollable_input_stream_can_poll()
24616 * returns %TRUE, or else the behavior is undefined. If @blocking is
24617 * %TRUE, then @stream does not need to be a #GPollableInputStream.
24619 * Returns: the number of bytes read, or -1 on error.
24625 * g_pollable_stream_write:
24626 * @stream: a #GOutputStream.
24627 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24628 * @count: the number of bytes to write
24629 * @blocking: whether to do blocking I/O
24630 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24631 * @error: location to store the error occurring, or %NULL to ignore
24633 * Tries to write to @stream, as with g_output_stream_write() (if
24634 * @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
24635 * (if @blocking is %FALSE). This can be used to more easily share
24636 * code between blocking and non-blocking implementations of a method.
24638 * If @blocking is %FALSE, then @stream must be a
24639 * #GPollableOutputStream for which
24640 * g_pollable_output_stream_can_poll() returns %TRUE or else the
24641 * behavior is undefined. If @blocking is %TRUE, then @stream does not
24642 * need to be a #GPollableOutputStream.
24644 * Returns: the number of bytes written, or -1 on error.
24650 * g_pollable_stream_write_all:
24651 * @stream: a #GOutputStream.
24652 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24653 * @count: the number of bytes to write
24654 * @blocking: whether to do blocking I/O
24655 * @bytes_written: (out): location to store the number of bytes that was written to the stream
24656 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24657 * @error: location to store the error occurring, or %NULL to ignore
24659 * Tries to write @count bytes to @stream, as with
24660 * g_output_stream_write_all(), but using g_pollable_stream_write()
24661 * rather than g_output_stream_write().
24663 * On a successful write of @count bytes, %TRUE is returned, and
24664 * @bytes_written is set to @count.
24666 * If there is an error during the operation (including
24667 * %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is
24668 * returned and @error is set to indicate the error status,
24669 * @bytes_written is updated to contain the number of bytes written
24670 * into the stream before the error occurred.
24672 * As with g_pollable_stream_write(), if @blocking is %FALSE, then
24673 * @stream must be a #GPollableOutputStream for which
24674 * g_pollable_output_stream_can_poll() returns %TRUE or else the
24675 * behavior is undefined. If @blocking is %TRUE, then @stream does not
24676 * need to be a #GPollableOutputStream.
24678 * Returns: %TRUE on success, %FALSE if there was an error
24684 * g_proxy_address_get_destination_hostname:
24685 * @proxy: a #GProxyAddress
24687 * Gets @proxy's destination hostname; that is, the name of the host
24688 * that will be connected to via the proxy, not the name of the proxy
24691 * Returns: the @proxy's destination hostname
24697 * g_proxy_address_get_destination_port:
24698 * @proxy: a #GProxyAddress
24700 * Gets @proxy's destination port; that is, the port on the
24701 * destination host that will be connected to via the proxy, not the
24702 * port number of the proxy itself.
24704 * Returns: the @proxy's destination port
24710 * g_proxy_address_get_destination_protocol:
24711 * @proxy: a #GProxyAddress
24713 * Gets the protocol that is being spoken to the destination
24714 * server; eg, "http" or "ftp".
24716 * Returns: the @proxy's destination protocol
24722 * g_proxy_address_get_password:
24723 * @proxy: a #GProxyAddress
24725 * Gets @proxy's password.
24727 * Returns: the @proxy's password
24733 * g_proxy_address_get_protocol:
24734 * @proxy: a #GProxyAddress
24736 * Gets @proxy's protocol. eg, "socks" or "http"
24738 * Returns: the @proxy's protocol
24744 * g_proxy_address_get_uri:
24745 * @proxy: a #GProxyAddress
24747 * Gets the proxy URI that @proxy was constructed from.
24749 * Returns: the @proxy's URI, or %NULL if unknown
24755 * g_proxy_address_get_username:
24756 * @proxy: a #GProxyAddress
24758 * Gets @proxy's username.
24760 * Returns: the @proxy's username
24766 * g_proxy_address_new:
24767 * @inetaddr: The proxy server #GInetAddress.
24768 * @port: The proxy server port.
24769 * @protocol: The proxy protocol to support, in lower case (e.g. socks, http).
24770 * @dest_hostname: The destination hostname the proxy should tunnel to.
24771 * @dest_port: The destination port to tunnel to.
24772 * @username: (allow-none): The username to authenticate to the proxy server (or %NULL).
24773 * @password: (allow-none): The password to authenticate to the proxy server (or %NULL).
24775 * Creates a new #GProxyAddress for @inetaddr with @protocol that should
24776 * tunnel through @dest_hostname and @dest_port.
24778 * (Note that this method doesn't set the #GProxyAddress:uri or
24779 * #GProxyAddress:destination-protocol fields; use g_object_new()
24780 * directly if you want to set those.)
24782 * Returns: a new #GProxyAddress
24789 * @proxy: a #GProxy
24790 * @connection: a #GIOStream
24791 * @proxy_address: a #GProxyAddress
24792 * @cancellable: (allow-none): a #GCancellable
24793 * @error: return #GError
24795 * Given @connection to communicate with a proxy (eg, a
24796 * #GSocketConnection that is connected to the proxy server), this
24797 * does the necessary handshake to connect to @proxy_address, and if
24798 * required, wraps the #GIOStream to handle proxy payload.
24800 * Returns: (transfer full): a #GIOStream that will replace @connection. This might be the same as @connection, in which case a reference will be added.
24806 * g_proxy_connect_async:
24807 * @proxy: a #GProxy
24808 * @connection: a #GIOStream
24809 * @proxy_address: a #GProxyAddress
24810 * @cancellable: (allow-none): a #GCancellable
24811 * @callback: (scope async): a #GAsyncReadyCallback
24812 * @user_data: (closure): callback data
24814 * Asynchronous version of g_proxy_connect().
24821 * g_proxy_connect_finish:
24822 * @proxy: a #GProxy
24823 * @result: a #GAsyncResult
24824 * @error: return #GError
24826 * See g_proxy_connect().
24828 * Returns: (transfer full): a #GIOStream.
24834 * g_proxy_get_default_for_protocol:
24835 * @protocol: the proxy protocol name (e.g. http, socks, etc)
24837 * Lookup "gio-proxy" extension point for a proxy implementation that supports
24838 * specified protocol.
24840 * Returns: (transfer full): return a #GProxy or NULL if protocol is not supported.
24846 * g_proxy_resolver_get_default:
24848 * Gets the default #GProxyResolver for the system.
24850 * Returns: (transfer none): the default #GProxyResolver.
24856 * g_proxy_resolver_is_supported:
24857 * @resolver: a #GProxyResolver
24859 * Checks if @resolver can be used on this system. (This is used
24860 * internally; g_proxy_resolver_get_default() will only return a proxy
24861 * resolver that returns %TRUE for this method.)
24863 * Returns: %TRUE if @resolver is supported.
24869 * g_proxy_resolver_lookup:
24870 * @resolver: a #GProxyResolver
24871 * @uri: a URI representing the destination to connect to
24872 * @cancellable: (allow-none): a #GCancellable, or %NULL
24873 * @error: return location for a #GError, or %NULL
24875 * Looks into the system proxy configuration to determine what proxy,
24876 * if any, to use to connect to @uri. The returned proxy URIs are of the
24877 * form <literal><protocol>://[user[:password]@]host:port</literal>
24878 * or <literal>direct://</literal>, where <protocol> could be
24879 * http, rtsp, socks or other proxying protocol.
24881 * If you don't know what network protocol is being used on the
24882 * socket, you should use <literal>none</literal> as the URI protocol.
24883 * In this case, the resolver might still return a generic proxy type
24884 * (such as SOCKS), but would not return protocol-specific proxy types
24887 * <literal>direct://</literal> is used when no proxy is needed.
24888 * Direct connection should not be attempted unless it is part of the
24889 * returned array of proxies.
24891 * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
24897 * g_proxy_resolver_lookup_async:
24898 * @resolver: a #GProxyResolver
24899 * @uri: a URI representing the destination to connect to
24900 * @cancellable: (allow-none): a #GCancellable, or %NULL
24901 * @callback: (scope async): callback to call after resolution completes
24902 * @user_data: (closure): data for @callback
24904 * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
24912 * g_proxy_resolver_lookup_finish:
24913 * @resolver: a #GProxyResolver
24914 * @result: the result passed to your #GAsyncReadyCallback
24915 * @error: return location for a #GError, or %NULL
24917 * Call this function to obtain the array of proxy URIs when
24918 * g_proxy_resolver_lookup_async() is complete. See
24919 * g_proxy_resolver_lookup() for more details.
24921 * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
24927 * g_proxy_supports_hostname:
24928 * @proxy: a #GProxy
24930 * Some proxy protocols expect to be passed a hostname, which they
24931 * will resolve to an IP address themselves. Others, like SOCKS4, do
24932 * not allow this. This function will return %FALSE if @proxy is
24933 * implementing such a protocol. When %FALSE is returned, the caller
24934 * should resolve the destination hostname first, and then pass a
24935 * #GProxyAddress containing the stringified IP address to
24936 * g_proxy_connect() or g_proxy_connect_async().
24938 * Returns: %TRUE if hostname resolution is supported.
24944 * g_remote_action_group_activate_action_full:
24945 * @remote: a #GDBusActionGroup
24946 * @action_name: the name of the action to activate
24947 * @parameter: (allow-none): the optional parameter to the activation
24948 * @platform_data: the platform data to send
24950 * Activates the remote action.
24952 * This is the same as g_action_group_activate_action() except that it
24953 * allows for provision of "platform data" to be sent along with the
24954 * activation request. This typically contains details such as the user
24955 * interaction timestamp or startup notification information.
24957 * @platform_data must be non-%NULL and must have the type
24958 * %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
24965 * g_remote_action_group_change_action_state_full:
24966 * @remote: a #GRemoteActionGroup
24967 * @action_name: the name of the action to change the state of
24968 * @value: the new requested value for the state
24969 * @platform_data: the platform data to send
24971 * Changes the state of a remote action.
24973 * This is the same as g_action_group_change_action_state() except that
24974 * it allows for provision of "platform data" to be sent along with the
24975 * state change request. This typically contains details such as the
24976 * user interaction timestamp or startup notification information.
24978 * @platform_data must be non-%NULL and must have the type
24979 * %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
24986 * g_resolver_error_quark:
24988 * Gets the #GResolver Error Quark.
24990 * Returns: a #GQuark.
24996 * g_resolver_free_addresses: (skip)
24997 * @addresses: a #GList of #GInetAddress
24999 * Frees @addresses (which should be the return value from
25000 * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
25001 * (This is a convenience method; you can also simply free the results
25009 * g_resolver_free_targets: (skip)
25010 * @targets: a #GList of #GSrvTarget
25012 * Frees @targets (which should be the return value from
25013 * g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
25014 * (This is a convenience method; you can also simply free the
25015 * results by hand.)
25022 * g_resolver_get_default:
25024 * Gets the default #GResolver. You should unref it when you are done
25025 * with it. #GResolver may use its reference count as a hint about how
25026 * many threads it should allocate for concurrent DNS resolutions.
25028 * Returns: (transfer full): the default #GResolver.
25034 * g_resolver_lookup_by_address:
25035 * @resolver: a #GResolver
25036 * @address: the address to reverse-resolve
25037 * @cancellable: (allow-none): a #GCancellable, or %NULL
25038 * @error: return location for a #GError, or %NULL
25040 * Synchronously reverse-resolves @address to determine its
25041 * associated hostname.
25043 * If the DNS resolution fails, @error (if non-%NULL) will be set to
25044 * a value from #GResolverError.
25046 * If @cancellable is non-%NULL, it can be used to cancel the
25047 * operation, in which case @error (if non-%NULL) will be set to
25048 * %G_IO_ERROR_CANCELLED.
25050 * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25056 * g_resolver_lookup_by_address_async:
25057 * @resolver: a #GResolver
25058 * @address: the address to reverse-resolve
25059 * @cancellable: (allow-none): a #GCancellable, or %NULL
25060 * @callback: (scope async): callback to call after resolution completes
25061 * @user_data: (closure): data for @callback
25063 * Begins asynchronously reverse-resolving @address to determine its
25064 * associated hostname, and eventually calls @callback, which must
25065 * call g_resolver_lookup_by_address_finish() to get the final result.
25072 * g_resolver_lookup_by_address_finish:
25073 * @resolver: a #GResolver
25074 * @result: the result passed to your #GAsyncReadyCallback
25075 * @error: return location for a #GError, or %NULL
25077 * Retrieves the result of a previous call to
25078 * g_resolver_lookup_by_address_async().
25080 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25081 * a value from #GResolverError. If the operation was cancelled,
25082 * @error will be set to %G_IO_ERROR_CANCELLED.
25084 * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25090 * g_resolver_lookup_by_name:
25091 * @resolver: a #GResolver
25092 * @hostname: the hostname to look up
25093 * @cancellable: (allow-none): a #GCancellable, or %NULL
25094 * @error: return location for a #GError, or %NULL
25096 * Synchronously resolves @hostname to determine its associated IP
25097 * address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
25098 * the textual form of an IP address (in which case this just becomes
25099 * a wrapper around g_inet_address_new_from_string()).
25101 * On success, g_resolver_lookup_by_name() will return a #GList of
25102 * #GInetAddress, sorted in order of preference and guaranteed to not
25103 * contain duplicates. That is, if using the result to connect to
25104 * @hostname, you should attempt to connect to the first address
25105 * first, then the second if the first fails, etc. If you are using
25106 * the result to listen on a socket, it is appropriate to add each
25107 * result using e.g. g_socket_listener_add_address().
25109 * If the DNS resolution fails, @error (if non-%NULL) will be set to a
25110 * value from #GResolverError.
25112 * If @cancellable is non-%NULL, it can be used to cancel the
25113 * operation, in which case @error (if non-%NULL) will be set to
25114 * %G_IO_ERROR_CANCELLED.
25116 * If you are planning to connect to a socket on the resolved IP
25117 * address, it may be easier to create a #GNetworkAddress and use its
25118 * #GSocketConnectable interface.
25120 * 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.)
25126 * g_resolver_lookup_by_name_async:
25127 * @resolver: a #GResolver
25128 * @hostname: the hostname to look up the address of
25129 * @cancellable: (allow-none): a #GCancellable, or %NULL
25130 * @callback: (scope async): callback to call after resolution completes
25131 * @user_data: (closure): data for @callback
25133 * Begins asynchronously resolving @hostname to determine its
25134 * associated IP address(es), and eventually calls @callback, which
25135 * must call g_resolver_lookup_by_name_finish() to get the result.
25136 * See g_resolver_lookup_by_name() for more details.
25143 * g_resolver_lookup_by_name_finish:
25144 * @resolver: a #GResolver
25145 * @result: the result passed to your #GAsyncReadyCallback
25146 * @error: return location for a #GError, or %NULL
25148 * Retrieves the result of a call to
25149 * g_resolver_lookup_by_name_async().
25151 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25152 * a value from #GResolverError. If the operation was cancelled,
25153 * @error will be set to %G_IO_ERROR_CANCELLED.
25155 * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name() for more details.
25161 * g_resolver_lookup_records:
25162 * @resolver: a #GResolver
25163 * @rrname: the DNS name to lookup the record for
25164 * @record_type: the type of DNS record to lookup
25165 * @cancellable: (allow-none): a #GCancellable, or %NULL
25166 * @error: return location for a #GError, or %NULL
25168 * Synchronously performs a DNS record lookup for the given @rrname and returns
25169 * a list of records as #GVariant tuples. See #GResolverRecordType for
25170 * information on what the records contain for each @record_type.
25172 * If the DNS resolution fails, @error (if non-%NULL) will be set to
25173 * a value from #GResolverError.
25175 * If @cancellable is non-%NULL, it can be used to cancel the
25176 * operation, in which case @error (if non-%NULL) will be set to
25177 * %G_IO_ERROR_CANCELLED.
25179 * 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.)
25185 * g_resolver_lookup_records_async:
25186 * @resolver: a #GResolver
25187 * @rrname: the DNS name to lookup the record for
25188 * @record_type: the type of DNS record to lookup
25189 * @cancellable: (allow-none): a #GCancellable, or %NULL
25190 * @callback: (scope async): callback to call after resolution completes
25191 * @user_data: (closure): data for @callback
25193 * Begins asynchronously performing a DNS lookup for the given
25194 * @rrname, and eventually calls @callback, which must call
25195 * g_resolver_lookup_records_finish() to get the final result. See
25196 * g_resolver_lookup_records() for more details.
25203 * g_resolver_lookup_records_finish:
25204 * @resolver: a #GResolver
25205 * @result: the result passed to your #GAsyncReadyCallback
25206 * @error: return location for a #GError, or %NULL
25208 * Retrieves the result of a previous call to
25209 * g_resolver_lookup_records_async(). Returns a list of records as #GVariant
25210 * tuples. See #GResolverRecordType for information on what the records contain.
25212 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25213 * a value from #GResolverError. If the operation was cancelled,
25214 * @error will be set to %G_IO_ERROR_CANCELLED.
25216 * 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.)
25222 * g_resolver_lookup_service:
25223 * @resolver: a #GResolver
25224 * @service: the service type to look up (eg, "ldap")
25225 * @protocol: the networking protocol to use for @service (eg, "tcp")
25226 * @domain: the DNS domain to look up the service in
25227 * @cancellable: (allow-none): a #GCancellable, or %NULL
25228 * @error: return location for a #GError, or %NULL
25230 * Synchronously performs a DNS SRV lookup for the given @service and
25231 * @protocol in the given @domain and returns an array of #GSrvTarget.
25232 * @domain may be an ASCII-only or UTF-8 hostname. Note also that the
25233 * @service and @protocol arguments <emphasis>do not</emphasis>
25234 * include the leading underscore that appears in the actual DNS
25237 * On success, g_resolver_lookup_service() will return a #GList of
25238 * #GSrvTarget, sorted in order of preference. (That is, you should
25239 * attempt to connect to the first target first, then the second if
25240 * the first fails, etc.)
25242 * If the DNS resolution fails, @error (if non-%NULL) will be set to
25243 * a value from #GResolverError.
25245 * If @cancellable is non-%NULL, it can be used to cancel the
25246 * operation, in which case @error (if non-%NULL) will be set to
25247 * %G_IO_ERROR_CANCELLED.
25249 * If you are planning to connect to the service, it is usually easier
25250 * to create a #GNetworkService and use its #GSocketConnectable
25253 * 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.)
25259 * g_resolver_lookup_service_async:
25260 * @resolver: a #GResolver
25261 * @service: the service type to look up (eg, "ldap")
25262 * @protocol: the networking protocol to use for @service (eg, "tcp")
25263 * @domain: the DNS domain to look up the service in
25264 * @cancellable: (allow-none): a #GCancellable, or %NULL
25265 * @callback: (scope async): callback to call after resolution completes
25266 * @user_data: (closure): data for @callback
25268 * Begins asynchronously performing a DNS SRV lookup for the given
25269 * @service and @protocol in the given @domain, and eventually calls
25270 * @callback, which must call g_resolver_lookup_service_finish() to
25271 * get the final result. See g_resolver_lookup_service() for more
25279 * g_resolver_lookup_service_finish:
25280 * @resolver: a #GResolver
25281 * @result: the result passed to your #GAsyncReadyCallback
25282 * @error: return location for a #GError, or %NULL
25284 * Retrieves the result of a previous call to
25285 * g_resolver_lookup_service_async().
25287 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25288 * a value from #GResolverError. If the operation was cancelled,
25289 * @error will be set to %G_IO_ERROR_CANCELLED.
25291 * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. See g_resolver_lookup_service() for more details.
25297 * g_resolver_set_default:
25298 * @resolver: the new default #GResolver
25300 * Sets @resolver to be the application's default resolver (reffing
25301 * @resolver, and unreffing the previous default resolver, if any).
25302 * Future calls to g_resolver_get_default() will return this resolver.
25304 * This can be used if an application wants to perform any sort of DNS
25305 * caching or "pinning"; it can implement its own #GResolver that
25306 * calls the original default resolver for DNS operations, and
25307 * implements its own cache policies on top of that, and then set
25308 * itself as the default resolver for all later code to use.
25315 * g_resource_enumerate_children:
25316 * @resource: A #GResource
25317 * @path: A pathname inside the resource
25318 * @lookup_flags: A #GResourceLookupFlags
25319 * @error: return location for a #GError, or %NULL
25321 * Returns all the names of children at the specified @path in the resource.
25322 * The return result is a %NULL terminated list of strings which should
25323 * be released with g_strfreev().
25325 * @lookup_flags controls the behaviour of the lookup.
25327 * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25333 * g_resource_error_quark:
25335 * Gets the #GResource Error Quark.
25337 * Returns: a #GQuark
25343 * g_resource_get_info:
25344 * @resource: A #GResource
25345 * @path: A pathname inside the resource
25346 * @lookup_flags: A #GResourceLookupFlags
25347 * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25348 * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25349 * @error: return location for a #GError, or %NULL
25351 * Looks for a file at the specified @path in the resource and
25352 * if found returns information about it.
25354 * @lookup_flags controls the behaviour of the lookup.
25356 * Returns: %TRUE if the file was found. %FALSE if there were errors
25363 * @filename: (type filename): the path of a filename to load, in the GLib filename encoding
25364 * @error: return location for a #GError, or %NULL
25366 * Loads a binary resource bundle and creates a #GResource representation of it, allowing
25367 * you to query it for data.
25369 * If you want to use this resource in the global resource namespace you need
25370 * to register it with g_resources_register().
25372 * Returns: (transfer full): a new #GResource, or %NULL on error
25378 * g_resource_lookup_data:
25379 * @resource: A #GResource
25380 * @path: A pathname inside the resource
25381 * @lookup_flags: A #GResourceLookupFlags
25382 * @error: return location for a #GError, or %NULL
25384 * Looks for a file at the specified @path in the resource and
25385 * returns a #GBytes that lets you directly access the data in
25388 * The data is always followed by a zero byte, so you
25389 * can safely use the data as a C string. However, that byte
25390 * is not included in the size of the GBytes.
25392 * For uncompressed resource files this is a pointer directly into
25393 * the resource bundle, which is typically in some readonly data section
25394 * in the program binary. For compressed files we allocate memory on
25395 * the heap and automatically uncompress the data.
25397 * @lookup_flags controls the behaviour of the lookup.
25399 * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
25405 * g_resource_new_from_data:
25407 * @error: return location for a #GError, or %NULL
25409 * Creates a GResource from a reference to the binary resource bundle.
25410 * This will keep a reference to @data while the resource lives, so
25411 * the data should not be modified or freed.
25413 * If you want to use this resource in the global resource namespace you need
25414 * to register it with g_resources_register().
25416 * Returns: (transfer full): a new #GResource, or %NULL on error
25422 * g_resource_open_stream:
25423 * @resource: A #GResource
25424 * @path: A pathname inside the resource
25425 * @lookup_flags: A #GResourceLookupFlags
25426 * @error: return location for a #GError, or %NULL
25428 * Looks for a file at the specified @path in the resource and
25429 * returns a #GInputStream that lets you read the data.
25431 * @lookup_flags controls the behaviour of the lookup.
25433 * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
25440 * @resource: A #GResource
25442 * Atomically increments the reference count of @array by one. This
25443 * function is MT-safe and may be called from any thread.
25445 * Returns: The passed in #GResource
25451 * g_resource_unref:
25452 * @resource: A #GResource
25454 * Atomically decrements the reference count of @resource by one. If the
25455 * reference count drops to 0, all memory allocated by the array is
25456 * released. This function is MT-safe and may be called from any
25464 * g_resources_enumerate_children:
25465 * @path: A pathname inside the resource
25466 * @lookup_flags: A #GResourceLookupFlags
25467 * @error: return location for a #GError, or %NULL
25469 * Returns all the names of children at the specified @path in the set of
25470 * globally registered resources.
25471 * The return result is a %NULL terminated list of strings which should
25472 * be released with g_strfreev().
25474 * @lookup_flags controls the behaviour of the lookup.
25476 * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25482 * g_resources_get_info:
25483 * @path: A pathname inside the resource
25484 * @lookup_flags: A #GResourceLookupFlags
25485 * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25486 * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25487 * @error: return location for a #GError, or %NULL
25489 * Looks for a file at the specified @path in the set of
25490 * globally registered resources and if found returns information about it.
25492 * @lookup_flags controls the behaviour of the lookup.
25494 * Returns: %TRUE if the file was found. %FALSE if there were errors
25500 * g_resources_lookup_data:
25501 * @path: A pathname inside the resource
25502 * @lookup_flags: A #GResourceLookupFlags
25503 * @error: return location for a #GError, or %NULL
25505 * Looks for a file at the specified @path in the set of
25506 * globally registered resources and returns a #GBytes that
25507 * lets you directly access the data in memory.
25509 * The data is always followed by a zero byte, so you
25510 * can safely use the data as a C string. However, that byte
25511 * is not included in the size of the GBytes.
25513 * For uncompressed resource files this is a pointer directly into
25514 * the resource bundle, which is typically in some readonly data section
25515 * in the program binary. For compressed files we allocate memory on
25516 * the heap and automatically uncompress the data.
25518 * @lookup_flags controls the behaviour of the lookup.
25520 * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
25526 * g_resources_open_stream:
25527 * @path: A pathname inside the resource
25528 * @lookup_flags: A #GResourceLookupFlags
25529 * @error: return location for a #GError, or %NULL
25531 * Looks for a file at the specified @path in the set of
25532 * globally registered resources and returns a #GInputStream
25533 * that lets you read the data.
25535 * @lookup_flags controls the behaviour of the lookup.
25537 * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
25543 * g_resources_register:
25544 * @resource: A #GResource
25546 * Registers the resource with the process-global set of resources.
25547 * Once a resource is registered the files in it can be accessed
25548 * with the global resource lookup functions like g_resources_lookup_data().
25555 * g_resources_unregister:
25556 * @resource: A #GResource
25558 * Unregisters the resource from the process-global set of resources.
25565 * g_seekable_can_seek:
25566 * @seekable: a #GSeekable.
25568 * Tests if the stream supports the #GSeekableIface.
25570 * Returns: %TRUE if @seekable can be seeked. %FALSE otherwise.
25575 * g_seekable_can_truncate:
25576 * @seekable: a #GSeekable.
25578 * Tests if the stream can be truncated.
25580 * Returns: %TRUE if the stream can be truncated, %FALSE otherwise.
25586 * @seekable: a #GSeekable.
25587 * @offset: a #goffset.
25588 * @type: a #GSeekType.
25589 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25590 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25592 * Seeks in the stream by the given @offset, modified by @type.
25594 * If @cancellable is not %NULL, then the operation can be cancelled by
25595 * triggering the cancellable object from another thread. If the operation
25596 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
25598 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
25604 * @seekable: a #GSeekable.
25606 * Tells the current position within the stream.
25608 * Returns: the offset from the beginning of the buffer.
25613 * g_seekable_truncate:
25614 * @seekable: a #GSeekable.
25615 * @offset: a #goffset.
25616 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25617 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25619 * Truncates a stream with a given #offset.
25621 * If @cancellable is not %NULL, then the operation can be cancelled by
25622 * triggering the cancellable object from another thread. If the operation
25623 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
25624 * operation was partially finished when the operation was cancelled the
25625 * partial result will be returned, without an error.
25627 * Virtual: truncate_fn
25628 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
25633 * g_settings_apply:
25634 * @settings: a #GSettings instance
25636 * Applies any changes that have been made to the settings. This
25637 * function does nothing unless @settings is in 'delay-apply' mode;
25638 * see g_settings_delay(). In the normal case settings are always
25639 * applied immediately.
25644 * g_settings_backend_changed:
25645 * @backend: a #GSettingsBackend implementation
25646 * @key: the name of the key
25647 * @origin_tag: the origin tag
25649 * Signals that a single key has possibly changed. Backend
25650 * implementations should call this if a key has possibly changed its
25653 * @key must be a valid key (ie starting with a slash, not containing
25654 * '//', and not ending with a slash).
25656 * The implementation must call this function during any call to
25657 * g_settings_backend_write(), before the call returns (except in the
25658 * case that no keys are actually changed and it cares to detect this
25659 * fact). It may not rely on the existence of a mainloop for
25660 * dispatching the signal later.
25662 * The implementation may call this function at any other time it likes
25663 * in response to other events (such as changes occurring outside of the
25664 * program). These calls may originate from a mainloop or may originate
25665 * in response to any other action (including from calls to
25666 * g_settings_backend_write()).
25668 * In the case that this call is in response to a call to
25669 * g_settings_backend_write() then @origin_tag must be set to the same
25670 * value that was passed to that call.
25677 * g_settings_backend_changed_tree:
25678 * @backend: a #GSettingsBackend implementation
25679 * @tree: a #GTree containing the changes
25680 * @origin_tag: the origin tag
25682 * This call is a convenience wrapper. It gets the list of changes from
25683 * @tree, computes the longest common prefix and calls
25684 * g_settings_backend_changed().
25691 * g_settings_backend_flatten_tree:
25692 * @tree: a #GTree containing the changes
25693 * @path: (out): the location to save the path
25694 * @keys: (out) (transfer container) (array zero-terminated=1): the location to save the relative keys
25695 * @values: (out) (allow-none) (transfer container) (array zero-terminated=1): the location to save the values, or %NULL
25697 * Calculate the longest common prefix of all keys in a tree and write
25698 * out an array of the key names relative to that prefix and,
25699 * optionally, the value to store at each of those keys.
25701 * You must free the value returned in @path, @keys and @values using
25702 * g_free(). You should not attempt to free or unref the contents of
25703 * @keys or @values.
25710 * g_settings_backend_get_default:
25712 * Returns the default #GSettingsBackend. It is possible to override
25713 * the default by setting the <envar>GSETTINGS_BACKEND</envar>
25714 * environment variable to the name of a settings backend.
25716 * The user gets a reference to the backend.
25718 * Returns: (transfer full): the default #GSettingsBackend
25724 * g_settings_backend_keys_changed:
25725 * @backend: a #GSettingsBackend implementation
25726 * @path: the path containing the changes
25727 * @items: (array zero-terminated=1): the %NULL-terminated list of changed keys
25728 * @origin_tag: the origin tag
25730 * Signals that a list of keys have possibly changed. Backend
25731 * implementations should call this if keys have possibly changed their
25734 * @path must be a valid path (ie starting and ending with a slash and
25735 * not containing '//'). Each string in @items must form a valid key
25736 * name when @path is prefixed to it (ie: each item must not start or
25737 * end with '/' and must not contain '//').
25739 * The meaning of this signal is that any of the key names resulting
25740 * from the contatenation of @path with each item in @items may have
25743 * The same rules for when notifications must occur apply as per
25744 * g_settings_backend_changed(). These two calls can be used
25745 * interchangeably if exactly one item has changed (although in that
25746 * case g_settings_backend_changed() is definitely preferred).
25748 * For efficiency reasons, the implementation should strive for @path to
25749 * be as long as possible (ie: the longest common prefix of all of the
25750 * keys that were changed) but this is not strictly required.
25757 * g_settings_backend_path_changed:
25758 * @backend: a #GSettingsBackend implementation
25759 * @path: the path containing the changes
25760 * @origin_tag: the origin tag
25762 * Signals that all keys below a given path may have possibly changed.
25763 * Backend implementations should call this if an entire path of keys
25764 * have possibly changed their values.
25766 * @path must be a valid path (ie starting and ending with a slash and
25767 * not containing '//').
25769 * The meaning of this signal is that any of the key which has a name
25770 * starting with @path may have changed.
25772 * The same rules for when notifications must occur apply as per
25773 * g_settings_backend_changed(). This call might be an appropriate
25774 * reasponse to a 'reset' call but implementations are also free to
25775 * explicitly list the keys that were affected by that call if they can
25778 * For efficiency reasons, the implementation should strive for @path to
25779 * be as long as possible (ie: the longest common prefix of all of the
25780 * keys that were changed) but this is not strictly required. As an
25781 * example, if this function is called with the path of "/" then every
25782 * single key in the application will be notified of a possible change.
25789 * g_settings_backend_path_writable_changed:
25790 * @backend: a #GSettingsBackend implementation
25791 * @path: the name of the path
25793 * Signals that the writability of all keys below a given path may have
25796 * Since GSettings performs no locking operations for itself, this call
25797 * will always be made in response to external events.
25804 * g_settings_backend_writable_changed:
25805 * @backend: a #GSettingsBackend implementation
25806 * @key: the name of the key
25808 * Signals that the writability of a single key has possibly changed.
25810 * Since GSettings performs no locking operations for itself, this call
25811 * will always be made in response to external events.
25819 * @settings: a #GSettings object
25820 * @key: the key to bind
25821 * @object: (type GObject.Object): a #GObject
25822 * @property: the name of the property to bind
25823 * @flags: flags for the binding
25825 * Create a binding between the @key in the @settings object
25826 * and the property @property of @object.
25828 * The binding uses the default GIO mapping functions to map
25829 * between the settings and property values. These functions
25830 * handle booleans, numeric types and string types in a
25831 * straightforward way. Use g_settings_bind_with_mapping() if
25832 * you need a custom mapping, or map between types that are not
25833 * supported by the default mapping functions.
25835 * Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
25836 * function also establishes a binding between the writability of
25837 * @key and the "sensitive" property of @object (if @object has
25838 * a boolean property by that name). See g_settings_bind_writable()
25839 * for more details about writable bindings.
25841 * Note that the lifecycle of the binding is tied to the object,
25842 * and that you can have only one binding per object property.
25843 * If you bind the same property twice on the same object, the second
25844 * binding overrides the first one.
25851 * g_settings_bind_with_mapping: (skip)
25852 * @settings: a #GSettings object
25853 * @key: the key to bind
25854 * @object: (type GObject.Object): a #GObject
25855 * @property: the name of the property to bind
25856 * @flags: flags for the binding
25857 * @get_mapping: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
25858 * @set_mapping: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
25859 * @user_data: data that gets passed to @get_mapping and @set_mapping
25860 * @destroy: #GDestroyNotify function for @user_data
25862 * Create a binding between the @key in the @settings object
25863 * and the property @property of @object.
25865 * The binding uses the provided mapping functions to map between
25866 * settings and property values.
25868 * Note that the lifecycle of the binding is tied to the object,
25869 * and that you can have only one binding per object property.
25870 * If you bind the same property twice on the same object, the second
25871 * binding overrides the first one.
25878 * g_settings_bind_writable:
25879 * @settings: a #GSettings object
25880 * @key: the key to bind
25881 * @object: (type GObject.Object): a #GObject
25882 * @property: the name of a boolean property to bind
25883 * @inverted: whether to 'invert' the value
25885 * Create a binding between the writability of @key in the
25886 * @settings object and the property @property of @object.
25887 * The property must be boolean; "sensitive" or "visible"
25888 * properties of widgets are the most likely candidates.
25890 * Writable bindings are always uni-directional; changes of the
25891 * writability of the setting will be propagated to the object
25892 * property, not the other way.
25894 * When the @inverted argument is %TRUE, the binding inverts the
25895 * value as it passes from the setting to the object, i.e. @property
25896 * will be set to %TRUE if the key is <emphasis>not</emphasis>
25899 * Note that the lifecycle of the binding is tied to the object,
25900 * and that you can have only one binding per object property.
25901 * If you bind the same property twice on the same object, the second
25902 * binding overrides the first one.
25909 * g_settings_create_action:
25910 * @settings: a #GSettings
25911 * @key: the name of a key in @settings
25913 * Creates a #GAction corresponding to a given #GSettings key.
25915 * The action has the same name as the key.
25917 * The value of the key becomes the state of the action and the action
25918 * is enabled when the key is writable. Changing the state of the
25919 * action results in the key being written to. Changes to the value or
25920 * writability of the key cause appropriate change notifications to be
25921 * emitted for the action.
25923 * For boolean-valued keys, action activations take no parameter and
25924 * result in the toggling of the value. For all other types,
25925 * activations take the new value for the key (which must have the
25928 * Returns: (transfer full): a new #GAction
25934 * g_settings_delay:
25935 * @settings: a #GSettings object
25937 * Changes the #GSettings object into 'delay-apply' mode. In this
25938 * mode, changes to @settings are not immediately propagated to the
25939 * backend, but kept locally until g_settings_apply() is called.
25947 * @settings: a #GSettings object
25948 * @key: the key to get the value for
25949 * @format: a #GVariant format string
25950 * @...: arguments as per @format
25952 * Gets the value that is stored at @key in @settings.
25954 * A convenience function that combines g_settings_get_value() with
25957 * It is a programmer error to give a @key that isn't contained in the
25958 * schema for @settings or for the #GVariantType of @format to mismatch
25959 * the type given in the schema.
25966 * g_settings_get_boolean:
25967 * @settings: a #GSettings object
25968 * @key: the key to get the value for
25970 * Gets the value that is stored at @key in @settings.
25972 * A convenience variant of g_settings_get() for booleans.
25974 * It is a programmer error to give a @key that isn't specified as
25975 * having a boolean type in the schema for @settings.
25977 * Returns: a boolean
25983 * g_settings_get_child:
25984 * @settings: a #GSettings object
25985 * @name: the name of the 'child' schema
25987 * Creates a 'child' settings object which has a base path of
25988 * <replaceable>base-path</replaceable>/@name, where
25989 * <replaceable>base-path</replaceable> is the base path of @settings.
25991 * The schema for the child settings object must have been declared
25992 * in the schema of @settings using a <tag class="starttag">child</tag> element.
25994 * Returns: (transfer full): a 'child' settings object
26000 * g_settings_get_double:
26001 * @settings: a #GSettings object
26002 * @key: the key to get the value for
26004 * Gets the value that is stored at @key in @settings.
26006 * A convenience variant of g_settings_get() for doubles.
26008 * It is a programmer error to give a @key that isn't specified as
26009 * having a 'double' type in the schema for @settings.
26011 * Returns: a double
26017 * g_settings_get_enum:
26018 * @settings: a #GSettings object
26019 * @key: the key to get the value for
26021 * Gets the value that is stored in @settings for @key and converts it
26022 * to the enum value that it represents.
26024 * In order to use this function the type of the value must be a string
26025 * and it must be marked in the schema file as an enumerated type.
26027 * It is a programmer error to give a @key that isn't contained in the
26028 * schema for @settings or is not marked as an enumerated type.
26030 * If the value stored in the configuration database is not a valid
26031 * value for the enumerated type then this function will return the
26034 * Returns: the enum value
26040 * g_settings_get_flags:
26041 * @settings: a #GSettings object
26042 * @key: the key to get the value for
26044 * Gets the value that is stored in @settings for @key and converts it
26045 * to the flags value that it represents.
26047 * In order to use this function the type of the value must be an array
26048 * of strings and it must be marked in the schema file as an flags type.
26050 * It is a programmer error to give a @key that isn't contained in the
26051 * schema for @settings or is not marked as a flags type.
26053 * If the value stored in the configuration database is not a valid
26054 * value for the flags type then this function will return the default
26057 * Returns: the flags value
26063 * g_settings_get_has_unapplied:
26064 * @settings: a #GSettings object
26066 * Returns whether the #GSettings object has any unapplied
26067 * changes. This can only be the case if it is in 'delayed-apply' mode.
26069 * Returns: %TRUE if @settings has unapplied changes
26075 * g_settings_get_int:
26076 * @settings: a #GSettings object
26077 * @key: the key to get the value for
26079 * Gets the value that is stored at @key in @settings.
26081 * A convenience variant of g_settings_get() for 32-bit integers.
26083 * It is a programmer error to give a @key that isn't specified as
26084 * having a int32 type in the schema for @settings.
26086 * Returns: an integer
26092 * g_settings_get_mapped:
26093 * @settings: a #GSettings object
26094 * @key: the key to get the value for
26095 * @mapping: (scope call): the function to map the value in the settings database to the value used by the application
26096 * @user_data: user data for @mapping
26098 * Gets the value that is stored at @key in @settings, subject to
26099 * application-level validation/mapping.
26101 * You should use this function when the application needs to perform
26102 * some processing on the value of the key (for example, parsing). The
26103 * @mapping function performs that processing. If the function
26104 * indicates that the processing was unsuccessful (due to a parse error,
26105 * for example) then the mapping is tried again with another value.
26107 * This allows a robust 'fall back to defaults' behaviour to be
26108 * implemented somewhat automatically.
26110 * The first value that is tried is the user's setting for the key. If
26111 * the mapping function fails to map this value, other values may be
26112 * tried in an unspecified order (system or site defaults, translated
26113 * schema default values, untranslated schema default values, etc).
26115 * If the mapping function fails for all possible values, one additional
26116 * attempt is made: the mapping function is called with a %NULL value.
26117 * If the mapping function still indicates failure at this point then
26118 * the application will be aborted.
26120 * The result parameter for the @mapping function is pointed to a
26121 * #gpointer which is initially set to %NULL. The same pointer is given
26122 * to each invocation of @mapping. The final value of that #gpointer is
26123 * what is returned by this function. %NULL is valid; it is returned
26124 * just as any other value would be.
26126 * Returns: (transfer full): the result, which may be %NULL
26131 * g_settings_get_range:
26132 * @settings: a #GSettings
26133 * @key: the key to query the range of
26135 * Queries the range of a key.
26137 * This function will return a #GVariant that fully describes the range
26138 * of values that are valid for @key.
26140 * The type of #GVariant returned is <literal>(sv)</literal>. The
26141 * string describes the type of range restriction in effect. The type
26142 * and meaning of the value contained in the variant depends on the
26145 * If the string is <literal>'type'</literal> then the variant contains
26146 * an empty array. The element type of that empty array is the expected
26147 * type of value and all values of that type are valid.
26149 * If the string is <literal>'enum'</literal> then the variant contains
26150 * an array enumerating the possible values. Each item in the array is
26151 * a possible valid value and no other values are valid.
26153 * If the string is <literal>'flags'</literal> then the variant contains
26154 * an array. Each item in the array is a value that may appear zero or
26155 * one times in an array to be used as the value for this key. For
26156 * example, if the variant contained the array <literal>['x',
26157 * 'y']</literal> then the valid values for the key would be
26158 * <literal>[]</literal>, <literal>['x']</literal>,
26159 * <literal>['y']</literal>, <literal>['x', 'y']</literal> and
26160 * <literal>['y', 'x']</literal>.
26162 * Finally, if the string is <literal>'range'</literal> then the variant
26163 * contains a pair of like-typed values -- the minimum and maximum
26164 * permissible values for this key.
26166 * This information should not be used by normal programs. It is
26167 * considered to be a hint for introspection purposes. Normal programs
26168 * should already know what is permitted by their own schema. The
26169 * format may change in any way in the future -- but particularly, new
26170 * forms may be added to the possibilities described above.
26172 * It is a programmer error to give a @key that isn't contained in the
26173 * schema for @settings.
26175 * You should free the returned value with g_variant_unref() when it is
26176 * no longer needed.
26178 * Returns: a #GVariant describing the range
26184 * g_settings_get_string:
26185 * @settings: a #GSettings object
26186 * @key: the key to get the value for
26188 * Gets the value that is stored at @key in @settings.
26190 * A convenience variant of g_settings_get() for strings.
26192 * It is a programmer error to give a @key that isn't specified as
26193 * having a string type in the schema for @settings.
26195 * Returns: a newly-allocated string
26201 * g_settings_get_strv:
26202 * @settings: a #GSettings object
26203 * @key: the key to get the value for
26205 * A convenience variant of g_settings_get() for string arrays.
26207 * It is a programmer error to give a @key that isn't specified as
26208 * having an array of strings type in the schema for @settings.
26210 * Returns: (array zero-terminated=1) (transfer full): a newly-allocated, %NULL-terminated array of strings, the value that is stored at @key in @settings.
26216 * g_settings_get_uint:
26217 * @settings: a #GSettings object
26218 * @key: the key to get the value for
26220 * Gets the value that is stored at @key in @settings.
26222 * A convenience variant of g_settings_get() for 32-bit unsigned
26225 * It is a programmer error to give a @key that isn't specified as
26226 * having a uint32 type in the schema for @settings.
26228 * Returns: an unsigned integer
26234 * g_settings_get_value:
26235 * @settings: a #GSettings object
26236 * @key: the key to get the value for
26238 * Gets the value that is stored in @settings for @key.
26240 * It is a programmer error to give a @key that isn't contained in the
26241 * schema for @settings.
26243 * Returns: a new #GVariant
26249 * g_settings_is_writable:
26250 * @settings: a #GSettings object
26251 * @name: the name of a key
26253 * Finds out if a key can be written or not
26255 * Returns: %TRUE if the key @name is writable
26261 * g_settings_list_children:
26262 * @settings: a #GSettings object
26264 * Gets the list of children on @settings.
26266 * The list is exactly the list of strings for which it is not an error
26267 * to call g_settings_get_child().
26269 * For GSettings objects that are lists, this value can change at any
26270 * time and you should connect to the "children-changed" signal to watch
26271 * for those changes. Note that there is a race condition here: you may
26272 * request a child after listing it only for it to have been destroyed
26273 * in the meantime. For this reason, g_settings_get_child() may return
26274 * %NULL even for a child that was listed by this function.
26276 * For GSettings objects that are not lists, you should probably not be
26277 * calling this function from "normal" code (since you should already
26278 * know what children are in your schema). This function may still be
26279 * useful there for introspection reasons, however.
26281 * You should free the return value with g_strfreev() when you are done
26284 * Returns: (transfer full) (element-type utf8): a list of the children on @settings
26289 * g_settings_list_keys:
26290 * @settings: a #GSettings object
26292 * Introspects the list of keys on @settings.
26294 * You should probably not be calling this function from "normal" code
26295 * (since you should already know what keys are in your schema). This
26296 * function is intended for introspection reasons.
26298 * You should free the return value with g_strfreev() when you are done
26301 * Returns: (transfer full) (element-type utf8): a list of the keys on @settings
26306 * g_settings_list_relocatable_schemas:
26308 * Gets a list of the relocatable #GSettings schemas installed on the
26309 * system. These are schemas that do not provide their own path. It is
26310 * usual to instantiate these schemas directly, but if you want to you
26311 * can use g_settings_new_with_path() to specify the path.
26313 * The output of this function, taken together with the output of
26314 * g_settings_list_schemas() represents the complete list of all
26315 * installed schemas.
26317 * Returns: (element-type utf8) (transfer none): a list of relocatable #GSettings schemas that are available. The list must not be modified or freed.
26323 * g_settings_list_schemas:
26325 * Gets a list of the #GSettings schemas installed on the system. The
26326 * returned list is exactly the list of schemas for which you may call
26327 * g_settings_new() without adverse effects.
26329 * This function does not list the schemas that do not provide their own
26330 * paths (ie: schemas for which you must use
26331 * g_settings_new_with_path()). See
26332 * g_settings_list_relocatable_schemas() for that.
26334 * Returns: (element-type utf8) (transfer none): a list of #GSettings schemas that are available. The list must not be modified or freed.
26341 * @schema_id: the id of the schema
26343 * Creates a new #GSettings object with the schema specified by
26346 * Signals on the newly created #GSettings object will be dispatched
26347 * via the thread-default #GMainContext in effect at the time of the
26348 * call to g_settings_new(). The new #GSettings will hold a reference
26349 * on the context. See g_main_context_push_thread_default().
26351 * Returns: a new #GSettings object
26357 * g_settings_new_full:
26358 * @schema: a #GSettingsSchema
26359 * @backend: (allow-none): a #GSettingsBackend
26360 * @path: (allow-none): the path to use
26362 * Creates a new #GSettings object with a given schema, backend and
26365 * It should be extremely rare that you ever want to use this function.
26366 * It is made available for advanced use-cases (such as plugin systems
26367 * that want to provide access to schemas loaded from custom locations,
26370 * At the most basic level, a #GSettings object is a pure composition of
26371 * 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
26372 * backend, and a #GMainContext to which signals are dispatched.
26374 * This constructor therefore gives you full control over constructing
26375 * #GSettings instances. The first 4 parameters are given directly as
26376 * @schema, @backend and @path, and the main context is taken from the
26377 * thread-default (as per g_settings_new()).
26379 * If @backend is %NULL then the default backend is used.
26381 * If @path is %NULL then the path from the schema is used. It is an
26382 * error f @path is %NULL and the schema has no path of its own or if
26383 * @path is non-%NULL and not equal to the path that the schema does
26386 * Returns: a new #GSettings object
26392 * g_settings_new_with_backend:
26393 * @schema_id: the id of the schema
26394 * @backend: the #GSettingsBackend to use
26396 * Creates a new #GSettings object with the schema specified by
26397 * @schema_id and a given #GSettingsBackend.
26399 * Creating a #GSettings object with a different backend allows accessing
26400 * settings from a database other than the usual one. For example, it may make
26401 * sense to pass a backend corresponding to the "defaults" settings database on
26402 * the system to get a settings object that modifies the system default
26403 * settings instead of the settings for this user.
26405 * Returns: a new #GSettings object
26411 * g_settings_new_with_backend_and_path:
26412 * @schema_id: the id of the schema
26413 * @backend: the #GSettingsBackend to use
26414 * @path: the path to use
26416 * Creates a new #GSettings object with the schema specified by
26417 * @schema_id and a given #GSettingsBackend and path.
26419 * This is a mix of g_settings_new_with_backend() and
26420 * g_settings_new_with_path().
26422 * Returns: a new #GSettings object
26428 * g_settings_new_with_path:
26429 * @schema_id: the id of the schema
26430 * @path: the path to use
26432 * Creates a new #GSettings object with the relocatable schema specified
26433 * by @schema_id and a given path.
26435 * You only need to do this if you want to directly create a settings
26436 * object with a schema that doesn't have a specified path of its own.
26437 * That's quite rare.
26439 * It is a programmer error to call this function for a schema that
26440 * has an explicitly specified path.
26442 * Returns: a new #GSettings object
26448 * g_settings_range_check:
26449 * @settings: a #GSettings
26450 * @key: the key to check
26451 * @value: the value to check
26453 * Checks if the given @value is of the correct type and within the
26454 * permitted range for @key.
26456 * This API is not intended to be used by normal programs -- they should
26457 * already know what is permitted by their own schemas. This API is
26458 * meant to be used by programs such as editors or commandline tools.
26460 * It is a programmer error to give a @key that isn't contained in the
26461 * schema for @settings.
26463 * Returns: %TRUE if @value is valid for @key
26469 * g_settings_reset:
26470 * @settings: a #GSettings object
26471 * @key: the name of a key
26473 * Resets @key to its default value.
26475 * This call resets the key, as much as possible, to its default value.
26476 * That might the value specified in the schema or the one set by the
26482 * g_settings_revert:
26483 * @settings: a #GSettings instance
26485 * Reverts all non-applied changes to the settings. This function
26486 * does nothing unless @settings is in 'delay-apply' mode; see
26487 * g_settings_delay(). In the normal case settings are always applied
26490 * Change notifications will be emitted for affected keys.
26495 * g_settings_schema_get_id:
26496 * @schema: a #GSettingsSchema
26498 * Get the ID of @schema.
26500 * Returns: (transfer none): the ID
26505 * g_settings_schema_get_path:
26506 * @schema: a #GSettingsSchema
26508 * Gets the path associated with @schema, or %NULL.
26510 * Schemas may be single-instance or relocatable. Single-instance
26511 * schemas correspond to exactly one set of keys in the backend
26512 * database: those located at the path returned by this function.
26514 * Relocatable schemas can be referenced by other schemas and can
26515 * threfore describe multiple sets of keys at different locations. For
26516 * relocatable schemas, this function will return %NULL.
26518 * Returns: (transfer none): the path of the schema, or %NULL
26524 * g_settings_schema_ref:
26525 * @schema: a #GSettingsSchema
26527 * Increase the reference count of @schema, returning a new reference.
26529 * Returns: a new reference to @schema
26535 * g_settings_schema_source_get_default:
26537 * Gets the default system schema source.
26539 * This function is not required for normal uses of #GSettings but it
26540 * may be useful to authors of plugin management systems or to those who
26541 * want to introspect the content of schemas.
26543 * If no schemas are installed, %NULL will be returned.
26545 * The returned source may actually consist of multiple schema sources
26546 * from different directories, depending on which directories were given
26547 * in <envar>XDG_DATA_DIRS</envar> and
26548 * <envar>GSETTINGS_SCHEMA_DIR</envar>. For this reason, all lookups
26549 * performed against the default source should probably be done
26552 * Returns: (transfer none): the default schema source
26558 * g_settings_schema_source_lookup:
26559 * @source: a #GSettingsSchemaSource
26560 * @schema_id: a schema ID
26561 * @recursive: %TRUE if the lookup should be recursive
26563 * Looks up a schema with the identifier @schema_id in @source.
26565 * This function is not required for normal uses of #GSettings but it
26566 * may be useful to authors of plugin management systems or to those who
26567 * want to introspect the content of schemas.
26569 * If the schema isn't found directly in @source and @recursive is %TRUE
26570 * then the parent sources will also be checked.
26572 * If the schema isn't found, %NULL is returned.
26574 * Returns: (transfer full): a new #GSettingsSchema
26580 * g_settings_schema_source_new_from_directory:
26581 * @directory: the filename of a directory
26582 * @parent: (allow-none): a #GSettingsSchemaSource, or %NULL
26583 * @trusted: %TRUE, if the directory is trusted
26584 * @error: a pointer to a #GError pointer set to %NULL, or %NULL
26586 * Attempts to create a new schema source corresponding to the contents
26587 * of the given directory.
26589 * This function is not required for normal uses of #GSettings but it
26590 * may be useful to authors of plugin management systems.
26592 * The directory should contain a file called
26593 * <filename>gschemas.compiled</filename> as produced by
26594 * <command>glib-compile-schemas</command>.
26596 * If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
26597 * trusted not to be corrupted. This assumption has a performance
26598 * advantage, but can result in crashes or inconsistent behaviour in the
26599 * case of a corrupted file. Generally, you should set @trusted to
26600 * %TRUE for files installed by the system and to %FALSE for files in
26601 * the home directory.
26603 * If @parent is non-%NULL then there are two effects.
26605 * First, if g_settings_schema_source_lookup() is called with the
26606 * @recursive flag set to %TRUE and the schema can not be found in the
26607 * source, the lookup will recurse to the parent.
26609 * Second, any references to other schemas specified within this
26610 * source (ie: <literal>child</literal> or <literal>extends</literal>)
26611 * references may be resolved from the @parent.
26613 * For this second reason, except in very unusual situations, the
26614 * @parent should probably be given as the default schema source, as
26615 * returned by g_settings_schema_source_get_default().
26622 * g_settings_schema_source_ref:
26623 * @source: a #GSettingsSchemaSource
26625 * Increase the reference count of @source, returning a new reference.
26627 * Returns: a new reference to @source
26633 * g_settings_schema_source_unref:
26634 * @source: a #GSettingsSchemaSource
26636 * Decrease the reference count of @source, possibly freeing it.
26643 * g_settings_schema_unref:
26644 * @schema: a #GSettingsSchema
26646 * Decrease the reference count of @schema, possibly freeing it.
26654 * @settings: a #GSettings object
26655 * @key: the name of the key to set
26656 * @format: a #GVariant format string
26657 * @...: arguments as per @format
26659 * Sets @key in @settings to @value.
26661 * A convenience function that combines g_settings_set_value() with
26664 * It is a programmer error to give a @key that isn't contained in the
26665 * schema for @settings or for the #GVariantType of @format to mismatch
26666 * the type given in the schema.
26668 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26674 * g_settings_set_boolean:
26675 * @settings: a #GSettings object
26676 * @key: the name of the key to set
26677 * @value: the value to set it to
26679 * Sets @key in @settings to @value.
26681 * A convenience variant of g_settings_set() for booleans.
26683 * It is a programmer error to give a @key that isn't specified as
26684 * having a boolean type in the schema for @settings.
26686 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26692 * g_settings_set_double:
26693 * @settings: a #GSettings object
26694 * @key: the name of the key to set
26695 * @value: the value to set it to
26697 * Sets @key in @settings to @value.
26699 * A convenience variant of g_settings_set() for doubles.
26701 * It is a programmer error to give a @key that isn't specified as
26702 * having a 'double' type in the schema for @settings.
26704 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26710 * g_settings_set_enum:
26711 * @settings: a #GSettings object
26712 * @key: a key, within @settings
26713 * @value: an enumerated value
26715 * Looks up the enumerated type nick for @value and writes it to @key,
26716 * within @settings.
26718 * It is a programmer error to give a @key that isn't contained in the
26719 * schema for @settings or is not marked as an enumerated type, or for
26720 * @value not to be a valid value for the named type.
26722 * After performing the write, accessing @key directly with
26723 * g_settings_get_string() will return the 'nick' associated with
26726 * Returns: %TRUE, if the set succeeds
26731 * g_settings_set_flags:
26732 * @settings: a #GSettings object
26733 * @key: a key, within @settings
26734 * @value: a flags value
26736 * Looks up the flags type nicks for the bits specified by @value, puts
26737 * them in an array of strings and writes the array to @key, within
26740 * It is a programmer error to give a @key that isn't contained in the
26741 * schema for @settings or is not marked as a flags type, or for @value
26742 * to contain any bits that are not value for the named type.
26744 * After performing the write, accessing @key directly with
26745 * g_settings_get_strv() will return an array of 'nicks'; one for each
26748 * Returns: %TRUE, if the set succeeds
26753 * g_settings_set_int:
26754 * @settings: a #GSettings object
26755 * @key: the name of the key to set
26756 * @value: the value to set it to
26758 * Sets @key in @settings to @value.
26760 * A convenience variant of g_settings_set() for 32-bit integers.
26762 * It is a programmer error to give a @key that isn't specified as
26763 * having a int32 type in the schema for @settings.
26765 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26771 * g_settings_set_string:
26772 * @settings: a #GSettings object
26773 * @key: the name of the key to set
26774 * @value: the value to set it to
26776 * Sets @key in @settings to @value.
26778 * A convenience variant of g_settings_set() for strings.
26780 * It is a programmer error to give a @key that isn't specified as
26781 * having a string type in the schema for @settings.
26783 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26789 * g_settings_set_strv:
26790 * @settings: a #GSettings object
26791 * @key: the name of the key to set
26792 * @value: (allow-none) (array zero-terminated=1): the value to set it to, or %NULL
26794 * Sets @key in @settings to @value.
26796 * A convenience variant of g_settings_set() for string arrays. If
26797 * @value is %NULL, then @key is set to be the empty array.
26799 * It is a programmer error to give a @key that isn't specified as
26800 * having an array of strings type in the schema for @settings.
26802 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26808 * g_settings_set_uint:
26809 * @settings: a #GSettings object
26810 * @key: the name of the key to set
26811 * @value: the value to set it to
26813 * Sets @key in @settings to @value.
26815 * A convenience variant of g_settings_set() for 32-bit unsigned
26818 * It is a programmer error to give a @key that isn't specified as
26819 * having a uint32 type in the schema for @settings.
26821 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26827 * g_settings_set_value:
26828 * @settings: a #GSettings object
26829 * @key: the name of the key to set
26830 * @value: a #GVariant of the correct type
26832 * Sets @key in @settings to @value.
26834 * It is a programmer error to give a @key that isn't contained in the
26835 * schema for @settings or for @value to have the incorrect type, per
26838 * If @value is floating then this function consumes the reference.
26840 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26848 * Ensures that all pending operations for the given are complete for
26849 * the default backend.
26851 * Writes made to a #GSettings are handled asynchronously. For this
26852 * reason, it is very unlikely that the changes have it to disk by the
26853 * time g_settings_set() returns.
26855 * This call will block until all of the writes have made it to the
26856 * backend. Since the mainloop is not running, no change notifications
26857 * will be dispatched during this call (but some may be queued by the
26858 * time the call is done).
26863 * g_settings_unbind:
26864 * @object: the object
26865 * @property: the property whose binding is removed
26867 * Removes an existing binding for @property on @object.
26869 * Note that bindings are automatically removed when the
26870 * object is finalized, so it is rarely necessary to call this
26878 * g_simple_action_group_add_entries:
26879 * @simple: a #GSimpleActionGroup
26880 * @entries: (array length=n_entries): a pointer to the first item in an array of #GActionEntry structs
26881 * @n_entries: the length of @entries, or -1
26882 * @user_data: the user data for signal connections
26884 * A convenience function for creating multiple #GSimpleAction instances
26885 * and adding them to the action group.
26892 * g_simple_action_group_insert:
26893 * @simple: a #GSimpleActionGroup
26894 * @action: a #GAction
26896 * Adds an action to the action group.
26898 * If the action group already contains an action with the same name as
26899 * @action then the old action is dropped from the group.
26901 * The action group takes its own reference on @action.
26908 * g_simple_action_group_lookup:
26909 * @simple: a #GSimpleActionGroup
26910 * @action_name: the name of an action
26912 * Looks up the action with the name @action_name in the group.
26914 * If no such action exists, returns %NULL.
26916 * Returns: (transfer none): a #GAction, or %NULL
26922 * g_simple_action_group_new:
26924 * Creates a new, empty, #GSimpleActionGroup.
26926 * Returns: a new #GSimpleActionGroup
26932 * g_simple_action_group_remove:
26933 * @simple: a #GSimpleActionGroup
26934 * @action_name: the name of the action
26936 * Removes the named action from the action group.
26938 * If no action of this name is in the group then nothing happens.
26945 * g_simple_action_new:
26946 * @name: the name of the action
26947 * @parameter_type: (allow-none): the type of parameter to the activate function
26949 * Creates a new action.
26951 * The created action is stateless. See g_simple_action_new_stateful().
26953 * Returns: a new #GSimpleAction
26959 * g_simple_action_new_stateful:
26960 * @name: the name of the action
26961 * @parameter_type: (allow-none): the type of the parameter to the activate function
26962 * @state: the initial state of the action
26964 * Creates a new stateful action.
26966 * @state is the initial state of the action. All future state values
26967 * must have the same #GVariantType as the initial state.
26969 * If the @state GVariant is floating, it is consumed.
26971 * Returns: a new #GSimpleAction
26977 * g_simple_action_set_enabled:
26978 * @simple: a #GSimpleAction
26979 * @enabled: whether the action is enabled
26981 * Sets the action as enabled or not.
26983 * An action must be enabled in order to be activated or in order to
26984 * have its state changed from outside callers.
26986 * This should only be called by the implementor of the action. Users
26987 * of the action should not attempt to modify its enabled flag.
26994 * g_simple_action_set_state:
26995 * @simple: a #GSimpleAction
26996 * @value: the new #GVariant for the state
26998 * Sets the state of the action.
27000 * This directly updates the 'state' property to the given value.
27002 * This should only be called by the implementor of the action. Users
27003 * of the action should not attempt to directly modify the 'state'
27004 * property. Instead, they should call g_action_change_state() to
27005 * request the change.
27012 * g_simple_async_report_error_in_idle: (skip)
27013 * @object: (allow-none): a #GObject, or %NULL.
27014 * @callback: a #GAsyncReadyCallback.
27015 * @user_data: user data passed to @callback.
27016 * @domain: a #GQuark containing the error domain (usually #G_IO_ERROR).
27017 * @code: a specific error code.
27018 * @format: a formatted error reporting string.
27019 * @...: a list of variables to fill in @format.
27021 * Reports an error in an asynchronous function in an idle function by
27022 * directly setting the contents of the #GAsyncResult with the given error
27028 * g_simple_async_report_gerror_in_idle:
27029 * @object: (allow-none): a #GObject, or %NULL
27030 * @callback: (scope async): a #GAsyncReadyCallback.
27031 * @user_data: (closure): user data passed to @callback.
27032 * @error: the #GError to report
27034 * Reports an error in an idle function. Similar to
27035 * g_simple_async_report_error_in_idle(), but takes a #GError rather
27036 * than building a new one.
27041 * g_simple_async_report_take_gerror_in_idle: (skip)
27042 * @object: (allow-none): a #GObject, or %NULL
27043 * @callback: a #GAsyncReadyCallback.
27044 * @user_data: user data passed to @callback.
27045 * @error: the #GError to report
27047 * Reports an error in an idle function. Similar to
27048 * g_simple_async_report_gerror_in_idle(), but takes over the caller's
27049 * ownership of @error, so the caller does not have to free it any more.
27056 * g_simple_async_result_complete:
27057 * @simple: a #GSimpleAsyncResult.
27059 * Completes an asynchronous I/O job immediately. Must be called in
27060 * the thread where the asynchronous result was to be delivered, as it
27061 * invokes the callback directly. If you are in a different thread use
27062 * g_simple_async_result_complete_in_idle().
27064 * Calling this function takes a reference to @simple for as long as
27065 * is needed to complete the call.
27070 * g_simple_async_result_complete_in_idle:
27071 * @simple: a #GSimpleAsyncResult.
27073 * Completes an asynchronous function in an idle handler in the <link
27074 * linkend="g-main-context-push-thread-default">thread-default main
27075 * loop</link> of the thread that @simple was initially created in
27076 * (and re-pushes that context around the invocation of the callback).
27078 * Calling this function takes a reference to @simple for as long as
27079 * is needed to complete the call.
27084 * g_simple_async_result_get_op_res_gboolean:
27085 * @simple: a #GSimpleAsyncResult.
27087 * Gets the operation result boolean from within the asynchronous result.
27089 * Returns: %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE.
27094 * g_simple_async_result_get_op_res_gpointer: (skip)
27095 * @simple: a #GSimpleAsyncResult.
27097 * Gets a pointer result as returned by the asynchronous function.
27099 * Returns: a pointer from the result.
27104 * g_simple_async_result_get_op_res_gssize:
27105 * @simple: a #GSimpleAsyncResult.
27107 * Gets a gssize from the asynchronous result.
27109 * Returns: a gssize returned from the asynchronous function.
27114 * g_simple_async_result_get_source_tag: (skip)
27115 * @simple: a #GSimpleAsyncResult.
27117 * Gets the source tag for the #GSimpleAsyncResult.
27119 * Returns: a #gpointer to the source object for the #GSimpleAsyncResult.
27124 * g_simple_async_result_is_valid:
27125 * @result: the #GAsyncResult passed to the _finish function.
27126 * @source: the #GObject passed to the _finish function.
27127 * @source_tag: the asynchronous function.
27129 * Ensures that the data passed to the _finish function of an async
27130 * operation is consistent. Three checks are performed.
27132 * First, @result is checked to ensure that it is really a
27133 * #GSimpleAsyncResult. Second, @source is checked to ensure that it
27134 * matches the source object of @result. Third, @source_tag is
27135 * checked to ensure that it is either %NULL (as it is when the result was
27136 * created by g_simple_async_report_error_in_idle() or
27137 * g_simple_async_report_gerror_in_idle()) or equal to the
27138 * @source_tag argument given to g_simple_async_result_new() (which, by
27139 * convention, is a pointer to the _async function corresponding to the
27140 * _finish function from which this function is called).
27142 * Returns: #TRUE if all checks passed or #FALSE if any failed.
27148 * g_simple_async_result_new:
27149 * @source_object: (allow-none): a #GObject, or %NULL.
27150 * @callback: (scope async): a #GAsyncReadyCallback.
27151 * @user_data: (closure): user data passed to @callback.
27152 * @source_tag: the asynchronous function.
27154 * Creates a #GSimpleAsyncResult.
27156 * The common convention is to create the #GSimpleAsyncResult in the
27157 * function that starts the asynchronous operation and use that same
27158 * function as the @source_tag.
27160 * If your operation supports cancellation with #GCancellable (which it
27161 * probably should) then you should provide the user's cancellable to
27162 * g_simple_async_result_set_check_cancellable() immediately after
27163 * this function returns.
27165 * Returns: a #GSimpleAsyncResult.
27170 * g_simple_async_result_new_error:
27171 * @source_object: (allow-none): a #GObject, or %NULL.
27172 * @callback: (scope async): a #GAsyncReadyCallback.
27173 * @user_data: (closure): user data passed to @callback.
27174 * @domain: a #GQuark.
27175 * @code: an error code.
27176 * @format: a string with format characters.
27177 * @...: a list of values to insert into @format.
27179 * Creates a new #GSimpleAsyncResult with a set error.
27181 * Returns: a #GSimpleAsyncResult.
27186 * g_simple_async_result_new_from_error:
27187 * @source_object: (allow-none): a #GObject, or %NULL.
27188 * @callback: (scope async): a #GAsyncReadyCallback.
27189 * @user_data: (closure): user data passed to @callback.
27190 * @error: a #GError
27192 * Creates a #GSimpleAsyncResult from an error condition.
27194 * Returns: a #GSimpleAsyncResult.
27199 * g_simple_async_result_new_take_error: (skip)
27200 * @source_object: (allow-none): a #GObject, or %NULL
27201 * @callback: (scope async): a #GAsyncReadyCallback
27202 * @user_data: (closure): user data passed to @callback
27203 * @error: a #GError
27205 * Creates a #GSimpleAsyncResult from an error condition, and takes over the
27206 * caller's ownership of @error, so the caller does not need to free it anymore.
27208 * Returns: a #GSimpleAsyncResult
27214 * g_simple_async_result_propagate_error:
27215 * @simple: a #GSimpleAsyncResult.
27216 * @dest: (out): a location to propagate the error to.
27218 * Propagates an error from within the simple asynchronous result to
27219 * a given destination.
27221 * If the #GCancellable given to a prior call to
27222 * g_simple_async_result_set_check_cancellable() is cancelled then this
27223 * function will return %TRUE with @dest set appropriately.
27225 * Returns: %TRUE if the error was propagated to @dest. %FALSE otherwise.
27230 * g_simple_async_result_run_in_thread: (skip)
27231 * @simple: a #GSimpleAsyncResult.
27232 * @func: a #GSimpleAsyncThreadFunc.
27233 * @io_priority: the io priority of the request.
27234 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27236 * Runs the asynchronous job in a separate thread and then calls
27237 * g_simple_async_result_complete_in_idle() on @simple to return
27238 * the result to the appropriate main loop.
27240 * Calling this function takes a reference to @simple for as long as
27241 * is needed to run the job and report its completion.
27246 * g_simple_async_result_set_check_cancellable:
27247 * @simple: a #GSimpleAsyncResult
27248 * @check_cancellable: (allow-none): a #GCancellable to check, or %NULL to unset
27250 * Sets a #GCancellable to check before dispatching results.
27252 * This function has one very specific purpose: the provided cancellable
27253 * is checked at the time of g_simple_async_result_propagate_error() If
27254 * it is cancelled, these functions will return an "Operation was
27255 * cancelled" error (%G_IO_ERROR_CANCELLED).
27257 * Implementors of cancellable asynchronous functions should use this in
27258 * order to provide a guarantee to their callers that cancelling an
27259 * async operation will reliably result in an error being returned for
27260 * that operation (even if a positive result for the operation has
27261 * already been sent as an idle to the main context to be dispatched).
27263 * The checking described above is done regardless of any call to the
27264 * unrelated g_simple_async_result_set_handle_cancellation() function.
27271 * g_simple_async_result_set_error: (skip)
27272 * @simple: a #GSimpleAsyncResult.
27273 * @domain: a #GQuark (usually #G_IO_ERROR).
27274 * @code: an error code.
27275 * @format: a formatted error reporting string.
27276 * @...: a list of variables to fill in @format.
27278 * Sets an error within the asynchronous result without a #GError.
27283 * g_simple_async_result_set_error_va: (skip)
27284 * @simple: a #GSimpleAsyncResult.
27285 * @domain: a #GQuark (usually #G_IO_ERROR).
27286 * @code: an error code.
27287 * @format: a formatted error reporting string.
27288 * @args: va_list of arguments.
27290 * Sets an error within the asynchronous result without a #GError.
27291 * Unless writing a binding, see g_simple_async_result_set_error().
27296 * g_simple_async_result_set_from_error:
27297 * @simple: a #GSimpleAsyncResult.
27300 * Sets the result from a #GError.
27305 * g_simple_async_result_set_handle_cancellation:
27306 * @simple: a #GSimpleAsyncResult.
27307 * @handle_cancellation: a #gboolean.
27309 * Sets whether to handle cancellation within the asynchronous operation.
27311 * This function has nothing to do with
27312 * g_simple_async_result_set_check_cancellable(). It only refers to the
27313 * #GCancellable passed to g_simple_async_result_run_in_thread().
27318 * g_simple_async_result_set_op_res_gboolean:
27319 * @simple: a #GSimpleAsyncResult.
27320 * @op_res: a #gboolean.
27322 * Sets the operation result to a boolean within the asynchronous result.
27327 * g_simple_async_result_set_op_res_gpointer: (skip)
27328 * @simple: a #GSimpleAsyncResult.
27329 * @op_res: a pointer result from an asynchronous function.
27330 * @destroy_op_res: a #GDestroyNotify function.
27332 * Sets the operation result within the asynchronous result to a pointer.
27337 * g_simple_async_result_set_op_res_gssize:
27338 * @simple: a #GSimpleAsyncResult.
27339 * @op_res: a #gssize.
27341 * Sets the operation result within the asynchronous result to
27342 * the given @op_res.
27347 * g_simple_async_result_take_error: (skip)
27348 * @simple: a #GSimpleAsyncResult
27349 * @error: a #GError
27351 * Sets the result from @error, and takes over the caller's ownership
27352 * of @error, so the caller does not need to free it any more.
27359 * g_simple_permission_new:
27360 * @allowed: %TRUE if the action is allowed
27362 * Creates a new #GPermission instance that represents an action that is
27363 * either always or never allowed.
27365 * Returns: the #GSimplePermission, as a #GPermission
27371 * g_simple_proxy_resolver_new:
27372 * @default_proxy: (allow-none): the default proxy to use, eg "socks://192.168.1.1"
27373 * @ignore_hosts: (allow-none): an optional list of hosts/IP addresses to not use a proxy for.
27375 * Creates a new #GSimpleProxyResolver. See
27376 * #GSimpleProxyResolver:default-proxy and
27377 * #GSimpleProxyResolver:ignore-hosts for more details on how the
27378 * arguments are interpreted.
27380 * Returns: a new #GSimpleProxyResolver
27386 * g_simple_proxy_resolver_set_default_proxy:
27387 * @resolver: a #GSimpleProxyResolver
27388 * @default_proxy: the default proxy to use
27390 * Sets the default proxy on @resolver, to be used for any URIs that
27391 * don't match #GSimpleProxyResolver:ignore-hosts or a proxy set
27392 * via g_simple_proxy_resolver_set_uri_proxy().
27394 * If @default_proxy starts with "<literal>socks://</literal>",
27395 * #GSimpleProxyResolver will treat it as referring to all three of
27396 * the <literal>socks5</literal>, <literal>socks4a</literal>, and
27397 * <literal>socks4</literal> proxy types.
27404 * g_simple_proxy_resolver_set_uri_proxy:
27405 * @resolver: a #GSimpleProxyResolver
27406 * @uri_scheme: the URI scheme to add a proxy for
27407 * @proxy: the proxy to use for @uri_scheme
27409 * Adds a URI-scheme-specific proxy to @resolver; URIs whose scheme
27410 * matches @uri_scheme (and which don't match
27411 * #GSimpleProxyResolver:ignore-hosts) will be proxied via @proxy.
27413 * As with #GSimpleProxyResolver:default-proxy, if @proxy starts with
27414 * "<literal>socks://</literal>", #GSimpleProxyResolver will treat it
27415 * as referring to all three of the <literal>socks5</literal>,
27416 * <literal>socks4a</literal>, and <literal>socks4</literal> proxy
27425 * @socket: a #GSocket.
27426 * @cancellable: (allow-none): a %GCancellable or %NULL
27427 * @error: #GError for error reporting, or %NULL to ignore.
27429 * Accept incoming connections on a connection-based socket. This removes
27430 * the first outstanding connection request from the listening socket and
27431 * creates a #GSocket object for it.
27433 * The @socket must be bound to a local address with g_socket_bind() and
27434 * must be listening for incoming connections (g_socket_listen()).
27436 * If there are no outstanding connections then the operation will block
27437 * or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
27438 * To be notified of an incoming connection, wait for the %G_IO_IN condition.
27440 * Returns: (transfer full): a new #GSocket, or %NULL on error. Free the returned object with g_object_unref().
27446 * g_socket_address_enumerator_next:
27447 * @enumerator: a #GSocketAddressEnumerator
27448 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27449 * @error: a #GError.
27451 * Retrieves the next #GSocketAddress from @enumerator. Note that this
27452 * may block for some amount of time. (Eg, a #GNetworkAddress may need
27453 * to do a DNS lookup before it can return an address.) Use
27454 * g_socket_address_enumerator_next_async() if you need to avoid
27457 * If @enumerator is expected to yield addresses, but for some reason
27458 * is unable to (eg, because of a DNS error), then the first call to
27459 * g_socket_address_enumerator_next() will return an appropriate error
27460 * in *@error. However, if the first call to
27461 * g_socket_address_enumerator_next() succeeds, then any further
27462 * internal errors (other than @cancellable being triggered) will be
27465 * 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.
27470 * g_socket_address_enumerator_next_async:
27471 * @enumerator: a #GSocketAddressEnumerator
27472 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27473 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
27474 * @user_data: (closure): the data to pass to callback function
27476 * Asynchronously retrieves the next #GSocketAddress from @enumerator
27477 * and then calls @callback, which must call
27478 * g_socket_address_enumerator_next_finish() to get the result.
27483 * g_socket_address_enumerator_next_finish:
27484 * @enumerator: a #GSocketAddressEnumerator
27485 * @result: a #GAsyncResult
27486 * @error: a #GError
27488 * Retrieves the result of a completed call to
27489 * g_socket_address_enumerator_next_async(). See
27490 * g_socket_address_enumerator_next() for more information about
27493 * 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.
27498 * g_socket_address_get_family:
27499 * @address: a #GSocketAddress
27501 * Gets the socket family type of @address.
27503 * Returns: the socket family type of @address.
27509 * g_socket_address_get_native_size:
27510 * @address: a #GSocketAddress
27512 * Gets the size of @address's native <type>struct sockaddr</type>.
27513 * You can use this to allocate memory to pass to
27514 * g_socket_address_to_native().
27516 * Returns: the size of the native <type>struct sockaddr</type> that @address represents
27522 * g_socket_address_new_from_native:
27523 * @native: a pointer to a <type>struct sockaddr</type>
27524 * @len: the size of the memory location pointed to by @native
27526 * Creates a #GSocketAddress subclass corresponding to the native
27527 * <type>struct sockaddr</type> @native.
27529 * Returns: a new #GSocketAddress if @native could successfully be converted, otherwise %NULL.
27535 * g_socket_address_to_native:
27536 * @address: a #GSocketAddress
27537 * @dest: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
27538 * @destlen: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
27539 * @error: #GError for error reporting, or %NULL to ignore.
27541 * Converts a #GSocketAddress to a native <type>struct
27542 * sockaddr</type>, which can be passed to low-level functions like
27543 * connect() or bind().
27545 * If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
27546 * returned. If the address type is not known on the system
27547 * then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
27549 * Returns: %TRUE if @dest was filled in, %FALSE on error
27556 * @socket: a #GSocket.
27557 * @address: a #GSocketAddress specifying the local address.
27558 * @allow_reuse: whether to allow reusing this address
27559 * @error: #GError for error reporting, or %NULL to ignore.
27561 * When a socket is created it is attached to an address family, but it
27562 * doesn't have an address in this family. g_socket_bind() assigns the
27563 * address (sometimes called name) of the socket.
27565 * It is generally required to bind to a local address before you can
27566 * receive connections. (See g_socket_listen() and g_socket_accept() ).
27567 * In certain situations, you may also want to bind a socket that will be
27568 * used to initiate connections, though this is not normally required.
27570 * @allow_reuse should be %TRUE for server sockets (sockets that you will
27571 * eventually call g_socket_accept() on), and %FALSE for client sockets.
27572 * (Specifically, if it is %TRUE, then g_socket_bind() will set the
27573 * %SO_REUSEADDR flag on the socket, allowing it to bind @address even if
27574 * that address was previously used by another socket that has not yet been
27575 * fully cleaned-up by the kernel. Failing to set this flag on a server
27576 * socket may cause the bind call to return %G_IO_ERROR_ADDRESS_IN_USE if
27577 * the server program is stopped and then immediately restarted.)
27579 * Returns: %TRUE on success, %FALSE on error.
27585 * g_socket_check_connect_result:
27586 * @socket: a #GSocket
27587 * @error: #GError for error reporting, or %NULL to ignore.
27589 * Checks and resets the pending connect error for the socket.
27590 * This is used to check for errors when g_socket_connect() is
27591 * used in non-blocking mode.
27593 * Returns: %TRUE if no error, %FALSE otherwise, setting @error to the error
27599 * g_socket_client_add_application_proxy:
27600 * @client: a #GSocketClient
27601 * @protocol: The proxy protocol
27603 * Enable proxy protocols to be handled by the application. When the
27604 * indicated proxy protocol is returned by the #GProxyResolver,
27605 * #GSocketClient will consider this protocol as supported but will
27606 * not try to find a #GProxy instance to handle handshaking. The
27607 * application must check for this case by calling
27608 * g_socket_connection_get_remote_address() on the returned
27609 * #GSocketConnection, and seeing if it's a #GProxyAddress of the
27610 * appropriate type, to determine whether or not it needs to handle
27611 * the proxy handshaking itself.
27613 * This should be used for proxy protocols that are dialects of
27614 * another protocol such as HTTP proxy. It also allows cohabitation of
27615 * proxy protocols that are reused between protocols. A good example
27616 * is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
27617 * be use as generic socket proxy through the HTTP CONNECT method.
27619 * When the proxy is detected as being an application proxy, TLS handshake
27620 * will be skipped. This is required to let the application do the proxy
27621 * specific handshake.
27626 * g_socket_client_connect:
27627 * @client: a #GSocketClient.
27628 * @connectable: a #GSocketConnectable specifying the remote address.
27629 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27630 * @error: #GError for error reporting, or %NULL to ignore.
27632 * Tries to resolve the @connectable and make a network connection to it.
27634 * Upon a successful connection, a new #GSocketConnection is constructed
27635 * and returned. The caller owns this new object and must drop their
27636 * reference to it when finished with it.
27638 * The type of the #GSocketConnection object returned depends on the type of
27639 * the underlying socket that is used. For instance, for a TCP/IP connection
27640 * it will be a #GTcpConnection.
27642 * The socket created will be the same family as the address that the
27643 * @connectable resolves to, unless family is set with g_socket_client_set_family()
27644 * or indirectly via g_socket_client_set_local_address(). The socket type
27645 * defaults to %G_SOCKET_TYPE_STREAM but can be set with
27646 * g_socket_client_set_socket_type().
27648 * If a local address is specified with g_socket_client_set_local_address() the
27649 * socket will be bound to this address before connecting.
27651 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27657 * g_socket_client_connect_async:
27658 * @client: a #GSocketClient
27659 * @connectable: a #GSocketConnectable specifying the remote address.
27660 * @cancellable: (allow-none): a #GCancellable, or %NULL
27661 * @callback: (scope async): a #GAsyncReadyCallback
27662 * @user_data: (closure): user data for the callback
27664 * This is the asynchronous version of g_socket_client_connect().
27666 * When the operation is finished @callback will be
27667 * called. You can then call g_socket_client_connect_finish() to get
27668 * the result of the operation.
27675 * g_socket_client_connect_finish:
27676 * @client: a #GSocketClient.
27677 * @result: a #GAsyncResult.
27678 * @error: a #GError location to store the error occurring, or %NULL to ignore.
27680 * Finishes an async connect operation. See g_socket_client_connect_async()
27682 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27688 * g_socket_client_connect_to_host:
27689 * @client: a #GSocketClient
27690 * @host_and_port: the name and optionally port of the host to connect to
27691 * @default_port: the default port to connect to
27692 * @cancellable: (allow-none): a #GCancellable, or %NULL
27693 * @error: a pointer to a #GError, or %NULL
27695 * This is a helper function for g_socket_client_connect().
27697 * Attempts to create a TCP connection to the named host.
27699 * @host_and_port may be in any of a number of recognized formats; an IPv6
27700 * address, an IPv4 address, or a domain name (in which case a DNS
27701 * lookup is performed). Quoting with [] is supported for all address
27702 * types. A port override may be specified in the usual way with a
27703 * colon. Ports may be given as decimal numbers or symbolic names (in
27704 * which case an /etc/services lookup is performed).
27706 * If no port override is given in @host_and_port then @default_port will be
27707 * used as the port number to connect to.
27709 * In general, @host_and_port is expected to be provided by the user (allowing
27710 * them to give the hostname, and a port override if necessary) and
27711 * @default_port is expected to be provided by the application.
27713 * In the case that an IP address is given, a single connection
27714 * attempt is made. In the case that a name is given, multiple
27715 * connection attempts may be made, in turn and according to the
27716 * number of address records in DNS, until a connection succeeds.
27718 * Upon a successful connection, a new #GSocketConnection is constructed
27719 * and returned. The caller owns this new object and must drop their
27720 * reference to it when finished with it.
27722 * In the event of any failure (DNS error, service not found, no hosts
27723 * connectable) %NULL is returned and @error (if non-%NULL) is set
27726 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27732 * g_socket_client_connect_to_host_async:
27733 * @client: a #GSocketClient
27734 * @host_and_port: the name and optionally the port of the host to connect to
27735 * @default_port: the default port to connect to
27736 * @cancellable: (allow-none): a #GCancellable, or %NULL
27737 * @callback: (scope async): a #GAsyncReadyCallback
27738 * @user_data: (closure): user data for the callback
27740 * This is the asynchronous version of g_socket_client_connect_to_host().
27742 * When the operation is finished @callback will be
27743 * called. You can then call g_socket_client_connect_to_host_finish() to get
27744 * the result of the operation.
27751 * g_socket_client_connect_to_host_finish:
27752 * @client: a #GSocketClient.
27753 * @result: a #GAsyncResult.
27754 * @error: a #GError location to store the error occurring, or %NULL to ignore.
27756 * Finishes an async connect operation. See g_socket_client_connect_to_host_async()
27758 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27764 * g_socket_client_connect_to_service:
27765 * @client: a #GSocketConnection
27766 * @domain: a domain name
27767 * @service: the name of the service to connect to
27768 * @cancellable: (allow-none): a #GCancellable, or %NULL
27769 * @error: a pointer to a #GError, or %NULL
27771 * Attempts to create a TCP connection to a service.
27773 * This call looks up the SRV record for @service at @domain for the
27774 * "tcp" protocol. It then attempts to connect, in turn, to each of
27775 * the hosts providing the service until either a connection succeeds
27776 * or there are no hosts remaining.
27778 * Upon a successful connection, a new #GSocketConnection is constructed
27779 * and returned. The caller owns this new object and must drop their
27780 * reference to it when finished with it.
27782 * In the event of any failure (DNS error, service not found, no hosts
27783 * connectable) %NULL is returned and @error (if non-%NULL) is set
27786 * Returns: (transfer full): a #GSocketConnection if successful, or %NULL on error
27791 * g_socket_client_connect_to_service_async:
27792 * @client: a #GSocketClient
27793 * @domain: a domain name
27794 * @service: the name of the service to connect to
27795 * @cancellable: (allow-none): a #GCancellable, or %NULL
27796 * @callback: (scope async): a #GAsyncReadyCallback
27797 * @user_data: (closure): user data for the callback
27799 * This is the asynchronous version of
27800 * g_socket_client_connect_to_service().
27807 * g_socket_client_connect_to_service_finish:
27808 * @client: a #GSocketClient.
27809 * @result: a #GAsyncResult.
27810 * @error: a #GError location to store the error occurring, or %NULL to ignore.
27812 * Finishes an async connect operation. See g_socket_client_connect_to_service_async()
27814 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27820 * g_socket_client_connect_to_uri:
27821 * @client: a #GSocketClient
27822 * @uri: A network URI
27823 * @default_port: the default port to connect to
27824 * @cancellable: (allow-none): a #GCancellable, or %NULL
27825 * @error: a pointer to a #GError, or %NULL
27827 * This is a helper function for g_socket_client_connect().
27829 * Attempts to create a TCP connection with a network URI.
27831 * @uri may be any valid URI containing an "authority" (hostname/port)
27832 * component. If a port is not specified in the URI, @default_port
27833 * will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
27834 * (#GSocketClient does not know to automatically assume TLS for
27835 * certain URI schemes.)
27837 * Using this rather than g_socket_client_connect() or
27838 * g_socket_client_connect_to_host() allows #GSocketClient to
27839 * determine when to use application-specific proxy protocols.
27841 * Upon a successful connection, a new #GSocketConnection is constructed
27842 * and returned. The caller owns this new object and must drop their
27843 * reference to it when finished with it.
27845 * In the event of any failure (DNS error, service not found, no hosts
27846 * connectable) %NULL is returned and @error (if non-%NULL) is set
27849 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27855 * g_socket_client_connect_to_uri_async:
27856 * @client: a #GSocketClient
27857 * @uri: a network uri
27858 * @default_port: the default port to connect to
27859 * @cancellable: (allow-none): a #GCancellable, or %NULL
27860 * @callback: (scope async): a #GAsyncReadyCallback
27861 * @user_data: (closure): user data for the callback
27863 * This is the asynchronous version of g_socket_client_connect_to_uri().
27865 * When the operation is finished @callback will be
27866 * called. You can then call g_socket_client_connect_to_uri_finish() to get
27867 * the result of the operation.
27874 * g_socket_client_connect_to_uri_finish:
27875 * @client: a #GSocketClient.
27876 * @result: a #GAsyncResult.
27877 * @error: a #GError location to store the error occurring, or %NULL to ignore.
27879 * Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
27881 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27887 * g_socket_client_get_enable_proxy:
27888 * @client: a #GSocketClient.
27890 * Gets the proxy enable state; see g_socket_client_set_enable_proxy()
27892 * Returns: whether proxying is enabled
27898 * g_socket_client_get_family:
27899 * @client: a #GSocketClient.
27901 * Gets the socket family of the socket client.
27903 * See g_socket_client_set_family() for details.
27905 * Returns: a #GSocketFamily
27911 * g_socket_client_get_local_address:
27912 * @client: a #GSocketClient.
27914 * Gets the local address of the socket client.
27916 * See g_socket_client_set_local_address() for details.
27918 * Returns: (transfer none): a #GSocketAddress or %NULL. Do not free.
27924 * g_socket_client_get_protocol:
27925 * @client: a #GSocketClient
27927 * Gets the protocol name type of the socket client.
27929 * See g_socket_client_set_protocol() for details.
27931 * Returns: a #GSocketProtocol
27937 * g_socket_client_get_proxy_resolver:
27938 * @client: a #GSocketClient.
27940 * Gets the #GProxyResolver being used by @client. Normally, this will
27941 * be the resolver returned by g_proxy_resolver_get_default(), but you
27942 * can override it with g_socket_client_set_proxy_resolver().
27944 * Returns: (transfer none): The #GProxyResolver being used by @client.
27950 * g_socket_client_get_socket_type:
27951 * @client: a #GSocketClient.
27953 * Gets the socket type of the socket client.
27955 * See g_socket_client_set_socket_type() for details.
27957 * Returns: a #GSocketFamily
27963 * g_socket_client_get_timeout:
27964 * @client: a #GSocketClient
27966 * Gets the I/O timeout time for sockets created by @client.
27968 * See g_socket_client_set_timeout() for details.
27970 * Returns: the timeout in seconds
27976 * g_socket_client_get_tls:
27977 * @client: a #GSocketClient.
27979 * Gets whether @client creates TLS connections. See
27980 * g_socket_client_set_tls() for details.
27982 * Returns: whether @client uses TLS
27988 * g_socket_client_get_tls_validation_flags:
27989 * @client: a #GSocketClient.
27991 * Gets the TLS validation flags used creating TLS connections via
27994 * Returns: the TLS validation flags
28000 * g_socket_client_new:
28002 * Creates a new #GSocketClient with the default options.
28004 * Returns: a #GSocketClient. Free the returned object with g_object_unref().
28010 * g_socket_client_set_enable_proxy:
28011 * @client: a #GSocketClient.
28012 * @enable: whether to enable proxies
28014 * Sets whether or not @client attempts to make connections via a
28015 * proxy server. When enabled (the default), #GSocketClient will use a
28016 * #GProxyResolver to determine if a proxy protocol such as SOCKS is
28017 * needed, and automatically do the necessary proxy negotiation.
28019 * See also g_socket_client_set_proxy_resolver().
28026 * g_socket_client_set_family:
28027 * @client: a #GSocketClient.
28028 * @family: a #GSocketFamily
28030 * Sets the socket family of the socket client.
28031 * If this is set to something other than %G_SOCKET_FAMILY_INVALID
28032 * then the sockets created by this object will be of the specified
28035 * This might be useful for instance if you want to force the local
28036 * connection to be an ipv4 socket, even though the address might
28037 * be an ipv6 mapped to ipv4 address.
28044 * g_socket_client_set_local_address:
28045 * @client: a #GSocketClient.
28046 * @address: (allow-none): a #GSocketAddress, or %NULL
28048 * Sets the local address of the socket client.
28049 * The sockets created by this object will bound to the
28050 * specified address (if not %NULL) before connecting.
28052 * This is useful if you want to ensure that the local
28053 * side of the connection is on a specific port, or on
28054 * a specific interface.
28061 * g_socket_client_set_protocol:
28062 * @client: a #GSocketClient.
28063 * @protocol: a #GSocketProtocol
28065 * Sets the protocol of the socket client.
28066 * The sockets created by this object will use of the specified
28069 * If @protocol is %0 that means to use the default
28070 * protocol for the socket family and type.
28077 * g_socket_client_set_proxy_resolver:
28078 * @client: a #GSocketClient.
28079 * @proxy_resolver: (allow-none): a #GProxyResolver, or %NULL for the default.
28081 * Overrides the #GProxyResolver used by @client. You can call this if
28082 * you want to use specific proxies, rather than using the system
28083 * default proxy settings.
28085 * Note that whether or not the proxy resolver is actually used
28086 * depends on the setting of #GSocketClient:enable-proxy, which is not
28087 * changed by this function (but which is %TRUE by default)
28094 * g_socket_client_set_socket_type:
28095 * @client: a #GSocketClient.
28096 * @type: a #GSocketType
28098 * Sets the socket type of the socket client.
28099 * The sockets created by this object will be of the specified
28102 * It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
28103 * as GSocketClient is used for connection oriented services.
28110 * g_socket_client_set_timeout:
28111 * @client: a #GSocketClient.
28112 * @timeout: the timeout
28114 * Sets the I/O timeout for sockets created by @client. @timeout is a
28115 * time in seconds, or 0 for no timeout (the default).
28117 * The timeout value affects the initial connection attempt as well,
28118 * so setting this may cause calls to g_socket_client_connect(), etc,
28119 * to fail with %G_IO_ERROR_TIMED_OUT.
28126 * g_socket_client_set_tls:
28127 * @client: a #GSocketClient.
28128 * @tls: whether to use TLS
28130 * Sets whether @client creates TLS (aka SSL) connections. If @tls is
28131 * %TRUE, @client will wrap its connections in a #GTlsClientConnection
28132 * and perform a TLS handshake when connecting.
28134 * Note that since #GSocketClient must return a #GSocketConnection,
28135 * but #GTlsClientConnection is not a #GSocketConnection, this
28136 * actually wraps the resulting #GTlsClientConnection in a
28137 * #GTcpWrapperConnection when returning it. You can use
28138 * g_tcp_wrapper_connection_get_base_io_stream() on the return value
28139 * to extract the #GTlsClientConnection.
28141 * If you need to modify the behavior of the TLS handshake (eg, by
28142 * setting a client-side certificate to use, or connecting to the
28143 * #GTlsConnection::accept-certificate signal), you can connect to
28144 * @client's #GSocketClient::event signal and wait for it to be
28145 * emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
28146 * a chance to see the #GTlsClientConnection before the handshake
28154 * g_socket_client_set_tls_validation_flags:
28155 * @client: a #GSocketClient.
28156 * @flags: the validation flags
28158 * Sets the TLS validation flags used when creating TLS connections
28159 * via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
28167 * @socket: a #GSocket
28168 * @error: #GError for error reporting, or %NULL to ignore.
28170 * Closes the socket, shutting down any active connection.
28172 * Closing a socket does not wait for all outstanding I/O operations
28173 * to finish, so the caller should not rely on them to be guaranteed
28174 * to complete even if the close returns with no error.
28176 * Once the socket is closed, all other operations will return
28177 * %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
28180 * Sockets will be automatically closed when the last reference
28181 * is dropped, but you might want to call this function to make sure
28182 * resources are released as early as possible.
28184 * Beware that due to the way that TCP works, it is possible for
28185 * recently-sent data to be lost if either you close a socket while the
28186 * %G_IO_IN condition is set, or else if the remote connection tries to
28187 * send something to you after you close the socket but before it has
28188 * finished reading all of the data you sent. There is no easy generic
28189 * way to avoid this problem; the easiest fix is to design the network
28190 * protocol such that the client will never send data "out of turn".
28191 * Another solution is for the server to half-close the connection by
28192 * calling g_socket_shutdown() with only the @shutdown_write flag set,
28193 * and then wait for the client to notice this and close its side of the
28194 * connection, after which the server can safely call g_socket_close().
28195 * (This is what #GTcpConnection does if you call
28196 * g_tcp_connection_set_graceful_disconnect(). But of course, this
28197 * only works if the client will close its connection after the server
28200 * Returns: %TRUE on success, %FALSE on error
28206 * g_socket_condition_check:
28207 * @socket: a #GSocket
28208 * @condition: a #GIOCondition mask to check
28210 * Checks on the readiness of @socket to perform operations.
28211 * The operations specified in @condition are checked for and masked
28212 * against the currently-satisfied conditions on @socket. The result
28215 * Note that on Windows, it is possible for an operation to return
28216 * %G_IO_ERROR_WOULD_BLOCK even immediately after
28217 * g_socket_condition_check() has claimed that the socket is ready for
28218 * writing. Rather than calling g_socket_condition_check() and then
28219 * writing to the socket if it succeeds, it is generally better to
28220 * simply try writing to the socket right away, and try again later if
28221 * the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
28223 * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
28224 * these conditions will always be set in the output if they are true.
28226 * This call never blocks.
28228 * Returns: the @GIOCondition mask of the current state
28234 * g_socket_condition_timed_wait:
28235 * @socket: a #GSocket
28236 * @condition: a #GIOCondition mask to wait for
28237 * @timeout: the maximum time (in microseconds) to wait, or -1
28238 * @cancellable: (allow-none): a #GCancellable, or %NULL
28239 * @error: a #GError pointer, or %NULL
28241 * Waits for up to @timeout microseconds for @condition to become true
28242 * on @socket. If the condition is met, %TRUE is returned.
28244 * If @cancellable is cancelled before the condition is met, or if
28245 * @timeout (or the socket's #GSocket:timeout) is reached before the
28246 * condition is met, then %FALSE is returned and @error, if non-%NULL,
28247 * is set to the appropriate value (%G_IO_ERROR_CANCELLED or
28248 * %G_IO_ERROR_TIMED_OUT).
28250 * If you don't want a timeout, use g_socket_condition_wait().
28251 * (Alternatively, you can pass -1 for @timeout.)
28253 * Note that although @timeout is in microseconds for consistency with
28254 * other GLib APIs, this function actually only has millisecond
28255 * resolution, and the behavior is undefined if @timeout is not an
28256 * exact number of milliseconds.
28258 * Returns: %TRUE if the condition was met, %FALSE otherwise
28264 * g_socket_condition_wait:
28265 * @socket: a #GSocket
28266 * @condition: a #GIOCondition mask to wait for
28267 * @cancellable: (allow-none): a #GCancellable, or %NULL
28268 * @error: a #GError pointer, or %NULL
28270 * Waits for @condition to become true on @socket. When the condition
28271 * is met, %TRUE is returned.
28273 * If @cancellable is cancelled before the condition is met, or if the
28274 * socket has a timeout set and it is reached before the condition is
28275 * met, then %FALSE is returned and @error, if non-%NULL, is set to
28276 * the appropriate value (%G_IO_ERROR_CANCELLED or
28277 * %G_IO_ERROR_TIMED_OUT).
28279 * See also g_socket_condition_timed_wait().
28281 * Returns: %TRUE if the condition was met, %FALSE otherwise
28287 * g_socket_connect:
28288 * @socket: a #GSocket.
28289 * @address: a #GSocketAddress specifying the remote address.
28290 * @cancellable: (allow-none): a %GCancellable or %NULL
28291 * @error: #GError for error reporting, or %NULL to ignore.
28293 * Connect the socket to the specified remote address.
28295 * For connection oriented socket this generally means we attempt to make
28296 * a connection to the @address. For a connection-less socket it sets
28297 * the default address for g_socket_send() and discards all incoming datagrams
28298 * from other sources.
28300 * Generally connection oriented sockets can only connect once, but
28301 * connection-less sockets can connect multiple times to change the
28304 * If the connect call needs to do network I/O it will block, unless
28305 * non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
28306 * and the user can be notified of the connection finishing by waiting
28307 * for the G_IO_OUT condition. The result of the connection must then be
28308 * checked with g_socket_check_connect_result().
28310 * Returns: %TRUE if connected, %FALSE on error.
28316 * g_socket_connectable_enumerate:
28317 * @connectable: a #GSocketConnectable
28319 * Creates a #GSocketAddressEnumerator for @connectable.
28321 * Returns: (transfer full): a new #GSocketAddressEnumerator.
28327 * g_socket_connectable_proxy_enumerate:
28328 * @connectable: a #GSocketConnectable
28330 * Creates a #GSocketAddressEnumerator for @connectable that will
28331 * return #GProxyAddress<!-- -->es for addresses that you must connect
28334 * If @connectable does not implement
28335 * g_socket_connectable_proxy_enumerate(), this will fall back to
28336 * calling g_socket_connectable_enumerate().
28338 * Returns: (transfer full): a new #GSocketAddressEnumerator.
28344 * g_socket_connection_connect:
28345 * @connection: a #GSocketConnection
28346 * @address: a #GSocketAddress specifying the remote address.
28347 * @cancellable: (allow-none): a %GCancellable or %NULL
28348 * @error: #GError for error reporting, or %NULL to ignore.
28350 * Connect @connection to the specified remote address.
28352 * Returns: %TRUE if the connection succeeded, %FALSE on error
28358 * g_socket_connection_connect_async:
28359 * @connection: a #GSocketConnection
28360 * @address: a #GSocketAddress specifying the remote address.
28361 * @cancellable: (allow-none): a %GCancellable or %NULL
28362 * @callback: (scope async): a #GAsyncReadyCallback
28363 * @user_data: (closure): user data for the callback
28365 * Asynchronously connect @connection to the specified remote address.
28367 * This clears the #GSocket:blocking flag on @connection's underlying
28368 * socket if it is currently set.
28370 * Use g_socket_connection_connect_finish() to retrieve the result.
28377 * g_socket_connection_connect_finish:
28378 * @connection: a #GSocketConnection
28379 * @result: the #GAsyncResult
28380 * @error: #GError for error reporting, or %NULL to ignore.
28382 * Gets the result of a g_socket_connection_connect_async() call.
28384 * Returns: %TRUE if the connection succeeded, %FALSE on error
28390 * g_socket_connection_factory_create_connection:
28391 * @socket: a #GSocket
28393 * Creates a #GSocketConnection subclass of the right type for
28396 * Returns: (transfer full): a #GSocketConnection
28402 * g_socket_connection_factory_lookup_type:
28403 * @family: a #GSocketFamily
28404 * @type: a #GSocketType
28405 * @protocol_id: a protocol id
28407 * Looks up the #GType to be used when creating socket connections on
28408 * sockets with the specified @family, @type and @protocol_id.
28410 * If no type is registered, the #GSocketConnection base type is returned.
28412 * Returns: a #GType
28418 * g_socket_connection_factory_register_type:
28419 * @g_type: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
28420 * @family: a #GSocketFamily
28421 * @type: a #GSocketType
28422 * @protocol: a protocol id
28424 * Looks up the #GType to be used when creating socket connections on
28425 * sockets with the specified @family, @type and @protocol.
28427 * If no type is registered, the #GSocketConnection base type is returned.
28434 * g_socket_connection_get_local_address:
28435 * @connection: a #GSocketConnection
28436 * @error: #GError for error reporting, or %NULL to ignore.
28438 * Try to get the local address of a socket connection.
28440 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28446 * g_socket_connection_get_remote_address:
28447 * @connection: a #GSocketConnection
28448 * @error: #GError for error reporting, or %NULL to ignore.
28450 * Try to get the remote address of a socket connection.
28452 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28458 * g_socket_connection_get_socket:
28459 * @connection: a #GSocketConnection
28461 * Gets the underlying #GSocket object of the connection.
28462 * This can be useful if you want to do something unusual on it
28463 * not supported by the #GSocketConnection APIs.
28465 * Returns: (transfer none): a #GSocketAddress or %NULL on error.
28471 * g_socket_connection_is_connected:
28472 * @connection: a #GSocketConnection
28474 * Checks if @connection is connected. This is equivalent to calling
28475 * g_socket_is_connected() on @connection's underlying #GSocket.
28477 * Returns: whether @connection is connected
28483 * g_socket_control_message_deserialize:
28484 * @level: a socket level
28485 * @type: a socket control message type for the given @level
28486 * @size: the size of the data in bytes
28487 * @data: (array length=size) (element-type guint8): pointer to the message data
28489 * Tries to deserialize a socket control message of a given
28490 * @level and @type. This will ask all known (to GType) subclasses
28491 * of #GSocketControlMessage if they can understand this kind
28492 * of message and if so deserialize it into a #GSocketControlMessage.
28494 * If there is no implementation for this kind of control message, %NULL
28495 * will be returned.
28497 * Returns: (transfer full): the deserialized message or %NULL
28503 * g_socket_control_message_get_level:
28504 * @message: a #GSocketControlMessage
28506 * Returns the "level" (i.e. the originating protocol) of the control message.
28507 * This is often SOL_SOCKET.
28509 * Returns: an integer describing the level
28515 * g_socket_control_message_get_msg_type:
28516 * @message: a #GSocketControlMessage
28518 * Returns the protocol specific type of the control message.
28519 * For instance, for UNIX fd passing this would be SCM_RIGHTS.
28521 * Returns: an integer describing the type of control message
28527 * g_socket_control_message_get_size:
28528 * @message: a #GSocketControlMessage
28530 * Returns the space required for the control message, not including
28531 * headers or alignment.
28533 * Returns: The number of bytes required.
28539 * g_socket_control_message_serialize:
28540 * @message: a #GSocketControlMessage
28541 * @data: A buffer to write data to
28543 * Converts the data in the message to bytes placed in the
28546 * @data is guaranteed to have enough space to fit the size
28547 * returned by g_socket_control_message_get_size() on this
28555 * g_socket_create_source: (skip)
28556 * @socket: a #GSocket
28557 * @condition: a #GIOCondition mask to monitor
28558 * @cancellable: (allow-none): a %GCancellable or %NULL
28560 * Creates a %GSource that can be attached to a %GMainContext to monitor
28561 * for the availibility of the specified @condition on the socket.
28563 * The callback on the source is of the #GSocketSourceFunc type.
28565 * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
28566 * these conditions will always be reported output if they are true.
28568 * @cancellable if not %NULL can be used to cancel the source, which will
28569 * cause the source to trigger, reporting the current condition (which
28570 * is likely 0 unless cancellation happened at the same time as a
28571 * condition change). You can check for this in the callback using
28572 * g_cancellable_is_cancelled().
28574 * If @socket has a timeout set, and it is reached before @condition
28575 * occurs, the source will then trigger anyway, reporting %G_IO_IN or
28576 * %G_IO_OUT depending on @condition. However, @socket will have been
28577 * marked as having had a timeout, and so the next #GSocket I/O method
28578 * you call will then fail with a %G_IO_ERROR_TIMED_OUT.
28580 * Returns: (transfer full): a newly allocated %GSource, free with g_source_unref().
28586 * g_socket_get_available_bytes:
28587 * @socket: a #GSocket
28589 * Get the amount of data pending in the OS input buffer.
28591 * Returns: the number of bytes that can be read from the socket without blocking or -1 on error.
28597 * g_socket_get_blocking:
28598 * @socket: a #GSocket.
28600 * Gets the blocking mode of the socket. For details on blocking I/O,
28601 * see g_socket_set_blocking().
28603 * Returns: %TRUE if blocking I/O is used, %FALSE otherwise.
28609 * g_socket_get_broadcast:
28610 * @socket: a #GSocket.
28612 * Gets the broadcast setting on @socket; if %TRUE,
28613 * it is possible to send packets to broadcast
28614 * addresses or receive from broadcast addresses.
28616 * Returns: the broadcast setting on @socket
28622 * g_socket_get_credentials:
28623 * @socket: a #GSocket.
28624 * @error: #GError for error reporting, or %NULL to ignore.
28626 * Returns the credentials of the foreign process connected to this
28627 * socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
28630 * If this operation isn't supported on the OS, the method fails with
28631 * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
28632 * by reading the %SO_PEERCRED option on the underlying socket.
28634 * Other ways to obtain credentials from a foreign peer includes the
28635 * #GUnixCredentialsMessage type and
28636 * g_unix_connection_send_credentials() /
28637 * g_unix_connection_receive_credentials() functions.
28639 * Returns: (transfer full): %NULL if @error is set, otherwise a #GCredentials object that must be freed with g_object_unref().
28645 * g_socket_get_family:
28646 * @socket: a #GSocket.
28648 * Gets the socket family of the socket.
28650 * Returns: a #GSocketFamily
28657 * @socket: a #GSocket.
28659 * Returns the underlying OS socket object. On unix this
28660 * is a socket file descriptor, and on Windows this is
28661 * a Winsock2 SOCKET handle. This may be useful for
28662 * doing platform specific or otherwise unusual operations
28665 * Returns: the file descriptor of the socket.
28671 * g_socket_get_keepalive:
28672 * @socket: a #GSocket.
28674 * Gets the keepalive mode of the socket. For details on this,
28675 * see g_socket_set_keepalive().
28677 * Returns: %TRUE if keepalive is active, %FALSE otherwise.
28683 * g_socket_get_listen_backlog:
28684 * @socket: a #GSocket.
28686 * Gets the listen backlog setting of the socket. For details on this,
28687 * see g_socket_set_listen_backlog().
28689 * Returns: the maximum number of pending connections.
28695 * g_socket_get_local_address:
28696 * @socket: a #GSocket.
28697 * @error: #GError for error reporting, or %NULL to ignore.
28699 * Try to get the local address of a bound socket. This is only
28700 * useful if the socket has been bound to a local address,
28701 * either explicitly or implicitly when connecting.
28703 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28709 * g_socket_get_multicast_loopback:
28710 * @socket: a #GSocket.
28712 * Gets the multicast loopback setting on @socket; if %TRUE (the
28713 * default), outgoing multicast packets will be looped back to
28714 * multicast listeners on the same host.
28716 * Returns: the multicast loopback setting on @socket
28722 * g_socket_get_multicast_ttl:
28723 * @socket: a #GSocket.
28725 * Gets the multicast time-to-live setting on @socket; see
28726 * g_socket_set_multicast_ttl() for more details.
28728 * Returns: the multicast time-to-live setting on @socket
28734 * g_socket_get_option:
28735 * @socket: a #GSocket
28736 * @level: the "API level" of the option (eg, <literal>SOL_SOCKET</literal>)
28737 * @optname: the "name" of the option (eg, <literal>SO_BROADCAST</literal>)
28738 * @value: (out): return location for the option value
28739 * @error: #GError for error reporting, or %NULL to ignore.
28741 * Gets the value of an integer-valued option on @socket, as with
28742 * <literal>getsockopt ()</literal>. (If you need to fetch a
28743 * non-integer-valued option, you will need to call
28744 * <literal>getsockopt ()</literal> directly.)
28746 * The <link linkend="gio-gnetworking.h"><literal><gio/gnetworking.h></literal></link>
28747 * header pulls in system headers that will define most of the
28748 * standard/portable socket options. For unusual socket protocols or
28749 * platform-dependent options, you may need to include additional
28752 * Note that even for socket options that are a single byte in size,
28753 * @value is still a pointer to a #gint variable, not a #guchar;
28754 * g_socket_get_option() will handle the conversion internally.
28756 * Returns: success or failure. On failure, @error will be set, and the system error value (<literal>errno</literal> or <literal>WSAGetLastError ()</literal>) will still be set to the result of the <literal>getsockopt ()</literal> call.
28762 * g_socket_get_protocol:
28763 * @socket: a #GSocket.
28765 * Gets the socket protocol id the socket was created with.
28766 * In case the protocol is unknown, -1 is returned.
28768 * Returns: a protocol id, or -1 if unknown
28774 * g_socket_get_remote_address:
28775 * @socket: a #GSocket.
28776 * @error: #GError for error reporting, or %NULL to ignore.
28778 * Try to get the remove address of a connected socket. This is only
28779 * useful for connection oriented sockets that have been connected.
28781 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28787 * g_socket_get_socket_type:
28788 * @socket: a #GSocket.
28790 * Gets the socket type of the socket.
28792 * Returns: a #GSocketType
28798 * g_socket_get_timeout:
28799 * @socket: a #GSocket.
28801 * Gets the timeout setting of the socket. For details on this, see
28802 * g_socket_set_timeout().
28804 * Returns: the timeout in seconds
28810 * g_socket_get_ttl:
28811 * @socket: a #GSocket.
28813 * Gets the unicast time-to-live setting on @socket; see
28814 * g_socket_set_ttl() for more details.
28816 * Returns: the time-to-live setting on @socket
28822 * g_socket_is_closed:
28823 * @socket: a #GSocket
28825 * Checks whether a socket is closed.
28827 * Returns: %TRUE if socket is closed, %FALSE otherwise
28833 * g_socket_is_connected:
28834 * @socket: a #GSocket.
28836 * Check whether the socket is connected. This is only useful for
28837 * connection-oriented sockets.
28839 * Returns: %TRUE if socket is connected, %FALSE otherwise.
28845 * g_socket_join_multicast_group:
28846 * @socket: a #GSocket.
28847 * @group: a #GInetAddress specifying the group address to join.
28848 * @iface: (allow-none): Name of the interface to use, or %NULL
28849 * @source_specific: %TRUE if source-specific multicast should be used
28850 * @error: #GError for error reporting, or %NULL to ignore.
28852 * Registers @socket to receive multicast messages sent to @group.
28853 * @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
28854 * been bound to an appropriate interface and port with
28857 * If @iface is %NULL, the system will automatically pick an interface
28858 * to bind to based on @group.
28860 * If @source_specific is %TRUE, source-specific multicast as defined
28861 * in RFC 4604 is used. Note that on older platforms this may fail
28862 * with a %G_IO_ERROR_NOT_SUPPORTED error.
28864 * Returns: %TRUE on success, %FALSE on error.
28870 * g_socket_leave_multicast_group:
28871 * @socket: a #GSocket.
28872 * @group: a #GInetAddress specifying the group address to leave.
28873 * @iface: (allow-none): Interface used
28874 * @source_specific: %TRUE if source-specific multicast was used
28875 * @error: #GError for error reporting, or %NULL to ignore.
28877 * Removes @socket from the multicast group defined by @group, @iface,
28878 * and @source_specific (which must all have the same values they had
28879 * when you joined the group).
28881 * @socket remains bound to its address and port, and can still receive
28882 * unicast messages after calling this.
28884 * Returns: %TRUE on success, %FALSE on error.
28891 * @socket: a #GSocket.
28892 * @error: #GError for error reporting, or %NULL to ignore.
28894 * Marks the socket as a server socket, i.e. a socket that is used
28895 * to accept incoming requests using g_socket_accept().
28897 * Before calling this the socket must be bound to a local address using
28900 * To set the maximum amount of outstanding clients, use
28901 * g_socket_set_listen_backlog().
28903 * Returns: %TRUE on success, %FALSE on error.
28909 * g_socket_listener_accept:
28910 * @listener: a #GSocketListener
28911 * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL
28912 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28913 * @error: #GError for error reporting, or %NULL to ignore.
28915 * Blocks waiting for a client to connect to any of the sockets added
28916 * to the listener. Returns a #GSocketConnection for the socket that was
28919 * If @source_object is not %NULL it will be filled out with the source
28920 * object specified when the corresponding socket or address was added
28923 * If @cancellable is not %NULL, then the operation can be cancelled by
28924 * triggering the cancellable object from another thread. If the operation
28925 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
28927 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28933 * g_socket_listener_accept_async:
28934 * @listener: a #GSocketListener
28935 * @cancellable: (allow-none): a #GCancellable, or %NULL
28936 * @callback: (scope async): a #GAsyncReadyCallback
28937 * @user_data: (closure): user data for the callback
28939 * This is the asynchronous version of g_socket_listener_accept().
28941 * When the operation is finished @callback will be
28942 * called. You can then call g_socket_listener_accept_socket()
28943 * to get the result of the operation.
28950 * g_socket_listener_accept_finish:
28951 * @listener: a #GSocketListener
28952 * @result: a #GAsyncResult.
28953 * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
28954 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28956 * Finishes an async accept operation. See g_socket_listener_accept_async()
28958 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28964 * g_socket_listener_accept_socket:
28965 * @listener: a #GSocketListener
28966 * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL.
28967 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28968 * @error: #GError for error reporting, or %NULL to ignore.
28970 * Blocks waiting for a client to connect to any of the sockets added
28971 * to the listener. Returns the #GSocket that was accepted.
28973 * If you want to accept the high-level #GSocketConnection, not a #GSocket,
28974 * which is often the case, then you should use g_socket_listener_accept()
28977 * If @source_object is not %NULL it will be filled out with the source
28978 * object specified when the corresponding socket or address was added
28981 * If @cancellable is not %NULL, then the operation can be cancelled by
28982 * triggering the cancellable object from another thread. If the operation
28983 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
28985 * Returns: (transfer full): a #GSocket on success, %NULL on error.
28991 * g_socket_listener_accept_socket_async:
28992 * @listener: a #GSocketListener
28993 * @cancellable: (allow-none): a #GCancellable, or %NULL
28994 * @callback: (scope async): a #GAsyncReadyCallback
28995 * @user_data: (closure): user data for the callback
28997 * This is the asynchronous version of g_socket_listener_accept_socket().
28999 * When the operation is finished @callback will be
29000 * called. You can then call g_socket_listener_accept_socket_finish()
29001 * to get the result of the operation.
29008 * g_socket_listener_accept_socket_finish:
29009 * @listener: a #GSocketListener
29010 * @result: a #GAsyncResult.
29011 * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29012 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29014 * Finishes an async accept operation. See g_socket_listener_accept_socket_async()
29016 * Returns: (transfer full): a #GSocket on success, %NULL on error.
29022 * g_socket_listener_add_address:
29023 * @listener: a #GSocketListener
29024 * @address: a #GSocketAddress
29025 * @type: a #GSocketType
29026 * @protocol: a #GSocketProtocol
29027 * @source_object: (allow-none): Optional #GObject identifying this source
29028 * @effective_address: (out) (allow-none): location to store the address that was bound to, or %NULL.
29029 * @error: #GError for error reporting, or %NULL to ignore.
29031 * Creates a socket of type @type and protocol @protocol, binds
29032 * it to @address and adds it to the set of sockets we're accepting
29035 * Note that adding an IPv6 address, depending on the platform,
29036 * may or may not result in a listener that also accepts IPv4
29037 * connections. For more deterministic behavior, see
29038 * g_socket_listener_add_inet_port().
29040 * @source_object will be passed out in the various calls
29041 * to accept to identify this particular source, which is
29042 * useful if you're listening on multiple addresses and do
29043 * different things depending on what address is connected to.
29045 * If successful and @effective_address is non-%NULL then it will
29046 * be set to the address that the binding actually occurred at. This
29047 * is helpful for determining the port number that was used for when
29048 * requesting a binding to port 0 (ie: "any port"). This address, if
29049 * requested, belongs to the caller and must be freed.
29051 * Returns: %TRUE on success, %FALSE on error.
29057 * g_socket_listener_add_any_inet_port:
29058 * @listener: a #GSocketListener
29059 * @source_object: (allow-none): Optional #GObject identifying this source
29060 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29062 * Listens for TCP connections on any available port number for both
29063 * IPv6 and IPv4 (if each is available).
29065 * This is useful if you need to have a socket for incoming connections
29066 * but don't care about the specific port number.
29068 * @source_object will be passed out in the various calls
29069 * to accept to identify this particular source, which is
29070 * useful if you're listening on multiple addresses and do
29071 * different things depending on what address is connected to.
29073 * Returns: the port number, or 0 in case of failure.
29079 * g_socket_listener_add_inet_port:
29080 * @listener: a #GSocketListener
29081 * @port: an IP port number (non-zero)
29082 * @source_object: (allow-none): Optional #GObject identifying this source
29083 * @error: #GError for error reporting, or %NULL to ignore.
29085 * Helper function for g_socket_listener_add_address() that
29086 * creates a TCP/IP socket listening on IPv4 and IPv6 (if
29087 * supported) on the specified port on all interfaces.
29089 * @source_object will be passed out in the various calls
29090 * to accept to identify this particular source, which is
29091 * useful if you're listening on multiple addresses and do
29092 * different things depending on what address is connected to.
29094 * Returns: %TRUE on success, %FALSE on error.
29100 * g_socket_listener_add_socket:
29101 * @listener: a #GSocketListener
29102 * @socket: a listening #GSocket
29103 * @source_object: (allow-none): Optional #GObject identifying this source
29104 * @error: #GError for error reporting, or %NULL to ignore.
29106 * Adds @socket to the set of sockets that we try to accept
29107 * new clients from. The socket must be bound to a local
29108 * address and listened to.
29110 * @source_object will be passed out in the various calls
29111 * to accept to identify this particular source, which is
29112 * useful if you're listening on multiple addresses and do
29113 * different things depending on what address is connected to.
29115 * Returns: %TRUE on success, %FALSE on error.
29121 * g_socket_listener_close:
29122 * @listener: a #GSocketListener
29124 * Closes all the sockets in the listener.
29131 * g_socket_listener_new:
29133 * Creates a new #GSocketListener with no sockets to listen for.
29134 * New listeners can be added with e.g. g_socket_listener_add_address()
29135 * or g_socket_listener_add_inet_port().
29137 * Returns: a new #GSocketListener.
29143 * g_socket_listener_set_backlog:
29144 * @listener: a #GSocketListener
29145 * @listen_backlog: an integer
29147 * Sets the listen backlog on the sockets in the listener.
29149 * See g_socket_set_listen_backlog() for details
29157 * @family: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
29158 * @type: the socket type to use.
29159 * @protocol: the id of the protocol to use, or 0 for default.
29160 * @error: #GError for error reporting, or %NULL to ignore.
29162 * Creates a new #GSocket with the defined family, type and protocol.
29163 * If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
29164 * for the family and type is used.
29166 * The @protocol is a family and type specific int that specifies what
29167 * kind of protocol to use. #GSocketProtocol lists several common ones.
29168 * Many families only support one protocol, and use 0 for this, others
29169 * support several and using 0 means to use the default protocol for
29170 * the family and type.
29172 * The protocol id is passed directly to the operating
29173 * system, so you can use protocols not listed in #GSocketProtocol if you
29174 * know the protocol number used for it.
29176 * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29182 * g_socket_new_from_fd:
29183 * @fd: a native socket file descriptor.
29184 * @error: #GError for error reporting, or %NULL to ignore.
29186 * Creates a new #GSocket from a native file descriptor
29187 * or winsock SOCKET handle.
29189 * This reads all the settings from the file descriptor so that
29190 * all properties should work. Note that the file descriptor
29191 * will be set to non-blocking mode, independent on the blocking
29192 * mode of the #GSocket.
29194 * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29200 * g_socket_receive:
29201 * @socket: a #GSocket
29202 * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29203 * @size: the number of bytes you want to read from the socket
29204 * @cancellable: (allow-none): a %GCancellable or %NULL
29205 * @error: #GError for error reporting, or %NULL to ignore.
29207 * Receive data (up to @size bytes) from a socket. This is mainly used by
29208 * connection-oriented sockets; it is identical to g_socket_receive_from()
29209 * with @address set to %NULL.
29211 * For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
29212 * g_socket_receive() will always read either 0 or 1 complete messages from
29213 * the socket. If the received message is too large to fit in @buffer, then
29214 * the data beyond @size bytes will be discarded, without any explicit
29215 * indication that this has occurred.
29217 * For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
29218 * number of bytes, up to @size. If more than @size bytes have been
29219 * received, the additional data will be returned in future calls to
29220 * g_socket_receive().
29222 * If the socket is in blocking mode the call will block until there
29223 * is some data to receive, the connection is closed, or there is an
29224 * error. If there is no data available and the socket is in
29225 * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29226 * returned. To be notified when data is available, wait for the
29227 * %G_IO_IN condition.
29229 * On error -1 is returned and @error is set accordingly.
29231 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29237 * g_socket_receive_from:
29238 * @socket: a #GSocket
29239 * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29240 * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29241 * @size: the number of bytes you want to read from the socket
29242 * @cancellable: (allow-none): a %GCancellable or %NULL
29243 * @error: #GError for error reporting, or %NULL to ignore.
29245 * Receive data (up to @size bytes) from a socket.
29247 * If @address is non-%NULL then @address will be set equal to the
29248 * source address of the received packet.
29249 * @address is owned by the caller.
29251 * See g_socket_receive() for additional information.
29253 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29259 * g_socket_receive_message:
29260 * @socket: a #GSocket
29261 * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29262 * @vectors: (array length=num_vectors): an array of #GInputVector structs
29263 * @num_vectors: the number of elements in @vectors, or -1
29264 * @messages: (array length=num_messages) (allow-none): a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
29265 * @num_messages: a pointer which will be filled with the number of elements in @messages, or %NULL
29266 * @flags: a pointer to an int containing #GSocketMsgFlags flags
29267 * @cancellable: (allow-none): a %GCancellable or %NULL
29268 * @error: a #GError pointer, or %NULL
29270 * Receive data from a socket. This is the most complicated and
29271 * fully-featured version of this call. For easier use, see
29272 * g_socket_receive() and g_socket_receive_from().
29274 * If @address is non-%NULL then @address will be set equal to the
29275 * source address of the received packet.
29276 * @address is owned by the caller.
29278 * @vector must point to an array of #GInputVector structs and
29279 * @num_vectors must be the length of this array. These structs
29280 * describe the buffers that received data will be scattered into.
29281 * If @num_vectors is -1, then @vectors is assumed to be terminated
29282 * by a #GInputVector with a %NULL buffer pointer.
29284 * As a special case, if @num_vectors is 0 (in which case, @vectors
29285 * may of course be %NULL), then a single byte is received and
29286 * discarded. This is to facilitate the common practice of sending a
29287 * single '\0' byte for the purposes of transferring ancillary data.
29289 * @messages, if non-%NULL, will be set to point to a newly-allocated
29290 * array of #GSocketControlMessage instances or %NULL if no such
29291 * messages was received. These correspond to the control messages
29292 * received from the kernel, one #GSocketControlMessage per message
29293 * from the kernel. This array is %NULL-terminated and must be freed
29294 * by the caller using g_free() after calling g_object_unref() on each
29295 * element. If @messages is %NULL, any control messages received will
29298 * @num_messages, if non-%NULL, will be set to the number of control
29299 * messages received.
29301 * If both @messages and @num_messages are non-%NULL, then
29302 * @num_messages gives the number of #GSocketControlMessage instances
29303 * in @messages (ie: not including the %NULL terminator).
29305 * @flags is an in/out parameter. The commonly available arguments
29306 * for this are available in the #GSocketMsgFlags enum, but the
29307 * values there are the same as the system values, and the flags
29308 * are passed in as-is, so you can pass in system-specific flags too
29309 * (and g_socket_receive_message() may pass system-specific flags out).
29311 * As with g_socket_receive(), data may be discarded if @socket is
29312 * %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
29313 * provide enough buffer space to read a complete message. You can pass
29314 * %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
29315 * removing it from the receive queue, but there is no portable way to find
29316 * out the length of the message other than by reading it into a
29317 * sufficiently-large buffer.
29319 * If the socket is in blocking mode the call will block until there
29320 * is some data to receive, the connection is closed, or there is an
29321 * error. If there is no data available and the socket is in
29322 * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29323 * returned. To be notified when data is available, wait for the
29324 * %G_IO_IN condition.
29326 * On error -1 is returned and @error is set accordingly.
29328 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29334 * g_socket_receive_with_blocking:
29335 * @socket: a #GSocket
29336 * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29337 * @size: the number of bytes you want to read from the socket
29338 * @blocking: whether to do blocking or non-blocking I/O
29339 * @cancellable: (allow-none): a %GCancellable or %NULL
29340 * @error: #GError for error reporting, or %NULL to ignore.
29342 * This behaves exactly the same as g_socket_receive(), except that
29343 * the choice of blocking or non-blocking behavior is determined by
29344 * the @blocking argument rather than by @socket's properties.
29346 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29353 * @socket: a #GSocket
29354 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29355 * @size: the number of bytes to send
29356 * @cancellable: (allow-none): a %GCancellable or %NULL
29357 * @error: #GError for error reporting, or %NULL to ignore.
29359 * Tries to send @size bytes from @buffer on the socket. This is
29360 * mainly used by connection-oriented sockets; it is identical to
29361 * g_socket_send_to() with @address set to %NULL.
29363 * If the socket is in blocking mode the call will block until there is
29364 * space for the data in the socket queue. If there is no space available
29365 * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29366 * will be returned. To be notified when space is available, wait for the
29367 * %G_IO_OUT condition. Note though that you may still receive
29368 * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29369 * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29370 * very common due to the way the underlying APIs work.)
29372 * On error -1 is returned and @error is set accordingly.
29374 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29380 * g_socket_send_message:
29381 * @socket: a #GSocket
29382 * @address: (allow-none): a #GSocketAddress, or %NULL
29383 * @vectors: (array length=num_vectors): an array of #GOutputVector structs
29384 * @num_vectors: the number of elements in @vectors, or -1
29385 * @messages: (array length=num_messages) (allow-none): a pointer to an array of #GSocketControlMessages, or %NULL.
29386 * @num_messages: number of elements in @messages, or -1.
29387 * @flags: an int containing #GSocketMsgFlags flags
29388 * @cancellable: (allow-none): a %GCancellable or %NULL
29389 * @error: #GError for error reporting, or %NULL to ignore.
29391 * Send data to @address on @socket. This is the most complicated and
29392 * fully-featured version of this call. For easier use, see
29393 * g_socket_send() and g_socket_send_to().
29395 * If @address is %NULL then the message is sent to the default receiver
29396 * (set by g_socket_connect()).
29398 * @vectors must point to an array of #GOutputVector structs and
29399 * @num_vectors must be the length of this array. (If @num_vectors is -1,
29400 * then @vectors is assumed to be terminated by a #GOutputVector with a
29401 * %NULL buffer pointer.) The #GOutputVector structs describe the buffers
29402 * that the sent data will be gathered from. Using multiple
29403 * #GOutputVector<!-- -->s is more memory-efficient than manually copying
29404 * data from multiple sources into a single buffer, and more
29405 * network-efficient than making multiple calls to g_socket_send().
29407 * @messages, if non-%NULL, is taken to point to an array of @num_messages
29408 * #GSocketControlMessage instances. These correspond to the control
29409 * messages to be sent on the socket.
29410 * If @num_messages is -1 then @messages is treated as a %NULL-terminated
29413 * @flags modify how the message is sent. The commonly available arguments
29414 * for this are available in the #GSocketMsgFlags enum, but the
29415 * values there are the same as the system values, and the flags
29416 * are passed in as-is, so you can pass in system-specific flags too.
29418 * If the socket is in blocking mode the call will block until there is
29419 * space for the data in the socket queue. If there is no space available
29420 * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29421 * will be returned. To be notified when space is available, wait for the
29422 * %G_IO_OUT condition. Note though that you may still receive
29423 * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29424 * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29425 * very common due to the way the underlying APIs work.)
29427 * On error -1 is returned and @error is set accordingly.
29429 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29435 * g_socket_send_to:
29436 * @socket: a #GSocket
29437 * @address: (allow-none): a #GSocketAddress, or %NULL
29438 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29439 * @size: the number of bytes to send
29440 * @cancellable: (allow-none): a %GCancellable or %NULL
29441 * @error: #GError for error reporting, or %NULL to ignore.
29443 * Tries to send @size bytes from @buffer to @address. If @address is
29444 * %NULL then the message is sent to the default receiver (set by
29445 * g_socket_connect()).
29447 * See g_socket_send() for additional information.
29449 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29455 * g_socket_send_with_blocking:
29456 * @socket: a #GSocket
29457 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29458 * @size: the number of bytes to send
29459 * @blocking: whether to do blocking or non-blocking I/O
29460 * @cancellable: (allow-none): a %GCancellable or %NULL
29461 * @error: #GError for error reporting, or %NULL to ignore.
29463 * This behaves exactly the same as g_socket_send(), except that
29464 * the choice of blocking or non-blocking behavior is determined by
29465 * the @blocking argument rather than by @socket's properties.
29467 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29473 * g_socket_service_is_active:
29474 * @service: a #GSocketService
29476 * Check whether the service is active or not. An active
29477 * service will accept new clients that connect, while
29478 * a non-active service will let connecting clients queue
29479 * up until the service is started.
29481 * Returns: %TRUE if the service is active, %FALSE otherwise
29487 * g_socket_service_new:
29489 * Creates a new #GSocketService with no sockets to listen for.
29490 * New listeners can be added with e.g. g_socket_listener_add_address()
29491 * or g_socket_listener_add_inet_port().
29493 * Returns: a new #GSocketService.
29499 * g_socket_service_start:
29500 * @service: a #GSocketService
29502 * Starts the service, i.e. start accepting connections
29503 * from the added sockets when the mainloop runs.
29505 * This call is thread-safe, so it may be called from a thread
29506 * handling an incoming client request.
29513 * g_socket_service_stop:
29514 * @service: a #GSocketService
29516 * Stops the service, i.e. stops accepting connections
29517 * from the added sockets when the mainloop runs.
29519 * This call is thread-safe, so it may be called from a thread
29520 * handling an incoming client request.
29527 * g_socket_set_blocking:
29528 * @socket: a #GSocket.
29529 * @blocking: Whether to use blocking I/O or not.
29531 * Sets the blocking mode of the socket. In blocking mode
29532 * all operations block until they succeed or there is an error. In
29533 * non-blocking mode all functions return results immediately or
29534 * with a %G_IO_ERROR_WOULD_BLOCK error.
29536 * All sockets are created in blocking mode. However, note that the
29537 * platform level socket is always non-blocking, and blocking mode
29538 * is a GSocket level feature.
29545 * g_socket_set_broadcast:
29546 * @socket: a #GSocket.
29547 * @broadcast: whether @socket should allow sending to and receiving from broadcast addresses
29549 * Sets whether @socket should allow sending to and receiving from
29550 * broadcast addresses. This is %FALSE by default.
29557 * g_socket_set_keepalive:
29558 * @socket: a #GSocket.
29559 * @keepalive: Value for the keepalive flag
29561 * Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
29562 * this flag is set on a socket, the system will attempt to verify that the
29563 * remote socket endpoint is still present if a sufficiently long period of
29564 * time passes with no data being exchanged. If the system is unable to
29565 * verify the presence of the remote endpoint, it will automatically close
29568 * This option is only functional on certain kinds of sockets. (Notably,
29569 * %G_SOCKET_PROTOCOL_TCP sockets.)
29571 * The exact time between pings is system- and protocol-dependent, but will
29572 * normally be at least two hours. Most commonly, you would set this flag
29573 * on a server socket if you want to allow clients to remain idle for long
29574 * periods of time, but also want to ensure that connections are eventually
29575 * garbage-collected if clients crash or become unreachable.
29582 * g_socket_set_listen_backlog:
29583 * @socket: a #GSocket.
29584 * @backlog: the maximum number of pending connections.
29586 * Sets the maximum number of outstanding connections allowed
29587 * when listening on this socket. If more clients than this are
29588 * connecting to the socket and the application is not handling them
29589 * on time then the new connections will be refused.
29591 * Note that this must be called before g_socket_listen() and has no
29592 * effect if called after that.
29599 * g_socket_set_multicast_loopback:
29600 * @socket: a #GSocket.
29601 * @loopback: whether @socket should receive messages sent to its multicast groups from the local host
29603 * Sets whether outgoing multicast packets will be received by sockets
29604 * listening on that multicast address on the same host. This is %TRUE
29612 * g_socket_set_multicast_ttl:
29613 * @socket: a #GSocket.
29614 * @ttl: the time-to-live value for all multicast datagrams on @socket
29616 * Sets the time-to-live for outgoing multicast datagrams on @socket.
29617 * By default, this is 1, meaning that multicast packets will not leave
29618 * the local network.
29625 * g_socket_set_option:
29626 * @socket: a #GSocket
29627 * @level: the "API level" of the option (eg, <literal>SOL_SOCKET</literal>)
29628 * @optname: the "name" of the option (eg, <literal>SO_BROADCAST</literal>)
29629 * @value: the value to set the option to
29630 * @error: #GError for error reporting, or %NULL to ignore.
29632 * Sets the value of an integer-valued option on @socket, as with
29633 * <literal>setsockopt ()</literal>. (If you need to set a
29634 * non-integer-valued option, you will need to call
29635 * <literal>setsockopt ()</literal> directly.)
29637 * The <link linkend="gio-gnetworking.h"><literal><gio/gnetworking.h></literal></link>
29638 * header pulls in system headers that will define most of the
29639 * standard/portable socket options. For unusual socket protocols or
29640 * platform-dependent options, you may need to include additional
29643 * Returns: success or failure. On failure, @error will be set, and the system error value (<literal>errno</literal> or <literal>WSAGetLastError ()</literal>) will still be set to the result of the <literal>setsockopt ()</literal> call.
29649 * g_socket_set_timeout:
29650 * @socket: a #GSocket.
29651 * @timeout: the timeout for @socket, in seconds, or 0 for none
29653 * Sets the time in seconds after which I/O operations on @socket will
29654 * time out if they have not yet completed.
29656 * On a blocking socket, this means that any blocking #GSocket
29657 * operation will time out after @timeout seconds of inactivity,
29658 * returning %G_IO_ERROR_TIMED_OUT.
29660 * On a non-blocking socket, calls to g_socket_condition_wait() will
29661 * also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
29662 * created with g_socket_create_source() will trigger after
29663 * @timeout seconds of inactivity, with the requested condition
29664 * set, at which point calling g_socket_receive(), g_socket_send(),
29665 * g_socket_check_connect_result(), etc, will fail with
29666 * %G_IO_ERROR_TIMED_OUT.
29668 * If @timeout is 0 (the default), operations will never time out
29671 * Note that if an I/O operation is interrupted by a signal, this may
29672 * cause the timeout to be reset.
29679 * g_socket_set_ttl:
29680 * @socket: a #GSocket.
29681 * @ttl: the time-to-live value for all unicast packets on @socket
29683 * Sets the time-to-live for outgoing unicast packets on @socket.
29684 * By default the platform-specific default value is used.
29691 * g_socket_shutdown:
29692 * @socket: a #GSocket
29693 * @shutdown_read: whether to shut down the read side
29694 * @shutdown_write: whether to shut down the write side
29695 * @error: #GError for error reporting, or %NULL to ignore.
29697 * Shut down part of a full-duplex connection.
29699 * If @shutdown_read is %TRUE then the receiving side of the connection
29700 * is shut down, and further reading is disallowed.
29702 * If @shutdown_write is %TRUE then the sending side of the connection
29703 * is shut down, and further writing is disallowed.
29705 * It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
29707 * One example where this is used is graceful disconnect for TCP connections
29708 * where you close the sending side, then wait for the other side to close
29709 * the connection, thus ensuring that the other side saw all sent data.
29711 * Returns: %TRUE on success, %FALSE on error
29717 * g_socket_speaks_ipv4:
29718 * @socket: a #GSocket
29720 * Checks if a socket is capable of speaking IPv4.
29722 * IPv4 sockets are capable of speaking IPv4. On some operating systems
29723 * and under some combinations of circumstances IPv6 sockets are also
29724 * capable of speaking IPv4. See RFC 3493 section 3.7 for more
29727 * No other types of sockets are currently considered as being capable
29728 * of speaking IPv4.
29730 * Returns: %TRUE if this socket can be used with IPv4.
29736 * g_srv_target_copy:
29737 * @target: a #GSrvTarget
29741 * Returns: a copy of @target
29747 * g_srv_target_free:
29748 * @target: a #GSrvTarget
29757 * g_srv_target_get_hostname:
29758 * @target: a #GSrvTarget
29760 * Gets @target's hostname (in ASCII form; if you are going to present
29761 * this to the user, you should use g_hostname_is_ascii_encoded() to
29762 * check if it contains encoded Unicode segments, and use
29763 * g_hostname_to_unicode() to convert it if it does.)
29765 * Returns: @target's hostname
29771 * g_srv_target_get_port:
29772 * @target: a #GSrvTarget
29774 * Gets @target's port
29776 * Returns: @target's port
29782 * g_srv_target_get_priority:
29783 * @target: a #GSrvTarget
29785 * Gets @target's priority. You should not need to look at this;
29786 * #GResolver already sorts the targets according to the algorithm in
29789 * Returns: @target's priority
29795 * g_srv_target_get_weight:
29796 * @target: a #GSrvTarget
29798 * Gets @target's weight. You should not need to look at this;
29799 * #GResolver already sorts the targets according to the algorithm in
29802 * Returns: @target's weight
29808 * g_srv_target_list_sort: (skip)
29809 * @targets: a #GList of #GSrvTarget
29811 * Sorts @targets in place according to the algorithm in RFC 2782.
29813 * Returns: (transfer full): the head of the sorted list.
29819 * g_srv_target_new:
29820 * @hostname: the host that the service is running on
29821 * @port: the port that the service is running on
29822 * @priority: the target's priority
29823 * @weight: the target's weight
29825 * Creates a new #GSrvTarget with the given parameters.
29827 * You should not need to use this; normally #GSrvTarget<!-- -->s are
29828 * created by #GResolver.
29830 * Returns: a new #GSrvTarget.
29836 * g_static_resource_fini:
29837 * @static_resource: pointer to a static #GStaticResource
29839 * Finalized a GResource initialized by g_static_resource_init().
29841 * This is normally used by code generated by
29842 * <link linkend="glib-compile-resources">glib-compile-resources</link>
29843 * and is not typically used by other code.
29850 * g_static_resource_get_resource:
29851 * @static_resource: pointer to a static #GStaticResource
29853 * Gets the GResource that was registered by a call to g_static_resource_init().
29855 * This is normally used by code generated by
29856 * <link linkend="glib-compile-resources">glib-compile-resources</link>
29857 * and is not typically used by other code.
29859 * Returns: (transfer none): a #GResource
29865 * g_static_resource_init:
29866 * @static_resource: pointer to a static #GStaticResource
29868 * Initializes a GResource from static data using a
29871 * This is normally used by code generated by
29872 * <link linkend="glib-compile-resources">glib-compile-resources</link>
29873 * and is not typically used by other code.
29880 * g_task_attach_source:
29882 * @source: the source to attach
29883 * @callback: the callback to invoke when @source triggers
29885 * A utility function for dealing with async operations where you need
29886 * to wait for a #GSource to trigger. Attaches @source to @task's
29887 * #GMainContext with @task's <link
29888 * linkend="io-priority">priority</link>, and sets @source's callback
29889 * to @callback, with @task as the callback's
29890 * <literal>user_data</literal>.
29892 * This takes a reference on @task until @source is destroyed.
29899 * g_task_get_cancellable:
29902 * Gets @task's #GCancellable
29904 * Returns: (transfer none): @task's #GCancellable
29910 * g_task_get_check_cancellable:
29911 * @task: the #GTask
29913 * Gets @task's check-cancellable flag. See
29914 * g_task_set_check_cancellable() for more details.
29921 * g_task_get_context:
29924 * Gets the #GMainContext that @task will return its result in (that
29925 * is, the context that was the <link
29926 * linkend="g-main-context-push-thread-default">thread-default main
29927 * context</link> at the point when @task was created).
29929 * This will always return a non-%NULL value, even if the task's
29930 * context is the default #GMainContext.
29932 * Returns: (transfer none): @task's #GMainContext
29938 * g_task_get_priority:
29941 * Gets @task's priority
29943 * Returns: @task's priority
29949 * g_task_get_return_on_cancel:
29950 * @task: the #GTask
29952 * Gets @task's return-on-cancel flag. See
29953 * g_task_set_return_on_cancel() for more details.
29960 * g_task_get_source_object:
29963 * Gets the source object from @task. Like
29964 * g_async_result_get_source_object(), but does not ref the object.
29966 * Returns: (transfer none) (type GObject): @task's source object, or %NULL
29972 * g_task_get_source_tag:
29975 * Gets @task's source tag. See g_task_set_source_tag().
29977 * Returns: (transfer none): @task's source tag
29983 * g_task_get_task_data:
29986 * Gets @task's <literal>task_data</literal>.
29988 * Returns: (transfer none): @task's <literal>task_data</literal>.
29994 * g_task_had_error:
29997 * Tests if @task resulted in an error.
29999 * Returns: %TRUE if the task resulted in an error, %FALSE otherwise.
30006 * @result: (type Gio.AsyncResult): A #GAsyncResult
30007 * @source_object: (allow-none) (type GObject): the source object expected to be associated with the task
30009 * Checks that @result is a #GTask, and that @source_object is its
30010 * source object (or that @source_object is %NULL and @result has no
30011 * source object). This can be used in g_return_if_fail() checks.
30013 * Returns: %TRUE if @result and @source_object are valid, %FALSE if not
30020 * @source_object: (allow-none) (type GObject): the #GObject that owns this task, or %NULL.
30021 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
30022 * @callback: (scope async): a #GAsyncReadyCallback.
30023 * @callback_data: (closure): user data passed to @callback.
30025 * Creates a #GTask acting on @source_object, which will eventually be
30026 * used to invoke @callback in the current <link
30027 * linkend="g-main-context-push-thread-default">thread-default main
30030 * Call this in the "start" method of your asynchronous method, and
30031 * pass the #GTask around throughout the asynchronous operation. You
30032 * can use g_task_set_task_data() to attach task-specific data to the
30033 * object, which you can retrieve later via g_task_get_task_data().
30035 * By default, if @cancellable is cancelled, then the return value of
30036 * the task will always be %G_IO_ERROR_CANCELLED, even if the task had
30037 * already completed before the cancellation. This allows for
30038 * simplified handling in cases where cancellation may imply that
30039 * other objects that the task depends on have been destroyed. If you
30040 * do not want this behavior, you can use
30041 * g_task_set_check_cancellable() to change it.
30043 * Returns: a #GTask.
30049 * g_task_propagate_boolean:
30051 * @error: return location for a #GError
30053 * Gets the result of @task as a #gboolean.
30055 * If the task resulted in an error, or was cancelled, then this will
30056 * instead return %FALSE and set @error.
30058 * Since this method transfers ownership of the return value (or
30059 * error) to the caller, you may only call it once.
30061 * Returns: the task result, or %FALSE on error
30067 * g_task_propagate_int:
30069 * @error: return location for a #GError
30071 * Gets the result of @task as an integer (#gssize).
30073 * If the task resulted in an error, or was cancelled, then this will
30074 * instead return -1 and set @error.
30076 * Since this method transfers ownership of the return value (or
30077 * error) to the caller, you may only call it once.
30079 * Returns: the task result, or -1 on error
30085 * g_task_propagate_pointer:
30087 * @error: return location for a #GError
30089 * Gets the result of @task as a pointer, and transfers ownership
30090 * of that value to the caller.
30092 * If the task resulted in an error, or was cancelled, then this will
30093 * instead return %NULL and set @error.
30095 * Since this method transfers ownership of the return value (or
30096 * error) to the caller, you may only call it once.
30098 * Returns: (transfer full): the task result, or %NULL on error
30104 * g_task_report_error:
30105 * @source_object: (allow-none) (type GObject): the #GObject that owns this task, or %NULL.
30106 * @callback: (scope async): a #GAsyncReadyCallback.
30107 * @callback_data: (closure): user data passed to @callback.
30108 * @source_tag: an opaque pointer indicating the source of this task
30109 * @error: (transfer full): error to report
30111 * Creates a #GTask and then immediately calls g_task_return_error()
30112 * on it. Use this in the wrapper function of an asynchronous method
30113 * when you want to avoid even calling the virtual method. You can
30114 * then use g_async_result_is_tagged() in the finish method wrapper to
30115 * check if the result there is tagged as having been created by the
30116 * wrapper method, and deal with it appropriately if so.
30118 * See also g_task_report_new_error().
30125 * g_task_report_new_error:
30126 * @source_object: (allow-none) (type GObject): the #GObject that owns this task, or %NULL.
30127 * @callback: (scope async): a #GAsyncReadyCallback.
30128 * @callback_data: (closure): user data passed to @callback.
30129 * @source_tag: an opaque pointer indicating the source of this task
30130 * @domain: a #GQuark.
30131 * @code: an error code.
30132 * @format: a string with format characters.
30133 * @...: a list of values to insert into @format.
30135 * Creates a #GTask and then immediately calls
30136 * g_task_return_new_error() on it. Use this in the wrapper function
30137 * of an asynchronous method when you want to avoid even calling the
30138 * virtual method. You can then use g_async_result_is_tagged() in the
30139 * finish method wrapper to check if the result there is tagged as
30140 * having been created by the wrapper method, and deal with it
30141 * appropriately if so.
30143 * See also g_task_report_error().
30150 * g_task_return_boolean:
30152 * @result: the #gboolean result of a task function.
30154 * Sets @task's result to @result and completes the task (see
30155 * g_task_return_pointer() for more discussion of exactly what this
30163 * g_task_return_error:
30165 * @error: (transfer full): the #GError result of a task function.
30167 * Sets @task's result to @error (which @task assumes ownership of)
30168 * and completes the task (see g_task_return_pointer() for more
30169 * discussion of exactly what this means).
30171 * Note that since the task takes ownership of @error, and since the
30172 * task may be completed before returning from g_task_return_error(),
30173 * you cannot assume that @error is still valid after calling this.
30174 * Call g_error_copy() on the error if you need to keep a local copy
30177 * See also g_task_return_new_error().
30184 * g_task_return_error_if_cancelled:
30187 * Checks if @task's #GCancellable has been cancelled, and if so, sets
30188 * @task's error accordingly and completes the task (see
30189 * g_task_return_pointer() for more discussion of exactly what this
30192 * Returns: %TRUE if @task has been cancelled, %FALSE if not
30198 * g_task_return_int:
30200 * @result: the integer (#gssize) result of a task function.
30202 * Sets @task's result to @result and completes the task (see
30203 * g_task_return_pointer() for more discussion of exactly what this
30211 * g_task_return_new_error:
30213 * @domain: a #GQuark.
30214 * @code: an error code.
30215 * @format: a string with format characters.
30216 * @...: a list of values to insert into @format.
30218 * Sets @task's result to a new #GError created from @domain, @code,
30219 * @format, and the remaining arguments, and completes the task (see
30220 * g_task_return_pointer() for more discussion of exactly what this
30223 * See also g_task_return_error().
30230 * g_task_return_pointer:
30232 * @result: (allow-none) (transfer full): the pointer result of a task function
30233 * @result_destroy: (allow-none): a #GDestroyNotify function.
30235 * Sets @task's result to @result and completes the task. If @result
30236 * is not %NULL, then @result_destroy will be used to free @result if
30237 * the caller does not take ownership of it with
30238 * g_task_propagate_pointer().
30240 * "Completes the task" means that for an ordinary asynchronous task
30241 * it will either invoke the task's callback, or else queue that
30242 * callback to be invoked in the proper #GMainContext, or in the next
30243 * iteration of the current #GMainContext. For a task run via
30244 * g_task_run_in_thread() or g_task_run_in_thread_sync(), calling this
30245 * method will save @result to be returned to the caller later, but
30246 * the task will not actually be completed until the #GTaskThreadFunc
30249 * Note that since the task may be completed before returning from
30250 * g_task_return_pointer(), you cannot assume that @result is still
30251 * valid after calling this, unless you are still holding another
30259 * g_task_run_in_thread:
30261 * @task_func: a #GTaskThreadFunc
30263 * Runs @task_func in another thread. When @task_func returns, @task's
30264 * #GAsyncReadyCallback will be invoked in @task's #GMainContext.
30266 * This takes a ref on @task until the task completes.
30268 * See #GTaskThreadFunc for more details about how @task_func is handled.
30275 * g_task_run_in_thread_sync:
30277 * @task_func: a #GTaskThreadFunc
30279 * Runs @task_func in another thread, and waits for it to return or be
30280 * cancelled. You can use g_task_propagate_pointer(), etc, afterward
30281 * to get the result of @task_func.
30283 * See #GTaskThreadFunc for more details about how @task_func is handled.
30285 * Normally this is used with tasks created with a %NULL
30286 * <literal>callback</literal>, but note that even if the task does
30287 * have a callback, it will not be invoked when @task_func returns.
30294 * g_task_set_check_cancellable:
30295 * @task: the #GTask
30296 * @check_cancellable: whether #GTask will check the state of its #GCancellable for you.
30298 * Sets or clears @task's check-cancellable flag. If this is %TRUE
30299 * (the default), then g_task_propagate_pointer(), etc, and
30300 * g_task_had_error() will check the task's #GCancellable first, and
30301 * if it has been cancelled, then they will consider the task to have
30302 * returned an "Operation was cancelled" error
30303 * (%G_IO_ERROR_CANCELLED), regardless of any other error or return
30304 * value the task may have had.
30306 * If @check_cancellable is %FALSE, then the #GTask will not check the
30307 * cancellable itself, and it is up to @task's owner to do this (eg,
30308 * via g_task_return_error_if_cancelled()).
30310 * If you are using g_task_set_return_on_cancel() as well, then
30311 * you must leave check-cancellable set %TRUE.
30318 * g_task_set_priority:
30319 * @task: the #GTask
30320 * @priority: the <link linkend="io-priority">priority</link> of the request.
30322 * Sets @task's priority. If you do not call this, it will default to
30323 * %G_PRIORITY_DEFAULT.
30325 * This will affect the priority of #GSources created with
30326 * g_task_attach_source() and the scheduling of tasks run in threads,
30327 * and can also be explicitly retrieved later via
30328 * g_task_get_priority().
30335 * g_task_set_return_on_cancel:
30336 * @task: the #GTask
30337 * @return_on_cancel: whether the task returns automatically when it is cancelled.
30339 * Sets or clears @task's return-on-cancel flag. This is only
30340 * meaningful for tasks run via g_task_run_in_thread() or
30341 * g_task_run_in_thread_sync().
30343 * If @return_on_cancel is %TRUE, then cancelling @task's
30344 * #GCancellable will immediately cause it to return, as though the
30345 * task's #GTaskThreadFunc had called
30346 * g_task_return_error_if_cancelled() and then returned.
30348 * This allows you to create a cancellable wrapper around an
30349 * uninterruptable function. The #GTaskThreadFunc just needs to be
30350 * careful that it does not modify any externally-visible state after
30351 * it has been cancelled. To do that, the thread should call
30352 * g_task_set_return_on_cancel() again to (atomically) set
30353 * return-on-cancel %FALSE before making externally-visible changes;
30354 * if the task gets cancelled before the return-on-cancel flag could
30355 * be changed, g_task_set_return_on_cancel() will indicate this by
30356 * returning %FALSE.
30358 * You can disable and re-enable this flag multiple times if you wish.
30359 * If the task's #GCancellable is cancelled while return-on-cancel is
30360 * %FALSE, then calling g_task_set_return_on_cancel() to set it %TRUE
30361 * again will cause the task to be cancelled at that point.
30363 * If the task's #GCancellable is already cancelled before you call
30364 * g_task_run_in_thread()/g_task_run_in_thread_sync(), then the
30365 * #GTaskThreadFunc will still be run (for consistency), but the task
30366 * will also be completed right away.
30368 * Returns: %TRUE if @task's return-on-cancel flag was changed to match @return_on_cancel. %FALSE if @task has already been cancelled.
30374 * g_task_set_source_tag:
30375 * @task: the #GTask
30376 * @source_tag: an opaque pointer indicating the source of this task
30378 * Sets @task's source tag. You can use this to tag a task return
30379 * value with a particular pointer (usually a pointer to the function
30380 * doing the tagging) and then later check it using
30381 * g_task_get_source_tag() (or g_async_result_is_tagged()) in the
30382 * task's "finish" function, to figure out if the response came from a
30383 * particular place.
30390 * g_task_set_task_data:
30391 * @task: the #GTask
30392 * @task_data: (allow-none): task-specific data
30393 * @task_data_destroy: (allow-none): #GDestroyNotify for @task_data
30395 * Sets @task's task data (freeing the existing task data, if any).
30402 * g_tcp_connection_get_graceful_disconnect:
30403 * @connection: a #GTcpConnection
30405 * Checks if graceful disconnects are used. See
30406 * g_tcp_connection_set_graceful_disconnect().
30408 * Returns: %TRUE if graceful disconnect is used on close, %FALSE otherwise
30414 * g_tcp_connection_set_graceful_disconnect:
30415 * @connection: a #GTcpConnection
30416 * @graceful_disconnect: Whether to do graceful disconnects or not
30418 * This enabled graceful disconnects on close. A graceful disconnect
30419 * means that we signal the receiving end that the connection is terminated
30420 * and wait for it to close the connection before closing the connection.
30422 * A graceful disconnect means that we can be sure that we successfully sent
30423 * all the outstanding data to the other end, or get an error reported.
30424 * However, it also means we have to wait for all the data to reach the
30425 * other side and for it to acknowledge this by closing the socket, which may
30426 * take a while. For this reason it is disabled by default.
30433 * g_tcp_wrapper_connection_get_base_io_stream:
30434 * @conn: a #GTcpWrapperConnection
30436 * Get's @conn's base #GIOStream
30438 * Returns: (transfer none): @conn's base #GIOStream
30443 * g_tcp_wrapper_connection_new:
30444 * @base_io_stream: the #GIOStream to wrap
30445 * @socket: the #GSocket associated with @base_io_stream
30447 * Wraps @base_io_stream and @socket together as a #GSocketConnection.
30449 * Returns: the new #GSocketConnection.
30455 * g_test_dbus_add_service_dir:
30456 * @self: a #GTestDBus
30457 * @path: path to a directory containing .service files
30459 * Add a path where dbus-daemon will lookup for .services files. This can't be
30460 * called after g_test_dbus_up().
30465 * g_test_dbus_down:
30466 * @self: a #GTestDBus
30468 * Stop the session bus started by g_test_dbus_up().
30470 * This will wait for the singleton returned by g_bus_get() or g_bus_get_sync()
30471 * is destroyed. This is done to ensure that the next unit test won't get a
30472 * leaked singleton from this test.
30477 * g_test_dbus_get_bus_address:
30478 * @self: a #GTestDBus
30480 * Get the address on which dbus-daemon is running. if g_test_dbus_up() has not
30481 * been called yet, %NULL is returned. This can be used with
30482 * g_dbus_connection_new_for_address()
30484 * Returns: the address of the bus, or %NULL.
30489 * g_test_dbus_get_flags:
30490 * @self: a #GTestDBus
30492 * Gets the flags of the #GTestDBus object.
30494 * Returns: the value of #GTestDBus:flags property
30500 * @flags: a #GTestDBusFlags
30502 * Create a new #GTestDBus object.
30504 * Returns: (transfer full): a new #GTestDBus.
30509 * g_test_dbus_stop:
30510 * @self: a #GTestDBus
30512 * Stop the session bus started by g_test_dbus_up().
30514 * Unlike g_test_dbus_down(), this won't verify the #GDBusConnection
30515 * singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit
30516 * tests wanting to verify behaviour after the session bus has been stopped
30517 * can use this function but should still call g_test_dbus_down() when done.
30522 * g_test_dbus_unset:
30524 * Unset DISPLAY and DBUS_SESSION_BUS_ADDRESS env variables to ensure the test
30525 * won't use user's session bus.
30527 * This is useful for unit tests that want to verify behaviour when no session
30528 * bus is running. It is not necessary to call this if unit test already calls
30529 * g_test_dbus_up() before acquiring the session bus.
30535 * @self: a #GTestDBus
30537 * Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this
30538 * call, it is safe for unit tests to start sending messages on the session bus.
30540 * If this function is called from setup callback of g_test_add(),
30541 * g_test_dbus_down() must be called in its teardown callback.
30543 * If this function is called from unit test's main(), then g_test_dbus_down()
30544 * must be called after g_test_run().
30549 * g_themed_icon_append_name:
30550 * @icon: a #GThemedIcon
30551 * @iconname: name of icon to append to list of icons from within @icon.
30553 * Append a name to the list of icons from within @icon.
30556 * Note that doing so invalidates the hash computed by prior calls
30557 * to g_icon_hash().
30563 * g_themed_icon_get_names:
30564 * @icon: a #GThemedIcon.
30566 * Gets the names of icons from within @icon.
30568 * Returns: (transfer none): a list of icon names.
30573 * g_themed_icon_new:
30574 * @iconname: a string containing an icon name.
30576 * Creates a new themed icon for @iconname.
30578 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30583 * g_themed_icon_new_from_names:
30584 * @iconnames: (array length=len): an array of strings containing icon names.
30585 * @len: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
30587 * Creates a new themed icon for @iconnames.
30589 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon
30594 * g_themed_icon_new_with_default_fallbacks:
30595 * @iconname: a string containing an icon name
30597 * Creates a new themed icon for @iconname, and all the names
30598 * that can be created by shortening @iconname at '-' characters.
30600 * In the following example, @icon1 and @icon2 are equivalent:
30602 * const char *names[] = {
30603 * "gnome-dev-cdrom-audio",
30604 * "gnome-dev-cdrom",
30609 * icon1 = g_themed_icon_new_from_names (names, 4);
30610 * icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
30613 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30618 * g_themed_icon_prepend_name:
30619 * @icon: a #GThemedIcon
30620 * @iconname: name of icon to prepend to list of icons from within @icon.
30622 * Prepend a name to the list of icons from within @icon.
30625 * Note that doing so invalidates the hash computed by prior calls
30626 * to g_icon_hash().
30634 * g_threaded_socket_service_new:
30635 * @max_threads: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
30637 * Creates a new #GThreadedSocketService with no listeners. Listeners
30638 * must be added with one of the #GSocketListener "add" methods.
30640 * Returns: a new #GSocketService.
30646 * g_tls_backend_get_certificate_type:
30647 * @backend: the #GTlsBackend
30649 * Gets the #GType of @backend's #GTlsCertificate implementation.
30651 * Returns: the #GType of @backend's #GTlsCertificate implementation.
30657 * g_tls_backend_get_client_connection_type:
30658 * @backend: the #GTlsBackend
30660 * Gets the #GType of @backend's #GTlsClientConnection implementation.
30662 * Returns: the #GType of @backend's #GTlsClientConnection implementation.
30668 * g_tls_backend_get_default:
30670 * Gets the default #GTlsBackend for the system.
30672 * Returns: (transfer none): a #GTlsBackend
30678 * g_tls_backend_get_default_database:
30679 * @backend: the #GTlsBackend
30681 * Gets the default #GTlsDatabase used to verify TLS connections.
30683 * Returns: (transfer full): the default database, which should be unreffed when done.
30689 * g_tls_backend_get_file_database_type:
30690 * @backend: the #GTlsBackend
30692 * Gets the #GType of @backend's #GTlsFileDatabase implementation.
30694 * Returns: the #GType of backend's #GTlsFileDatabase implementation.
30700 * g_tls_backend_get_server_connection_type:
30701 * @backend: the #GTlsBackend
30703 * Gets the #GType of @backend's #GTlsServerConnection implementation.
30705 * Returns: the #GType of @backend's #GTlsServerConnection implementation.
30711 * g_tls_backend_supports_tls:
30712 * @backend: the #GTlsBackend
30714 * Checks if TLS is supported; if this returns %FALSE for the default
30715 * #GTlsBackend, it means no "real" TLS backend is available.
30717 * Returns: whether or not TLS is supported
30723 * g_tls_certificate_get_issuer:
30724 * @cert: a #GTlsCertificate
30726 * Gets the #GTlsCertificate representing @cert's issuer, if known
30728 * Returns: (transfer none): The certificate of @cert's issuer, or %NULL if @cert is self-signed or signed with an unknown certificate.
30734 * g_tls_certificate_is_same:
30735 * @cert_one: first certificate to compare
30736 * @cert_two: second certificate to compare
30738 * Check if two #GTlsCertificate objects represent the same certificate.
30739 * The raw DER byte data of the two certificates are checked for equality.
30740 * This has the effect that two certificates may compare equal even if
30741 * their #GTlsCertificate:issuer, #GTlsCertificate:private-key, or
30742 * #GTlsCertificate:private-key-pem properties differ.
30744 * Returns: whether the same or not
30750 * g_tls_certificate_list_new_from_file:
30751 * @file: file containing PEM-encoded certificates to import
30752 * @error: #GError for error reporting, or %NULL to ignore.
30754 * Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
30755 * data in @file. If @file cannot be read or parsed, the function will
30756 * return %NULL and set @error. If @file does not contain any
30757 * PEM-encoded certificates, this will return an empty list and not
30760 * 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.
30766 * g_tls_certificate_new_from_file:
30767 * @file: file containing a PEM-encoded certificate to import
30768 * @error: #GError for error reporting, or %NULL to ignore.
30770 * Creates a #GTlsCertificate from the PEM-encoded data in @file. If
30771 * @file cannot be read or parsed, the function will return %NULL and
30772 * set @error. Otherwise, this behaves like
30773 * g_tls_certificate_new_from_pem().
30775 * Returns: the new certificate, or %NULL on error
30781 * g_tls_certificate_new_from_files:
30782 * @cert_file: file containing a PEM-encoded certificate to import
30783 * @key_file: file containing a PEM-encoded private key to import
30784 * @error: #GError for error reporting, or %NULL to ignore.
30786 * Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
30787 * and @key_file. If either file cannot be read or parsed, the
30788 * function will return %NULL and set @error. Otherwise, this behaves
30789 * like g_tls_certificate_new_from_pem().
30791 * Returns: the new certificate, or %NULL on error
30797 * g_tls_certificate_new_from_pem:
30798 * @data: PEM-encoded certificate data
30799 * @length: the length of @data, or -1 if it's 0-terminated.
30800 * @error: #GError for error reporting, or %NULL to ignore.
30802 * Creates a new #GTlsCertificate from the PEM-encoded data in @data.
30803 * If @data includes both a certificate and a private key, then the
30804 * returned certificate will include the private key data as well. (See
30805 * the #GTlsCertificate:private-key-pem property for information about
30806 * supported formats.)
30808 * If @data includes multiple certificates, only the first one will be
30811 * Returns: the new certificate, or %NULL if @data is invalid
30817 * g_tls_certificate_verify:
30818 * @cert: a #GTlsCertificate
30819 * @identity: (allow-none): the expected peer identity
30820 * @trusted_ca: (allow-none): the certificate of a trusted authority
30822 * This verifies @cert and returns a set of #GTlsCertificateFlags
30823 * indicating any problems found with it. This can be used to verify a
30824 * certificate outside the context of making a connection, or to
30825 * check a certificate against a CA that is not part of the system
30828 * If @identity is not %NULL, @cert's name(s) will be compared against
30829 * it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
30830 * value if it does not match. If @identity is %NULL, that bit will
30831 * never be set in the return value.
30833 * If @trusted_ca is not %NULL, then @cert (or one of the certificates
30834 * in its chain) must be signed by it, or else
30835 * %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
30836 * @trusted_ca is %NULL, that bit will never be set in the return
30839 * (All other #GTlsCertificateFlags values will always be set or unset
30842 * Returns: the appropriate #GTlsCertificateFlags
30848 * g_tls_client_connection_get_accepted_cas:
30849 * @conn: the #GTlsClientConnection
30851 * Gets the list of distinguished names of the Certificate Authorities
30852 * that the server will accept certificates from. This will be set
30853 * during the TLS handshake if the server requests a certificate.
30854 * Otherwise, it will be %NULL.
30856 * Each item in the list is a #GByteArray which contains the complete
30857 * subject DN of the certificate authority.
30859 * 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().
30865 * g_tls_client_connection_get_server_identity:
30866 * @conn: the #GTlsClientConnection
30868 * Gets @conn's expected server identity
30870 * Returns: (transfer none): a #GSocketConnectable describing the expected server identity, or %NULL if the expected identity is not known.
30876 * g_tls_client_connection_get_use_ssl3:
30877 * @conn: the #GTlsClientConnection
30879 * Gets whether @conn will use SSL 3.0 rather than the
30880 * highest-supported version of TLS; see
30881 * g_tls_client_connection_set_use_ssl3().
30883 * Returns: whether @conn will use SSL 3.0
30889 * g_tls_client_connection_get_validation_flags:
30890 * @conn: the #GTlsClientConnection
30892 * Gets @conn's validation flags
30894 * Returns: the validation flags
30900 * g_tls_client_connection_new:
30901 * @base_io_stream: the #GIOStream to wrap
30902 * @server_identity: (allow-none): the expected identity of the server
30903 * @error: #GError for error reporting, or %NULL to ignore.
30905 * Creates a new #GTlsClientConnection wrapping @base_io_stream (which
30906 * must have pollable input and output streams) which is assumed to
30907 * communicate with the server identified by @server_identity.
30909 * Returns: (transfer full) (type GTlsClientConnection): the new #GTlsClientConnection, or %NULL on error
30915 * g_tls_client_connection_set_server_identity:
30916 * @conn: the #GTlsClientConnection
30917 * @identity: a #GSocketConnectable describing the expected server identity
30919 * Sets @conn's expected server identity, which is used both to tell
30920 * servers on virtual hosts which certificate to present, and also
30921 * to let @conn know what name to look for in the certificate when
30922 * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
30929 * g_tls_client_connection_set_use_ssl3:
30930 * @conn: the #GTlsClientConnection
30931 * @use_ssl3: whether to use SSL 3.0
30933 * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
30934 * trying to properly negotiate the right version of TLS or SSL to use.
30935 * This can be used when talking to servers that do not implement the
30936 * fallbacks correctly and which will therefore fail to handshake with
30937 * a "modern" TLS handshake attempt.
30944 * g_tls_client_connection_set_validation_flags:
30945 * @conn: the #GTlsClientConnection
30946 * @flags: the #GTlsCertificateFlags to use
30948 * Sets @conn's validation flags, to override the default set of
30949 * checks performed when validating a server certificate. By default,
30950 * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
30957 * g_tls_connection_emit_accept_certificate:
30958 * @conn: a #GTlsConnection
30959 * @peer_cert: the peer's #GTlsCertificate
30960 * @errors: the problems with @peer_cert
30962 * Used by #GTlsConnection implementations to emit the
30963 * #GTlsConnection::accept-certificate signal.
30965 * Returns: %TRUE if one of the signal handlers has returned %TRUE to accept @peer_cert
30971 * g_tls_connection_get_certificate:
30972 * @conn: a #GTlsConnection
30974 * Gets @conn's certificate, as set by
30975 * g_tls_connection_set_certificate().
30977 * Returns: (transfer none): @conn's certificate, or %NULL
30983 * g_tls_connection_get_database:
30984 * @conn: a #GTlsConnection
30986 * Gets the certificate database that @conn uses to verify
30987 * peer certificates. See g_tls_connection_set_database().
30989 * Returns: (transfer none): the certificate database that @conn uses or %NULL
30995 * g_tls_connection_get_interaction:
30996 * @conn: a connection
30998 * Get the object that will be used to interact with the user. It will be used
30999 * for things like prompting the user for passwords. If %NULL is returned, then
31000 * no user interaction will occur for this connection.
31002 * Returns: (transfer none): The interaction object.
31008 * g_tls_connection_get_peer_certificate:
31009 * @conn: a #GTlsConnection
31011 * Gets @conn's peer's certificate after the handshake has completed.
31012 * (It is not set during the emission of
31013 * #GTlsConnection::accept-certificate.)
31015 * Returns: (transfer none): @conn's peer's certificate, or %NULL
31021 * g_tls_connection_get_peer_certificate_errors:
31022 * @conn: a #GTlsConnection
31024 * Gets the errors associated with validating @conn's peer's
31025 * certificate, after the handshake has completed. (It is not set
31026 * during the emission of #GTlsConnection::accept-certificate.)
31028 * Returns: @conn's peer's certificate errors
31034 * g_tls_connection_get_rehandshake_mode:
31035 * @conn: a #GTlsConnection
31037 * Gets @conn rehandshaking mode. See
31038 * g_tls_connection_set_rehandshake_mode() for details.
31040 * Returns: @conn's rehandshaking mode
31046 * g_tls_connection_get_require_close_notify:
31047 * @conn: a #GTlsConnection
31049 * Tests whether or not @conn expects a proper TLS close notification
31050 * when the connection is closed. See
31051 * g_tls_connection_set_require_close_notify() for details.
31053 * Returns: %TRUE if @conn requires a proper TLS close notification.
31059 * g_tls_connection_get_use_system_certdb:
31060 * @conn: a #GTlsConnection
31062 * Gets whether @conn uses the system certificate database to verify
31063 * peer certificates. See g_tls_connection_set_use_system_certdb().
31065 * Returns: whether @conn uses the system certificate database
31066 * Deprecated: 2.30: Use g_tls_connection_get_database() instead
31071 * g_tls_connection_handshake:
31072 * @conn: a #GTlsConnection
31073 * @cancellable: (allow-none): a #GCancellable, or %NULL
31074 * @error: a #GError, or %NULL
31076 * Attempts a TLS handshake on @conn.
31078 * On the client side, it is never necessary to call this method;
31079 * although the connection needs to perform a handshake after
31080 * connecting (or after sending a "STARTTLS"-type command) and may
31081 * need to rehandshake later if the server requests it,
31082 * #GTlsConnection will handle this for you automatically when you try
31083 * to send or receive data on the connection. However, you can call
31084 * g_tls_connection_handshake() manually if you want to know for sure
31085 * whether the initial handshake succeeded or failed (as opposed to
31086 * just immediately trying to write to @conn's output stream, in which
31087 * case if it fails, it may not be possible to tell if it failed
31088 * before or after completing the handshake).
31090 * Likewise, on the server side, although a handshake is necessary at
31091 * the beginning of the communication, you do not need to call this
31092 * function explicitly unless you want clearer error reporting.
31093 * However, you may call g_tls_connection_handshake() later on to
31094 * renegotiate parameters (encryption methods, etc) with the client.
31096 * #GTlsConnection::accept_certificate may be emitted during the
31099 * Returns: success or failure
31105 * g_tls_connection_handshake_async:
31106 * @conn: a #GTlsConnection
31107 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
31108 * @cancellable: (allow-none): a #GCancellable, or %NULL
31109 * @callback: callback to call when the handshake is complete
31110 * @user_data: the data to pass to the callback function
31112 * Asynchronously performs a TLS handshake on @conn. See
31113 * g_tls_connection_handshake() for more information.
31120 * g_tls_connection_handshake_finish:
31121 * @conn: a #GTlsConnection
31122 * @result: a #GAsyncResult.
31123 * @error: a #GError pointer, or %NULL
31125 * Finish an asynchronous TLS handshake operation. See
31126 * g_tls_connection_handshake() for more information.
31128 * Returns: %TRUE on success, %FALSE on failure, in which case @error will be set.
31134 * g_tls_connection_set_certificate:
31135 * @conn: a #GTlsConnection
31136 * @certificate: the certificate to use for @conn
31138 * This sets the certificate that @conn will present to its peer
31139 * during the TLS handshake. For a #GTlsServerConnection, it is
31140 * mandatory to set this, and that will normally be done at construct
31143 * For a #GTlsClientConnection, this is optional. If a handshake fails
31144 * with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
31145 * requires a certificate, and if you try connecting again, you should
31146 * call this method first. You can call
31147 * g_tls_client_connection_get_accepted_cas() on the failed connection
31148 * to get a list of Certificate Authorities that the server will
31149 * accept certificates from.
31151 * (It is also possible that a server will allow the connection with
31152 * or without a certificate; in that case, if you don't provide a
31153 * certificate, you can tell that the server requested one by the fact
31154 * that g_tls_client_connection_get_accepted_cas() will return
31162 * g_tls_connection_set_database:
31163 * @conn: a #GTlsConnection
31164 * @database: a #GTlsDatabase
31166 * Sets the certificate database that is used to verify peer certificates.
31167 * This is set to the default database by default. See
31168 * g_tls_backend_get_default_database(). If set to %NULL, then
31169 * peer certificate validation will always set the
31170 * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
31171 * #GTlsConnection::accept-certificate will always be emitted on
31172 * client-side connections, unless that bit is not set in
31173 * #GTlsClientConnection:validation-flags).
31180 * g_tls_connection_set_interaction:
31181 * @conn: a connection
31182 * @interaction: (allow-none): an interaction object, or %NULL
31184 * Set the object that will be used to interact with the user. It will be used
31185 * for things like prompting the user for passwords.
31187 * The @interaction argument will normally be a derived subclass of
31188 * #GTlsInteraction. %NULL can also be provided if no user interaction
31189 * should occur for this connection.
31196 * g_tls_connection_set_rehandshake_mode:
31197 * @conn: a #GTlsConnection
31198 * @mode: the rehandshaking mode
31200 * Sets how @conn behaves with respect to rehandshaking requests.
31202 * %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
31203 * rehandshake after the initial handshake is complete. (For a client,
31204 * this means it will refuse rehandshake requests from the server, and
31205 * for a server, this means it will close the connection with an error
31206 * if the client attempts to rehandshake.)
31208 * %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
31209 * rehandshake only if the other end of the connection supports the
31210 * TLS <literal>renegotiation_info</literal> extension. This is the
31211 * default behavior, but means that rehandshaking will not work
31212 * against older implementations that do not support that extension.
31214 * %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
31215 * rehandshaking even without the
31216 * <literal>renegotiation_info</literal> extension. On the server side
31217 * in particular, this is not recommended, since it leaves the server
31218 * open to certain attacks. However, this mode is necessary if you
31219 * need to allow renegotiation with older client software.
31226 * g_tls_connection_set_require_close_notify:
31227 * @conn: a #GTlsConnection
31228 * @require_close_notify: whether or not to require close notification
31230 * Sets whether or not @conn expects a proper TLS close notification
31231 * before the connection is closed. If this is %TRUE (the default),
31232 * then @conn will expect to receive a TLS close notification from its
31233 * peer before the connection is closed, and will return a
31234 * %G_TLS_ERROR_EOF error if the connection is closed without proper
31235 * notification (since this may indicate a network error, or
31236 * man-in-the-middle attack).
31238 * In some protocols, the application will know whether or not the
31239 * connection was closed cleanly based on application-level data
31240 * (because the application-level data includes a length field, or is
31241 * somehow self-delimiting); in this case, the close notify is
31242 * redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
31243 * in TLS 1.0 it is technically an error, but often done anyway.) You
31244 * can use g_tls_connection_set_require_close_notify() to tell @conn
31245 * to allow an "unannounced" connection close, in which case the close
31246 * will show up as a 0-length read, as in a non-TLS
31247 * #GSocketConnection, and it is up to the application to check that
31248 * the data has been fully received.
31250 * Note that this only affects the behavior when the peer closes the
31251 * connection; when the application calls g_io_stream_close() itself
31252 * on @conn, this will send a close notification regardless of the
31253 * setting of this property. If you explicitly want to do an unclean
31254 * close, you can close @conn's #GTlsConnection:base-io-stream rather
31255 * than closing @conn itself.
31262 * g_tls_connection_set_use_system_certdb:
31263 * @conn: a #GTlsConnection
31264 * @use_system_certdb: whether to use the system certificate database
31266 * Sets whether @conn uses the system certificate database to verify
31267 * peer certificates. This is %TRUE by default. If set to %FALSE, then
31268 * peer certificate validation will always set the
31269 * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
31270 * #GTlsConnection::accept-certificate will always be emitted on
31271 * client-side connections, unless that bit is not set in
31272 * #GTlsClientConnection:validation-flags).
31274 * Deprecated: 2.30: Use g_tls_connection_set_database() instead
31279 * g_tls_database_create_certificate_handle:
31280 * @self: a #GTlsDatabase
31281 * @certificate: certificate for which to create a handle.
31283 * Create a handle string for the certificate. The database will only be able
31284 * to create a handle for certificates that originate from the database. In
31285 * cases where the database cannot create a handle for a certificate, %NULL
31286 * will be returned.
31288 * This handle should be stable across various instances of the application,
31289 * and between applications. If a certificate is modified in the database,
31290 * then it is not guaranteed that this handle will continue to point to it.
31292 * Returns: (allow-none): a newly allocated string containing the handle.
31298 * g_tls_database_lookup_certificate_for_handle:
31299 * @self: a #GTlsDatabase
31300 * @handle: a certificate handle
31301 * @interaction: (allow-none): used to interact with the user if necessary
31302 * @flags: Flags which affect the lookup.
31303 * @cancellable: (allow-none): a #GCancellable, or %NULL
31304 * @error: (allow-none): a #GError, or %NULL
31306 * Lookup a certificate by its handle.
31308 * The handle should have been created by calling
31309 * g_tls_database_create_certificate_handle() on a #GTlsDatabase object of
31310 * the same TLS backend. The handle is designed to remain valid across
31311 * instantiations of the database.
31313 * If the handle is no longer valid, or does not point to a certificate in
31314 * this database, then %NULL will be returned.
31316 * This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
31317 * the lookup operation asynchronously.
31319 * Returns: (transfer full) (allow-none): a newly allocated #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31325 * g_tls_database_lookup_certificate_for_handle_async:
31326 * @self: a #GTlsDatabase
31327 * @handle: a certificate handle
31328 * @interaction: (allow-none): used to interact with the user if necessary
31329 * @flags: Flags which affect the lookup.
31330 * @cancellable: (allow-none): a #GCancellable, or %NULL
31331 * @callback: callback to call when the operation completes
31332 * @user_data: the data to pass to the callback function
31334 * Asynchronously lookup a certificate by its handle in the database. See
31335 * g_tls_database_lookup_certificate_for_handle() for more information.
31342 * g_tls_database_lookup_certificate_for_handle_finish:
31343 * @self: a #GTlsDatabase
31344 * @result: a #GAsyncResult.
31345 * @error: a #GError pointer, or %NULL
31347 * Finish an asynchronous lookup of a certificate by its handle. See
31348 * g_tls_database_lookup_certificate_handle() for more information.
31350 * If the handle is no longer valid, or does not point to a certificate in
31351 * this database, then %NULL will be returned.
31353 * Returns: (transfer full): a newly allocated #GTlsCertificate object. Use g_object_unref() to release the certificate.
31359 * g_tls_database_lookup_certificate_issuer:
31360 * @self: a #GTlsDatabase
31361 * @certificate: a #GTlsCertificate
31362 * @interaction: (allow-none): used to interact with the user if necessary
31363 * @flags: flags which affect the lookup operation
31364 * @cancellable: (allow-none): a #GCancellable, or %NULL
31365 * @error: (allow-none): a #GError, or %NULL
31367 * Lookup the issuer of @certificate in the database.
31369 * The %issuer property
31370 * of @certificate is not modified, and the two certificates are not hooked
31373 * This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
31374 * the lookup operation asynchronously.
31376 * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31382 * g_tls_database_lookup_certificate_issuer_async:
31383 * @self: a #GTlsDatabase
31384 * @certificate: a #GTlsCertificate
31385 * @interaction: (allow-none): used to interact with the user if necessary
31386 * @flags: flags which affect the lookup operation
31387 * @cancellable: (allow-none): a #GCancellable, or %NULL
31388 * @callback: callback to call when the operation completes
31389 * @user_data: the data to pass to the callback function
31391 * Asynchronously lookup the issuer of @certificate in the database. See
31392 * g_tls_database_lookup_certificate_issuer() for more information.
31399 * g_tls_database_lookup_certificate_issuer_finish:
31400 * @self: a #GTlsDatabase
31401 * @result: a #GAsyncResult.
31402 * @error: a #GError pointer, or %NULL
31404 * Finish an asynchronous lookup issuer operation. See
31405 * g_tls_database_lookup_certificate_issuer() for more information.
31407 * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31413 * g_tls_database_lookup_certificates_issued_by:
31414 * @self: a #GTlsDatabase
31415 * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
31416 * @interaction: (allow-none): used to interact with the user if necessary
31417 * @flags: Flags which affect the lookup operation.
31418 * @cancellable: (allow-none): a #GCancellable, or %NULL
31419 * @error: (allow-none): a #GError, or %NULL
31421 * Lookup certificates issued by this issuer in the database.
31423 * This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
31424 * the lookup operation asynchronously.
31426 * 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.
31432 * g_tls_database_lookup_certificates_issued_by_async:
31433 * @self: a #GTlsDatabase
31434 * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
31435 * @interaction: (allow-none): used to interact with the user if necessary
31436 * @flags: Flags which affect the lookup operation.
31437 * @cancellable: (allow-none): a #GCancellable, or %NULL
31438 * @callback: callback to call when the operation completes
31439 * @user_data: the data to pass to the callback function
31441 * Asynchronously lookup certificates issued by this issuer in the database. See
31442 * g_tls_database_lookup_certificates_issued_by() for more information.
31444 * The database may choose to hold a reference to the issuer byte array for the duration
31445 * of of this asynchronous operation. The byte array should not be modified during
31453 * g_tls_database_lookup_certificates_issued_by_finish:
31454 * @self: a #GTlsDatabase
31455 * @result: a #GAsyncResult.
31456 * @error: a #GError pointer, or %NULL
31458 * Finish an asynchronous lookup of certificates. See
31459 * g_tls_database_lookup_certificates_issued_by() for more information.
31461 * 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.
31467 * g_tls_database_verify_chain:
31468 * @self: a #GTlsDatabase
31469 * @chain: a #GTlsCertificate chain
31470 * @purpose: the purpose that this certificate chain will be used for.
31471 * @identity: (allow-none): the expected peer identity
31472 * @interaction: (allow-none): used to interact with the user if necessary
31473 * @flags: additional verify flags
31474 * @cancellable: (allow-none): a #GCancellable, or %NULL
31475 * @error: (allow-none): a #GError, or %NULL
31477 * Verify's a certificate chain after looking up and adding any missing
31478 * certificates to the chain.
31480 * @chain is a chain of #GTlsCertificate objects each pointing to the next
31481 * certificate in the chain by its %issuer property. The chain may initially
31482 * consist of one or more certificates. After the verification process is
31483 * complete, @chain may be modified by adding missing certificates, or removing
31484 * extra certificates. If a certificate anchor was found, then it is added to
31487 * @purpose describes the purpose (or usage) for which the certificate
31488 * is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
31489 * which means that the certificate is being used to authenticate a server
31490 * (and we are acting as the client).
31492 * The @identity is used to check for pinned certificates (trust exceptions)
31493 * in the database. These will override the normal verification process on a
31494 * host by host basis.
31496 * Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
31499 * This function can block, use g_tls_database_verify_chain_async() to perform
31500 * the verification operation asynchronously.
31502 * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31508 * g_tls_database_verify_chain_async:
31509 * @self: a #GTlsDatabase
31510 * @chain: a #GTlsCertificate chain
31511 * @purpose: the purpose that this certificate chain will be used for.
31512 * @identity: (allow-none): the expected peer identity
31513 * @interaction: (allow-none): used to interact with the user if necessary
31514 * @flags: additional verify flags
31515 * @cancellable: (allow-none): a #GCancellable, or %NULL
31516 * @callback: callback to call when the operation completes
31517 * @user_data: the data to pass to the callback function
31519 * Asynchronously verify's a certificate chain after looking up and adding
31520 * any missing certificates to the chain. See g_tls_database_verify_chain()
31521 * for more information.
31528 * g_tls_database_verify_chain_finish:
31529 * @self: a #GTlsDatabase
31530 * @result: a #GAsyncResult.
31531 * @error: a #GError pointer, or %NULL
31533 * Finish an asynchronous verify chain operation. See
31534 * g_tls_database_verify_chain() for more information. *
31536 * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31542 * g_tls_error_quark:
31544 * Gets the TLS error quark.
31546 * Returns: a #GQuark.
31552 * g_tls_file_database_new:
31553 * @anchors: filename of anchor certificate authorities.
31554 * @error: #GError for error reporting, or %NULL to ignore.
31556 * Creates a new #GTlsFileDatabase which uses anchor certificate authorities
31557 * in @anchors to verify certificate chains.
31559 * The certificates in @anchors must be PEM encoded.
31561 * Returns: (transfer full) (type GTlsFileDatabase): the new #GTlsFileDatabase, or %NULL on error
31567 * g_tls_interaction_ask_password:
31568 * @interaction: a #GTlsInteraction object
31569 * @password: a #GTlsPassword object
31570 * @cancellable: an optional #GCancellable cancellation object
31571 * @error: an optional location to place an error on failure
31573 * Run synchronous interaction to ask the user for a password. In general,
31574 * g_tls_interaction_invoke_ask_password() should be used instead of this
31577 * Derived subclasses usually implement a password prompt, although they may
31578 * also choose to provide a password from elsewhere. The @password value will
31579 * be filled in and then @callback will be called. Alternatively the user may
31580 * abort this password request, which will usually abort the TLS connection.
31582 * If the interaction is cancelled by the cancellation object, or by the
31583 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31584 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31585 * not support immediate cancellation.
31587 * Returns: The status of the ask password interaction.
31593 * g_tls_interaction_ask_password_async:
31594 * @interaction: a #GTlsInteraction object
31595 * @password: a #GTlsPassword object
31596 * @cancellable: an optional #GCancellable cancellation object
31597 * @callback: (allow-none): will be called when the interaction completes
31598 * @user_data: (allow-none): data to pass to the @callback
31600 * Run asynchronous interaction to ask the user for a password. In general,
31601 * g_tls_interaction_invoke_ask_password() should be used instead of this
31604 * Derived subclasses usually implement a password prompt, although they may
31605 * also choose to provide a password from elsewhere. The @password value will
31606 * be filled in and then @callback will be called. Alternatively the user may
31607 * abort this password request, which will usually abort the TLS connection.
31609 * If the interaction is cancelled by the cancellation object, or by the
31610 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31611 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31612 * not support immediate cancellation.
31614 * Certain implementations may not support immediate cancellation.
31621 * g_tls_interaction_ask_password_finish:
31622 * @interaction: a #GTlsInteraction object
31623 * @result: the result passed to the callback
31624 * @error: an optional location to place an error on failure
31626 * Complete an ask password user interaction request. This should be once
31627 * the g_tls_interaction_ask_password_async() completion callback is called.
31629 * If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
31630 * to g_tls_interaction_ask_password() will have its password filled in.
31632 * If the interaction is cancelled by the cancellation object, or by the
31633 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31634 * contains a %G_IO_ERROR_CANCELLED error code.
31636 * Returns: The status of the ask password interaction.
31642 * g_tls_interaction_invoke_ask_password:
31643 * @interaction: a #GTlsInteraction object
31644 * @password: a #GTlsPassword object
31645 * @cancellable: an optional #GCancellable cancellation object
31646 * @error: an optional location to place an error on failure
31648 * Invoke the interaction to ask the user for a password. It invokes this
31649 * interaction in the main loop, specifically the #GMainContext returned by
31650 * g_main_context_get_thread_default() when the interaction is created. This
31651 * is called by called by #GTlsConnection or #GTlsDatabase to ask the user
31654 * Derived subclasses usually implement a password prompt, although they may
31655 * also choose to provide a password from elsewhere. The @password value will
31656 * be filled in and then @callback will be called. Alternatively the user may
31657 * abort this password request, which will usually abort the TLS connection.
31659 * The implementation can either be a synchronous (eg: modal dialog) or an
31660 * asynchronous one (eg: modeless dialog). This function will take care of
31661 * calling which ever one correctly.
31663 * If the interaction is cancelled by the cancellation object, or by the
31664 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31665 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31666 * not support immediate cancellation.
31668 * Returns: The status of the ask password interaction.
31674 * g_tls_password_get_description:
31675 * @password: a #GTlsPassword object
31677 * Get a description string about what the password will be used for.
31679 * Returns: The description of the password.
31685 * g_tls_password_get_flags:
31686 * @password: a #GTlsPassword object
31688 * Get flags about the password.
31690 * Returns: The flags about the password.
31696 * g_tls_password_get_value:
31697 * @password: a #GTlsPassword object
31698 * @length: (allow-none): location to place the length of the password.
31700 * Get the password value. If @length is not %NULL then it will be
31701 * filled in with the length of the password value. (Note that the
31702 * password value is not nul-terminated, so you can only pass %NULL
31703 * for @length in contexts where you know the password will have a
31704 * certain fixed length.)
31706 * Returns: The password value (owned by the password object).
31712 * g_tls_password_get_warning:
31713 * @password: a #GTlsPassword object
31715 * Get a user readable translated warning. Usually this warning is a
31716 * representation of the password flags returned from
31717 * g_tls_password_get_flags().
31719 * Returns: The warning.
31725 * g_tls_password_new:
31726 * @flags: the password flags
31727 * @description: description of what the password is for
31729 * Create a new #GTlsPassword object.
31731 * Returns: (transfer full): The newly allocated password object
31736 * g_tls_password_set_description:
31737 * @password: a #GTlsPassword object
31738 * @description: The description of the password
31740 * Set a description string about what the password will be used for.
31747 * g_tls_password_set_flags:
31748 * @password: a #GTlsPassword object
31749 * @flags: The flags about the password
31751 * Set flags about the password.
31758 * g_tls_password_set_value:
31759 * @password: a #GTlsPassword object
31760 * @value: the new password value
31761 * @length: the length of the password, or -1
31763 * Set the value for this password. The @value will be copied by the password
31766 * Specify the @length, for a non-nul-terminated password. Pass -1 as
31767 * @length if using a nul-terminated password, and @length will be
31768 * calculated automatically. (Note that the terminating nul is not
31769 * considered part of the password in this case.)
31776 * g_tls_password_set_value_full:
31777 * @password: a #GTlsPassword object
31778 * @value: the value for the password
31779 * @length: the length of the password, or -1
31780 * @destroy: (allow-none): a function to use to free the password.
31782 * Provide the value for this password.
31784 * The @value will be owned by the password object, and later freed using
31785 * the @destroy function callback.
31787 * Specify the @length, for a non-nul-terminated password. Pass -1 as
31788 * @length if using a nul-terminated password, and @length will be
31789 * calculated automatically. (Note that the terminating nul is not
31790 * considered part of the password in this case.)
31792 * Virtual: set_value
31798 * g_tls_password_set_warning:
31799 * @password: a #GTlsPassword object
31800 * @warning: The user readable warning
31802 * Set a user readable translated warning. Usually this warning is a
31803 * representation of the password flags returned from
31804 * g_tls_password_get_flags().
31811 * g_tls_server_connection_new:
31812 * @base_io_stream: the #GIOStream to wrap
31813 * @certificate: (allow-none): the default server certificate, or %NULL
31814 * @error: #GError for error reporting, or %NULL to ignore.
31816 * Creates a new #GTlsServerConnection wrapping @base_io_stream (which
31817 * must have pollable input and output streams).
31819 * Returns: (transfer full) (type GTlsServerConnection): the new #GTlsServerConnection, or %NULL on error
31825 * g_unix_connection_receive_credentials:
31826 * @connection: A #GUnixConnection.
31827 * @cancellable: (allow-none): A #GCancellable or %NULL.
31828 * @error: Return location for error or %NULL.
31830 * Receives credentials from the sending end of the connection. The
31831 * sending end has to call g_unix_connection_send_credentials() (or
31832 * similar) for this to work.
31834 * As well as reading the credentials this also reads (and discards) a
31835 * single byte from the stream, as this is required for credentials
31836 * passing to work on some implementations.
31838 * Other ways to exchange credentials with a foreign peer includes the
31839 * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31841 * Returns: (transfer full): Received credentials on success (free with g_object_unref()), %NULL if @error is set.
31847 * g_unix_connection_receive_credentials_async:
31848 * @connection: A #GUnixConnection.
31849 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31850 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31851 * @user_data: (closure): the data to pass to callback function
31853 * Asynchronously receive credentials.
31855 * For more details, see g_unix_connection_receive_credentials() which is
31856 * the synchronous version of this call.
31858 * When the operation is finished, @callback will be called. You can then call
31859 * g_unix_connection_receive_credentials_finish() to get the result of the operation.
31866 * g_unix_connection_receive_credentials_finish:
31867 * @connection: A #GUnixConnection.
31868 * @result: a #GAsyncResult.
31869 * @error: a #GError, or %NULL
31871 * Finishes an asynchronous receive credentials operation started with
31872 * g_unix_connection_receive_credentials_async().
31874 * Returns: (transfer full): a #GCredentials, or %NULL on error. Free the returned object with g_object_unref().
31880 * g_unix_connection_receive_fd:
31881 * @connection: a #GUnixConnection
31882 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
31883 * @error: (allow-none): #GError for error reporting, or %NULL to ignore
31885 * Receives a file descriptor from the sending end of the connection.
31886 * The sending end has to call g_unix_connection_send_fd() for this
31889 * As well as reading the fd this also reads a single byte from the
31890 * stream, as this is required for fd passing to work on some
31893 * Returns: a file descriptor on success, -1 on error.
31899 * g_unix_connection_send_credentials:
31900 * @connection: A #GUnixConnection.
31901 * @cancellable: (allow-none): A #GCancellable or %NULL.
31902 * @error: Return location for error or %NULL.
31904 * Passes the credentials of the current user the receiving side
31905 * of the connection. The receiving end has to call
31906 * g_unix_connection_receive_credentials() (or similar) to accept the
31909 * As well as sending the credentials this also writes a single NUL
31910 * byte to the stream, as this is required for credentials passing to
31911 * work on some implementations.
31913 * Other ways to exchange credentials with a foreign peer includes the
31914 * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31916 * Returns: %TRUE on success, %FALSE if @error is set.
31922 * g_unix_connection_send_credentials_async:
31923 * @connection: A #GUnixConnection.
31924 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31925 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31926 * @user_data: (closure): the data to pass to callback function
31928 * Asynchronously send credentials.
31930 * For more details, see g_unix_connection_send_credentials() which is
31931 * the synchronous version of this call.
31933 * When the operation is finished, @callback will be called. You can then call
31934 * g_unix_connection_send_credentials_finish() to get the result of the operation.
31941 * g_unix_connection_send_credentials_finish:
31942 * @connection: A #GUnixConnection.
31943 * @result: a #GAsyncResult.
31944 * @error: a #GError, or %NULL
31946 * Finishes an asynchronous send credentials operation started with
31947 * g_unix_connection_send_credentials_async().
31949 * Returns: %TRUE if the operation was successful, otherwise %FALSE.
31955 * g_unix_connection_send_fd:
31956 * @connection: a #GUnixConnection
31957 * @fd: a file descriptor
31958 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31959 * @error: (allow-none): #GError for error reporting, or %NULL to ignore.
31961 * Passes a file descriptor to the receiving side of the
31962 * connection. The receiving end has to call g_unix_connection_receive_fd()
31963 * to accept the file descriptor.
31965 * As well as sending the fd this also writes a single byte to the
31966 * stream, as this is required for fd passing to work on some
31969 * Returns: a %TRUE on success, %NULL on error.
31975 * g_unix_credentials_message_get_credentials:
31976 * @message: A #GUnixCredentialsMessage.
31978 * Gets the credentials stored in @message.
31980 * Returns: (transfer none): A #GCredentials instance. Do not free, it is owned by @message.
31986 * g_unix_credentials_message_is_supported:
31988 * Checks if passing #GCredentials on a #GSocket is supported on this platform.
31990 * Returns: %TRUE if supported, %FALSE otherwise
31996 * g_unix_credentials_message_new:
31998 * Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
32000 * Returns: a new #GUnixCredentialsMessage
32006 * g_unix_credentials_message_new_with_credentials:
32007 * @credentials: A #GCredentials object.
32009 * Creates a new #GUnixCredentialsMessage holding @credentials.
32011 * Returns: a new #GUnixCredentialsMessage
32017 * g_unix_fd_list_append:
32018 * @list: a #GUnixFDList
32019 * @fd: a valid open file descriptor
32020 * @error: a #GError pointer
32022 * Adds a file descriptor to @list.
32024 * The file descriptor is duplicated using dup(). You keep your copy
32025 * of the descriptor and the copy contained in @list will be closed
32026 * when @list is finalized.
32028 * A possible cause of failure is exceeding the per-process or
32029 * system-wide file descriptor limit.
32031 * The index of the file descriptor in the list is returned. If you use
32032 * this index with g_unix_fd_list_get() then you will receive back a
32033 * duplicated copy of the same file descriptor.
32035 * Returns: the index of the appended fd in case of success, else -1 (and @error is set)
32041 * g_unix_fd_list_get:
32042 * @list: a #GUnixFDList
32043 * @index_: the index into the list
32044 * @error: a #GError pointer
32046 * Gets a file descriptor out of @list.
32048 * @index_ specifies the index of the file descriptor to get. It is a
32049 * programmer error for @index_ to be out of range; see
32050 * g_unix_fd_list_get_length().
32052 * The file descriptor is duplicated using dup() and set as
32053 * close-on-exec before being returned. You must call close() on it
32054 * when you are done.
32056 * A possible cause of failure is exceeding the per-process or
32057 * system-wide file descriptor limit.
32059 * Returns: the file descriptor, or -1 in case of error
32065 * g_unix_fd_list_get_length:
32066 * @list: a #GUnixFDList
32068 * Gets the length of @list (ie: the number of file descriptors
32069 * contained within).
32071 * Returns: the length of @list
32077 * g_unix_fd_list_new:
32079 * Creates a new #GUnixFDList containing no file descriptors.
32081 * Returns: a new #GUnixFDList
32087 * g_unix_fd_list_new_from_array:
32088 * @fds: (array length=n_fds): the initial list of file descriptors
32089 * @n_fds: the length of #fds, or -1
32091 * Creates a new #GUnixFDList containing the file descriptors given in
32092 * @fds. The file descriptors become the property of the new list and
32093 * may no longer be used by the caller. The array itself is owned by
32096 * Each file descriptor in the array should be set to close-on-exec.
32098 * If @n_fds is -1 then @fds must be terminated with -1.
32100 * Returns: a new #GUnixFDList
32106 * g_unix_fd_list_peek_fds:
32107 * @list: a #GUnixFDList
32108 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32110 * Returns the array of file descriptors that is contained in this
32113 * After this call, the descriptors remain the property of @list. The
32114 * caller must not close them and must not free the array. The array is
32115 * valid only until @list is changed in any way.
32117 * If @length is non-%NULL then it is set to the number of file
32118 * descriptors in the returned array. The returned array is also
32119 * terminated with -1.
32121 * This function never returns %NULL. In case there are no file
32122 * descriptors contained in @list, an empty array is returned.
32124 * Returns: (array length=length) (transfer none): an array of file descriptors
32130 * g_unix_fd_list_steal_fds:
32131 * @list: a #GUnixFDList
32132 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32134 * Returns the array of file descriptors that is contained in this
32137 * After this call, the descriptors are no longer contained in
32138 * @list. Further calls will return an empty list (unless more
32139 * descriptors have been added).
32141 * The return result of this function must be freed with g_free().
32142 * The caller is also responsible for closing all of the file
32143 * descriptors. The file descriptors in the array are set to
32146 * If @length is non-%NULL then it is set to the number of file
32147 * descriptors in the returned array. The returned array is also
32148 * terminated with -1.
32150 * This function never returns %NULL. In case there are no file
32151 * descriptors contained in @list, an empty array is returned.
32153 * Returns: (array length=length) (transfer full): an array of file descriptors
32159 * g_unix_fd_message_append_fd:
32160 * @message: a #GUnixFDMessage
32161 * @fd: a valid open file descriptor
32162 * @error: a #GError pointer
32164 * Adds a file descriptor to @message.
32166 * The file descriptor is duplicated using dup(). You keep your copy
32167 * of the descriptor and the copy contained in @message will be closed
32168 * when @message is finalized.
32170 * A possible cause of failure is exceeding the per-process or
32171 * system-wide file descriptor limit.
32173 * Returns: %TRUE in case of success, else %FALSE (and @error is set)
32179 * g_unix_fd_message_get_fd_list:
32180 * @message: a #GUnixFDMessage
32182 * Gets the #GUnixFDList contained in @message. This function does not
32183 * return a reference to the caller, but the returned list is valid for
32184 * the lifetime of @message.
32186 * Returns: (transfer none): the #GUnixFDList from @message
32192 * g_unix_fd_message_new:
32194 * Creates a new #GUnixFDMessage containing an empty file descriptor
32197 * Returns: a new #GUnixFDMessage
32203 * g_unix_fd_message_new_with_fd_list:
32204 * @fd_list: a #GUnixFDList
32206 * Creates a new #GUnixFDMessage containing @list.
32208 * Returns: a new #GUnixFDMessage
32214 * g_unix_fd_message_steal_fds:
32215 * @message: a #GUnixFDMessage
32216 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32218 * Returns the array of file descriptors that is contained in this
32221 * After this call, the descriptors are no longer contained in
32222 * @message. Further calls will return an empty list (unless more
32223 * descriptors have been added).
32225 * The return result of this function must be freed with g_free().
32226 * The caller is also responsible for closing all of the file
32229 * If @length is non-%NULL then it is set to the number of file
32230 * descriptors in the returned array. The returned array is also
32231 * terminated with -1.
32233 * This function never returns %NULL. In case there are no file
32234 * descriptors contained in @message, an empty array is returned.
32236 * Returns: (array length=length) (transfer full): an array of file descriptors
32242 * g_unix_input_stream_get_close_fd:
32243 * @stream: a #GUnixInputStream
32245 * Returns whether the file descriptor of @stream will be
32246 * closed when the stream is closed.
32248 * Returns: %TRUE if the file descriptor is closed when done
32254 * g_unix_input_stream_get_fd:
32255 * @stream: a #GUnixInputStream
32257 * Return the UNIX file descriptor that the stream reads from.
32259 * Returns: The file descriptor of @stream
32265 * g_unix_input_stream_new:
32266 * @fd: a UNIX file descriptor
32267 * @close_fd: %TRUE to close the file descriptor when done
32269 * Creates a new #GUnixInputStream for the given @fd.
32271 * If @close_fd is %TRUE, the file descriptor will be closed
32272 * when the stream is closed.
32274 * Returns: a new #GUnixInputStream
32279 * g_unix_input_stream_set_close_fd:
32280 * @stream: a #GUnixInputStream
32281 * @close_fd: %TRUE to close the file descriptor when done
32283 * Sets whether the file descriptor of @stream shall be closed
32284 * when the stream is closed.
32291 * g_unix_is_mount_path_system_internal:
32292 * @mount_path: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
32294 * Determines if @mount_path is considered an implementation of the
32295 * OS. This is primarily used for hiding mountable and mounted volumes
32296 * that only are used in the OS and has little to no relevance to the
32299 * Returns: %TRUE if @mount_path is considered an implementation detail of the OS.
32304 * g_unix_mount_at: (skip)
32305 * @mount_path: path for a possible unix mount.
32306 * @time_read: (out) (allow-none): guint64 to contain a timestamp.
32308 * Gets a #GUnixMountEntry for a given mount path. If @time_read
32309 * is set, it will be filled with a unix timestamp for checking
32310 * if the mounts have changed since with g_unix_mounts_changed_since().
32312 * Returns: (transfer full): a #GUnixMountEntry.
32317 * g_unix_mount_compare:
32318 * @mount1: first #GUnixMountEntry to compare.
32319 * @mount2: second #GUnixMountEntry to compare.
32321 * Compares two unix mounts.
32323 * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
32328 * g_unix_mount_free:
32329 * @mount_entry: a #GUnixMountEntry.
32331 * Frees a unix mount.
32336 * g_unix_mount_get_device_path:
32337 * @mount_entry: a #GUnixMount.
32339 * Gets the device path for a unix mount.
32341 * Returns: a string containing the device path.
32346 * g_unix_mount_get_fs_type:
32347 * @mount_entry: a #GUnixMount.
32349 * Gets the filesystem type for the unix mount.
32351 * Returns: a string containing the file system type.
32356 * g_unix_mount_get_mount_path:
32357 * @mount_entry: input #GUnixMountEntry to get the mount path for.
32359 * Gets the mount path for a unix mount.
32361 * Returns: the mount path for @mount_entry.
32366 * g_unix_mount_guess_can_eject:
32367 * @mount_entry: a #GUnixMountEntry
32369 * Guesses whether a Unix mount can be ejected.
32371 * Returns: %TRUE if @mount_entry is deemed to be ejectable.
32376 * g_unix_mount_guess_icon:
32377 * @mount_entry: a #GUnixMountEntry
32379 * Guesses the icon of a Unix mount.
32381 * Returns: (transfer full): a #GIcon
32386 * g_unix_mount_guess_name:
32387 * @mount_entry: a #GUnixMountEntry
32389 * Guesses the name of a Unix mount.
32390 * The result is a translated string.
32392 * Returns: A newly allocated string that must be freed with g_free()
32397 * g_unix_mount_guess_should_display:
32398 * @mount_entry: a #GUnixMountEntry
32400 * Guesses whether a Unix mount should be displayed in the UI.
32402 * Returns: %TRUE if @mount_entry is deemed to be displayable.
32407 * g_unix_mount_guess_symbolic_icon:
32408 * @mount_entry: a #GUnixMountEntry
32410 * Guesses the symbolic icon of a Unix mount.
32412 * Returns: (transfer full): a #GIcon
32418 * g_unix_mount_is_readonly:
32419 * @mount_entry: a #GUnixMount.
32421 * Checks if a unix mount is mounted read only.
32423 * Returns: %TRUE if @mount_entry is read only.
32428 * g_unix_mount_is_system_internal:
32429 * @mount_entry: a #GUnixMount.
32431 * Checks if a unix mount is a system path.
32433 * Returns: %TRUE if the unix mount is for a system path.
32438 * g_unix_mount_monitor_new:
32440 * Gets a new #GUnixMountMonitor. The default rate limit for which the
32441 * monitor will report consecutive changes for the mount and mount
32442 * point entry files is the default for a #GFileMonitor. Use
32443 * g_unix_mount_monitor_set_rate_limit() to change this.
32445 * Returns: a #GUnixMountMonitor.
32450 * g_unix_mount_monitor_set_rate_limit:
32451 * @mount_monitor: a #GUnixMountMonitor
32452 * @limit_msec: a integer with the limit in milliseconds to poll for changes.
32454 * Sets the rate limit to which the @mount_monitor will report
32455 * consecutive change events to the mount and mount point entry files.
32462 * g_unix_mount_point_compare:
32463 * @mount1: a #GUnixMount.
32464 * @mount2: a #GUnixMount.
32466 * Compares two unix mount points.
32468 * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
32473 * g_unix_mount_point_free:
32474 * @mount_point: unix mount point to free.
32476 * Frees a unix mount point.
32481 * g_unix_mount_point_get_device_path:
32482 * @mount_point: a #GUnixMountPoint.
32484 * Gets the device path for a unix mount point.
32486 * Returns: a string containing the device path.
32491 * g_unix_mount_point_get_fs_type:
32492 * @mount_point: a #GUnixMountPoint.
32494 * Gets the file system type for the mount point.
32496 * Returns: a string containing the file system type.
32501 * g_unix_mount_point_get_mount_path:
32502 * @mount_point: a #GUnixMountPoint.
32504 * Gets the mount path for a unix mount point.
32506 * Returns: a string containing the mount path.
32511 * g_unix_mount_point_get_options:
32512 * @mount_point: a #GUnixMountPoint.
32514 * Gets the options for the mount point.
32516 * Returns: a string containing the options.
32522 * g_unix_mount_point_guess_can_eject:
32523 * @mount_point: a #GUnixMountPoint
32525 * Guesses whether a Unix mount point can be ejected.
32527 * Returns: %TRUE if @mount_point is deemed to be ejectable.
32532 * g_unix_mount_point_guess_icon:
32533 * @mount_point: a #GUnixMountPoint
32535 * Guesses the icon of a Unix mount point.
32537 * Returns: (transfer full): a #GIcon
32542 * g_unix_mount_point_guess_name:
32543 * @mount_point: a #GUnixMountPoint
32545 * Guesses the name of a Unix mount point.
32546 * The result is a translated string.
32548 * Returns: A newly allocated string that must be freed with g_free()
32553 * g_unix_mount_point_guess_symbolic_icon:
32554 * @mount_point: a #GUnixMountPoint
32556 * Guesses the symbolic icon of a Unix mount point.
32558 * Returns: (transfer full): a #GIcon
32564 * g_unix_mount_point_is_loopback:
32565 * @mount_point: a #GUnixMountPoint.
32567 * Checks if a unix mount point is a loopback device.
32569 * Returns: %TRUE if the mount point is a loopback. %FALSE otherwise.
32574 * g_unix_mount_point_is_readonly:
32575 * @mount_point: a #GUnixMountPoint.
32577 * Checks if a unix mount point is read only.
32579 * Returns: %TRUE if a mount point is read only.
32584 * g_unix_mount_point_is_user_mountable:
32585 * @mount_point: a #GUnixMountPoint.
32587 * Checks if a unix mount point is mountable by the user.
32589 * Returns: %TRUE if the mount point is user mountable.
32594 * g_unix_mount_points_changed_since:
32595 * @time: guint64 to contain a timestamp.
32597 * Checks if the unix mount points have changed since a given unix time.
32599 * Returns: %TRUE if the mount points have changed since @time.
32604 * g_unix_mount_points_get: (skip)
32605 * @time_read: (out) (allow-none): guint64 to contain a timestamp.
32607 * Gets a #GList of #GUnixMountPoint containing the unix mount points.
32608 * If @time_read is set, it will be filled with the mount timestamp,
32609 * allowing for checking if the mounts have changed with
32610 * g_unix_mount_points_changed_since().
32612 * Returns: (element-type GUnixMountPoint) (transfer full): a #GList of the UNIX mountpoints.
32617 * g_unix_mounts_changed_since:
32618 * @time: guint64 to contain a timestamp.
32620 * Checks if the unix mounts have changed since a given unix time.
32622 * Returns: %TRUE if the mounts have changed since @time.
32627 * g_unix_mounts_get: (skip)
32628 * @time_read: (out) (allow-none): guint64 to contain a timestamp, or %NULL
32630 * Gets a #GList of #GUnixMountEntry containing the unix mounts.
32631 * If @time_read is set, it will be filled with the mount
32632 * timestamp, allowing for checking if the mounts have changed
32633 * with g_unix_mounts_changed_since().
32635 * Returns: (element-type GUnixMountEntry) (transfer full): a #GList of the UNIX mounts.
32640 * g_unix_output_stream_get_close_fd:
32641 * @stream: a #GUnixOutputStream
32643 * Returns whether the file descriptor of @stream will be
32644 * closed when the stream is closed.
32646 * Returns: %TRUE if the file descriptor is closed when done
32652 * g_unix_output_stream_get_fd:
32653 * @stream: a #GUnixOutputStream
32655 * Return the UNIX file descriptor that the stream writes to.
32657 * Returns: The file descriptor of @stream
32663 * g_unix_output_stream_new:
32664 * @fd: a UNIX file descriptor
32665 * @close_fd: %TRUE to close the file descriptor when done
32667 * Creates a new #GUnixOutputStream for the given @fd.
32669 * If @close_fd, is %TRUE, the file descriptor will be closed when
32670 * the output stream is destroyed.
32672 * Returns: a new #GOutputStream
32677 * g_unix_output_stream_set_close_fd:
32678 * @stream: a #GUnixOutputStream
32679 * @close_fd: %TRUE to close the file descriptor when done
32681 * Sets whether the file descriptor of @stream shall be closed
32682 * when the stream is closed.
32689 * g_unix_socket_address_abstract_names_supported:
32691 * Checks if abstract UNIX domain socket names are supported.
32693 * Returns: %TRUE if supported, %FALSE otherwise
32699 * g_unix_socket_address_get_address_type:
32700 * @address: a #GInetSocketAddress
32702 * Gets @address's type.
32704 * Returns: a #GUnixSocketAddressType
32710 * g_unix_socket_address_get_is_abstract:
32711 * @address: a #GInetSocketAddress
32713 * Tests if @address is abstract.
32715 * Returns: %TRUE if the address is abstract, %FALSE otherwise
32717 * Deprecated: Use g_unix_socket_address_get_address_type()
32722 * g_unix_socket_address_get_path:
32723 * @address: a #GInetSocketAddress
32725 * Gets @address's path, or for abstract sockets the "name".
32727 * Guaranteed to be zero-terminated, but an abstract socket
32728 * may contain embedded zeros, and thus you should use
32729 * g_unix_socket_address_get_path_len() to get the true length
32732 * Returns: the path for @address
32738 * g_unix_socket_address_get_path_len:
32739 * @address: a #GInetSocketAddress
32741 * Gets the length of @address's path.
32743 * For details, see g_unix_socket_address_get_path().
32745 * Returns: the length of the path
32751 * g_unix_socket_address_new:
32752 * @path: the socket path
32754 * Creates a new #GUnixSocketAddress for @path.
32756 * To create abstract socket addresses, on systems that support that,
32757 * use g_unix_socket_address_new_abstract().
32759 * Returns: a new #GUnixSocketAddress
32765 * g_unix_socket_address_new_abstract:
32766 * @path: (array length=path_len) (element-type gchar): the abstract name
32767 * @path_len: the length of @path, or -1
32769 * Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
32770 * #GUnixSocketAddress for @path.
32772 * Returns: a new #GUnixSocketAddress
32773 * Deprecated: Use g_unix_socket_address_new_with_type().
32778 * g_unix_socket_address_new_with_type:
32779 * @path: (array length=path_len) (element-type gchar): the name
32780 * @path_len: the length of @path, or -1
32781 * @type: a #GUnixSocketAddressType
32783 * Creates a new #GUnixSocketAddress of type @type with name @path.
32785 * If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
32786 * calling g_unix_socket_address_new().
32788 * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
32789 * bytes of @path will be copied to the socket's path, and only those
32790 * bytes will be considered part of the name. (If @path_len is -1,
32791 * then @path is assumed to be NUL-terminated.) For example, if @path
32792 * was "test", then calling g_socket_address_get_native_size() on the
32793 * returned socket would return 7 (2 bytes of overhead, 1 byte for the
32794 * abstract-socket indicator byte, and 4 bytes for the name "test").
32796 * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
32797 * @path_len bytes of @path will be copied to the socket's path, the
32798 * rest of the path will be padded with 0 bytes, and the entire
32799 * zero-padded buffer will be considered the name. (As above, if
32800 * @path_len is -1, then @path is assumed to be NUL-terminated.) In
32801 * this case, g_socket_address_get_native_size() will always return
32802 * the full size of a <literal>struct sockaddr_un</literal>, although
32803 * g_unix_socket_address_get_path_len() will still return just the
32806 * %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
32807 * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
32808 * when connecting to a server created by another process, you must
32809 * use the appropriate type corresponding to how that process created
32810 * its listening socket.
32812 * Returns: a new #GUnixSocketAddress
32818 * g_vfs_get_default:
32820 * Gets the default #GVfs for the system.
32822 * Returns: (transfer none): a #GVfs.
32827 * g_vfs_get_file_for_path:
32829 * @path: a string containing a VFS path.
32831 * Gets a #GFile for @path.
32833 * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32838 * g_vfs_get_file_for_uri:
32840 * @uri: a string containing a URI
32842 * Gets a #GFile for @uri.
32844 * This operation never fails, but the returned object
32845 * might not support any I/O operation if the URI
32846 * is malformed or if the URI scheme is not supported.
32848 * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32855 * Gets the local #GVfs for the system.
32857 * Returns: (transfer none): a #GVfs.
32862 * g_vfs_get_supported_uri_schemes:
32865 * Gets a list of URI schemes supported by @vfs.
32867 * Returns: (transfer none): a %NULL-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
32875 * Checks if the VFS is active.
32877 * Returns: %TRUE if construction of the @vfs was successful and it is now active.
32882 * g_vfs_parse_name:
32884 * @parse_name: a string to be parsed by the VFS module.
32886 * This operation never fails, but the returned object might
32887 * not support any I/O operations if the @parse_name cannot
32888 * be parsed by the #GVfs module.
32890 * Returns: (transfer full): a #GFile for the given @parse_name. Free the returned object with g_object_unref().
32895 * g_volume_can_eject:
32896 * @volume: a #GVolume.
32898 * Checks if a volume can be ejected.
32900 * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise.
32905 * g_volume_can_mount:
32906 * @volume: a #GVolume.
32908 * Checks if a volume can be mounted.
32910 * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise.
32916 * @volume: a #GVolume.
32917 * @flags: flags affecting the unmount if required for eject
32918 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32919 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32920 * @user_data: user data that gets passed to @callback
32922 * Ejects a volume. This is an asynchronous operation, and is
32923 * finished by calling g_volume_eject_finish() with the @volume
32924 * and #GAsyncResult returned in the @callback.
32926 * Deprecated: 2.22: Use g_volume_eject_with_operation() instead.
32931 * g_volume_eject_finish:
32932 * @volume: pointer to a #GVolume.
32933 * @result: a #GAsyncResult.
32934 * @error: a #GError location to store an error, or %NULL to ignore
32936 * Finishes ejecting a volume. If any errors occurred during the operation,
32937 * @error will be set to contain the errors and %FALSE will be returned.
32939 * Returns: %TRUE, %FALSE if operation failed.
32940 * Deprecated: 2.22: Use g_volume_eject_with_operation_finish() instead.
32945 * g_volume_eject_with_operation:
32946 * @volume: a #GVolume.
32947 * @flags: flags affecting the unmount if required for eject
32948 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
32949 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32950 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32951 * @user_data: user data passed to @callback.
32953 * Ejects a volume. This is an asynchronous operation, and is
32954 * finished by calling g_volume_eject_with_operation_finish() with the @volume
32955 * and #GAsyncResult data returned in the @callback.
32962 * g_volume_eject_with_operation_finish:
32963 * @volume: a #GVolume.
32964 * @result: a #GAsyncResult.
32965 * @error: a #GError location to store the error occurring, or %NULL to ignore.
32967 * Finishes ejecting a volume. If any errors occurred during the operation,
32968 * @error will be set to contain the errors and %FALSE will be returned.
32970 * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise.
32976 * g_volume_enumerate_identifiers:
32977 * @volume: a #GVolume
32979 * Gets the kinds of <link linkend="volume-identifier">identifiers</link>
32980 * that @volume has. Use g_volume_get_identifier() to obtain
32981 * the identifiers themselves.
32983 * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
32988 * g_volume_get_activation_root:
32989 * @volume: a #GVolume
32991 * Gets the activation root for a #GVolume if it is known ahead of
32992 * mount time. Returns %NULL otherwise. If not %NULL and if @volume
32993 * is mounted, then the result of g_mount_get_root() on the
32994 * #GMount object obtained from g_volume_get_mount() will always
32995 * either be equal or a prefix of what this function returns. In
32996 * other words, in code
33000 * GFile *mount_root
33001 * GFile *volume_activation_root;
33003 * mount = g_volume_get_mount (volume); /* mounted, so never NULL */
33004 * mount_root = g_mount_get_root (mount);
33005 * volume_activation_root = g_volume_get_activation_root(volume); /* assume not NULL */
33006 * </programlisting>
33008 * then the expression
33011 * (g_file_has_prefix (volume_activation_root, mount_root) ||
33012 * g_file_equal (volume_activation_root, mount_root))
33013 * </programlisting>
33015 * will always be %TRUE.
33017 * Activation roots are typically used in #GVolumeMonitor
33018 * implementations to find the underlying mount to shadow, see
33019 * g_mount_is_shadowed() for more details.
33021 * Returns: (transfer full): the activation root of @volume or %NULL. Use g_object_unref() to free.
33027 * g_volume_get_drive:
33028 * @volume: a #GVolume.
33030 * Gets the drive for the @volume.
33032 * 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.
33037 * g_volume_get_icon:
33038 * @volume: a #GVolume.
33040 * Gets the icon for @volume.
33042 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
33047 * g_volume_get_identifier:
33048 * @volume: a #GVolume
33049 * @kind: the kind of identifier to return
33051 * Gets the identifier of the given kind for @volume.
33052 * See the <link linkend="volume-identifier">introduction</link>
33053 * for more information about volume identifiers.
33055 * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GVolume doesn't have this kind of identifier
33060 * g_volume_get_mount:
33061 * @volume: a #GVolume.
33063 * Gets the mount for the @volume.
33065 * 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.
33070 * g_volume_get_name:
33071 * @volume: a #GVolume.
33073 * Gets the name of @volume.
33075 * Returns: the name for the given @volume. The returned string should be freed with g_free() when no longer needed.
33080 * g_volume_get_sort_key:
33081 * @volume: A #GVolume.
33083 * Gets the sort key for @volume, if any.
33085 * Returns: Sorting key for @volume or %NULL if no such key is available.
33091 * g_volume_get_symbolic_icon:
33092 * @volume: a #GVolume.
33094 * Gets the symbolic icon for @volume.
33096 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
33102 * g_volume_get_uuid:
33103 * @volume: a #GVolume.
33105 * Gets the UUID for the @volume. The reference is typically based on
33106 * the file system UUID for the volume in question and should be
33107 * considered an opaque string. Returns %NULL if there is no UUID
33110 * 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.
33115 * g_volume_monitor_adopt_orphan_mount:
33116 * @mount: a #GMount object to find a parent for
33118 * This function should be called by any #GVolumeMonitor
33119 * implementation when a new #GMount object is created that is not
33120 * associated with a #GVolume object. It must be called just before
33121 * emitting the @mount_added signal.
33123 * If the return value is not %NULL, the caller must associate the
33124 * returned #GVolume object with the #GMount. This involves returning
33125 * it in its g_mount_get_volume() implementation. The caller must
33126 * also listen for the "removed" signal on the returned object
33127 * and give up its reference when handling that signal
33129 * Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
33130 * the implementor must take a reference to @mount and return it in
33131 * its g_volume_get_mount() implemented. Also, the implementor must
33132 * listen for the "unmounted" signal on @mount and give up its
33133 * reference upon handling that signal.
33135 * There are two main use cases for this function.
33137 * One is when implementing a user space file system driver that reads
33138 * blocks of a block device that is already represented by the native
33139 * volume monitor (for example a CD Audio file system driver). Such
33140 * a driver will generate its own #GMount object that needs to be
33141 * associated with the #GVolume object that represents the volume.
33143 * The other is for implementing a #GVolumeMonitor whose sole purpose
33144 * is to return #GVolume objects representing entries in the users
33145 * "favorite servers" list or similar.
33147 * Returns: (transfer full): the #GVolume object that is the parent for @mount or %NULL if no wants to adopt the #GMount.
33148 * 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.
33153 * g_volume_monitor_get:
33155 * Gets the volume monitor used by gio.
33157 * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call g_object_unref() when done with it.
33162 * g_volume_monitor_get_connected_drives:
33163 * @volume_monitor: a #GVolumeMonitor.
33165 * Gets a list of drives connected to the system.
33167 * The returned list should be freed with g_list_free(), after
33168 * its elements have been unreffed with g_object_unref().
33170 * Returns: (element-type GDrive) (transfer full): a #GList of connected #GDrive objects.
33175 * g_volume_monitor_get_mount_for_uuid:
33176 * @volume_monitor: a #GVolumeMonitor.
33177 * @uuid: the UUID to look for
33179 * Finds a #GMount object by its UUID (see g_mount_get_uuid())
33181 * Returns: (transfer full): a #GMount or %NULL if no such mount is available. Free the returned object with g_object_unref().
33186 * g_volume_monitor_get_mounts:
33187 * @volume_monitor: a #GVolumeMonitor.
33189 * Gets a list of the mounts on the system.
33191 * The returned list should be freed with g_list_free(), after
33192 * its elements have been unreffed with g_object_unref().
33194 * Returns: (element-type GMount) (transfer full): a #GList of #GMount objects.
33199 * g_volume_monitor_get_volume_for_uuid:
33200 * @volume_monitor: a #GVolumeMonitor.
33201 * @uuid: the UUID to look for
33203 * Finds a #GVolume object by its UUID (see g_volume_get_uuid())
33205 * Returns: (transfer full): a #GVolume or %NULL if no such volume is available. Free the returned object with g_object_unref().
33210 * g_volume_monitor_get_volumes:
33211 * @volume_monitor: a #GVolumeMonitor.
33213 * Gets a list of the volumes on the system.
33215 * The returned list should be freed with g_list_free(), after
33216 * its elements have been unreffed with g_object_unref().
33218 * Returns: (element-type GVolume) (transfer full): a #GList of #GVolume objects.
33224 * @volume: a #GVolume.
33225 * @flags: flags affecting the operation
33226 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
33227 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33228 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33229 * @user_data: user data that gets passed to @callback
33231 * Mounts a volume. This is an asynchronous operation, and is
33232 * finished by calling g_volume_mount_finish() with the @volume
33233 * and #GAsyncResult returned in the @callback.
33235 * Virtual: mount_fn
33240 * g_volume_mount_finish:
33241 * @volume: a #GVolume
33242 * @result: a #GAsyncResult
33243 * @error: a #GError location to store an error, or %NULL to ignore
33245 * Finishes mounting a volume. If any errors occurred during the operation,
33246 * @error will be set to contain the errors and %FALSE will be returned.
33248 * If the mount operation succeeded, g_volume_get_mount() on @volume
33249 * is guaranteed to return the mount right after calling this
33250 * function; there's no need to listen for the 'mount-added' signal on
33253 * Returns: %TRUE, %FALSE if operation failed.
33258 * g_volume_should_automount:
33259 * @volume: a #GVolume
33261 * Returns whether the volume should be automatically mounted.
33263 * Returns: %TRUE if the volume should be automatically mounted.
33268 * g_win32_input_stream_get_close_handle:
33269 * @stream: a #GWin32InputStream
33271 * Returns whether the handle of @stream will be
33272 * closed when the stream is closed.
33274 * Returns: %TRUE if the handle is closed when done
33280 * g_win32_input_stream_get_handle:
33281 * @stream: a #GWin32InputStream
33283 * Return the Windows file handle that the stream reads from.
33285 * Returns: The file handle of @stream
33291 * g_win32_input_stream_new:
33292 * @handle: a Win32 file handle
33293 * @close_handle: %TRUE to close the handle when done
33295 * Creates a new #GWin32InputStream for the given @handle.
33297 * If @close_handle is %TRUE, the handle will be closed
33298 * when the stream is closed.
33300 * Note that "handle" here means a Win32 HANDLE, not a "file descriptor"
33301 * as used in the Windows C libraries.
33303 * Returns: a new #GWin32InputStream
33308 * g_win32_input_stream_set_close_handle:
33309 * @stream: a #GWin32InputStream
33310 * @close_handle: %TRUE to close the handle when done
33312 * Sets whether the handle of @stream shall be closed
33313 * when the stream is closed.
33320 * g_win32_output_stream_get_close_handle:
33321 * @stream: a #GWin32OutputStream
33323 * Returns whether the handle of @stream will be closed when the
33324 * stream is closed.
33326 * Returns: %TRUE if the handle is closed when done
33332 * g_win32_output_stream_get_handle:
33333 * @stream: a #GWin32OutputStream
33335 * Return the Windows handle that the stream writes to.
33337 * Returns: The handle descriptor of @stream
33343 * g_win32_output_stream_new:
33344 * @handle: a Win32 file handle
33345 * @close_handle: %TRUE to close the handle when done
33347 * Creates a new #GWin32OutputStream for the given @handle.
33349 * If @close_handle, is %TRUE, the handle will be closed when the
33350 * output stream is destroyed.
33352 * Returns: a new #GOutputStream
33358 * g_win32_output_stream_set_close_handle:
33359 * @stream: a #GWin32OutputStream
33360 * @close_handle: %TRUE to close the handle when done
33362 * Sets whether the handle of @stream shall be closed when the stream
33370 * g_zlib_compressor_get_file_info:
33371 * @compressor: a #GZlibCompressor
33373 * Returns the #GZlibCompressor:file-info property.
33375 * Returns: (transfer none): a #GFileInfo, or %NULL
33381 * g_zlib_compressor_new:
33382 * @format: The format to use for the compressed data
33383 * @level: compression level (0-9), -1 for default
33385 * Creates a new #GZlibCompressor.
33387 * Returns: a new #GZlibCompressor
33393 * g_zlib_compressor_set_file_info:
33394 * @compressor: a #GZlibCompressor
33395 * @file_info: (allow-none): a #GFileInfo
33397 * Sets @file_info in @compressor. If non-%NULL, and @compressor's
33398 * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
33399 * it will be used to set the file name and modification time in
33400 * the GZIP header of the compressed data.
33402 * Note: it is an error to call this function while a compression is in
33403 * progress; it may only be called immediately after creation of @compressor,
33404 * or after resetting it with g_converter_reset().
33411 * g_zlib_decompressor_get_file_info:
33412 * @decompressor: a #GZlibDecompressor
33414 * Retrieves the #GFileInfo constructed from the GZIP header data
33415 * of compressed data processed by @compressor, or %NULL if @decompressor's
33416 * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
33417 * or the header data was not fully processed yet, or it not present in the
33418 * data stream at all.
33420 * Returns: (transfer none): a #GFileInfo, or %NULL
33426 * g_zlib_decompressor_new:
33427 * @format: The format to use for the compressed data
33429 * Creates a new #GZlibDecompressor.
33431 * Returns: a new #GZlibDecompressor
33437 * get_all_desktop_entries_for_mime_type:
33438 * @mime_type: a mime type.
33439 * @except: NULL or a strv list
33441 * Returns all the desktop ids for @mime_type. The desktop files
33442 * are listed in an order so that default applications are listed before
33443 * non-default ones, and handlers for inherited mimetypes are listed
33444 * after the base ones.
33446 * Optionally doesn't list the desktop ids given in the @except
33448 * Returns: a #GList containing the desktop ids which claim to handle @mime_type.
33453 * mime_info_cache_reload:
33454 * @dir: directory path which needs reloading.
33456 * Reload the mime information for the @dir.
33461 /************************************************************/
33462 /* THIS FILE IS GENERATED DO NOT EDIT */
33463 /************************************************************/