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
266 * The bytes containing the icon.
271 * GCancellable::cancelled:
272 * @cancellable: a #GCancellable.
274 * Emitted when the operation has been cancelled.
276 * Can be used by implementations of cancellable operations. If the
277 * operation is cancelled from another thread, the signal will be
278 * emitted in the thread that cancelled the operation, not the
279 * thread that is running the operation.
281 * Note that disconnecting from this signal (or any signal) in a
282 * multi-threaded program is prone to race conditions. For instance
283 * it is possible that a signal handler may be invoked even
284 * <emphasis>after</emphasis> a call to
285 * g_signal_handler_disconnect() for that handler has already
288 * There is also a problem when cancellation happen
289 * right before connecting to the signal. If this happens the
290 * signal will unexpectedly not be emitted, and checking before
291 * connecting to the signal leaves a race condition where this is
294 * In order to make it safe and easy to connect handlers there
295 * are two helper functions: g_cancellable_connect() and
296 * g_cancellable_disconnect() which protect against problems
299 * An example of how to us this:
301 * /<!-- -->* Make sure we don't do any unnecessary work if already cancelled *<!-- -->/
302 * if (g_cancellable_set_error_if_cancelled (cancellable))
305 * /<!-- -->* Set up all the data needed to be able to
306 * * handle cancellation of the operation *<!-- -->/
307 * my_data = my_data_new (...);
311 * id = g_cancellable_connect (cancellable,
312 * G_CALLBACK (cancelled_handler)
315 * /<!-- -->* cancellable operation here... *<!-- -->/
317 * g_cancellable_disconnect (cancellable, id);
319 * /<!-- -->* cancelled_handler is never called after this, it
320 * * is now safe to free the data *<!-- -->/
321 * my_data_free (my_data);
324 * Note that the cancelled signal is emitted in the thread that
325 * the user cancelled from, which may be the main thread. So, the
326 * cancellable signal should not do something that can block.
333 * Conversions between character sets.
340 * The #GCredentials structure contains only private data and
341 * should only be accessed using the provided API.
350 * Class structure for #GCredentials.
357 * GDBusAuthMechanism:credentials:
359 * If authenticating as a server, this property contains the
360 * received credentials, if any.
362 * If authenticating as a client, the property contains the
363 * credentials that were sent, if any.
370 * The #GDBusAuthObserver structure contains only private data and
371 * should only be accessed using the provided API.
378 * GDBusAuthObserver::allow-mechanism:
379 * @observer: The #GDBusAuthObserver emitting the signal.
380 * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
382 * Emitted to check if @mechanism is allowed to be used.
384 * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
390 * GDBusAuthObserver::authorize-authenticated-peer:
391 * @observer: The #GDBusAuthObserver emitting the signal.
392 * @stream: A #GIOStream for the #GDBusConnection.
393 * @credentials: (allow-none): Credentials received from the peer or %NULL.
395 * Emitted to check if a peer that is successfully authenticated
398 * Returns: %TRUE if the peer is authorized, %FALSE if not.
404 * GDBusAuthObserverClass:
405 * @authorize_authenticated_peer: Signal class handler for the #GDBusAuthObserver::authorize-authenticated-peer signal.
407 * Class structure for #GDBusAuthObserverClass.
416 * The #GDBusConnection structure contains only private data and
417 * should only be accessed using the provided API.
424 * GDBusConnection::closed:
425 * @connection: The #GDBusConnection emitting the signal.
426 * @remote_peer_vanished: %TRUE if @connection is closed because the remote peer closed its end of the connection.
427 * @error: (allow-none): A #GError with more details about the event or %NULL.
429 * Emitted when the connection is closed.
431 * The cause of this event can be
434 * If g_dbus_connection_close() is called. In this case
435 * @remote_peer_vanished is set to %FALSE and @error is %NULL.
438 * If the remote peer closes the connection. In this case
439 * @remote_peer_vanished is set to %TRUE and @error is set.
442 * If the remote peer sends invalid or malformed data. In this
443 * case @remote_peer_vanished is set to %FALSE and @error
448 * Upon receiving this signal, you should give up your reference to
449 * @connection. You are guaranteed that this signal is emitted only
457 * GDBusConnection:address:
459 * A D-Bus address specifying potential endpoints that can be used
460 * when establishing the connection.
467 * GDBusConnection:authentication-observer:
469 * A #GDBusAuthObserver object to assist in the authentication process or %NULL.
476 * GDBusConnection:capabilities:
478 * Flags from the #GDBusCapabilityFlags enumeration
479 * representing connection features negotiated with the other peer.
486 * GDBusConnection:closed:
488 * A boolean specifying whether the connection has been closed.
495 * GDBusConnection:exit-on-close:
497 * A boolean specifying whether the process will be terminated (by
498 * calling <literal>raise(SIGTERM)</literal>) if the connection
499 * is closed by the remote peer.
501 * Note that #GDBusConnection objects returned by g_bus_get_finish() and
502 * g_bus_get_sync() will (usually) have this property set to %TRUE.
509 * GDBusConnection:flags:
511 * Flags from the #GDBusConnectionFlags enumeration.
518 * GDBusConnection:guid:
520 * The GUID of the peer performing the role of server when
523 * If you are constructing a #GDBusConnection and pass
524 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER in the
525 * #GDBusConnection:flags property then you MUST also set this
526 * property to a valid guid.
528 * If you are constructing a #GDBusConnection and pass
529 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT in the
530 * #GDBusConnection:flags property you will be able to read the GUID
531 * of the other peer here after the connection has been successfully
539 * GDBusConnection:locked:
541 * A boolean specifying whether the message is locked.
548 * GDBusConnection:stream:
550 * The underlying #GIOStream used for I/O.
552 * If this is passed on construction and is a #GSocketConnection,
553 * then the corresponding #GSocket will be put into non-blocking mode.
555 * While the #GDBusConnection is active, it will interact with this
556 * stream from a worker thread, so it is not safe to interact with
557 * the stream directly.
564 * GDBusConnection:unique-name:
566 * The unique name as assigned by the message bus or %NULL if the
567 * connection is not open or not a message bus connection.
574 * GDBusConnectionClass:
575 * @closed: Signal class handler for the #GDBusConnection::closed signal.
577 * Class structure for #GDBusConnection.
584 * GDBusInterfaceSkeleton::g-authorize-method:
585 * @interface: The #GDBusInterfaceSkeleton emitting the signal.
586 * @invocation: A #GDBusMethodInvocation.
588 * Emitted when a method is invoked by a remote caller and used to
589 * determine if the method call is authorized.
591 * Note that this signal is emitted in a thread dedicated to
592 * handling the method call so handlers are allowed to perform
593 * blocking IO. This means that it is appropriate to call
595 * url="http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#polkit-authority-check-authorization-sync">polkit_authority_check_authorization_sync()</ulink>
597 * 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.
599 * If %FALSE is returned then no further handlers are run and the
600 * signal handler must take a reference to @invocation and finish
601 * handling the call (e.g. return an error via
602 * g_dbus_method_invocation_return_error()).
604 * Otherwise, if %TRUE is returned, signal emission continues. If no
605 * handlers return %FALSE, then the method is dispatched. If
606 * @interface has an enclosing #GDBusObjectSkeleton, then the
607 * #GDBusObjectSkeleton::authorize-method signal handlers run before
608 * the handlers for this signal.
610 * The default class handler just returns %TRUE.
612 * Please note that the common case is optimized: if no signals
613 * handlers are connected and the default class handler isn't
614 * overridden (for both @interface and the enclosing
615 * #GDBusObjectSkeleton, if any) and #GDBusInterfaceSkeleton:g-flags does
617 * %G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD
618 * flags set, no dedicated thread is ever used and the call will be
619 * handled in the same thread as the object that @interface belongs
620 * to was exported in.
622 * Returns: %TRUE if the call is authorized, %FALSE otherwise.
628 * GDBusInterfaceSkeleton:g-flags:
630 * Flags from the #GDBusInterfaceSkeletonFlags enumeration.
639 * The #GDBusMessage structure contains only private data and should
640 * only be accessed using the provided API.
649 * Class structure for #GDBusMessage.
656 * GDBusMethodInvocation:
658 * The #GDBusMethodInvocation structure contains only private data and
659 * should only be accessed using the provided API.
666 * GDBusMethodInvocationClass:
668 * Class structure for #GDBusMethodInvocation.
675 * GDBusObject::interface-added:
676 * @object: The #GDBusObject emitting the signal.
677 * @interface: The #GDBusInterface that was added.
679 * Emitted when @interface is added to @object.
686 * GDBusObject::interface-removed:
687 * @object: The #GDBusObject emitting the signal.
688 * @interface: The #GDBusInterface that was removed.
690 * Emitted when @interface is removed from @object.
697 * GDBusObjectManager::interface-added:
698 * @manager: The #GDBusObjectManager emitting the signal.
699 * @object: The #GDBusObject on which an interface was added.
700 * @interface: The #GDBusInterface that was added.
702 * Emitted when @interface is added to @object.
704 * This signal exists purely as a convenience to avoid having to
705 * connect signals to all objects managed by @manager.
712 * GDBusObjectManager::interface-removed:
713 * @manager: The #GDBusObjectManager emitting the signal.
714 * @object: The #GDBusObject on which an interface was removed.
715 * @interface: The #GDBusInterface that was removed.
717 * Emitted when @interface has been removed from @object.
719 * This signal exists purely as a convenience to avoid having to
720 * connect signals to all objects managed by @manager.
727 * GDBusObjectManager::object-added:
728 * @manager: The #GDBusObjectManager emitting the signal.
729 * @object: The #GDBusObject that was added.
731 * Emitted when @object is added to @manager.
738 * GDBusObjectManager::object-removed:
739 * @manager: The #GDBusObjectManager emitting the signal.
740 * @object: The #GDBusObject that was removed.
742 * Emitted when @object is removed from @manager.
749 * GDBusObjectManagerClient::interface-proxy-properties-changed:
750 * @manager: The #GDBusObjectManagerClient emitting the signal.
751 * @object_proxy: The #GDBusObjectProxy on which an interface has properties that are changing.
752 * @interface_proxy: The #GDBusProxy that has properties that are changing.
753 * @changed_properties: A #GVariant containing the properties that changed.
754 * @invalidated_properties: A %NULL terminated array of properties that was invalidated.
756 * Emitted when one or more D-Bus properties on proxy changes. The
757 * local cache has already been updated when this signal fires. Note
758 * that both @changed_properties and @invalidated_properties are
759 * guaranteed to never be %NULL (either may be empty though).
761 * This signal exists purely as a convenience to avoid having to
762 * connect signals to all interface proxies managed by @manager.
764 * This signal is emitted in the
765 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
766 * that @manager was constructed in.
773 * GDBusObjectManagerClient::interface-proxy-signal:
774 * @manager: The #GDBusObjectManagerClient emitting the signal.
775 * @object_proxy: The #GDBusObjectProxy on which an interface is emitting a D-Bus signal.
776 * @interface_proxy: The #GDBusProxy that is emitting a D-Bus signal.
777 * @sender_name: The sender of the signal or NULL if the connection is not a bus connection.
778 * @signal_name: The signal name.
779 * @parameters: A #GVariant tuple with parameters for the signal.
781 * Emitted when a D-Bus signal is received on @interface_proxy.
783 * This signal exists purely as a convenience to avoid having to
784 * connect signals to all interface proxies managed by @manager.
786 * This signal is emitted in the
787 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
788 * that @manager was constructed in.
795 * GDBusObjectManagerClient:bus-type:
797 * If this property is not %G_BUS_TYPE_NONE, then
798 * #GDBusObjectManagerClient:connection must be %NULL and will be set to the
799 * #GDBusConnection obtained by calling g_bus_get() with the value
807 * GDBusObjectManagerClient:connection:
809 * The #GDBusConnection to use.
816 * GDBusObjectManagerClient:flags:
818 * Flags from the #GDBusObjectManagerClientFlags enumeration.
825 * GDBusObjectManagerClient:get-proxy-type-destroy-notify:
827 * A #GDestroyNotify for the #gpointer user_data in #GDBusObjectManagerClient:get-proxy-type-user-data.
834 * GDBusObjectManagerClient:get-proxy-type-func:
836 * The #GDBusProxyTypeFunc to use when determining what #GType to
837 * use for interface proxies or %NULL.
844 * GDBusObjectManagerClient:get-proxy-type-user-data:
846 * The #gpointer user_data to pass to #GDBusObjectManagerClient:get-proxy-type-func.
853 * GDBusObjectManagerClient:name:
855 * The well-known name or unique name that the manager is for.
862 * GDBusObjectManagerClient:name-owner:
864 * The unique name that owns #GDBusObjectManagerClient:name or %NULL if
865 * no-one is currently owning the name. Connect to the
866 * #GObject::notify signal to track changes to this property.
873 * GDBusObjectManagerClient:object-path:
875 * The object path the manager is for.
882 * GDBusObjectManagerServer:connection:
884 * The #GDBusConnection to export objects on.
891 * GDBusObjectManagerServer:object-path:
893 * The object path to register the manager object at.
900 * GDBusObjectProxy:g-connection:
902 * The connection of the proxy.
909 * GDBusObjectProxy:g-object-path:
911 * The object path of the proxy.
918 * GDBusObjectSkeleton::authorize-method:
919 * @object: The #GDBusObjectSkeleton emitting the signal.
920 * @interface: The #GDBusInterfaceSkeleton that @invocation is for.
921 * @invocation: A #GDBusMethodInvocation.
923 * Emitted when a method is invoked by a remote caller and used to
924 * determine if the method call is authorized.
926 * This signal is like #GDBusInterfaceSkeleton<!-- -->'s
927 * #GDBusInterfaceSkeleton::g-authorize-method signal, except that it is
928 * for the enclosing object.
930 * The default class handler just returns %TRUE.
932 * Returns: %TRUE if the call is authorized, %FALSE otherwise.
938 * GDBusObjectSkeleton:g-object-path:
940 * The object path where the object is exported.
947 * GDBusProxy::g-properties-changed:
948 * @proxy: The #GDBusProxy emitting the signal.
949 * @changed_properties: A #GVariant containing the properties that changed
950 * @invalidated_properties: A %NULL terminated array of properties that was invalidated
952 * Emitted when one or more D-Bus properties on @proxy changes. The
953 * local cache has already been updated when this signal fires. Note
954 * that both @changed_properties and @invalidated_properties are
955 * guaranteed to never be %NULL (either may be empty though).
957 * If the proxy has the flag
958 * %G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES set, then
959 * @invalidated_properties will always be empty.
961 * This signal corresponds to the
962 * <literal>PropertiesChanged</literal> D-Bus signal on the
963 * <literal>org.freedesktop.DBus.Properties</literal> interface.
970 * GDBusProxy::g-signal:
971 * @proxy: The #GDBusProxy emitting the signal.
972 * @sender_name: (allow-none): The sender of the signal or %NULL if the connection is not a bus connection.
973 * @signal_name: The name of the signal.
974 * @parameters: A #GVariant tuple with parameters for the signal.
976 * Emitted when a signal from the remote object and interface that @proxy is for, has been received.
983 * GDBusProxy:g-bus-type:
985 * If this property is not %G_BUS_TYPE_NONE, then
986 * #GDBusProxy:g-connection must be %NULL and will be set to the
987 * #GDBusConnection obtained by calling g_bus_get() with the value
995 * GDBusProxy:g-connection:
997 * The #GDBusConnection the proxy is for.
1004 * GDBusProxy:g-default-timeout:
1006 * The timeout to use if -1 (specifying default timeout) is passed
1007 * as @timeout_msec in the g_dbus_proxy_call() and
1008 * g_dbus_proxy_call_sync() functions.
1010 * This allows applications to set a proxy-wide timeout for all
1011 * remote method invocations on the proxy. If this property is -1,
1012 * the default timeout (typically 25 seconds) is used. If set to
1013 * %G_MAXINT, then no timeout is used.
1020 * GDBusProxy:g-flags:
1022 * Flags from the #GDBusProxyFlags enumeration.
1029 * GDBusProxy:g-interface-info:
1031 * Ensure that interactions with this proxy conform to the given
1032 * interface. This is mainly to ensure that malformed data received
1033 * from the other peer is ignored. The given #GDBusInterfaceInfo is
1034 * said to be the <emphasis>expected interface</emphasis>.
1036 * The checks performed are:
1039 * When completing a method call, if the type signature of
1040 * the reply message isn't what's expected, the reply is
1041 * discarded and the #GError is set to %G_IO_ERROR_INVALID_ARGUMENT.
1042 * </para></listitem>
1044 * Received signals that have a type signature mismatch are dropped and
1045 * a warning is logged via g_warning().
1046 * </para></listitem>
1048 * Properties received via the initial <literal>GetAll()</literal> call
1049 * or via the <literal>::PropertiesChanged</literal> signal (on the
1050 * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties">org.freedesktop.DBus.Properties</ulink> interface) or
1051 * set using g_dbus_proxy_set_cached_property() with a type signature
1052 * mismatch are ignored and a warning is logged via g_warning().
1053 * </para></listitem>
1055 * Note that these checks are never done on methods, signals and
1056 * properties that are not referenced in the given
1057 * #GDBusInterfaceInfo, since extending a D-Bus interface on the
1058 * service-side is not considered an ABI break.
1065 * GDBusProxy:g-interface-name:
1067 * The D-Bus interface name the proxy is for.
1074 * GDBusProxy:g-name:
1076 * The well-known or unique name that the proxy is for.
1083 * GDBusProxy:g-name-owner:
1085 * The unique name that owns #GDBusProxy:g-name or %NULL if no-one
1086 * currently owns that name. You may connect to #GObject::notify signal to
1087 * track changes to this property.
1094 * GDBusProxy:g-object-path:
1096 * The object path the proxy is for.
1105 * The #GDBusServer structure contains only private data and
1106 * should only be accessed using the provided API.
1113 * GDBusServer::new-connection:
1114 * @server: The #GDBusServer emitting the signal.
1115 * @connection: A #GDBusConnection for the new connection.
1117 * Emitted when a new authenticated connection has been made. Use
1118 * g_dbus_connection_get_peer_credentials() to figure out what
1119 * identity (if any), was authenticated.
1121 * If you want to accept the connection, take a reference to the
1122 * @connection object and return %TRUE. When you are done with the
1123 * connection call g_dbus_connection_close() and give up your
1124 * reference. Note that the other peer may disconnect at any time -
1125 * a typical thing to do when accepting a connection is to listen to
1126 * the #GDBusConnection::closed signal.
1128 * If #GDBusServer:flags contains %G_DBUS_SERVER_FLAGS_RUN_IN_THREAD
1129 * then the signal is emitted in a new thread dedicated to the
1130 * connection. Otherwise the signal is emitted in the <link
1131 * linkend="g-main-context-push-thread-default">thread-default main
1132 * loop</link> of the thread that @server was constructed in.
1134 * You are guaranteed that signal handlers for this signal runs
1135 * before incoming messages on @connection are processed. This means
1136 * that it's suitable to call g_dbus_connection_register_object() or
1137 * similar from the signal handler.
1139 * Returns: %TRUE to claim @connection, %FALSE to let other handlers run.
1145 * GDBusServer:active:
1147 * Whether the server is currently active.
1154 * GDBusServer:address:
1156 * The D-Bus address to listen on.
1163 * GDBusServer:authentication-observer:
1165 * A #GDBusAuthObserver object to assist in the authentication process or %NULL.
1172 * GDBusServer:client-address:
1174 * The D-Bus address that clients can use.
1181 * GDBusServer:flags:
1183 * Flags from the #GDBusServerFlags enumeration.
1192 * The guid of the server.
1200 * @new_connection: Signal class handler for the #GDBusServer::new-connection signal.
1202 * Class structure for #GDBusServer.
1209 * GDataOutputStream:byte-order:
1211 * Determines the byte ordering that is used when writing
1212 * multi-byte entities (such as integers) to the stream.
1217 * GDataStream:byte-order:
1219 * The ::byte-order property determines the byte ordering that
1220 * is used when reading multi-byte entities (such as integers)
1226 * GDataStream:newline-type:
1228 * The :newline-type property determines what is considered
1229 * as a line ending when reading complete lines from the stream.
1236 * Information about an installed application from a desktop file.
1241 * GDesktopAppInfo:filename:
1243 * The origin filename of this #GDesktopAppInfo
1249 * @drive: a #GDrive.
1251 * Emitted when the drive's state has changed.
1256 * GDrive::disconnected:
1257 * @drive: a #GDrive.
1259 * This signal is emitted when the #GDrive have been
1260 * disconnected. If the recipient is holding references to the
1261 * object they should release them so the object can be
1267 * GDrive::eject-button:
1268 * @drive: a #GDrive.
1270 * Emitted when the physical eject button (if any) of a drive has
1276 * GDrive::stop-button:
1277 * @drive: a #GDrive.
1279 * Emitted when the physical stop button (if any) of a drive has
1289 * The file containing the icon.
1294 * GFileMonitor::changed:
1295 * @monitor: a #GFileMonitor.
1297 * @other_file: (allow-none): a #GFile or #NULL.
1298 * @event_type: a #GFileMonitorEvent.
1300 * Emitted when @file has been changed.
1302 * If using #G_FILE_MONITOR_SEND_MOVED flag and @event_type is
1303 * #G_FILE_MONITOR_EVENT_MOVED, @file will be set to a #GFile containing the
1304 * old path, and @other_file will be set to a #GFile containing the new path.
1306 * In all the other cases, @other_file will be set to #NULL.
1311 * GFilenameCompleter::got-completion-data:
1313 * Emitted when the file name completion information comes available.
1320 * Represents a scope for loading IO modules. A scope can be used for blocking
1321 * duplicate modules, or blocking a module you don't want to load.
1323 * The scope can be used with g_io_modules_load_all_in_directory_with_scope()
1324 * or g_io_modules_scan_all_in_directory_with_scope().
1333 * An IPv4 or IPv6 internet address.
1338 * GInetAddress:is-any:
1340 * Whether this is the "any" address for its family.
1341 * See g_inet_address_get_is_any().
1348 * GInetAddress:is-link-local:
1350 * Whether this is a link-local address.
1351 * See g_inet_address_get_is_link_local().
1358 * GInetAddress:is-loopback:
1360 * Whether this is the loopback address for its family.
1361 * See g_inet_address_get_is_loopback().
1368 * GInetAddress:is-mc-global:
1370 * Whether this is a global multicast address.
1371 * See g_inet_address_get_is_mc_global().
1378 * GInetAddress:is-mc-link-local:
1380 * Whether this is a link-local multicast address.
1381 * See g_inet_address_get_is_mc_link_local().
1388 * GInetAddress:is-mc-node-local:
1390 * Whether this is a node-local multicast address.
1391 * See g_inet_address_get_is_mc_node_local().
1398 * GInetAddress:is-mc-org-local:
1400 * Whether this is an organization-local multicast address.
1401 * See g_inet_address_get_is_mc_org_local().
1408 * GInetAddress:is-mc-site-local:
1410 * Whether this is a site-local multicast address.
1411 * See g_inet_address_get_is_mc_site_local().
1418 * GInetAddress:is-multicast:
1420 * Whether this is a multicast address.
1421 * See g_inet_address_get_is_multicast().
1428 * GInetAddress:is-site-local:
1430 * Whether this is a site-local address.
1431 * See g_inet_address_get_is_loopback().
1440 * A combination of an IPv4 or IPv6 base address and a length,
1441 * representing a range of IP addresses.
1448 * GInetSocketAddress:
1450 * An IPv4 or IPv6 socket address, corresponding to a <type>struct
1451 * sockaddr_in</type> or <type>struct sockaddr_in6</type>.
1456 * GInetSocketAddress:flowinfo:
1458 * The <literal>sin6_flowinfo</literal> field, for IPv6 addresses.
1465 * GInetSocketAddress:scope_id:
1467 * The <literal>sin6_scope_id</literal> field, for IPv6 addresses.
1474 * GMemoryOutputStream:data:
1476 * Pointer to buffer where data will be written.
1483 * GMemoryOutputStream:data-size:
1485 * Size of data written to the buffer.
1492 * GMemoryOutputStream:destroy-function: (skip)
1494 * Function called with the buffer as argument when the stream is destroyed.
1501 * GMemoryOutputStream:realloc-function: (skip)
1503 * Function with realloc semantics called to enlarge the buffer.
1510 * GMemoryOutputStream:size:
1512 * Current size of the data buffer.
1521 * #GMenu is an opaque structure type. You must access it using the
1529 * GMenuAttributeIter:
1531 * #GMenuAttributeIter is an opaque structure type. You must access it
1532 * using the functions below.
1541 * #GMenuItem is an opaque structure type. You must access it using the
1551 * #GMenuLinkIter is an opaque structure type. You must access it using
1552 * the functions below.
1561 * #GMenuModel is an opaque structure type. You must access it using the
1569 * GMenuModel::items-changed:
1570 * @model: the #GMenuModel that is changing
1571 * @position: the position of the change
1572 * @removed: the number of items removed
1573 * @added: the number of items added
1575 * Emitted when a change has occured to the menu.
1577 * The only changes that can occur to a menu is that items are removed
1578 * or added. Items may not change (except by being removed and added
1579 * back in the same location). This signal is capable of describing
1580 * both of those changes (at the same time).
1582 * The signal means that starting at the index @position, @removed
1583 * items were removed and @added items were added in their place. If
1584 * @removed is zero then only items were added. If @added is zero
1585 * then only items were removed.
1587 * As an example, if the menu contains items a, b, c, d (in that
1588 * order) and the signal (2, 1, 3) occurs then the new composition of
1589 * the menu will be a, b, _, _, _, d (with each _ representing some
1592 * Signal handlers may query the model (particularly the added items)
1593 * and expect to see the results of the modification that is being
1594 * reported. The signal is emitted after the modification.
1600 * @mount: the object on which the signal is emitted
1602 * Emitted when the mount has been changed.
1607 * GMount::pre-unmount:
1608 * @mount: the object on which the signal is emitted
1610 * This signal is emitted when the #GMount is about to be
1618 * GMount::unmounted:
1619 * @mount: the object on which the signal is emitted
1621 * This signal is emitted when the #GMount have been
1622 * unmounted. If the recipient is holding references to the
1623 * object they should release them so the object can be
1629 * GMountOperation::aborted:
1631 * Emitted by the backend when e.g. a device becomes unavailable
1632 * while a mount operation is in progress.
1634 * Implementations of GMountOperation should handle this signal
1635 * by dismissing open password dialogs.
1642 * GMountOperation::ask-password:
1643 * @op: a #GMountOperation requesting a password.
1644 * @message: string containing a message to display to the user.
1645 * @default_user: string containing the default user name.
1646 * @default_domain: string containing the default domain.
1647 * @flags: a set of #GAskPasswordFlags.
1649 * Emitted when a mount operation asks the user for a password.
1651 * If the message contains a line break, the first line should be
1652 * presented as a heading. For example, it may be used as the
1653 * primary text in a #GtkMessageDialog.
1658 * GMountOperation::ask-question:
1659 * @op: a #GMountOperation asking a question.
1660 * @message: string containing a message to display to the user.
1661 * @choices: an array of strings for each possible choice.
1663 * Emitted when asking the user a question and gives a list of
1664 * choices for the user to choose from.
1666 * If the message contains a line break, the first line should be
1667 * presented as a heading. For example, it may be used as the
1668 * primary text in a #GtkMessageDialog.
1673 * GMountOperation::reply:
1674 * @op: a #GMountOperation.
1675 * @result: a #GMountOperationResult indicating how the request was handled
1677 * Emitted when the user has replied to the mount operation.
1682 * GMountOperation::show-processes:
1683 * @op: a #GMountOperation.
1684 * @message: string containing a message to display to the user.
1685 * @processes: (element-type GPid): an array of #GPid for processes blocking the operation.
1686 * @choices: an array of strings for each possible choice.
1688 * Emitted when one or more processes are blocking an operation
1689 * e.g. unmounting/ejecting a #GMount or stopping a #GDrive.
1691 * Note that this signal may be emitted several times to update the
1692 * list of blocking processes as processes close files. The
1693 * application should only respond with g_mount_operation_reply() to
1694 * the latest signal (setting #GMountOperation:choice to the choice
1697 * If the message contains a line break, the first line should be
1698 * presented as a heading. For example, it may be used as the
1699 * primary text in a #GtkMessageDialog.
1706 * GMountOperation::show-unmount-progress:
1707 * @op: a #GMountOperation:
1708 * @message: string containing a mesage to display to the user
1709 * @time_left: the estimated time left before the operation completes, in microseconds, or -1
1710 * @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
1712 * Emitted when an unmount operation has been busy for more than some time
1713 * (typically 1.5 seconds).
1715 * When unmounting or ejecting a volume, the kernel might need to flush
1716 * pending data in its buffers to the volume stable storage, and this operation
1717 * can take a considerable amount of time. This signal may be emitted several
1718 * times as long as the unmount operation is outstanding, and then one
1719 * last time when the operation is completed, with @bytes_left set to zero.
1721 * Implementations of GMountOperation should handle this signal by
1722 * showing an UI notification, and then dismiss it, or show another notification
1723 * of completion, when @bytes_left reaches zero.
1725 * If the message contains a line break, the first line should be
1726 * presented as a heading. For example, it may be used as the
1727 * primary text in a #GtkMessageDialog.
1734 * GMountOperation:anonymous:
1736 * Whether to use an anonymous user when authenticating.
1741 * GMountOperation:choice:
1743 * The index of the user's choice when a question is asked during the
1744 * mount operation. See the #GMountOperation::ask-question signal.
1749 * GMountOperation:domain:
1751 * The domain to use for the mount operation.
1756 * GMountOperation:password:
1758 * The password that is used for authentication when carrying out
1759 * the mount operation.
1764 * GMountOperation:password-save:
1766 * Determines if and how the password information should be saved.
1771 * GMountOperation:username:
1773 * The user name that is used for authentication when carrying out
1774 * the mount operation.
1781 * A #GSocketConnectable for resolving a hostname and connecting to
1789 * #GNetworkMonitor monitors the status of network connections and
1790 * indicates when a possibly-user-visible change has occurred.
1797 * GNetworkMonitor::network-changed:
1798 * @monitor: a #GNetworkMonitor
1799 * @available: the current value of #GNetworkMonitor:network-available
1801 * Emitted when the network configuration changes. If @available is
1802 * %TRUE, then some hosts may be reachable that were not reachable
1803 * before, while others that were reachable before may no longer be
1804 * reachable. If @available is %FALSE, then no remote hosts are
1812 * GNetworkMonitor:network-available:
1814 * Whether the network is considered available. That is, whether the
1815 * system has a default route for at least one of IPv4 or IPv6.
1817 * Real-world networks are of course much more complicated than
1818 * this; the machine may be connected to a wifi hotspot that
1819 * requires payment before allowing traffic through, or may be
1820 * connected to a functioning router that has lost its own upstream
1821 * connectivity. Some hosts might only be accessible when a VPN is
1822 * active. Other hosts might only be accessible when the VPN is
1823 * <emphasis>not</emphasis> active. Thus, it is best to use
1824 * g_network_monitor_can_reach() or
1825 * g_network_monitor_can_reach_async() to test for reachability on a
1826 * host-by-host basis. (On the other hand, when the property is
1827 * %FALSE, the application can reasonably expect that no remote
1828 * hosts at all are reachable, and should indicate this to the user
1831 * See also #GNetworkMonitor::network-changed.
1840 * A #GSocketConnectable for resolving a SRV record and connecting to
1848 * #GPermission is an opaque data structure and can only be accessed
1849 * using the following functions.
1854 * GPermission:allowed:
1856 * %TRUE if the caller currently has permission to perform the action that
1857 * @permission represents the permission to perform.
1862 * GPermission:can-acquire:
1864 * %TRUE if it is generally possible to acquire the permission by calling
1865 * g_permission_acquire().
1870 * GPermission:can-release:
1872 * %TRUE if it is generally possible to release the permission by calling
1873 * g_permission_release().
1880 * This type is opaque.
1887 * GPropertyAction:enabled:
1889 * If @action is currently enabled.
1891 * If the action is disabled then calls to g_action_activate() and
1892 * g_action_change_state() have no effect.
1899 * GPropertyAction:name:
1901 * The name of the action. This is mostly meaningful for identifying
1902 * the action once it has been added to a #GActionMap.
1909 * GPropertyAction:object:
1911 * The object to wrap a property on.
1913 * The object must be a non-%NULL #GObject with properties.
1920 * GPropertyAction:parameter-type:
1922 * The type of the parameter that must be given when activating the
1930 * GPropertyAction:property-name:
1932 * The name of the property to wrap on the object.
1934 * The property must exist on the passed-in object and it must be
1935 * readable and writable (and not construct-only).
1942 * GPropertyAction:state:
1944 * The state of the action, or %NULL if the action is stateless.
1951 * GPropertyAction:state-type:
1953 * The #GVariantType of the state that the action has, or %NULL if the
1954 * action is stateless.
1963 * A #GInetSocketAddress representing a connection via a proxy server
1970 * GProxyAddress:destination-protocol:
1972 * The protocol being spoke to the destination host, or %NULL if
1973 * the #GProxyAddress doesn't know.
1980 * GProxyAddress:uri:
1982 * The URI string that the proxy was constructed from (or %NULL
1983 * if the creator didn't specify this).
1990 * GProxyAddressEnumerator:default-port:
1992 * The default port to use if #GProxyAddressEnumerator:uri does not
2000 * GProxyAddressEnumerator:proxy-resolver:
2002 * The proxy resolver to use.
2009 * GRemoteActionGroupInterface:
2010 * @activate_action_full: the virtual function pointer for g_remote_action_group_activate_action_full()
2011 * @change_action_state_full: the virtual function pointer for g_remote_action_group_change_action_state_full()
2013 * The virtual function table for #GRemoteActionGroup.
2022 * The object that handles DNS resolution. Use g_resolver_get_default()
2023 * to get the default resolver.
2028 * GResolver::reload:
2029 * @resolver: a #GResolver
2031 * Emitted when the resolver notices that the system resolver
2032 * configuration has changed.
2037 * GSettings::change-event:
2038 * @settings: the object on which the signal was emitted
2039 * @keys: (array length=n_keys) (element-type GQuark) (allow-none): an array of #GQuark<!-- -->s for the changed keys, or %NULL
2040 * @n_keys: the length of the @keys array, or 0
2042 * The "change-event" signal is emitted once per change event that
2043 * affects this settings object. You should connect to this signal
2044 * only if you are interested in viewing groups of changes before they
2045 * are split out into multiple emissions of the "changed" signal.
2046 * For most use cases it is more appropriate to use the "changed" signal.
2048 * In the event that the change event applies to one or more specified
2049 * keys, @keys will be an array of #GQuark of length @n_keys. In the
2050 * event that the change event applies to the #GSettings object as a
2051 * whole (ie: potentially every key has been changed) then @keys will
2052 * be %NULL and @n_keys will be 0.
2054 * The default handler for this signal invokes the "changed" signal
2055 * for each affected key. If any other connected handler returns
2056 * %TRUE then this default functionality will be suppressed.
2058 * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
2063 * GSettings::changed:
2064 * @settings: the object on which the signal was emitted
2065 * @key: the name of the key that changed
2067 * The "changed" signal is emitted when a key has potentially changed.
2068 * You should call one of the g_settings_get() calls to check the new
2071 * This signal supports detailed connections. You can connect to the
2072 * detailed signal "changed::x" in order to only receive callbacks
2073 * when key "x" changes.
2078 * GSettings::writable-change-event:
2079 * @settings: the object on which the signal was emitted
2080 * @key: the quark of the key, or 0
2082 * The "writable-change-event" signal is emitted once per writability
2083 * change event that affects this settings object. You should connect
2084 * to this signal if you are interested in viewing groups of changes
2085 * before they are split out into multiple emissions of the
2086 * "writable-changed" signal. For most use cases it is more
2087 * appropriate to use the "writable-changed" signal.
2089 * In the event that the writability change applies only to a single
2090 * key, @key will be set to the #GQuark for that key. In the event
2091 * that the writability change affects the entire settings object,
2094 * The default handler for this signal invokes the "writable-changed"
2095 * and "changed" signals for each affected key. This is done because
2096 * changes in writability might also imply changes in value (if for
2097 * example, a new mandatory setting is introduced). If any other
2098 * connected handler returns %TRUE then this default functionality
2099 * will be suppressed.
2101 * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
2106 * GSettings::writable-changed:
2107 * @settings: the object on which the signal was emitted
2110 * The "writable-changed" signal is emitted when the writability of a
2111 * key has potentially changed. You should call
2112 * g_settings_is_writable() in order to determine the new status.
2114 * This signal supports detailed connections. You can connect to the
2115 * detailed signal "writable-changed::x" in order to only receive
2116 * callbacks when the writability of "x" changes.
2121 * GSettings:context:
2123 * The name of the context that the settings are stored in.
2128 * GSettings:delay-apply:
2130 * Whether the #GSettings object is in 'delay-apply' mode. See
2131 * g_settings_delay() for details.
2138 * GSettings:has-unapplied:
2140 * If this property is %TRUE, the #GSettings object has outstanding
2141 * changes that will be applied when g_settings_apply() is called.
2148 * The path within the backend where the settings are stored.
2155 * The name of the schema that describes the types of keys
2156 * for this #GSettings object.
2158 * The type of this property is *not* #GSettingsSchema.
2159 * #GSettingsSchema has only existed since version 2.32 and
2160 * unfortunately this name was used in previous versions to refer to
2161 * the schema ID rather than the schema itself. Take care to use the
2162 * 'settings-schema' property if you wish to pass in a
2165 * Deprecated: 2.32:Use the 'schema-id' property instead. In a future version, this property may instead refer to a #GSettingsSchema.
2170 * GSettings:schema-id:
2172 * The name of the schema that describes the types of keys
2173 * for this #GSettings object.
2178 * GSettings:settings-schema:
2180 * The #GSettingsSchema describing the types of keys for this
2181 * #GSettings object.
2183 * Ideally, this property would be called 'schema'. #GSettingsSchema
2184 * has only existed since version 2.32, however, and before then the
2185 * 'schema' property was used to refer to the ID of the schema rather
2186 * than the schema itself. Take care.
2193 * This is an opaque structure type. You may not access it directly.
2200 * GSettingsSchemaSource:
2202 * This is an opaque structure type. You may not access it directly.
2209 * GSimpleAction::activate:
2210 * @simple: the #GSimpleAction
2211 * @parameter: (allow-none): the parameter to the activation
2213 * Indicates that the action was just activated.
2215 * @parameter will always be of the expected type. In the event that
2216 * an incorrect type was given, no signal will be emitted.
2223 * GSimpleAction::change-state:
2224 * @simple: the #GSimpleAction
2225 * @value: (allow-none): the requested value for the state
2227 * Indicates that the action just received a request to change its
2230 * @value will always be of the correct state type. In the event that
2231 * an incorrect type was given, no signal will be emitted.
2233 * If no handler is connected to this signal then the default
2234 * behaviour is to call g_simple_action_set_state() to set the state
2235 * to the requested value. If you connect a signal handler then no
2236 * default action is taken. If the state should change then you must
2237 * call g_simple_action_set_state() from the handler.
2240 * <title>Example 'change-state' handler</title>
2243 * change_volume_state (GSimpleAction *action,
2245 * gpointer user_data)
2249 * requested = g_variant_get_int32 (value);
2251 * // Volume only goes from 0 to 10
2252 * if (0 <= requested && requested <= 10)
2253 * g_simple_action_set_state (action, value);
2258 * The handler need not set the state to the requested value. It
2259 * could set it to any value at all, or take some other action.
2266 * GSimpleAction:enabled:
2268 * If @action is currently enabled.
2270 * If the action is disabled then calls to g_action_activate() and
2271 * g_action_change_state() have no effect.
2278 * GSimpleAction:name:
2280 * The name of the action. This is mostly meaningful for identifying
2281 * the action once it has been added to a #GSimpleActionGroup.
2288 * GSimpleAction:parameter-type:
2290 * The type of the parameter that must be given when activating the
2298 * GSimpleAction:state:
2300 * The state of the action, or %NULL if the action is stateless.
2307 * GSimpleAction:state-type:
2309 * The #GVariantType of the state that the action has, or %NULL if the
2310 * action is stateless.
2317 * GSimplePermission:
2319 * #GSimplePermission is an opaque data structure. There are no methods
2320 * except for those defined by #GPermission.
2325 * GSimpleProxyResolver:default-proxy:
2327 * The default proxy URI that will be used for any URI that doesn't
2328 * match #GSimpleProxyResolver:ignore-hosts, and doesn't match any
2329 * of the schemes set with g_simple_proxy_resolver_set_uri_proxy().
2331 * Note that as a special case, if this URI starts with
2332 * "<literal>socks://</literal>", #GSimpleProxyResolver will treat
2333 * it as referring to all three of the <literal>socks5</literal>,
2334 * <literal>socks4a</literal>, and <literal>socks4</literal> proxy
2340 * GSimpleProxyResolver:ignore-hosts:
2342 * A list of hostnames and IP addresses that the resolver should
2343 * allow direct connections to.
2345 * Entries can be in one of 4 formats:
2349 * A hostname, such as "<literal>example.com</literal>",
2350 * "<literal>.example.com</literal>", or
2351 * "<literal>*.example.com</literal>", any of which match
2352 * "<literal>example.com</literal>" or any subdomain of it.
2355 * An IPv4 or IPv6 address, such as
2356 * "<literal>192.168.1.1</literal>", which matches only
2360 * A hostname or IP address followed by a port, such as
2361 * "<literal>example.com:80</literal>", which matches whatever
2362 * the hostname or IP address would match, but only for URLs
2363 * with the (explicitly) indicated port. In the case of an IPv6
2364 * address, the address part must appear in brackets:
2365 * "<literal>[::1]:443</literal>"
2368 * An IP address range, given by a base address and prefix length,
2369 * such as "<literal>fe80::/10</literal>", which matches any
2370 * address in that range.
2374 * Note that when dealing with Unicode hostnames, the matching is
2375 * done against the ASCII form of the name.
2377 * Also note that hostname exclusions apply only to connections made
2378 * to hosts identified by name, and IP address exclusions apply only
2379 * to connections made to hosts identified by address. That is, if
2380 * <literal>example.com</literal> has an address of
2381 * <literal>192.168.1.1</literal>, and the :ignore-hosts list
2382 * contains only "<literal>192.168.1.1</literal>", then a connection
2383 * to "<literal>example.com</literal>" (eg, via a #GNetworkAddress)
2384 * will use the proxy, and a connection to
2385 * "<literal>192.168.1.1</literal>" (eg, via a #GInetSocketAddress)
2388 * These rules match the "ignore-hosts"/"noproxy" rules most
2389 * commonly used by other applications.
2394 * GSocket:broadcast:
2396 * Whether the socket should allow sending to broadcast addresses.
2403 * GSocket:multicast-loopback:
2405 * Whether outgoing multicast packets loop back to the local host.
2412 * GSocket:multicast-ttl:
2414 * Time-to-live out outgoing multicast packets
2423 * The timeout in seconds on socket I/O
2432 * Time-to-live for outgoing unicast packets
2441 * A socket endpoint address, corresponding to <type>struct sockaddr</type>
2442 * or one of its subtypes.
2447 * GSocketClient::event:
2448 * @client: the #GSocketClient
2449 * @event: the event that is occurring
2450 * @connectable: the #GSocketConnectable that @event is occurring on
2451 * @connection: the current representation of the connection
2453 * Emitted when @client's activity on @connectable changes state.
2454 * Among other things, this can be used to provide progress
2455 * information about a network connection in the UI. The meanings of
2456 * the different @event values are as follows:
2460 * <term>%G_SOCKET_CLIENT_RESOLVING:</term>
2462 * @client is about to look up @connectable in DNS.
2463 * @connection will be %NULL.
2464 * </para></listitem>
2467 * <term>%G_SOCKET_CLIENT_RESOLVED:</term>
2469 * @client has successfully resolved @connectable in DNS.
2470 * @connection will be %NULL.
2471 * </para></listitem>
2474 * <term>%G_SOCKET_CLIENT_CONNECTING:</term>
2476 * @client is about to make a connection to a remote host;
2477 * either a proxy server or the destination server itself.
2478 * @connection is the #GSocketConnection, which is not yet
2480 * </para></listitem>
2483 * <term>%G_SOCKET_CLIENT_CONNECTED:</term>
2485 * @client has successfully connected to a remote host.
2486 * @connection is the connected #GSocketConnection.
2487 * </para></listitem>
2490 * <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATING:</term>
2492 * @client is about to negotiate with a proxy to get it to
2493 * connect to @connectable. @connection is the
2494 * #GSocketConnection to the proxy server.
2495 * </para></listitem>
2498 * <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATED:</term>
2500 * @client has negotiated a connection to @connectable through
2501 * a proxy server. @connection is the stream returned from
2502 * g_proxy_connect(), which may or may not be a
2503 * #GSocketConnection.
2504 * </para></listitem>
2507 * <term>%G_SOCKET_CLIENT_TLS_HANDSHAKING:</term>
2509 * @client is about to begin a TLS handshake. @connection is a
2510 * #GTlsClientConnection.
2511 * </para></listitem>
2514 * <term>%G_SOCKET_CLIENT_TLS_HANDSHAKED:</term>
2516 * @client has successfully completed the TLS handshake.
2517 * @connection is a #GTlsClientConnection.
2518 * </para></listitem>
2521 * <term>%G_SOCKET_CLIENT_COMPLETE:</term>
2523 * @client has either successfully connected to @connectable
2524 * (in which case @connection is the #GSocketConnection that
2525 * it will be returning to the caller) or has failed (in which
2526 * case @connection is %NULL and the client is about to return
2528 * </para></listitem>
2532 * Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted
2533 * multiple times (or not at all) for a given connectable (in
2534 * particular, if @client ends up attempting to connect to more than
2535 * one address). However, if @client emits the #GSocketClient::event
2536 * signal at all for a given connectable, that it will always emit
2537 * it with %G_SOCKET_CLIENT_COMPLETE when it is done.
2539 * Note that there may be additional #GSocketClientEvent values in
2540 * the future; unrecognized @event values should be ignored.
2547 * GSocketClient:proxy-resolver:
2549 * The proxy resolver to use
2556 * GSocketService::incoming:
2557 * @service: the #GSocketService
2558 * @connection: a new #GSocketConnection object
2559 * @source_object: (allow-none): the source_object passed to g_socket_listener_add_address()
2561 * The ::incoming signal is emitted when a new incoming connection
2562 * to @service needs to be handled. The handler must initiate the
2563 * handling of @connection, but may not block; in essence,
2564 * asynchronous operations must be used.
2566 * @connection will be unreffed once the signal handler returns,
2567 * so you need to ref it yourself if you are planning to use it.
2569 * Returns: %TRUE to stop other handlers from being called
2577 * A single target host/port that a network service is running on.
2584 * The opaque object representing a synchronous or asynchronous task
2592 * @source_object: (type GObject): @task's source object
2593 * @task_data: @task's task data
2594 * @cancellable: @task's #GCancellable, or %NULL
2596 * The prototype for a task function to be run in a thread via
2597 * g_task_run_in_thread() or g_task_run_in_thread_sync().
2599 * If the return-on-cancel flag is set on @task, and @cancellable gets
2600 * cancelled, then the #GTask will be completed immediately (as though
2601 * g_task_return_error_if_cancelled() had been called), without
2602 * waiting for the task function to complete. However, the task
2603 * function will continue running in its thread in the background. The
2604 * function therefore needs to be careful about how it uses
2605 * externally-visible state in this case. See
2606 * g_task_set_return_on_cancel() for more details.
2608 * Other than in that case, @task will be completed when the
2609 * #GTaskThreadFunc returns, <emphasis>not</emphasis> when it calls
2610 * a <literal>g_task_return_</literal> function.
2619 * The #GTestDBus structure contains only private data and
2620 * should only be accessed using the provided API.
2629 * #GTestDBusFlags specifying the behaviour of the dbus session
2643 * GThemedIcon:names:
2645 * A %NULL-terminated array of icon names.
2650 * GThemedIcon:use-default-fallbacks:
2652 * Whether to use the default fallbacks found by shortening the icon name
2653 * at '-' characters. If the "names" array has more than one element,
2654 * ignores any past the first.
2656 * For example, if the icon name was "gnome-dev-cdrom-audio", the array
2660 * "gnome-dev-cdrom-audio",
2661 * "gnome-dev-cdrom",
2671 * GThreadedSocketService::run:
2672 * @service: the #GThreadedSocketService.
2673 * @connection: a new #GSocketConnection object.
2674 * @source_object: the source_object passed to g_socket_listener_add_address().
2676 * The ::run signal is emitted in a worker thread in response to an
2677 * incoming connection. This thread is dedicated to handling
2678 * @connection and may perform blocking IO. The signal handler need
2679 * not return until the connection is closed.
2681 * Returns: %TRUE to stop further signal handlers from being called
2688 * TLS (Transport Layer Security, aka SSL) backend. This is an
2689 * internal type used to coordinate the different classes implemented
2699 * Abstract base class for TLS certificate types.
2706 * GTlsCertificate:certificate:
2708 * The DER (binary) encoded representation of the certificate.
2709 * This property and the #GTlsCertificate:certificate-pem property
2710 * represent the same data, just in different forms.
2717 * GTlsCertificate:certificate-pem:
2719 * The PEM (ASCII) encoded representation of the certificate.
2720 * This property and the #GTlsCertificate:certificate
2721 * property represent the same data, just in different forms.
2728 * GTlsCertificate:issuer:
2730 * A #GTlsCertificate representing the entity that issued this
2731 * certificate. If %NULL, this means that the certificate is either
2732 * self-signed, or else the certificate of the issuer is not
2740 * GTlsCertificate:private-key:
2742 * The DER (binary) encoded representation of the certificate's
2743 * private key, in either PKCS#1 format or unencrypted PKCS#8
2744 * format. This property (or the #GTlsCertificate:private-key-pem
2745 * property) can be set when constructing a key (eg, from a file),
2746 * but cannot be read.
2748 * PKCS#8 format is supported since 2.32; earlier releases only
2749 * support PKCS#1. You can use the <literal>openssl rsa</literal>
2750 * tool to convert PKCS#8 keys to PKCS#1.
2757 * GTlsCertificate:private-key-pem:
2759 * The PEM (ASCII) encoded representation of the certificate's
2760 * private key in either PKCS#1 format ("<literal>BEGIN RSA PRIVATE
2761 * KEY</literal>") or unencrypted PKCS#8 format ("<literal>BEGIN
2762 * PRIVATE KEY</literal>"). This property (or the
2763 * #GTlsCertificate:private-key property) can be set when
2764 * constructing a key (eg, from a file), but cannot be read.
2766 * PKCS#8 format is supported since 2.32; earlier releases only
2767 * support PKCS#1. You can use the <literal>openssl rsa</literal>
2768 * tool to convert PKCS#8 keys to PKCS#1.
2775 * GTlsClientConnection:
2777 * Abstract base class for the backend-specific client connection
2785 * GTlsClientConnection:accepted-cas:
2787 * A list of the distinguished names of the Certificate Authorities
2788 * that the server will accept client certificates signed by. If the
2789 * server requests a client certificate during the handshake, then
2790 * this property will be set after the handshake completes.
2792 * Each item in the list is a #GByteArray which contains the complete
2793 * subject DN of the certificate authority.
2800 * GTlsClientConnection:server-identity:
2802 * A #GSocketConnectable describing the identity of the server that
2803 * is expected on the other end of the connection.
2805 * If the %G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in
2806 * #GTlsClientConnection:validation-flags, this object will be used
2807 * to determine the expected identify of the remote end of the
2808 * connection; if #GTlsClientConnection:server-identity is not set,
2809 * or does not match the identity presented by the server, then the
2810 * %G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail.
2812 * In addition to its use in verifying the server certificate,
2813 * this is also used to give a hint to the server about what
2814 * certificate we expect, which is useful for servers that serve
2822 * GTlsClientConnection:use-ssl3:
2824 * If %TRUE, tells the connection to use SSL 3.0 rather than trying
2825 * to negotiate the best version of TLS or SSL to use. This can be
2826 * used when talking to servers that don't implement version
2827 * negotiation correctly and therefore refuse to handshake at all with
2828 * a "modern" TLS handshake.
2835 * GTlsClientConnection:validation-flags:
2837 * What steps to perform when validating a certificate received from
2838 * a server. Server certificates that fail to validate in all of the
2839 * ways indicated here will be rejected unless the application
2840 * overrides the default via #GTlsConnection::accept-certificate.
2849 * Abstract base class for the backend-specific #GTlsClientConnection
2850 * and #GTlsServerConnection types.
2857 * GTlsConnection::accept-certificate:
2858 * @conn: a #GTlsConnection
2859 * @peer_cert: the peer's #GTlsCertificate
2860 * @errors: the problems with @peer_cert.
2862 * Emitted during the TLS handshake after the peer certificate has
2863 * been received. You can examine @peer_cert's certification path by
2864 * calling g_tls_certificate_get_issuer() on it.
2866 * For a client-side connection, @peer_cert is the server's
2867 * certificate, and the signal will only be emitted if the
2868 * certificate was not acceptable according to @conn's
2869 * #GTlsClientConnection:validation_flags. If you would like the
2870 * certificate to be accepted despite @errors, return %TRUE from the
2871 * signal handler. Otherwise, if no handler accepts the certificate,
2872 * the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE.
2874 * For a server-side connection, @peer_cert is the certificate
2875 * presented by the client, if this was requested via the server's
2876 * #GTlsServerConnection:authentication_mode. On the server side,
2877 * the signal is always emitted when the client presents a
2878 * certificate, and the certificate will only be accepted if a
2879 * handler returns %TRUE.
2881 * Note that if this signal is emitted as part of asynchronous I/O
2882 * in the main thread, then you should not attempt to interact with
2883 * the user before returning from the signal handler. If you want to
2884 * let the user decide whether or not to accept the certificate, you
2885 * would have to return %FALSE from the signal handler on the first
2886 * attempt, and then after the connection attempt returns a
2887 * %G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if
2888 * the user decides to accept the certificate, remember that fact,
2889 * create a new connection, and return %TRUE from the signal handler
2892 * If you are doing I/O in another thread, you do not
2893 * need to worry about this, and can simply block in the signal
2894 * handler until the UI thread returns an answer.
2896 * 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.
2902 * GTlsConnection:base-io-stream:
2904 * The #GIOStream that the connection wraps
2911 * GTlsConnection:certificate:
2913 * The connection's certificate; see
2914 * g_tls_connection_set_certificate().
2921 * GTlsConnection:database:
2923 * The certificate database to use when verifying this TLS connection.
2924 * If no cerificate database is set, then the default database will be
2925 * used. See g_tls_backend_get_default_database().
2932 * GTlsConnection:interaction:
2934 * A #GTlsInteraction object to be used when the connection or certificate
2935 * database need to interact with the user. This will be used to prompt the
2936 * user for passwords where necessary.
2943 * GTlsConnection:peer-certificate:
2945 * The connection's peer's certificate, after the TLS handshake has
2946 * completed and the certificate has been accepted. Note in
2947 * particular that this is not yet set during the emission of
2948 * #GTlsConnection::accept-certificate.
2950 * (You can watch for a #GObject::notify signal on this property to
2951 * detect when a handshake has occurred.)
2958 * GTlsConnection:peer-certificate-errors:
2960 * The errors noticed-and-ignored while verifying
2961 * #GTlsConnection:peer-certificate. Normally this should be 0, but
2962 * it may not be if #GTlsClientConnection:validation-flags is not
2963 * %G_TLS_CERTIFICATE_VALIDATE_ALL, or if
2964 * #GTlsConnection::accept-certificate overrode the default
2972 * GTlsConnection:rehandshake-mode:
2974 * The rehandshaking mode. See
2975 * g_tls_connection_set_rehandshake_mode().
2982 * GTlsConnection:require-close-notify:
2984 * Whether or not proper TLS close notification is required.
2985 * See g_tls_connection_set_require_close_notify().
2992 * GTlsConnection:use-system-certdb:
2994 * Whether or not the system certificate database will be used to
2995 * verify peer certificates. See
2996 * g_tls_connection_set_use_system_certdb().
2998 * Deprecated: 2.30: Use GTlsConnection:database instead
3005 * Abstract base class for the backend-specific database types.
3014 * Implemented by a #GTlsDatabase which allows you to load certificates
3022 * GTlsFileDatabase:anchors:
3024 * The path to a file containing PEM encoded certificate authority
3025 * root anchors. The certificates in this file will be treated as
3026 * root authorities for the purpose of verifying other certificates
3027 * via the g_tls_database_verify_chain() operation.
3036 * An object representing interaction that the TLS connection and database
3037 * might have with the user.
3044 * GTlsInteractionClass:
3045 * @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.
3046 * @ask_password_async: ask for a password asynchronously.
3047 * @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.
3049 * The class for #GTlsInteraction. Derived classes implement the various
3050 * virtual interaction methods to handle TLS interactions.
3052 * Derived classes can choose to implement whichever interactions methods they'd
3053 * like to support by overriding those virtual methods in their class
3054 * initialization function. If a derived class implements an async method,
3055 * it must also implement the corresponding finish method.
3057 * The synchronous interaction methods should implement to display modal dialogs,
3058 * and the asynchronous methods to display modeless dialogs.
3060 * If the user cancels an interaction, then the result should be
3061 * %G_TLS_INTERACTION_FAILED and the error should be set with a domain of
3062 * %G_IO_ERROR and code of %G_IO_ERROR_CANCELLED.
3071 * An abstract interface representing a password used in TLS. Often used in
3072 * user interaction such as unlocking a key storage token.
3079 * GTlsServerConnection:authentication-mode:
3081 * The #GTlsAuthenticationMode for the server. This can be changed
3082 * before calling g_tls_connection_handshake() if you want to
3083 * rehandshake with a different mode from the initial handshake.
3090 * GUnixCredentialsMessage:credentials:
3092 * The credentials stored in the message.
3099 * GUnixInputStream:close-fd:
3101 * Whether to close the file descriptor when the stream is closed.
3108 * GUnixInputStream:fd:
3110 * The file descriptor that the stream reads from.
3117 * GUnixMountMonitor::mountpoints-changed:
3118 * @monitor: the object on which the signal is emitted
3120 * Emitted when the unix mount points have changed.
3125 * GUnixMountMonitor::mounts-changed:
3126 * @monitor: the object on which the signal is emitted
3128 * Emitted when the unix mounts have changed.
3133 * GUnixOutputStream:close-fd:
3135 * Whether to close the file descriptor when the stream is closed.
3142 * GUnixOutputStream:fd:
3144 * The file descriptor that the stream writes to.
3151 * GUnixSocketAddress:
3153 * A UNIX-domain (local) socket address, corresponding to a
3154 * <type>struct sockaddr_un</type>.
3159 * GUnixSocketAddress:abstract:
3161 * Whether or not this is an abstract address
3163 * Deprecated: Use #GUnixSocketAddress:address-type, which distinguishes between zero-padded and non-zero-padded abstract addresses.
3170 * Emitted when the volume has been changed.
3177 * This signal is emitted when the #GVolume have been removed. If
3178 * the recipient is holding references to the object they should
3179 * release them so the object can be finalized.
3184 * GVolumeMonitor::drive-changed:
3185 * @volume_monitor: The volume monitor emitting the signal.
3186 * @drive: the drive that changed
3188 * Emitted when a drive changes.
3193 * GVolumeMonitor::drive-connected:
3194 * @volume_monitor: The volume monitor emitting the signal.
3195 * @drive: a #GDrive that was connected.
3197 * Emitted when a drive is connected to the system.
3202 * GVolumeMonitor::drive-disconnected:
3203 * @volume_monitor: The volume monitor emitting the signal.
3204 * @drive: a #GDrive that was disconnected.
3206 * Emitted when a drive is disconnected from the system.
3211 * GVolumeMonitor::drive-eject-button:
3212 * @volume_monitor: The volume monitor emitting the signal.
3213 * @drive: the drive where the eject button was pressed
3215 * Emitted when the eject button is pressed on @drive.
3222 * GVolumeMonitor::drive-stop-button:
3223 * @volume_monitor: The volume monitor emitting the signal.
3224 * @drive: the drive where the stop button was pressed
3226 * Emitted when the stop button is pressed on @drive.
3233 * GVolumeMonitor::mount-added:
3234 * @volume_monitor: The volume monitor emitting the signal.
3235 * @mount: a #GMount that was added.
3237 * Emitted when a mount is added.
3242 * GVolumeMonitor::mount-changed:
3243 * @volume_monitor: The volume monitor emitting the signal.
3244 * @mount: a #GMount that changed.
3246 * Emitted when a mount changes.
3251 * GVolumeMonitor::mount-pre-unmount:
3252 * @volume_monitor: The volume monitor emitting the signal.
3253 * @mount: a #GMount that is being unmounted.
3255 * Emitted when a mount is about to be removed.
3260 * GVolumeMonitor::mount-removed:
3261 * @volume_monitor: The volume monitor emitting the signal.
3262 * @mount: a #GMount that was removed.
3264 * Emitted when a mount is removed.
3269 * GVolumeMonitor::volume-added:
3270 * @volume_monitor: The volume monitor emitting the signal.
3271 * @volume: a #GVolume that was added.
3273 * Emitted when a mountable volume is added to the system.
3278 * GVolumeMonitor::volume-changed:
3279 * @volume_monitor: The volume monitor emitting the signal.
3280 * @volume: a #GVolume that changed.
3282 * Emitted when mountable volume is changed.
3287 * GVolumeMonitor::volume-removed:
3288 * @volume_monitor: The volume monitor emitting the signal.
3289 * @volume: a #GVolume that was removed.
3291 * Emitted when a mountable volume is removed from the system.
3296 * GWin32InputStream:close-handle:
3298 * Whether to close the file handle when the stream is closed.
3305 * GWin32InputStream:handle:
3307 * The handle that the stream reads from.
3314 * GWin32OutputStream:close-handle:
3316 * Whether to close the file handle when the stream is closed.
3323 * GWin32OutputStream:handle:
3325 * The file handle that the stream writes to.
3334 * Zlib decompression
3339 * GZlibCompressor:file-info:
3341 * If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is
3342 * %G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name
3343 * and modification time from the file info to the GZIP header.
3350 * GZlibDecompressor:
3352 * Zlib decompression
3357 * GZlibDecompressor:file-info:
3359 * A #GFileInfo containing the information found in the GZIP header
3360 * of the data stream processed, or %NULL if the header was not yet
3361 * fully processed, is not present at all, or the compressor's
3362 * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP.
3369 * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT:
3371 * The purpose used to verify the client certificate in a TLS connection.
3372 * Used by TLS servers.
3377 * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER:
3379 * The purpose used to verify the server certificate in a TLS connection. This
3380 * is the most common purpose in use. Used by TLS clients.
3385 * G_TYPE_SETTINGS_SCHEMA:
3387 * A boxed #GType corresponding to #GSettingsSchema.
3394 * G_TYPE_SETTINGS_SCHEMA_SOURCE:
3396 * A boxed #GType corresponding to #GSettingsSchemaSource.
3403 * SECTION:extensionpoints
3404 * @short_description: Extension Points
3406 * @see_also: <link linkend="extending-gio">Extending GIO</link>
3408 * #GIOExtensionPoint provides a mechanism for modules to extend the
3409 * functionality of the library or application that loaded it in an
3410 * organized fashion.
3412 * An extension point is identified by a name, and it may optionally
3413 * require that any implementation must by of a certain type (or derived
3414 * thereof). Use g_io_extension_point_register() to register an
3415 * extension point, and g_io_extension_point_set_required_type() to
3416 * set a required type.
3418 * A module can implement an extension point by specifying the #GType
3419 * that implements the functionality. Additionally, each implementation
3420 * of an extension point has a name, and a priority. Use
3421 * g_io_extension_point_implement() to implement an extension point.
3424 * GIOExtensionPoint *ep;
3426 * /* Register an extension point */
3427 * ep = g_io_extension_point_register ("my-extension-point");
3428 * g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE);
3432 * /* Implement an extension point */
3433 * G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
3434 * g_io_extension_point_implement ("my-extension-point",
3435 * my_example_impl_get_type (),
3440 * It is up to the code that registered the extension point how
3441 * it uses the implementations that have been associated with it.
3442 * Depending on the use case, it may use all implementations, or
3443 * only the one with the highest priority, or pick a specific
3446 * To avoid opening all modules just to find out what extension
3447 * points they implement, GIO makes use of a caching mechanism,
3448 * see <link linkend="gio-querymodules">gio-querymodules</link>.
3449 * You are expected to run this command after installing a
3452 * The <envar>GIO_EXTRA_MODULES</envar> environment variable can be
3453 * used to specify additional directories to automatically load modules
3454 * from. This environment variable has the same syntax as the
3455 * <envar>PATH</envar>. If two modules have the same base name in different
3456 * directories, then the latter one will be ignored. If additional
3457 * directories are specified GIO will load modules from the built-in
3465 * @short_description: An action interface
3467 * #GAction represents a single named action.
3469 * The main interface to an action is that it can be activated with
3470 * g_action_activate(). This results in the 'activate' signal being
3471 * emitted. An activation has a #GVariant parameter (which may be
3472 * %NULL). The correct type for the parameter is determined by a static
3473 * parameter type (which is given at construction time).
3475 * An action may optionally have a state, in which case the state may be
3476 * set with g_action_change_state(). This call takes a #GVariant. The
3477 * correct type for the state is determined by a static state type
3478 * (which is given at construction time).
3480 * The state may have a hint associated with it, specifying its valid
3483 * #GAction is merely the interface to the concept of an action, as
3484 * described above. Various implementations of actions exist, including
3485 * #GSimpleAction and #GtkAction.
3487 * In all cases, the implementing class is responsible for storing the
3488 * name of the action, the parameter type, the enabled state, the
3489 * optional state type and the state and emitting the appropriate
3490 * signals when these change. The implementor responsible for filtering
3491 * calls to g_action_activate() and g_action_change_state() for type
3492 * safety and for the state being enabled.
3494 * Probably the only useful thing to do with a #GAction is to put it
3495 * inside of a #GSimpleActionGroup.
3500 * SECTION:gactiongroup
3501 * @title: GActionGroup
3502 * @short_description: A group of actions
3503 * @see_also: #GAction
3505 * #GActionGroup represents a group of actions. Actions can be used to
3506 * expose functionality in a structured way, either from one part of a
3507 * program to another, or to the outside world. Action groups are often
3508 * used together with a #GMenuModel that provides additional
3509 * representation data for displaying the actions to the user, e.g. in
3512 * The main way to interact with the actions in a GActionGroup is to
3513 * activate them with g_action_group_activate_action(). Activating an
3514 * action may require a #GVariant parameter. The required type of the
3515 * parameter can be inquired with g_action_group_get_action_parameter_type().
3516 * Actions may be disabled, see g_action_group_get_action_enabled().
3517 * Activating a disabled action has no effect.
3519 * Actions may optionally have a state in the form of a #GVariant. The
3520 * current state of an action can be inquired with
3521 * g_action_group_get_action_state(). Activating a stateful action may
3522 * change its state, but it is also possible to set the state by calling
3523 * g_action_group_change_action_state().
3525 * As typical example, consider a text editing application which has an
3526 * option to change the current font to 'bold'. A good way to represent
3527 * this would be a stateful action, with a boolean state. Activating the
3528 * action would toggle the state.
3530 * Each action in the group has a unique name (which is a string). All
3531 * method calls, except g_action_group_list_actions() take the name of
3532 * an action as an argument.
3534 * The #GActionGroup API is meant to be the 'public' API to the action
3535 * group. The calls here are exactly the interaction that 'external
3536 * forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have
3537 * with actions. 'Internal' APIs (ie: ones meant only to be accessed by
3538 * the action group implementation) are found on subclasses. This is
3539 * why you will find - for example - g_action_group_get_action_enabled()
3540 * but not an equivalent <function>set()</function> call.
3542 * Signals are emitted on the action group in response to state changes
3543 * on individual actions.
3545 * Implementations of #GActionGroup should provide implementations for
3546 * the virtual functions g_action_group_list_actions() and
3547 * g_action_group_query_action(). The other virtual functions should
3548 * not be implemented - their "wrappers" are actually implemented with
3549 * calls to g_action_group_query_action().
3554 * SECTION:gactiongroupexporter
3555 * @title: GActionGroup exporter
3556 * @short_description: Export GActionGroups on D-Bus
3557 * @see_also: #GActionGroup, #GDBusActionGroup
3559 * These functions support exporting a #GActionGroup on D-Bus.
3560 * The D-Bus interface that is used is a private implementation
3563 * To access an exported #GActionGroup remotely, use
3564 * g_dbus_action_group_get() to obtain a #GDBusActionGroup.
3569 * SECTION:gactionmap
3570 * @title: GActionMap
3571 * @short_description: Interface for action containers
3573 * The GActionMap interface is implemented by #GActionGroup
3574 * implementations that operate by containing a number of
3575 * named #GAction instances, such as #GSimpleActionGroup.
3577 * One useful application of this interface is to map the
3578 * names of actions from various action groups to unique,
3579 * prefixed names (e.g. by prepending "app." or "win.").
3580 * This is the motivation for the 'Map' part of the interface
3589 * @short_description: Application information and launch contexts
3590 * @include: gio/gio.h
3592 * #GAppInfo and #GAppLaunchContext are used for describing and launching
3593 * applications installed on the system.
3595 * As of GLib 2.20, URIs will always be converted to POSIX paths
3596 * (using g_file_get_path()) when using g_app_info_launch() even if
3597 * the application requested an URI and not a POSIX path. For example
3598 * for an desktop-file based application with Exec key <literal>totem
3599 * %U</literal> and a single URI,
3600 * <literal>sftp://foo/file.avi</literal>, then
3601 * <literal>/home/user/.gvfs/sftp on foo/file.avi</literal> will be
3602 * passed. This will only work if a set of suitable GIO extensions
3603 * (such as gvfs 2.26 compiled with FUSE support), is available and
3604 * operational; if this is not the case, the URI will be passed
3605 * unmodified to the application. Some URIs, such as
3606 * <literal>mailto:</literal>, of course cannot be mapped to a POSIX
3607 * path (in gvfs there's no FUSE mount for it); such URIs will be
3608 * passed unmodified to the application.
3610 * Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
3611 * back to the GIO URI in the #GFile constructors (since gvfs
3612 * implements the #GVfs extension point). As such, if the application
3613 * needs to examine the URI, it needs to use g_file_get_uri() or
3614 * similar on #GFile. In other words, an application cannot assume
3615 * that the URI passed to e.g. g_file_new_for_commandline_arg() is
3616 * equal to the result of g_file_get_uri(). The following snippet
3623 * file = g_file_new_for_commandline_arg (uri_from_commandline);
3625 * uri = g_file_get_uri (file);
3626 * strcmp (uri, uri_from_commandline) == 0; // FALSE
3629 * if (g_file_has_uri_scheme (file, "cdda"))
3631 * // do something special with uri
3633 * g_object_unref (file);
3636 * This code will work when both <literal>cdda://sr0/Track
3637 * 1.wav</literal> and <literal>/home/user/.gvfs/cdda on sr0/Track
3638 * 1.wav</literal> is passed to the application. It should be noted
3639 * that it's generally not safe for applications to rely on the format
3640 * of a particular URIs. Different launcher applications (e.g. file
3641 * managers) may have different ideas of what a given URI means.
3646 * SECTION:gapplication
3647 * @title: GApplication
3648 * @short_description: Core application class
3650 * A #GApplication is the foundation of an application. It wraps some
3651 * low-level platform-specific services and is intended to act as the
3652 * foundation for higher-level application classes such as
3653 * #GtkApplication or #MxApplication. In general, you should not use
3654 * this class outside of a higher level framework.
3656 * GApplication provides convenient life cycle management by maintaining
3657 * a <firstterm>use count</firstterm> for the primary application instance.
3658 * The use count can be changed using g_application_hold() and
3659 * g_application_release(). If it drops to zero, the application exits.
3660 * Higher-level classes such as #GtkApplication employ the use count to
3661 * ensure that the application stays alive as long as it has any opened
3664 * Another feature that GApplication (optionally) provides is process
3665 * uniqueness. Applications can make use of this functionality by
3666 * providing a unique application ID. If given, only one application
3667 * with this ID can be running at a time per session. The session
3668 * concept is platform-dependent, but corresponds roughly to a graphical
3669 * desktop login. When your application is launched again, its
3670 * arguments are passed through platform communication to the already
3671 * running program. The already running instance of the program is
3672 * called the <firstterm>primary instance</firstterm>; for non-unique
3673 * applications this is the always the current instance.
3674 * On Linux, the D-Bus session bus is used for communication.
3676 * The use of #GApplication differs from some other commonly-used
3677 * uniqueness libraries (such as libunique) in important ways. The
3678 * application is not expected to manually register itself and check if
3679 * it is the primary instance. Instead, the <code>main()</code>
3680 * function of a #GApplication should do very little more than
3681 * instantiating the application instance, possibly connecting signal
3682 * handlers, then calling g_application_run(). All checks for
3683 * uniqueness are done internally. If the application is the primary
3684 * instance then the startup signal is emitted and the mainloop runs.
3685 * If the application is not the primary instance then a signal is sent
3686 * to the primary instance and g_application_run() promptly returns.
3687 * See the code examples below.
3689 * If used, the expected form of an application identifier is very close
3691 * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface">DBus bus name</ulink>.
3692 * Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator".
3693 * For details on valid application identifiers, see g_application_id_is_valid().
3695 * On Linux, the application identifier is claimed as a well-known bus name
3696 * on the user's session bus. This means that the uniqueness of your
3697 * application is scoped to the current session. It also means that your
3698 * application may provide additional services (through registration of other
3699 * object paths) at that bus name. The registration of these object paths
3700 * should be done with the shared GDBus session bus. Note that due to the
3701 * internal architecture of GDBus, method calls can be dispatched at any time
3702 * (even if a main loop is not running). For this reason, you must ensure that
3703 * any object paths that you wish to register are registered before #GApplication
3704 * attempts to acquire the bus name of your application (which happens in
3705 * g_application_register()). Unfortunately, this means that you cannot use
3706 * g_application_get_is_remote() to decide if you want to register object paths.
3708 * GApplication also implements the #GActionGroup and #GActionMap
3709 * interfaces and lets you easily export actions by adding them with
3710 * g_action_map_add_action(). When invoking an action by calling
3711 * g_action_group_activate_action() on the application, it is always
3712 * invoked in the primary instance. The actions are also exported on
3713 * the session bus, and GIO provides the #GDBusActionGroup wrapper to
3714 * conveniently access them remotely. GIO provides a #GDBusMenuModel wrapper
3715 * for remote access to exported #GMenuModels.
3717 * There is a number of different entry points into a GApplication:
3719 * <listitem>via 'Activate' (i.e. just starting the application)</listitem>
3720 * <listitem>via 'Open' (i.e. opening some files)</listitem>
3721 * <listitem>by handling a command-line</listitem>
3722 * <listitem>via activating an action</listitem>
3724 * The #GApplication::startup signal lets you handle the application
3725 * initialization for all of these in a single place.
3727 * Regardless of which of these entry points is used to start the application,
3728 * GApplication passes some <firstterm id="platform-data">platform
3729 * data</firstterm> from the launching instance to the primary instance,
3730 * in the form of a #GVariant dictionary mapping strings to variants.
3731 * To use platform data, override the @before_emit or @after_emit virtual
3732 * functions in your #GApplication subclass. When dealing with
3733 * #GApplicationCommandLine objects, the platform data is directly
3734 * available via g_application_command_line_get_cwd(),
3735 * g_application_command_line_get_environ() and
3736 * g_application_command_line_get_platform_data().
3738 * As the name indicates, the platform data may vary depending on the
3739 * operating system, but it always includes the current directory (key
3740 * "cwd"), and optionally the environment (ie the set of environment
3741 * variables and their values) of the calling process (key "environ").
3742 * The environment is only added to the platform data if the
3743 * %G_APPLICATION_SEND_ENVIRONMENT flag is set. #GApplication subclasses
3744 * can add their own platform data by overriding the @add_platform_data
3745 * virtual function. For instance, #GtkApplication adds startup notification
3748 * To parse commandline arguments you may handle the
3749 * #GApplication::command-line signal or override the local_command_line()
3750 * vfunc, to parse them in either the primary instance or the local instance,
3753 * <example id="gapplication-example-open"><title>Opening files with a GApplication</title>
3755 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-open.c">
3756 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3761 * <example id="gapplication-example-actions"><title>A GApplication with actions</title>
3763 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-actions.c">
3764 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3769 * <example id="gapplication-example-menu"><title>A GApplication with menus</title>
3771 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-menu.c">
3772 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3777 * <example id="gapplication-example-dbushooks"><title>Using extra D-Bus hooks with a GApplication</title>
3779 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-dbushooks.c">
3780 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3788 * SECTION:gapplicationcommandline
3789 * @title: GApplicationCommandLine
3790 * @short_description: A command-line invocation of an application
3791 * @see_also: #GApplication
3793 * #GApplicationCommandLine represents a command-line invocation of
3794 * an application. It is created by #GApplication and emitted
3795 * in the #GApplication::command-line signal and virtual function.
3797 * The class contains the list of arguments that the program was invoked
3798 * with. It is also possible to query if the commandline invocation was
3799 * local (ie: the current process is running in direct response to the
3800 * invocation) or remote (ie: some other process forwarded the
3801 * commandline to this process).
3803 * The GApplicationCommandLine object can provide the @argc and @argv
3804 * parameters for use with the #GOptionContext command-line parsing API,
3805 * with the g_application_command_line_get_arguments() function. See
3806 * <xref linkend="gapplication-example-cmdline3"/> for an example.
3808 * The exit status of the originally-invoked process may be set and
3809 * messages can be printed to stdout or stderr of that process. The
3810 * lifecycle of the originally-invoked process is tied to the lifecycle
3811 * of this object (ie: the process exits when the last reference is
3814 * The main use for #GApplicationCommandLine (and the
3815 * #GApplication::command-line signal) is 'Emacs server' like use cases:
3816 * You can set the <envar>EDITOR</envar> environment variable to have
3817 * e.g. git use your favourite editor to edit commit messages, and if you
3818 * already have an instance of the editor running, the editing will happen
3819 * in the running instance, instead of opening a new one. An important
3820 * aspect of this use case is that the process that gets started by git
3821 * does not return until the editing is done.
3823 * <example id="gapplication-example-cmdline"><title>Handling commandline arguments with GApplication</title>
3825 * A simple example where the commandline is completely handled
3826 * in the #GApplication::command-line handler. The launching instance exits
3827 * once the signal handler in the primary instance has returned, and the
3828 * return value of the signal handler becomes the exit status of the launching
3832 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline.c">
3833 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3838 * <example id="gapplication-example-cmdline2"><title>Split commandline handling</title>
3840 * An example of split commandline handling. Options that start with
3841 * <literal>--local-</literal> are handled locally, all other options are
3842 * passed to the #GApplication::command-line handler which runs in the primary
3846 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline2.c">
3847 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3852 * <example id="gapplication-example-cmdline3"><title>Deferred commandline handling</title>
3854 * An example of deferred commandline handling. Here, the commandline is
3855 * not completely handled before the #GApplication::command-line handler
3856 * returns. Instead, we keep a reference to the GApplicationCommandLine
3857 * object and handle it later(in this example, in an idle). Note that it
3858 * is necessary to hold the application until you are done with the
3862 * This example also shows how to use #GOptionContext for parsing the
3863 * commandline arguments. Note that it is necessary to disable the
3864 * built-in help-handling of #GOptionContext, since it calls exit()
3865 * after printing help, which is not what you want to happen in
3866 * the primary instance.
3869 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline3.c">
3870 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3878 * SECTION:gasyncinitable
3879 * @short_description: Asynchronously failable object initialization interface
3880 * @include: gio/gio.h
3881 * @see_also: #GInitable
3883 * This is the asynchronous version of #GInitable; it behaves the same
3884 * in all ways except that initialization is asynchronous. For more details
3885 * see the descriptions on #GInitable.
3887 * A class may implement both the #GInitable and #GAsyncInitable interfaces.
3889 * Users of objects implementing this are not intended to use the interface
3890 * method directly; instead it will be used automatically in various ways.
3891 * For C applications you generally just call g_async_initable_new_async()
3892 * directly, or indirectly via a foo_thing_new_async() wrapper. This will call
3893 * g_async_initable_init_async() under the cover, calling back with %NULL and
3894 * a set %GError on failure.
3896 * A typical implementation might look something like this:
3906 * _foo_ready_cb (Foo *self)
3910 * self->priv->state = INITIALIZED;
3912 * for (l = self->priv->init_results; l != NULL; l = l->next)
3914 * GTask *task = l->data;
3916 * if (self->priv->success)
3917 * g_task_return_boolean (task, TRUE);
3919 * g_task_return_new_error (task, ...);
3920 * g_object_unref (task);
3923 * g_list_free (self->priv->init_results);
3924 * self->priv->init_results = NULL;
3928 * foo_init_async (GAsyncInitable *initable,
3930 * GCancellable *cancellable,
3931 * GAsyncReadyCallback callback,
3932 * gpointer user_data)
3934 * Foo *self = FOO (initable);
3937 * task = g_task_new (initable, cancellable, callback, user_data);
3939 * switch (self->priv->state)
3941 * case NOT_INITIALIZED:
3942 * _foo_get_ready (self);
3943 * self->priv->init_results = g_list_append (self->priv->init_results,
3945 * self->priv->state = INITIALIZING;
3947 * case INITIALIZING:
3948 * self->priv->init_results = g_list_append (self->priv->init_results,
3952 * if (!self->priv->success)
3953 * g_task_return_new_error (task, ...);
3955 * g_task_return_boolean (task, TRUE);
3956 * g_object_unref (task);
3962 * foo_init_finish (GAsyncInitable *initable,
3963 * GAsyncResult *result,
3966 * g_return_val_if_fail (g_task_is_valid (result, initable), FALSE);
3968 * return g_task_propagate_boolean (G_TASK (result), error);
3972 * foo_async_initable_iface_init (gpointer g_iface,
3975 * GAsyncInitableIface *iface = g_iface;
3977 * iface->init_async = foo_init_async;
3978 * iface->init_finish = foo_init_finish;
3985 * SECTION:gasyncresult
3986 * @short_description: Asynchronous Function Results
3987 * @include: gio/gio.h
3990 * Provides a base class for implementing asynchronous function results.
3992 * Asynchronous operations are broken up into two separate operations
3993 * which are chained together by a #GAsyncReadyCallback. To begin
3994 * an asynchronous operation, provide a #GAsyncReadyCallback to the
3995 * asynchronous function. This callback will be triggered when the
3996 * operation has completed, and will be passed a #GAsyncResult instance
3997 * filled with the details of the operation's success or failure, the
3998 * object the asynchronous function was started for and any error codes
3999 * returned. The asynchronous callback function is then expected to call
4000 * the corresponding "_finish()" function, passing the object the
4001 * function was called for, the #GAsyncResult instance, and (optionally)
4002 * an @error to grab any error conditions that may have occurred.
4004 * The "_finish()" function for an operation takes the generic result
4005 * (of type #GAsyncResult) and returns the specific result that the
4006 * operation in question yields (e.g. a #GFileEnumerator for a
4007 * "enumerate children" operation). If the result or error status of the
4008 * operation is not needed, there is no need to call the "_finish()"
4009 * function; GIO will take care of cleaning up the result and error
4010 * information after the #GAsyncReadyCallback returns. You can pass
4011 * %NULL for the #GAsyncReadyCallback if you don't need to take any
4012 * action at all after the operation completes. Applications may also
4013 * take a reference to the #GAsyncResult and call "_finish()" later;
4014 * however, the "_finish()" function may be called at most once.
4016 * Example of a typical asynchronous operation flow:
4018 * void _theoretical_frobnitz_async (Theoretical *t,
4020 * GAsyncReadyCallback cb,
4023 * gboolean _theoretical_frobnitz_finish (Theoretical *t,
4024 * GAsyncResult *res,
4028 * frobnitz_result_func (GObject *source_object,
4029 * GAsyncResult *res,
4030 * gpointer user_data)
4032 * gboolean success = FALSE;
4034 * success = _theoretical_frobnitz_finish (source_object, res, NULL);
4037 * g_printf ("Hurray!\n");
4039 * g_printf ("Uh oh!\n");
4041 * /<!-- -->* ... *<!-- -->/
4045 * int main (int argc, void *argv[])
4047 * /<!-- -->* ... *<!-- -->/
4049 * _theoretical_frobnitz_async (theoretical_data,
4051 * frobnitz_result_func,
4054 * /<!-- -->* ... *<!-- -->/
4058 * The callback for an asynchronous operation is called only once, and is
4059 * always called, even in the case of a cancelled operation. On cancellation
4060 * the result is a %G_IO_ERROR_CANCELLED error.
4062 * <para id="io-priority"><indexterm><primary>I/O
4063 * priority</primary></indexterm> Many I/O-related asynchronous
4064 * operations have a priority parameter, which is used in certain
4065 * cases to determine the order in which operations are executed. They
4066 * are <emphasis>not</emphasis> used to determine system-wide I/O
4067 * scheduling. Priorities are integers, with lower numbers indicating
4068 * higher priority. It is recommended to choose priorities between
4069 * %G_PRIORITY_LOW and %G_PRIORITY_HIGH, with %G_PRIORITY_DEFAULT as a
4075 * SECTION:gbufferedinputstream
4076 * @short_description: Buffered Input Stream
4077 * @include: gio/gio.h
4078 * @see_also: #GFilterInputStream, #GInputStream
4080 * Buffered input stream implements #GFilterInputStream and provides
4081 * for buffered reads.
4083 * By default, #GBufferedInputStream's buffer size is set at 4 kilobytes.
4085 * To create a buffered input stream, use g_buffered_input_stream_new(),
4086 * or g_buffered_input_stream_new_sized() to specify the buffer's size at
4089 * To get the size of a buffer within a buffered input stream, use
4090 * g_buffered_input_stream_get_buffer_size(). To change the size of a
4091 * buffered input stream's buffer, use
4092 * g_buffered_input_stream_set_buffer_size(). Note that the buffer's size
4093 * cannot be reduced below the size of the data within the buffer.
4098 * SECTION:gbufferedoutputstream
4099 * @short_description: Buffered Output Stream
4100 * @include: gio/gio.h
4101 * @see_also: #GFilterOutputStream, #GOutputStream
4103 * Buffered output stream implements #GFilterOutputStream and provides
4104 * for buffered writes.
4106 * By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.
4108 * To create a buffered output stream, use g_buffered_output_stream_new(),
4109 * or g_buffered_output_stream_new_sized() to specify the buffer's size
4112 * To get the size of a buffer within a buffered input stream, use
4113 * g_buffered_output_stream_get_buffer_size(). To change the size of a
4114 * buffered output stream's buffer, use
4115 * g_buffered_output_stream_set_buffer_size(). Note that the buffer's
4116 * size cannot be reduced below the size of the data within the buffer.
4121 * SECTION:gbytesicon
4122 * @short_description: An icon stored in memory as a GBytes
4123 * @include: gio/gio.h
4124 * @see_also: #GIcon, #GLoadableIcon, #GBytes
4126 * #GBytesIcon specifies an image held in memory in a common format (usually
4127 * png) to be used as icon.
4134 * SECTION:gcancellable
4135 * @short_description: Thread-safe Operation Cancellation Stack
4136 * @include: gio/gio.h
4138 * GCancellable is a thread-safe operation cancellation stack used
4139 * throughout GIO to allow for cancellation of synchronous and
4140 * asynchronous operations.
4145 * SECTION:gcharsetconverter
4146 * @short_description: Convert between charsets
4147 * @include: gio/gio.h
4149 * #GCharsetConverter is an implementation of #GConverter based on
4155 * SECTION:gcontenttype
4156 * @short_description: Platform-specific content typing
4157 * @include: gio/gio.h
4159 * A content type is a platform specific string that defines the type
4160 * 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".
4161 * On Win32 it is an extension string like ".doc", ".txt" or a perceived
4162 * string like "audio". Such strings can be looked up in the registry at
4163 * HKEY_CLASSES_ROOT.
4168 * SECTION:gconverter
4169 * @short_description: Data conversion interface
4170 * @include: gio/gio.h
4171 * @see_also: #GInputStream, #GOutputStream
4173 * #GConverter is implemented by objects that convert
4174 * binary data in various ways. The conversion can be
4175 * stateful and may fail at any place.
4177 * Some example conversions are: character set conversion,
4178 * compression, decompression and regular expression
4186 * SECTION:gconverterinputstream
4187 * @short_description: Converter Input Stream
4188 * @include: gio/gio.h
4189 * @see_also: #GInputStream, #GConverter
4191 * Converter input stream implements #GInputStream and allows
4192 * conversion of data of various types during reading.
4194 * As of GLib 2.34, #GConverterInputStream implements
4195 * #GPollableInputStream.
4200 * SECTION:gconverteroutputstream
4201 * @short_description: Converter Output Stream
4202 * @include: gio/gio.h
4203 * @see_also: #GOutputStream, #GConverter
4205 * Converter output stream implements #GOutputStream and allows
4206 * conversion of data of various types during reading.
4208 * As of GLib 2.34, #GConverterOutputStream implements
4209 * #GPollableOutputStream.
4214 * SECTION:gcredentials
4215 * @short_description: An object containing credentials
4216 * @include: gio/gio.h
4218 * The #GCredentials type is a reference-counted wrapper for native
4219 * credentials. This information is typically used for identifying,
4220 * authenticating and authorizing other processes.
4222 * Some operating systems supports looking up the credentials of the
4223 * remote peer of a communication endpoint - see e.g.
4224 * g_socket_get_credentials().
4226 * Some operating systems supports securely sending and receiving
4227 * credentials over a Unix Domain Socket, see
4228 * #GUnixCredentialsMessage, g_unix_connection_send_credentials() and
4229 * g_unix_connection_receive_credentials() for details.
4231 * On Linux, the native credential type is a <type>struct ucred</type>
4233 * <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>
4234 * man page for details. This corresponds to
4235 * %G_CREDENTIALS_TYPE_LINUX_UCRED.
4237 * On FreeBSD, the native credential type is a <type>struct cmsgcred</type>.
4238 * This corresponds to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED.
4240 * On OpenBSD, the native credential type is a <type>struct sockpeercred</type>.
4241 * This corresponds to %G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED.
4246 * SECTION:gdatainputstream
4247 * @short_description: Data Input Stream
4248 * @include: gio/gio.h
4249 * @see_also: #GInputStream
4251 * Data input stream implements #GInputStream and includes functions for
4252 * reading structured data directly from a binary input stream.
4257 * SECTION:gdataoutputstream
4258 * @short_description: Data Output Stream
4259 * @include: gio/gio.h
4260 * @see_also: #GOutputStream
4262 * Data output stream implements #GOutputStream and includes functions for
4263 * writing data directly to an output stream.
4268 * SECTION:gdbusactiongroup
4269 * @title: GDBusActionGroup
4270 * @short_description: A D-Bus GActionGroup implementation
4271 * @see_also: <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
4273 * #GDBusActionGroup is an implementation of the #GActionGroup
4274 * interface that can be used as a proxy for an action group
4275 * that is exported over D-Bus with g_dbus_connection_export_action_group().
4280 * SECTION:gdbusaddress
4281 * @title: D-Bus Addresses
4282 * @short_description: D-Bus connection endpoints
4283 * @include: gio/gio.h
4285 * Routines for working with D-Bus addresses. A D-Bus address is a string
4286 * like "unix:tmpdir=/tmp/my-app-name". The exact format of addresses
4287 * is explained in detail in the <link linkend="http://dbus.freedesktop.org/doc/dbus-specification.html#addresses">D-Bus specification</link>.
4292 * SECTION:gdbusauthobserver
4293 * @short_description: Object used for authenticating connections
4294 * @include: gio/gio.h
4296 * The #GDBusAuthObserver type provides a mechanism for participating
4297 * in how a #GDBusServer (or a #GDBusConnection) authenticates remote
4298 * peers. Simply instantiate a #GDBusAuthObserver and connect to the
4299 * signals you are interested in. Note that new signals may be added
4302 * For example, if you only want to allow D-Bus connections from
4303 * processes owned by the same uid as the server, you would use a
4304 * signal handler like the following:
4305 * <example id="auth-observer"><title>Controlling Authentication</title><programlisting>
4307 * on_authorize_authenticated_peer (GDBusAuthObserver *observer,
4308 * GIOStream *stream,
4309 * GCredentials *credentials,
4310 * gpointer user_data)
4312 * gboolean authorized;
4314 * authorized = FALSE;
4315 * if (credentials != NULL)
4317 * GCredentials *own_credentials;
4318 * own_credentials = g_credentials_new ();
4319 * if (g_credentials_is_same_user (credentials, own_credentials, NULL))
4320 * authorized = TRUE;
4321 * g_object_unref (own_credentials);
4324 * return authorized;
4326 * </programlisting></example>
4331 * SECTION:gdbusconnection
4332 * @short_description: D-Bus Connections
4333 * @include: gio/gio.h
4335 * The #GDBusConnection type is used for D-Bus connections to remote
4336 * peers such as a message buses. It is a low-level API that offers a
4337 * lot of flexibility. For instance, it lets you establish a connection
4338 * over any transport that can by represented as an #GIOStream.
4340 * This class is rarely used directly in D-Bus clients. If you are writing
4341 * an D-Bus client, it is often easier to use the g_bus_own_name(),
4342 * g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs.
4344 * As an exception to the usual GLib rule that a particular object must not be
4345 * used by two threads at the same time, #GDBusConnection's methods may be
4346 * called from any thread<footnote>
4348 * This is so that g_bus_get() and g_bus_get_sync() can safely return the
4349 * same #GDBusConnection when called from any thread.
4353 * Most of the ways to obtain a #GDBusConnection automatically initialize it
4354 * (i.e. connect to D-Bus): for instance, g_dbus_connection_new() and
4355 * g_bus_get(), and the synchronous versions of those methods, give you an
4356 * initialized connection. Language bindings for GIO should use
4357 * g_initable_new() or g_async_initable_new_async(), which also initialize the
4360 * If you construct an uninitialized #GDBusConnection, such as via
4361 * g_object_new(), you must initialize it via g_initable_init() or
4362 * g_async_initable_init_async() before using its methods or properties.
4363 * Calling methods or accessing properties on a #GDBusConnection that has not
4364 * completed initialization successfully is considered to be invalid, and leads
4365 * to undefined behaviour. In particular, if initialization fails with a
4366 * #GError, the only valid thing you can do with that #GDBusConnection is to
4367 * free it with g_object_unref().
4369 * <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>
4371 * <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>
4373 * <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>
4375 * <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>
4380 * SECTION:gdbuserror
4381 * @title: GDBusError
4382 * @short_description: Mapping D-Bus errors to and from GError
4383 * @include: gio/gio.h
4385 * All facilities that return errors from remote methods (such as
4386 * g_dbus_connection_call_sync()) use #GError to represent both D-Bus
4387 * errors (e.g. errors returned from the other peer) and locally
4388 * in-process generated errors.
4390 * To check if a returned #GError is an error from a remote peer, use
4391 * g_dbus_error_is_remote_error(). To get the actual D-Bus error name,
4392 * use g_dbus_error_get_remote_error(). Before presenting an error,
4393 * always use g_dbus_error_strip_remote_error().
4395 * In addition, facilities used to return errors to a remote peer also
4396 * use #GError. See g_dbus_method_invocation_return_error() for
4397 * discussion about how the D-Bus error name is set.
4399 * Applications can associate a #GError error domain with a set of D-Bus errors in order to
4400 * automatically map from D-Bus errors to #GError and back. This
4401 * is typically done in the function returning the #GQuark for the
4403 * <example id="error-registration"><title>Error Registration</title><programlisting>
4404 * /<!-- -->* foo-bar-error.h: *<!-- -->/
4406 * #define FOO_BAR_ERROR (foo_bar_error_quark ())
4407 * GQuark foo_bar_error_quark (void);
4411 * FOO_BAR_ERROR_FAILED,
4412 * FOO_BAR_ERROR_ANOTHER_ERROR,
4413 * FOO_BAR_ERROR_SOME_THIRD_ERROR,
4414 * FOO_BAR_N_ERRORS /<!-- -->*< skip >*<!-- -->/
4417 * /<!-- -->* foo-bar-error.c: *<!-- -->/
4419 * static const GDBusErrorEntry foo_bar_error_entries[] =
4421 * {FOO_BAR_ERROR_FAILED, "org.project.Foo.Bar.Error.Failed"},
4422 * {FOO_BAR_ERROR_ANOTHER_ERROR, "org.project.Foo.Bar.Error.AnotherError"},
4423 * {FOO_BAR_ERROR_SOME_THIRD_ERROR, "org.project.Foo.Bar.Error.SomeThirdError"},
4426 * /<!-- -->* Ensure that every error code has an associated D-Bus error name *<!-- -->/
4427 * G_STATIC_ASSERT (G_N_ELEMENTS (foo_bar_error_entries) == FOO_BAR_N_ERRORS);
4430 * foo_bar_error_quark (void)
4432 * static volatile gsize quark_volatile = 0;
4433 * g_dbus_error_register_error_domain ("foo-bar-error-quark",
4435 * foo_bar_error_entries,
4436 * G_N_ELEMENTS (foo_bar_error_entries));
4437 * return (GQuark) quark_volatile;
4439 * </programlisting></example>
4440 * With this setup, a D-Bus peer can transparently pass e.g. %FOO_BAR_ERROR_ANOTHER_ERROR and
4441 * other peers will see the D-Bus error name <literal>org.project.Foo.Bar.Error.AnotherError</literal>.
4443 * If the other peer is using GDBus, and has registered the association with
4444 * g_dbus_error_register_error_domain() in advance (e.g. by invoking the %FOO_BAR_ERROR quark
4445 * generation itself in the previous example) the peer will see also %FOO_BAR_ERROR_ANOTHER_ERROR instead
4446 * of %G_IO_ERROR_DBUS_ERROR. Note that GDBus clients can still recover
4447 * <literal>org.project.Foo.Bar.Error.AnotherError</literal> using g_dbus_error_get_remote_error().
4449 * Note that errors in the %G_DBUS_ERROR error domain is intended only
4450 * for returning errors from a remote message bus process. Errors
4451 * generated locally in-process by e.g. #GDBusConnection is from the
4452 * %G_IO_ERROR domain.
4457 * SECTION:gdbusinterface
4458 * @short_description: Base type for D-Bus interfaces
4459 * @include: gio/gio.h
4461 * The #GDBusInterface type is the base type for D-Bus interfaces both
4462 * on the service side (see #GDBusInterfaceSkeleton) and client side
4463 * (see #GDBusProxy).
4468 * SECTION:gdbusinterfaceskeleton
4469 * @short_description: Service-side D-Bus interface
4470 * @include: gio/gio.h
4472 * Abstract base class for D-Bus interfaces on the service side.
4477 * SECTION:gdbusintrospection
4478 * @title: D-Bus Introspection Data
4479 * @short_description: Node and interface description data structures
4480 * @include: gio/gio.h
4482 * Various data structures and convenience routines to parse and
4483 * generate D-Bus introspection XML. Introspection information is
4484 * used when registering objects with g_dbus_connection_register_object().
4486 * The format of D-Bus introspection XML is specified in the
4487 * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format">D-Bus specification</ulink>.
4492 * SECTION:gdbusmenumodel
4493 * @title: GDBusMenuModel
4494 * @short_description: A D-Bus GMenuModel implementation
4495 * @see_also: <link linkend="gio-GMenuModel-exporter">GMenuModel Exporter</link>
4497 * #GDBusMenuModel is an implementation of #GMenuModel that can be used
4498 * as a proxy for a menu model that is exported over D-Bus with
4499 * g_dbus_connection_export_menu_model().
4504 * SECTION:gdbusmessage
4505 * @short_description: D-Bus Message
4506 * @include: gio/gio.h
4508 * A type for representing D-Bus messages that can be sent or received
4509 * on a #GDBusConnection.
4514 * SECTION:gdbusmethodinvocation
4515 * @short_description: Object for handling remote calls
4516 * @include: gio/gio.h
4518 * Instances of the #GDBusMethodInvocation class are used when
4519 * handling D-Bus method calls. It provides a way to asynchronously
4520 * return results and errors.
4522 * The normal way to obtain a #GDBusMethodInvocation object is to receive
4523 * it as an argument to the handle_method_call() function in a
4524 * #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
4529 * SECTION:gdbusnameowning
4530 * @title: Owning Bus Names
4531 * @short_description: Simple API for owning bus names
4532 * @include: gio/gio.h
4534 * Convenience API for owning bus names.
4536 * <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>
4541 * SECTION:gdbusnamewatching
4542 * @title: Watching Bus Names
4543 * @short_description: Simple API for watching bus names
4544 * @include: gio/gio.h
4546 * Convenience API for watching bus names.
4548 * <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>
4553 * SECTION:gdbusobject
4554 * @short_description: Base type for D-Bus objects
4555 * @include: gio/gio.h
4557 * The #GDBusObject type is the base type for D-Bus objects on both
4558 * the service side (see #GDBusObjectSkeleton) and the client side
4559 * (see #GDBusObjectProxy). It is essentially just a container of
4565 * SECTION:gdbusobjectmanager
4566 * @short_description: Base type for D-Bus object managers
4567 * @include: gio/gio.h
4569 * The #GDBusObjectManager type is the base type for service- and
4570 * client-side implementations of the standardized <ulink
4571 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4574 * See #GDBusObjectManagerClient for the client-side implementation
4575 * and #GDBusObjectManagerServer for the service-side implementation.
4580 * SECTION:gdbusobjectmanagerclient
4581 * @short_description: Client-side object manager
4582 * @include: gio/gio.h
4584 * #GDBusObjectManagerClient is used to create, monitor and delete object
4585 * proxies for remote objects exported by a #GDBusObjectManagerServer (or any
4586 * code implementing the <ulink
4587 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4590 * Once an instance of this type has been created, you can connect to
4591 * the #GDBusObjectManager::object-added and
4592 * #GDBusObjectManager::object-removed signals and inspect the
4593 * #GDBusObjectProxy objects returned by
4594 * g_dbus_object_manager_get_objects().
4596 * If the name for a #GDBusObjectManagerClient is not owned by anyone at
4597 * object construction time, the default behavior is to request the
4598 * message bus to launch an owner for the name. This behavior can be
4599 * disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
4600 * flag. It's also worth noting that this only works if the name of
4601 * interest is activatable in the first place. E.g. in some cases it
4602 * is not possible to launch an owner for the requested name. In this
4603 * case, #GDBusObjectManagerClient object construction still succeeds but
4604 * there will be no object proxies
4605 * (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
4606 * the #GDBusObjectManagerClient:name-owner property is %NULL.
4608 * The owner of the requested name can come and go (for example
4609 * consider a system service being restarted) – #GDBusObjectManagerClient
4610 * handles this case too; simply connect to the #GObject::notify
4611 * signal to watch for changes on the #GDBusObjectManagerClient:name-owner
4612 * property. When the name owner vanishes, the behavior is that
4613 * #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
4614 * emission of the #GObject::notify signal) and then
4615 * #GDBusObjectManager::object-removed signals are synthesized
4616 * for all currently existing object proxies. Since
4617 * #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
4618 * use this information to disambiguate a synthesized signal from a
4619 * genuine signal caused by object removal on the remote
4620 * #GDBusObjectManager. Similarly, when a new name owner appears,
4621 * #GDBusObjectManager::object-added signals are synthesized
4622 * while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
4623 * object proxies have been added, the #GDBusObjectManagerClient:name-owner
4624 * is set to the new name owner (this includes emission of the
4625 * #GObject::notify signal). Furthermore, you are guaranteed that
4626 * #GDBusObjectManagerClient:name-owner will alternate between a name owner
4627 * (e.g. <literal>:1.42</literal>) and %NULL even in the case where
4628 * the name of interest is atomically replaced
4630 * Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
4631 * instances. All signals (including the
4632 * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
4633 * signal) delivered to #GDBusProxy instances are guaranteed to
4634 * originate from the name owner. This guarantee along with the
4635 * behavior described above, means that certain race conditions
4636 * including the <emphasis><quote>half the proxy is from the old owner
4637 * and the other half is from the new owner</quote></emphasis> problem
4640 * To avoid having the application connect to signals on the returned
4641 * #GDBusObjectProxy and #GDBusProxy objects, the
4642 * #GDBusObject::interface-added,
4643 * #GDBusObject::interface-removed,
4644 * #GDBusProxy::g-properties-changed and
4645 * #GDBusProxy::g-signal signals
4646 * are also emitted on the #GDBusObjectManagerClient instance managing these
4647 * objects. The signals emitted are
4648 * #GDBusObjectManager::interface-added,
4649 * #GDBusObjectManager::interface-removed,
4650 * #GDBusObjectManagerClient::interface-proxy-properties-changed and
4651 * #GDBusObjectManagerClient::interface-proxy-signal.
4653 * Note that all callbacks and signals are emitted in the
4654 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4655 * that the #GDBusObjectManagerClient object was constructed
4656 * in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
4657 * originating from the #GDBusObjectManagerClient object will be created in
4658 * the same context and, consequently, will deliver signals in the
4664 * SECTION:gdbusobjectmanagerserver
4665 * @short_description: Service-side object manager
4666 * @include: gio/gio.h
4668 * #GDBusObjectManagerServer is used to export #GDBusObject instances using
4669 * the standardized <ulink
4670 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4671 * interface. For example, remote D-Bus clients can get all objects
4672 * and properties in a single call. Additionally, any change in the
4673 * object hierarchy is broadcast using signals. This means that D-Bus
4674 * clients can keep caches up to date by only listening to D-Bus
4677 * See #GDBusObjectManagerClient for the client-side code that is
4678 * intended to be used with #GDBusObjectManagerServer or any D-Bus
4679 * object implementing the org.freedesktop.DBus.ObjectManager
4685 * SECTION:gdbusobjectproxy
4686 * @short_description: Client-side D-Bus object
4687 * @include: gio/gio.h
4689 * A #GDBusObjectProxy is an object used to represent a remote object
4690 * with one or more D-Bus interfaces. Normally, you don't instantiate
4691 * a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
4692 * is used to obtain it.
4699 * SECTION:gdbusobjectskeleton
4700 * @short_description: Service-side D-Bus object
4701 * @include: gio/gio.h
4703 * A #GDBusObjectSkeleton instance is essentially a group of D-Bus
4704 * interfaces. The set of exported interfaces on the object may be
4705 * dynamic and change at runtime.
4707 * This type is intended to be used with #GDBusObjectManager.
4712 * SECTION:gdbusproxy
4713 * @short_description: Client-side D-Bus interface proxy
4714 * @include: gio/gio.h
4716 * #GDBusProxy is a base class used for proxies to access a D-Bus
4717 * interface on a remote object. A #GDBusProxy can be constructed for
4718 * both well-known and unique names.
4720 * By default, #GDBusProxy will cache all properties (and listen to
4721 * changes) of the remote object, and proxy all signals that gets
4722 * emitted. This behaviour can be changed by passing suitable
4723 * #GDBusProxyFlags when the proxy is created. If the proxy is for a
4724 * well-known name, the property cache is flushed when the name owner
4725 * vanishes and reloaded when a name owner appears.
4727 * If a #GDBusProxy is used for a well-known name, the owner of the
4728 * name is tracked and can be read from
4729 * #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
4730 * get notified of changes. Additionally, only signals and property
4731 * changes emitted from the current name owner are considered and
4732 * calls are always sent to the current name owner. This avoids a
4733 * number of race conditions when the name is lost by one owner and
4734 * claimed by another. However, if no name owner currently exists,
4735 * then calls will be sent to the well-known name which may result in
4736 * the message bus launching an owner (unless
4737 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
4739 * The generic #GDBusProxy::g-properties-changed and
4740 * #GDBusProxy::g-signal signals are not very convenient to work
4741 * with. Therefore, the recommended way of working with proxies is to
4742 * subclass #GDBusProxy, and have more natural properties and signals
4743 * in your derived class. See <xref linkend="gdbus-example-gdbus-codegen"/>
4744 * for how this can easily be done using the
4745 * <command><link linkend="gdbus-codegen">gdbus-codegen</link></command>
4748 * A #GDBusProxy instance can be used from multiple threads but note
4749 * that all signals (e.g. #GDBusProxy::g-signal, #GDBusProxy::g-properties-changed
4750 * and #GObject::notify) are emitted in the
4751 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4752 * of the thread where the instance was constructed.
4754 * <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>
4759 * SECTION:gdbusserver
4760 * @short_description: Helper for accepting connections
4761 * @include: gio/gio.h
4763 * #GDBusServer is a helper for listening to and accepting D-Bus
4764 * connections. This can be used to create a new D-Bus server, allowing two
4765 * peers to use the D-Bus protocol for their own specialized communication.
4766 * A server instance provided in this way will not perform message routing or
4767 * implement the org.freedesktop.DBus interface.
4769 * To just export an object on a well-known name on a message bus, such as the
4770 * session or system bus, you should instead use g_bus_own_name().
4772 * <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>
4777 * SECTION:gdbusutils
4778 * @title: D-Bus Utilities
4779 * @short_description: Various utilities related to D-Bus
4780 * @include: gio/gio.h
4782 * Various utility routines related to D-Bus.
4787 * SECTION:gdesktopappinfo
4788 * @title: GDesktopAppInfo
4789 * @short_description: Application information from desktop files
4790 * @include: gio/gdesktopappinfo.h
4792 * #GDesktopAppInfo is an implementation of #GAppInfo based on
4795 * Note that <filename><gio/gdesktopappinfo.h></filename> belongs to
4796 * the UNIX-specific GIO interfaces, thus you have to use the
4797 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4803 * @short_description: Drive management
4804 * @include: gio/gio.h
4806 * #GDrive - this represent a piece of hardware connected to the machine.
4807 * It's generally only created for removable hardware or hardware with
4810 * #GDrive is a container class for #GVolume objects that stem from
4811 * the same piece of media. As such, #GDrive abstracts a drive with
4812 * (or without) removable media and provides operations for querying
4813 * whether media is available, determining whether media change is
4814 * automatically detected and ejecting the media.
4816 * If the #GDrive reports that media isn't automatically detected, one
4817 * can poll for media; typically one should not do this periodically
4818 * as a poll for media operation is potententially expensive and may
4819 * spin up the drive creating noise.
4821 * #GDrive supports starting and stopping drives with authentication
4822 * support for the former. This can be used to support a diverse set
4823 * of use cases including connecting/disconnecting iSCSI devices,
4824 * powering down external disk enclosures and starting/stopping
4825 * multi-disk devices such as RAID devices. Note that the actual
4826 * semantics and side-effects of starting/stopping a #GDrive may vary
4827 * according to implementation. To choose the correct verbs in e.g. a
4828 * file manager, use g_drive_get_start_stop_type().
4830 * For porting from GnomeVFS note that there is no equivalent of
4831 * #GDrive in that API.
4837 * @short_description: An object for emblems
4838 * @include: gio/gio.h
4839 * @see_also: #GIcon, #GEmblemedIcon, #GLoadableIcon, #GThemedIcon
4841 * #GEmblem is an implementation of #GIcon that supports
4842 * having an emblem, which is an icon with additional properties.
4843 * It can than be added to a #GEmblemedIcon.
4845 * Currently, only metainformation about the emblem's origin is
4846 * supported. More may be added in the future.
4851 * SECTION:gemblemedicon
4852 * @short_description: Icon with emblems
4853 * @include: gio/gio.h
4854 * @see_also: #GIcon, #GLoadableIcon, #GThemedIcon, #GEmblem
4856 * #GEmblemedIcon is an implementation of #GIcon that supports
4857 * adding an emblem to an icon. Adding multiple emblems to an
4858 * icon is ensured via g_emblemed_icon_add_emblem().
4860 * Note that #GEmblemedIcon allows no control over the position
4861 * of the emblems. See also #GEmblem for more information.
4867 * @short_description: File and Directory Handling
4868 * @include: gio/gio.h
4869 * @see_also: #GFileInfo, #GFileEnumerator
4871 * #GFile is a high level abstraction for manipulating files on a
4872 * virtual file system. #GFiles are lightweight, immutable objects
4873 * that do no I/O upon creation. It is necessary to understand that
4874 * #GFile objects do not represent files, merely an identifier for a
4875 * file. All file content I/O is implemented as streaming operations
4876 * (see #GInputStream and #GOutputStream).
4878 * To construct a #GFile, you can use:
4880 * <member>g_file_new_for_path() if you have a path.</member>
4881 * <member>g_file_new_for_uri() if you have a URI.</member>
4882 * <member>g_file_new_for_commandline_arg() for a command line argument.</member>
4883 * <member>g_file_new_tmp() to create a temporary file from a template.</member>
4884 * <member>g_file_parse_name() from a UTF-8 string gotten from g_file_get_parse_name().</member>
4887 * One way to think of a #GFile is as an abstraction of a pathname. For
4888 * normal files the system pathname is what is stored internally, but as
4889 * #GFiles are extensible it could also be something else that corresponds
4890 * to a pathname in a userspace implementation of a filesystem.
4892 * #GFiles make up hierarchies of directories and files that correspond to
4893 * the files on a filesystem. You can move through the file system with
4894 * #GFile using g_file_get_parent() to get an identifier for the parent
4895 * directory, g_file_get_child() to get a child within a directory,
4896 * g_file_resolve_relative_path() to resolve a relative path between two
4897 * #GFiles. There can be multiple hierarchies, so you may not end up at
4898 * the same root if you repeatedly call g_file_get_parent() on two different
4901 * All #GFiles have a basename (get with g_file_get_basename()). These names
4902 * are byte strings that are used to identify the file on the filesystem
4903 * (relative to its parent directory) and there is no guarantees that they
4904 * have any particular charset encoding or even make any sense at all. If
4905 * you want to use filenames in a user interface you should use the display
4906 * name that you can get by requesting the
4907 * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
4908 * This is guaranteed to be in UTF-8 and can be used in a user interface.
4909 * But always store the real basename or the #GFile to use to actually
4910 * access the file, because there is no way to go from a display name to
4913 * Using #GFile as an identifier has the same weaknesses as using a path
4914 * in that there may be multiple aliases for the same file. For instance,
4915 * hard or soft links may cause two different #GFiles to refer to the same
4916 * file. Other possible causes for aliases are: case insensitive filesystems,
4917 * short and long names on FAT/NTFS, or bind mounts in Linux. If you want to
4918 * check if two #GFiles point to the same file you can query for the
4919 * %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
4920 * canonicalization of pathnames passed in, so that trivial differences in
4921 * the path string used at creation (duplicated slashes, slash at end of
4922 * path, "." or ".." path segments, etc) does not create different #GFiles.
4924 * Many #GFile operations have both synchronous and asynchronous versions
4925 * to suit your application. Asynchronous versions of synchronous functions
4926 * simply have _async() appended to their function names. The asynchronous
4927 * I/O functions call a #GAsyncReadyCallback which is then used to finalize
4928 * the operation, producing a GAsyncResult which is then passed to the
4929 * function's matching _finish() operation.
4931 * Some #GFile operations do not have synchronous analogs, as they may
4932 * take a very long time to finish, and blocking may leave an application
4933 * unusable. Notable cases include:
4935 * <member>g_file_mount_mountable() to mount a mountable file.</member>
4936 * <member>g_file_unmount_mountable_with_operation() to unmount a mountable file.</member>
4937 * <member>g_file_eject_mountable_with_operation() to eject a mountable file.</member>
4940 * <para id="gfile-etag"><indexterm><primary>entity tag</primary></indexterm>
4941 * One notable feature of #GFiles are entity tags, or "etags" for
4942 * short. Entity tags are somewhat like a more abstract version of the
4943 * traditional mtime, and can be used to quickly determine if the file has
4944 * been modified from the version on the file system. See the HTTP 1.1
4945 * <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">specification</ulink>
4946 * for HTTP Etag headers, which are a very similar concept.
4952 * SECTION:gfileattribute
4953 * @short_description: Key-Value Paired File Attributes
4954 * @include: gio/gio.h
4955 * @see_also: #GFile, #GFileInfo
4957 * File attributes in GIO consist of a list of key-value pairs.
4959 * Keys are strings that contain a key namespace and a key name, separated
4960 * by a colon, e.g. "namespace::keyname". Namespaces are included to sort
4961 * key-value pairs by namespaces for relevance. Keys can be retrived
4962 * using wildcards, e.g. "standard::*" will return all of the keys in the
4963 * "standard" namespace.
4965 * The list of possible attributes for a filesystem (pointed to by a #GFile) is
4966 * available as a #GFileAttributeInfoList. This list is queryable by key names
4967 * as indicated earlier.
4969 * Information is stored within the list in #GFileAttributeInfo structures.
4970 * The info structure can store different types, listed in the enum
4971 * #GFileAttributeType. Upon creation of a #GFileAttributeInfo, the type will
4972 * be set to %G_FILE_ATTRIBUTE_TYPE_INVALID.
4974 * Classes that implement #GFileIface will create a #GFileAttributeInfoList and
4975 * install default keys and values for their given file system, architecture,
4976 * and other possible implementation details (e.g., on a UNIX system, a file
4977 * attribute key will be registered for the user id for a given file).
4981 * <title>GFileAttributes Default Namespaces</title>
4982 * <tgroup cols='2' align='left'><thead>
4983 * <row><entry>Namspace</entry><entry>Description</entry></row>
4986 * <row><entry>"standard"</entry><entry>The "Standard" namespace. General file
4987 * information that any application may need should be put in this namespace.
4988 * Examples include the file's name, type, and size.</entry></row>
4989 * <row><entry>"etag"</entry><entry>The <link linkend="gfile-etag">"Entity Tag"</link>
4990 * namespace. Currently, the only key in this namespace is "value", which contains
4991 * the value of the current entity tag.</entry></row>
4992 * <row><entry>"id"</entry><entry>The "Identification" namespace. This
4993 * namespace is used by file managers and applications that list directories
4994 * to check for loops and to uniquely identify files.</entry></row>
4995 * <row><entry>"access"</entry><entry>The "Access" namespace. Used to check
4996 * if a user has the proper privilidges to access files and perform
4997 * file operations. Keys in this namespace are made to be generic
4998 * and easily understood, e.g. the "can_read" key is %TRUE if
4999 * the current user has permission to read the file. UNIX permissions and
5000 * NTFS ACLs in Windows should be mapped to these values.</entry></row>
5001 * <row><entry>"mountable"</entry><entry>The "Mountable" namespace. Includes
5002 * simple boolean keys for checking if a file or path supports mount operations, e.g.
5003 * mount, unmount, eject. These are used for files of type %G_FILE_TYPE_MOUNTABLE.</entry></row>
5004 * <row><entry>"time"</entry><entry>The "Time" namespace. Includes file
5005 * access, changed, created times. </entry></row>
5006 * <row><entry>"unix"</entry><entry>The "Unix" namespace. Includes UNIX-specific
5007 * information and may not be available for all files. Examples include
5008 * the UNIX "UID", "GID", etc.</entry></row>
5009 * <row><entry>"dos"</entry><entry>The "DOS" namespace. Includes DOS-specific
5010 * information and may not be available for all files. Examples include
5011 * "is_system" for checking if a file is marked as a system file, and "is_archive"
5012 * for checking if a file is marked as an archive file.</entry></row>
5013 * <row><entry>"owner"</entry><entry>The "Owner" namespace. Includes information
5014 * about who owns a file. May not be available for all file systems. Examples include
5015 * "user" for getting the user name of the file owner. This information is often mapped from
5016 * some backend specific data such as a unix UID.</entry></row>
5017 * <row><entry>"thumbnail"</entry><entry>The "Thumbnail" namespace. Includes
5018 * information about file thumbnails and their location within the file system. Examples of
5019 * keys in this namespace include "path" to get the location of a thumbnail, and "failed"
5020 * to check if thumbnailing of the file failed.</entry></row>
5021 * <row><entry>"filesystem"</entry><entry>The "Filesystem" namespace. Gets information
5022 * about the file system where a file is located, such as its type, how much
5023 * space is left available, and the overall size of the file system.</entry></row>
5024 * <row><entry>"gvfs"</entry><entry>The "GVFS" namespace. Keys in this namespace
5025 * contain information about the current GVFS backend in use. </entry></row>
5026 * <row><entry>"xattr"</entry><entry>The "xattr" namespace. Gets information
5027 * about extended user attributes. See attr(5). The "user." prefix of the
5028 * extended user attribute name is stripped away when constructing keys in
5029 * this namespace, e.g. "xattr::mime_type" for the extended attribute with
5030 * the name "user.mime_type". Note that this information is only available
5031 * if GLib has been built with extended attribute support.</entry></row>
5032 * <row><entry>"xattr-sys"</entry><entry>The "xattr-sys" namespace.
5033 * Gets information about extended attributes which are not user-specific.
5034 * See attr(5). Note that this information is only available if GLib
5035 * has been built with extended attribute support.</entry></row>
5036 * <row><entry>"selinux"</entry><entry>The "SELinux" namespace. Includes
5037 * information about the SELinux context of files. Note that this information
5038 * is only available if GLib has been built with SELinux support.</entry></row>
5044 * Please note that these are not all of the possible namespaces.
5045 * More namespaces can be added from GIO modules or by individual applications.
5046 * For more information about writing GIO modules, see #GIOModule.
5048 * <!-- TODO: Implementation note about using extended attributes on supported
5052 * <title>GFileAttributes Built-in Keys and Value Types</title>
5053 * <tgroup cols='3' align='left'><thead>
5054 * <row><entry>Enum Value</entry><entry>Namespace::Key</entry><entry>Value Type</entry></row>
5056 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TYPE</entry><entry>standard::type</entry><entry>uint32 (#GFileType)</entry></row>
5057 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN</entry><entry>standard::is-hidden</entry><entry>boolean</entry></row>
5058 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP</entry><entry>standard::is-backup</entry><entry>boolean</entry></row>
5059 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK</entry><entry>standard::is-symlink</entry><entry>boolean</entry></row>
5060 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL</entry><entry>standard::is-virtual</entry><entry>boolean</entry></row>
5061 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_NAME</entry><entry>standard::name</entry><entry>byte string</entry></row>
5062 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</entry><entry>standard::display-name</entry><entry>string</entry></row>
5063 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME</entry><entry>standard::edit-name</entry><entry>string</entry></row>
5064 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ICON</entry><entry>standard::icon</entry><entry>object (#GIcon)</entry></row>
5065 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE</entry><entry>standard::content-type</entry><entry>string</entry></row>
5066 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE</entry><entry>standard::fast-content-type</entry><entry>string</entry></row>
5067 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SIZE</entry><entry>standard::size</entry><entry>uint64</entry></row>
5068 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE</entry><entry>standard::allocated-size</entry><entry>uint64</entry></row>
5069 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET</entry><entry>standard::symlink-target</entry><entry>byte string</entry></row>
5070 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TARGET_URI</entry><entry>standard::target-uri</entry><entry>string</entry></row>
5071 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER</entry><entry>standard::sort-order</entry><entry>int32</entry></row>
5072 * <row><entry>%G_FILE_ATTRIBUTE_ETAG_VALUE</entry><entry>etag::value</entry><entry>string</entry></row>
5073 * <row><entry>%G_FILE_ATTRIBUTE_ID_FILE</entry><entry>id::file</entry><entry>string</entry></row>
5074 * <row><entry>%G_FILE_ATTRIBUTE_ID_FILESYSTEM</entry><entry>id::filesystem</entry><entry>string</entry></row>
5075 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_READ</entry><entry>access::can-read</entry><entry>boolean</entry></row>
5076 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE</entry><entry>access::can-write</entry><entry>boolean</entry></row>
5077 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE</entry><entry>access::can-execute</entry><entry>boolean</entry></row>
5078 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE</entry><entry>access::can-delete</entry><entry>boolean</entry></row>
5079 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH</entry><entry>access::can-trash</entry><entry>boolean</entry></row>
5080 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME</entry><entry>access::can-rename</entry><entry>boolean</entry></row>
5081 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT</entry><entry>mountable::can-mount</entry><entry>boolean</entry></row>
5082 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT</entry><entry>mountable::can-unmount</entry><entry>boolean</entry></row>
5083 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT</entry><entry>mountable::can-eject</entry><entry>boolean</entry></row>
5084 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE</entry><entry>mountable::unix-device</entry><entry>uint32</entry></row>
5085 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE</entry><entry>mountable::unix-device-file</entry><entry>string</entry></row>
5086 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI</entry><entry>mountable::hal-udi</entry><entry>string</entry></row>
5087 * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED</entry><entry>time::modified</entry><entry>uint64</entry></row>
5088 * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC</entry><entry>time::modified-usec</entry><entry>uint32</entry></row>
5089 * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS</entry><entry>time::access</entry><entry>uint64</entry></row>
5090 * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS_USEC</entry><entry>time::access-usec</entry><entry>uint32</entry></row>
5091 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED</entry><entry>time::changed</entry><entry>uint64</entry></row>
5092 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED_USEC</entry><entry>time::changed-usec</entry><entry>uint32</entry></row>
5093 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED</entry><entry>time::created</entry><entry>uint64</entry></row>
5094 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED_USEC</entry><entry>time::created-usec</entry><entry>uint32</entry></row>
5095 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_DEVICE</entry><entry>unix::device</entry><entry>uint32</entry></row>
5096 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_INODE</entry><entry>unix::inode</entry><entry>uint64</entry></row>
5097 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_MODE</entry><entry>unix::mode</entry><entry>uint32</entry></row>
5098 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_NLINK</entry><entry>unix::nlink</entry><entry>uint32</entry></row>
5099 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_UID</entry><entry>unix::uid</entry><entry>uint32</entry></row>
5100 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_GID</entry><entry>unix::gid</entry><entry>uint32</entry></row>
5101 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_RDEV</entry><entry>unix::rdev</entry><entry>uint32</entry></row>
5102 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE</entry><entry>unix::block-size</entry><entry>uint32</entry></row>
5103 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCKS</entry><entry>unix::blocks</entry><entry>uint64</entry></row>
5104 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT</entry><entry>unix::is-mountpoint</entry><entry>boolean</entry></row>
5105 * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE</entry><entry>dos::is-archive</entry><entry>boolean</entry></row>
5106 * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_SYSTEM</entry><entry>dos::is-system</entry><entry>boolean</entry></row>
5107 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER</entry><entry>owner::user</entry><entry>string</entry></row>
5108 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER_REAL</entry><entry>owner::user-real</entry><entry>string</entry></row>
5109 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_GROUP</entry><entry>owner::group</entry><entry>string</entry></row>
5110 * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAIL_PATH</entry><entry>thumbnail::path</entry><entry>bytestring</entry></row>
5111 * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAILING_FAILED</entry><entry>thumbnail::failed</entry><entry>boolean</entry></row>
5112 * <row><entry>%G_FILE_ATTRIBUTE_PREVIEW_ICON</entry><entry>preview::icon</entry><entry>object (#GIcon)</entry></row>
5113 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_SIZE</entry><entry>filesystem::size</entry><entry>uint64</entry></row>
5114 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_FREE</entry><entry>filesystem::free</entry><entry>uint64</entry></row>
5115 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_USED</entry><entry>filesystem::used</entry><entry>uint64</entry></row>
5116 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_TYPE</entry><entry>filesystem::type</entry><entry>string</entry></row>
5117 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_READONLY</entry><entry>filesystem::readonly</entry><entry>boolean</entry></row>
5118 * <row><entry>%G_FILE_ATTRIBUTE_GVFS_BACKEND</entry><entry>gvfs::backend</entry><entry>string</entry></row>
5119 * <row><entry>%G_FILE_ATTRIBUTE_SELINUX_CONTEXT</entry><entry>selinux::context</entry><entry>string</entry></row>
5120 * </tbody></tgroup></table></para>
5122 * Note that there are no predefined keys in the "xattr" and "xattr-sys"
5123 * namespaces. Keys for the "xattr" namespace are constructed by stripping
5124 * away the "user." prefix from the extended user attribute, and prepending
5125 * "xattr::". Keys for the "xattr-sys" namespace are constructed by
5126 * concatenating "xattr-sys::" with the extended attribute name. All extended
5127 * attribute values are returned as hex-encoded strings in which bytes outside
5128 * the ASCII range are encoded as hexadecimal escape sequences of the form
5129 * \x<replaceable>nn</replaceable>.
5134 * SECTION:gfiledescriptorbased
5135 * @short_description: Interface for file descriptor based IO
5136 * @include: gio/gfiledescriptorbased.h
5137 * @see_also: #GInputStream, #GOutputStream
5139 * #GFileDescriptorBased is implemented by streams (implementations of
5140 * #GInputStream or #GOutputStream) that are based on file descriptors.
5142 * Note that <filename><gio/gfiledescriptorbased.h></filename> belongs to
5143 * the UNIX-specific GIO interfaces, thus you have to use the
5144 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
5151 * SECTION:gfileenumerator
5152 * @short_description: Enumerated Files Routines
5153 * @include: gio/gio.h
5155 * #GFileEnumerator allows you to operate on a set of #GFile<!-- -->s,
5156 * returning a #GFileInfo structure for each file enumerated (e.g.
5157 * g_file_enumerate_children() will return a #GFileEnumerator for each
5158 * of the children within a directory).
5160 * To get the next file's information from a #GFileEnumerator, use
5161 * g_file_enumerator_next_file() or its asynchronous version,
5162 * g_file_enumerator_next_files_async(). Note that the asynchronous
5163 * version will return a list of #GFileInfo<!---->s, whereas the
5164 * synchronous will only return the next file in the enumerator.
5166 * The ordering of returned files is unspecified for non-Unix
5167 * platforms; for more information, see g_dir_read_name(). On Unix,
5168 * when operating on local files, returned files will be sorted by
5169 * inode number. Effectively you can assume that the ordering of
5170 * returned files will be stable between successive calls (and
5171 * applications) assuming the directory is unchanged.
5173 * If your application needs a specific ordering, such as by name or
5174 * modification time, you will have to implement that in your
5177 * To close a #GFileEnumerator, use g_file_enumerator_close(), or
5178 * its asynchronous version, g_file_enumerator_close_async(). Once
5179 * a #GFileEnumerator is closed, no further actions may be performed
5180 * on it, and it should be freed with g_object_unref().
5186 * @short_description: Icons pointing to an image file
5187 * @include: gio/gio.h
5188 * @see_also: #GIcon, #GLoadableIcon
5190 * #GFileIcon specifies an icon by pointing to an image file
5191 * to be used as icon.
5197 * @short_description: File Information and Attributes
5198 * @include: gio/gio.h
5199 * @see_also: #GFile, <link linkend="gio-GFileAttribute">GFileAttribute</link>
5201 * Functionality for manipulating basic metadata for files. #GFileInfo
5202 * implements methods for getting information that all files should
5203 * contain, and allows for manipulation of extended attributes.
5205 * See <link linkend="gio-GFileAttribute">GFileAttribute</link> for more
5206 * information on how GIO handles file attributes.
5208 * To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
5209 * async variant). To obtain a #GFileInfo for a file input or output
5210 * stream, use g_file_input_stream_query_info() or
5211 * g_file_output_stream_query_info() (or their async variants).
5213 * To change the actual attributes of a file, you should then set the
5214 * attribute in the #GFileInfo and call g_file_set_attributes_from_info()
5215 * or g_file_set_attributes_async() on a GFile.
5217 * However, not all attributes can be changed in the file. For instance,
5218 * the actual size of a file cannot be changed via g_file_info_set_size().
5219 * You may call g_file_query_settable_attributes() and
5220 * g_file_query_writable_namespaces() to discover the settable attributes
5221 * of a particular file at runtime.
5223 * #GFileAttributeMatcher allows for searching through a #GFileInfo for
5229 * SECTION:gfileinputstream
5230 * @short_description: File input streaming operations
5231 * @include: gio/gio.h
5232 * @see_also: #GInputStream, #GDataInputStream, #GSeekable
5234 * GFileInputStream provides input streams that take their
5235 * content from a file.
5237 * GFileInputStream implements #GSeekable, which allows the input
5238 * stream to jump to arbitrary positions in the file, provided the
5239 * filesystem of the file allows it. To find the position of a file
5240 * input stream, use g_seekable_tell(). To find out if a file input
5241 * stream supports seeking, use g_seekable_can_seek().
5242 * To position a file input stream, use g_seekable_seek().
5247 * SECTION:gfileiostream
5248 * @short_description: File read and write streaming operations
5249 * @include: gio/gio.h
5250 * @see_also: #GIOStream, #GFileInputStream, #GFileOutputStream, #GSeekable
5252 * GFileIOStream provides io streams that both read and write to the same
5255 * GFileIOStream implements #GSeekable, which allows the io
5256 * stream to jump to arbitrary positions in the file and to truncate
5257 * the file, provided the filesystem of the file supports these
5260 * To find the position of a file io stream, use
5261 * g_seekable_tell().
5263 * To find out if a file io stream supports seeking, use g_seekable_can_seek().
5264 * To position a file io stream, use g_seekable_seek().
5265 * To find out if a file io stream supports truncating, use
5266 * g_seekable_can_truncate(). To truncate a file io
5267 * stream, use g_seekable_truncate().
5269 * The default implementation of all the #GFileIOStream operations
5270 * and the implementation of #GSeekable just call into the same operations
5271 * on the output stream.
5278 * SECTION:gfilemonitor
5279 * @short_description: File Monitor
5280 * @include: gio/gio.h
5282 * Monitors a file or directory for changes.
5284 * To obtain a #GFileMonitor for a file or directory, use
5285 * g_file_monitor(), g_file_monitor_file(), or
5286 * g_file_monitor_directory().
5288 * To get informed about changes to the file or directory you are
5289 * monitoring, connect to the #GFileMonitor::changed signal. The
5290 * signal will be emitted in the <link
5291 * linkend="g-main-context-push-thread-default">thread-default main
5292 * context</link> of the thread that the monitor was created in
5293 * (though if the global default main context is blocked, this may
5294 * cause notifications to be blocked even if the thread-default
5295 * context is still running).
5300 * SECTION:gfilenamecompleter
5301 * @short_description: Filename Completer
5302 * @include: gio/gio.h
5304 * Completes partial file and directory names given a partial string by
5305 * looking in the file system for clues. Can return a list of possible
5306 * completion strings for widget implementations.
5311 * SECTION:gfileoutputstream
5312 * @short_description: File output streaming operations
5313 * @include: gio/gio.h
5314 * @see_also: #GOutputStream, #GDataOutputStream, #GSeekable
5316 * GFileOutputStream provides output streams that write their
5317 * content to a file.
5319 * GFileOutputStream implements #GSeekable, which allows the output
5320 * stream to jump to arbitrary positions in the file and to truncate
5321 * the file, provided the filesystem of the file supports these
5324 * To find the position of a file output stream, use g_seekable_tell().
5325 * To find out if a file output stream supports seeking, use
5326 * g_seekable_can_seek().To position a file output stream, use
5327 * g_seekable_seek(). To find out if a file output stream supports
5328 * truncating, use g_seekable_can_truncate(). To truncate a file output
5329 * stream, use g_seekable_truncate().
5334 * SECTION:gfilterinputstream
5335 * @short_description: Filter Input Stream
5336 * @include: gio/gio.h
5338 * Base class for input stream implementations that perform some
5339 * kind of filtering operation on a base stream. Typical examples
5340 * of filtering operations are character set conversion, compression
5341 * and byte order flipping.
5346 * SECTION:gfilteroutputstream
5347 * @short_description: Filter Output Stream
5348 * @include: gio/gio.h
5350 * Base class for output stream implementations that perform some
5351 * kind of filtering operation on a base stream. Typical examples
5352 * of filtering operations are character set conversion, compression
5353 * and byte order flipping.
5359 * @short_description: Interface for icons
5360 * @include: gio/gio.h
5362 * #GIcon is a very minimal interface for icons. It provides functions
5363 * for checking the equality of two icons, hashing of icons and
5364 * serializing an icon to and from strings.
5366 * #GIcon does not provide the actual pixmap for the icon as this is out
5367 * of GIO's scope, however implementations of #GIcon may contain the name
5368 * of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
5370 * To obtain a hash of a #GIcon, see g_icon_hash().
5372 * To check if two #GIcons are equal, see g_icon_equal().
5374 * For serializing a #GIcon, use g_icon_serialize() and
5375 * g_icon_deserialize().
5377 * If you want to consume #GIcon (for example, in a toolkit) you must
5378 * be prepared to handle at least the three following cases:
5379 * #GLoadableIcon, #GThemedIcon and #GEmblemedIcon. It may also make
5380 * sense to have fast-paths for other cases (like handling #GdkPixbuf
5381 * directly, for example) but all compliant #GIcon implementations
5382 * outside of GIO must implement #GLoadableIcon.
5384 * If your application or library provides one or more #GIcon
5385 * implementations you need to ensure that your new implementation also
5386 * implements #GLoadableIcon. Additionally, you must provide an
5387 * implementation of g_icon_serialize() that gives a result that is
5388 * understood by g_icon_deserialize(), yielding one of the built-in icon
5394 * SECTION:ginetaddress
5395 * @short_description: An IPv4/IPv6 address
5397 * #GInetAddress represents an IPv4 or IPv6 internet address. Use
5398 * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
5399 * look up the #GInetAddress for a hostname. Use
5400 * g_resolver_lookup_by_address() or
5401 * g_resolver_lookup_by_address_async() to look up the hostname for a
5404 * To actually connect to a remote host, you will need a
5405 * #GInetSocketAddress (which includes a #GInetAddress as well as a
5411 * SECTION:ginetaddressmask
5412 * @short_description: An IPv4/IPv6 address mask
5414 * #GInetAddressMask represents a range of IPv4 or IPv6 addresses
5415 * described by a base address and a length indicating how many bits
5416 * of the base address are relevant for matching purposes. These are
5417 * often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".
5422 * SECTION:ginetsocketaddress
5423 * @short_description: Internet GSocketAddress
5425 * An IPv4 or IPv6 socket address; that is, the combination of a
5426 * #GInetAddress and a port number.
5432 * @short_description: Failable object initialization interface
5433 * @include: gio/gio.h
5434 * @see_also: #GAsyncInitable
5436 * #GInitable is implemented by objects that can fail during
5437 * initialization. If an object implements this interface then
5438 * it must be initialized as the first thing after construction,
5439 * either via g_initable_init() or g_async_initable_init_async()
5440 * (the latter is only available if it also implements #GAsyncInitable).
5442 * If the object is not initialized, or initialization returns with an
5443 * error, then all operations on the object except g_object_ref() and
5444 * g_object_unref() are considered to be invalid, and have undefined
5445 * behaviour. They will often fail with g_critical() or g_warning(), but
5446 * this must not be relied on.
5448 * Users of objects implementing this are not intended to use
5449 * the interface method directly, instead it will be used automatically
5450 * in various ways. For C applications you generally just call
5451 * g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
5452 * This will call g_initable_init() under the cover, returning %NULL and
5453 * setting a #GError on failure (at which point the instance is
5456 * For bindings in languages where the native constructor supports
5457 * exceptions the binding could check for objects implemention %GInitable
5458 * during normal construction and automatically initialize them, throwing
5459 * an exception on failure.
5464 * SECTION:ginputstream
5465 * @short_description: Base class for implementing streaming input
5466 * @include: gio/gio.h
5468 * #GInputStream has functions to read from a stream (g_input_stream_read()),
5469 * to close a stream (g_input_stream_close()) and to skip some content
5470 * (g_input_stream_skip()).
5472 * To copy the content of an input stream to an output stream without
5473 * manually handling the reads and writes, use g_output_stream_splice().
5475 * All of these functions have async variants too.
5481 * @short_description: Error helper functions
5482 * @include: gio/gio.h
5484 * Contains helper functions for reporting errors to the user.
5490 * @short_description: Loadable GIO Modules
5491 * @include: gio/gio.h
5493 * Provides an interface and default functions for loading and unloading
5494 * modules. This is used internally to make GIO extensible, but can also
5495 * be used by others to implement module loading.
5500 * SECTION:gioscheduler
5501 * @short_description: I/O Scheduler
5502 * @include: gio/gio.h
5505 * As of GLib 2.36, the <literal>g_io_scheduler</literal> methods
5506 * are deprecated in favor of #GThreadPool and #GTask.
5509 * Schedules asynchronous I/O operations. #GIOScheduler integrates
5510 * into the main event loop (#GMainLoop) and uses threads.
5516 * @short_description: Base class for implementing read/write streams
5517 * @include: gio/gio.h
5518 * @see_also: #GInputStream, #GOutputStream
5520 * GIOStream represents an object that has both read and write streams.
5521 * Generally the two streams acts as separate input and output streams,
5522 * but they share some common resources and state. For instance, for
5523 * seekable streams they may use the same position in both streams.
5525 * Examples of #GIOStream objects are #GSocketConnection which represents
5526 * a two-way network connection, and #GFileIOStream which represent a
5527 * file handle opened in read-write mode.
5529 * To do the actual reading and writing you need to get the substreams
5530 * with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
5532 * The #GIOStream object owns the input and the output streams, not the other
5533 * way around, so keeping the substreams alive will not keep the #GIOStream
5534 * object alive. If the #GIOStream object is freed it will be closed, thus
5535 * closing the substream, so even if the substreams stay alive they will
5536 * always just return a %G_IO_ERROR_CLOSED for all operations.
5538 * To close a stream use g_io_stream_close() which will close the common
5539 * stream object and also the individual substreams. You can also close
5540 * the substreams themselves. In most cases this only marks the
5541 * substream as closed, so further I/O on it fails. However, some streams
5542 * may support "half-closed" states where one direction of the stream
5543 * is actually shut down.
5550 * SECTION:gloadableicon
5551 * @short_description: Loadable Icons
5552 * @include: gio/gio.h
5553 * @see_also: #GIcon, #GThemedIcon
5555 * Extends the #GIcon interface and adds the ability to
5556 * load icons from streams.
5561 * SECTION:gmemoryinputstream
5562 * @short_description: Streaming input operations on memory chunks
5563 * @include: gio/gio.h
5564 * @see_also: #GMemoryOutputStream
5566 * #GMemoryInputStream is a class for using arbitrary
5567 * memory chunks as input for GIO streaming input operations.
5569 * As of GLib 2.34, #GMemoryInputStream implements
5570 * #GPollableInputStream.
5575 * SECTION:gmemoryoutputstream
5576 * @short_description: Streaming output operations on memory chunks
5577 * @include: gio/gio.h
5578 * @see_also: #GMemoryInputStream
5580 * #GMemoryOutputStream is a class for using arbitrary
5581 * memory chunks as output for GIO streaming output operations.
5583 * As of GLib 2.34, #GMemoryOutputStream implements
5584 * #GPollableOutputStream.
5591 * @short_description: A simple implementation of GMenuModel
5593 * #GMenu is a simple implementation of #GMenuModel.
5594 * You populate a #GMenu by adding #GMenuItem instances to it.
5596 * There are some convenience functions to allow you to directly
5597 * add items (avoiding #GMenuItem) for the common cases. To add
5598 * a regular item, use g_menu_insert(). To add a section, use
5599 * g_menu_insert_section(). To add a submenu, use
5600 * g_menu_insert_submenu().
5605 * SECTION:gmenuexporter
5606 * @title: GMenuModel exporter
5607 * @short_description: Export GMenuModels on D-Bus
5608 * @see_also: #GMenuModel, #GDBusMenuModel
5610 * These functions support exporting a #GMenuModel on D-Bus.
5611 * The D-Bus interface that is used is a private implementation
5614 * To access an exported #GMenuModel remotely, use
5615 * g_dbus_menu_model_get() to obtain a #GDBusMenuModel.
5620 * SECTION:gmenumodel
5621 * @title: GMenuModel
5622 * @short_description: An abstract class representing the contents of a menu
5623 * @see_also: #GActionGroup
5625 * #GMenuModel represents the contents of a menu -- an ordered list of
5626 * menu items. The items are associated with actions, which can be
5627 * activated through them. Items can be grouped in sections, and may
5628 * have submenus associated with them. Both items and sections usually
5629 * have some representation data, such as labels or icons. The type of
5630 * the associated action (ie whether it is stateful, and what kind of
5631 * state it has) can influence the representation of the item.
5633 * The conceptual model of menus in #GMenuModel is hierarchical:
5634 * sections and submenus are again represented by #GMenuModels.
5635 * Menus themselves do not define their own roles. Rather, the role
5636 * of a particular #GMenuModel is defined by the item that references
5637 * it (or, in the case of the 'root' menu, is defined by the context
5638 * in which it is used).
5640 * As an example, consider the visible portions of the menu in
5641 * <xref linkend="menu-example"/>.
5643 * <figure id="menu-example">
5644 * <title>An example menu</title>
5645 * <graphic fileref="menu-example.png" format="PNG"></graphic>
5648 * There are 8 "menus" visible in the screenshot: one menubar, two
5649 * submenus and 5 sections:
5651 * <listitem>the toplevel menubar (containing 4 items)</listitem>
5652 * <listitem>the View submenu (containing 3 sections)</listitem>
5653 * <listitem>the first section of the View submenu (containing 2 items)</listitem>
5654 * <listitem>the second section of the View submenu (containing 1 item)</listitem>
5655 * <listitem>the final section of the View submenu (containing 1 item)</listitem>
5656 * <listitem>the Highlight Mode submenu (containing 2 sections)</listitem>
5657 * <listitem>the Sources section (containing 2 items)</listitem>
5658 * <listitem>the Markup section (containing 2 items)</listitem>
5661 * <xref linkend="menu-model"/> illustrates the conceptual connection between
5662 * these 8 menus. Each large block in the figure represents a menu and the
5663 * smaller blocks within the large block represent items in that menu. Some
5664 * items contain references to other menus.
5666 * <figure id="menu-model">
5667 * <title>A menu model</title>
5668 * <graphic fileref="menu-model.png" format="PNG"></graphic>
5671 * Notice that the separators visible in <xref linkend="menu-example"/>
5672 * appear nowhere in <xref linkend="menu-model"/>. This is because
5673 * separators are not explicitly represented in the menu model. Instead,
5674 * a separator is inserted between any two non-empty sections of a menu.
5675 * Section items can have labels just like any other item. In that case,
5676 * a display system may show a section header instead of a separator.
5678 * The motivation for this abstract model of application controls is
5679 * that modern user interfaces tend to make these controls available
5680 * outside the application. Examples include global menus, jumplists,
5681 * dash boards, etc. To support such uses, it is necessary to 'export'
5682 * information about actions and their representation in menus, which
5683 * is exactly what the
5684 * <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
5686 * <link linkend="gio-GMenuModel-exporter">GMenuModel exporter</link>
5687 * do for #GActionGroup and #GMenuModel. The client-side counterparts
5688 * to make use of the exported information are #GDBusActionGroup and
5691 * The API of #GMenuModel is very generic, with iterators for the
5692 * attributes and links of an item, see g_menu_model_iterate_item_attributes()
5693 * and g_menu_model_iterate_item_links(). The 'standard' attributes and
5694 * link types have predefined names: %G_MENU_ATTRIBUTE_LABEL,
5695 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, %G_MENU_LINK_SECTION
5696 * and %G_MENU_LINK_SUBMENU.
5698 * Items in a #GMenuModel represent active controls if they refer to
5699 * an action that can get activated when the user interacts with the
5700 * menu item. The reference to the action is encoded by the string id
5701 * in the %G_MENU_ATTRIBUTE_ACTION attribute. An action id uniquely
5702 * identifies an action in an action group. Which action group(s) provide
5703 * actions depends on the context in which the menu model is used.
5704 * E.g. when the model is exported as the application menu of a
5705 * #GtkApplication, actions can be application-wide or window-specific
5706 * (and thus come from two different action groups). By convention, the
5707 * application-wide actions have names that start with "app.", while the
5708 * names of window-specific actions start with "win.".
5710 * While a wide variety of stateful actions is possible, the following
5711 * is the minimum that is expected to be supported by all users of exported
5714 * <listitem>an action with no parameter type and no state</listitem>
5715 * <listitem>an action with no parameter type and boolean state</listitem>
5716 * <listitem>an action with string parameter type and string state</listitem>
5719 * <formalpara><title>Stateless</title>
5721 * A stateless action typically corresponds to an ordinary menu item.
5724 * Selecting such a menu item will activate the action (with no parameter).
5728 * <formalpara><title>Boolean State</title>
5730 * An action with a boolean state will most typically be used with a "toggle"
5731 * or "switch" menu item. The state can be set directly, but activating the
5732 * action (with no parameter) results in the state being toggled.
5735 * Selecting a toggle menu item will activate the action. The menu item should
5736 * be rendered as "checked" when the state is true.
5740 * <formalpara><title>String Parameter and State</title>
5742 * Actions with string parameters and state will most typically be used to
5743 * represent an enumerated choice over the items available for a group of
5744 * radio menu items. Activating the action with a string parameter is
5745 * equivalent to setting that parameter as the state.
5748 * Radio menu items, in addition to being associated with the action, will
5749 * have a target value. Selecting that menu item will result in activation
5750 * of the action with the target value as the parameter. The menu item should
5751 * be rendered as "selected" when the state of the action is equal to the
5752 * target value of the menu item.
5760 * @short_description: Mount management
5761 * @include: gio/gio.h
5762 * @see_also: GVolume, GUnixMountEntry, GUnixMountPoint
5764 * The #GMount interface represents user-visible mounts. Note, when
5765 * porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
5767 * #GMount is a "mounted" filesystem that you can access. Mounted is in
5768 * quotes because it's not the same as a unix mount, it might be a gvfs
5769 * mount, but you can still access the files on it if you use GIO. Might or
5770 * might not be related to a volume object.
5772 * Unmounting a #GMount instance is an asynchronous operation. For
5773 * more information about asynchronous operations, see #GAsyncResult
5774 * and #GTask. To unmount a #GMount instance, first call
5775 * g_mount_unmount_with_operation() with (at least) the #GMount instance and a
5776 * #GAsyncReadyCallback. The callback will be fired when the
5777 * operation has resolved (either with success or failure), and a
5778 * #GAsyncReady structure will be passed to the callback. That
5779 * callback should then call g_mount_unmount_with_operation_finish() with the #GMount
5780 * and the #GAsyncReady data to see if the operation was completed
5781 * successfully. If an @error is present when g_mount_unmount_with_operation_finish()
5782 * is called, then it will be filled with any error information.
5787 * SECTION:gmountoperation
5788 * @short_description: Object used for authentication and user interaction
5789 * @include: gio/gio.h
5791 * #GMountOperation provides a mechanism for interacting with the user.
5792 * It can be used for authenticating mountable operations, such as loop
5793 * mounting files, hard drive partitions or server locations. It can
5794 * also be used to ask the user questions or show a list of applications
5795 * preventing unmount or eject operations from completing.
5797 * Note that #GMountOperation is used for more than just #GMount
5798 * objects – for example it is also used in g_drive_start() and
5801 * Users should instantiate a subclass of this that implements all the
5802 * various callbacks to show the required dialogs, such as
5803 * #GtkMountOperation. If no user interaction is desired (for example
5804 * when automounting filesystems at login time), usually %NULL can be
5805 * passed, see each method taking a #GMountOperation for details.
5810 * SECTION:gnetworkaddress
5811 * @short_description: A GSocketConnectable for resolving hostnames
5812 * @include: gio/gio.h
5814 * #GNetworkAddress provides an easy way to resolve a hostname and
5815 * then attempt to connect to that host, handling the possibility of
5816 * multiple IP addresses and multiple address families.
5818 * See #GSocketConnectable for and example of using the connectable
5824 * SECTION:gnetworking
5825 * @title: gnetworking.h
5826 * @short_description: System networking includes
5827 * @include: gio/gnetworking.h
5829 * The <literal>gnetworking.h</literal> header can be included to get
5830 * various low-level networking-related system headers, automatically
5831 * taking care of certain portability issues for you.
5833 * This can be used, for example, if you want to call setsockopt()
5836 * Note that while WinSock has many of the same APIs as the
5837 * traditional UNIX socket API, most of them behave at least slightly
5838 * differently (particularly with respect to error handling). If you
5839 * want your code to work under both UNIX and Windows, you will need
5840 * to take these differences into account.
5842 * Also, under glibc, certain non-portable functions are only visible
5843 * in the headers if you define <literal>_GNU_SOURCE</literal> before
5844 * including them. Note that this symbol must be defined before
5845 * including <emphasis>any</emphasis> headers, or it may not take
5851 * SECTION:gnetworkmonitor
5852 * @title: GNetworkMonitor
5853 * @short_description: Network status monitor
5854 * @include: gio/gio.h
5856 * #GNetworkMonitor provides an easy-to-use cross-platform API
5857 * for monitoring network connectivity. On Linux, the implementation
5858 * is based on the kernel's netlink interface.
5863 * SECTION:gnetworkservice
5864 * @short_description: A GSocketConnectable for resolving SRV records
5865 * @include: gio/gio.h
5867 * Like #GNetworkAddress does with hostnames, #GNetworkService
5868 * provides an easy way to resolve a SRV record, and then attempt to
5869 * connect to one of the hosts that implements that service, handling
5870 * service priority/weighting, multiple IP addresses, and multiple
5873 * See #GSrvTarget for more information about SRV records, and see
5874 * #GSocketConnectable for and example of using the connectable
5880 * SECTION:goutputstream
5881 * @short_description: Base class for implementing streaming output
5882 * @include: gio/gio.h
5884 * #GOutputStream has functions to write to a stream (g_output_stream_write()),
5885 * to close a stream (g_output_stream_close()) and to flush pending writes
5886 * (g_output_stream_flush()).
5888 * To copy the content of an input stream to an output stream without
5889 * manually handling the reads and writes, use g_output_stream_splice().
5891 * All of these functions have async variants too.
5896 * SECTION:gpermission
5897 * @title: GPermission
5898 * @short_description: An object representing the permission to perform a certain action
5900 * A #GPermission represents the status of the caller's permission to
5901 * perform a certain action.
5903 * You can query if the action is currently allowed and if it is
5904 * possible to acquire the permission so that the action will be allowed
5907 * There is also an API to actually acquire the permission and one to
5910 * As an example, a #GPermission might represent the ability for the
5911 * user to write to a #GSettings object. This #GPermission object could
5912 * then be used to decide if it is appropriate to show a "Click here to
5913 * unlock" button in a dialog and to provide the mechanism to invoke
5914 * when that button is clicked.
5919 * SECTION:gpollableinputstream
5920 * @short_description: Interface for pollable input streams
5921 * @include: gio/gio.h
5922 * @see_also: #GInputStream, #GPollableOutputStream, #GFileDescriptorBased
5924 * #GPollableInputStream is implemented by #GInputStreams that
5925 * can be polled for readiness to read. This can be used when
5926 * interfacing with a non-GIO API that expects
5927 * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5934 * SECTION:gpollableoutputstream
5935 * @short_description: Interface for pollable output streams
5936 * @include: gio/gio.h
5937 * @see_also: #GOutputStream, #GFileDescriptorBased, #GPollableInputStream
5939 * #GPollableOutputStream is implemented by #GOutputStreams that
5940 * can be polled for readiness to write. This can be used when
5941 * interfacing with a non-GIO API that expects
5942 * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5949 * SECTION:gpollableutils
5950 * @short_description: Utilities for pollable streams
5951 * @include: gio/gio.h
5953 * Utility functions for #GPollableInputStream and
5954 * #GPollableOutputStream implementations.
5959 * SECTION:gpropertyaction
5960 * @title: GPropertyAction
5961 * @short_description: A GAction reflecting a GObject property
5963 * A #GPropertyAction is a way to get a #GAction with a state value
5964 * reflecting and controlling the value of a #GObject property.
5966 * The state of the action will correspond to the value of the property.
5967 * Changing it will change the property (assuming the requested value
5968 * matches the requirements as specified in the #GParamSpec).
5970 * Only the most common types are presently supported. Booleans are
5971 * mapped to booleans, strings to strings, signed/unsigned integers to
5972 * int32/uint32 and floats and doubles to doubles.
5974 * If the property is an enum then the state will be string-typed and
5975 * conversion will automatically be performed between the enum value and
5976 * "nick" string as per the #GEnumValue table.
5978 * Flags types are not currently supported.
5980 * Properties of object types, boxed types and pointer types are not
5981 * supported and probably never will be.
5983 * Properties of #GVariant types are not currently supported.
5985 * If the property is boolean-valued then the action will have a NULL
5986 * parameter type, and activating the action (with no parameter) will
5987 * toggle the value of the property.
5989 * In all other cases, the parameter type will correspond to the type of
5992 * The general idea here is to reduce the number of locations where a
5993 * particular piece of state is kept (and therefore has to be
5994 * synchronised between). #GPropertyAction does not have a separate
5995 * state that is kept in sync with the property value -- its state
5996 * <em>is</em> the property value.
5998 * For example, it might be useful to create a #GAction corresponding to
5999 * the "visible-child-name" property of a #GtkStack so that the current
6000 * page can be switched from a menu. The active radio indication in the
6001 * menu is then directly determined from the active page of the
6004 * An anti-example would be binding the "active-id" property on a
6005 * #GtkComboBox. This is because the state of the combobox itself is
6006 * probably uninteresting and is actually being used to control
6009 * Another anti-example would be to bind to the "visible-child-name"
6010 * property of a #GtkStack if this value is actually stored in
6011 * #GSettings. In that case, the real source of the value is
6012 * #GSettings. If you want a #GAction to control a setting stored in
6013 * #GSettings, see g_settings_create_action() instead, and possibly
6014 * combine its use with g_settings_bind().
6022 * @short_description: Interface for proxy handling
6024 * A #GProxy handles connecting to a remote host via a given type of
6025 * proxy server. It is implemented by the 'gio-proxy' extension point.
6026 * The extensions are named after their proxy protocol name. As an
6027 * example, a SOCKS5 proxy implementation can be retrieved with the
6028 * name 'socks5' using the function
6029 * g_io_extension_point_get_extension_by_name().
6036 * SECTION:gproxyaddress
6037 * @short_description: An internet address with proxy information
6039 * Support for proxied #GInetSocketAddress.
6044 * SECTION:gproxyresolver
6045 * @short_description: Asynchronous and cancellable network proxy resolver
6046 * @include: gio/gio.h
6048 * #GProxyResolver provides synchronous and asynchronous network proxy
6049 * resolution. #GProxyResolver is used within #GSocketClient through
6050 * the method g_socket_connectable_proxy_enumerate().
6055 * SECTION:gremoteactiongroup
6056 * @title: GRemoteActionGroup
6057 * @short_description: A GActionGroup that interacts with other processes
6059 * The GRemoteActionGroup interface is implemented by #GActionGroup
6060 * instances that either transmit action invocations to other processes
6061 * or receive action invocations in the local process from other
6064 * The interface has <literal>_full</literal> variants of the two
6065 * methods on #GActionGroup used to activate actions:
6066 * g_action_group_activate_action() and
6067 * g_action_group_change_action_state(). These variants allow a
6068 * "platform data" #GVariant to be specified: a dictionary providing
6069 * context for the action invocation (for example: timestamps, startup
6070 * notification IDs, etc).
6072 * #GDBusActionGroup implements #GRemoteActionGroup. This provides a
6073 * mechanism to send platform data for action invocations over D-Bus.
6075 * Additionally, g_dbus_connection_export_action_group() will check if
6076 * the exported #GActionGroup implements #GRemoteActionGroup and use the
6077 * <literal>_full</literal> variants of the calls if available. This
6078 * provides a mechanism by which to receive platform data for action
6079 * invocations that arrive by way of D-Bus.
6087 * @short_description: Asynchronous and cancellable DNS resolver
6088 * @include: gio/gio.h
6090 * #GResolver provides cancellable synchronous and asynchronous DNS
6091 * resolution, for hostnames (g_resolver_lookup_by_address(),
6092 * g_resolver_lookup_by_name() and their async variants) and SRV
6093 * (service) records (g_resolver_lookup_service()).
6095 * #GNetworkAddress and #GNetworkService provide wrappers around
6096 * #GResolver functionality that also implement #GSocketConnectable,
6097 * making it easy to connect to a remote host/service.
6103 * @short_description: Resource framework
6104 * @include: gio/gio.h
6106 * Applications and libraries often contain binary or textual data that is really part of the
6107 * application, rather than user data. For instance #GtkBuilder .ui files, splashscreen images,
6108 * GMenu markup xml, CSS files, icons, etc. These are often shipped as files in <filename>$datadir/appname</filename>, or
6109 * manually included as literal strings in the code.
6111 * The #GResource API and the <link linkend="glib-compile-resources">glib-compile-resources</link> program
6112 * provide a convenient and efficient alternative to this which has some nice properties. You
6113 * maintain the files as normal files, so its easy to edit them, but during the build the files
6114 * are combined into a binary bundle that is linked into the executable. This means that loading
6115 * the resource files are efficient (as they are already in memory, shared with other instances) and
6116 * simple (no need to check for things like I/O errors or locate the files in the filesystem). It
6117 * also makes it easier to create relocatable applications.
6119 * Resource files can also be marked as compressed. Such files will be included in the resource bundle
6120 * in a compressed form, but will be automatically uncompressed when the resource is used. This
6121 * is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away.
6123 * Resource files can also be marked to be preprocessed, by setting the value of the
6124 * <literal>preprocess</literal> attribute to a comma-separated list of preprocessing options.
6125 * The only options currently supported are:
6127 * <literal>xml-stripblanks</literal> which will use <command>xmllint</command> to strip
6128 * ignorable whitespace from the xml file. For this to work, the <envar>XMLLINT</envar>
6129 * environment variable must be set to the full path to the xmllint executable, or xmllint
6130 * must be in the PATH; otherwise the preprocessing step is skipped.
6132 * <literal>to-pixdata</literal> which will use <command>gdk-pixbuf-pixdata</command> to convert
6133 * images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside
6134 * the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata
6135 * program must be in the PATH, or the <envar>GDK_PIXBUF_PIXDATA</envar> environment variable must be
6136 * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will
6139 * Resource bundles are created by the <link linkend="glib-compile-resources">glib-compile-resources</link> program
6140 * which takes an xml file that describes the bundle, and a set of files that the xml references. These
6141 * are combined into a binary resource bundle.
6143 * <example id="resource-example"><title>Example resource description</title>
6144 * <programlisting><![CDATA[
6145 * <?xml version="1.0" encoding="UTF-8"?>
6147 * <gresource prefix="/org/gtk/Example">
6148 * <file>data/splashscreen.png</file>
6149 * <file compressed="true">dialog.ui</file>
6150 * <file preprocess="xml-stripblanks">menumarkup.xml</file>
6153 * ]]></programlisting></example>
6155 * This will create a resource bundle with the following files:
6156 * <programlisting><![CDATA[
6157 * /org/gtk/Example/data/splashscreen.png
6158 * /org/gtk/Example/dialog.ui
6159 * /org/gtk/Example/menumarkup.xml
6160 * ]]></programlisting>
6162 * Note that all resources in the process share the same namespace, so use java-style
6163 * path prefixes (like in the above example) to avoid conflicts.
6165 * You can then use <link linkend="glib-compile-resources">glib-compile-resources</link> to compile the xml to a
6166 * binary bundle that you can load with g_resource_load(). However, its more common to use the --generate-source and
6167 * --generate-header arguments to create a source file and header to link directly into your application.
6169 * Once a #GResource has been created and registered all the data in it can be accessed globally in the process by
6170 * using API calls like g_resources_open_stream() to stream the data or g_resources_lookup_data() to get a direct pointer
6171 * to the data. You can also use uris like "resource:///org/gtk/Example/data/splashscreen.png" with #GFile to access
6172 * the resource data.
6174 * There are two forms of the generated source, the default version uses the compiler support for constructor
6175 * and destructor functions (where available) to automatically create and register the #GResource on startup
6176 * or library load time. If you pass --manual-register two functions to register/unregister the resource is instead
6177 * created. This requires an explicit initialization call in your application/library, but it works on all platforms,
6178 * even on the minor ones where this is not available. (Constructor support is available for at least Win32, MacOS and Linux.)
6180 * Note that resource data can point directly into the data segment of e.g. a library, so if you are unloading libraries
6181 * during runtime you need to be very careful with keeping around pointers to data from a resource, as this goes away
6182 * when the library is unloaded. However, in practice this is not generally a problem, since most resource accesses
6183 * is for your own resources, and resource data is often used once, during parsing, and then released.
6191 * @short_description: Stream seeking interface
6192 * @include: gio/gio.h
6193 * @see_also: #GInputStream, #GOutputStream
6195 * #GSeekable is implemented by streams (implementations of
6196 * #GInputStream or #GOutputStream) that support seeking.
6202 * @short_description: High-level API for application settings
6204 * The #GSettings class provides a convenient API for storing and retrieving
6205 * application settings.
6207 * Reads and writes can be considered to be non-blocking. Reading
6208 * settings with #GSettings is typically extremely fast: on
6209 * approximately the same order of magnitude (but slower than) a
6210 * #GHashTable lookup. Writing settings is also extremely fast in terms
6211 * of time to return to your application, but can be extremely expensive
6212 * for other threads and other processes. Many settings backends
6213 * (including dconf) have lazy initialisation which means in the common
6214 * case of the user using their computer without modifying any settings
6215 * a lot of work can be avoided. For dconf, the D-Bus service doesn't
6216 * even need to be started in this case. For this reason, you should
6217 * only ever modify #GSettings keys in response to explicit user action.
6218 * Particular care should be paid to ensure that modifications are not
6219 * made during startup -- for example, when setting the initial value
6220 * of preferences widgets. The built-in g_settings_bind() functionality
6221 * is careful not to write settings in response to notify signals as a
6222 * result of modifications that it makes to widgets.
6224 * When creating a GSettings instance, you have to specify a schema
6225 * that describes the keys in your settings and their types and default
6226 * values, as well as some other information.
6228 * Normally, a schema has as fixed path that determines where the settings
6229 * are stored in the conceptual global tree of settings. However, schemas
6230 * can also be 'relocatable', i.e. not equipped with a fixed path. This is
6231 * useful e.g. when the schema describes an 'account', and you want to be
6232 * able to store a arbitrary number of accounts.
6234 * Paths must start with and end with a forward slash character ('/')
6235 * and must not contain two sequential slash characters. Paths should
6236 * be chosen based on a domain name associated with the program or
6237 * library to which the settings belong. Examples of paths are
6238 * "/org/gtk/settings/file-chooser/" and "/ca/desrt/dconf-editor/".
6239 * Paths should not start with "/apps/", "/desktop/" or "/system/" as
6240 * they often did in GConf.
6242 * Unlike other configuration systems (like GConf), GSettings does not
6243 * restrict keys to basic types like strings and numbers. GSettings stores
6244 * values as #GVariant, and allows any #GVariantType for keys. Key names
6245 * are restricted to lowercase characters, numbers and '-'. Furthermore,
6246 * the names must begin with a lowercase character, must not end
6247 * with a '-', and must not contain consecutive dashes.
6249 * Similar to GConf, the default values in GSettings schemas can be
6250 * localized, but the localized values are stored in gettext catalogs
6251 * and looked up with the domain that is specified in the
6252 * <tag class="attribute">gettext-domain</tag> attribute of the
6253 * <tag class="starttag">schemalist</tag> or <tag class="starttag">schema</tag>
6254 * elements and the category that is specified in the l10n attribute of the
6255 * <tag class="starttag">key</tag> element.
6257 * GSettings uses schemas in a compact binary form that is created
6258 * by the <link linkend="glib-compile-schemas">glib-compile-schemas</link>
6259 * utility. The input is a schema description in an XML format that can be
6260 * described by the following DTD:
6261 * |[<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>]|
6263 * glib-compile-schemas expects schema files to have the extension <filename>.gschema.xml</filename>
6265 * At runtime, schemas are identified by their id (as specified
6266 * in the <tag class="attribute">id</tag> attribute of the
6267 * <tag class="starttag">schema</tag> element). The
6268 * convention for schema ids is to use a dotted name, similar in
6269 * style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
6270 * if the settings are for a specific service that owns a D-Bus bus name,
6271 * the D-Bus bus name and schema id should match. For schemas which deal
6272 * with settings not associated with one named application, the id should
6273 * not use StudlyCaps, e.g. "org.gnome.font-rendering".
6275 * In addition to #GVariant types, keys can have types that have enumerated
6276 * types. These can be described by a <tag class="starttag">choice</tag>,
6277 * <tag class="starttag">enum</tag> or <tag class="starttag">flags</tag> element, see
6278 * <xref linkend="schema-enumerated"/>. The underlying type of
6279 * such a key is string, but you can use g_settings_get_enum(),
6280 * g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags()
6281 * access the numeric values corresponding to the string value of enum
6284 * <example id="schema-default-values"><title>Default values</title>
6285 * <programlisting><![CDATA[
6287 * <schema id="org.gtk.Test" path="/org/gtk/Test/" gettext-domain="test">
6289 * <key name="greeting" type="s">
6290 * <default l10n="messages">"Hello, earthlings"</default>
6291 * <summary>A greeting</summary>
6293 * Greeting of the invading martians
6297 * <key name="box" type="(ii)">
6298 * <default>(20,30)</default>
6303 * ]]></programlisting></example>
6305 * <example id="schema-enumerated"><title>Ranges, choices and enumerated types</title>
6306 * <programlisting><![CDATA[
6309 * <enum id="org.gtk.Test.myenum">
6310 * <value nick="first" value="1"/>
6311 * <value nick="second" value="2"/>
6314 * <flags id="org.gtk.Test.myflags">
6315 * <value nick="flag1" value="1"/>
6316 * <value nick="flag2" value="2"/>
6317 * <value nick="flag3" value="4"/>
6320 * <schema id="org.gtk.Test">
6322 * <key name="key-with-range" type="i">
6323 * <range min="1" max="100"/>
6324 * <default>10</default>
6327 * <key name="key-with-choices" type="s">
6329 * <choice value='Elisabeth'/>
6330 * <choice value='Annabeth'/>
6331 * <choice value='Joe'/>
6334 * <alias value='Anna' target='Annabeth'/>
6335 * <alias value='Beth' target='Elisabeth'/>
6337 * <default>'Joe'</default>
6340 * <key name='enumerated-key' enum='org.gtk.Test.myenum'>
6341 * <default>'first'</default>
6344 * <key name='flags-key' flags='org.gtk.Test.myflags'>
6345 * <default>["flag1",flag2"]</default>
6349 * ]]></programlisting></example>
6352 * <title>Vendor overrides</title>
6354 * Default values are defined in the schemas that get installed by
6355 * an application. Sometimes, it is necessary for a vendor or distributor
6356 * to adjust these defaults. Since patching the XML source for the schema
6357 * is inconvenient and error-prone,
6358 * <link linkend="glib-compile-schemas">glib-compile-schemas</link> reads
6359 * so-called 'vendor override' files. These are keyfiles in the same
6360 * directory as the XML schema sources which can override default values.
6361 * The schema id serves as the group name in the key file, and the values
6362 * are expected in serialized GVariant form, as in the following example:
6363 * <informalexample><programlisting>
6367 * </programlisting></informalexample>
6370 * glib-compile-schemas expects schema files to have the extension
6371 * <filename>.gschema.override</filename>
6376 * <title>Binding</title>
6378 * A very convenient feature of GSettings lets you bind #GObject properties
6379 * directly to settings, using g_settings_bind(). Once a GObject property
6380 * has been bound to a setting, changes on either side are automatically
6381 * propagated to the other side. GSettings handles details like
6382 * mapping between GObject and GVariant types, and preventing infinite
6386 * This makes it very easy to hook up a preferences dialog to the
6387 * underlying settings. To make this even more convenient, GSettings
6388 * looks for a boolean property with the name "sensitivity" and
6389 * automatically binds it to the writability of the bound setting.
6390 * If this 'magic' gets in the way, it can be suppressed with the
6391 * #G_SETTINGS_BIND_NO_SENSITIVITY flag.
6398 * SECTION:gsettingsbackend
6399 * @title: GSettingsBackend
6400 * @short_description: Interface for settings backend implementations
6401 * @include: gio/gsettingsbackend.h
6402 * @see_also: #GSettings, #GIOExtensionPoint
6404 * The #GSettingsBackend interface defines a generic interface for
6405 * non-strictly-typed data that is stored in a hierarchy. To implement
6406 * an alternative storage backend for #GSettings, you need to implement
6407 * the #GSettingsBackend interface and then make it implement the
6408 * extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.
6410 * The interface defines methods for reading and writing values, a
6411 * method for determining if writing of certain values will fail
6412 * (lockdown) and a change notification mechanism.
6414 * The semantics of the interface are very precisely defined and
6415 * implementations must carefully adhere to the expectations of
6416 * callers that are documented on each of the interface methods.
6418 * Some of the GSettingsBackend functions accept or return a #GTree.
6419 * These trees always have strings as keys and #GVariant as values.
6420 * g_settings_backend_create_tree() is a convenience function to create
6424 * The #GSettingsBackend API is exported to allow third-party
6425 * implementations, but does not carry the same stability guarantees
6426 * as the public GIO API. For this reason, you have to define the
6427 * C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including
6428 * <filename>gio/gsettingsbackend.h</filename>
6434 * SECTION:gsettingsschema
6435 * @short_description: Introspecting and controlling the loading of GSettings schemas
6437 * The #GSettingsSchemaSource and #GSettingsSchema APIs provide a
6438 * mechanism for advanced control over the loading of schemas and a
6439 * mechanism for introspecting their content.
6441 * Plugin loading systems that wish to provide plugins a way to access
6442 * settings face the problem of how to make the schemas for these
6443 * settings visible to GSettings. Typically, a plugin will want to ship
6444 * the schema along with itself and it won't be installed into the
6445 * standard system directories for schemas.
6447 * #GSettingsSchemaSource provides a mechanism for dealing with this by
6448 * allowing the creation of a new 'schema source' from which schemas can
6449 * be acquired. This schema source can then become part of the metadata
6450 * associated with the plugin and queried whenever the plugin requires
6451 * access to some settings.
6453 * Consider the following example:
6459 * GSettingsSchemaSource *schema_source;
6464 * initialise_plugin (const gchar *dir)
6470 * plugin->schema_source =
6471 * g_settings_new_schema_source_from_directory (dir,
6472 * g_settings_schema_source_get_default (), FALSE, NULL);
6482 * plugin_get_settings (Plugin *plugin,
6483 * const gchar *schema_id)
6485 * GSettingsSchema *schema;
6487 * if (schema_id == NULL)
6488 * schema_id = plugin->identifier;
6490 * schema = g_settings_schema_source_lookup (plugin->schema_source,
6491 * schema_id, FALSE);
6493 * if (schema == NULL)
6495 * ... disable the plugin or abort, etc ...
6498 * return g_settings_new_full (schema, NULL, NULL);
6502 * The code above shows how hooks should be added to the code that
6503 * initialises (or enables) the plugin to create the schema source and
6504 * how an API can be added to the plugin system to provide a convenient
6505 * way for the plugin to access its settings, using the schemas that it
6508 * From the standpoint of the plugin, it would need to ensure that it
6509 * ships a gschemas.compiled file as part of itself, and then simply do
6514 * GSettings *settings;
6517 * settings = plugin_get_settings (self, NULL);
6518 * some_value = g_settings_get_int (settings, "some-value");
6523 * It's also possible that the plugin system expects the schema source
6524 * files (ie: .gschema.xml files) instead of a gschemas.compiled file.
6525 * In that case, the plugin loading system must compile the schemas for
6526 * itself before attempting to create the settings source.
6533 * SECTION:gsimpleaction
6534 * @title: GSimpleAction
6535 * @short_description: A simple GAction implementation
6537 * A #GSimpleAction is the obvious simple implementation of the #GAction
6538 * interface. This is the easiest way to create an action for purposes of
6539 * adding it to a #GSimpleActionGroup.
6541 * See also #GtkAction.
6546 * SECTION:gsimpleactiongroup
6547 * @title: GSimpleActionGroup
6548 * @short_description: A simple GActionGroup implementation
6550 * #GSimpleActionGroup is a hash table filled with #GAction objects,
6551 * implementing the #GActionGroup and #GActionMap interfaces.
6556 * SECTION:gsimpleasyncresult
6557 * @short_description: Simple asynchronous results implementation
6558 * @include: gio/gio.h
6559 * @see_also: #GAsyncResult
6562 * As of GLib 2.36, #GSimpleAsyncResult is deprecated in favor of
6563 * #GTask, which provides a simpler API.
6566 * #GSimpleAsyncResult implements #GAsyncResult.
6568 * GSimpleAsyncResult handles #GAsyncReadyCallback<!-- -->s, error
6569 * reporting, operation cancellation and the final state of an operation,
6570 * completely transparent to the application. Results can be returned
6571 * as a pointer e.g. for functions that return data that is collected
6572 * asynchronously, a boolean value for checking the success or failure
6573 * of an operation, or a #gssize for operations which return the number
6574 * of bytes modified by the operation; all of the simple return cases
6577 * Most of the time, an application will not need to know of the details
6578 * of this API; it is handled transparently, and any necessary operations
6579 * are handled by #GAsyncResult's interface. However, if implementing a
6580 * new GIO module, for writing language bindings, or for complex
6581 * applications that need better control of how asynchronous operations
6582 * are completed, it is important to understand this functionality.
6584 * GSimpleAsyncResults are tagged with the calling function to ensure
6585 * that asynchronous functions and their finishing functions are used
6586 * together correctly.
6588 * To create a new #GSimpleAsyncResult, call g_simple_async_result_new().
6589 * If the result needs to be created for a #GError, use
6590 * g_simple_async_result_new_from_error() or
6591 * g_simple_async_result_new_take_error(). If a #GError is not available
6592 * (e.g. the asynchronous operation's doesn't take a #GError argument),
6593 * but the result still needs to be created for an error condition, use
6594 * g_simple_async_result_new_error() (or g_simple_async_result_set_error_va()
6595 * if your application or binding requires passing a variable argument list
6596 * directly), and the error can then be propagated through the use of
6597 * g_simple_async_result_propagate_error().
6599 * An asynchronous operation can be made to ignore a cancellation event by
6600 * calling g_simple_async_result_set_handle_cancellation() with a
6601 * #GSimpleAsyncResult for the operation and %FALSE. This is useful for
6602 * operations that are dangerous to cancel, such as close (which would
6603 * cause a leak if cancelled before being run).
6605 * GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
6606 * or it can use #GThread<!-- -->s.
6607 * g_simple_async_result_complete() will finish an I/O task directly
6608 * from the point where it is called. g_simple_async_result_complete_in_idle()
6609 * will finish it from an idle handler in the <link
6610 * linkend="g-main-context-push-thread-default">thread-default main
6611 * context</link>. g_simple_async_result_run_in_thread() will run the
6612 * job in a separate thread and then deliver the result to the
6613 * thread-default main context.
6615 * To set the results of an asynchronous function,
6616 * g_simple_async_result_set_op_res_gpointer(),
6617 * g_simple_async_result_set_op_res_gboolean(), and
6618 * g_simple_async_result_set_op_res_gssize()
6619 * are provided, setting the operation's result to a gpointer, gboolean, or
6620 * gssize, respectively.
6622 * Likewise, to get the result of an asynchronous function,
6623 * g_simple_async_result_get_op_res_gpointer(),
6624 * g_simple_async_result_get_op_res_gboolean(), and
6625 * g_simple_async_result_get_op_res_gssize() are
6626 * provided, getting the operation's result as a gpointer, gboolean, and
6627 * gssize, respectively.
6629 * For the details of the requirements implementations must respect, see
6630 * #GAsyncResult. A typical implementation of an asynchronous operation
6631 * using GSimpleAsyncResult looks something like this:
6635 * baked_cb (Cake *cake,
6636 * gpointer user_data)
6638 * /* In this example, this callback is not given a reference to the cake, so
6639 * * the GSimpleAsyncResult has to take a reference to it.
6641 * GSimpleAsyncResult *result = user_data;
6644 * g_simple_async_result_set_error (result,
6646 * BAKER_ERROR_NO_FLOUR,
6647 * "Go to the supermarket");
6649 * g_simple_async_result_set_op_res_gpointer (result,
6650 * g_object_ref (cake),
6654 * /* In this example, we assume that baked_cb is called as a callback from
6655 * * the mainloop, so it's safe to complete the operation synchronously here.
6656 * * If, however, _baker_prepare_cake () might call its callback without
6657 * * first returning to the mainloop — inadvisable, but some APIs do so —
6658 * * we would need to use g_simple_async_result_complete_in_idle().
6660 * g_simple_async_result_complete (result);
6661 * g_object_unref (result);
6665 * baker_bake_cake_async (Baker *self,
6667 * GAsyncReadyCallback callback,
6668 * gpointer user_data)
6670 * GSimpleAsyncResult *simple;
6675 * g_simple_async_report_error_in_idle (G_OBJECT (self),
6679 * BAKER_ERROR_TOO_SMALL,
6680 * "%ucm radius cakes are silly",
6685 * simple = g_simple_async_result_new (G_OBJECT (self),
6688 * baker_bake_cake_async);
6689 * cake = _baker_get_cached_cake (self, radius);
6693 * g_simple_async_result_set_op_res_gpointer (simple,
6694 * g_object_ref (cake),
6696 * g_simple_async_result_complete_in_idle (simple);
6697 * g_object_unref (simple);
6698 * /* Drop the reference returned by _baker_get_cached_cake(); the
6699 * * GSimpleAsyncResult has taken its own reference.
6701 * g_object_unref (cake);
6705 * _baker_prepare_cake (self, radius, baked_cb, simple);
6709 * baker_bake_cake_finish (Baker *self,
6710 * GAsyncResult *result,
6713 * GSimpleAsyncResult *simple;
6716 * g_return_val_if_fail (g_simple_async_result_is_valid (result,
6718 * baker_bake_cake_async),
6721 * simple = (GSimpleAsyncResult *) result;
6723 * if (g_simple_async_result_propagate_error (simple, error))
6726 * cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
6727 * return g_object_ref (cake);
6734 * SECTION:gsimplepermission
6735 * @title: GSimplePermission
6736 * @short_description: A GPermission that doesn't change value
6738 * #GSimplePermission is a trivial implementation of #GPermission that
6739 * represents a permission that is either always or never allowed. The
6740 * value is given at construction and doesn't change.
6742 * Calling request or release will result in errors.
6747 * SECTION:gsimpleproxyresolver
6748 * @short_description: Simple proxy resolver implementation
6749 * @include: gio/gio.h
6750 * @see_also: g_socket_client_set_proxy_resolver()
6752 * #GSimpleProxyResolver is a simple #GProxyResolver implementation
6753 * that handles a single default proxy, multiple URI-scheme-specific
6754 * proxies, and a list of hosts that proxies should not be used for.
6756 * #GSimpleProxyResolver is never the default proxy resolver, but it
6757 * can be used as the base class for another proxy resolver
6758 * implementation, or it can be created and used manually, such as
6759 * with g_socket_client_set_proxy_resolver().
6767 * @short_description: Low-level socket object
6768 * @include: gio/gio.h
6769 * @see_also: #GInitable, <link linkend="gio-gnetworking.h">gnetworking.h</link>
6771 * A #GSocket is a low-level networking primitive. It is a more or less
6772 * direct mapping of the BSD socket API in a portable GObject based API.
6773 * It supports both the UNIX socket implementations and winsock2 on Windows.
6775 * #GSocket is the platform independent base upon which the higher level
6776 * network primitives are based. Applications are not typically meant to
6777 * use it directly, but rather through classes like #GSocketClient,
6778 * #GSocketService and #GSocketConnection. However there may be cases where
6779 * direct use of #GSocket is useful.
6781 * #GSocket implements the #GInitable interface, so if it is manually constructed
6782 * by e.g. g_object_new() you must call g_initable_init() and check the
6783 * results before using the object. This is done automatically in
6784 * g_socket_new() and g_socket_new_from_fd(), so these functions can return
6787 * Sockets operate in two general modes, blocking or non-blocking. When
6788 * in blocking mode all operations block until the requested operation
6789 * is finished or there is an error. In non-blocking mode all calls that
6790 * would block return immediately with a %G_IO_ERROR_WOULD_BLOCK error.
6791 * To know when a call would successfully run you can call g_socket_condition_check(),
6792 * or g_socket_condition_wait(). You can also use g_socket_create_source() and
6793 * attach it to a #GMainContext to get callbacks when I/O is possible.
6794 * Note that all sockets are always set to non blocking mode in the system, and
6795 * blocking mode is emulated in GSocket.
6797 * When working in non-blocking mode applications should always be able to
6798 * handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other
6799 * function said that I/O was possible. This can easily happen in case
6800 * of a race condition in the application, but it can also happen for other
6801 * reasons. For instance, on Windows a socket is always seen as writable
6802 * until a write returns %G_IO_ERROR_WOULD_BLOCK.
6804 * #GSocket<!-- -->s can be either connection oriented or datagram based.
6805 * For connection oriented types you must first establish a connection by
6806 * either connecting to an address or accepting a connection from another
6807 * address. For connectionless socket types the target/source address is
6808 * specified or received in each I/O operation.
6810 * All socket file descriptors are set to be close-on-exec.
6812 * Note that creating a #GSocket causes the signal %SIGPIPE to be
6813 * ignored for the remainder of the program. If you are writing a
6814 * command-line utility that uses #GSocket, you may need to take into
6815 * account the fact that your program will not automatically be killed
6816 * if it tries to write to %stdout after it has been closed.
6823 * SECTION:gsocketaddress
6824 * @short_description: Abstract base class representing endpoints for socket communication
6826 * #GSocketAddress is the equivalent of <type>struct sockaddr</type>
6827 * in the BSD sockets API. This is an abstract class; use
6828 * #GInetSocketAddress for internet sockets, or #GUnixSocketAddress
6829 * for UNIX domain sockets.
6834 * SECTION:gsocketclient
6835 * @short_description: Helper for connecting to a network service
6836 * @include: gio/gio.h
6837 * @see_also: #GSocketConnection, #GSocketListener
6839 * #GSocketClient is a lightweight high-level utility class for connecting to
6840 * a network host using a connection oriented socket type.
6842 * You create a #GSocketClient object, set any options you want, and then
6843 * call a sync or async connect operation, which returns a #GSocketConnection
6844 * subclass on success.
6846 * The type of the #GSocketConnection object returned depends on the type of
6847 * the underlying socket that is in use. For instance, for a TCP/IP connection
6848 * it will be a #GTcpConnection.
6850 * As #GSocketClient is a lightweight object, you don't need to cache it. You
6851 * can just create a new one any time you need one.
6858 * SECTION:gsocketconnectable
6859 * @short_description: Interface for potential socket endpoints
6861 * Objects that describe one or more potential socket endpoints
6862 * implement #GSocketConnectable. Callers can then use
6863 * g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator
6864 * to try out each socket address in turn until one succeeds, as shown
6865 * in the sample code below.
6868 * MyConnectionType *
6869 * connect_to_host (const char *hostname,
6871 * GCancellable *cancellable,
6874 * MyConnection *conn = NULL;
6875 * GSocketConnectable *addr;
6876 * GSocketAddressEnumerator *enumerator;
6877 * GSocketAddress *sockaddr;
6878 * GError *conn_error = NULL;
6880 * addr = g_network_address_new (hostname, port);
6881 * enumerator = g_socket_connectable_enumerate (addr);
6882 * g_object_unref (addr);
6884 * /<!-- -->* Try each sockaddr until we succeed. Record the first
6885 * * connection error, but not any further ones (since they'll probably
6886 * * be basically the same as the first).
6888 * while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error))
6890 * conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error);
6891 * g_object_unref (sockaddr);
6893 * g_object_unref (enumerator);
6899 * /<!-- -->* We couldn't connect to the first address, but we succeeded
6900 * * in connecting to a later address.
6902 * g_error_free (conn_error);
6908 * /<!-- -->* Either the initial lookup failed, or else the caller
6912 * g_error_free (conn_error);
6917 * g_error_propagate (error, conn_error);
6926 * SECTION:gsocketconnection
6927 * @short_description: A socket connection
6928 * @include: gio/gio.h
6929 * @see_also: #GIOStream, #GSocketClient, #GSocketListener
6931 * #GSocketConnection is a #GIOStream for a connected socket. They
6932 * can be created either by #GSocketClient when connecting to a host,
6933 * or by #GSocketListener when accepting a new client.
6935 * The type of the #GSocketConnection object returned from these calls
6936 * depends on the type of the underlying socket that is in use. For
6937 * instance, for a TCP/IP connection it will be a #GTcpConnection.
6939 * Choosing what type of object to construct is done with the socket
6940 * connection factory, and it is possible for 3rd parties to register
6941 * custom socket connection types for specific combination of socket
6942 * family/type/protocol using g_socket_connection_factory_register_type().
6949 * SECTION:gsocketcontrolmessage
6950 * @title: GSocketControlMessage
6951 * @short_description: A GSocket control message
6952 * @see_also: #GSocket.
6954 * A #GSocketControlMessage is a special-purpose utility message that
6955 * can be sent to or received from a #GSocket. These types of
6956 * messages are often called "ancillary data".
6958 * The message can represent some sort of special instruction to or
6959 * information from the socket or can represent a special kind of
6960 * transfer to the peer (for example, sending a file description over
6963 * These messages are sent with g_socket_send_message() and received
6964 * with g_socket_receive_message().
6966 * To extend the set of control message that can be sent, subclass this
6967 * class and override the get_size, get_level, get_type and serialize
6970 * To extend the set of control messages that can be received, subclass
6971 * this class and implement the deserialize method. Also, make sure your
6972 * class is registered with the GType typesystem before calling
6973 * g_socket_receive_message() to read such a message.
6980 * SECTION:gsocketlistener
6981 * @title: GSocketListener
6982 * @short_description: Helper for accepting network client connections
6983 * @see_also: #GThreadedSocketService, #GSocketService.
6985 * A #GSocketListener is an object that keeps track of a set
6986 * of server sockets and helps you accept sockets from any of the
6987 * socket, either sync or async.
6989 * If you want to implement a network server, also look at #GSocketService
6990 * and #GThreadedSocketService which are subclass of #GSocketListener
6991 * that makes this even easier.
6998 * SECTION:gsocketservice
6999 * @title: GSocketService
7000 * @short_description: Make it easy to implement a network service
7001 * @see_also: #GThreadedSocketService, #GSocketListener.
7003 * A #GSocketService is an object that represents a service that
7004 * is provided to the network or over local sockets. When a new
7005 * connection is made to the service the #GSocketService::incoming
7006 * signal is emitted.
7008 * A #GSocketService is a subclass of #GSocketListener and you need
7009 * to add the addresses you want to accept connections on with the
7010 * #GSocketListener APIs.
7012 * There are two options for implementing a network service based on
7013 * #GSocketService. The first is to create the service using
7014 * g_socket_service_new() and to connect to the #GSocketService::incoming
7015 * signal. The second is to subclass #GSocketService and override the
7016 * default signal handler implementation.
7018 * In either case, the handler must immediately return, or else it
7019 * will block additional incoming connections from being serviced.
7020 * If you are interested in writing connection handlers that contain
7021 * blocking code then see #GThreadedSocketService.
7023 * The socket service runs on the main loop of the <link
7024 * linkend="g-main-context-push-thread-default-context">thread-default
7025 * context</link> of the thread it is created in, and is not
7026 * threadsafe in general. However, the calls to start and stop the
7027 * service are thread-safe so these can be used from threads that
7028 * handle incoming clients.
7035 * SECTION:gsrvtarget
7036 * @short_description: DNS SRV record target
7037 * @include: gio/gio.h
7039 * SRV (service) records are used by some network protocols to provide
7040 * service-specific aliasing and load-balancing. For example, XMPP
7041 * (Jabber) uses SRV records to locate the XMPP server for a domain;
7042 * rather than connecting directly to "example.com" or assuming a
7043 * specific server hostname like "xmpp.example.com", an XMPP client
7044 * would look up the "xmpp-client" SRV record for "example.com", and
7045 * then connect to whatever host was pointed to by that record.
7047 * You can use g_resolver_lookup_service() or
7048 * g_resolver_lookup_service_async() to find the #GSrvTarget<!-- -->s
7049 * for a given service. However, if you are simply planning to connect
7050 * to the remote service, you can use #GNetworkService's
7051 * #GSocketConnectable interface and not need to worry about
7052 * #GSrvTarget at all.
7058 * @short_description: Cancellable synchronous or asynchronous task and result
7059 * @include: gio/gio.h
7060 * @see_also: #GAsyncResult
7063 * A #GTask represents and manages a cancellable "task".
7066 * <title>Asynchronous operations</title>
7068 * The most common usage of #GTask is as a #GAsyncResult, to
7069 * manage data during an asynchronous operation. You call
7070 * g_task_new() in the "start" method, followed by
7071 * g_task_set_task_data() and the like if you need to keep some
7072 * additional data associated with the task, and then pass the
7073 * task object around through your asynchronous operation.
7074 * Eventually, you will call a method such as
7075 * g_task_return_pointer() or g_task_return_error(), which will
7076 * save the value you give it and then invoke the task's callback
7077 * function (waiting until the next iteration of the main
7078 * loop first, if necessary). The caller will pass the #GTask back
7079 * to the operation's finish function (as a #GAsyncResult), and
7080 * you can use g_task_propagate_pointer() or the like to extract
7083 * <example id="gtask-async"><title>GTask as a GAsyncResult</title>
7086 * CakeFrostingType frosting;
7091 * decoration_data_free (DecorationData *decoration)
7093 * g_free (decoration->message);
7094 * g_slice_free (DecorationData, decoration);
7098 * baked_cb (Cake *cake,
7099 * gpointer user_data)
7101 * GTask *task = user_data;
7102 * DecorationData *decoration = g_task_get_task_data (task);
7103 * GError *error = NULL;
7107 * g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_NO_FLOUR,
7108 * "Go to the supermarket");
7109 * g_object_unref (task);
7113 * if (!cake_decorate (cake, decoration->frosting, decoration->message, &error))
7115 * g_object_unref (cake);
7116 * /* g_task_return_error() takes ownership of error */
7117 * g_task_return_error (task, error);
7118 * g_object_unref (task);
7122 * g_task_return_pointer (result, cake, g_object_unref);
7123 * g_object_unref (task);
7127 * baker_bake_cake_async (Baker *self,
7129 * CakeFlavor flavor,
7130 * CakeFrostingType frosting,
7131 * const char *message,
7132 * GCancellable *cancellable,
7133 * GAsyncReadyCallback callback,
7134 * gpointer user_data)
7137 * DecorationData *decoration;
7140 * task = g_task_new (self, cancellable, callback, user_data);
7143 * g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_TOO_SMALL,
7144 * "%ucm radius cakes are silly",
7146 * g_object_unref (task);
7150 * cake = _baker_get_cached_cake (self, radius, flavor, frosting, message);
7153 * /* _baker_get_cached_cake() returns a reffed cake */
7154 * g_task_return_pointer (task, cake, g_object_unref);
7155 * g_object_unref (task);
7159 * decoration = g_slice_new (DecorationData);
7160 * decoration->frosting = frosting;
7161 * decoration->message = g_strdup (message);
7162 * g_task_set_task_data (task, decoration, (GDestroyNotify) decoration_data_free);
7164 * _baker_begin_cake (self, radius, flavor, cancellable, baked_cb, task);
7168 * baker_bake_cake_finish (Baker *self,
7169 * GAsyncResult *result,
7172 * g_return_val_if_fail (g_task_is_valid (result, self), NULL);
7174 * return g_task_propagate_pointer (G_TASK (result), error);
7180 * <title>Chained asynchronous operations</title>
7182 * #GTask also tries to simplify asynchronous operations that
7183 * internally chain together several smaller asynchronous
7184 * operations. g_task_get_cancellable(), g_task_get_context(), and
7185 * g_task_get_priority() allow you to get back the task's
7186 * #GCancellable, #GMainContext, and <link
7187 * linkend="io-priority">I/O priority</link> when starting a new
7188 * subtask, so you don't have to keep track of them yourself.
7189 * g_task_attach_source() simplifies the case of waiting for a
7190 * source to fire (automatically using the correct #GMainContext
7193 * <example id="gtask-chained"><title>Chained asynchronous operations</title>
7197 * CakeFrostingType frosting;
7202 * decoration_data_free (BakingData *bd)
7205 * g_object_unref (bd->cake);
7206 * g_free (bd->message);
7207 * g_slice_free (BakingData, bd);
7211 * decorated_cb (Cake *cake,
7212 * GAsyncResult *result,
7213 * gpointer user_data)
7215 * GTask *task = user_data;
7216 * GError *error = NULL;
7218 * if (!cake_decorate_finish (cake, result, &error))
7220 * g_object_unref (cake);
7221 * g_task_return_error (task, error);
7222 * g_object_unref (task);
7226 * /* baking_data_free() will drop its ref on the cake, so
7227 * * we have to take another here to give to the caller.
7229 * g_task_return_pointer (result, g_object_ref (cake), g_object_unref);
7230 * g_object_unref (task);
7234 * decorator_ready (gpointer user_data)
7236 * GTask *task = user_data;
7237 * BakingData *bd = g_task_get_task_data (task);
7239 * cake_decorate_async (bd->cake, bd->frosting, bd->message,
7240 * g_task_get_cancellable (task),
7241 * decorated_cb, task);
7245 * baked_cb (Cake *cake,
7246 * gpointer user_data)
7248 * GTask *task = user_data;
7249 * BakingData *bd = g_task_get_task_data (task);
7250 * GError *error = NULL;
7254 * g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_NO_FLOUR,
7255 * "Go to the supermarket");
7256 * g_object_unref (task);
7262 * /* Bail out now if the user has already cancelled */
7263 * if (g_task_return_error_if_cancelled (g_task_get_cancellable (task)))
7265 * g_object_unref (task);
7269 * if (cake_decorator_available (cake))
7270 * decorator_ready (task);
7275 * source = cake_decorator_wait_source_new (cake);
7276 * /* Attach @source to @task's GMainContext and have it call
7277 * * decorator_ready() when it is ready.
7279 * g_task_attach_source (task, source,
7280 * G_CALLBACK (decorator_ready));
7281 * g_source_unref (source);
7286 * baker_bake_cake_async (Baker *self,
7288 * CakeFlavor flavor,
7289 * CakeFrostingType frosting,
7290 * const char *message,
7292 * GCancellable *cancellable,
7293 * GAsyncReadyCallback callback,
7294 * gpointer user_data)
7299 * task = g_task_new (self, cancellable, callback, user_data);
7300 * g_task_set_priority (task, priority);
7302 * bd = g_slice_new0 (BakingData);
7303 * bd->frosting = frosting;
7304 * bd->message = g_strdup (message);
7305 * g_task_set_task_data (task, bd, (GDestroyNotify) baking_data_free);
7307 * _baker_begin_cake (self, radius, flavor, cancellable, baked_cb, task);
7311 * baker_bake_cake_finish (Baker *self,
7312 * GAsyncResult *result,
7315 * g_return_val_if_fail (g_task_is_valid (result, self), NULL);
7317 * return g_task_propagate_pointer (G_TASK (result), error);
7323 * <title>Asynchronous operations from synchronous ones</title>
7325 * You can use g_task_run_in_thread() to turn a synchronous
7326 * operation into an asynchronous one, by running it in a thread
7327 * which will then dispatch the result back to the caller's
7328 * #GMainContext when it completes.
7330 * <example id="gtask-run-in-thread"><title>g_task_run_in_thread()</title>
7334 * CakeFlavor flavor;
7335 * CakeFrostingType frosting;
7340 * cake_data_free (CakeData *cake_data)
7342 * g_free (cake_data->message);
7343 * g_slice_free (CakeData, cake_data);
7347 * bake_cake_thread (GTask *task,
7348 * gpointer source_object,
7349 * gpointer task_data,
7350 * GCancellable *cancellable)
7352 * Baker *self = source_object;
7353 * CakeData *cake_data = task_data;
7355 * GError *error = NULL;
7357 * cake = bake_cake (baker, cake_data->radius, cake_data->flavor,
7358 * cake_data->frosting, cake_data->message,
7359 * cancellable, &error);
7361 * g_task_return_pointer (task, cake, g_object_unref);
7363 * g_task_return_error (task, error);
7367 * baker_bake_cake_async (Baker *self,
7369 * CakeFlavor flavor,
7370 * CakeFrostingType frosting,
7371 * const char *message,
7372 * GCancellable *cancellable,
7373 * GAsyncReadyCallback callback,
7374 * gpointer user_data)
7376 * CakeData *cake_data;
7379 * cake_data = g_slice_new (CakeData);
7380 * cake_data->radius = radius;
7381 * cake_data->flavor = flavor;
7382 * cake_data->frosting = frosting;
7383 * cake_data->message = g_strdup (message);
7384 * task = g_task_new (self, cancellable, callback, user_data);
7385 * g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7386 * g_task_run_in_thread (task, bake_cake_thread);
7390 * baker_bake_cake_finish (Baker *self,
7391 * GAsyncResult *result,
7394 * g_return_val_if_fail (g_task_is_valid (result, self), NULL);
7396 * return g_task_propagate_pointer (G_TASK (result), error);
7402 * <title>Adding cancellability to uncancellable tasks</title>
7404 * Finally, g_task_run_in_thread() and g_task_run_in_thread_sync()
7405 * can be used to turn an uncancellable operation into a
7406 * cancellable one. If you call g_task_set_return_on_cancel(),
7407 * passing %TRUE, then if the task's #GCancellable is cancelled,
7408 * it will return control back to the caller immediately, while
7409 * allowing the task thread to continue running in the background
7410 * (and simply discarding its result when it finally does finish).
7411 * Provided that the task thread is careful about how it uses
7412 * locks and other externally-visible resources, this allows you
7413 * to make "GLib-friendly" asynchronous and cancellable
7414 * synchronous variants of blocking APIs.
7416 * <example id="gtask-cancellable"><title>g_task_set_return_on_cancel()</title>
7419 * bake_cake_thread (GTask *task,
7420 * gpointer source_object,
7421 * gpointer task_data,
7422 * GCancellable *cancellable)
7424 * Baker *self = source_object;
7425 * CakeData *cake_data = task_data;
7427 * GError *error = NULL;
7429 * cake = bake_cake (baker, cake_data->radius, cake_data->flavor,
7430 * cake_data->frosting, cake_data->message,
7434 * g_task_return_error (task, error);
7438 * /* If the task has already been cancelled, then we don't
7439 * * want to add the cake to the cake cache. Likewise, we don't
7440 * * want to have the task get cancelled in the middle of
7441 * * updating the cache. g_task_set_return_on_cancel() will
7442 * * return %TRUE here if it managed to disable return-on-cancel,
7443 * * or %FALSE if the task was cancelled before it could.
7445 * if (g_task_set_return_on_cancel (task, FALSE))
7447 * /* If the caller cancels at this point, their
7448 * * GAsyncReadyCallback won't be invoked until we return,
7449 * * so we don't have to worry that this code will run at
7450 * * the same time as that code does. But if there were
7451 * * other functions that might look at the cake cache,
7452 * * then we'd probably need a GMutex here as well.
7454 * baker_add_cake_to_cache (baker, cake);
7455 * g_task_return_pointer (task, cake, g_object_unref);
7460 * baker_bake_cake_async (Baker *self,
7462 * CakeFlavor flavor,
7463 * CakeFrostingType frosting,
7464 * const char *message,
7465 * GCancellable *cancellable,
7466 * GAsyncReadyCallback callback,
7467 * gpointer user_data)
7469 * CakeData *cake_data;
7472 * cake_data = g_slice_new (CakeData);
7475 * task = g_task_new (self, cancellable, callback, user_data);
7476 * g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7477 * g_task_set_return_on_cancel (task, TRUE);
7478 * g_task_run_in_thread (task, bake_cake_thread);
7482 * baker_bake_cake_sync (Baker *self,
7484 * CakeFlavor flavor,
7485 * CakeFrostingType frosting,
7486 * const char *message,
7487 * GCancellable *cancellable,
7490 * CakeData *cake_data;
7494 * cake_data = g_slice_new (CakeData);
7497 * task = g_task_new (self, cancellable, NULL, NULL);
7498 * g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7499 * g_task_set_return_on_cancel (task, TRUE);
7500 * g_task_run_in_thread_sync (task, bake_cake_thread);
7502 * cake = g_task_propagate_pointer (task, error);
7503 * g_object_unref (task);
7510 * <title>Porting from <literal>GSimpleAsyncResult</literal></title>
7512 * #GTask's API attempts to be simpler than #GSimpleAsyncResult's
7517 * You can save task-specific data with g_task_set_task_data(), and
7518 * retrieve it later with g_task_get_task_data(). This replaces the
7519 * abuse of g_simple_async_result_set_op_res_gpointer() for the same
7520 * purpose with #GSimpleAsyncResult.
7521 * </para></listitem>
7523 * In addition to the task data, #GTask also keeps track of the
7524 * <link linkend="io-priority">priority</link>, #GCancellable, and
7525 * #GMainContext associated with the task, so tasks that consist of
7526 * a chain of simpler asynchronous operations will have easy access
7527 * to those values when starting each sub-task.
7528 * </para></listitem>
7530 * g_task_return_error_if_cancelled() provides simplified
7531 * handling for cancellation. In addition, cancellation
7532 * overrides any other #GTask return value by default, like
7533 * #GSimpleAsyncResult does when
7534 * g_simple_async_result_set_check_cancellable() is called.
7535 * (You can use g_task_set_check_cancellable() to turn off that
7536 * behavior.) On the other hand, g_task_run_in_thread()
7537 * guarantees that it will always run your
7538 * <literal>task_func</literal>, even if the task's #GCancellable
7539 * is already cancelled before the task gets a chance to run;
7540 * you can start your <literal>task_func</literal> with a
7541 * g_task_return_error_if_cancelled() check if you need the
7543 * </para></listitem>
7545 * The "return" methods (eg, g_task_return_pointer())
7546 * automatically cause the task to be "completed" as well, and
7547 * there is no need to worry about the "complete" vs "complete
7548 * in idle" distinction. (#GTask automatically figures out
7549 * whether the task's callback can be invoked directly, or
7550 * if it needs to be sent to another #GMainContext, or delayed
7551 * until the next iteration of the current #GMainContext.)
7552 * </para></listitem>
7554 * The "finish" functions for #GTask-based operations are generally
7555 * much simpler than #GSimpleAsyncResult ones, normally consisting
7556 * of only a single call to g_task_propagate_pointer() or the like.
7557 * Since g_task_propagate_pointer() "steals" the return value from
7558 * the #GTask, it is not necessary to juggle pointers around to
7559 * prevent it from being freed twice.
7560 * </para></listitem>
7562 * With #GSimpleAsyncResult, it was common to call
7563 * g_simple_async_result_propagate_error() from the
7564 * <literal>_finish()</literal> wrapper function, and have
7565 * virtual method implementations only deal with successful
7566 * returns. This behavior is deprecated, because it makes it
7567 * difficult for a subclass to chain to a parent class's async
7568 * methods. Instead, the wrapper function should just be a
7569 * simple wrapper, and the virtual method should call an
7570 * appropriate <literal>g_task_propagate_</literal> function.
7571 * Note that wrapper methods can now use
7572 * g_async_result_legacy_propagate_error() to do old-style
7573 * #GSimpleAsyncResult error-returning behavior, and
7574 * g_async_result_is_tagged() to check if a result is tagged as
7575 * having come from the <literal>_async()</literal> wrapper
7576 * function (for "short-circuit" results, such as when passing
7577 * 0 to g_input_stream_read_async()).
7578 * </para></listitem>
7585 * SECTION:gtcpconnection
7586 * @title: GTcpConnection
7587 * @short_description: A TCP GSocketConnection
7588 * @see_also: #GSocketConnection.
7590 * This is the subclass of #GSocketConnection that is created
7591 * for TCP/IP sockets.
7598 * SECTION:gtcpwrapperconnection
7599 * @title: GTcpWrapperConnection
7600 * @short_description: Wrapper for non-GSocketConnection-based, GSocket-based GIOStreams
7601 * @see_also: #GSocketConnection.
7603 * A #GTcpWrapperConnection can be used to wrap a #GIOStream that is
7604 * based on a #GSocket, but which is not actually a
7605 * #GSocketConnection. This is used by #GSocketClient so that it can
7606 * always return a #GSocketConnection, even when the connection it has
7607 * actually created is not directly a #GSocketConnection.
7615 * @short_description: D-Bus testing helper
7616 * @include: gio/gio.h
7618 * A helper class for testing code which uses D-Bus without touching the user's
7621 * <refsect2 id="gio-D-Bus-Test-Scaffolding">
7622 * <title>Creating unit tests using GTestDBus</title>
7624 * Testing of D-Bus services can be tricky because normally we only ever run
7625 * D-Bus services over an existing instance of the D-Bus daemon thus we
7626 * usually don't activate D-Bus services that are not yet installed into the
7627 * target system. The #GTestDBus object makes this easier for us by taking care
7628 * of the lower level tasks such as running a private D-Bus daemon and looking
7629 * up uninstalled services in customizable locations, typically in your source code tree.
7632 * The first thing you will need is a separate service description file for the
7633 * D-Bus daemon. Typically a 'services' subdirectory of your 'tests' directory
7634 * is a good place to put this file.
7637 * The service file should list your service along with an absolute path to the
7638 * uninstalled service executable in your source tree. Using autotools we would
7639 * achieve this by adding a file such as 'my-server.service.in' in the services
7640 * directory and have it processed by configure.
7641 * <informalexample><programlisting>
7643 * Name=org.gtk.GDBus.Examples.ObjectManager
7644 * Exec=@abs_top_builddir@/gio/tests/gdbus-example-objectmanager-server
7645 * </programlisting></informalexample>
7646 * You will also need to indicate this service directory in your test
7647 * fixtures, so you will need to pass the path while compiling your
7648 * test cases. Typically this is done with autotools with an added
7649 * preprocessor flag specified to compile your tests such as:
7650 * <informalexample><programlisting>
7651 * -DTEST_SERVICES=\""$(abs_top_builddir)/tests/services"\"
7652 * </programlisting></informalexample>
7655 * Once you have a service definition file which is local to your source tree,
7656 * you can proceed to setup a GTest fixture using the GTestDBus scaffolding.
7657 * <example id="gdbus-test-fixture">
7658 * <title>Test Fixture for D-Bus services</title>
7660 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-test-fixture.c">
7661 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
7667 * Note that these examples only deal with isolating the D-Bus aspect of your
7668 * service. To successfully run isolated unit tests on your service you may need
7669 * some additional modifications to your test case fixture. For example; if your
7670 * service uses GSettings and installs a schema then it is important that your test service
7671 * not load the schema in the ordinary installed location (chances are that your service
7672 * and schema files are not yet installed, or worse; there is an older version of the
7673 * schema file sitting in the install location).
7676 * Most of the time we can work around these obstacles using the environment. Since the
7677 * environment is inherited by the D-Bus daemon created by GTestDBus and then in turn
7678 * inherited by any services the D-Bus daemon activates, using the setup routine for your
7679 * fixture is a practical place to help sandbox your runtime environment. For the rather
7680 * typical GSettings case we can work around this by setting GSETTINGS_SCHEMA_DIR to the
7681 * in tree directory holding your schemas in the above fixture_setup() routine.
7684 * The GSettings schemas need to be locally pre-compiled for this to work. This can be achieved
7685 * by compiling the schemas locally as a step before running test cases, an autotools setup might
7686 * do the following in the directory holding schemas:
7687 * <informalexample><programlisting>
7689 * $(GLIB_COMPILE_SCHEMAS) .
7691 * CLEANFILES += gschemas.compiled
7692 * </programlisting></informalexample>
7699 * SECTION:gthemedicon
7700 * @short_description: Icon theming support
7701 * @include: gio/gio.h
7702 * @see_also: #GIcon, #GLoadableIcon
7704 * #GThemedIcon is an implementation of #GIcon that supports icon themes.
7705 * #GThemedIcon contains a list of all of the icons present in an icon
7706 * theme, so that icons can be looked up quickly. #GThemedIcon does
7707 * not provide actual pixmaps for icons, just the icon names.
7708 * Ideally something like gtk_icon_theme_choose_icon() should be used to
7709 * resolve the list of names so that fallback icons work nicely with
7710 * themes that inherit other themes.
7715 * SECTION:gthreadedsocketservice
7716 * @title: GThreadedSocketService
7717 * @short_description: A threaded GSocketService
7718 * @see_also: #GSocketService.
7720 * A #GThreadedSocketService is a simple subclass of #GSocketService
7721 * that handles incoming connections by creating a worker thread and
7722 * dispatching the connection to it by emitting the
7723 * #GThreadedSocketService::run signal in the new thread.
7725 * The signal handler may perform blocking IO and need not return
7726 * until the connection is closed.
7728 * The service is implemented using a thread pool, so there is a
7729 * limited amount of threads available to serve incoming requests.
7730 * The service automatically stops the #GSocketService from accepting
7731 * new connections when all threads are busy.
7733 * As with #GSocketService, you may connect to #GThreadedSocketService::run,
7734 * or subclass and override the default handler.
7740 * @title: TLS Overview
7741 * @short_description: TLS (aka SSL) support for GSocketConnection
7742 * @include: gio/gio.h
7744 * #GTlsConnection and related classes provide TLS (Transport Layer
7745 * Security, previously known as SSL, Secure Sockets Layer) support for
7746 * gio-based network streams.
7748 * In the simplest case, for a client connection, you can just set the
7749 * #GSocketClient:tls flag on a #GSocketClient, and then any
7750 * connections created by that client will have TLS negotiated
7751 * automatically, using appropriate default settings, and rejecting
7752 * any invalid or self-signed certificates (unless you change that
7753 * default by setting the #GSocketClient:tls-validation-flags
7754 * property). The returned object will be a #GTcpWrapperConnection,
7755 * which wraps the underlying #GTlsClientConnection.
7757 * For greater control, you can create your own #GTlsClientConnection,
7758 * wrapping a #GSocketConnection (or an arbitrary #GIOStream with
7759 * pollable input and output streams) and then connect to its signals,
7760 * such as #GTlsConnection::accept-certificate, before starting the
7763 * Server-side TLS is similar, using #GTlsServerConnection. At the
7764 * moment, there is no support for automatically wrapping server-side
7765 * connections in the way #GSocketClient does for client-side
7771 * SECTION:gtlsbackend
7772 * @title: GTlsBackend
7773 * @short_description: TLS backend implementation
7774 * @include: gio/gio.h
7779 * SECTION:gtlscertificate
7780 * @title: GTlsCertificate
7781 * @short_description: TLS certificate
7782 * @see_also: #GTlsConnection
7784 * A certificate used for TLS authentication and encryption.
7785 * This can represent either a certificate only (eg, the certificate
7786 * received by a client from a server), or the combination of
7787 * a certificate and a private key (which is needed when acting as a
7788 * #GTlsServerConnection).
7795 * SECTION:gtlsclientconnection
7796 * @short_description: TLS client-side connection
7797 * @include: gio/gio.h
7799 * #GTlsClientConnection is the client-side subclass of
7800 * #GTlsConnection, representing a client-side TLS connection.
7805 * SECTION:gtlsconnection
7806 * @short_description: TLS connection type
7807 * @include: gio/gio.h
7809 * #GTlsConnection is the base TLS connection class type, which wraps
7810 * a #GIOStream and provides TLS encryption on top of it. Its
7811 * subclasses, #GTlsClientConnection and #GTlsServerConnection,
7812 * implement client-side and server-side TLS, respectively.
7819 * SECTION:gtlsdatabase
7820 * @short_description: TLS database type
7821 * @include: gio/gio.h
7823 * #GTlsDatabase is used to lookup certificates and other information
7824 * from a certificate or key store. It is an abstract base class which
7825 * TLS library specific subtypes override.
7827 * Most common client applications will not directly interact with
7828 * #GTlsDatabase. It is used internally by #GTlsConnection.
7835 * SECTION:gtlsfiledatabase
7836 * @short_description: TLS file based database type
7837 * @include: gio/gio.h
7839 * #GTlsFileDatabase is implemented by #GTlsDatabase objects which load
7840 * their certificate information from a file. It is an interface which
7841 * TLS library specific subtypes implement.
7848 * SECTION:gtlsinteraction
7849 * @short_description: Interaction with the user during TLS operations.
7850 * @include: gio/gio.h
7852 * #GTlsInteraction provides a mechanism for the TLS connection and database
7853 * code to interact with the user. It can be used to ask the user for passwords.
7855 * To use a #GTlsInteraction with a TLS connection use
7856 * g_tls_connection_set_interaction().
7858 * Callers should instantiate a derived class that implements the various
7859 * interaction methods to show the required dialogs.
7861 * Callers should use the 'invoke' functions like
7862 * g_tls_interaction_invoke_ask_password() to run interaction methods. These
7863 * functions make sure that the interaction is invoked in the main loop
7864 * and not in the current thread, if the current thread is not running the
7867 * Derived classes can choose to implement whichever interactions methods they'd
7868 * like to support by overriding those virtual methods in their class
7869 * initialization function. Any interactions not implemented will return
7870 * %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
7871 * it must also implement the corresponding finish method.
7876 * SECTION:gtlspassword
7877 * @title: GTlsPassword
7878 * @short_description: TLS Passwords for prompting
7879 * @include: gio/gio.h
7881 * Holds a password used in TLS.
7886 * SECTION:gtlsserverconnection
7887 * @short_description: TLS server-side connection
7888 * @include: gio/gio.h
7890 * #GTlsServerConnection is the server-side subclass of #GTlsConnection,
7891 * representing a server-side TLS connection.
7898 * SECTION:gunixconnection
7899 * @title: GUnixConnection
7900 * @short_description: A UNIX domain GSocketConnection
7901 * @include: gio/gunixconnection.h
7902 * @see_also: #GSocketConnection.
7904 * This is the subclass of #GSocketConnection that is created
7905 * for UNIX domain sockets.
7907 * It contains functions to do some of the UNIX socket specific
7908 * functionality like passing file descriptors.
7910 * Note that <filename><gio/gunixconnection.h></filename> belongs to
7911 * the UNIX-specific GIO interfaces, thus you have to use the
7912 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7919 * SECTION:gunixcredentialsmessage
7920 * @title: GUnixCredentialsMessage
7921 * @short_description: A GSocketControlMessage containing credentials
7922 * @include: gio/gunixcredentialsmessage.h
7923 * @see_also: #GUnixConnection, #GSocketControlMessage
7925 * This #GSocketControlMessage contains a #GCredentials instance. It
7926 * may be sent using g_socket_send_message() and received using
7927 * g_socket_receive_message() over UNIX sockets (ie: sockets in the
7928 * %G_SOCKET_FAMILY_UNIX family).
7930 * For an easier way to send and receive credentials over
7931 * stream-oriented UNIX sockets, see
7932 * g_unix_connection_send_credentials() and
7933 * g_unix_connection_receive_credentials(). To receive credentials of
7934 * a foreign process connected to a socket, use
7935 * g_socket_get_credentials().
7940 * SECTION:gunixfdlist
7941 * @title: GUnixFDList
7942 * @short_description: An object containing a set of UNIX file descriptors
7943 * @include: gio/gunixfdlist.h
7944 * @see_also: #GUnixFDMessage
7946 * A #GUnixFDList contains a list of file descriptors. It owns the file
7947 * descriptors that it contains, closing them when finalized.
7949 * It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
7950 * the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
7951 * and received using g_socket_receive_message().
7953 * Note that <filename><gio/gunixfdlist.h></filename> belongs to
7954 * the UNIX-specific GIO interfaces, thus you have to use the
7955 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7960 * SECTION:gunixfdmessage
7961 * @title: GUnixFDMessage
7962 * @short_description: A GSocketControlMessage containing a GUnixFDList
7963 * @include: gio/gunixfdmessage.h
7964 * @see_also: #GUnixConnection, #GUnixFDList, #GSocketControlMessage
7966 * This #GSocketControlMessage contains a #GUnixFDList.
7967 * It may be sent using g_socket_send_message() and received using
7968 * g_socket_receive_message() over UNIX sockets (ie: sockets in the
7969 * %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied
7970 * between processes by the kernel.
7972 * For an easier way to send and receive file descriptors over
7973 * stream-oriented UNIX sockets, see g_unix_connection_send_fd() and
7974 * g_unix_connection_receive_fd().
7976 * Note that <filename><gio/gunixfdmessage.h></filename> belongs to
7977 * the UNIX-specific GIO interfaces, thus you have to use the
7978 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7983 * SECTION:gunixinputstream
7984 * @short_description: Streaming input operations for UNIX file descriptors
7985 * @include: gio/gunixinputstream.h
7986 * @see_also: #GInputStream
7988 * #GUnixInputStream implements #GInputStream for reading from a UNIX
7989 * file descriptor, including asynchronous operations. (If the file
7990 * descriptor refers to a socket or pipe, this will use poll() to do
7991 * asynchronous I/O. If it refers to a regular file, it will fall back
7992 * to doing asynchronous I/O in another thread.)
7994 * Note that <filename><gio/gunixinputstream.h></filename> belongs
7995 * to the UNIX-specific GIO interfaces, thus you have to use the
7996 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
8001 * SECTION:gunixmounts
8002 * @include: gio/gunixmounts.h
8003 * @short_description: UNIX mounts
8005 * Routines for managing mounted UNIX mount points and paths.
8007 * Note that <filename><gio/gunixmounts.h></filename> belongs to the
8008 * UNIX-specific GIO interfaces, thus you have to use the
8009 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
8014 * SECTION:gunixoutputstream
8015 * @short_description: Streaming output operations for UNIX file descriptors
8016 * @include: gio/gunixoutputstream.h
8017 * @see_also: #GOutputStream
8019 * #GUnixOutputStream implements #GOutputStream for writing to a UNIX
8020 * file descriptor, including asynchronous operations. (If the file
8021 * descriptor refers to a socket or pipe, this will use poll() to do
8022 * asynchronous I/O. If it refers to a regular file, it will fall back
8023 * to doing asynchronous I/O in another thread.)
8025 * Note that <filename><gio/gunixoutputstream.h></filename> belongs
8026 * to the UNIX-specific GIO interfaces, thus you have to use the
8027 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
8032 * SECTION:gunixsocketaddress
8033 * @short_description: UNIX GSocketAddress
8034 * @include: gio/gunixsocketaddress.h
8036 * Support for UNIX-domain (also known as local) sockets.
8038 * UNIX domain sockets are generally visible in the filesystem.
8039 * However, some systems support abstract socket names which are not
8040 * visible in the filesystem and not affected by the filesystem
8041 * permissions, visibility, etc. Currently this is only supported
8042 * under Linux. If you attempt to use abstract sockets on other
8043 * systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED
8044 * errors. You can use g_unix_socket_address_abstract_names_supported()
8045 * to see if abstract names are supported.
8047 * Note that <filename><gio/gunixsocketaddress.h></filename> belongs to
8048 * the UNIX-specific GIO interfaces, thus you have to use the
8049 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
8055 * @short_description: Virtual File System
8056 * @include: gio/gio.h
8058 * Entry point for using GIO functionality.
8064 * @short_description: Volume management
8065 * @include: gio/gio.h
8067 * The #GVolume interface represents user-visible objects that can be
8068 * mounted. Note, when porting from GnomeVFS, #GVolume is the moral
8069 * equivalent of #GnomeVFSDrive.
8071 * Mounting a #GVolume instance is an asynchronous operation. For more
8072 * information about asynchronous operations, see #GAsyncResult and
8073 * #GTask. To mount a #GVolume, first call g_volume_mount() with (at
8074 * least) the #GVolume instance, optionally a #GMountOperation object
8075 * and a #GAsyncReadyCallback.
8077 * Typically, one will only want to pass %NULL for the
8078 * #GMountOperation if automounting all volumes when a desktop session
8079 * starts since it's not desirable to put up a lot of dialogs asking
8082 * The callback will be fired when the operation has resolved (either
8083 * with success or failure), and a #GAsyncReady structure will be
8084 * passed to the callback. That callback should then call
8085 * g_volume_mount_finish() with the #GVolume instance and the
8086 * #GAsyncReady data to see if the operation was completed
8087 * successfully. If an @error is present when g_volume_mount_finish()
8088 * is called, then it will be filled with any error information.
8090 * <para id="volume-identifier">
8091 * It is sometimes necessary to directly access the underlying
8092 * operating system object behind a volume (e.g. for passing a volume
8093 * to an application via the commandline). For this purpose, GIO
8094 * allows to obtain an 'identifier' for the volume. There can be
8095 * different kinds of identifiers, such as Hal UDIs, filesystem labels,
8096 * traditional Unix devices (e.g. <filename>/dev/sda2</filename>),
8097 * uuids. GIO uses predefind strings as names for the different kinds
8098 * of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
8099 * #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
8100 * to obtain an identifier for a volume.
8103 * Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
8104 * when the gvfs hal volume monitor is in use. Other volume monitors
8105 * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
8106 * identifier, which can be used to obtain a hal device by means of
8107 * libhal_manager_find_device_string_match().
8112 * SECTION:gvolumemonitor
8113 * @short_description: Volume Monitor
8114 * @include: gio/gio.h
8115 * @see_also: #GFileMonitor
8117 * #GVolumeMonitor is for listing the user interesting devices and volumes
8118 * on the computer. In other words, what a file selector or file manager
8119 * would show in a sidebar.
8121 * #GVolumeMonitor is not <link
8122 * linkend="g-main-context-push-thread-default">thread-default-context
8123 * aware</link>, and so should not be used other than from the main
8124 * thread, with no thread-default-context active.
8129 * SECTION:gwin32inputstream
8130 * @short_description: Streaming input operations for Windows file handles
8131 * @include: gio/gwin32inputstream.h
8132 * @see_also: #GInputStream
8134 * #GWin32InputStream implements #GInputStream for reading from a
8135 * Windows file handle.
8137 * Note that <filename><gio/gwin32inputstream.h></filename> belongs
8138 * to the Windows-specific GIO interfaces, thus you have to use the
8139 * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
8144 * SECTION:gwin32outputstream
8145 * @short_description: Streaming output operations for Windows file handles
8146 * @include: gio/gwin32outputstream.h
8147 * @see_also: #GOutputStream
8149 * #GWin32OutputStream implements #GOutputStream for writing to a
8150 * Windows file handle.
8152 * Note that <filename><gio/gwin32outputstream.h></filename> belongs
8153 * to the Windows-specific GIO interfaces, thus you have to use the
8154 * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
8159 * SECTION:gzcompressor
8160 * @short_description: Zlib compressor
8161 * @include: gio/gio.h
8163 * #GZlibCompressor is an implementation of #GConverter that
8164 * compresses data using zlib.
8169 * SECTION:gzdecompressor
8170 * @short_description: Zlib decompressor
8171 * @include: gio/gio.h
8173 * #GZlibDecompressor is an implementation of #GConverter that
8174 * decompresses data compressed with zlib.
8179 * _g_io_module_get_default:
8180 * @extension_point: the name of an extension point
8181 * @envvar: (allow-none): the name of an environment variable to override the default implementation.
8182 * @verify_func: (allow-none): a function to call to verify that a given implementation is usable in the current environment.
8184 * Retrieves the default object implementing @extension_point.
8186 * If @envvar is not %NULL, and the environment variable with that
8187 * name is set, then the implementation it specifies will be tried
8188 * first. After that, or if @envvar is not set, all other
8189 * implementations will be tried in order of decreasing priority.
8191 * If an extension point implementation implements #GInitable, then
8192 * that implementation will only be used if it initializes
8193 * successfully. Otherwise, if @verify_func is not %NULL, then it will
8194 * be called on each candidate implementation after construction, to
8195 * check if it is actually usable or not.
8197 * The result is cached after it is generated the first time, and
8198 * the function is thread-safe.
8200 * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
8205 * _g_io_module_get_default_type:
8206 * @extension_point: the name of an extension point
8207 * @envvar: (allow-none): the name of an environment variable to override the default implementation.
8208 * @is_supported_offset: a vtable offset, or zero
8210 * Retrieves the default class implementing @extension_point.
8212 * If @envvar is not %NULL, and the environment variable with that
8213 * name is set, then the implementation it specifies will be tried
8214 * first. After that, or if @envvar is not set, all other
8215 * implementations will be tried in order of decreasing priority.
8217 * If @is_supported_offset is non-zero, then it is the offset into the
8218 * class vtable at which there is a function that takes no arguments and
8219 * returns a boolean. This function will be called on each candidate
8220 * implementation to check if it is actually usable or not.
8222 * The result is cached after it is generated the first time, and
8223 * the function is thread-safe.
8225 * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
8230 * g_action_activate:
8231 * @action: a #GAction
8232 * @parameter: (allow-none): the parameter to the activation
8234 * Activates the action.
8236 * @parameter must be the correct type of parameter for the action (ie:
8237 * the parameter type given at construction time). If the parameter
8238 * type was %NULL then @parameter must also be %NULL.
8240 * If the @parameter GVariant is floating, it is consumed.
8247 * g_action_change_state:
8248 * @action: a #GAction
8249 * @value: the new state
8251 * Request for the state of @action to be changed to @value.
8253 * The action must be stateful and @value must be of the correct type.
8254 * See g_action_get_state_type().
8256 * This call merely requests a change. The action may refuse to change
8257 * its state or may change its state to something other than @value.
8258 * See g_action_get_state_hint().
8260 * If the @value GVariant is floating, it is consumed.
8267 * g_action_get_enabled:
8268 * @action: a #GAction
8270 * Checks if @action is currently enabled.
8272 * An action must be enabled in order to be activated or in order to
8273 * have its state changed from outside callers.
8275 * Returns: whether the action is enabled
8281 * g_action_get_name:
8282 * @action: a #GAction
8284 * Queries the name of @action.
8286 * Returns: the name of the action
8292 * g_action_get_parameter_type:
8293 * @action: a #GAction
8295 * Queries the type of the parameter that must be given when activating
8298 * When activating the action using g_action_activate(), the #GVariant
8299 * given to that function must be of the type returned by this function.
8301 * In the case that this function returns %NULL, you must not give any
8302 * #GVariant, but %NULL instead.
8304 * Returns: (allow-none): the parameter type
8310 * g_action_get_state:
8311 * @action: a #GAction
8313 * Queries the current state of @action.
8315 * If the action is not stateful then %NULL will be returned. If the
8316 * action is stateful then the type of the return value is the type
8317 * given by g_action_get_state_type().
8319 * The return value (if non-%NULL) should be freed with
8320 * g_variant_unref() when it is no longer required.
8322 * Returns: (transfer full): the current state of the action
8328 * g_action_get_state_hint:
8329 * @action: a #GAction
8331 * Requests a hint about the valid range of values for the state of
8334 * If %NULL is returned it either means that the action is not stateful
8335 * or that there is no hint about the valid range of values for the
8336 * state of the action.
8338 * If a #GVariant array is returned then each item in the array is a
8339 * possible value for the state. If a #GVariant pair (ie: two-tuple) is
8340 * returned then the tuple specifies the inclusive lower and upper bound
8341 * of valid values for the state.
8343 * In any case, the information is merely a hint. It may be possible to
8344 * have a state value outside of the hinted range and setting a value
8345 * within the range may fail.
8347 * The return value (if non-%NULL) should be freed with
8348 * g_variant_unref() when it is no longer required.
8350 * Returns: (transfer full): the state range hint
8356 * g_action_get_state_type:
8357 * @action: a #GAction
8359 * Queries the type of the state of @action.
8361 * If the action is stateful (e.g. created with
8362 * g_simple_action_new_stateful()) then this function returns the
8363 * #GVariantType of the state. This is the type of the initial value
8364 * given as the state. All calls to g_action_change_state() must give a
8365 * #GVariant of this type and g_action_get_state() will return a
8366 * #GVariant of the same type.
8368 * If the action is not stateful (e.g. created with g_simple_action_new())
8369 * then this function will return %NULL. In that case, g_action_get_state()
8370 * will return %NULL and you must not call g_action_change_state().
8372 * Returns: (allow-none): the state type, if the action is stateful
8378 * g_action_group_action_added:
8379 * @action_group: a #GActionGroup
8380 * @action_name: the name of an action in the group
8382 * Emits the #GActionGroup::action-added signal on @action_group.
8384 * This function should only be called by #GActionGroup implementations.
8391 * g_action_group_action_enabled_changed:
8392 * @action_group: a #GActionGroup
8393 * @action_name: the name of an action in the group
8394 * @enabled: whether or not the action is now enabled
8396 * Emits the #GActionGroup::action-enabled-changed signal on @action_group.
8398 * This function should only be called by #GActionGroup implementations.
8405 * g_action_group_action_removed:
8406 * @action_group: a #GActionGroup
8407 * @action_name: the name of an action in the group
8409 * Emits the #GActionGroup::action-removed signal on @action_group.
8411 * This function should only be called by #GActionGroup implementations.
8418 * g_action_group_action_state_changed:
8419 * @action_group: a #GActionGroup
8420 * @action_name: the name of an action in the group
8421 * @state: the new state of the named action
8423 * Emits the #GActionGroup::action-state-changed signal on @action_group.
8425 * This function should only be called by #GActionGroup implementations.
8432 * g_action_group_activate_action:
8433 * @action_group: a #GActionGroup
8434 * @action_name: the name of the action to activate
8435 * @parameter: (allow-none): parameters to the activation
8437 * Activate the named action within @action_group.
8439 * If the action is expecting a parameter, then the correct type of
8440 * parameter must be given as @parameter. If the action is expecting no
8441 * parameters then @parameter must be %NULL. See
8442 * g_action_group_get_action_parameter_type().
8449 * g_action_group_change_action_state:
8450 * @action_group: a #GActionGroup
8451 * @action_name: the name of the action to request the change on
8452 * @value: the new state
8454 * Request for the state of the named action within @action_group to be
8455 * changed to @value.
8457 * The action must be stateful and @value must be of the correct type.
8458 * See g_action_group_get_action_state_type().
8460 * This call merely requests a change. The action may refuse to change
8461 * its state or may change its state to something other than @value.
8462 * See g_action_group_get_action_state_hint().
8464 * If the @value GVariant is floating, it is consumed.
8471 * g_action_group_get_action_enabled:
8472 * @action_group: a #GActionGroup
8473 * @action_name: the name of the action to query
8475 * Checks if the named action within @action_group is currently enabled.
8477 * An action must be enabled in order to be activated or in order to
8478 * have its state changed from outside callers.
8480 * Returns: whether or not the action is currently enabled
8486 * g_action_group_get_action_parameter_type:
8487 * @action_group: a #GActionGroup
8488 * @action_name: the name of the action to query
8490 * Queries the type of the parameter that must be given when activating
8491 * the named action within @action_group.
8493 * When activating the action using g_action_group_activate_action(),
8494 * the #GVariant given to that function must be of the type returned
8497 * In the case that this function returns %NULL, you must not give any
8498 * #GVariant, but %NULL instead.
8500 * The parameter type of a particular action will never change but it is
8501 * possible for an action to be removed and for a new action to be added
8502 * with the same name but a different parameter type.
8504 * Returns: the parameter type
8510 * g_action_group_get_action_state:
8511 * @action_group: a #GActionGroup
8512 * @action_name: the name of the action to query
8514 * Queries the current state of the named action within @action_group.
8516 * If the action is not stateful then %NULL will be returned. If the
8517 * action is stateful then the type of the return value is the type
8518 * given by g_action_group_get_action_state_type().
8520 * The return value (if non-%NULL) should be freed with
8521 * g_variant_unref() when it is no longer required.
8523 * Returns: (allow-none): the current state of the action
8529 * g_action_group_get_action_state_hint:
8530 * @action_group: a #GActionGroup
8531 * @action_name: the name of the action to query
8533 * Requests a hint about the valid range of values for the state of the
8534 * named action within @action_group.
8536 * If %NULL is returned it either means that the action is not stateful
8537 * or that there is no hint about the valid range of values for the
8538 * state of the action.
8540 * If a #GVariant array is returned then each item in the array is a
8541 * possible value for the state. If a #GVariant pair (ie: two-tuple) is
8542 * returned then the tuple specifies the inclusive lower and upper bound
8543 * of valid values for the state.
8545 * In any case, the information is merely a hint. It may be possible to
8546 * have a state value outside of the hinted range and setting a value
8547 * within the range may fail.
8549 * The return value (if non-%NULL) should be freed with
8550 * g_variant_unref() when it is no longer required.
8552 * Returns: (transfer full): the state range hint
8558 * g_action_group_get_action_state_type:
8559 * @action_group: a #GActionGroup
8560 * @action_name: the name of the action to query
8562 * Queries the type of the state of the named action within
8565 * If the action is stateful then this function returns the
8566 * #GVariantType of the state. All calls to
8567 * g_action_group_change_action_state() must give a #GVariant of this
8568 * type and g_action_group_get_action_state() will return a #GVariant
8571 * If the action is not stateful then this function will return %NULL.
8572 * In that case, g_action_group_get_action_state() will return %NULL
8573 * and you must not call g_action_group_change_action_state().
8575 * The state type of a particular action will never change but it is
8576 * possible for an action to be removed and for a new action to be added
8577 * with the same name but a different state type.
8579 * Returns: (transfer full): the state type, if the action is stateful
8585 * g_action_group_has_action:
8586 * @action_group: a #GActionGroup
8587 * @action_name: the name of the action to check for
8589 * Checks if the named action exists within @action_group.
8591 * Returns: whether the named action exists
8597 * g_action_group_list_actions:
8598 * @action_group: a #GActionGroup
8600 * Lists the actions contained within @action_group.
8602 * The caller is responsible for freeing the list with g_strfreev() when
8603 * it is no longer required.
8605 * Returns: (transfer full): a %NULL-terminated array of the names of the actions in the groupb
8611 * g_action_group_query_action:
8612 * @action_group: a #GActionGroup
8613 * @action_name: the name of an action in the group
8614 * @enabled: (out): if the action is presently enabled
8615 * @parameter_type: (out) (allow-none): the parameter type, or %NULL if none needed
8616 * @state_type: (out) (allow-none): the state type, or %NULL if stateless
8617 * @state_hint: (out) (allow-none): the state hint, or %NULL if none
8618 * @state: (out) (allow-none): the current state, or %NULL if stateless
8620 * Queries all aspects of the named action within an @action_group.
8622 * This function acquires the information available from
8623 * g_action_group_has_action(), g_action_group_get_action_enabled(),
8624 * g_action_group_get_action_parameter_type(),
8625 * g_action_group_get_action_state_type(),
8626 * g_action_group_get_action_state_hint() and
8627 * g_action_group_get_action_state() with a single function call.
8629 * This provides two main benefits.
8631 * The first is the improvement in efficiency that comes with not having
8632 * to perform repeated lookups of the action in order to discover
8633 * different things about it. The second is that implementing
8634 * #GActionGroup can now be done by only overriding this one virtual
8637 * The interface provides a default implementation of this function that
8638 * calls the individual functions, as required, to fetch the
8639 * information. The interface also provides default implementations of
8640 * those functions that call this function. All implementations,
8641 * therefore, must override either this function or all of the others.
8643 * If the action exists, %TRUE is returned and any of the requested
8644 * fields (as indicated by having a non-%NULL reference passed in) are
8645 * filled. If the action doesn't exist, %FALSE is returned and the
8646 * fields may or may not have been modified.
8648 * Returns: %TRUE if the action exists, else %FALSE
8654 * g_action_map_add_action:
8655 * @action_map: a #GActionMap
8656 * @action: a #GAction
8658 * Adds an action to the @action_map.
8660 * If the action map already contains an action with the same name
8661 * as @action then the old action is dropped from the action map.
8663 * The action map takes its own reference on @action.
8670 * g_action_map_add_action_entries:
8671 * @action_map: a #GActionMap
8672 * @entries: (array length=n_entries) (element-type GActionEntry): a pointer to the first item in an array of #GActionEntry structs
8673 * @n_entries: the length of @entries, or -1 if @entries is %NULL-terminated
8674 * @user_data: the user data for signal connections
8676 * A convenience function for creating multiple #GSimpleAction instances
8677 * and adding them to a #GActionMap.
8679 * Each action is constructed as per one #GActionEntry.
8682 * <title>Using g_action_map_add_action_entries()</title>
8685 * activate_quit (GSimpleAction *simple,
8686 * GVariant *parameter,
8687 * gpointer user_data)
8693 * activate_print_string (GSimpleAction *simple,
8694 * GVariant *parameter,
8695 * gpointer user_data)
8697 * g_print ("%s\n", g_variant_get_string (parameter, NULL));
8700 * static GActionGroup *
8701 * create_action_group (void)
8703 * const GActionEntry entries[] = {
8704 * { "quit", activate_quit },
8705 * { "print-string", activate_print_string, "s" }
8707 * GSimpleActionGroup *group;
8709 * group = g_simple_action_group_new ();
8710 * g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
8712 * return G_ACTION_GROUP (group);
8722 * g_action_map_lookup_action:
8723 * @action_map: a #GActionMap
8724 * @action_name: the name of an action
8726 * Looks up the action with the name @action_name in @action_map.
8728 * If no such action exists, returns %NULL.
8730 * Returns: (transfer none): a #GAction, or %NULL
8736 * g_action_map_remove_action:
8737 * @action_map: a #GActionMap
8738 * @action_name: the name of the action
8740 * Removes the named action from the action map.
8742 * If no action of this name is in the map then nothing happens.
8749 * g_action_name_is_valid:
8750 * @action_name: an potential action name
8752 * Checks if @action_name is valid.
8754 * @action_name is valid if it consists only of alphanumeric characters,
8755 * plus '-' and '.'. The empty string is not a valid action name.
8757 * It is an error to call this function with a non-utf8 @action_name.
8758 * @action_name must not be %NULL.
8760 * Returns: %TRUE if @action_name is valid
8766 * g_action_parse_detailed_name:
8767 * @detailed_name: a detailed action name
8768 * @action_name: (out): the action name
8769 * @target_value: (out): the target value, or %NULL for no target
8770 * @error: a pointer to a %NULL #GError, or %NULL
8772 * Parses a detailed action name into its separate name and target
8775 * Detailed action names can have three formats.
8777 * The first format is used to represent an action name with no target
8778 * value and consists of just an action name containing no whitespace
8779 * nor the characters ':', '(' or ')'. For example: "app.action".
8781 * The second format is used to represent an action with a target value
8782 * that is a non-empty string consisting only of alphanumerics, plus '-'
8783 * and '.'. In that case, the action name and target value are
8784 * separated by a double colon ("::"). For example:
8785 * "app.action::target".
8787 * The third format is used to represent an action with any type of
8788 * target value, including strings. The target value follows the action
8789 * name, surrounded in parens. For example: "app.action(42)". The
8790 * target value is parsed using g_variant_parse(). If a tuple-typed
8791 * value is desired, it must be specified in the same way, resulting in
8792 * two sets of parens, for example: "app.action((1,2,3))". A string
8793 * target can be specified this way as well: "app.action('target')".
8794 * For strings, this third format must be used if * target value is
8795 * empty or contains characters other than alphanumerics, '-' and '.'.
8797 * Returns: %TRUE if successful, else %FALSE with @error set
8803 * g_action_print_detailed_name:
8804 * @action_name: a valid action name
8805 * @target_value: (allow-none): a #GVariant target value, or %NULL
8807 * Formats a detailed action name from @action_name and @target_value.
8809 * It is an error to call this function with an invalid action name.
8811 * This function is the opposite of
8812 * g_action_parse_detailed_action_name(). It will produce a string that
8813 * can be parsed back to the @action_name and @target_value by that
8816 * See that function for the types of strings that will be printed by
8819 * Returns: a detailed format string
8825 * g_app_info_add_supports_type:
8826 * @appinfo: a #GAppInfo.
8827 * @content_type: a string.
8828 * @error: a #GError.
8830 * Adds a content type to the application information to indicate the
8831 * application is capable of opening files with the given content type.
8833 * Returns: %TRUE on success, %FALSE on error.
8838 * g_app_info_can_delete:
8839 * @appinfo: a #GAppInfo
8841 * Obtains the information whether the #GAppInfo can be deleted.
8842 * See g_app_info_delete().
8844 * Returns: %TRUE if @appinfo can be deleted
8850 * g_app_info_can_remove_supports_type:
8851 * @appinfo: a #GAppInfo.
8853 * Checks if a supported content type can be removed from an application.
8855 * Returns: %TRUE if it is possible to remove supported content types from a given @appinfo, %FALSE if not.
8860 * g_app_info_create_from_commandline:
8861 * @commandline: the commandline to use
8862 * @application_name: (allow-none): the application name, or %NULL to use @commandline
8863 * @flags: flags that can specify details of the created #GAppInfo
8864 * @error: a #GError location to store the error occurring, %NULL to ignore.
8866 * Creates a new #GAppInfo from the given information.
8868 * Note that for @commandline, the quoting rules of the Exec key of the
8869 * <ulink url="http://freedesktop.org/Standards/desktop-entry-spec">freedesktop.org Desktop
8870 * Entry Specification</ulink> are applied. For example, if the @commandline contains
8871 * percent-encoded URIs, the percent-character must be doubled in order to prevent it from
8872 * being swallowed by Exec key unquoting. See the specification for exact quoting rules.
8874 * Returns: (transfer full): new #GAppInfo for given command.
8879 * g_app_info_delete:
8880 * @appinfo: a #GAppInfo
8882 * Tries to delete a #GAppInfo.
8884 * On some platforms, there may be a difference between user-defined
8885 * #GAppInfo<!-- -->s which can be deleted, and system-wide ones which
8886 * cannot. See g_app_info_can_delete().
8888 * Virtual: do_delete
8889 * Returns: %TRUE if @appinfo has been deleted
8896 * @appinfo: a #GAppInfo.
8898 * Creates a duplicate of a #GAppInfo.
8900 * Returns: (transfer full): a duplicate of @appinfo.
8906 * @appinfo1: the first #GAppInfo.
8907 * @appinfo2: the second #GAppInfo.
8909 * Checks if two #GAppInfo<!-- -->s are equal.
8911 * Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
8916 * g_app_info_get_all:
8918 * Gets a list of all of the applications currently registered
8921 * For desktop files, this includes applications that have
8922 * <literal>NoDisplay=true</literal> set or are excluded from
8923 * display by means of <literal>OnlyShowIn</literal> or
8924 * <literal>NotShowIn</literal>. See g_app_info_should_show().
8925 * The returned list does not include applications which have
8926 * the <literal>Hidden</literal> key set.
8928 * Returns: (element-type GAppInfo) (transfer full): a newly allocated #GList of references to #GAppInfo<!---->s.
8933 * g_app_info_get_all_for_type:
8934 * @content_type: the content type to find a #GAppInfo for
8936 * Gets a list of all #GAppInfos for a given content type,
8937 * including the recommended and fallback #GAppInfos. See
8938 * g_app_info_get_recommended_for_type() and
8939 * g_app_info_get_fallback_for_type().
8941 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
8946 * g_app_info_get_commandline:
8947 * @appinfo: a #GAppInfo
8949 * Gets the commandline with which the application will be
8952 * Returns: a string containing the @appinfo's commandline, or %NULL if this information is not available
8958 * g_app_info_get_default_for_type:
8959 * @content_type: the content type to find a #GAppInfo for
8960 * @must_support_uris: if %TRUE, the #GAppInfo is expected to support URIs
8962 * Gets the default #GAppInfo for a given content type.
8964 * Returns: (transfer full): #GAppInfo for given @content_type or %NULL on error.
8969 * g_app_info_get_default_for_uri_scheme:
8970 * @uri_scheme: a string containing a URI scheme.
8972 * Gets the default application for handling URIs with
8973 * the given URI scheme. A URI scheme is the initial part
8974 * of the URI, up to but not including the ':', e.g. "http",
8977 * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
8982 * g_app_info_get_description:
8983 * @appinfo: a #GAppInfo.
8985 * Gets a human-readable description of an installed application.
8987 * Returns: a string containing a description of the application @appinfo, or %NULL if none.
8992 * g_app_info_get_display_name:
8993 * @appinfo: a #GAppInfo.
8995 * Gets the display name of the application. The display name is often more
8996 * descriptive to the user than the name itself.
8998 * Returns: the display name of the application for @appinfo, or the name if no display name is available.
9004 * g_app_info_get_executable:
9005 * @appinfo: a #GAppInfo
9007 * Gets the executable's name for the installed application.
9009 * Returns: a string containing the @appinfo's application binaries name
9014 * g_app_info_get_fallback_for_type:
9015 * @content_type: the content type to find a #GAppInfo for
9017 * Gets a list of fallback #GAppInfos for a given content type, i.e.
9018 * those applications which claim to support the given content type
9019 * by MIME type subclassing and not directly.
9021 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9027 * g_app_info_get_icon:
9028 * @appinfo: a #GAppInfo.
9030 * Gets the icon for the application.
9032 * Returns: (transfer none): the default #GIcon for @appinfo or %NULL if there is no default icon.
9037 * g_app_info_get_id:
9038 * @appinfo: a #GAppInfo.
9040 * Gets the ID of an application. An id is a string that
9041 * identifies the application. The exact format of the id is
9042 * platform dependent. For instance, on Unix this is the
9043 * desktop file id from the xdg menu specification.
9045 * Note that the returned ID may be %NULL, depending on how
9046 * the @appinfo has been constructed.
9048 * Returns: a string containing the application's ID.
9053 * g_app_info_get_name:
9054 * @appinfo: a #GAppInfo.
9056 * Gets the installed name of the application.
9058 * Returns: the name of the application for @appinfo.
9063 * g_app_info_get_recommended_for_type:
9064 * @content_type: the content type to find a #GAppInfo for
9066 * Gets a list of recommended #GAppInfos for a given content type, i.e.
9067 * those applications which claim to support the given content type exactly,
9068 * and not by MIME type subclassing.
9069 * Note that the first application of the list is the last used one, i.e.
9070 * the last one for which g_app_info_set_as_last_used_for_type() has been
9073 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9079 * g_app_info_get_supported_types:
9080 * @appinfo: a #GAppInfo that can handle files
9082 * Retrieves the list of content types that @app_info claims to support.
9083 * If this information is not provided by the environment, this function
9084 * will return %NULL.
9085 * This function does not take in consideration associations added with
9086 * g_app_info_add_supports_type(), but only those exported directly by
9089 * Returns: (transfer none) (array zero-terminated=1) (element-type utf8): a list of content types.
9095 * g_app_info_launch:
9096 * @appinfo: a #GAppInfo
9097 * @files: (allow-none) (element-type GFile): a #GList of #GFile objects
9098 * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
9101 * Launches the application. Passes @files to the launched application
9102 * as arguments, using the optional @launch_context to get information
9103 * about the details of the launcher (like what screen it is on).
9104 * On error, @error will be set accordingly.
9106 * To launch the application without arguments pass a %NULL @files list.
9108 * Note that even if the launch is successful the application launched
9109 * can fail to start if it runs into problems during startup. There is
9110 * no way to detect this.
9112 * Some URIs can be changed when passed through a GFile (for instance
9113 * unsupported URIs with strange formats like mailto:), so if you have
9114 * a textual URI you want to pass in as argument, consider using
9115 * g_app_info_launch_uris() instead.
9117 * The launched application inherits the environment of the launching
9118 * process, but it can be modified with g_app_launch_context_setenv() and
9119 * g_app_launch_context_unsetenv().
9121 * On UNIX, this function sets the <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>
9122 * environment variable with the path of the launched desktop file and
9123 * <envar>GIO_LAUNCHED_DESKTOP_FILE_PID</envar> to the process
9124 * id of the launched process. This can be used to ignore
9125 * <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>, should it be inherited
9126 * by further processes. The <envar>DISPLAY</envar> and
9127 * <envar>DESKTOP_STARTUP_ID</envar> environment variables are also
9128 * set, based on information provided in @launch_context.
9130 * Returns: %TRUE on successful launch, %FALSE otherwise.
9135 * g_app_info_launch_default_for_uri:
9136 * @uri: the uri to show
9137 * @launch_context: (allow-none): an optional #GAppLaunchContext.
9138 * @error: a #GError.
9140 * Utility function that launches the default application
9141 * registered to handle the specified uri. Synchronous I/O
9142 * is done on the uri to detect the type of the file if
9145 * Returns: %TRUE on success, %FALSE on error.
9150 * g_app_info_launch_uris:
9151 * @appinfo: a #GAppInfo
9152 * @uris: (allow-none) (element-type utf8): a #GList containing URIs to launch.
9153 * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
9156 * Launches the application. This passes the @uris to the launched application
9157 * as arguments, using the optional @launch_context to get information
9158 * about the details of the launcher (like what screen it is on).
9159 * On error, @error will be set accordingly.
9161 * To launch the application without arguments pass a %NULL @uris list.
9163 * Note that even if the launch is successful the application launched
9164 * can fail to start if it runs into problems during startup. There is
9165 * no way to detect this.
9167 * Returns: %TRUE on successful launch, %FALSE otherwise.
9172 * g_app_info_remove_supports_type:
9173 * @appinfo: a #GAppInfo.
9174 * @content_type: a string.
9175 * @error: a #GError.
9177 * Removes a supported type from an application, if possible.
9179 * Returns: %TRUE on success, %FALSE on error.
9184 * g_app_info_reset_type_associations:
9185 * @content_type: a content type
9187 * Removes all changes to the type associations done by
9188 * g_app_info_set_as_default_for_type(),
9189 * g_app_info_set_as_default_for_extension(),
9190 * g_app_info_add_supports_type() or
9191 * g_app_info_remove_supports_type().
9198 * g_app_info_set_as_default_for_extension:
9199 * @appinfo: a #GAppInfo.
9200 * @extension: a string containing the file extension (without the dot).
9201 * @error: a #GError.
9203 * Sets the application as the default handler for the given file extension.
9205 * Returns: %TRUE on success, %FALSE on error.
9210 * g_app_info_set_as_default_for_type:
9211 * @appinfo: a #GAppInfo.
9212 * @content_type: the content type.
9213 * @error: a #GError.
9215 * Sets the application as the default handler for a given type.
9217 * Returns: %TRUE on success, %FALSE on error.
9222 * g_app_info_set_as_last_used_for_type:
9223 * @appinfo: a #GAppInfo.
9224 * @content_type: the content type.
9225 * @error: a #GError.
9227 * Sets the application as the last used application for a given type.
9228 * This will make the application appear as first in the list returned
9229 * by g_app_info_get_recommended_for_type(), regardless of the default
9230 * application for that content type.
9232 * Returns: %TRUE on success, %FALSE on error.
9237 * g_app_info_should_show:
9238 * @appinfo: a #GAppInfo.
9240 * Checks if the application info should be shown in menus that
9241 * list available applications.
9243 * Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
9248 * g_app_info_supports_files:
9249 * @appinfo: a #GAppInfo.
9251 * Checks if the application accepts files as arguments.
9253 * Returns: %TRUE if the @appinfo supports files.
9258 * g_app_info_supports_uris:
9259 * @appinfo: a #GAppInfo.
9261 * Checks if the application supports reading files and directories from URIs.
9263 * Returns: %TRUE if the @appinfo supports URIs.
9268 * g_app_launch_context_get_display:
9269 * @context: a #GAppLaunchContext
9270 * @info: a #GAppInfo
9271 * @files: (element-type GFile): a #GList of #GFile objects
9273 * Gets the display string for the @context. This is used to ensure new
9274 * applications are started on the same display as the launching
9275 * application, by setting the <envar>DISPLAY</envar> environment variable.
9277 * Returns: a display string for the display.
9282 * g_app_launch_context_get_environment:
9283 * @context: a #GAppLaunchContext
9285 * Gets the complete environment variable list to be passed to
9286 * the child process when @context is used to launch an application.
9287 * This is a %NULL-terminated array of strings, where each string has
9288 * the form <literal>KEY=VALUE</literal>.
9290 * Returns: (array zero-terminated=1) (transfer full): the child's environment
9296 * g_app_launch_context_get_startup_notify_id:
9297 * @context: a #GAppLaunchContext
9298 * @info: a #GAppInfo
9299 * @files: (element-type GFile): a #GList of of #GFile objects
9301 * Initiates startup notification for the application and returns the
9302 * <envar>DESKTOP_STARTUP_ID</envar> for the launched operation,
9305 * Startup notification IDs are defined in the <ulink
9306 * url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
9307 * FreeDesktop.Org Startup Notifications standard</ulink>.
9309 * Returns: a startup notification ID for the application, or %NULL if not supported.
9314 * g_app_launch_context_launch_failed:
9315 * @context: a #GAppLaunchContext.
9316 * @startup_notify_id: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
9318 * Called when an application has failed to launch, so that it can cancel
9319 * the application startup notification started in g_app_launch_context_get_startup_notify_id().
9324 * g_app_launch_context_new:
9326 * Creates a new application launch context. This is not normally used,
9327 * instead you instantiate a subclass of this, such as #GdkAppLaunchContext.
9329 * Returns: a #GAppLaunchContext.
9334 * g_app_launch_context_setenv:
9335 * @context: a #GAppLaunchContext
9336 * @variable: the environment variable to set
9337 * @value: the value for to set the variable to.
9339 * Arranges for @variable to be set to @value in the child's
9340 * environment when @context is used to launch an application.
9347 * g_app_launch_context_unsetenv:
9348 * @context: a #GAppLaunchContext
9349 * @variable: the environment variable to remove
9351 * Arranges for @variable to be unset in the child's environment
9352 * when @context is used to launch an application.
9359 * g_application_activate:
9360 * @application: a #GApplication
9362 * Activates the application.
9364 * In essence, this results in the #GApplication::activate signal being
9365 * emitted in the primary instance.
9367 * The application must be registered before calling this function.
9374 * g_application_command_line_create_file_for_arg:
9375 * @cmdline: a #GApplicationCommandLine
9376 * @arg: an argument from @cmdline
9378 * Creates a #GFile corresponding to a filename that was given as part
9379 * of the invocation of @cmdline.
9381 * This differs from g_file_new_for_commandline_arg() in that it
9382 * resolves relative pathnames using the current working directory of
9383 * the invoking process rather than the local process.
9385 * Returns: (transfer full): a new #GFile
9391 * g_application_command_line_get_arguments:
9392 * @cmdline: a #GApplicationCommandLine
9393 * @argc: (out) (allow-none): the length of the arguments array, or %NULL
9395 * Gets the list of arguments that was passed on the command line.
9397 * The strings in the array may contain non-utf8 data.
9399 * The return value is %NULL-terminated and should be freed using
9402 * Returns: (array length=argc) (transfer full): the string array containing the arguments (the argv)
9408 * g_application_command_line_get_cwd:
9409 * @cmdline: a #GApplicationCommandLine
9411 * Gets the working directory of the command line invocation.
9412 * The string may contain non-utf8 data.
9414 * It is possible that the remote application did not send a working
9415 * directory, so this may be %NULL.
9417 * The return value should not be modified or freed and is valid for as
9418 * long as @cmdline exists.
9420 * Returns: the current directory, or %NULL
9426 * g_application_command_line_get_environ:
9427 * @cmdline: a #GApplicationCommandLine
9429 * Gets the contents of the 'environ' variable of the command line
9430 * invocation, as would be returned by g_get_environ(), ie as a
9431 * %NULL-terminated list of strings in the form 'NAME=VALUE'.
9432 * The strings may contain non-utf8 data.
9434 * The remote application usually does not send an environment. Use
9435 * %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
9436 * set it is possible that the environment is still not available (due
9437 * to invocation messages from other applications).
9439 * The return value should not be modified or freed and is valid for as
9440 * long as @cmdline exists.
9442 * See g_application_command_line_getenv() if you are only interested
9443 * in the value of a single environment variable.
9445 * Returns: (array zero-terminated=1) (transfer none): the environment strings, or %NULL if they were not sent
9451 * g_application_command_line_get_exit_status:
9452 * @cmdline: a #GApplicationCommandLine
9454 * Gets the exit status of @cmdline. See
9455 * g_application_command_line_set_exit_status() for more information.
9457 * Returns: the exit status
9463 * g_application_command_line_get_is_remote:
9464 * @cmdline: a #GApplicationCommandLine
9466 * Determines if @cmdline represents a remote invocation.
9468 * Returns: %TRUE if the invocation was remote
9474 * g_application_command_line_get_platform_data:
9475 * @cmdline: #GApplicationCommandLine
9477 * Gets the platform data associated with the invocation of @cmdline.
9479 * This is a #GVariant dictionary containing information about the
9480 * context in which the invocation occurred. It typically contains
9481 * information like the current working directory and the startup
9484 * For local invocation, it will be %NULL.
9486 * Returns: (allow-none): the platform data, or %NULL
9492 * g_application_command_line_get_stdin:
9493 * @cmdline: a #GApplicationCommandLine
9495 * Gets the stdin of the invoking process.
9497 * The #GInputStream can be used to read data passed to the standard
9498 * input of the invoking process.
9499 * This doesn't work on all platforms. Presently, it is only available
9500 * on UNIX when using a DBus daemon capable of passing file descriptors.
9501 * If stdin is not available then %NULL will be returned. In the
9502 * future, support may be expanded to other platforms.
9504 * You must only call this function once per commandline invocation.
9506 * Returns: (transfer full): a #GInputStream for stdin
9512 * g_application_command_line_getenv:
9513 * @cmdline: a #GApplicationCommandLine
9514 * @name: the environment variable to get
9516 * Gets the value of a particular environment variable of the command
9517 * line invocation, as would be returned by g_getenv(). The strings may
9518 * contain non-utf8 data.
9520 * The remote application usually does not send an environment. Use
9521 * %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
9522 * set it is possible that the environment is still not available (due
9523 * to invocation messages from other applications).
9525 * The return value should not be modified or freed and is valid for as
9526 * long as @cmdline exists.
9528 * Returns: the value of the variable, or %NULL if unset or unsent
9534 * g_application_command_line_print:
9535 * @cmdline: a #GApplicationCommandLine
9536 * @format: a printf-style format string
9537 * @...: arguments, as per @format
9539 * Formats a message and prints it using the stdout print handler in the
9542 * If @cmdline is a local invocation then this is exactly equivalent to
9543 * g_print(). If @cmdline is remote then this is equivalent to calling
9544 * g_print() in the invoking process.
9551 * g_application_command_line_printerr:
9552 * @cmdline: a #GApplicationCommandLine
9553 * @format: a printf-style format string
9554 * @...: arguments, as per @format
9556 * Formats a message and prints it using the stderr print handler in the
9559 * If @cmdline is a local invocation then this is exactly equivalent to
9560 * g_printerr(). If @cmdline is remote then this is equivalent to
9561 * calling g_printerr() in the invoking process.
9568 * g_application_command_line_set_exit_status:
9569 * @cmdline: a #GApplicationCommandLine
9570 * @exit_status: the exit status
9572 * Sets the exit status that will be used when the invoking process
9575 * The return value of the #GApplication::command-line signal is
9576 * passed to this function when the handler returns. This is the usual
9577 * way of setting the exit status.
9579 * In the event that you want the remote invocation to continue running
9580 * and want to decide on the exit status in the future, you can use this
9581 * call. For the case of a remote invocation, the remote process will
9582 * typically exit when the last reference is dropped on @cmdline. The
9583 * exit status of the remote process will be equal to the last value
9584 * that was set with this function.
9586 * In the case that the commandline invocation is local, the situation
9587 * is slightly more complicated. If the commandline invocation results
9588 * in the mainloop running (ie: because the use-count of the application
9589 * increased to a non-zero value) then the application is considered to
9590 * have been 'successful' in a certain sense, and the exit status is
9591 * always zero. If the application use count is zero, though, the exit
9592 * status of the local #GApplicationCommandLine is used.
9599 * g_application_get_application_id:
9600 * @application: a #GApplication
9602 * Gets the unique identifier for @application.
9604 * Returns: the identifier for @application, owned by @application
9610 * g_application_get_dbus_connection:
9611 * @application: a #GApplication
9613 * Gets the #GDBusConnection being used by the application, or %NULL.
9615 * If #GApplication is using its D-Bus backend then this function will
9616 * return the #GDBusConnection being used for uniqueness and
9617 * communication with the desktop environment and other instances of the
9620 * If #GApplication is not using D-Bus then this function will return
9621 * %NULL. This includes the situation where the D-Bus backend would
9622 * normally be in use but we were unable to connect to the bus.
9624 * This function must not be called before the application has been
9625 * registered. See g_application_get_is_registered().
9627 * Returns: (transfer none): a #GDBusConnection, or %NULL
9633 * g_application_get_dbus_object_path:
9634 * @application: a #GApplication
9636 * Gets the D-Bus object path being used by the application, or %NULL.
9638 * If #GApplication is using its D-Bus backend then this function will
9639 * return the D-Bus object path that #GApplication is using. If the
9640 * application is the primary instance then there is an object published
9641 * at this path. If the application is not the primary instance then
9642 * the result of this function is undefined.
9644 * If #GApplication is not using D-Bus then this function will return
9645 * %NULL. This includes the situation where the D-Bus backend would
9646 * normally be in use but we were unable to connect to the bus.
9648 * This function must not be called before the application has been
9649 * registered. See g_application_get_is_registered().
9651 * Returns: the object path, or %NULL
9657 * g_application_get_default:
9659 * Returns the default #GApplication instance for this process.
9661 * Normally there is only one #GApplication per process and it becomes
9662 * the default when it is created. You can exercise more control over
9663 * this by using g_application_set_default().
9665 * If there is no default application then %NULL is returned.
9667 * Returns: (transfer none): the default application for this process, or %NULL
9673 * g_application_get_flags:
9674 * @application: a #GApplication
9676 * Gets the flags for @application.
9678 * See #GApplicationFlags.
9680 * Returns: the flags for @application
9686 * g_application_get_inactivity_timeout:
9687 * @application: a #GApplication
9689 * Gets the current inactivity timeout for the application.
9691 * This is the amount of time (in milliseconds) after the last call to
9692 * g_application_release() before the application stops running.
9694 * Returns: the timeout, in milliseconds
9700 * g_application_get_is_registered:
9701 * @application: a #GApplication
9703 * Checks if @application is registered.
9705 * An application is registered if g_application_register() has been
9706 * successfully called.
9708 * Returns: %TRUE if @application is registered
9714 * g_application_get_is_remote:
9715 * @application: a #GApplication
9717 * Checks if @application is remote.
9719 * If @application is remote then it means that another instance of
9720 * application already exists (the 'primary' instance). Calls to
9721 * perform actions on @application will result in the actions being
9722 * performed by the primary instance.
9724 * The value of this property cannot be accessed before
9725 * g_application_register() has been called. See
9726 * g_application_get_is_registered().
9728 * Returns: %TRUE if @application is remote
9734 * g_application_hold:
9735 * @application: a #GApplication
9737 * Increases the use count of @application.
9739 * Use this function to indicate that the application has a reason to
9740 * continue to run. For example, g_application_hold() is called by GTK+
9741 * when a toplevel window is on the screen.
9743 * To cancel the hold, call g_application_release().
9748 * g_application_id_is_valid:
9749 * @application_id: a potential application identifier
9751 * Checks if @application_id is a valid application identifier.
9753 * A valid ID is required for calls to g_application_new() and
9754 * g_application_set_application_id().
9756 * For convenience, the restrictions on application identifiers are
9759 * <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-." and must not begin with a digit.</listitem>
9760 * <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least three elements).</listitem>
9761 * <listitem>Application identifiers must not begin or end with a '.' (period) character.</listitem>
9762 * <listitem>Application identifiers must not contain consecutive '.' (period) characters.</listitem>
9763 * <listitem>Application identifiers must not exceed 255 characters.</listitem>
9766 * Returns: %TRUE if @application_id is valid
9771 * g_application_mark_busy:
9772 * @application: a #GApplication
9774 * Increases the busy count of @application.
9776 * Use this function to indicate that the application is busy, for instance
9777 * while a long running operation is pending.
9779 * The busy state will be exposed to other processes, so a session shell will
9780 * use that information to indicate the state to the user (e.g. with a
9783 * To cancel the busy indication, use g_application_unmark_busy().
9790 * g_application_new:
9791 * @application_id: (allow-none): the application id
9792 * @flags: the application flags
9794 * Creates a new #GApplication instance.
9796 * If non-%NULL, the application id must be valid. See
9797 * g_application_id_is_valid().
9799 * If no application ID is given then some features of #GApplication
9800 * (most notably application uniqueness) will be disabled.
9802 * Returns: a new #GApplication instance
9807 * g_application_open:
9808 * @application: a #GApplication
9809 * @files: (array length=n_files): an array of #GFiles to open
9810 * @n_files: the length of the @files array
9811 * @hint: a hint (or ""), but never %NULL
9813 * Opens the given files.
9815 * In essence, this results in the #GApplication::open signal being emitted
9816 * in the primary instance.
9818 * @n_files must be greater than zero.
9820 * @hint is simply passed through to the ::open signal. It is
9821 * intended to be used by applications that have multiple modes for
9822 * opening files (eg: "view" vs "edit", etc). Unless you have a need
9823 * for this functionality, you should use "".
9825 * The application must be registered before calling this function
9826 * and it must have the %G_APPLICATION_HANDLES_OPEN flag set.
9833 * g_application_quit:
9834 * @application: a #GApplication
9836 * Immediately quits the application.
9838 * Upon return to the mainloop, g_application_run() will return,
9839 * calling only the 'shutdown' function before doing so.
9841 * The hold count is ignored.
9843 * The result of calling g_application_run() again after it returns is
9851 * g_application_register:
9852 * @application: a #GApplication
9853 * @cancellable: (allow-none): a #GCancellable, or %NULL
9854 * @error: a pointer to a NULL #GError, or %NULL
9856 * Attempts registration of the application.
9858 * This is the point at which the application discovers if it is the
9859 * primary instance or merely acting as a remote for an already-existing
9860 * primary instance. This is implemented by attempting to acquire the
9861 * application identifier as a unique bus name on the session bus using
9864 * If there is no application ID or if %G_APPLICATION_NON_UNIQUE was
9865 * given, then this process will always become the primary instance.
9867 * Due to the internal architecture of GDBus, method calls can be
9868 * dispatched at any time (even if a main loop is not running). For
9869 * this reason, you must ensure that any object paths that you wish to
9870 * register are registered before calling this function.
9872 * If the application has already been registered then %TRUE is
9873 * returned with no work performed.
9875 * The #GApplication::startup signal is emitted if registration succeeds
9876 * and @application is the primary instance (including the non-unique
9879 * In the event of an error (such as @cancellable being cancelled, or a
9880 * failure to connect to the session bus), %FALSE is returned and @error
9881 * is set appropriately.
9883 * Note: the return value of this function is not an indicator that this
9884 * instance is or is not the primary instance of the application. See
9885 * g_application_get_is_remote() for that.
9887 * Returns: %TRUE if registration succeeded
9893 * g_application_release:
9894 * @application: a #GApplication
9896 * Decrease the use count of @application.
9898 * When the use count reaches zero, the application will stop running.
9900 * Never call this function except to cancel the effect of a previous
9901 * call to g_application_hold().
9906 * g_application_run:
9907 * @application: a #GApplication
9908 * @argc: the argc from main() (or 0 if @argv is %NULL)
9909 * @argv: (array length=argc) (allow-none): the argv from main(), or %NULL
9911 * Runs the application.
9913 * This function is intended to be run from main() and its return value
9914 * is intended to be returned by main(). Although you are expected to pass
9915 * the @argc, @argv parameters from main() to this function, it is possible
9916 * to pass %NULL if @argv is not available or commandline handling is not
9919 * First, the local_command_line() virtual function is invoked.
9920 * This function always runs on the local instance. It gets passed a pointer
9921 * to a %NULL-terminated copy of @argv and is expected to remove the arguments
9922 * that it handled (shifting up remaining arguments). See
9923 * <xref linkend="gapplication-example-cmdline2"/> for an example of
9924 * parsing @argv manually. Alternatively, you may use the #GOptionContext API,
9925 * after setting <literal>argc = g_strv_length (argv);</literal>.
9927 * The last argument to local_command_line() is a pointer to the @status
9928 * variable which can used to set the exit status that is returned from
9929 * g_application_run().
9931 * If local_command_line() returns %TRUE, the command line is expected
9932 * to be completely handled, including possibly registering as the primary
9933 * instance, calling g_application_activate() or g_application_open(), etc.
9935 * If local_command_line() returns %FALSE then the application is registered
9936 * and the #GApplication::command-line signal is emitted in the primary
9937 * instance (which may or may not be this instance). The signal handler
9938 * gets passed a #GApplicationCommandLine object that (among other things)
9939 * contains the remaining commandline arguments that have not been handled
9940 * by local_command_line().
9942 * If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE
9943 * flag set then the default implementation of local_command_line()
9944 * always returns %FALSE immediately, resulting in the commandline
9945 * always being handled in the primary instance.
9947 * Otherwise, the default implementation of local_command_line() tries
9948 * to do a couple of things that are probably reasonable for most
9949 * applications. First, g_application_register() is called to attempt
9950 * to register the application. If that works, then the command line
9951 * arguments are inspected. If no commandline arguments are given, then
9952 * g_application_activate() is called. If commandline arguments are
9953 * given and the %G_APPLICATION_HANDLES_OPEN flag is set then they
9954 * are assumed to be filenames and g_application_open() is called.
9956 * If you need to handle commandline arguments that are not filenames,
9957 * and you don't mind commandline handling to happen in the primary
9958 * instance, you should set %G_APPLICATION_HANDLES_COMMAND_LINE and
9959 * process the commandline arguments in your #GApplication::command-line
9960 * signal handler, either manually or using the #GOptionContext API.
9962 * If you are interested in doing more complicated local handling of the
9963 * commandline then you should implement your own #GApplication subclass
9964 * and override local_command_line(). In this case, you most likely want
9965 * to return %TRUE from your local_command_line() implementation to
9966 * suppress the default handling. See
9967 * <xref linkend="gapplication-example-cmdline2"/> for an example.
9969 * If, after the above is done, the use count of the application is zero
9970 * then the exit status is returned immediately. If the use count is
9971 * non-zero then the default main context is iterated until the use count
9972 * falls to zero, at which point 0 is returned.
9974 * If the %G_APPLICATION_IS_SERVICE flag is set, then the service will
9975 * run for as much as 10 seconds with a use count of zero while waiting
9976 * for the message that caused the activation to arrive. After that,
9977 * if the use count falls to zero the application will exit immediately,
9978 * except in the case that g_application_set_inactivity_timeout() is in
9981 * This function sets the prgname (g_set_prgname()), if not already set,
9982 * to the basename of argv[0]. Since 2.38, if %G_APPLICATION_IS_SERVICE
9983 * is specified, the prgname is set to the application ID. The main
9984 * impact of this is is that the wmclass of windows created by Gtk+ will
9985 * be set accordingly, which helps the window manager determine which
9986 * application is showing the window.
9988 * Returns: the exit status
9994 * g_application_set_action_group:
9995 * @application: a #GApplication
9996 * @action_group: (allow-none): a #GActionGroup, or %NULL
9998 * This used to be how actions were associated with a #GApplication.
9999 * Now there is #GActionMap for that.
10002 * 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.
10007 * g_application_set_application_id:
10008 * @application: a #GApplication
10009 * @application_id: (allow-none): the identifier for @application
10011 * Sets the unique identifier for @application.
10013 * The application id can only be modified if @application has not yet
10016 * If non-%NULL, the application id must be valid. See
10017 * g_application_id_is_valid().
10024 * g_application_set_default:
10025 * @application: (allow-none): the application to set as default, or %NULL
10027 * Sets or unsets the default application for the process, as returned
10028 * by g_application_get_default().
10030 * This function does not take its own reference on @application. If
10031 * @application is destroyed then the default application will revert
10039 * g_application_set_flags:
10040 * @application: a #GApplication
10041 * @flags: the flags for @application
10043 * Sets the flags for @application.
10045 * The flags can only be modified if @application has not yet been
10048 * See #GApplicationFlags.
10055 * g_application_set_inactivity_timeout:
10056 * @application: a #GApplication
10057 * @inactivity_timeout: the timeout, in milliseconds
10059 * Sets the current inactivity timeout for the application.
10061 * This is the amount of time (in milliseconds) after the last call to
10062 * g_application_release() before the application stops running.
10064 * This call has no side effects of its own. The value set here is only
10065 * used for next time g_application_release() drops the use count to
10066 * zero. Any timeouts currently in progress are not impacted.
10073 * g_application_unmark_busy:
10074 * @application: a #GApplication
10076 * Decreases the busy count of @application.
10078 * When the busy count reaches zero, the new state will be propagated
10079 * to other processes.
10081 * This function must only be called to cancel the effect of a previous
10082 * call to g_application_mark_busy().
10089 * g_async_initable_init_async:
10090 * @initable: a #GAsyncInitable.
10091 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10092 * @cancellable: optional #GCancellable object, %NULL to ignore.
10093 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
10094 * @user_data: the data to pass to callback function
10096 * Starts asynchronous initialization of the object implementing the
10097 * interface. This must be done before any real use of the object after
10098 * initial construction. If the object also implements #GInitable you can
10099 * optionally call g_initable_init() instead.
10101 * When the initialization is finished, @callback will be called. You can
10102 * then call g_async_initable_init_finish() to get the result of the
10105 * Implementations may also support cancellation. If @cancellable is not
10106 * %NULL, then initialization can be cancelled by triggering the cancellable
10107 * object from another thread. If the operation was cancelled, the error
10108 * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
10109 * the object doesn't support cancellable initialization, the error
10110 * %G_IO_ERROR_NOT_SUPPORTED will be returned.
10112 * As with #GInitable, if the object is not initialized, or initialization
10113 * returns with an error, then all operations on the object except
10114 * g_object_ref() and g_object_unref() are considered to be invalid, and
10115 * have undefined behaviour. They will often fail with g_critical() or
10116 * g_warning(), but this must not be relied on.
10118 * Implementations of this method must be idempotent: i.e. multiple calls
10119 * to this function with the same argument should return the same results.
10120 * Only the first call initializes the object; further calls return the result
10121 * of the first call. This is so that it's safe to implement the singleton
10122 * pattern in the GObject constructor function.
10124 * For classes that also support the #GInitable interface, the default
10125 * implementation of this method will run the g_initable_init() function
10126 * in a thread, so if you want to support asynchronous initialization via
10127 * threads, just implement the #GAsyncInitable interface without overriding
10128 * any interface methods.
10135 * g_async_initable_init_finish:
10136 * @initable: a #GAsyncInitable.
10137 * @res: a #GAsyncResult.
10138 * @error: a #GError location to store the error occurring, or %NULL to ignore.
10140 * Finishes asynchronous initialization and returns the result.
10141 * See g_async_initable_init_async().
10143 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
10149 * g_async_initable_new_async:
10150 * @object_type: a #GType supporting #GAsyncInitable.
10151 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10152 * @cancellable: optional #GCancellable object, %NULL to ignore.
10153 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10154 * @user_data: the data to pass to callback function
10155 * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
10156 * @...: the value of the first property, followed by other property value pairs, and ended by %NULL.
10158 * Helper function for constructing #GAsyncInitable object. This is
10159 * similar to g_object_new() but also initializes the object asynchronously.
10161 * When the initialization is finished, @callback will be called. You can
10162 * then call g_async_initable_new_finish() to get the new object and check
10170 * g_async_initable_new_finish:
10171 * @initable: the #GAsyncInitable from the callback
10172 * @res: the #GAsyncResult from the callback
10173 * @error: return location for errors, or %NULL to ignore
10175 * Finishes the async construction for the various g_async_initable_new
10176 * calls, returning the created object or %NULL on error.
10178 * Returns: (type GObject.Object) (transfer full): a newly created #GObject, or %NULL on error. Free with g_object_unref().
10184 * g_async_initable_new_valist_async:
10185 * @object_type: a #GType supporting #GAsyncInitable.
10186 * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
10187 * @var_args: The var args list generated from @first_property_name.
10188 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10189 * @cancellable: optional #GCancellable object, %NULL to ignore.
10190 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10191 * @user_data: the data to pass to callback function
10193 * Helper function for constructing #GAsyncInitable object. This is
10194 * similar to g_object_new_valist() but also initializes the object
10197 * When the initialization is finished, @callback will be called. You can
10198 * then call g_async_initable_new_finish() to get the new object and check
10206 * g_async_initable_newv_async:
10207 * @object_type: a #GType supporting #GAsyncInitable.
10208 * @n_parameters: the number of parameters in @parameters
10209 * @parameters: the parameters to use to construct the object
10210 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10211 * @cancellable: optional #GCancellable object, %NULL to ignore.
10212 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10213 * @user_data: the data to pass to callback function
10215 * Helper function for constructing #GAsyncInitable object. This is
10216 * similar to g_object_newv() but also initializes the object asynchronously.
10218 * When the initialization is finished, @callback will be called. You can
10219 * then call g_async_initable_new_finish() to get the new object and check
10227 * g_async_result_get_source_object:
10228 * @res: a #GAsyncResult
10230 * Gets the source object from a #GAsyncResult.
10232 * Returns: (transfer full): a new reference to the source object for the @res, or %NULL if there is none.
10237 * g_async_result_get_user_data:
10238 * @res: a #GAsyncResult.
10240 * Gets the user data from a #GAsyncResult.
10242 * Returns: (transfer full): the user data for @res.
10247 * g_async_result_is_tagged:
10248 * @res: a #GAsyncResult
10249 * @source_tag: an application-defined tag
10251 * Checks if @res has the given @source_tag (generally a function
10252 * pointer indicating the function @res was created by).
10254 * Returns: %TRUE if @res has the indicated @source_tag, %FALSE if not.
10260 * g_async_result_legacy_propagate_error:
10261 * @res: a #GAsyncResult
10262 * @error: (out): a location to propagate the error to.
10264 * If @res is a #GSimpleAsyncResult, this is equivalent to
10265 * g_simple_async_result_propagate_error(). Otherwise it returns
10268 * This can be used for legacy error handling in async
10269 * <literal>_finish ()</literal> wrapper functions that traditionally
10270 * handled #GSimpleAsyncResult error returns themselves rather than
10271 * calling into the virtual method. This should not be used in new
10272 * code; #GAsyncResult errors that are set by virtual methods should
10273 * also be extracted by virtual methods, to enable subclasses to chain
10276 * Returns: %TRUE if @error is has been filled in with an error from @res, %FALSE if not.
10282 * g_buffered_input_stream_fill:
10283 * @stream: a #GBufferedInputStream
10284 * @count: the number of bytes that will be read from the stream
10285 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10286 * @error: location to store the error occurring, or %NULL to ignore
10288 * Tries to read @count bytes from the stream into the buffer.
10289 * Will block during this read.
10291 * If @count is zero, returns zero and does nothing. A value of @count
10292 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
10294 * On success, the number of bytes read into the buffer is returned.
10295 * It is not an error if this is not the same as the requested size, as it
10296 * can happen e.g. near the end of a file. Zero is returned on end of file
10297 * (or if @count is zero), but never otherwise.
10299 * If @count is -1 then the attempted read size is equal to the number of
10300 * bytes that are required to fill the buffer.
10302 * If @cancellable is not %NULL, then the operation can be cancelled by
10303 * triggering the cancellable object from another thread. If the operation
10304 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
10305 * operation was partially finished when the operation was cancelled the
10306 * partial result will be returned, without an error.
10308 * On error -1 is returned and @error is set accordingly.
10310 * For the asynchronous, non-blocking, version of this function, see
10311 * g_buffered_input_stream_fill_async().
10313 * Returns: the number of bytes read into @stream's buffer, up to @count, or -1 on error.
10318 * g_buffered_input_stream_fill_async:
10319 * @stream: a #GBufferedInputStream
10320 * @count: the number of bytes that will be read from the stream
10321 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
10322 * @cancellable: (allow-none): optional #GCancellable object
10323 * @callback: (scope async): a #GAsyncReadyCallback
10324 * @user_data: (closure): a #gpointer
10326 * Reads data into @stream's buffer asynchronously, up to @count size.
10327 * @io_priority can be used to prioritize reads. For the synchronous
10328 * version of this function, see g_buffered_input_stream_fill().
10330 * If @count is -1 then the attempted read size is equal to the number
10331 * of bytes that are required to fill the buffer.
10336 * g_buffered_input_stream_fill_finish:
10337 * @stream: a #GBufferedInputStream
10338 * @result: a #GAsyncResult
10339 * @error: a #GError
10341 * Finishes an asynchronous read.
10343 * Returns: a #gssize of the read stream, or %-1 on an error.
10348 * g_buffered_input_stream_get_available:
10349 * @stream: #GBufferedInputStream
10351 * Gets the size of the available data within the stream.
10353 * Returns: size of the available stream.
10358 * g_buffered_input_stream_get_buffer_size:
10359 * @stream: a #GBufferedInputStream
10361 * Gets the size of the input buffer.
10363 * Returns: the current buffer size.
10368 * g_buffered_input_stream_new:
10369 * @base_stream: a #GInputStream
10371 * Creates a new #GInputStream from the given @base_stream, with
10372 * a buffer set to the default size (4 kilobytes).
10374 * Returns: a #GInputStream for the given @base_stream.
10379 * g_buffered_input_stream_new_sized:
10380 * @base_stream: a #GInputStream
10383 * Creates a new #GBufferedInputStream from the given @base_stream,
10384 * with a buffer set to @size.
10386 * Returns: a #GInputStream.
10391 * g_buffered_input_stream_peek:
10392 * @stream: a #GBufferedInputStream
10393 * @buffer: (array length=count) (element-type guint8): a pointer to an allocated chunk of memory
10394 * @offset: a #gsize
10397 * Peeks in the buffer, copying data of size @count into @buffer,
10398 * offset @offset bytes.
10400 * Returns: a #gsize of the number of bytes peeked, or -1 on error.
10405 * g_buffered_input_stream_peek_buffer:
10406 * @stream: a #GBufferedInputStream
10407 * @count: (out): a #gsize to get the number of bytes available in the buffer
10409 * Returns the buffer with the currently available bytes. The returned
10410 * buffer must not be modified and will become invalid when reading from
10411 * the stream or filling the buffer.
10413 * Returns: (array length=count) (element-type guint8) (transfer none): read-only buffer
10418 * g_buffered_input_stream_read_byte:
10419 * @stream: a #GBufferedInputStream
10420 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10421 * @error: location to store the error occurring, or %NULL to ignore
10423 * Tries to read a single byte from the stream or the buffer. Will block
10424 * during this read.
10426 * On success, the byte read from the stream is returned. On end of stream
10427 * -1 is returned but it's not an exceptional error and @error is not set.
10429 * If @cancellable is not %NULL, then the operation can be cancelled by
10430 * triggering the cancellable object from another thread. If the operation
10431 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
10432 * operation was partially finished when the operation was cancelled the
10433 * partial result will be returned, without an error.
10435 * On error -1 is returned and @error is set accordingly.
10437 * Returns: the byte read from the @stream, or -1 on end of stream or error.
10442 * g_buffered_input_stream_set_buffer_size:
10443 * @stream: a #GBufferedInputStream
10446 * Sets the size of the internal buffer of @stream to @size, or to the
10447 * size of the contents of the buffer. The buffer can never be resized
10448 * smaller than its current contents.
10453 * g_buffered_output_stream_get_auto_grow:
10454 * @stream: a #GBufferedOutputStream.
10456 * Checks if the buffer automatically grows as data is added.
10458 * Returns: %TRUE if the @stream's buffer automatically grows, %FALSE otherwise.
10463 * g_buffered_output_stream_get_buffer_size:
10464 * @stream: a #GBufferedOutputStream.
10466 * Gets the size of the buffer in the @stream.
10468 * Returns: the current size of the buffer.
10473 * g_buffered_output_stream_new:
10474 * @base_stream: a #GOutputStream.
10476 * Creates a new buffered output stream for a base stream.
10478 * Returns: a #GOutputStream for the given @base_stream.
10483 * g_buffered_output_stream_new_sized:
10484 * @base_stream: a #GOutputStream.
10487 * Creates a new buffered output stream with a given buffer size.
10489 * Returns: a #GOutputStream with an internal buffer set to @size.
10494 * g_buffered_output_stream_set_auto_grow:
10495 * @stream: a #GBufferedOutputStream.
10496 * @auto_grow: a #gboolean.
10498 * Sets whether or not the @stream's buffer should automatically grow.
10499 * If @auto_grow is true, then each write will just make the buffer
10500 * larger, and you must manually flush the buffer to actually write out
10501 * the data to the underlying stream.
10506 * g_buffered_output_stream_set_buffer_size:
10507 * @stream: a #GBufferedOutputStream.
10510 * Sets the size of the internal buffer to @size.
10516 * @bus_type: A #GBusType.
10517 * @cancellable: (allow-none): A #GCancellable or %NULL.
10518 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
10519 * @user_data: The data to pass to @callback.
10521 * Asynchronously connects to the message bus specified by @bus_type.
10523 * When the operation is finished, @callback will be invoked. You can
10524 * then call g_bus_get_finish() to get the result of the operation.
10526 * This is a asynchronous failable function. See g_bus_get_sync() for
10527 * the synchronous version.
10534 * g_bus_get_finish:
10535 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
10536 * @error: Return location for error or %NULL.
10538 * Finishes an operation started with g_bus_get().
10540 * The returned object is a singleton, that is, shared with other
10541 * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10542 * event that you need a private message bus connection, use
10543 * g_dbus_address_get_for_bus_sync() and
10544 * g_dbus_connection_new_for_address().
10546 * Note that the returned #GDBusConnection object will (usually) have
10547 * the #GDBusConnection:exit-on-close property set to %TRUE.
10549 * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10556 * @bus_type: A #GBusType.
10557 * @cancellable: (allow-none): A #GCancellable or %NULL.
10558 * @error: Return location for error or %NULL.
10560 * Synchronously connects to the message bus specified by @bus_type.
10561 * Note that the returned object may shared with other callers,
10562 * e.g. if two separate parts of a process calls this function with
10563 * the same @bus_type, they will share the same object.
10565 * This is a synchronous failable function. See g_bus_get() and
10566 * g_bus_get_finish() for the asynchronous version.
10568 * The returned object is a singleton, that is, shared with other
10569 * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10570 * event that you need a private message bus connection, use
10571 * g_dbus_address_get_for_bus_sync() and
10572 * g_dbus_connection_new_for_address().
10574 * Note that the returned #GDBusConnection object will (usually) have
10575 * the #GDBusConnection:exit-on-close property set to %TRUE.
10577 * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10584 * @bus_type: The type of bus to own a name on.
10585 * @name: The well-known name to own.
10586 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10587 * @bus_acquired_handler: (allow-none): Handler to invoke when connected to the bus of type @bus_type or %NULL.
10588 * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10589 * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10590 * @user_data: User data to pass to handlers.
10591 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10593 * Starts acquiring @name on the bus specified by @bus_type and calls
10594 * @name_acquired_handler and @name_lost_handler when the name is
10595 * acquired respectively lost. Callbacks will be invoked in the <link
10596 * linkend="g-main-context-push-thread-default">thread-default main
10597 * loop</link> of the thread you are calling this function from.
10599 * You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
10600 * callbacks will be invoked after calling this function - there are three
10604 * @name_lost_handler with a %NULL connection (if a connection to the bus can't be made).
10605 * </para></listitem>
10607 * @bus_acquired_handler then @name_lost_handler (if the name can't be obtained)
10608 * </para></listitem>
10610 * @bus_acquired_handler then @name_acquired_handler (if the name was obtained).
10611 * </para></listitem>
10613 * When you are done owning the name, just call g_bus_unown_name()
10614 * with the owner id this function returns.
10616 * If the name is acquired or lost (for example another application
10617 * could acquire the name if you allow replacement or the application
10618 * currently owning the name exits), the handlers are also invoked. If the
10619 * #GDBusConnection that is used for attempting to own the name
10620 * closes, then @name_lost_handler is invoked since it is no
10621 * longer possible for other processes to access the process.
10623 * You cannot use g_bus_own_name() several times for the same name (unless
10624 * interleaved with calls to g_bus_unown_name()) - only the first call
10627 * Another guarantee is that invocations of @name_acquired_handler
10628 * and @name_lost_handler are guaranteed to alternate; that
10629 * is, if @name_acquired_handler is invoked then you are
10630 * guaranteed that the next time one of the handlers is invoked, it
10631 * will be @name_lost_handler. The reverse is also true.
10633 * If you plan on exporting objects (using e.g.
10634 * g_dbus_connection_register_object()), note that it is generally too late
10635 * to export the objects in @name_acquired_handler. Instead, you can do this
10636 * in @bus_acquired_handler since you are guaranteed that this will run
10637 * before @name is requested from the bus.
10639 * This behavior makes it very simple to write applications that wants
10640 * to own names and export objects, see <xref linkend="gdbus-owning-names"/>.
10641 * Simply register objects to be exported in @bus_acquired_handler and
10642 * unregister the objects (if any) in @name_lost_handler.
10644 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10650 * g_bus_own_name_on_connection:
10651 * @connection: A #GDBusConnection.
10652 * @name: The well-known name to own.
10653 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10654 * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10655 * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10656 * @user_data: User data to pass to handlers.
10657 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10659 * Like g_bus_own_name() but takes a #GDBusConnection instead of a
10662 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10668 * g_bus_own_name_on_connection_with_closures:
10669 * @connection: A #GDBusConnection.
10670 * @name: The well-known name to own.
10671 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10672 * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10673 * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10675 * Version of g_bus_own_name_on_connection() using closures instead of callbacks for
10676 * easier binding in other languages.
10678 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10679 * Rename to: g_bus_own_name_on_connection
10685 * g_bus_own_name_with_closures:
10686 * @bus_type: The type of bus to own a name on.
10687 * @name: The well-known name to own.
10688 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10689 * @bus_acquired_closure: (allow-none): #GClosure to invoke when connected to the bus of type @bus_type or %NULL.
10690 * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10691 * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10693 * Version of g_bus_own_name() using closures instead of callbacks for
10694 * easier binding in other languages.
10696 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10697 * Rename to: g_bus_own_name
10703 * g_bus_unown_name:
10704 * @owner_id: An identifier obtained from g_bus_own_name()
10706 * Stops owning a name.
10713 * g_bus_unwatch_name:
10714 * @watcher_id: An identifier obtained from g_bus_watch_name()
10716 * Stops watching a name.
10723 * g_bus_watch_name:
10724 * @bus_type: The type of bus to watch a name on.
10725 * @name: The name (well-known or unique) to watch.
10726 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10727 * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
10728 * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
10729 * @user_data: User data to pass to handlers.
10730 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10732 * Starts watching @name on the bus specified by @bus_type and calls
10733 * @name_appeared_handler and @name_vanished_handler when the name is
10734 * known to have a owner respectively known to lose its
10735 * owner. Callbacks will be invoked in the <link
10736 * linkend="g-main-context-push-thread-default">thread-default main
10737 * loop</link> of the thread you are calling this function from.
10739 * You are guaranteed that one of the handlers will be invoked after
10740 * calling this function. When you are done watching the name, just
10741 * call g_bus_unwatch_name() with the watcher id this function
10744 * If the name vanishes or appears (for example the application owning
10745 * the name could restart), the handlers are also invoked. If the
10746 * #GDBusConnection that is used for watching the name disconnects, then
10747 * @name_vanished_handler is invoked since it is no longer
10748 * possible to access the name.
10750 * Another guarantee is that invocations of @name_appeared_handler
10751 * and @name_vanished_handler are guaranteed to alternate; that
10752 * is, if @name_appeared_handler is invoked then you are
10753 * guaranteed that the next time one of the handlers is invoked, it
10754 * will be @name_vanished_handler. The reverse is also true.
10756 * This behavior makes it very simple to write applications that wants
10757 * to take action when a certain name exists, see <xref
10758 * linkend="gdbus-watching-names"/>. Basically, the application
10759 * should create object proxies in @name_appeared_handler and destroy
10760 * them again (if any) in @name_vanished_handler.
10762 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10768 * g_bus_watch_name_on_connection:
10769 * @connection: A #GDBusConnection.
10770 * @name: The name (well-known or unique) to watch.
10771 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10772 * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
10773 * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
10774 * @user_data: User data to pass to handlers.
10775 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10777 * Like g_bus_watch_name() but takes a #GDBusConnection instead of a
10780 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10786 * g_bus_watch_name_on_connection_with_closures:
10787 * @connection: A #GDBusConnection.
10788 * @name: The name (well-known or unique) to watch.
10789 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10790 * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
10791 * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
10793 * Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
10794 * easier binding in other languages.
10796 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10797 * Rename to: g_bus_watch_name_on_connection
10803 * g_bus_watch_name_with_closures:
10804 * @bus_type: The type of bus to watch a name on.
10805 * @name: The name (well-known or unique) to watch.
10806 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10807 * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
10808 * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
10810 * Version of g_bus_watch_name() using closures instead of callbacks for
10811 * easier binding in other languages.
10813 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10814 * Rename to: g_bus_watch_name
10820 * g_bytes_icon_get_bytes:
10823 * Gets the #GBytes associated with the given @icon.
10825 * Returns: (transfer none): a #GBytes, or %NULL.
10831 * g_bytes_icon_new:
10832 * @bytes: a #GBytes.
10834 * Creates a new icon for a bytes.
10836 * Returns: (transfer full) (type GBytesIcon): a #GIcon for the given @bytes, or %NULL on error.
10842 * g_cancellable_cancel:
10843 * @cancellable: a #GCancellable object.
10845 * Will set @cancellable to cancelled, and will emit the
10846 * #GCancellable::cancelled signal. (However, see the warning about
10847 * race conditions in the documentation for that signal if you are
10848 * planning to connect to it.)
10850 * This function is thread-safe. In other words, you can safely call
10851 * it from a thread other than the one running the operation that was
10852 * passed the @cancellable.
10854 * The convention within gio is that cancelling an asynchronous
10855 * operation causes it to complete asynchronously. That is, if you
10856 * cancel the operation from the same thread in which it is running,
10857 * then the operation's #GAsyncReadyCallback will not be invoked until
10858 * the application returns to the main loop.
10863 * g_cancellable_connect:
10864 * @cancellable: A #GCancellable.
10865 * @callback: The #GCallback to connect.
10866 * @data: Data to pass to @callback.
10867 * @data_destroy_func: (allow-none): Free function for @data or %NULL.
10869 * Convenience function to connect to the #GCancellable::cancelled
10870 * signal. Also handles the race condition that may happen
10871 * if the cancellable is cancelled right before connecting.
10873 * @callback is called at most once, either directly at the
10874 * time of the connect if @cancellable is already cancelled,
10875 * or when @cancellable is cancelled in some thread.
10877 * @data_destroy_func will be called when the handler is
10878 * disconnected, or immediately if the cancellable is already
10881 * See #GCancellable::cancelled for details on how to use this.
10883 * Returns: The id of the signal handler or 0 if @cancellable has already been cancelled.
10889 * g_cancellable_disconnect:
10890 * @cancellable: (allow-none): A #GCancellable or %NULL.
10891 * @handler_id: Handler id of the handler to be disconnected, or %0.
10893 * Disconnects a handler from a cancellable instance similar to
10894 * g_signal_handler_disconnect(). Additionally, in the event that a
10895 * signal handler is currently running, this call will block until the
10896 * handler has finished. Calling this function from a
10897 * #GCancellable::cancelled signal handler will therefore result in a
10900 * This avoids a race condition where a thread cancels at the
10901 * same time as the cancellable operation is finished and the
10902 * signal handler is removed. See #GCancellable::cancelled for
10903 * details on how to use this.
10905 * If @cancellable is %NULL or @handler_id is %0 this function does
10913 * g_cancellable_get_current:
10915 * Gets the top cancellable from the stack.
10917 * Returns: (transfer none): a #GCancellable from the top of the stack, or %NULL if the stack is empty.
10922 * g_cancellable_get_fd:
10923 * @cancellable: a #GCancellable.
10925 * Gets the file descriptor for a cancellable job. This can be used to
10926 * implement cancellable operations on Unix systems. The returned fd will
10927 * turn readable when @cancellable is cancelled.
10929 * You are not supposed to read from the fd yourself, just check for
10930 * readable status. Reading to unset the readable status is done
10931 * with g_cancellable_reset().
10933 * After a successful return from this function, you should use
10934 * g_cancellable_release_fd() to free up resources allocated for
10935 * the returned file descriptor.
10937 * See also g_cancellable_make_pollfd().
10939 * Returns: A valid file descriptor. %-1 if the file descriptor is not supported, or on errors.
10944 * g_cancellable_is_cancelled:
10945 * @cancellable: (allow-none): a #GCancellable or %NULL
10947 * Checks if a cancellable job has been cancelled.
10949 * Returns: %TRUE if @cancellable is cancelled, FALSE if called with %NULL or if item is not cancelled.
10954 * g_cancellable_make_pollfd:
10955 * @cancellable: (allow-none): a #GCancellable or %NULL
10956 * @pollfd: a pointer to a #GPollFD
10958 * Creates a #GPollFD corresponding to @cancellable; this can be passed
10959 * to g_poll() and used to poll for cancellation. This is useful both
10960 * for unix systems without a native poll and for portability to
10963 * When this function returns %TRUE, you should use
10964 * g_cancellable_release_fd() to free up resources allocated for the
10965 * @pollfd. After a %FALSE return, do not call g_cancellable_release_fd().
10967 * If this function returns %FALSE, either no @cancellable was given or
10968 * resource limits prevent this function from allocating the necessary
10969 * structures for polling. (On Linux, you will likely have reached
10970 * the maximum number of file descriptors.) The suggested way to handle
10971 * these cases is to ignore the @cancellable.
10973 * You are not supposed to read from the fd yourself, just check for
10974 * readable status. Reading to unset the readable status is done
10975 * with g_cancellable_reset().
10977 * Returns: %TRUE if @pollfd was successfully initialized, %FALSE on failure to prepare the cancellable.
10983 * g_cancellable_new:
10985 * Creates a new #GCancellable object.
10987 * Applications that want to start one or more operations
10988 * that should be cancellable should create a #GCancellable
10989 * and pass it to the operations.
10991 * One #GCancellable can be used in multiple consecutive
10992 * operations or in multiple concurrent operations.
10994 * Returns: a #GCancellable.
10999 * g_cancellable_pop_current:
11000 * @cancellable: a #GCancellable object
11002 * Pops @cancellable off the cancellable stack (verifying that @cancellable
11003 * is on the top of the stack).
11008 * g_cancellable_push_current:
11009 * @cancellable: a #GCancellable object
11011 * Pushes @cancellable onto the cancellable stack. The current
11012 * cancellable can then be received using g_cancellable_get_current().
11014 * This is useful when implementing cancellable operations in
11015 * code that does not allow you to pass down the cancellable object.
11017 * This is typically called automatically by e.g. #GFile operations,
11018 * so you rarely have to call this yourself.
11023 * g_cancellable_release_fd:
11024 * @cancellable: a #GCancellable
11026 * Releases a resources previously allocated by g_cancellable_get_fd()
11027 * or g_cancellable_make_pollfd().
11029 * For compatibility reasons with older releases, calling this function
11030 * is not strictly required, the resources will be automatically freed
11031 * when the @cancellable is finalized. However, the @cancellable will
11032 * block scarce file descriptors until it is finalized if this function
11033 * is not called. This can cause the application to run out of file
11034 * descriptors when many #GCancellables are used at the same time.
11041 * g_cancellable_reset:
11042 * @cancellable: a #GCancellable object.
11044 * Resets @cancellable to its uncancelled state.
11046 * If cancellable is currently in use by any cancellable operation
11047 * then the behavior of this function is undefined.
11052 * g_cancellable_set_error_if_cancelled:
11053 * @cancellable: (allow-none): a #GCancellable or %NULL
11054 * @error: #GError to append error state to
11056 * If the @cancellable is cancelled, sets the error to notify
11057 * that the operation was cancelled.
11059 * Returns: %TRUE if @cancellable was cancelled, %FALSE if it was not
11064 * g_cancellable_source_new: (skip)
11065 * @cancellable: (allow-none): a #GCancellable, or %NULL
11067 * Creates a source that triggers if @cancellable is cancelled and
11068 * calls its callback of type #GCancellableSourceFunc. This is
11069 * primarily useful for attaching to another (non-cancellable) source
11070 * with g_source_add_child_source() to add cancellability to it.
11072 * For convenience, you can call this with a %NULL #GCancellable,
11073 * in which case the source will never trigger.
11075 * Returns: (transfer full): the new #GSource.
11081 * g_charset_converter_get_num_fallbacks:
11082 * @converter: a #GCharsetConverter
11084 * Gets the number of fallbacks that @converter has applied so far.
11086 * Returns: the number of fallbacks that @converter has applied
11092 * g_charset_converter_get_use_fallback:
11093 * @converter: a #GCharsetConverter
11095 * Gets the #GCharsetConverter:use-fallback property.
11097 * Returns: %TRUE if fallbacks are used by @converter
11103 * g_charset_converter_new:
11104 * @to_charset: destination charset
11105 * @from_charset: source charset
11106 * @error: #GError for error reporting, or %NULL to ignore.
11108 * Creates a new #GCharsetConverter.
11110 * Returns: a new #GCharsetConverter or %NULL on error.
11116 * g_charset_converter_set_use_fallback:
11117 * @converter: a #GCharsetConverter
11118 * @use_fallback: %TRUE to use fallbacks
11120 * Sets the #GCharsetConverter:use-fallback property.
11127 * g_content_type_can_be_executable:
11128 * @type: a content type string
11130 * Checks if a content type can be executable. Note that for instance
11131 * things like text files can be executables (i.e. scripts and batch files).
11133 * Returns: %TRUE if the file type corresponds to a type that can be executable, %FALSE otherwise.
11138 * g_content_type_equals:
11139 * @type1: a content type string
11140 * @type2: a content type string
11142 * Compares two content types for equality.
11144 * Returns: %TRUE if the two strings are identical or equivalent, %FALSE otherwise.
11149 * g_content_type_from_mime_type:
11150 * @mime_type: a mime type string
11152 * Tries to find a content type based on the mime type name.
11154 * Returns: (allow-none): Newly allocated string with content type or %NULL. Free with g_free()
11160 * g_content_type_get_description:
11161 * @type: a content type string
11163 * Gets the human readable description of the content type.
11165 * Returns: a short description of the content type @type. Free the returned string with g_free()
11170 * g_content_type_get_generic_icon_name:
11171 * @type: a content type string
11173 * Gets the generic icon name for a content type.
11175 * See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
11176 * specification for more on the generic icon name.
11178 * Returns: (allow-none): the registered generic icon name for the given @type, or %NULL if unknown. Free with g_free()
11184 * g_content_type_get_icon:
11185 * @type: a content type string
11187 * Gets the icon for a content type.
11189 * Returns: (transfer full): #GIcon corresponding to the content type. Free the returned object with g_object_unref()
11194 * g_content_type_get_mime_type:
11195 * @type: a content type string
11197 * Gets the mime type for the content type, if one is registered.
11199 * Returns: (allow-none): the registered mime type for the given @type, or %NULL if unknown.
11204 * g_content_type_get_symbolic_icon:
11205 * @type: a content type string
11207 * Gets the symbolic icon for a content type.
11209 * Returns: (transfer full): symbolic #GIcon corresponding to the content type. Free the returned object with g_object_unref()
11215 * g_content_type_guess:
11216 * @filename: (allow-none): a string, or %NULL
11217 * @data: (allow-none) (array length=data_size): a stream of data, or %NULL
11218 * @data_size: the size of @data
11219 * @result_uncertain: (allow-none) (out): return location for the certainty of the result, or %NULL
11221 * Guesses the content type based on example data. If the function is
11222 * uncertain, @result_uncertain will be set to %TRUE. Either @filename
11223 * or @data may be %NULL, in which case the guess will be based solely
11224 * on the other argument.
11226 * Returns: a string indicating a guessed content type for the given data. Free with g_free()
11231 * g_content_type_guess_for_tree:
11232 * @root: the root of the tree to guess a type for
11234 * Tries to guess the type of the tree with root @root, by
11235 * looking at the files it contains. The result is an array
11236 * of content types, with the best guess coming first.
11238 * The types returned all have the form x-content/foo, e.g.
11239 * x-content/audio-cdda (for audio CDs) or x-content/image-dcf
11240 * (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
11241 * specification for more on x-content types.
11243 * This function is useful in the implementation of
11244 * g_mount_guess_content_type().
11246 * Returns: (transfer full) (array zero-terminated=1): an %NULL-terminated array of zero or more content types. Free with g_strfreev()
11252 * g_content_type_is_a:
11253 * @type: a content type string
11254 * @supertype: a content type string
11256 * Determines if @type is a subset of @supertype.
11258 * Returns: %TRUE if @type is a kind of @supertype, %FALSE otherwise.
11263 * g_content_type_is_unknown:
11264 * @type: a content type string
11266 * Checks if the content type is the generic "unknown" type.
11267 * On UNIX this is the "application/octet-stream" mimetype,
11268 * while on win32 it is "*".
11270 * Returns: %TRUE if the type is the unknown type.
11275 * g_content_types_get_registered:
11277 * Gets a list of strings containing all the registered content types
11278 * known to the system. The list and its data should be freed using
11280 * g_list_free_full (list, g_free);
11281 * </programlisting>
11283 * Returns: (element-type utf8) (transfer full): #GList of the registered content types
11288 * g_converter_convert:
11289 * @converter: a #GConverter.
11290 * @inbuf: (array length=inbuf_size) (element-type guint8): the buffer containing the data to convert.
11291 * @inbuf_size: the number of bytes in @inbuf
11292 * @outbuf: a buffer to write converted data in.
11293 * @outbuf_size: the number of bytes in @outbuf, must be at least one
11294 * @flags: a #GConverterFlags controlling the conversion details
11295 * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success
11296 * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success
11297 * @error: location to store the error occurring, or %NULL to ignore
11299 * This is the main operation used when converting data. It is to be called
11300 * multiple times in a loop, and each time it will do some work, i.e.
11301 * producing some output (in @outbuf) or consuming some input (from @inbuf) or
11302 * both. If its not possible to do any work an error is returned.
11304 * Note that a single call may not consume all input (or any input at all).
11305 * Also a call may produce output even if given no input, due to state stored
11306 * in the converter producing output.
11308 * If any data was either produced or consumed, and then an error happens, then
11309 * only the successful conversion is reported and the error is returned on the
11312 * A full conversion loop involves calling this method repeatedly, each time
11313 * giving it new input and space output space. When there is no more input
11314 * data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
11315 * The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
11316 * each time until all data is consumed and all output is produced, then
11317 * %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
11318 * may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
11319 * in a decompression converter where the end of data is detectable from the
11320 * data (and there might even be other data after the end of the compressed data).
11322 * When some data has successfully been converted @bytes_read and is set to
11323 * the number of bytes read from @inbuf, and @bytes_written is set to indicate
11324 * how many bytes was written to @outbuf. If there are more data to output
11325 * or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
11326 * %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
11327 * then %G_CONVERTER_FINISHED is returned.
11329 * On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
11330 * Some errors need special handling:
11332 * %G_IO_ERROR_NO_SPACE is returned if there is not enough space
11333 * to write the resulting converted data, the application should
11334 * call the function again with a larger @outbuf to continue.
11336 * %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
11337 * input to fully determine what the conversion should produce,
11338 * and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
11339 * example with an incomplete multibyte sequence when converting text,
11340 * or when a regexp matches up to the end of the input (and may match
11341 * further input). It may also happen when @inbuf_size is zero and
11342 * there is no more data to produce.
11344 * When this happens the application should read more input and then
11345 * call the function again. If further input shows that there is no
11346 * more data call the function again with the same data but with
11347 * the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
11348 * to finish as e.g. in the regexp match case (or, to fail again with
11349 * %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
11350 * input is actually partial).
11352 * After g_converter_convert() has returned %G_CONVERTER_FINISHED the
11353 * converter object is in an invalid state where its not allowed
11354 * to call g_converter_convert() anymore. At this time you can only
11355 * free the object or call g_converter_reset() to reset it to the
11358 * If the flag %G_CONVERTER_FLUSH is set then conversion is modified
11359 * to try to write out all internal state to the output. The application
11360 * has to call the function multiple times with the flag set, and when
11361 * the available input has been consumed and all internal state has
11362 * been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
11363 * really at the end) is returned instead of %G_CONVERTER_CONVERTED.
11364 * This is somewhat similar to what happens at the end of the input stream,
11365 * but done in the middle of the data.
11367 * This has different meanings for different conversions. For instance
11368 * in a compression converter it would mean that we flush all the
11369 * compression state into output such that if you uncompress the
11370 * compressed data you get back all the input data. Doing this may
11371 * make the final file larger due to padding though. Another example
11372 * is a regexp conversion, where if you at the end of the flushed data
11373 * have a match, but there is also a potential longer match. In the
11374 * non-flushed case we would ask for more input, but when flushing we
11375 * treat this as the end of input and do the match.
11377 * Flushing is not always possible (like if a charset converter flushes
11378 * at a partial multibyte sequence). Converters are supposed to try
11379 * to produce as much output as possible and then return an error
11380 * (typically %G_IO_ERROR_PARTIAL_INPUT).
11382 * Returns: a #GConverterResult, %G_CONVERTER_ERROR on error.
11388 * g_converter_input_stream_get_converter:
11389 * @converter_stream: a #GConverterInputStream
11391 * Gets the #GConverter that is used by @converter_stream.
11393 * Returns: (transfer none): the converter of the converter input stream
11399 * g_converter_input_stream_new:
11400 * @base_stream: a #GInputStream
11401 * @converter: a #GConverter
11403 * Creates a new converter input stream for the @base_stream.
11405 * Returns: a new #GInputStream.
11410 * g_converter_output_stream_get_converter:
11411 * @converter_stream: a #GConverterOutputStream
11413 * Gets the #GConverter that is used by @converter_stream.
11415 * Returns: (transfer none): the converter of the converter output stream
11421 * g_converter_output_stream_new:
11422 * @base_stream: a #GOutputStream
11423 * @converter: a #GConverter
11425 * Creates a new converter output stream for the @base_stream.
11427 * Returns: a new #GOutputStream.
11432 * g_converter_reset:
11433 * @converter: a #GConverter.
11435 * Resets all internal state in the converter, making it behave
11436 * as if it was just created. If the converter has any internal
11437 * state that would produce output then that output is lost.
11444 * g_credentials_get_native: (skip)
11445 * @credentials: A #GCredentials.
11446 * @native_type: The type of native credentials to get.
11448 * Gets a pointer to native credentials of type @native_type from
11451 * It is a programming error (which will cause an warning to be
11452 * logged) to use this method if there is no #GCredentials support for
11453 * the OS or if @native_type isn't supported by the OS.
11455 * 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.
11461 * g_credentials_get_unix_pid:
11462 * @credentials: A #GCredentials
11463 * @error: Return location for error or %NULL.
11465 * Tries to get the UNIX process identifier from @credentials. This
11466 * method is only available on UNIX platforms.
11468 * This operation can fail if #GCredentials is not supported on the
11469 * OS or if the native credentials type does not contain information
11470 * about the UNIX process ID.
11472 * Returns: The UNIX process ID, or -1 if @error is set.
11478 * g_credentials_get_unix_user:
11479 * @credentials: A #GCredentials
11480 * @error: Return location for error or %NULL.
11482 * Tries to get the UNIX user identifier from @credentials. This
11483 * method is only available on UNIX platforms.
11485 * This operation can fail if #GCredentials is not supported on the
11486 * OS or if the native credentials type does not contain information
11487 * about the UNIX user.
11489 * Returns: The UNIX user identifier or -1 if @error is set.
11495 * g_credentials_is_same_user:
11496 * @credentials: A #GCredentials.
11497 * @other_credentials: A #GCredentials.
11498 * @error: Return location for error or %NULL.
11500 * Checks if @credentials and @other_credentials is the same user.
11502 * This operation can fail if #GCredentials is not supported on the
11505 * Returns: %TRUE if @credentials and @other_credentials has the same user, %FALSE otherwise or if @error is set.
11511 * g_credentials_new:
11513 * Creates a new #GCredentials object with credentials matching the
11514 * the current process.
11516 * Returns: A #GCredentials. Free with g_object_unref().
11522 * g_credentials_set_native:
11523 * @credentials: A #GCredentials.
11524 * @native_type: The type of native credentials to set.
11525 * @native: A pointer to native credentials.
11527 * Copies the native credentials of type @native_type from @native
11528 * into @credentials.
11530 * It is a programming error (which will cause an warning to be
11531 * logged) to use this method if there is no #GCredentials support for
11532 * the OS or if @native_type isn't supported by the OS.
11539 * g_credentials_set_unix_user:
11540 * @credentials: A #GCredentials.
11541 * @uid: The UNIX user identifier to set.
11542 * @error: Return location for error or %NULL.
11544 * Tries to set the UNIX user identifier on @credentials. This method
11545 * is only available on UNIX platforms.
11547 * This operation can fail if #GCredentials is not supported on the
11548 * OS or if the native credentials type does not contain information
11549 * about the UNIX user.
11551 * Returns: %TRUE if @uid was set, %FALSE if error is set.
11557 * g_credentials_to_string:
11558 * @credentials: A #GCredentials object.
11560 * Creates a human-readable textual representation of @credentials
11561 * that can be used in logging and debug messages. The format of the
11562 * returned string may change in future GLib release.
11564 * Returns: A string that should be freed with g_free().
11570 * g_data_input_stream_get_byte_order:
11571 * @stream: a given #GDataInputStream.
11573 * Gets the byte order for the data input stream.
11575 * Returns: the @stream's current #GDataStreamByteOrder.
11580 * g_data_input_stream_get_newline_type:
11581 * @stream: a given #GDataInputStream.
11583 * Gets the current newline type for the @stream.
11585 * Returns: #GDataStreamNewlineType for the given @stream.
11590 * g_data_input_stream_new:
11591 * @base_stream: a #GInputStream.
11593 * Creates a new data input stream for the @base_stream.
11595 * Returns: a new #GDataInputStream.
11600 * g_data_input_stream_read_byte:
11601 * @stream: a given #GDataInputStream.
11602 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11603 * @error: #GError for error reporting.
11605 * Reads an unsigned 8-bit/1-byte value from @stream.
11607 * Returns: an unsigned 8-bit/1-byte value read from the @stream or %0 if an error occurred.
11612 * g_data_input_stream_read_int16:
11613 * @stream: a given #GDataInputStream.
11614 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11615 * @error: #GError for error reporting.
11617 * Reads a 16-bit/2-byte value from @stream.
11619 * In order to get the correct byte order for this read operation,
11620 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11622 * Returns: a signed 16-bit/2-byte value read from @stream or %0 if an error occurred.
11627 * g_data_input_stream_read_int32:
11628 * @stream: a given #GDataInputStream.
11629 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11630 * @error: #GError for error reporting.
11632 * Reads a signed 32-bit/4-byte value from @stream.
11634 * In order to get the correct byte order for this read operation,
11635 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11637 * If @cancellable is not %NULL, then the operation can be cancelled by
11638 * triggering the cancellable object from another thread. If the operation
11639 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11641 * Returns: a signed 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11646 * g_data_input_stream_read_int64:
11647 * @stream: a given #GDataInputStream.
11648 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11649 * @error: #GError for error reporting.
11651 * Reads a 64-bit/8-byte value from @stream.
11653 * In order to get the correct byte order for this read operation,
11654 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11656 * If @cancellable is not %NULL, then the operation can be cancelled by
11657 * triggering the cancellable object from another thread. If the operation
11658 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11660 * Returns: a signed 64-bit/8-byte value read from @stream or %0 if an error occurred.
11665 * g_data_input_stream_read_line:
11666 * @stream: a given #GDataInputStream.
11667 * @length: (out): a #gsize to get the length of the data read in.
11668 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11669 * @error: #GError for error reporting.
11671 * Reads a line from the data input stream. Note that no encoding
11672 * checks or conversion is performed; the input is not guaranteed to
11673 * be UTF-8, and may in fact have embedded NUL characters.
11675 * If @cancellable is not %NULL, then the operation can be cancelled by
11676 * triggering the cancellable object from another thread. If the operation
11677 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11679 * 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.
11684 * g_data_input_stream_read_line_async:
11685 * @stream: a given #GDataInputStream.
11686 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11687 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11688 * @callback: (scope async): callback to call when the request is satisfied.
11689 * @user_data: (closure): the data to pass to callback function.
11691 * The asynchronous version of g_data_input_stream_read_line(). It is
11692 * an error to have two outstanding calls to this function.
11694 * When the operation is finished, @callback will be called. You
11695 * can then call g_data_input_stream_read_line_finish() to get
11696 * the result of the operation.
11703 * g_data_input_stream_read_line_finish:
11704 * @stream: a given #GDataInputStream.
11705 * @result: the #GAsyncResult that was provided to the callback.
11706 * @length: (out): a #gsize to get the length of the data read in.
11707 * @error: #GError for error reporting.
11709 * Finish an asynchronous call started by
11710 * g_data_input_stream_read_line_async(). Note the warning about
11711 * string encoding in g_data_input_stream_read_line() applies here as
11714 * 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.
11720 * g_data_input_stream_read_line_finish_utf8:
11721 * @stream: a given #GDataInputStream.
11722 * @result: the #GAsyncResult that was provided to the callback.
11723 * @length: (out): a #gsize to get the length of the data read in.
11724 * @error: #GError for error reporting.
11726 * Finish an asynchronous call started by
11727 * g_data_input_stream_read_line_async().
11729 * 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.
11735 * g_data_input_stream_read_line_utf8:
11736 * @stream: a given #GDataInputStream.
11737 * @length: (out): a #gsize to get the length of the data read in.
11738 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11739 * @error: #GError for error reporting.
11741 * Reads a UTF-8 encoded line from the data input stream.
11743 * If @cancellable is not %NULL, then the operation can be cancelled by
11744 * triggering the cancellable object from another thread. If the operation
11745 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11747 * 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.
11753 * g_data_input_stream_read_uint16:
11754 * @stream: a given #GDataInputStream.
11755 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11756 * @error: #GError for error reporting.
11758 * Reads an unsigned 16-bit/2-byte value from @stream.
11760 * In order to get the correct byte order for this read operation,
11761 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11763 * Returns: an unsigned 16-bit/2-byte value read from the @stream or %0 if an error occurred.
11768 * g_data_input_stream_read_uint32:
11769 * @stream: a given #GDataInputStream.
11770 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11771 * @error: #GError for error reporting.
11773 * Reads an unsigned 32-bit/4-byte value from @stream.
11775 * In order to get the correct byte order for this read operation,
11776 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11778 * If @cancellable is not %NULL, then the operation can be cancelled by
11779 * triggering the cancellable object from another thread. If the operation
11780 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11782 * Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11787 * g_data_input_stream_read_uint64:
11788 * @stream: a given #GDataInputStream.
11789 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11790 * @error: #GError for error reporting.
11792 * Reads an unsigned 64-bit/8-byte value from @stream.
11794 * In order to get the correct byte order for this read operation,
11795 * see g_data_input_stream_get_byte_order().
11797 * If @cancellable is not %NULL, then the operation can be cancelled by
11798 * triggering the cancellable object from another thread. If the operation
11799 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11801 * Returns: an unsigned 64-bit/8-byte read from @stream or %0 if an error occurred.
11806 * g_data_input_stream_read_until:
11807 * @stream: a given #GDataInputStream.
11808 * @stop_chars: characters to terminate the read.
11809 * @length: (out): a #gsize to get the length of the data read in.
11810 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11811 * @error: #GError for error reporting.
11813 * Reads a string from the data input stream, up to the first
11814 * occurrence of any of the stop characters.
11816 * Note that, in contrast to g_data_input_stream_read_until_async(),
11817 * this function consumes the stop character that it finds.
11819 * Don't use this function in new code. Its functionality is
11820 * inconsistent with g_data_input_stream_read_until_async(). Both
11821 * functions will be marked as deprecated in a future release. Use
11822 * g_data_input_stream_read_upto() instead, but note that that function
11823 * does not consume the stop character.
11825 * 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.
11830 * g_data_input_stream_read_until_async:
11831 * @stream: a given #GDataInputStream.
11832 * @stop_chars: characters to terminate the read.
11833 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11834 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11835 * @callback: (scope async): callback to call when the request is satisfied.
11836 * @user_data: (closure): the data to pass to callback function.
11838 * The asynchronous version of g_data_input_stream_read_until().
11839 * It is an error to have two outstanding calls to this function.
11841 * Note that, in contrast to g_data_input_stream_read_until(),
11842 * this function does not consume the stop character that it finds. You
11843 * must read it for yourself.
11845 * When the operation is finished, @callback will be called. You
11846 * can then call g_data_input_stream_read_until_finish() to get
11847 * the result of the operation.
11849 * Don't use this function in new code. Its functionality is
11850 * inconsistent with g_data_input_stream_read_until(). Both functions
11851 * will be marked as deprecated in a future release. Use
11852 * g_data_input_stream_read_upto_async() instead.
11859 * g_data_input_stream_read_until_finish:
11860 * @stream: a given #GDataInputStream.
11861 * @result: the #GAsyncResult that was provided to the callback.
11862 * @length: (out): a #gsize to get the length of the data read in.
11863 * @error: #GError for error reporting.
11865 * Finish an asynchronous call started by
11866 * g_data_input_stream_read_until_async().
11869 * 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.
11874 * g_data_input_stream_read_upto:
11875 * @stream: a #GDataInputStream
11876 * @stop_chars: characters to terminate the read
11877 * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
11878 * @length: (out): a #gsize to get the length of the data read in
11879 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
11880 * @error: #GError for error reporting
11882 * Reads a string from the data input stream, up to the first
11883 * occurrence of any of the stop characters.
11885 * In contrast to g_data_input_stream_read_until(), this function
11886 * does <emphasis>not</emphasis> consume the stop character. You have
11887 * to use g_data_input_stream_read_byte() to get it before calling
11888 * g_data_input_stream_read_upto() again.
11890 * Note that @stop_chars may contain '\0' if @stop_chars_len is
11893 * 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
11899 * g_data_input_stream_read_upto_async:
11900 * @stream: a #GDataInputStream
11901 * @stop_chars: characters to terminate the read
11902 * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
11903 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11904 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
11905 * @callback: (scope async): callback to call when the request is satisfied
11906 * @user_data: (closure): the data to pass to callback function
11908 * The asynchronous version of g_data_input_stream_read_upto().
11909 * It is an error to have two outstanding calls to this function.
11911 * In contrast to g_data_input_stream_read_until(), this function
11912 * does <emphasis>not</emphasis> consume the stop character. You have
11913 * to use g_data_input_stream_read_byte() to get it before calling
11914 * g_data_input_stream_read_upto() again.
11916 * Note that @stop_chars may contain '\0' if @stop_chars_len is
11919 * When the operation is finished, @callback will be called. You
11920 * can then call g_data_input_stream_read_upto_finish() to get
11921 * the result of the operation.
11928 * g_data_input_stream_read_upto_finish:
11929 * @stream: a #GDataInputStream
11930 * @result: the #GAsyncResult that was provided to the callback
11931 * @length: (out): a #gsize to get the length of the data read in
11932 * @error: #GError for error reporting
11934 * Finish an asynchronous call started by
11935 * g_data_input_stream_read_upto_async().
11937 * Note that this function does <emphasis>not</emphasis> consume the
11938 * stop character. You have to use g_data_input_stream_read_byte() to
11939 * get it before calling g_data_input_stream_read_upto_async() again.
11941 * 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.
11947 * g_data_input_stream_set_byte_order:
11948 * @stream: a given #GDataInputStream.
11949 * @order: a #GDataStreamByteOrder to set.
11951 * This function sets the byte order for the given @stream. All subsequent
11952 * reads from the @stream will be read in the given @order.
11957 * g_data_input_stream_set_newline_type:
11958 * @stream: a #GDataInputStream.
11959 * @type: the type of new line return as #GDataStreamNewlineType.
11961 * Sets the newline type for the @stream.
11963 * Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
11964 * chunk ends in "CR" we must read an additional byte to know if this is "CR" or
11965 * "CR LF", and this might block if there is no more data available.
11970 * g_data_output_stream_get_byte_order:
11971 * @stream: a #GDataOutputStream.
11973 * Gets the byte order for the stream.
11975 * Returns: the #GDataStreamByteOrder for the @stream.
11980 * g_data_output_stream_new:
11981 * @base_stream: a #GOutputStream.
11983 * Creates a new data output stream for @base_stream.
11985 * Returns: #GDataOutputStream.
11990 * g_data_output_stream_put_byte:
11991 * @stream: a #GDataOutputStream.
11992 * @data: a #guchar.
11993 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11994 * @error: a #GError, %NULL to ignore.
11996 * Puts a byte into the output stream.
11998 * Returns: %TRUE if @data was successfully added to the @stream.
12003 * g_data_output_stream_put_int16:
12004 * @stream: a #GDataOutputStream.
12005 * @data: a #gint16.
12006 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12007 * @error: a #GError, %NULL to ignore.
12009 * Puts a signed 16-bit integer into the output stream.
12011 * Returns: %TRUE if @data was successfully added to the @stream.
12016 * g_data_output_stream_put_int32:
12017 * @stream: a #GDataOutputStream.
12018 * @data: a #gint32.
12019 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12020 * @error: a #GError, %NULL to ignore.
12022 * Puts a signed 32-bit integer into the output stream.
12024 * Returns: %TRUE if @data was successfully added to the @stream.
12029 * g_data_output_stream_put_int64:
12030 * @stream: a #GDataOutputStream.
12031 * @data: a #gint64.
12032 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12033 * @error: a #GError, %NULL to ignore.
12035 * Puts a signed 64-bit integer into the stream.
12037 * Returns: %TRUE if @data was successfully added to the @stream.
12042 * g_data_output_stream_put_string:
12043 * @stream: a #GDataOutputStream.
12045 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12046 * @error: a #GError, %NULL to ignore.
12048 * Puts a string into the output stream.
12050 * Returns: %TRUE if @string was successfully added to the @stream.
12055 * g_data_output_stream_put_uint16:
12056 * @stream: a #GDataOutputStream.
12057 * @data: a #guint16.
12058 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12059 * @error: a #GError, %NULL to ignore.
12061 * Puts an unsigned 16-bit integer into the output stream.
12063 * Returns: %TRUE if @data was successfully added to the @stream.
12068 * g_data_output_stream_put_uint32:
12069 * @stream: a #GDataOutputStream.
12070 * @data: a #guint32.
12071 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12072 * @error: a #GError, %NULL to ignore.
12074 * Puts an unsigned 32-bit integer into the stream.
12076 * Returns: %TRUE if @data was successfully added to the @stream.
12081 * g_data_output_stream_put_uint64:
12082 * @stream: a #GDataOutputStream.
12083 * @data: a #guint64.
12084 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12085 * @error: a #GError, %NULL to ignore.
12087 * Puts an unsigned 64-bit integer into the stream.
12089 * Returns: %TRUE if @data was successfully added to the @stream.
12094 * g_data_output_stream_set_byte_order:
12095 * @stream: a #GDataOutputStream.
12096 * @order: a %GDataStreamByteOrder.
12098 * Sets the byte order of the data output stream to @order.
12103 * g_dbus_action_group_get:
12104 * @connection: A #GDBusConnection
12105 * @bus_name: the bus name which exports the action group
12106 * @object_path: the object path at which the action group is exported
12108 * Obtains a #GDBusActionGroup for the action group which is exported at
12109 * the given @bus_name and @object_path.
12111 * The thread default main context is taken at the time of this call.
12112 * All signals on the menu model (and any linked models) are reported
12113 * with respect to this context. All calls on the returned menu model
12114 * (and linked models) must also originate from this same context, with
12115 * the thread default main context unchanged.
12117 * This call is non-blocking. The returned action group may or may not
12118 * already be filled in. The correct thing to do is connect the signals
12119 * for the action group to monitor for changes and then to call
12120 * g_action_group_list_actions() to get the initial list.
12122 * Returns: (transfer full): a #GDBusActionGroup
12128 * g_dbus_address_escape_value:
12129 * @string: an unescaped string to be included in a D-Bus address as the value in a key-value pair
12131 * Escape @string so it can appear in a D-Bus address as the value
12132 * part of a key-value pair.
12134 * For instance, if @string is <code>/run/bus-for-:0</code>,
12135 * this function would return <code>/run/bus-for-%3A0</code>,
12136 * which could be used in a D-Bus address like
12137 * <code>unix:nonce-tcp:host=127.0.0.1,port=42,noncefile=/run/bus-for-%3A0</code>.
12139 * Returns: (transfer full): a copy of @string with all non-optionally-escaped bytes escaped
12145 * g_dbus_address_get_for_bus_sync:
12146 * @bus_type: A #GBusType.
12147 * @cancellable: (allow-none): A #GCancellable or %NULL.
12148 * @error: Return location for error or %NULL.
12150 * Synchronously looks up the D-Bus address for the well-known message
12151 * bus instance specified by @bus_type. This may involve using various
12152 * platform specific mechanisms.
12154 * Returns: A valid D-Bus address string for @bus_type or %NULL if @error is set.
12160 * g_dbus_address_get_stream:
12161 * @address: A valid D-Bus address.
12162 * @cancellable: (allow-none): A #GCancellable or %NULL.
12163 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12164 * @user_data: Data to pass to @callback.
12166 * Asynchronously connects to an endpoint specified by @address and
12167 * sets up the connection so it is in a state to run the client-side
12168 * of the D-Bus authentication conversation.
12170 * When the operation is finished, @callback will be invoked. You can
12171 * then call g_dbus_address_get_stream_finish() to get the result of
12174 * This is an asynchronous failable function. See
12175 * g_dbus_address_get_stream_sync() for the synchronous version.
12182 * g_dbus_address_get_stream_finish:
12183 * @res: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
12184 * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12185 * @error: Return location for error or %NULL.
12187 * Finishes an operation started with g_dbus_address_get_stream().
12189 * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12195 * g_dbus_address_get_stream_sync:
12196 * @address: A valid D-Bus address.
12197 * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12198 * @cancellable: (allow-none): A #GCancellable or %NULL.
12199 * @error: Return location for error or %NULL.
12201 * Synchronously connects to an endpoint specified by @address and
12202 * sets up the connection so it is in a state to run the client-side
12203 * of the D-Bus authentication conversation.
12205 * This is a synchronous failable function. See
12206 * g_dbus_address_get_stream() for the asynchronous version.
12208 * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12214 * g_dbus_annotation_info_lookup:
12215 * @annotations: (array zero-terminated=1) (allow-none): A %NULL-terminated array of annotations or %NULL.
12216 * @name: The name of the annotation to look up.
12218 * Looks up the value of an annotation.
12220 * The cost of this function is O(n) in number of annotations.
12222 * Returns: The value or %NULL if not found. Do not free, it is owned by @annotations.
12228 * g_dbus_annotation_info_ref:
12229 * @info: A #GDBusNodeInfo
12231 * If @info is statically allocated does nothing. Otherwise increases
12232 * the reference count.
12234 * Returns: The same @info.
12240 * g_dbus_annotation_info_unref:
12241 * @info: A #GDBusAnnotationInfo.
12243 * If @info is statically allocated, does nothing. Otherwise decreases
12244 * the reference count of @info. When its reference count drops to 0,
12245 * the memory used is freed.
12252 * g_dbus_arg_info_ref:
12253 * @info: A #GDBusArgInfo
12255 * If @info is statically allocated does nothing. Otherwise increases
12256 * the reference count.
12258 * Returns: The same @info.
12264 * g_dbus_arg_info_unref:
12265 * @info: A #GDBusArgInfo.
12267 * If @info is statically allocated, does nothing. Otherwise decreases
12268 * the reference count of @info. When its reference count drops to 0,
12269 * the memory used is freed.
12276 * g_dbus_auth_observer_allow_mechanism:
12277 * @observer: A #GDBusAuthObserver.
12278 * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
12280 * Emits the #GDBusAuthObserver::allow-mechanism signal on @observer.
12282 * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
12288 * g_dbus_auth_observer_authorize_authenticated_peer:
12289 * @observer: A #GDBusAuthObserver.
12290 * @stream: A #GIOStream for the #GDBusConnection.
12291 * @credentials: (allow-none): Credentials received from the peer or %NULL.
12293 * Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
12295 * Returns: %TRUE if the peer is authorized, %FALSE if not.
12301 * g_dbus_auth_observer_new:
12303 * Creates a new #GDBusAuthObserver object.
12305 * Returns: A #GDBusAuthObserver. Free with g_object_unref().
12311 * g_dbus_connection_add_filter:
12312 * @connection: A #GDBusConnection.
12313 * @filter_function: A filter function.
12314 * @user_data: User data to pass to @filter_function.
12315 * @user_data_free_func: Function to free @user_data with when filter is removed or %NULL.
12317 * Adds a message filter. Filters are handlers that are run on all
12318 * incoming and outgoing messages, prior to standard dispatch. Filters
12319 * are run in the order that they were added. The same handler can be
12320 * added as a filter more than once, in which case it will be run more
12321 * than once. Filters added during a filter callback won't be run on
12322 * the message being processed. Filter functions are allowed to modify
12323 * and even drop messages.
12325 * Note that filters are run in a dedicated message handling thread so
12326 * they can't block and, generally, can't do anything but signal a
12327 * worker thread. Also note that filters are rarely needed - use API
12328 * such as g_dbus_connection_send_message_with_reply(),
12329 * g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
12331 * If a filter consumes an incoming message the message is not
12332 * dispatched anywhere else - not even the standard dispatch machinery
12333 * (that API such as g_dbus_connection_signal_subscribe() and
12334 * g_dbus_connection_send_message_with_reply() relies on) will see the
12335 * message. Similary, if a filter consumes an outgoing message, the
12336 * message will not be sent to the other peer.
12338 * Returns: A filter identifier that can be used with g_dbus_connection_remove_filter().
12344 * g_dbus_connection_call:
12345 * @connection: A #GDBusConnection.
12346 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12347 * @object_path: Path of remote object.
12348 * @interface_name: D-Bus interface to invoke method on.
12349 * @method_name: The name of the method to invoke.
12350 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12351 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12352 * @flags: Flags from the #GDBusCallFlags enumeration.
12353 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12354 * @cancellable: (allow-none): A #GCancellable or %NULL.
12355 * @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.
12356 * @user_data: The data to pass to @callback.
12358 * Asynchronously invokes the @method_name method on the
12359 * @interface_name D-Bus interface on the remote object at
12360 * @object_path owned by @bus_name.
12362 * If @connection is closed then the operation will fail with
12363 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
12364 * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
12365 * not compatible with the D-Bus protocol, the operation fails with
12366 * %G_IO_ERROR_INVALID_ARGUMENT.
12368 * If @reply_type is non-%NULL then the reply will be checked for having this type and an
12369 * error will be raised if it does not match. Said another way, if you give a @reply_type
12370 * then any non-%NULL return value will be of this type.
12372 * If the @parameters #GVariant is floating, it is consumed. This allows
12373 * convenient 'inline' use of g_variant_new(), e.g.:
12375 * g_dbus_connection_call (connection,
12376 * "org.freedesktop.StringThings",
12377 * "/org/freedesktop/StringThings",
12378 * "org.freedesktop.StringThings",
12380 * g_variant_new ("(ss)",
12384 * G_DBUS_CALL_FLAGS_NONE,
12387 * (GAsyncReadyCallback) two_strings_done,
12391 * This is an asynchronous method. When the operation is finished, @callback will be invoked
12392 * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
12393 * of the thread you are calling this method from. You can then call
12394 * g_dbus_connection_call_finish() to get the result of the operation.
12395 * See g_dbus_connection_call_sync() for the synchronous version of this
12398 * If @callback is %NULL then the D-Bus method call message will be sent with
12399 * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
12406 * g_dbus_connection_call_finish:
12407 * @connection: A #GDBusConnection.
12408 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
12409 * @error: Return location for error or %NULL.
12411 * Finishes an operation started with g_dbus_connection_call().
12413 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12419 * g_dbus_connection_call_sync:
12420 * @connection: A #GDBusConnection.
12421 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12422 * @object_path: Path of remote object.
12423 * @interface_name: D-Bus interface to invoke method on.
12424 * @method_name: The name of the method to invoke.
12425 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12426 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12427 * @flags: Flags from the #GDBusCallFlags enumeration.
12428 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12429 * @cancellable: (allow-none): A #GCancellable or %NULL.
12430 * @error: Return location for error or %NULL.
12432 * Synchronously invokes the @method_name method on the
12433 * @interface_name D-Bus interface on the remote object at
12434 * @object_path owned by @bus_name.
12436 * If @connection is closed then the operation will fail with
12437 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
12438 * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
12439 * contains a value not compatible with the D-Bus protocol, the operation
12440 * fails with %G_IO_ERROR_INVALID_ARGUMENT.
12442 * If @reply_type is non-%NULL then the reply will be checked for having
12443 * this type and an error will be raised if it does not match. Said
12444 * another way, if you give a @reply_type then any non-%NULL return
12445 * value will be of this type.
12447 * If the @parameters #GVariant is floating, it is consumed.
12448 * This allows convenient 'inline' use of g_variant_new(), e.g.:
12450 * g_dbus_connection_call_sync (connection,
12451 * "org.freedesktop.StringThings",
12452 * "/org/freedesktop/StringThings",
12453 * "org.freedesktop.StringThings",
12455 * g_variant_new ("(ss)",
12459 * G_DBUS_CALL_FLAGS_NONE,
12465 * The calling thread is blocked until a reply is received. See
12466 * g_dbus_connection_call() for the asynchronous version of
12469 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12475 * g_dbus_connection_call_with_unix_fd_list:
12476 * @connection: A #GDBusConnection.
12477 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12478 * @object_path: Path of remote object.
12479 * @interface_name: D-Bus interface to invoke method on.
12480 * @method_name: The name of the method to invoke.
12481 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12482 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12483 * @flags: Flags from the #GDBusCallFlags enumeration.
12484 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12485 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12486 * @cancellable: (allow-none): A #GCancellable or %NULL.
12487 * @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.
12488 * @user_data: The data to pass to @callback.
12490 * Like g_dbus_connection_call() but also takes a #GUnixFDList object.
12492 * This method is only available on UNIX.
12499 * g_dbus_connection_call_with_unix_fd_list_finish:
12500 * @connection: A #GDBusConnection.
12501 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12502 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
12503 * @error: Return location for error or %NULL.
12505 * Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
12507 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12513 * g_dbus_connection_call_with_unix_fd_list_sync:
12514 * @connection: A #GDBusConnection.
12515 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12516 * @object_path: Path of remote object.
12517 * @interface_name: D-Bus interface to invoke method on.
12518 * @method_name: The name of the method to invoke.
12519 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12520 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12521 * @flags: Flags from the #GDBusCallFlags enumeration.
12522 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12523 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12524 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12525 * @cancellable: (allow-none): A #GCancellable or %NULL.
12526 * @error: Return location for error or %NULL.
12528 * Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
12530 * This method is only available on UNIX.
12532 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12538 * g_dbus_connection_close:
12539 * @connection: A #GDBusConnection.
12540 * @cancellable: (allow-none): A #GCancellable or %NULL.
12541 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12542 * @user_data: The data to pass to @callback.
12544 * Closes @connection. Note that this never causes the process to
12545 * exit (this might only happen if the other end of a shared message
12546 * bus connection disconnects, see #GDBusConnection:exit-on-close).
12548 * Once the connection is closed, operations such as sending a message
12549 * will return with the error %G_IO_ERROR_CLOSED. Closing a connection
12550 * will not automatically flush the connection so queued messages may
12551 * be lost. Use g_dbus_connection_flush() if you need such guarantees.
12553 * If @connection is already closed, this method fails with
12554 * %G_IO_ERROR_CLOSED.
12556 * When @connection has been closed, the #GDBusConnection::closed
12557 * signal is emitted in the <link
12558 * linkend="g-main-context-push-thread-default">thread-default main
12559 * loop</link> of the thread that @connection was constructed in.
12561 * This is an asynchronous method. When the operation is finished,
12562 * @callback will be invoked in the <link
12563 * linkend="g-main-context-push-thread-default">thread-default main
12564 * loop</link> of the thread you are calling this method from. You can
12565 * then call g_dbus_connection_close_finish() to get the result of the
12566 * operation. See g_dbus_connection_close_sync() for the synchronous
12574 * g_dbus_connection_close_finish:
12575 * @connection: A #GDBusConnection.
12576 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
12577 * @error: Return location for error or %NULL.
12579 * Finishes an operation started with g_dbus_connection_close().
12581 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12587 * g_dbus_connection_close_sync:
12588 * @connection: A #GDBusConnection.
12589 * @cancellable: (allow-none): A #GCancellable or %NULL.
12590 * @error: Return location for error or %NULL.
12592 * Synchronously closees @connection. The calling thread is blocked
12593 * until this is done. See g_dbus_connection_close() for the
12594 * asynchronous version of this method and more details about what it
12597 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12603 * g_dbus_connection_emit_signal:
12604 * @connection: A #GDBusConnection.
12605 * @destination_bus_name: (allow-none): The unique bus name for the destination for the signal or %NULL to emit to all listeners.
12606 * @object_path: Path of remote object.
12607 * @interface_name: D-Bus interface to emit a signal on.
12608 * @signal_name: The name of the signal to emit.
12609 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
12610 * @error: Return location for error or %NULL.
12614 * If the parameters GVariant is floating, it is consumed.
12616 * This can only fail if @parameters is not compatible with the D-Bus protocol.
12618 * Returns: %TRUE unless @error is set.
12624 * g_dbus_connection_export_action_group:
12625 * @connection: a #GDBusConnection
12626 * @object_path: a D-Bus object path
12627 * @action_group: a #GActionGroup
12628 * @error: a pointer to a %NULL #GError, or %NULL
12630 * Exports @action_group on @connection at @object_path.
12632 * The implemented D-Bus API should be considered private. It is
12633 * subject to change in the future.
12635 * A given object path can only have one action group exported on it.
12636 * If this constraint is violated, the export will fail and 0 will be
12637 * returned (with @error set accordingly).
12639 * You can unexport the action group using
12640 * g_dbus_connection_unexport_action_group() with the return value of
12643 * The thread default main context is taken at the time of this call.
12644 * All incoming action activations and state change requests are
12645 * reported from this context. Any changes on the action group that
12646 * cause it to emit signals must also come from this same context.
12647 * Since incoming action activations and state change requests are
12648 * rather likely to cause changes on the action group, this effectively
12649 * limits a given action group to being exported from only one main
12652 * Returns: the ID of the export (never zero), or 0 in case of failure
12658 * g_dbus_connection_export_menu_model:
12659 * @connection: a #GDBusConnection
12660 * @object_path: a D-Bus object path
12661 * @menu: a #GMenuModel
12662 * @error: return location for an error, or %NULL
12664 * Exports @menu on @connection at @object_path.
12666 * The implemented D-Bus API should be considered private.
12667 * It is subject to change in the future.
12669 * An object path can only have one menu model exported on it. If this
12670 * constraint is violated, the export will fail and 0 will be
12671 * returned (with @error set accordingly).
12673 * You can unexport the menu model using
12674 * g_dbus_connection_unexport_menu_model() with the return value of
12677 * Returns: the ID of the export (never zero), or 0 in case of failure
12683 * g_dbus_connection_flush:
12684 * @connection: A #GDBusConnection.
12685 * @cancellable: (allow-none): A #GCancellable or %NULL.
12686 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12687 * @user_data: The data to pass to @callback.
12689 * Asynchronously flushes @connection, that is, writes all queued
12690 * outgoing message to the transport and then flushes the transport
12691 * (using g_output_stream_flush_async()). This is useful in programs
12692 * that wants to emit a D-Bus signal and then exit
12693 * immediately. Without flushing the connection, there is no guarantee
12694 * that the message has been sent to the networking buffers in the OS
12697 * This is an asynchronous method. When the operation is finished,
12698 * @callback will be invoked in the <link
12699 * linkend="g-main-context-push-thread-default">thread-default main
12700 * loop</link> of the thread you are calling this method from. You can
12701 * then call g_dbus_connection_flush_finish() to get the result of the
12702 * operation. See g_dbus_connection_flush_sync() for the synchronous
12710 * g_dbus_connection_flush_finish:
12711 * @connection: A #GDBusConnection.
12712 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
12713 * @error: Return location for error or %NULL.
12715 * Finishes an operation started with g_dbus_connection_flush().
12717 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12723 * g_dbus_connection_flush_sync:
12724 * @connection: A #GDBusConnection.
12725 * @cancellable: (allow-none): A #GCancellable or %NULL.
12726 * @error: Return location for error or %NULL.
12728 * Synchronously flushes @connection. The calling thread is blocked
12729 * until this is done. See g_dbus_connection_flush() for the
12730 * asynchronous version of this method and more details about what it
12733 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12739 * g_dbus_connection_get_capabilities:
12740 * @connection: A #GDBusConnection.
12742 * Gets the capabilities negotiated with the remote peer
12744 * Returns: Zero or more flags from the #GDBusCapabilityFlags enumeration.
12750 * g_dbus_connection_get_exit_on_close:
12751 * @connection: A #GDBusConnection.
12753 * Gets whether the process is terminated when @connection is
12754 * closed by the remote peer. See
12755 * #GDBusConnection:exit-on-close for more details.
12757 * Returns: Whether the process is terminated when @connection is closed by the remote peer.
12763 * g_dbus_connection_get_guid:
12764 * @connection: A #GDBusConnection.
12766 * The GUID of the peer performing the role of server when
12767 * authenticating. See #GDBusConnection:guid for more details.
12769 * Returns: The GUID. Do not free this string, it is owned by @connection.
12775 * g_dbus_connection_get_last_serial:
12776 * @connection: A #GDBusConnection.
12778 * Retrieves the last serial number assigned to a #GDBusMessage on
12779 * the current thread. This includes messages sent via both low-level
12780 * API such as g_dbus_connection_send_message() as well as
12781 * high-level API such as g_dbus_connection_emit_signal(),
12782 * g_dbus_connection_call() or g_dbus_proxy_call().
12784 * Returns: the last used serial or zero when no message has been sent within the current thread.
12790 * g_dbus_connection_get_peer_credentials:
12791 * @connection: A #GDBusConnection.
12793 * Gets the credentials of the authenticated peer. This will always
12794 * return %NULL unless @connection acted as a server
12795 * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
12796 * when set up and the client passed credentials as part of the
12797 * authentication process.
12799 * In a message bus setup, the message bus is always the server and
12800 * each application is a client. So this method will always return
12801 * %NULL for message bus clients.
12803 * Returns: (transfer none): A #GCredentials or %NULL if not available. Do not free this object, it is owned by @connection.
12809 * g_dbus_connection_get_stream:
12810 * @connection: a #GDBusConnection
12812 * Gets the underlying stream used for IO.
12814 * While the #GDBusConnection is active, it will interact with this
12815 * stream from a worker thread, so it is not safe to interact with
12816 * the stream directly.
12818 * Returns: (transfer none): the stream used for IO
12824 * g_dbus_connection_get_unique_name:
12825 * @connection: A #GDBusConnection.
12827 * Gets the unique name of @connection as assigned by the message
12828 * bus. This can also be used to figure out if @connection is a
12829 * message bus connection.
12831 * Returns: The unique name or %NULL if @connection is not a message bus connection. Do not free this string, it is owned by @connection.
12837 * g_dbus_connection_is_closed:
12838 * @connection: A #GDBusConnection.
12840 * Gets whether @connection is closed.
12842 * Returns: %TRUE if the connection is closed, %FALSE otherwise.
12848 * g_dbus_connection_new:
12849 * @stream: A #GIOStream.
12850 * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
12851 * @flags: Flags describing how to make the connection.
12852 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12853 * @cancellable: (allow-none): A #GCancellable or %NULL.
12854 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12855 * @user_data: The data to pass to @callback.
12857 * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
12858 * with the end represented by @stream.
12860 * If @stream is a #GSocketConnection, then the corresponding #GSocket
12861 * will be put into non-blocking mode.
12863 * The D-Bus connection will interact with @stream from a worker thread.
12864 * As a result, the caller should not interact with @stream after this
12865 * method has been called, except by calling g_object_unref() on it.
12867 * If @observer is not %NULL it may be used to control the
12868 * authentication process.
12870 * When the operation is finished, @callback will be invoked. You can
12871 * then call g_dbus_connection_new_finish() to get the result of the
12874 * This is a asynchronous failable constructor. See
12875 * g_dbus_connection_new_sync() for the synchronous
12883 * g_dbus_connection_new_finish:
12884 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
12885 * @error: Return location for error or %NULL.
12887 * Finishes an operation started with g_dbus_connection_new().
12889 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
12895 * g_dbus_connection_new_for_address:
12896 * @address: A D-Bus address.
12897 * @flags: Flags describing how to make the connection.
12898 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12899 * @cancellable: (allow-none): A #GCancellable or %NULL.
12900 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12901 * @user_data: The data to pass to @callback.
12903 * Asynchronously connects and sets up a D-Bus client connection for
12904 * exchanging D-Bus messages with an endpoint specified by @address
12905 * which must be in the D-Bus address format.
12907 * This constructor can only be used to initiate client-side
12908 * connections - use g_dbus_connection_new() if you need to act as the
12909 * server. In particular, @flags cannot contain the
12910 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
12911 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
12913 * When the operation is finished, @callback will be invoked. You can
12914 * then call g_dbus_connection_new_finish() to get the result of the
12917 * If @observer is not %NULL it may be used to control the
12918 * authentication process.
12920 * This is a asynchronous failable constructor. See
12921 * g_dbus_connection_new_for_address_sync() for the synchronous
12929 * g_dbus_connection_new_for_address_finish:
12930 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
12931 * @error: Return location for error or %NULL.
12933 * Finishes an operation started with g_dbus_connection_new_for_address().
12935 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
12941 * g_dbus_connection_new_for_address_sync:
12942 * @address: A D-Bus address.
12943 * @flags: Flags describing how to make the connection.
12944 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12945 * @cancellable: (allow-none): A #GCancellable or %NULL.
12946 * @error: Return location for error or %NULL.
12948 * Synchronously connects and sets up a D-Bus client connection for
12949 * exchanging D-Bus messages with an endpoint specified by @address
12950 * which must be in the D-Bus address format.
12952 * This constructor can only be used to initiate client-side
12953 * connections - use g_dbus_connection_new_sync() if you need to act
12954 * as the server. In particular, @flags cannot contain the
12955 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
12956 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
12958 * This is a synchronous failable constructor. See
12959 * g_dbus_connection_new_for_address() for the asynchronous version.
12961 * If @observer is not %NULL it may be used to control the
12962 * authentication process.
12964 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
12970 * g_dbus_connection_new_sync:
12971 * @stream: A #GIOStream.
12972 * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
12973 * @flags: Flags describing how to make the connection.
12974 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12975 * @cancellable: (allow-none): A #GCancellable or %NULL.
12976 * @error: Return location for error or %NULL.
12978 * Synchronously sets up a D-Bus connection for exchanging D-Bus messages
12979 * with the end represented by @stream.
12981 * If @stream is a #GSocketConnection, then the corresponding #GSocket
12982 * will be put into non-blocking mode.
12984 * The D-Bus connection will interact with @stream from a worker thread.
12985 * As a result, the caller should not interact with @stream after this
12986 * method has been called, except by calling g_object_unref() on it.
12988 * If @observer is not %NULL it may be used to control the
12989 * authentication process.
12991 * This is a synchronous failable constructor. See
12992 * g_dbus_connection_new() for the asynchronous version.
12994 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13000 * g_dbus_connection_register_object:
13001 * @connection: A #GDBusConnection.
13002 * @object_path: The object path to register at.
13003 * @interface_info: Introspection data for the interface.
13004 * @vtable: (allow-none): A #GDBusInterfaceVTable to call into or %NULL.
13005 * @user_data: (allow-none): Data to pass to functions in @vtable.
13006 * @user_data_free_func: Function to call when the object path is unregistered.
13007 * @error: Return location for error or %NULL.
13009 * Registers callbacks for exported objects at @object_path with the
13010 * D-Bus interface that is described in @interface_info.
13012 * Calls to functions in @vtable (and @user_data_free_func) will
13013 * happen in the <link linkend="g-main-context-push-thread-default">thread-default main
13014 * loop</link> of the thread you are calling this method from.
13016 * Note that all #GVariant values passed to functions in @vtable will match
13017 * the signature given in @interface_info - if a remote caller passes
13018 * incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
13019 * is returned to the remote caller.
13021 * Additionally, if the remote caller attempts to invoke methods or
13022 * access properties not mentioned in @interface_info the
13023 * <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
13024 * <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
13025 * are returned to the caller.
13027 * It is considered a programming error if the
13028 * #GDBusInterfaceGetPropertyFunc function in @vtable returns a
13029 * #GVariant of incorrect type.
13031 * If an existing callback is already registered at @object_path and
13032 * @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
13034 * GDBus automatically implements the standard D-Bus interfaces
13035 * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
13036 * and org.freedesktop.Peer, so you don't have to implement those for
13037 * the objects you export. You <emphasis>can</emphasis> implement
13038 * org.freedesktop.DBus.Properties yourself, e.g. to handle getting
13039 * and setting of properties asynchronously.
13041 * Note that the reference count on @interface_info will be
13042 * incremented by 1 (unless allocated statically, e.g. if the
13043 * reference count is -1, see g_dbus_interface_info_ref()) for as long
13044 * as the object is exported. Also note that @vtable will be copied.
13046 * See <xref linkend="gdbus-server"/> for an example of how to use this method.
13048 * Returns: 0 if @error is set, otherwise a registration id (never 0) that can be used with g_dbus_connection_unregister_object() .
13054 * g_dbus_connection_register_subtree:
13055 * @connection: A #GDBusConnection.
13056 * @object_path: The object path to register the subtree at.
13057 * @vtable: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
13058 * @flags: Flags used to fine tune the behavior of the subtree.
13059 * @user_data: Data to pass to functions in @vtable.
13060 * @user_data_free_func: Function to call when the subtree is unregistered.
13061 * @error: Return location for error or %NULL.
13063 * Registers a whole subtree of <quote>dynamic</quote> objects.
13065 * The @enumerate and @introspection functions in @vtable are used to
13066 * convey, to remote callers, what nodes exist in the subtree rooted
13069 * When handling remote calls into any node in the subtree, first the
13070 * @enumerate function is used to check if the node exists. If the node exists
13071 * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
13072 * the @introspection function is used to check if the node supports the
13073 * requested method. If so, the @dispatch function is used to determine
13074 * where to dispatch the call. The collected #GDBusInterfaceVTable and
13075 * #gpointer will be used to call into the interface vtable for processing
13078 * All calls into user-provided code will be invoked in the <link
13079 * linkend="g-main-context-push-thread-default">thread-default main
13080 * loop</link> of the thread you are calling this method from.
13082 * If an existing subtree is already registered at @object_path or
13083 * then @error is set to #G_IO_ERROR_EXISTS.
13085 * Note that it is valid to register regular objects (using
13086 * g_dbus_connection_register_object()) in a subtree registered with
13087 * g_dbus_connection_register_subtree() - if so, the subtree handler
13088 * is tried as the last resort. One way to think about a subtree
13089 * handler is to consider it a <quote>fallback handler</quote>
13090 * for object paths not registered via g_dbus_connection_register_object()
13091 * or other bindings.
13093 * Note that @vtable will be copied so you cannot change it after
13096 * See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
13098 * Returns: 0 if @error is set, otherwise a subtree registration id (never 0) that can be used with g_dbus_connection_unregister_subtree() .
13104 * g_dbus_connection_remove_filter:
13105 * @connection: a #GDBusConnection
13106 * @filter_id: an identifier obtained from g_dbus_connection_add_filter()
13108 * Removes a filter.
13115 * g_dbus_connection_send_message:
13116 * @connection: A #GDBusConnection.
13117 * @message: A #GDBusMessage
13118 * @flags: Flags affecting how the message is sent.
13119 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13120 * @error: Return location for error or %NULL.
13122 * Asynchronously sends @message to the peer represented by @connection.
13124 * Unless @flags contain the
13125 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13126 * will be assigned by @connection and set on @message via
13127 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13128 * serial number used will be written to this location prior to
13129 * submitting the message to the underlying transport.
13131 * If @connection is closed then the operation will fail with
13132 * %G_IO_ERROR_CLOSED. If @message is not well-formed,
13133 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13135 * See <xref linkend="gdbus-server"/> and <xref
13136 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13137 * low-level API to send and receive UNIX file descriptors.
13139 * Note that @message must be unlocked, unless @flags contain the
13140 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13142 * Returns: %TRUE if the message was well-formed and queued for transmission, %FALSE if @error is set.
13148 * g_dbus_connection_send_message_with_reply:
13149 * @connection: A #GDBusConnection.
13150 * @message: A #GDBusMessage.
13151 * @flags: Flags affecting how the message is sent.
13152 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13153 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13154 * @cancellable: (allow-none): A #GCancellable or %NULL.
13155 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13156 * @user_data: The data to pass to @callback.
13158 * Asynchronously sends @message to the peer represented by @connection.
13160 * Unless @flags contain the
13161 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13162 * will be assigned by @connection and set on @message via
13163 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13164 * serial number used will be written to this location prior to
13165 * submitting the message to the underlying transport.
13167 * If @connection is closed then the operation will fail with
13168 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13169 * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13170 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13172 * This is an asynchronous method. When the operation is finished, @callback will be invoked
13173 * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13174 * of the thread you are calling this method from. You can then call
13175 * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
13176 * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
13178 * Note that @message must be unlocked, unless @flags contain the
13179 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13181 * See <xref linkend="gdbus-server"/> and <xref
13182 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13183 * low-level API to send and receive UNIX file descriptors.
13190 * g_dbus_connection_send_message_with_reply_finish:
13191 * @connection: a #GDBusConnection
13192 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
13193 * @error: Return location for error or %NULL.
13195 * Finishes an operation started with g_dbus_connection_send_message_with_reply().
13197 * Note that @error is only set if a local in-process error
13198 * occurred. That is to say that the returned #GDBusMessage object may
13199 * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13200 * g_dbus_message_to_gerror() to transcode this to a #GError.
13202 * See <xref linkend="gdbus-server"/> and <xref
13203 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13204 * low-level API to send and receive UNIX file descriptors.
13206 * Returns: (transfer full): A locked #GDBusMessage or %NULL if @error is set.
13212 * g_dbus_connection_send_message_with_reply_sync:
13213 * @connection: A #GDBusConnection.
13214 * @message: A #GDBusMessage.
13215 * @flags: Flags affecting how the message is sent.
13216 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13217 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13218 * @cancellable: (allow-none): A #GCancellable or %NULL.
13219 * @error: Return location for error or %NULL.
13221 * Synchronously sends @message to the peer represented by @connection
13222 * and blocks the calling thread until a reply is received or the
13223 * timeout is reached. See g_dbus_connection_send_message_with_reply()
13224 * for the asynchronous version of this method.
13226 * Unless @flags contain the
13227 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13228 * will be assigned by @connection and set on @message via
13229 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13230 * serial number used will be written to this location prior to
13231 * submitting the message to the underlying transport.
13233 * If @connection is closed then the operation will fail with
13234 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13235 * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13236 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13238 * Note that @error is only set if a local in-process error
13239 * occurred. That is to say that the returned #GDBusMessage object may
13240 * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13241 * g_dbus_message_to_gerror() to transcode this to a #GError.
13243 * See <xref linkend="gdbus-server"/> and <xref
13244 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13245 * low-level API to send and receive UNIX file descriptors.
13247 * Note that @message must be unlocked, unless @flags contain the
13248 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13250 * Returns: (transfer full): A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
13256 * g_dbus_connection_set_exit_on_close:
13257 * @connection: A #GDBusConnection.
13258 * @exit_on_close: Whether the process should be terminated when @connection is closed by the remote peer.
13260 * Sets whether the process should be terminated when @connection is
13261 * closed by the remote peer. See #GDBusConnection:exit-on-close for
13264 * Note that this function should be used with care. Most modern UNIX
13265 * desktops tie the notion of a user session the session bus, and expect
13266 * all of a users applications to quit when their bus connection goes away.
13267 * If you are setting @exit_on_close to %FALSE for the shared session
13268 * bus connection, you should make sure that your application exits
13269 * when the user session ends.
13276 * g_dbus_connection_signal_subscribe:
13277 * @connection: A #GDBusConnection.
13278 * @sender: (allow-none): Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
13279 * @interface_name: (allow-none): D-Bus interface name to match on or %NULL to match on all interfaces.
13280 * @member: (allow-none): D-Bus signal name to match on or %NULL to match on all signals.
13281 * @object_path: (allow-none): Object path to match on or %NULL to match on all object paths.
13282 * @arg0: (allow-none): Contents of first string argument to match on or %NULL to match on all kinds of arguments.
13283 * @flags: Flags describing how to subscribe to the signal (currently unused).
13284 * @callback: Callback to invoke when there is a signal matching the requested data.
13285 * @user_data: User data to pass to @callback.
13286 * @user_data_free_func: (allow-none): Function to free @user_data with when subscription is removed or %NULL.
13288 * Subscribes to signals on @connection and invokes @callback with a
13289 * whenever the signal is received. Note that @callback
13290 * will be invoked in the <link
13291 * linkend="g-main-context-push-thread-default">thread-default main
13292 * loop</link> of the thread you are calling this method from.
13294 * If @connection is not a message bus connection, @sender must be
13297 * If @sender is a well-known name note that @callback is invoked with
13298 * the unique name for the owner of @sender, not the well-known name
13299 * as one would expect. This is because the message bus rewrites the
13300 * name. As such, to avoid certain race conditions, users should be
13301 * tracking the name owner of the well-known name and use that when
13302 * processing the received signal.
13304 * If one of %G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE or
13305 * %G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH are given, @arg0 is
13306 * interpreted as part of a namespace or path. The first argument
13307 * of a signal is matched against that part as specified by D-Bus.
13309 * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
13315 * g_dbus_connection_signal_unsubscribe:
13316 * @connection: A #GDBusConnection.
13317 * @subscription_id: A subscription id obtained from g_dbus_connection_signal_subscribe().
13319 * Unsubscribes from signals.
13326 * g_dbus_connection_start_message_processing:
13327 * @connection: A #GDBusConnection.
13329 * If @connection was created with
13330 * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
13331 * starts processing messages. Does nothing on if @connection wasn't
13332 * created with this flag or if the method has already been called.
13339 * g_dbus_connection_unexport_action_group:
13340 * @connection: a #GDBusConnection
13341 * @export_id: the ID from g_dbus_connection_export_action_group()
13343 * Reverses the effect of a previous call to
13344 * g_dbus_connection_export_action_group().
13346 * It is an error to call this function with an ID that wasn't returned
13347 * from g_dbus_connection_export_action_group() or to call it with the
13348 * same ID more than once.
13355 * g_dbus_connection_unexport_menu_model:
13356 * @connection: a #GDBusConnection
13357 * @export_id: the ID from g_dbus_connection_export_menu_model()
13359 * Reverses the effect of a previous call to
13360 * g_dbus_connection_export_menu_model().
13362 * It is an error to call this function with an ID that wasn't returned
13363 * from g_dbus_connection_export_menu_model() or to call it with the
13364 * same ID more than once.
13371 * g_dbus_connection_unregister_object:
13372 * @connection: A #GDBusConnection.
13373 * @registration_id: A registration id obtained from g_dbus_connection_register_object().
13375 * Unregisters an object.
13377 * Returns: %TRUE if the object was unregistered, %FALSE otherwise.
13383 * g_dbus_connection_unregister_subtree:
13384 * @connection: A #GDBusConnection.
13385 * @registration_id: A subtree registration id obtained from g_dbus_connection_register_subtree().
13387 * Unregisters a subtree.
13389 * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise.
13395 * g_dbus_error_encode_gerror:
13396 * @error: A #GError.
13398 * Creates a D-Bus error name to use for @error. If @error matches
13399 * a registered error (cf. g_dbus_error_register_error()), the corresponding
13400 * D-Bus error name will be returned.
13402 * Otherwise the a name of the form
13403 * <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
13404 * will be used. This allows other GDBus applications to map the error
13405 * on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
13407 * This function is typically only used in object mappings to put a
13408 * #GError on the wire. Regular applications should not use it.
13410 * Returns: A D-Bus error name (never %NULL). Free with g_free().
13416 * g_dbus_error_get_remote_error:
13417 * @error: A #GError.
13419 * Gets the D-Bus error name used for @error, if any.
13421 * This function is guaranteed to return a D-Bus error name for all
13422 * #GError<!-- -->s returned from functions handling remote method
13423 * calls (e.g. g_dbus_connection_call_finish()) unless
13424 * g_dbus_error_strip_remote_error() has been used on @error.
13426 * Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
13432 * g_dbus_error_is_remote_error:
13433 * @error: A #GError.
13435 * Checks if @error represents an error received via D-Bus from a remote peer. If so,
13436 * use g_dbus_error_get_remote_error() to get the name of the error.
13438 * Returns: %TRUE if @error represents an error from a remote peer, %FALSE otherwise.
13444 * g_dbus_error_new_for_dbus_error:
13445 * @dbus_error_name: D-Bus error name.
13446 * @dbus_error_message: D-Bus error message.
13448 * Creates a #GError based on the contents of @dbus_error_name and
13449 * @dbus_error_message.
13451 * Errors registered with g_dbus_error_register_error() will be looked
13452 * up using @dbus_error_name and if a match is found, the error domain
13453 * and code is used. Applications can use g_dbus_error_get_remote_error()
13454 * to recover @dbus_error_name.
13456 * If a match against a registered error is not found and the D-Bus
13457 * error name is in a form as returned by g_dbus_error_encode_gerror()
13458 * the error domain and code encoded in the name is used to
13459 * create the #GError. Also, @dbus_error_name is added to the error message
13460 * such that it can be recovered with g_dbus_error_get_remote_error().
13462 * Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
13463 * in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
13464 * added to the error message such that it can be recovered with
13465 * g_dbus_error_get_remote_error().
13467 * In all three cases, @dbus_error_name can always be recovered from the
13468 * returned #GError using the g_dbus_error_get_remote_error() function
13469 * (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
13471 * This function is typically only used in object mappings to prepare
13472 * #GError instances for applications. Regular applications should not use
13475 * Returns: An allocated #GError. Free with g_error_free().
13481 * g_dbus_error_register_error:
13482 * @error_domain: A #GQuark for a error domain.
13483 * @error_code: An error code.
13484 * @dbus_error_name: A D-Bus error name.
13486 * Creates an association to map between @dbus_error_name and
13487 * #GError<!-- -->s specified by @error_domain and @error_code.
13489 * This is typically done in the routine that returns the #GQuark for
13492 * Returns: %TRUE if the association was created, %FALSE if it already exists.
13498 * g_dbus_error_register_error_domain:
13499 * @error_domain_quark_name: The error domain name.
13500 * @quark_volatile: A pointer where to store the #GQuark.
13501 * @entries: A pointer to @num_entries #GDBusErrorEntry struct items.
13502 * @num_entries: Number of items to register.
13504 * Helper function for associating a #GError error domain with D-Bus error names.
13511 * g_dbus_error_set_dbus_error:
13512 * @error: A pointer to a #GError or %NULL.
13513 * @dbus_error_name: D-Bus error name.
13514 * @dbus_error_message: D-Bus error message.
13515 * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13516 * @...: Arguments for @format.
13518 * Does nothing if @error is %NULL. Otherwise sets *@error to
13519 * a new #GError created with g_dbus_error_new_for_dbus_error()
13520 * with @dbus_error_message prepend with @format (unless %NULL).
13527 * g_dbus_error_set_dbus_error_valist:
13528 * @error: A pointer to a #GError or %NULL.
13529 * @dbus_error_name: D-Bus error name.
13530 * @dbus_error_message: D-Bus error message.
13531 * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13532 * @var_args: Arguments for @format.
13534 * Like g_dbus_error_set_dbus_error() but intended for language bindings.
13541 * g_dbus_error_strip_remote_error:
13542 * @error: A #GError.
13544 * Looks for extra information in the error message used to recover
13545 * the D-Bus error name and strips it if found. If stripped, the
13546 * message field in @error will correspond exactly to what was
13547 * received on the wire.
13549 * This is typically used when presenting errors to the end user.
13551 * Returns: %TRUE if information was stripped, %FALSE otherwise.
13557 * g_dbus_error_unregister_error:
13558 * @error_domain: A #GQuark for a error domain.
13559 * @error_code: An error code.
13560 * @dbus_error_name: A D-Bus error name.
13562 * Destroys an association previously set up with g_dbus_error_register_error().
13564 * Returns: %TRUE if the association was destroyed, %FALSE if it wasn't found.
13570 * g_dbus_generate_guid:
13572 * Generate a D-Bus GUID that can be used with
13573 * e.g. g_dbus_connection_new().
13575 * See the D-Bus specification regarding what strings are valid D-Bus
13576 * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
13578 * Returns: A valid D-Bus GUID. Free with g_free().
13584 * g_dbus_gvalue_to_gvariant:
13585 * @gvalue: A #GValue to convert to a #GVariant.
13586 * @type: A #GVariantType.
13588 * Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
13590 * The conversion is using the following rules:
13591 * <table frame='all'>
13592 * <title>#GValue / #GVariant conversion rules</title>
13593 * <tgroup cols='2' align='left' colsep='1' rowsep='1'>
13596 * <entry>If the #GType for @gvalue is...</entry>
13597 * <entry>... then @type must be</entry>
13602 * <entry>#G_TYPE_STRING</entry>
13603 * <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>
13606 * <entry>#G_TYPE_STRV</entry>
13607 * <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>
13610 * <entry>#G_TYPE_BOOLEAN</entry>
13611 * <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
13614 * <entry>#G_TYPE_UCHAR</entry>
13615 * <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
13618 * <entry>#G_TYPE_INT</entry>
13619 * <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
13622 * <entry>#G_TYPE_UINT</entry>
13623 * <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
13626 * <entry>#G_TYPE_INT64</entry>
13627 * <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
13630 * <entry>#G_TYPE_UINT64</entry>
13631 * <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
13634 * <entry>#G_TYPE_DOUBLE</entry>
13635 * <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
13638 * <entry>#G_TYPE_VARIANT</entry>
13639 * <entry>Any #GVariantType</entry>
13644 * This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
13645 * is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
13646 * also fail for any #GType (including e.g. #G_TYPE_OBJECT and
13647 * #G_TYPE_BOXED derived-types) not in the table above.
13649 * Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
13650 * %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
13651 * %NULL) for @type is returned (e.g. 0 for scalar types, the empty
13652 * string for string types, <literal>'/'</literal> for object path
13653 * types, the empty array for any array type and so on).
13655 * See the g_dbus_gvariant_to_gvalue() function for how to convert a
13656 * #GVariant to a #GValue.
13658 * Returns: A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or %NULL in case of failure. Free with g_variant_unref().
13664 * g_dbus_gvariant_to_gvalue:
13665 * @value: A #GVariant.
13666 * @out_gvalue: (out): Return location pointing to a zero-filled (uninitialized) #GValue.
13668 * Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
13670 * The rules specified in the g_dbus_gvalue_to_gvariant() function are
13671 * used - this function is essentially its reverse form.
13673 * The conversion never fails - a valid #GValue is always returned in
13681 * g_dbus_interface_dup_object:
13682 * @interface_: An exported D-Bus interface.
13684 * Gets the #GDBusObject that @interface_ belongs to, if any.
13686 * Returns: (transfer full): A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
13688 * Rename to: g_dbus_interface_get_object
13693 * g_dbus_interface_get_info:
13694 * @interface_: An exported D-Bus interface.
13696 * Gets D-Bus introspection information for the D-Bus interface
13697 * implemented by @interface_.
13699 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
13705 * g_dbus_interface_get_object: (skip)
13706 * @interface_: An exported D-Bus interface.
13708 * Gets the #GDBusObject that @interface_ belongs to, if any.
13710 * <warning>It is not safe to use the returned object if @interface_
13711 * or the returned object is being used from other threads. See
13712 * g_dbus_interface_dup_object() for a thread-safe
13713 * alternative.</warning>
13715 * Returns: (transfer none): A #GDBusObject or %NULL. The returned reference belongs to @interface_ and should not be freed.
13721 * g_dbus_interface_info_cache_build:
13722 * @info: A #GDBusInterfaceInfo.
13724 * Builds a lookup-cache to speed up
13725 * g_dbus_interface_info_lookup_method(),
13726 * g_dbus_interface_info_lookup_signal() and
13727 * g_dbus_interface_info_lookup_property().
13729 * If this has already been called with @info, the existing cache is
13730 * used and its use count is increased.
13732 * Note that @info cannot be modified until
13733 * g_dbus_interface_info_cache_release() is called.
13740 * g_dbus_interface_info_cache_release:
13741 * @info: A GDBusInterfaceInfo
13743 * Decrements the usage count for the cache for @info built by
13744 * g_dbus_interface_info_cache_build() (if any) and frees the
13745 * resources used by the cache if the usage count drops to zero.
13752 * g_dbus_interface_info_generate_xml:
13753 * @info: A #GDBusNodeInfo
13754 * @indent: Indentation level.
13755 * @string_builder: (out): A #GString to to append XML data to.
13757 * Appends an XML representation of @info (and its children) to @string_builder.
13759 * This function is typically used for generating introspection XML
13760 * documents at run-time for handling the
13761 * <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
13769 * g_dbus_interface_info_lookup_method:
13770 * @info: A #GDBusInterfaceInfo.
13771 * @name: A D-Bus method name (typically in CamelCase)
13773 * Looks up information about a method.
13775 * The cost of this function is O(n) in number of methods unless
13776 * g_dbus_interface_info_cache_build() has been used on @info.
13778 * Returns: (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
13784 * g_dbus_interface_info_lookup_property:
13785 * @info: A #GDBusInterfaceInfo.
13786 * @name: A D-Bus property name (typically in CamelCase).
13788 * Looks up information about a property.
13790 * The cost of this function is O(n) in number of properties unless
13791 * g_dbus_interface_info_cache_build() has been used on @info.
13793 * Returns: (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
13799 * g_dbus_interface_info_lookup_signal:
13800 * @info: A #GDBusInterfaceInfo.
13801 * @name: A D-Bus signal name (typically in CamelCase)
13803 * Looks up information about a signal.
13805 * The cost of this function is O(n) in number of signals unless
13806 * g_dbus_interface_info_cache_build() has been used on @info.
13808 * Returns: (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
13814 * g_dbus_interface_info_ref:
13815 * @info: A #GDBusInterfaceInfo
13817 * If @info is statically allocated does nothing. Otherwise increases
13818 * the reference count.
13820 * Returns: The same @info.
13826 * g_dbus_interface_info_unref:
13827 * @info: A #GDBusInterfaceInfo.
13829 * If @info is statically allocated, does nothing. Otherwise decreases
13830 * the reference count of @info. When its reference count drops to 0,
13831 * the memory used is freed.
13838 * g_dbus_interface_set_object:
13839 * @interface_: An exported D-Bus interface.
13840 * @object: (allow-none): A #GDBusObject or %NULL.
13842 * Sets the #GDBusObject for @interface_ to @object.
13844 * Note that @interface_ will hold a weak reference to @object.
13851 * g_dbus_interface_skeleton_export:
13852 * @interface_: The D-Bus interface to export.
13853 * @connection: A #GDBusConnection to export @interface_ on.
13854 * @object_path: The path to export the interface at.
13855 * @error: Return location for error or %NULL.
13857 * Exports @interface_ at @object_path on @connection.
13859 * This can be called multiple times to export the same @interface_
13860 * onto multiple connections however the @object_path provided must be
13861 * the same for all connections.
13863 * Use g_dbus_interface_skeleton_unexport() to unexport the object.
13865 * Returns: %TRUE if the interface was exported on @connection, otherwise %FALSE with @error set.
13871 * g_dbus_interface_skeleton_flush:
13872 * @interface_: A #GDBusInterfaceSkeleton.
13874 * If @interface_ has outstanding changes, request for these changes to be
13875 * emitted immediately.
13877 * For example, an exported D-Bus interface may queue up property
13878 * changes and emit the
13879 * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
13880 * signal later (e.g. in an idle handler). This technique is useful
13881 * for collapsing multiple property changes into one.
13888 * g_dbus_interface_skeleton_get_connection:
13889 * @interface_: A #GDBusInterfaceSkeleton.
13891 * Gets the first connection that @interface_ is exported on, if any.
13893 * Returns: (transfer none): A #GDBusConnection or %NULL if @interface_ is not exported anywhere. Do not free, the object belongs to @interface_.
13899 * g_dbus_interface_skeleton_get_connections:
13900 * @interface_: A #GDBusInterfaceSkeleton.
13902 * Gets a list of the connections that @interface_ is exported on.
13904 * 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().
13910 * g_dbus_interface_skeleton_get_flags:
13911 * @interface_: A #GDBusInterfaceSkeleton.
13913 * Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
13916 * Returns: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
13922 * g_dbus_interface_skeleton_get_info:
13923 * @interface_: A #GDBusInterfaceSkeleton.
13925 * Gets D-Bus introspection information for the D-Bus interface
13926 * implemented by @interface_.
13928 * Returns: (transfer none): A #GDBusInterfaceInfo (never %NULL). Do not free.
13934 * g_dbus_interface_skeleton_get_object_path:
13935 * @interface_: A #GDBusInterfaceSkeleton.
13937 * Gets the object path that @interface_ is exported on, if any.
13939 * Returns: A string owned by @interface_ or %NULL if @interface_ is not exported anywhere. Do not free, the string belongs to @interface_.
13945 * g_dbus_interface_skeleton_get_properties:
13946 * @interface_: A #GDBusInterfaceSkeleton.
13948 * Gets all D-Bus properties for @interface_.
13950 * Returns: (transfer full): A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
13956 * g_dbus_interface_skeleton_get_vtable: (skip)
13957 * @interface_: A #GDBusInterfaceSkeleton.
13959 * Gets the interface vtable for the D-Bus interface implemented by
13960 * @interface_. The returned function pointers should expect @interface_
13961 * itself to be passed as @user_data.
13963 * Returns: A #GDBusInterfaceVTable (never %NULL).
13969 * g_dbus_interface_skeleton_has_connection:
13970 * @interface_: A #GDBusInterfaceSkeleton.
13971 * @connection: A #GDBusConnection.
13973 * Checks if @interface_ is exported on @connection.
13975 * Returns: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
13981 * g_dbus_interface_skeleton_set_flags:
13982 * @interface_: A #GDBusInterfaceSkeleton.
13983 * @flags: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
13985 * Sets flags describing what the behavior of @skeleton should be.
13992 * g_dbus_interface_skeleton_unexport:
13993 * @interface_: A #GDBusInterfaceSkeleton.
13995 * Stops exporting @interface_ on all connections it is exported on.
13997 * To unexport @interface_ from only a single connection, use
13998 * g_dbus_interface_skeleton_unexport_from_connection()
14005 * g_dbus_interface_skeleton_unexport_from_connection:
14006 * @interface_: A #GDBusInterfaceSkeleton.
14007 * @connection: A #GDBusConnection.
14009 * Stops exporting @interface_ on @connection.
14011 * To stop exporting on all connections the interface is exported on,
14012 * use g_dbus_interface_skeleton_unexport().
14019 * g_dbus_is_address:
14020 * @string: A string.
14022 * Checks if @string is a D-Bus address.
14024 * This doesn't check if @string is actually supported by #GDBusServer
14025 * or #GDBusConnection - use g_dbus_is_supported_address() to do more
14028 * Returns: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
14035 * @string: The string to check.
14037 * Checks if @string is a D-Bus GUID.
14039 * See the D-Bus specification regarding what strings are valid D-Bus
14040 * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
14042 * Returns: %TRUE if @string is a guid, %FALSE otherwise.
14048 * g_dbus_is_interface_name:
14049 * @string: The string to check.
14051 * Checks if @string is a valid D-Bus interface name.
14053 * Returns: %TRUE if valid, %FALSE otherwise.
14059 * g_dbus_is_member_name:
14060 * @string: The string to check.
14062 * Checks if @string is a valid D-Bus member (e.g. signal or method) name.
14064 * Returns: %TRUE if valid, %FALSE otherwise.
14071 * @string: The string to check.
14073 * Checks if @string is a valid D-Bus bus name (either unique or well-known).
14075 * Returns: %TRUE if valid, %FALSE otherwise.
14081 * g_dbus_is_supported_address:
14082 * @string: A string.
14083 * @error: Return location for error or %NULL.
14085 * Like g_dbus_is_address() but also checks if the library suppors the
14086 * transports in @string and that key/value pairs for each transport
14089 * Returns: %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set.
14095 * g_dbus_is_unique_name:
14096 * @string: The string to check.
14098 * Checks if @string is a valid D-Bus unique bus name.
14100 * Returns: %TRUE if valid, %FALSE otherwise.
14106 * g_dbus_menu_model_get:
14107 * @connection: a #GDBusConnection
14108 * @bus_name: the bus name which exports the menu model
14109 * @object_path: the object path at which the menu model is exported
14111 * Obtains a #GDBusMenuModel for the menu model which is exported
14112 * at the given @bus_name and @object_path.
14114 * The thread default main context is taken at the time of this call.
14115 * All signals on the menu model (and any linked models) are reported
14116 * with respect to this context. All calls on the returned menu model
14117 * (and linked models) must also originate from this same context, with
14118 * the thread default main context unchanged.
14120 * Returns: (transfer full): a #GDBusMenuModel object. Free with g_object_unref().
14126 * g_dbus_message_bytes_needed:
14127 * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14128 * @blob_len: The length of @blob (must be at least 16).
14129 * @error: Return location for error or %NULL.
14131 * Utility function to calculate how many bytes are needed to
14132 * completely deserialize the D-Bus message stored at @blob.
14134 * 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).
14140 * g_dbus_message_copy:
14141 * @message: A #GDBusMessage.
14142 * @error: Return location for error or %NULL.
14144 * Copies @message. The copy is a deep copy and the returned
14145 * #GDBusMessage is completely identical except that it is guaranteed
14146 * to not be locked.
14148 * This operation can fail if e.g. @message contains file descriptors
14149 * and the per-process or system-wide open files limit is reached.
14151 * Returns: (transfer full): A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14157 * g_dbus_message_get_arg0:
14158 * @message: A #GDBusMessage.
14160 * Convenience to get the first item in the body of @message.
14162 * Returns: The string item or %NULL if the first item in the body of @message is not a string.
14168 * g_dbus_message_get_body:
14169 * @message: A #GDBusMessage.
14171 * Gets the body of a message.
14173 * Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
14179 * g_dbus_message_get_byte_order:
14180 * @message: A #GDBusMessage.
14182 * Gets the byte order of @message.
14184 * Returns: The byte order.
14189 * g_dbus_message_get_destination:
14190 * @message: A #GDBusMessage.
14192 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14194 * Returns: The value.
14200 * g_dbus_message_get_error_name:
14201 * @message: A #GDBusMessage.
14203 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14205 * Returns: The value.
14211 * g_dbus_message_get_flags:
14212 * @message: A #GDBusMessage.
14214 * Gets the flags for @message.
14216 * Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14222 * g_dbus_message_get_header:
14223 * @message: A #GDBusMessage.
14224 * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14226 * Gets a header field on @message.
14228 * Returns: A #GVariant with the value if the header was found, %NULL otherwise. Do not free, it is owned by @message.
14234 * g_dbus_message_get_header_fields:
14235 * @message: A #GDBusMessage.
14237 * Gets an array of all header fields on @message that are set.
14239 * 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().
14245 * g_dbus_message_get_interface:
14246 * @message: A #GDBusMessage.
14248 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14250 * Returns: The value.
14256 * g_dbus_message_get_locked:
14257 * @message: A #GDBusMessage.
14259 * Checks whether @message is locked. To monitor changes to this
14260 * value, conncet to the #GObject::notify signal to listen for changes
14261 * on the #GDBusMessage:locked property.
14263 * Returns: %TRUE if @message is locked, %FALSE otherwise.
14269 * g_dbus_message_get_member:
14270 * @message: A #GDBusMessage.
14272 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14274 * Returns: The value.
14280 * g_dbus_message_get_message_type:
14281 * @message: A #GDBusMessage.
14283 * Gets the type of @message.
14285 * Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14291 * g_dbus_message_get_num_unix_fds:
14292 * @message: A #GDBusMessage.
14294 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14296 * Returns: The value.
14302 * g_dbus_message_get_path:
14303 * @message: A #GDBusMessage.
14305 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14307 * Returns: The value.
14313 * g_dbus_message_get_reply_serial:
14314 * @message: A #GDBusMessage.
14316 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14318 * Returns: The value.
14324 * g_dbus_message_get_sender:
14325 * @message: A #GDBusMessage.
14327 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14329 * Returns: The value.
14335 * g_dbus_message_get_serial:
14336 * @message: A #GDBusMessage.
14338 * Gets the serial for @message.
14340 * Returns: A #guint32.
14346 * g_dbus_message_get_signature:
14347 * @message: A #GDBusMessage.
14349 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14351 * Returns: The value.
14357 * g_dbus_message_get_unix_fd_list:
14358 * @message: A #GDBusMessage.
14360 * Gets the UNIX file descriptors associated with @message, if any.
14362 * This method is only available on UNIX.
14364 * Returns: (transfer none): A #GUnixFDList or %NULL if no file descriptors are associated. Do not free, this object is owned by @message.
14370 * g_dbus_message_lock:
14371 * @message: A #GDBusMessage.
14373 * If @message is locked, does nothing. Otherwise locks the message.
14380 * g_dbus_message_new:
14382 * Creates a new empty #GDBusMessage.
14384 * Returns: A #GDBusMessage. Free with g_object_unref().
14390 * g_dbus_message_new_from_blob:
14391 * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14392 * @blob_len: The length of @blob.
14393 * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14394 * @error: Return location for error or %NULL.
14396 * Creates a new #GDBusMessage from the data stored at @blob. The byte
14397 * order that the message was in can be retrieved using
14398 * g_dbus_message_get_byte_order().
14400 * Returns: A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14406 * g_dbus_message_new_method_call:
14407 * @name: (allow-none): A valid D-Bus name or %NULL.
14408 * @path: A valid object path.
14409 * @interface_: (allow-none): A valid D-Bus interface name or %NULL.
14410 * @method: A valid method name.
14412 * Creates a new #GDBusMessage for a method call.
14414 * Returns: A #GDBusMessage. Free with g_object_unref().
14420 * g_dbus_message_new_method_error:
14421 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14422 * @error_name: A valid D-Bus error name.
14423 * @error_message_format: The D-Bus error message in a printf() format.
14424 * @...: Arguments for @error_message_format.
14426 * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14428 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14434 * g_dbus_message_new_method_error_literal:
14435 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14436 * @error_name: A valid D-Bus error name.
14437 * @error_message: The D-Bus error message.
14439 * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14441 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14447 * g_dbus_message_new_method_error_valist:
14448 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14449 * @error_name: A valid D-Bus error name.
14450 * @error_message_format: The D-Bus error message in a printf() format.
14451 * @var_args: Arguments for @error_message_format.
14453 * Like g_dbus_message_new_method_error() but intended for language bindings.
14455 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14461 * g_dbus_message_new_method_reply:
14462 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14464 * Creates a new #GDBusMessage that is a reply to @method_call_message.
14466 * Returns: (transfer full): #GDBusMessage. Free with g_object_unref().
14472 * g_dbus_message_new_signal:
14473 * @path: A valid object path.
14474 * @interface_: A valid D-Bus interface name.
14475 * @signal: A valid signal name.
14477 * Creates a new #GDBusMessage for a signal emission.
14479 * Returns: A #GDBusMessage. Free with g_object_unref().
14485 * g_dbus_message_print:
14486 * @message: A #GDBusMessage.
14487 * @indent: Indentation level.
14489 * Produces a human-readable multi-line description of @message.
14491 * The contents of the description has no ABI guarantees, the contents
14492 * and formatting is subject to change at any time. Typical output
14493 * looks something like this:
14495 * Type: method-call
14496 * Flags: none
14500 * path -> objectpath '/org/gtk/GDBus/TestObject'
14501 * interface -> 'org.gtk.GDBus.TestInterface'
14502 * member -> 'GimmeStdout'
14503 * destination -> ':1.146'
14505 * UNIX File Descriptors:
14507 * </programlisting>
14510 * Type: method-return
14511 * Flags: no-reply-expected
14513 * Serial: 477
14515 * reply-serial -> uint32 4
14516 * destination -> ':1.159'
14517 * sender -> ':1.146'
14518 * num-unix-fds -> uint32 1
14520 * UNIX File Descriptors:
14521 * fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
14522 * </programlisting>
14524 * Returns: A string that should be freed with g_free().
14530 * g_dbus_message_set_body:
14531 * @message: A #GDBusMessage.
14532 * @body: Either %NULL or a #GVariant that is a tuple.
14534 * Sets the body @message. As a side-effect the
14535 * %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
14536 * type string of @body (or cleared if @body is %NULL).
14538 * If @body is floating, @message assumes ownership of @body.
14545 * g_dbus_message_set_byte_order:
14546 * @message: A #GDBusMessage.
14547 * @byte_order: The byte order.
14549 * Sets the byte order of @message.
14554 * g_dbus_message_set_destination:
14555 * @message: A #GDBusMessage.
14556 * @value: The value to set.
14558 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14565 * g_dbus_message_set_error_name:
14566 * @message: A #GDBusMessage.
14567 * @value: The value to set.
14569 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14576 * g_dbus_message_set_flags:
14577 * @message: A #GDBusMessage.
14578 * @flags: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14580 * Sets the flags to set on @message.
14587 * g_dbus_message_set_header:
14588 * @message: A #GDBusMessage.
14589 * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14590 * @value: (allow-none): A #GVariant to set the header field or %NULL to clear the header field.
14592 * Sets a header field on @message.
14594 * If @value is floating, @message assumes ownership of @value.
14601 * g_dbus_message_set_interface:
14602 * @message: A #GDBusMessage.
14603 * @value: The value to set.
14605 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14612 * g_dbus_message_set_member:
14613 * @message: A #GDBusMessage.
14614 * @value: The value to set.
14616 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14623 * g_dbus_message_set_message_type:
14624 * @message: A #GDBusMessage.
14625 * @type: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14627 * Sets @message to be of @type.
14634 * g_dbus_message_set_num_unix_fds:
14635 * @message: A #GDBusMessage.
14636 * @value: The value to set.
14638 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14645 * g_dbus_message_set_path:
14646 * @message: A #GDBusMessage.
14647 * @value: The value to set.
14649 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14656 * g_dbus_message_set_reply_serial:
14657 * @message: A #GDBusMessage.
14658 * @value: The value to set.
14660 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14667 * g_dbus_message_set_sender:
14668 * @message: A #GDBusMessage.
14669 * @value: The value to set.
14671 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14678 * g_dbus_message_set_serial:
14679 * @message: A #GDBusMessage.
14680 * @serial: A #guint32.
14682 * Sets the serial for @message.
14689 * g_dbus_message_set_signature:
14690 * @message: A #GDBusMessage.
14691 * @value: The value to set.
14693 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14700 * g_dbus_message_set_unix_fd_list:
14701 * @message: A #GDBusMessage.
14702 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
14704 * Sets the UNIX file descriptors associated with @message. As a
14705 * side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
14706 * field is set to the number of fds in @fd_list (or cleared if
14707 * @fd_list is %NULL).
14709 * This method is only available on UNIX.
14716 * g_dbus_message_to_blob:
14717 * @message: A #GDBusMessage.
14718 * @out_size: Return location for size of generated blob.
14719 * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14720 * @error: Return location for error.
14722 * Serializes @message to a blob. The byte order returned by
14723 * g_dbus_message_get_byte_order() will be used.
14725 * 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().
14731 * g_dbus_message_to_gerror:
14732 * @message: A #GDBusMessage.
14733 * @error: The #GError to set.
14735 * If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
14736 * nothing and returns %FALSE.
14738 * Otherwise this method encodes the error in @message as a #GError
14739 * using g_dbus_error_set_dbus_error() using the information in the
14740 * %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
14741 * well as the first string item in @message's body.
14743 * Returns: %TRUE if @error was set, %FALSE otherwise.
14749 * g_dbus_method_info_ref:
14750 * @info: A #GDBusMethodInfo
14752 * If @info is statically allocated does nothing. Otherwise increases
14753 * the reference count.
14755 * Returns: The same @info.
14761 * g_dbus_method_info_unref:
14762 * @info: A #GDBusMethodInfo.
14764 * If @info is statically allocated, does nothing. Otherwise decreases
14765 * the reference count of @info. When its reference count drops to 0,
14766 * the memory used is freed.
14773 * g_dbus_method_invocation_get_connection:
14774 * @invocation: A #GDBusMethodInvocation.
14776 * Gets the #GDBusConnection the method was invoked on.
14778 * Returns: (transfer none): A #GDBusConnection. Do not free, it is owned by @invocation.
14784 * g_dbus_method_invocation_get_interface_name:
14785 * @invocation: A #GDBusMethodInvocation.
14787 * Gets the name of the D-Bus interface the method was invoked on.
14789 * If this method call is a property Get, Set or GetAll call that has
14790 * been redirected to the method call handler then
14791 * "org.freedesktop.DBus.Properties" will be returned. See
14792 * #GDBusInterfaceVTable for more information.
14794 * Returns: A string. Do not free, it is owned by @invocation.
14800 * g_dbus_method_invocation_get_message:
14801 * @invocation: A #GDBusMethodInvocation.
14803 * Gets the #GDBusMessage for the method invocation. This is useful if
14804 * you need to use low-level protocol features, such as UNIX file
14805 * descriptor passing, that cannot be properly expressed in the
14808 * See <xref linkend="gdbus-server"/> and <xref
14809 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
14810 * low-level API to send and receive UNIX file descriptors.
14812 * Returns: (transfer none): #GDBusMessage. Do not free, it is owned by @invocation.
14818 * g_dbus_method_invocation_get_method_info:
14819 * @invocation: A #GDBusMethodInvocation.
14821 * Gets information about the method call, if any.
14823 * If this method invocation is a property Get, Set or GetAll call that
14824 * has been redirected to the method call handler then %NULL will be
14825 * returned. See g_dbus_method_invocation_get_property_info() and
14826 * #GDBusInterfaceVTable for more information.
14828 * Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
14834 * g_dbus_method_invocation_get_method_name:
14835 * @invocation: A #GDBusMethodInvocation.
14837 * Gets the name of the method that was invoked.
14839 * Returns: A string. Do not free, it is owned by @invocation.
14845 * g_dbus_method_invocation_get_object_path:
14846 * @invocation: A #GDBusMethodInvocation.
14848 * Gets the object path the method was invoked on.
14850 * Returns: A string. Do not free, it is owned by @invocation.
14856 * g_dbus_method_invocation_get_parameters:
14857 * @invocation: A #GDBusMethodInvocation.
14859 * Gets the parameters of the method invocation. If there are no input
14860 * parameters then this will return a GVariant with 0 children rather than NULL.
14862 * Returns: (transfer none): A #GVariant tuple. Do not unref this because it is owned by @invocation.
14868 * g_dbus_method_invocation_get_property_info:
14869 * @invocation: A #GDBusMethodInvocation
14871 * Gets information about the property that this method call is for, if
14874 * This will only be set in the case of an invocation in response to a
14875 * property Get or Set call that has been directed to the method call
14876 * handler for an object on account of its property_get() or
14877 * property_set() vtable pointers being unset.
14879 * See #GDBusInterfaceVTable for more information.
14881 * If the call was GetAll, %NULL will be returned.
14883 * Returns: (transfer none): a #GDBusPropertyInfo or %NULL
14889 * g_dbus_method_invocation_get_sender:
14890 * @invocation: A #GDBusMethodInvocation.
14892 * Gets the bus name that invoked the method.
14894 * Returns: A string. Do not free, it is owned by @invocation.
14900 * g_dbus_method_invocation_get_user_data: (skip)
14901 * @invocation: A #GDBusMethodInvocation.
14903 * Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
14905 * Returns: A #gpointer.
14911 * g_dbus_method_invocation_return_dbus_error:
14912 * @invocation: (transfer full): A #GDBusMethodInvocation.
14913 * @error_name: A valid D-Bus error name.
14914 * @error_message: A valid D-Bus error message.
14916 * Finishes handling a D-Bus method call by returning an error.
14918 * This method will free @invocation, you cannot use it afterwards.
14925 * g_dbus_method_invocation_return_error:
14926 * @invocation: (transfer full): A #GDBusMethodInvocation.
14927 * @domain: A #GQuark for the #GError error domain.
14928 * @code: The error code.
14929 * @format: printf()-style format.
14930 * @...: Parameters for @format.
14932 * Finishes handling a D-Bus method call by returning an error.
14934 * See g_dbus_error_encode_gerror() for details about what error name
14935 * will be returned on the wire. In a nutshell, if the given error is
14936 * registered using g_dbus_error_register_error() the name given
14937 * during registration is used. Otherwise, a name of the form
14938 * <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
14939 * used. This provides transparent mapping of #GError between
14940 * applications using GDBus.
14942 * If you are writing an application intended to be portable,
14943 * <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
14944 * or use g_dbus_method_invocation_return_dbus_error().
14946 * This method will free @invocation, you cannot use it afterwards.
14953 * g_dbus_method_invocation_return_error_literal:
14954 * @invocation: (transfer full): A #GDBusMethodInvocation.
14955 * @domain: A #GQuark for the #GError error domain.
14956 * @code: The error code.
14957 * @message: The error message.
14959 * Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
14961 * This method will free @invocation, you cannot use it afterwards.
14968 * g_dbus_method_invocation_return_error_valist:
14969 * @invocation: (transfer full): A #GDBusMethodInvocation.
14970 * @domain: A #GQuark for the #GError error domain.
14971 * @code: The error code.
14972 * @format: printf()-style format.
14973 * @var_args: #va_list of parameters for @format.
14975 * Like g_dbus_method_invocation_return_error() but intended for
14976 * language bindings.
14978 * This method will free @invocation, you cannot use it afterwards.
14985 * g_dbus_method_invocation_return_gerror:
14986 * @invocation: (transfer full): A #GDBusMethodInvocation.
14987 * @error: A #GError.
14989 * Like g_dbus_method_invocation_return_error() but takes a #GError
14990 * instead of the error domain, error code and message.
14992 * This method will free @invocation, you cannot use it afterwards.
14999 * g_dbus_method_invocation_return_value:
15000 * @invocation: (transfer full): A #GDBusMethodInvocation.
15001 * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15003 * Finishes handling a D-Bus method call by returning @parameters.
15004 * If the @parameters GVariant is floating, it is consumed.
15006 * It is an error if @parameters is not of the right format.
15008 * This method will free @invocation, you cannot use it afterwards.
15015 * g_dbus_method_invocation_return_value_with_unix_fd_list:
15016 * @invocation: (transfer full): A #GDBusMethodInvocation.
15017 * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15018 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15020 * Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
15022 * This method is only available on UNIX.
15024 * This method will free @invocation, you cannot use it afterwards.
15031 * g_dbus_method_invocation_take_error: (skip)
15032 * @invocation: (transfer full): A #GDBusMethodInvocation.
15033 * @error: (transfer full): A #GError.
15035 * Like g_dbus_method_invocation_return_gerror() but takes ownership
15036 * of @error so the caller does not need to free it.
15038 * This method will free @invocation, you cannot use it afterwards.
15045 * g_dbus_node_info_generate_xml:
15046 * @info: A #GDBusNodeInfo.
15047 * @indent: Indentation level.
15048 * @string_builder: (out): A #GString to to append XML data to.
15050 * Appends an XML representation of @info (and its children) to @string_builder.
15052 * This function is typically used for generating introspection XML documents at run-time for
15053 * handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
15060 * g_dbus_node_info_lookup_interface:
15061 * @info: A #GDBusNodeInfo.
15062 * @name: A D-Bus interface name.
15064 * Looks up information about an interface.
15066 * The cost of this function is O(n) in number of interfaces.
15068 * Returns: (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
15074 * g_dbus_node_info_new_for_xml:
15075 * @xml_data: Valid D-Bus introspection XML.
15076 * @error: Return location for error.
15078 * Parses @xml_data and returns a #GDBusNodeInfo representing the data.
15080 * The introspection XML must contain exactly one top-level
15081 * <tag class="starttag">node</tag> element.
15083 * Note that this routine is using a
15084 * <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
15085 * parser that only accepts a subset of valid XML documents.
15087 * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free with g_dbus_node_info_unref().
15093 * g_dbus_node_info_ref:
15094 * @info: A #GDBusNodeInfo
15096 * If @info is statically allocated does nothing. Otherwise increases
15097 * the reference count.
15099 * Returns: The same @info.
15105 * g_dbus_node_info_unref:
15106 * @info: A #GDBusNodeInfo.
15108 * If @info is statically allocated, does nothing. Otherwise decreases
15109 * the reference count of @info. When its reference count drops to 0,
15110 * the memory used is freed.
15117 * g_dbus_object_get_interface:
15118 * @object: A #GDBusObject.
15119 * @interface_name: A D-Bus interface name.
15121 * Gets the D-Bus interface with name @interface_name associated with
15124 * Returns: (transfer full): %NULL if not found, otherwise a #GDBusInterface that must be freed with g_object_unref().
15130 * g_dbus_object_get_interfaces:
15131 * @object: A #GDBusObject.
15133 * Gets the D-Bus interfaces associated with @object.
15135 * 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().
15141 * g_dbus_object_get_object_path:
15142 * @object: A #GDBusObject.
15144 * Gets the object path for @object.
15146 * Returns: A string owned by @object. Do not free.
15152 * g_dbus_object_manager_client_get_connection:
15153 * @manager: A #GDBusObjectManagerClient
15155 * Gets the #GDBusConnection used by @manager.
15157 * Returns: (transfer none): A #GDBusConnection object. Do not free, the object belongs to @manager.
15163 * g_dbus_object_manager_client_get_flags:
15164 * @manager: A #GDBusObjectManagerClient
15166 * Gets the flags that @manager was constructed with.
15168 * Returns: Zero of more flags from the #GDBusObjectManagerClientFlags enumeration.
15174 * g_dbus_object_manager_client_get_name:
15175 * @manager: A #GDBusObjectManagerClient
15177 * Gets the name that @manager is for, or %NULL if not a message bus
15180 * Returns: A unique or well-known name. Do not free, the string belongs to @manager.
15186 * g_dbus_object_manager_client_get_name_owner:
15187 * @manager: A #GDBusObjectManagerClient.
15189 * The unique name that owns the name that @manager is for or %NULL if
15190 * no-one currently owns that name. You can connect to the
15191 * #GObject::notify signal to track changes to the
15192 * #GDBusObjectManagerClient:name-owner property.
15194 * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15200 * g_dbus_object_manager_client_new:
15201 * @connection: A #GDBusConnection.
15202 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15203 * @name: The owner of the control object (unique or well-known name).
15204 * @object_path: The object path of the control object.
15205 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15206 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15207 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15208 * @cancellable: (allow-none): A #GCancellable or %NULL
15209 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15210 * @user_data: The data to pass to @callback.
15212 * Asynchronously creates a new #GDBusObjectManagerClient object.
15214 * This is an asynchronous failable constructor. When the result is
15215 * ready, @callback will be invoked in the
15216 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15217 * of the thread you are calling this method from. You can
15218 * then call g_dbus_object_manager_client_new_finish() to get the result. See
15219 * g_dbus_object_manager_client_new_sync() for the synchronous version.
15226 * g_dbus_object_manager_client_new_finish:
15227 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
15228 * @error: Return location for error or %NULL.
15230 * Finishes an operation started with g_dbus_object_manager_client_new().
15232 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15238 * g_dbus_object_manager_client_new_for_bus:
15239 * @bus_type: A #GBusType.
15240 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15241 * @name: The owner of the control object (unique or well-known name).
15242 * @object_path: The object path of the control object.
15243 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15244 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15245 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15246 * @cancellable: (allow-none): A #GCancellable or %NULL
15247 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15248 * @user_data: The data to pass to @callback.
15250 * Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
15251 * #GDBusConnection.
15253 * This is an asynchronous failable constructor. When the result is
15254 * ready, @callback will be invoked in the
15255 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15256 * of the thread you are calling this method from. You can
15257 * then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
15258 * g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
15265 * g_dbus_object_manager_client_new_for_bus_finish:
15266 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
15267 * @error: Return location for error or %NULL.
15269 * Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
15271 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15277 * g_dbus_object_manager_client_new_for_bus_sync:
15278 * @bus_type: A #GBusType.
15279 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15280 * @name: The owner of the control object (unique or well-known name).
15281 * @object_path: The object path of the control object.
15282 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15283 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15284 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15285 * @cancellable: (allow-none): A #GCancellable or %NULL
15286 * @error: Return location for error or %NULL.
15288 * Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
15289 * of a #GDBusConnection.
15291 * This is a synchronous failable constructor - the calling thread is
15292 * blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
15293 * for the asynchronous version.
15295 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15301 * g_dbus_object_manager_client_new_sync:
15302 * @connection: A #GDBusConnection.
15303 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15304 * @name: (allow-none): The owner of the control object (unique or well-known name), or %NULL when not using a message bus connection.
15305 * @object_path: The object path of the control object.
15306 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15307 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15308 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15309 * @cancellable: (allow-none): A #GCancellable or %NULL
15310 * @error: Return location for error or %NULL.
15312 * Creates a new #GDBusObjectManagerClient object.
15314 * This is a synchronous failable constructor - the calling thread is
15315 * blocked until a reply is received. See g_dbus_object_manager_client_new()
15316 * for the asynchronous version.
15318 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15324 * g_dbus_object_manager_get_interface:
15325 * @manager: A #GDBusObjectManager.
15326 * @object_path: Object path to lookup.
15327 * @interface_name: D-Bus interface name to lookup.
15329 * Gets the interface proxy for @interface_name at @object_path, if
15332 * Returns: (transfer full): A #GDBusInterface instance or %NULL. Free with g_object_unref().
15338 * g_dbus_object_manager_get_object:
15339 * @manager: A #GDBusObjectManager.
15340 * @object_path: Object path to lookup.
15342 * Gets the #GDBusObjectProxy at @object_path, if any.
15344 * Returns: (transfer full): A #GDBusObject or %NULL. Free with g_object_unref().
15350 * g_dbus_object_manager_get_object_path:
15351 * @manager: A #GDBusObjectManager.
15353 * Gets the object path that @manager is for.
15355 * Returns: A string owned by @manager. Do not free.
15361 * g_dbus_object_manager_get_objects:
15362 * @manager: A #GDBusObjectManager.
15364 * Gets all #GDBusObject objects known to @manager.
15366 * 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().
15372 * g_dbus_object_manager_server_export:
15373 * @manager: A #GDBusObjectManagerServer.
15374 * @object: A #GDBusObjectSkeleton.
15376 * Exports @object on @manager.
15378 * If there is already a #GDBusObject exported at the object path,
15379 * then the old object is removed.
15381 * The object path for @object must be in the hierarchy rooted by the
15382 * object path for @manager.
15384 * Note that @manager will take a reference on @object for as long as
15392 * g_dbus_object_manager_server_export_uniquely:
15393 * @manager: A #GDBusObjectManagerServer.
15394 * @object: An object.
15396 * Like g_dbus_object_manager_server_export() but appends a string of
15397 * the form <literal>_N</literal> (with N being a natural number) to
15398 * @object<!-- -->'s object path if an object with the given path
15399 * already exists. As such, the #GDBusObjectProxy:g-object-path property
15400 * of @object may be modified.
15407 * g_dbus_object_manager_server_get_connection:
15408 * @manager: A #GDBusObjectManagerServer
15410 * Gets the #GDBusConnection used by @manager.
15412 * 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().
15418 * g_dbus_object_manager_server_is_exported:
15419 * @manager: A #GDBusObjectManagerServer.
15420 * @object: An object.
15422 * Returns whether @object is currently exported on @manager.
15424 * Returns: %TRUE if @object is exported
15430 * g_dbus_object_manager_server_new:
15431 * @object_path: The object path to export the manager object at.
15433 * Creates a new #GDBusObjectManagerServer object.
15435 * The returned server isn't yet exported on any connection. To do so,
15436 * use g_dbus_object_manager_server_set_connection(). Normally you
15437 * want to export all of your objects before doing so to avoid <ulink
15438 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
15439 * signals being emitted.
15441 * Returns: A #GDBusObjectManagerServer object. Free with g_object_unref().
15447 * g_dbus_object_manager_server_set_connection:
15448 * @manager: A #GDBusObjectManagerServer.
15449 * @connection: (allow-none): A #GDBusConnection or %NULL.
15451 * Exports all objects managed by @manager on @connection. If
15452 * @connection is %NULL, stops exporting objects.
15457 * g_dbus_object_manager_server_unexport:
15458 * @manager: A #GDBusObjectManagerServer.
15459 * @object_path: An object path.
15461 * If @manager has an object at @path, removes the object. Otherwise
15464 * Note that @object_path must be in the hierarchy rooted by the
15465 * object path for @manager.
15467 * Returns: %TRUE if object at @object_path was removed, %FALSE otherwise.
15473 * g_dbus_object_proxy_get_connection:
15474 * @proxy: a #GDBusObjectProxy
15476 * Gets the connection that @proxy is for.
15478 * Returns: (transfer none): A #GDBusConnection. Do not free, the object is owned by @proxy.
15484 * g_dbus_object_proxy_new:
15485 * @connection: a #GDBusConnection
15486 * @object_path: the object path
15488 * Creates a new #GDBusObjectProxy for the given connection and
15491 * Returns: a new #GDBusObjectProxy
15497 * g_dbus_object_skeleton_add_interface:
15498 * @object: A #GDBusObjectSkeleton.
15499 * @interface_: A #GDBusInterfaceSkeleton.
15501 * Adds @interface_ to @object.
15503 * If @object already contains a #GDBusInterfaceSkeleton with the same
15504 * interface name, it is removed before @interface_ is added.
15506 * Note that @object takes its own reference on @interface_ and holds
15507 * it until removed.
15514 * g_dbus_object_skeleton_flush:
15515 * @object: A #GDBusObjectSkeleton.
15517 * This method simply calls g_dbus_interface_skeleton_flush() on all
15518 * interfaces belonging to @object. See that method for when flushing
15526 * g_dbus_object_skeleton_new:
15527 * @object_path: An object path.
15529 * Creates a new #GDBusObjectSkeleton.
15531 * Returns: A #GDBusObjectSkeleton. Free with g_object_unref().
15537 * g_dbus_object_skeleton_remove_interface:
15538 * @object: A #GDBusObjectSkeleton.
15539 * @interface_: A #GDBusInterfaceSkeleton.
15541 * Removes @interface_ from @object.
15548 * g_dbus_object_skeleton_remove_interface_by_name:
15549 * @object: A #GDBusObjectSkeleton.
15550 * @interface_name: A D-Bus interface name.
15552 * Removes the #GDBusInterface with @interface_name from @object.
15554 * If no D-Bus interface of the given interface exists, this function
15562 * g_dbus_object_skeleton_set_object_path:
15563 * @object: A #GDBusObjectSkeleton.
15564 * @object_path: A valid D-Bus object path.
15566 * Sets the object path for @object.
15573 * g_dbus_property_info_ref:
15574 * @info: A #GDBusPropertyInfo
15576 * If @info is statically allocated does nothing. Otherwise increases
15577 * the reference count.
15579 * Returns: The same @info.
15585 * g_dbus_property_info_unref:
15586 * @info: A #GDBusPropertyInfo.
15588 * If @info is statically allocated, does nothing. Otherwise decreases
15589 * the reference count of @info. When its reference count drops to 0,
15590 * the memory used is freed.
15597 * g_dbus_proxy_call:
15598 * @proxy: A #GDBusProxy.
15599 * @method_name: Name of method to invoke.
15600 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15601 * @flags: Flags from the #GDBusCallFlags enumeration.
15602 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15603 * @cancellable: (allow-none): A #GCancellable or %NULL.
15604 * @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.
15605 * @user_data: The data to pass to @callback.
15607 * Asynchronously invokes the @method_name method on @proxy.
15609 * If @method_name contains any dots, then @name is split into interface and
15610 * method name parts. This allows using @proxy for invoking methods on
15611 * other interfaces.
15613 * If the #GDBusConnection associated with @proxy is closed then
15614 * the operation will fail with %G_IO_ERROR_CLOSED. If
15615 * @cancellable is canceled, the operation will fail with
15616 * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15617 * compatible with the D-Bus protocol, the operation fails with
15618 * %G_IO_ERROR_INVALID_ARGUMENT.
15620 * If the @parameters #GVariant is floating, it is consumed. This allows
15621 * convenient 'inline' use of g_variant_new(), e.g.:
15623 * g_dbus_proxy_call (proxy,
15625 * g_variant_new ("(ss)",
15628 * G_DBUS_CALL_FLAGS_NONE,
15631 * (GAsyncReadyCallback) two_strings_done,
15635 * If @proxy has an expected interface (see
15636 * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15637 * then the return value is checked against the return type.
15639 * This is an asynchronous method. When the operation is finished,
15640 * @callback will be invoked in the
15641 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15642 * of the thread you are calling this method from.
15643 * You can then call g_dbus_proxy_call_finish() to get the result of
15644 * the operation. See g_dbus_proxy_call_sync() for the synchronous
15645 * version of this method.
15647 * If @callback is %NULL then the D-Bus method call message will be sent with
15648 * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
15655 * g_dbus_proxy_call_finish:
15656 * @proxy: A #GDBusProxy.
15657 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
15658 * @error: Return location for error or %NULL.
15660 * Finishes an operation started with g_dbus_proxy_call().
15662 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15668 * g_dbus_proxy_call_sync:
15669 * @proxy: A #GDBusProxy.
15670 * @method_name: Name of method to invoke.
15671 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15672 * @flags: Flags from the #GDBusCallFlags enumeration.
15673 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15674 * @cancellable: (allow-none): A #GCancellable or %NULL.
15675 * @error: Return location for error or %NULL.
15677 * Synchronously invokes the @method_name method on @proxy.
15679 * If @method_name contains any dots, then @name is split into interface and
15680 * method name parts. This allows using @proxy for invoking methods on
15681 * other interfaces.
15683 * If the #GDBusConnection associated with @proxy is disconnected then
15684 * the operation will fail with %G_IO_ERROR_CLOSED. If
15685 * @cancellable is canceled, the operation will fail with
15686 * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15687 * compatible with the D-Bus protocol, the operation fails with
15688 * %G_IO_ERROR_INVALID_ARGUMENT.
15690 * If the @parameters #GVariant is floating, it is consumed. This allows
15691 * convenient 'inline' use of g_variant_new(), e.g.:
15693 * g_dbus_proxy_call_sync (proxy,
15695 * g_variant_new ("(ss)",
15698 * G_DBUS_CALL_FLAGS_NONE,
15704 * The calling thread is blocked until a reply is received. See
15705 * g_dbus_proxy_call() for the asynchronous version of this
15708 * If @proxy has an expected interface (see
15709 * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15710 * then the return value is checked against the return type.
15712 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15718 * g_dbus_proxy_call_with_unix_fd_list:
15719 * @proxy: A #GDBusProxy.
15720 * @method_name: Name of method to invoke.
15721 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15722 * @flags: Flags from the #GDBusCallFlags enumeration.
15723 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15724 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15725 * @cancellable: (allow-none): A #GCancellable or %NULL.
15726 * @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.
15727 * @user_data: The data to pass to @callback.
15729 * Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
15731 * This method is only available on UNIX.
15738 * g_dbus_proxy_call_with_unix_fd_list_finish:
15739 * @proxy: A #GDBusProxy.
15740 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15741 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
15742 * @error: Return location for error or %NULL.
15744 * Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
15746 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15752 * g_dbus_proxy_call_with_unix_fd_list_sync:
15753 * @proxy: A #GDBusProxy.
15754 * @method_name: Name of method to invoke.
15755 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15756 * @flags: Flags from the #GDBusCallFlags enumeration.
15757 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15758 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15759 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15760 * @cancellable: (allow-none): A #GCancellable or %NULL.
15761 * @error: Return location for error or %NULL.
15763 * Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
15765 * This method is only available on UNIX.
15767 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15773 * g_dbus_proxy_get_cached_property:
15774 * @proxy: A #GDBusProxy.
15775 * @property_name: Property name.
15777 * Looks up the value for a property from the cache. This call does no
15780 * If @proxy has an expected interface (see
15781 * #GDBusProxy:g-interface-info) and @property_name is referenced by
15782 * it, then @value is checked against the type of the property.
15784 * 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().
15790 * g_dbus_proxy_get_cached_property_names:
15791 * @proxy: A #GDBusProxy.
15793 * Gets the names of all cached properties on @proxy.
15795 * Returns: (transfer full): A %NULL-terminated array of strings or %NULL if @proxy has no cached properties. Free the returned array with g_strfreev().
15801 * g_dbus_proxy_get_connection:
15802 * @proxy: A #GDBusProxy.
15804 * Gets the connection @proxy is for.
15806 * Returns: (transfer none): A #GDBusConnection owned by @proxy. Do not free.
15812 * g_dbus_proxy_get_default_timeout:
15813 * @proxy: A #GDBusProxy.
15815 * Gets the timeout to use if -1 (specifying default timeout) is
15816 * passed as @timeout_msec in the g_dbus_proxy_call() and
15817 * g_dbus_proxy_call_sync() functions.
15819 * See the #GDBusProxy:g-default-timeout property for more details.
15821 * Returns: Timeout to use for @proxy.
15827 * g_dbus_proxy_get_flags:
15828 * @proxy: A #GDBusProxy.
15830 * Gets the flags that @proxy was constructed with.
15832 * Returns: Flags from the #GDBusProxyFlags enumeration.
15838 * g_dbus_proxy_get_interface_info:
15839 * @proxy: A #GDBusProxy
15841 * Returns the #GDBusInterfaceInfo, if any, specifying the interface
15842 * that @proxy conforms to. See the #GDBusProxy:g-interface-info
15843 * property for more details.
15845 * Returns: A #GDBusInterfaceInfo or %NULL. Do not unref the returned object, it is owned by @proxy.
15851 * g_dbus_proxy_get_interface_name:
15852 * @proxy: A #GDBusProxy.
15854 * Gets the D-Bus interface name @proxy is for.
15856 * Returns: A string owned by @proxy. Do not free.
15862 * g_dbus_proxy_get_name:
15863 * @proxy: A #GDBusProxy.
15865 * Gets the name that @proxy was constructed for.
15867 * Returns: A string owned by @proxy. Do not free.
15873 * g_dbus_proxy_get_name_owner:
15874 * @proxy: A #GDBusProxy.
15876 * The unique name that owns the name that @proxy is for or %NULL if
15877 * no-one currently owns that name. You may connect to the
15878 * #GObject::notify signal to track changes to the
15879 * #GDBusProxy:g-name-owner property.
15881 * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15887 * g_dbus_proxy_get_object_path:
15888 * @proxy: A #GDBusProxy.
15890 * Gets the object path @proxy is for.
15892 * Returns: A string owned by @proxy. Do not free.
15898 * g_dbus_proxy_new:
15899 * @connection: A #GDBusConnection.
15900 * @flags: Flags used when constructing the proxy.
15901 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15902 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
15903 * @object_path: An object path.
15904 * @interface_name: A D-Bus interface name.
15905 * @cancellable: (allow-none): A #GCancellable or %NULL.
15906 * @callback: Callback function to invoke when the proxy is ready.
15907 * @user_data: User data to pass to @callback.
15909 * Creates a proxy for accessing @interface_name on the remote object
15910 * at @object_path owned by @name at @connection and asynchronously
15911 * loads D-Bus properties unless the
15912 * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
15913 * the #GDBusProxy::g-properties-changed signal to get notified about
15914 * property changes.
15916 * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
15917 * match rules for signals. Connect to the #GDBusProxy::g-signal signal
15918 * to handle signals from the remote object.
15920 * If @name is a well-known name and the
15921 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
15922 * owner currently exists, the message bus will be requested to launch
15923 * a name owner for the name.
15925 * This is a failable asynchronous constructor - when the proxy is
15926 * ready, @callback will be invoked and you can use
15927 * g_dbus_proxy_new_finish() to get the result.
15929 * See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
15931 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
15938 * g_dbus_proxy_new_finish:
15939 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
15940 * @error: Return location for error or %NULL.
15942 * Finishes creating a #GDBusProxy.
15944 * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
15950 * g_dbus_proxy_new_for_bus:
15951 * @bus_type: A #GBusType.
15952 * @flags: Flags used when constructing the proxy.
15953 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15954 * @name: A bus name (well-known or unique).
15955 * @object_path: An object path.
15956 * @interface_name: A D-Bus interface name.
15957 * @cancellable: (allow-none): A #GCancellable or %NULL.
15958 * @callback: Callback function to invoke when the proxy is ready.
15959 * @user_data: User data to pass to @callback.
15961 * Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
15963 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
15970 * g_dbus_proxy_new_for_bus_finish:
15971 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
15972 * @error: Return location for error or %NULL.
15974 * Finishes creating a #GDBusProxy.
15976 * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
15982 * g_dbus_proxy_new_for_bus_sync:
15983 * @bus_type: A #GBusType.
15984 * @flags: Flags used when constructing the proxy.
15985 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15986 * @name: A bus name (well-known or unique).
15987 * @object_path: An object path.
15988 * @interface_name: A D-Bus interface name.
15989 * @cancellable: (allow-none): A #GCancellable or %NULL.
15990 * @error: Return location for error or %NULL.
15992 * Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
15994 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
15996 * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16002 * g_dbus_proxy_new_sync:
16003 * @connection: A #GDBusConnection.
16004 * @flags: Flags used when constructing the proxy.
16005 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16006 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16007 * @object_path: An object path.
16008 * @interface_name: A D-Bus interface name.
16009 * @cancellable: (allow-none): A #GCancellable or %NULL.
16010 * @error: (allow-none): Return location for error or %NULL.
16012 * Creates a proxy for accessing @interface_name on the remote object
16013 * at @object_path owned by @name at @connection and synchronously
16014 * loads D-Bus properties unless the
16015 * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
16017 * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16018 * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16019 * to handle signals from the remote object.
16021 * If @name is a well-known name and the
16022 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16023 * owner currently exists, the message bus will be requested to launch
16024 * a name owner for the name.
16026 * This is a synchronous failable constructor. See g_dbus_proxy_new()
16027 * and g_dbus_proxy_new_finish() for the asynchronous version.
16029 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16031 * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16037 * g_dbus_proxy_set_cached_property:
16038 * @proxy: A #GDBusProxy
16039 * @property_name: Property name.
16040 * @value: (allow-none): Value for the property or %NULL to remove it from the cache.
16042 * If @value is not %NULL, sets the cached value for the property with
16043 * name @property_name to the value in @value.
16045 * If @value is %NULL, then the cached value is removed from the
16048 * If @proxy has an expected interface (see
16049 * #GDBusProxy:g-interface-info) and @property_name is referenced by
16050 * it, then @value is checked against the type of the property.
16052 * If the @value #GVariant is floating, it is consumed. This allows
16053 * convenient 'inline' use of g_variant_new(), e.g.
16055 * g_dbus_proxy_set_cached_property (proxy,
16057 * g_variant_new ("(si)",
16062 * Normally you will not need to use this method since @proxy is
16063 * tracking changes using the
16064 * <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
16065 * D-Bus signal. However, for performance reasons an object may decide
16066 * to not use this signal for some properties and instead use a
16067 * proprietary out-of-band mechanism to transmit changes.
16069 * As a concrete example, consider an object with a property
16070 * <literal>ChatroomParticipants</literal> which is an array of
16071 * strings. Instead of transmitting the same (long) array every time
16072 * the property changes, it is more efficient to only transmit the
16073 * delta using e.g. signals <literal>ChatroomParticipantJoined(String
16074 * name)</literal> and <literal>ChatroomParticipantParted(String
16082 * g_dbus_proxy_set_default_timeout:
16083 * @proxy: A #GDBusProxy.
16084 * @timeout_msec: Timeout in milliseconds.
16086 * Sets the timeout to use if -1 (specifying default timeout) is
16087 * passed as @timeout_msec in the g_dbus_proxy_call() and
16088 * g_dbus_proxy_call_sync() functions.
16090 * See the #GDBusProxy:g-default-timeout property for more details.
16097 * g_dbus_proxy_set_interface_info:
16098 * @proxy: A #GDBusProxy
16099 * @info: (allow-none): Minimum interface this proxy conforms to or %NULL to unset.
16101 * Ensure that interactions with @proxy conform to the given
16102 * interface. See the #GDBusProxy:g-interface-info property for more
16110 * g_dbus_server_get_client_address:
16111 * @server: A #GDBusServer.
16113 * Gets a D-Bus address string that can be used by clients to connect
16116 * Returns: A D-Bus address string. Do not free, the string is owned by @server.
16122 * g_dbus_server_get_flags:
16123 * @server: A #GDBusServer.
16125 * Gets the flags for @server.
16127 * Returns: A set of flags from the #GDBusServerFlags enumeration.
16133 * g_dbus_server_get_guid:
16134 * @server: A #GDBusServer.
16136 * Gets the GUID for @server.
16138 * Returns: A D-Bus GUID. Do not free this string, it is owned by @server.
16144 * g_dbus_server_is_active:
16145 * @server: A #GDBusServer.
16147 * Gets whether @server is active.
16149 * Returns: %TRUE if server is active, %FALSE otherwise.
16155 * g_dbus_server_new_sync:
16156 * @address: A D-Bus address.
16157 * @flags: Flags from the #GDBusServerFlags enumeration.
16158 * @guid: A D-Bus GUID.
16159 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
16160 * @cancellable: (allow-none): A #GCancellable or %NULL.
16161 * @error: Return location for server or %NULL.
16163 * Creates a new D-Bus server that listens on the first address in
16164 * @address that works.
16166 * Once constructed, you can use g_dbus_server_get_client_address() to
16167 * get a D-Bus address string that clients can use to connect.
16169 * Connect to the #GDBusServer::new-connection signal to handle
16170 * incoming connections.
16172 * The returned #GDBusServer isn't active - you have to start it with
16173 * g_dbus_server_start().
16175 * See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
16178 * This is a synchronous failable constructor. See
16179 * g_dbus_server_new() for the asynchronous version.
16181 * Returns: A #GDBusServer or %NULL if @error is set. Free with g_object_unref().
16187 * g_dbus_server_start:
16188 * @server: A #GDBusServer.
16197 * g_dbus_server_stop:
16198 * @server: A #GDBusServer.
16207 * g_dbus_signal_info_ref:
16208 * @info: A #GDBusSignalInfo
16210 * If @info is statically allocated does nothing. Otherwise increases
16211 * the reference count.
16213 * Returns: The same @info.
16219 * g_dbus_signal_info_unref:
16220 * @info: A #GDBusSignalInfo.
16222 * If @info is statically allocated, does nothing. Otherwise decreases
16223 * the reference count of @info. When its reference count drops to 0,
16224 * the memory used is freed.
16231 * g_desktop_app_info_get_action_name:
16232 * @info: a #GDesktopAppInfo
16233 * @action_name: the name of the action as from g_desktop_app_info_list_actions()
16235 * Gets the user-visible display name of the "additional application
16236 * action" specified by @action_name.
16238 * This corresponds to the "Name" key within the keyfile group for the
16241 * Returns: (transfer full): the locale-specific action name
16247 * g_desktop_app_info_get_boolean:
16248 * @info: a #GDesktopAppInfo
16249 * @key: the key to look up
16251 * Looks up a boolean value in the keyfile backing @info.
16253 * The @key is looked up in the "Desktop Entry" group.
16255 * Returns: the boolean value, or %FALSE if the key is not found
16261 * g_desktop_app_info_get_categories:
16262 * @info: a #GDesktopAppInfo
16264 * Gets the categories from the desktop file.
16266 * Returns: The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by ';' or validate it.
16271 * g_desktop_app_info_get_filename:
16272 * @info: a #GDesktopAppInfo
16274 * When @info was created from a known filename, return it. In some
16275 * situations such as the #GDesktopAppInfo returned from
16276 * g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
16278 * Returns: The full path to the file for @info, or %NULL if not known.
16284 * g_desktop_app_info_get_generic_name:
16285 * @info: a #GDesktopAppInfo
16287 * Gets the generic name from the destkop file.
16289 * Returns: The value of the GenericName key
16294 * g_desktop_app_info_get_is_hidden:
16295 * @info: a #GDesktopAppInfo.
16297 * A desktop file is hidden if the Hidden key in it is
16300 * Returns: %TRUE if hidden, %FALSE otherwise.
16305 * g_desktop_app_info_get_keywords:
16306 * @info: a #GDesktopAppInfo
16308 * Gets the keywords from the desktop file.
16310 * Returns: (transfer none): The value of the Keywords key
16316 * g_desktop_app_info_get_nodisplay:
16317 * @info: a #GDesktopAppInfo
16319 * Gets the value of the NoDisplay key, which helps determine if the
16320 * application info should be shown in menus. See
16321 * #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
16323 * Returns: The value of the NoDisplay key
16329 * g_desktop_app_info_get_show_in:
16330 * @info: a #GDesktopAppInfo
16331 * @desktop_env: a string specifying a desktop name
16333 * Checks if the application info should be shown in menus that list available
16334 * applications for a specific name of the desktop, based on the
16335 * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
16337 * If @desktop_env is %NULL, then the name of the desktop set with
16338 * g_desktop_app_info_set_desktop_env() is used.
16340 * Note that g_app_info_should_show() for @info will include this check (with
16341 * %NULL for @desktop_env) as well as additional checks.
16343 * Returns: %TRUE if the @info should be shown in @desktop_env according to the <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE otherwise.
16349 * g_desktop_app_info_get_startup_wm_class:
16350 * @info: a #GDesktopAppInfo that supports startup notify
16352 * Retrieves the StartupWMClass field from @info. This represents the
16353 * WM_CLASS property of the main window of the application, if launched
16356 * Returns: (transfer none): the startup WM class, or %NULL if none is set in the desktop file.
16362 * g_desktop_app_info_get_string:
16363 * @info: a #GDesktopAppInfo
16364 * @key: the key to look up
16366 * Looks up a string value in the keyfile backing @info.
16368 * The @key is looked up in the "Desktop Entry" group.
16370 * Returns: a newly allocated string, or %NULL if the key is not found
16376 * g_desktop_app_info_has_key:
16377 * @info: a #GDesktopAppInfo
16378 * @key: the key to look up
16380 * Returns whether @key exists in the "Desktop Entry" group
16381 * of the keyfile backing @info.
16383 * Returns: %TRUE if the @key exists
16389 * g_desktop_app_info_launch_action:
16390 * @info: a #GDesktopAppInfo
16391 * @action_name: the name of the action as from g_desktop_app_info_list_actions()
16392 * @launch_context: (allow-none): a #GAppLaunchContext
16394 * Activates the named application action.
16396 * You may only call this function on action names that were
16397 * returned from g_desktop_app_info_list_actions().
16399 * Note that if the main entry of the desktop file indicates that the
16400 * application supports startup notification, and @launch_context is
16401 * non-%NULL, then startup notification will be used when activating the
16402 * action (and as such, invocation of the action on the receiving side
16403 * must signal the end of startup notification when it is completed).
16404 * This is the expected behaviour of applications declaring additional
16405 * actions, as per the desktop file specification.
16407 * As with g_app_info_launch() there is no way to detect failures that
16408 * occur while using this function.
16415 * g_desktop_app_info_launch_uris_as_manager:
16416 * @appinfo: a #GDesktopAppInfo
16417 * @uris: (element-type utf8): List of URIs
16418 * @launch_context: a #GAppLaunchContext
16419 * @spawn_flags: #GSpawnFlags, used for each process
16420 * @user_setup: (scope call): a #GSpawnChildSetupFunc, used once for each process.
16421 * @user_setup_data: (closure user_setup): User data for @user_setup
16422 * @pid_callback: (scope call): Callback for child processes
16423 * @pid_callback_data: (closure pid_callback): User data for @callback
16424 * @error: return location for a #GError, or %NULL
16426 * This function performs the equivalent of g_app_info_launch_uris(),
16427 * but is intended primarily for operating system components that
16428 * launch applications. Ordinary applications should use
16429 * g_app_info_launch_uris().
16431 * If the application is launched via traditional UNIX fork()/exec()
16432 * then @spawn_flags, @user_setup and @user_setup_data are used for the
16433 * call to g_spawn_async(). Additionally, @pid_callback (with
16434 * @pid_callback_data) will be called to inform about the PID of the
16437 * If application launching occurs via some other mechanism (eg: D-Bus
16438 * activation) then @spawn_flags, @user_setup, @user_setup_data,
16439 * @pid_callback and @pid_callback_data are ignored.
16441 * Returns: %TRUE on successful launch, %FALSE otherwise.
16446 * g_desktop_app_info_list_actions:
16447 * @info: a #GDesktopAppInfo
16449 * Returns the list of "additional application actions" supported on the
16450 * desktop file, as per the desktop file specification.
16452 * As per the specification, this is the list of actions that are
16453 * explicitly listed in the "Actions" key of the [Desktop Entry] group.
16455 * Returns: (array zero-terminated=1) (element-type utf8) (transfer none): a list of strings, always non-%NULL
16461 * g_desktop_app_info_lookup_get_default_for_uri_scheme:
16462 * @lookup: a #GDesktopAppInfoLookup
16463 * @uri_scheme: a string containing a URI scheme.
16465 * Gets the default application for launching applications
16466 * using this URI scheme for a particular GDesktopAppInfoLookup
16469 * The GDesktopAppInfoLookup interface and this function is used
16470 * to implement g_app_info_get_default_for_uri_scheme() backends
16471 * in a GIO module. There is no reason for applications to use it
16472 * directly. Applications should use g_app_info_get_default_for_uri_scheme().
16474 * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
16475 * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
16480 * g_desktop_app_info_new:
16481 * @desktop_id: the desktop file id
16483 * Creates a new #GDesktopAppInfo based on a desktop file id.
16485 * A desktop file id is the basename of the desktop file, including the
16486 * .desktop extension. GIO is looking for a desktop file with this name
16487 * in the <filename>applications</filename> subdirectories of the XDG data
16488 * directories (i.e. the directories specified in the
16489 * <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
16490 * variables). GIO also supports the prefix-to-subdirectory mapping that is
16491 * described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
16492 * (i.e. a desktop id of kde-foo.desktop will match
16493 * <filename>/usr/share/applications/kde/foo.desktop</filename>).
16495 * Returns: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
16500 * g_desktop_app_info_new_from_filename:
16501 * @filename: the path of a desktop file, in the GLib filename encoding
16503 * Creates a new #GDesktopAppInfo.
16505 * Returns: a new #GDesktopAppInfo or %NULL on error.
16510 * g_desktop_app_info_new_from_keyfile:
16511 * @key_file: an opened #GKeyFile
16513 * Creates a new #GDesktopAppInfo.
16515 * Returns: a new #GDesktopAppInfo or %NULL on error.
16521 * g_desktop_app_info_set_desktop_env:
16522 * @desktop_env: a string specifying what desktop this is
16524 * Sets the name of the desktop that the application is running in.
16525 * This is used by g_app_info_should_show() and
16526 * g_desktop_app_info_get_show_in() to evaluate the
16527 * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
16528 * desktop entry fields.
16530 * The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
16531 * Menu specification</ulink> recognizes the following:
16533 * <member>GNOME</member>
16534 * <member>KDE</member>
16535 * <member>ROX</member>
16536 * <member>XFCE</member>
16537 * <member>LXDE</member>
16538 * <member>Unity</member>
16539 * <member>Old</member>
16542 * Should be called only once; subsequent calls are ignored.
16547 * g_drive_can_eject:
16548 * @drive: a #GDrive.
16550 * Checks if a drive can be ejected.
16552 * Returns: %TRUE if the @drive can be ejected, %FALSE otherwise.
16557 * g_drive_can_poll_for_media:
16558 * @drive: a #GDrive.
16560 * Checks if a drive can be polled for media changes.
16562 * Returns: %TRUE if the @drive can be polled for media changes, %FALSE otherwise.
16567 * g_drive_can_start:
16568 * @drive: a #GDrive.
16570 * Checks if a drive can be started.
16572 * Returns: %TRUE if the @drive can be started, %FALSE otherwise.
16578 * g_drive_can_start_degraded:
16579 * @drive: a #GDrive.
16581 * Checks if a drive can be started degraded.
16583 * Returns: %TRUE if the @drive can be started degraded, %FALSE otherwise.
16589 * g_drive_can_stop:
16590 * @drive: a #GDrive.
16592 * Checks if a drive can be stopped.
16594 * Returns: %TRUE if the @drive can be stopped, %FALSE otherwise.
16601 * @drive: a #GDrive.
16602 * @flags: flags affecting the unmount if required for eject
16603 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16604 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16605 * @user_data: user data to pass to @callback
16607 * Asynchronously ejects a drive.
16609 * When the operation is finished, @callback will be called.
16610 * You can then call g_drive_eject_finish() to obtain the
16611 * result of the operation.
16613 * Deprecated: 2.22: Use g_drive_eject_with_operation() instead.
16618 * g_drive_eject_finish:
16619 * @drive: a #GDrive.
16620 * @result: a #GAsyncResult.
16621 * @error: a #GError, or %NULL
16623 * Finishes ejecting a drive.
16625 * Returns: %TRUE if the drive has been ejected successfully, %FALSE otherwise.
16626 * Deprecated: 2.22: Use g_drive_eject_with_operation_finish() instead.
16631 * g_drive_eject_with_operation:
16632 * @drive: a #GDrive.
16633 * @flags: flags affecting the unmount if required for eject
16634 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16635 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16636 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16637 * @user_data: user data passed to @callback.
16639 * Ejects a drive. This is an asynchronous operation, and is
16640 * finished by calling g_drive_eject_with_operation_finish() with the @drive
16641 * and #GAsyncResult data returned in the @callback.
16648 * g_drive_eject_with_operation_finish:
16649 * @drive: a #GDrive.
16650 * @result: a #GAsyncResult.
16651 * @error: a #GError location to store the error occurring, or %NULL to ignore.
16653 * Finishes ejecting a drive. If any errors occurred during the operation,
16654 * @error will be set to contain the errors and %FALSE will be returned.
16656 * Returns: %TRUE if the drive was successfully ejected. %FALSE otherwise.
16662 * g_drive_enumerate_identifiers:
16663 * @drive: a #GDrive
16665 * Gets the kinds of identifiers that @drive has.
16666 * Use g_drive_get_identifier() to obtain the identifiers
16669 * Returns: (transfer full) (array zero-terminated=1): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
16674 * g_drive_get_icon:
16675 * @drive: a #GDrive.
16677 * Gets the icon for @drive.
16679 * Returns: (transfer full): #GIcon for the @drive. Free the returned object with g_object_unref().
16684 * g_drive_get_identifier:
16685 * @drive: a #GDrive
16686 * @kind: the kind of identifier to return
16688 * Gets the identifier of the given kind for @drive.
16690 * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GDrive doesn't have this kind of identifier.
16695 * g_drive_get_name:
16696 * @drive: a #GDrive.
16698 * Gets the name of @drive.
16700 * Returns: a string containing @drive's name. The returned string should be freed when no longer needed.
16705 * g_drive_get_sort_key:
16706 * @drive: A #GDrive.
16708 * Gets the sort key for @drive, if any.
16710 * Returns: Sorting key for @drive or %NULL if no such key is available.
16716 * g_drive_get_start_stop_type:
16717 * @drive: a #GDrive.
16719 * Gets a hint about how a drive can be started/stopped.
16721 * Returns: A value from the #GDriveStartStopType enumeration.
16727 * g_drive_get_symbolic_icon:
16728 * @drive: a #GDrive.
16730 * Gets the icon for @drive.
16732 * Returns: (transfer full): symbolic #GIcon for the @drive. Free the returned object with g_object_unref().
16738 * g_drive_get_volumes:
16739 * @drive: a #GDrive.
16741 * Get a list of mountable volumes for @drive.
16743 * The returned list should be freed with g_list_free(), after
16744 * its elements have been unreffed with g_object_unref().
16746 * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive.
16751 * g_drive_has_media:
16752 * @drive: a #GDrive.
16754 * Checks if the @drive has media. Note that the OS may not be polling
16755 * the drive for media changes; see g_drive_is_media_check_automatic()
16756 * for more details.
16758 * Returns: %TRUE if @drive has media, %FALSE otherwise.
16763 * g_drive_has_volumes:
16764 * @drive: a #GDrive.
16766 * Check if @drive has any mountable volumes.
16768 * Returns: %TRUE if the @drive contains volumes, %FALSE otherwise.
16773 * g_drive_is_media_check_automatic:
16774 * @drive: a #GDrive.
16776 * Checks if @drive is capabable of automatically detecting media changes.
16778 * Returns: %TRUE if the @drive is capabable of automatically detecting media changes, %FALSE otherwise.
16783 * g_drive_is_media_removable:
16784 * @drive: a #GDrive.
16786 * Checks if the @drive supports removable media.
16788 * Returns: %TRUE if @drive supports removable media, %FALSE otherwise.
16793 * g_drive_poll_for_media:
16794 * @drive: a #GDrive.
16795 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16796 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16797 * @user_data: user data to pass to @callback
16799 * Asynchronously polls @drive to see if media has been inserted or removed.
16801 * When the operation is finished, @callback will be called.
16802 * You can then call g_drive_poll_for_media_finish() to obtain the
16803 * result of the operation.
16808 * g_drive_poll_for_media_finish:
16809 * @drive: a #GDrive.
16810 * @result: a #GAsyncResult.
16811 * @error: a #GError, or %NULL
16813 * Finishes an operation started with g_drive_poll_for_media() on a drive.
16815 * Returns: %TRUE if the drive has been poll_for_mediaed successfully, %FALSE otherwise.
16821 * @drive: a #GDrive.
16822 * @flags: flags affecting the start operation.
16823 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16824 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16825 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16826 * @user_data: user data to pass to @callback
16828 * Asynchronously starts a drive.
16830 * When the operation is finished, @callback will be called.
16831 * You can then call g_drive_start_finish() to obtain the
16832 * result of the operation.
16839 * g_drive_start_finish:
16840 * @drive: a #GDrive.
16841 * @result: a #GAsyncResult.
16842 * @error: a #GError, or %NULL
16844 * Finishes starting a drive.
16846 * Returns: %TRUE if the drive has been started successfully, %FALSE otherwise.
16853 * @drive: a #GDrive.
16854 * @flags: flags affecting the unmount if required for stopping.
16855 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16856 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16857 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16858 * @user_data: user data to pass to @callback
16860 * Asynchronously stops a drive.
16862 * When the operation is finished, @callback will be called.
16863 * You can then call g_drive_stop_finish() to obtain the
16864 * result of the operation.
16871 * g_drive_stop_finish:
16872 * @drive: a #GDrive.
16873 * @result: a #GAsyncResult.
16874 * @error: a #GError, or %NULL
16876 * Finishes stopping a drive.
16878 * Returns: %TRUE if the drive has been stopped successfully, %FALSE otherwise.
16884 * g_emblem_get_icon:
16885 * @emblem: a #GEmblem from which the icon should be extracted.
16887 * Gives back the icon from @emblem.
16889 * Returns: (transfer none): a #GIcon. The returned object belongs to the emblem and should not be modified or freed.
16895 * g_emblem_get_origin:
16896 * @emblem: a #GEmblem
16898 * Gets the origin of the emblem.
16900 * Returns: (transfer none): the origin of the emblem
16907 * @icon: a GIcon containing the icon.
16909 * Creates a new emblem for @icon.
16911 * Returns: a new #GEmblem.
16917 * g_emblem_new_with_origin:
16918 * @icon: a GIcon containing the icon.
16919 * @origin: a GEmblemOrigin enum defining the emblem's origin
16921 * Creates a new emblem for @icon.
16923 * Returns: a new #GEmblem.
16929 * g_emblemed_icon_add_emblem:
16930 * @emblemed: a #GEmblemedIcon
16931 * @emblem: a #GEmblem
16933 * Adds @emblem to the #GList of #GEmblem <!-- -->s.
16940 * g_emblemed_icon_clear_emblems:
16941 * @emblemed: a #GEmblemedIcon
16943 * Removes all the emblems from @icon.
16950 * g_emblemed_icon_get_emblems:
16951 * @emblemed: a #GEmblemedIcon
16953 * Gets the list of emblems for the @icon.
16955 * Returns: (element-type Gio.Emblem) (transfer none): a #GList of #GEmblem <!-- -->s that is owned by @emblemed
16961 * g_emblemed_icon_get_icon:
16962 * @emblemed: a #GEmblemedIcon
16964 * Gets the main icon for @emblemed.
16966 * Returns: (transfer none): a #GIcon that is owned by @emblemed
16972 * g_emblemed_icon_new:
16974 * @emblem: (allow-none): a #GEmblem, or %NULL
16976 * Creates a new emblemed icon for @icon with the emblem @emblem.
16978 * Returns: (transfer full) (type GEmblemedIcon): a new #GIcon
16984 * g_file_append_to:
16985 * @file: input #GFile
16986 * @flags: a set of #GFileCreateFlags
16987 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16988 * @error: a #GError, or %NULL
16990 * Gets an output stream for appending data to the file.
16991 * If the file doesn't already exist it is created.
16993 * By default files created are generally readable by everyone,
16994 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
16995 * will be made readable only to the current user, to the level that
16996 * is supported on the target filesystem.
16998 * If @cancellable is not %NULL, then the operation can be cancelled
16999 * by triggering the cancellable object from another thread. If the
17000 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17003 * Some file systems don't allow all file names, and may return an
17004 * %G_IO_ERROR_INVALID_FILENAME error. If the file is a directory the
17005 * %G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are
17006 * possible too, and depend on what kind of filesystem the file is on.
17008 * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
17013 * g_file_append_to_async:
17014 * @file: input #GFile
17015 * @flags: a set of #GFileCreateFlags
17016 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17017 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17018 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17019 * @user_data: (closure): the data to pass to callback function
17021 * Asynchronously opens @file for appending.
17023 * For more details, see g_file_append_to() which is
17024 * the synchronous version of this call.
17026 * When the operation is finished, @callback will be called.
17027 * You can then call g_file_append_to_finish() to get the result
17028 * of the operation.
17033 * g_file_append_to_finish:
17034 * @file: input #GFile
17035 * @res: #GAsyncResult
17036 * @error: a #GError, or %NULL
17038 * Finishes an asynchronous file append operation started with
17039 * g_file_append_to_async().
17041 * Returns: (transfer full): a valid #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17046 * g_file_attribute_info_list_add:
17047 * @list: a #GFileAttributeInfoList.
17048 * @name: the name of the attribute to add.
17049 * @type: the #GFileAttributeType for the attribute.
17050 * @flags: #GFileAttributeInfoFlags for the attribute.
17052 * Adds a new attribute with @name to the @list, setting
17053 * its @type and @flags.
17058 * g_file_attribute_info_list_dup:
17059 * @list: a #GFileAttributeInfoList to duplicate.
17061 * Makes a duplicate of a file attribute info list.
17063 * Returns: a copy of the given @list.
17068 * g_file_attribute_info_list_lookup:
17069 * @list: a #GFileAttributeInfoList.
17070 * @name: the name of the attribute to lookup.
17072 * Gets the file attribute with the name @name from @list.
17074 * Returns: a #GFileAttributeInfo for the @name, or %NULL if an attribute isn't found.
17079 * g_file_attribute_info_list_new:
17081 * Creates a new file attribute info list.
17083 * Returns: a #GFileAttributeInfoList.
17088 * g_file_attribute_info_list_ref:
17089 * @list: a #GFileAttributeInfoList to reference.
17091 * References a file attribute info list.
17093 * Returns: #GFileAttributeInfoList or %NULL on error.
17098 * g_file_attribute_info_list_unref:
17099 * @list: The #GFileAttributeInfoList to unreference.
17101 * Removes a reference from the given @list. If the reference count
17102 * falls to zero, the @list is deleted.
17107 * g_file_attribute_matcher_enumerate_namespace:
17108 * @matcher: a #GFileAttributeMatcher.
17109 * @ns: a string containing a file attribute namespace.
17111 * Checks if the matcher will match all of the keys in a given namespace.
17112 * This will always return %TRUE if a wildcard character is in use (e.g. if
17113 * matcher was created with "standard::*" and @ns is "standard", or if matcher was created
17114 * using "*" and namespace is anything.)
17116 * TODO: this is awkwardly worded.
17118 * Returns: %TRUE if the matcher matches all of the entries in the given @ns, %FALSE otherwise.
17123 * g_file_attribute_matcher_enumerate_next:
17124 * @matcher: a #GFileAttributeMatcher.
17126 * Gets the next matched attribute from a #GFileAttributeMatcher.
17128 * Returns: a string containing the next attribute or %NULL if no more attribute exist.
17133 * g_file_attribute_matcher_matches:
17134 * @matcher: a #GFileAttributeMatcher.
17135 * @attribute: a file attribute key.
17137 * Checks if an attribute will be matched by an attribute matcher. If
17138 * the matcher was created with the "*" matching string, this function
17139 * will always return %TRUE.
17141 * Returns: %TRUE if @attribute matches @matcher. %FALSE otherwise.
17146 * g_file_attribute_matcher_matches_only:
17147 * @matcher: a #GFileAttributeMatcher.
17148 * @attribute: a file attribute key.
17150 * Checks if a attribute matcher only matches a given attribute. Always
17151 * returns %FALSE if "*" was used when creating the matcher.
17153 * Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
17158 * g_file_attribute_matcher_new:
17159 * @attributes: an attribute string to match.
17161 * Creates a new file attribute matcher, which matches attributes
17162 * against a given string. #GFileAttributeMatcher<!-- -->s are reference
17163 * counted structures, and are created with a reference count of 1. If
17164 * the number of references falls to 0, the #GFileAttributeMatcher is
17165 * automatically destroyed.
17167 * The @attribute string should be formatted with specific keys separated
17168 * from namespaces with a double colon. Several "namespace::key" strings may be
17169 * concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
17170 * The wildcard "*" may be used to match all keys and namespaces, or
17171 * "namespace::*" will match all keys in a given namespace.
17173 * Examples of strings to use:
17175 * <title>File Attribute Matcher strings and results</title>
17176 * <tgroup cols='2' align='left'><thead>
17177 * <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
17179 * <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
17180 * <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
17181 * <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
17182 * all keys in the unix namespace.</entry></row>
17183 * </tbody></tgroup>
17186 * Returns: a #GFileAttributeMatcher.
17191 * g_file_attribute_matcher_ref:
17192 * @matcher: a #GFileAttributeMatcher.
17194 * References a file attribute matcher.
17196 * Returns: a #GFileAttributeMatcher.
17201 * g_file_attribute_matcher_subtract:
17202 * @matcher: Matcher to subtract from
17203 * @subtract: The matcher to subtract
17205 * Subtracts all attributes of @subtract from @matcher and returns
17206 * a matcher that supports those attributes.
17208 * Note that currently it is not possible to remove a single
17209 * attribute when the @matcher matches the whole namespace - or remove
17210 * a namespace or attribute when the matcher matches everything. This
17211 * is a limitation of the current implementation, but may be fixed
17214 * Returns: A file attribute matcher matching all attributes of @matcher that are not matched by @subtract
17219 * g_file_attribute_matcher_to_string:
17220 * @matcher: (allow-none): a #GFileAttributeMatcher.
17222 * Prints what the matcher is matching against. The format will be
17223 * equal to the format passed to g_file_attribute_matcher_new().
17224 * The output however, might not be identical, as the matcher may
17225 * decide to use a different order or omit needless parts.
17227 * Returns: a string describing the attributes the matcher matches against or %NULL if @matcher was %NULL.
17233 * g_file_attribute_matcher_unref:
17234 * @matcher: a #GFileAttributeMatcher.
17236 * Unreferences @matcher. If the reference count falls below 1,
17237 * the @matcher is automatically freed.
17243 * @source: input #GFile
17244 * @destination: destination #GFile
17245 * @flags: set of #GFileCopyFlags
17246 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17247 * @progress_callback: (allow-none) (scope call): function to callback with progress information, or %NULL if progress information is not needed
17248 * @progress_callback_data: (closure): user data to pass to @progress_callback
17249 * @error: #GError to set on error, or %NULL
17251 * Copies the file @source to the location specified by @destination.
17252 * Can not handle recursive copies of directories.
17254 * If the flag #G_FILE_COPY_OVERWRITE is specified an already
17255 * existing @destination file is overwritten.
17257 * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
17258 * will be copied as symlinks, otherwise the target of the
17259 * @source symlink will be copied.
17261 * If @cancellable is not %NULL, then the operation can be cancelled by
17262 * triggering the cancellable object from another thread. If the operation
17263 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17265 * If @progress_callback is not %NULL, then the operation can be monitored
17266 * by setting this to a #GFileProgressCallback function.
17267 * @progress_callback_data will be passed to this function. It is guaranteed
17268 * that this callback will be called after all data has been transferred with
17269 * the total number of bytes copied during the operation.
17271 * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND error
17272 * is returned, independent on the status of the @destination.
17274 * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then
17275 * the error %G_IO_ERROR_EXISTS is returned.
17277 * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
17278 * error is returned. If trying to overwrite a directory with a directory the
17279 * %G_IO_ERROR_WOULD_MERGE error is returned.
17281 * If the source is a directory and the target does not exist, or
17282 * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
17283 * %G_IO_ERROR_WOULD_RECURSE error is returned.
17285 * If you are interested in copying the #GFile object itself (not the on-disk
17286 * file), see g_file_dup().
17288 * Returns: %TRUE on success, %FALSE otherwise.
17293 * g_file_copy_async: (skip)
17294 * @source: input #GFile
17295 * @destination: destination #GFile
17296 * @flags: set of #GFileCopyFlags
17297 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17298 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17299 * @progress_callback: (allow-none): function to callback with progress information, or %NULL if progress information is not needed
17300 * @progress_callback_data: (closure): user data to pass to @progress_callback
17301 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17302 * @user_data: the data to pass to callback function
17304 * Copies the file @source to the location specified by @destination
17305 * asynchronously. For details of the behaviour, see g_file_copy().
17307 * If @progress_callback is not %NULL, then that function that will be called
17308 * just like in g_file_copy(), however the callback will run in the main loop,
17309 * not in the thread that is doing the I/O operation.
17311 * When the operation is finished, @callback will be called. You can then call
17312 * g_file_copy_finish() to get the result of the operation.
17317 * g_file_copy_attributes:
17318 * @source: a #GFile with attributes
17319 * @destination: a #GFile to copy attributes to
17320 * @flags: a set of #GFileCopyFlags
17321 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17322 * @error: a #GError, %NULL to ignore
17324 * Copies the file attributes from @source to @destination.
17326 * Normally only a subset of the file attributes are copied,
17327 * those that are copies in a normal file copy operation
17328 * (which for instance does not include e.g. owner). However
17329 * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
17330 * all the metadata that is possible to copy is copied. This
17331 * is useful when implementing move by copy + delete source.
17333 * Returns: %TRUE if the attributes were copied successfully, %FALSE otherwise.
17338 * g_file_copy_finish:
17339 * @file: input #GFile
17340 * @res: a #GAsyncResult
17341 * @error: a #GError, or %NULL
17343 * Finishes copying the file started with g_file_copy_async().
17345 * Returns: a %TRUE on success, %FALSE on error.
17351 * @file: input #GFile
17352 * @flags: a set of #GFileCreateFlags
17353 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17354 * @error: a #GError, or %NULL
17356 * Creates a new file and returns an output stream for writing to it.
17357 * The file must not already exist.
17359 * By default files created are generally readable by everyone,
17360 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17361 * will be made readable only to the current user, to the level
17362 * that is supported on the target filesystem.
17364 * If @cancellable is not %NULL, then the operation can be cancelled
17365 * by triggering the cancellable object from another thread. If the
17366 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17369 * If a file or directory with this name already exists the
17370 * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
17371 * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
17372 * error, and if the name is to long %G_IO_ERROR_FILENAME_TOO_LONG will
17373 * be returned. Other errors are possible too, and depend on what kind
17374 * of filesystem the file is on.
17376 * Returns: (transfer full): a #GFileOutputStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17381 * g_file_create_async:
17382 * @file: input #GFile
17383 * @flags: a set of #GFileCreateFlags
17384 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17385 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17386 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17387 * @user_data: (closure): the data to pass to callback function
17389 * Asynchronously creates a new file and returns an output stream
17390 * for writing to it. The file must not already exist.
17392 * For more details, see g_file_create() which is
17393 * the synchronous version of this call.
17395 * When the operation is finished, @callback will be called.
17396 * You can then call g_file_create_finish() to get the result
17397 * of the operation.
17402 * g_file_create_finish:
17403 * @file: input #GFile
17404 * @res: a #GAsyncResult
17405 * @error: a #GError, or %NULL
17407 * Finishes an asynchronous file create operation started with
17408 * g_file_create_async().
17410 * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17415 * g_file_create_readwrite:
17417 * @flags: a set of #GFileCreateFlags
17418 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17419 * @error: return location for a #GError, or %NULL
17421 * Creates a new file and returns a stream for reading and
17422 * writing to it. The file must not already exist.
17424 * By default files created are generally readable by everyone,
17425 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17426 * will be made readable only to the current user, to the level
17427 * that is supported on the target filesystem.
17429 * If @cancellable is not %NULL, then the operation can be cancelled
17430 * by triggering the cancellable object from another thread. If the
17431 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17434 * If a file or directory with this name already exists, the
17435 * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
17436 * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
17437 * error, and if the name is too long, %G_IO_ERROR_FILENAME_TOO_LONG
17438 * will be returned. Other errors are possible too, and depend on what
17439 * kind of filesystem the file is on.
17441 * Note that in many non-local file cases read and write streams are
17442 * not supported, so make sure you really need to do read and write
17443 * streaming, rather than just opening for reading or writing.
17445 * Returns: (transfer full): a #GFileIOStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17451 * g_file_create_readwrite_async:
17452 * @file: input #GFile
17453 * @flags: a set of #GFileCreateFlags
17454 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17455 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17456 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17457 * @user_data: (closure): the data to pass to callback function
17459 * Asynchronously creates a new file and returns a stream
17460 * for reading and writing to it. The file must not already exist.
17462 * For more details, see g_file_create_readwrite() which is
17463 * the synchronous version of this call.
17465 * When the operation is finished, @callback will be called.
17466 * You can then call g_file_create_readwrite_finish() to get
17467 * the result of the operation.
17474 * g_file_create_readwrite_finish:
17475 * @file: input #GFile
17476 * @res: a #GAsyncResult
17477 * @error: a #GError, or %NULL
17479 * Finishes an asynchronous file create operation started with
17480 * g_file_create_readwrite_async().
17482 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
17489 * @file: input #GFile
17490 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17491 * @error: a #GError, or %NULL
17493 * Deletes a file. If the @file is a directory, it will only be
17494 * deleted if it is empty. This has the same semantics as g_unlink().
17496 * If @cancellable is not %NULL, then the operation can be cancelled by
17497 * triggering the cancellable object from another thread. If the operation
17498 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17500 * Virtual: delete_file
17501 * Returns: %TRUE if the file was deleted. %FALSE otherwise.
17506 * g_file_delete_async:
17507 * @file: input #GFile
17508 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17509 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17510 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17511 * @user_data: the data to pass to callback function
17513 * Asynchronously delete a file. If the @file is a directory, it will
17514 * only be deleted if it is empty. This has the same semantics as
17517 * Virtual: delete_file_async
17523 * g_file_delete_finish:
17524 * @file: input #GFile
17525 * @result: a #GAsyncResult
17526 * @error: a #GError, or %NULL
17528 * Finishes deleting a file started with g_file_delete_async().
17530 * Virtual: delete_file_finish
17531 * Returns: %TRUE if the file was deleted. %FALSE otherwise.
17537 * g_file_descriptor_based_get_fd:
17538 * @fd_based: a #GFileDescriptorBased.
17540 * Gets the underlying file descriptor.
17542 * Returns: The file descriptor
17549 * @file: input #GFile
17551 * Duplicates a #GFile handle. This operation does not duplicate
17552 * the actual file or directory represented by the #GFile; see
17553 * g_file_copy() if attempting to copy a file.
17555 * This call does no blocking I/O.
17557 * Returns: (transfer full): a new #GFile that is a duplicate of the given #GFile.
17562 * g_file_eject_mountable:
17563 * @file: input #GFile
17564 * @flags: flags affecting the operation
17565 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17566 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17567 * @user_data: (closure): the data to pass to callback function
17569 * Starts an asynchronous eject on a mountable.
17570 * When this operation has completed, @callback will be called with
17571 * @user_user data, and the operation can be finalized with
17572 * g_file_eject_mountable_finish().
17574 * If @cancellable is not %NULL, then the operation can be cancelled by
17575 * triggering the cancellable object from another thread. If the operation
17576 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17578 * Deprecated: 2.22: Use g_file_eject_mountable_with_operation() instead.
17583 * g_file_eject_mountable_finish:
17584 * @file: input #GFile
17585 * @result: a #GAsyncResult
17586 * @error: a #GError, or %NULL
17588 * Finishes an asynchronous eject operation started by
17589 * g_file_eject_mountable().
17591 * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17592 * Deprecated: 2.22: Use g_file_eject_mountable_with_operation_finish() instead.
17597 * g_file_eject_mountable_with_operation:
17598 * @file: input #GFile
17599 * @flags: flags affecting the operation
17600 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
17601 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17602 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17603 * @user_data: (closure): the data to pass to callback function
17605 * Starts an asynchronous eject on a mountable.
17606 * When this operation has completed, @callback will be called with
17607 * @user_user data, and the operation can be finalized with
17608 * g_file_eject_mountable_with_operation_finish().
17610 * If @cancellable is not %NULL, then the operation can be cancelled by
17611 * triggering the cancellable object from another thread. If the operation
17612 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17619 * g_file_eject_mountable_with_operation_finish:
17620 * @file: input #GFile
17621 * @result: a #GAsyncResult
17622 * @error: a #GError, or %NULL
17624 * Finishes an asynchronous eject operation started by
17625 * g_file_eject_mountable_with_operation().
17627 * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17633 * g_file_enumerate_children:
17634 * @file: input #GFile
17635 * @attributes: an attribute query string
17636 * @flags: a set of #GFileQueryInfoFlags
17637 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17638 * @error: #GError for error reporting
17640 * Gets the requested information about the files in a directory.
17641 * The result is a #GFileEnumerator object that will give out
17642 * #GFileInfo objects for all the files in the directory.
17644 * The @attributes value is a string that specifies the file
17645 * attributes that should be gathered. It is not an error if
17646 * it's not possible to read a particular requested attribute
17647 * from a file - it just won't be set. @attributes should
17648 * be a comma-separated list of attributes or attribute wildcards.
17649 * The wildcard "*" means all attributes, and a wildcard like
17650 * "standard::*" means all attributes in the standard namespace.
17651 * An example attribute query be "standard::*,owner::user".
17652 * The standard attributes are available as defines, like
17653 * #G_FILE_ATTRIBUTE_STANDARD_NAME.
17655 * If @cancellable is not %NULL, then the operation can be cancelled
17656 * by triggering the cancellable object from another thread. If the
17657 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17660 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
17661 * be returned. If the file is not a directory, the %G_IO_ERROR_NOT_DIRECTORY
17662 * error will be returned. Other errors are possible too.
17664 * Returns: (transfer full): A #GFileEnumerator if successful, %NULL on error. Free the returned object with g_object_unref().
17669 * g_file_enumerate_children_async:
17670 * @file: input #GFile
17671 * @attributes: an attribute query string
17672 * @flags: a set of #GFileQueryInfoFlags
17673 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17674 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17675 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17676 * @user_data: (closure): the data to pass to callback function
17678 * Asynchronously gets the requested information about the files
17679 * in a directory. The result is a #GFileEnumerator object that will
17680 * give out #GFileInfo objects for all the files in the directory.
17682 * For more details, see g_file_enumerate_children() which is
17683 * the synchronous version of this call.
17685 * When the operation is finished, @callback will be called. You can
17686 * then call g_file_enumerate_children_finish() to get the result of
17692 * g_file_enumerate_children_finish:
17693 * @file: input #GFile
17694 * @res: a #GAsyncResult
17695 * @error: a #GError
17697 * Finishes an async enumerate children operation.
17698 * See g_file_enumerate_children_async().
17700 * Returns: (transfer full): a #GFileEnumerator or %NULL if an error occurred. Free the returned object with g_object_unref().
17705 * g_file_enumerator_close:
17706 * @enumerator: a #GFileEnumerator.
17707 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17708 * @error: location to store the error occurring, or %NULL to ignore
17710 * Releases all resources used by this enumerator, making the
17711 * enumerator return %G_IO_ERROR_CLOSED on all calls.
17713 * This will be automatically called when the last reference
17714 * is dropped, but you might want to call this function to make
17715 * sure resources are released as early as possible.
17717 * Returns: #TRUE on success or #FALSE on error.
17722 * g_file_enumerator_close_async:
17723 * @enumerator: a #GFileEnumerator.
17724 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17725 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17726 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17727 * @user_data: (closure): the data to pass to callback function
17729 * Asynchronously closes the file enumerator.
17731 * If @cancellable is not %NULL, then the operation can be cancelled by
17732 * triggering the cancellable object from another thread. If the operation
17733 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
17734 * g_file_enumerator_close_finish().
17739 * g_file_enumerator_close_finish:
17740 * @enumerator: a #GFileEnumerator.
17741 * @result: a #GAsyncResult.
17742 * @error: a #GError location to store the error occurring, or %NULL to ignore.
17744 * Finishes closing a file enumerator, started from g_file_enumerator_close_async().
17746 * If the file enumerator was already closed when g_file_enumerator_close_async()
17747 * was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
17748 * return %FALSE. If the file enumerator had pending operation when the close
17749 * operation was started, then this function will report %G_IO_ERROR_PENDING, and
17750 * return %FALSE. If @cancellable was not %NULL, then the operation may have been
17751 * cancelled by triggering the cancellable object from another thread. If the operation
17752 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
17755 * Returns: %TRUE if the close operation has finished successfully.
17760 * g_file_enumerator_get_child:
17761 * @enumerator: a #GFileEnumerator
17762 * @info: a #GFileInfo gotten from g_file_enumerator_next_file() or the async equivalents.
17764 * Return a new #GFile which refers to the file named by @info in the source
17765 * directory of @enumerator. This function is primarily intended to be used
17766 * inside loops with g_file_enumerator_next_file().
17768 * This is a convenience method that's equivalent to:
17770 * gchar *name = g_file_info_get_name (info);
17771 * GFile *child = g_file_get_child (g_file_enumerator_get_container (enumr),
17775 * Returns: (transfer full): a #GFile for the #GFileInfo passed it.
17781 * g_file_enumerator_get_container:
17782 * @enumerator: a #GFileEnumerator
17784 * Get the #GFile container which is being enumerated.
17786 * Returns: (transfer none): the #GFile which is being enumerated.
17792 * g_file_enumerator_has_pending:
17793 * @enumerator: a #GFileEnumerator.
17795 * Checks if the file enumerator has pending operations.
17797 * Returns: %TRUE if the @enumerator has pending operations.
17802 * g_file_enumerator_is_closed:
17803 * @enumerator: a #GFileEnumerator.
17805 * Checks if the file enumerator has been closed.
17807 * Returns: %TRUE if the @enumerator is closed.
17812 * g_file_enumerator_next_file:
17813 * @enumerator: a #GFileEnumerator.
17814 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17815 * @error: location to store the error occurring, or %NULL to ignore
17817 * Returns information for the next file in the enumerated object.
17818 * Will block until the information is available. The #GFileInfo
17819 * returned from this function will contain attributes that match the
17820 * attribute string that was passed when the #GFileEnumerator was created.
17822 * See the documentation of #GFileEnumerator for information about the
17823 * order of returned files.
17825 * On error, returns %NULL and sets @error to the error. If the
17826 * enumerator is at the end, %NULL will be returned and @error will
17829 * 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.
17834 * g_file_enumerator_next_files_async:
17835 * @enumerator: a #GFileEnumerator.
17836 * @num_files: the number of file info objects to request
17837 * @io_priority: the <link linkend="io-priority">io priority</link> of the request.
17838 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17839 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17840 * @user_data: (closure): the data to pass to callback function
17842 * Request information for a number of files from the enumerator asynchronously.
17843 * When all i/o for the operation is finished the @callback will be called with
17844 * the requested information.
17846 * See the documentation of #GFileEnumerator for information about the
17847 * order of returned files.
17849 * The callback can be called with less than @num_files files in case of error
17850 * or at the end of the enumerator. In case of a partial error the callback will
17851 * be called with any succeeding items and no error, and on the next request the
17852 * error will be reported. If a request is cancelled the callback will be called
17853 * with %G_IO_ERROR_CANCELLED.
17855 * During an async request no other sync and async calls are allowed, and will
17856 * result in %G_IO_ERROR_PENDING errors.
17858 * Any outstanding i/o request with higher priority (lower numerical value) will
17859 * be executed before an outstanding request with lower priority. Default
17860 * priority is %G_PRIORITY_DEFAULT.
17865 * g_file_enumerator_next_files_finish:
17866 * @enumerator: a #GFileEnumerator.
17867 * @result: a #GAsyncResult.
17868 * @error: a #GError location to store the error occurring, or %NULL to ignore.
17870 * Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
17872 * 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.
17877 * g_file_enumerator_set_pending:
17878 * @enumerator: a #GFileEnumerator.
17879 * @pending: a boolean value.
17881 * Sets the file enumerator as having pending operations.
17887 * @file1: the first #GFile
17888 * @file2: the second #GFile
17890 * Checks equality of two given #GFiles.
17892 * Note that two #GFiles that differ can still refer to the same
17893 * file on the filesystem due to various forms of filename
17896 * This call does no blocking I/O.
17898 * Returns: %TRUE if @file1 and @file2 are equal. %FALSE if either is not a #GFile.
17903 * g_file_find_enclosing_mount:
17904 * @file: input #GFile
17905 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17906 * @error: a #GError
17908 * Gets a #GMount for the #GFile.
17910 * If the #GFileIface for @file does not have a mount (e.g.
17911 * possibly a remote share), @error will be set to %G_IO_ERROR_NOT_FOUND
17912 * and %NULL will be returned.
17914 * If @cancellable is not %NULL, then the operation can be cancelled by
17915 * triggering the cancellable object from another thread. If the operation
17916 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17918 * Returns: (transfer full): a #GMount where the @file is located or %NULL on error. Free the returned object with g_object_unref().
17923 * g_file_find_enclosing_mount_async:
17925 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17926 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17927 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17928 * @user_data: (closure): the data to pass to callback function
17930 * Asynchronously gets the mount for the file.
17932 * For more details, see g_file_find_enclosing_mount() which is
17933 * the synchronous version of this call.
17935 * When the operation is finished, @callback will be called.
17936 * You can then call g_file_find_enclosing_mount_finish() to
17937 * get the result of the operation.
17942 * g_file_find_enclosing_mount_finish:
17944 * @res: a #GAsyncResult
17945 * @error: a #GError
17947 * Finishes an asynchronous find mount request.
17948 * See g_file_find_enclosing_mount_async().
17950 * Returns: (transfer full): #GMount for given @file or %NULL on error. Free the returned object with g_object_unref().
17955 * g_file_get_basename:
17956 * @file: input #GFile
17958 * Gets the base name (the last component of the path) for a given #GFile.
17960 * If called for the top level of a system (such as the filesystem root
17961 * or a uri like sftp://host/) it will return a single directory separator
17962 * (and on Windows, possibly a drive letter).
17964 * The base name is a byte string (not UTF-8). It has no defined encoding
17965 * or rules other than it may not contain zero bytes. If you want to use
17966 * filenames in a user interface you should use the display name that you
17967 * can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
17968 * attribute with g_file_query_info().
17970 * This call does no blocking I/O.
17972 * 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.
17977 * g_file_get_child:
17978 * @file: input #GFile
17979 * @name: string containing the child's basename
17981 * Gets a child of @file with basename equal to @name.
17983 * Note that the file with that specific name might not exist, but
17984 * you can still have a #GFile that points to it. You can use this
17985 * for instance to create that file.
17987 * This call does no blocking I/O.
17989 * Returns: (transfer full): a #GFile to a child specified by @name. Free the returned object with g_object_unref().
17994 * g_file_get_child_for_display_name:
17995 * @file: input #GFile
17996 * @display_name: string to a possible child
17997 * @error: return location for an error
17999 * Gets the child of @file for a given @display_name (i.e. a UTF-8
18000 * version of the name). If this function fails, it returns %NULL
18001 * and @error will be set. This is very useful when constructing a
18002 * #GFile for a new file and the user entered the filename in the
18003 * user interface, for instance when you select a directory and
18004 * type a filename in the file selector.
18006 * This call does no blocking I/O.
18008 * 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().
18013 * g_file_get_parent:
18014 * @file: input #GFile
18016 * Gets the parent directory for the @file.
18017 * If the @file represents the root directory of the
18018 * file system, then %NULL will be returned.
18020 * This call does no blocking I/O.
18022 * 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().
18027 * g_file_get_parse_name:
18028 * @file: input #GFile
18030 * Gets the parse name of the @file.
18031 * A parse name is a UTF-8 string that describes the
18032 * file such that one can get the #GFile back using
18033 * g_file_parse_name().
18035 * This is generally used to show the #GFile as a nice
18036 * full-pathname kind of string in a user interface,
18037 * like in a location entry.
18039 * For local files with names that can safely be converted
18040 * to UTF-8 the pathname is used, otherwise the IRI is used
18041 * (a form of URI that allows UTF-8 characters unescaped).
18043 * This call does no blocking I/O.
18045 * Returns: a string containing the #GFile's parse name. The returned string should be freed with g_free() when no longer needed.
18051 * @file: input #GFile
18053 * Gets the local pathname for #GFile, if one exists.
18055 * This call does no blocking I/O.
18057 * 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.
18062 * g_file_get_relative_path:
18063 * @parent: input #GFile
18064 * @descendant: input #GFile
18066 * Gets the path for @descendant relative to @parent.
18068 * This call does no blocking I/O.
18070 * 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.
18076 * @file: input #GFile
18078 * Gets the URI for the @file.
18080 * This call does no blocking I/O.
18082 * Returns: a string containing the #GFile's URI. The returned string should be freed with g_free() when no longer needed.
18087 * g_file_get_uri_scheme:
18088 * @file: input #GFile
18090 * Gets the URI scheme for a #GFile.
18091 * RFC 3986 decodes the scheme as:
18093 * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
18094 * </programlisting>
18095 * Common schemes include "file", "http", "ftp", etc.
18097 * This call does no blocking I/O.
18099 * Returns: a string containing the URI scheme for the given #GFile. The returned string should be freed with g_free() when no longer needed.
18104 * g_file_has_parent:
18105 * @file: input #GFile
18106 * @parent: (allow-none): the parent to check for, or %NULL
18108 * Checks if @file has a parent, and optionally, if it is @parent.
18110 * If @parent is %NULL then this function returns %TRUE if @file has any
18111 * parent at all. If @parent is non-%NULL then %TRUE is only returned
18112 * if @file is a child of @parent.
18114 * Returns: %TRUE if @file is a child of @parent (or any parent in the case that @parent is %NULL).
18120 * g_file_has_prefix:
18121 * @file: input #GFile
18122 * @prefix: input #GFile
18124 * Checks whether @file has the prefix specified by @prefix.
18126 * In other words, if the names of initial elements of @file's
18127 * pathname match @prefix. Only full pathname elements are matched,
18128 * so a path like /foo is not considered a prefix of /foobar, only
18131 * This call does no I/O, as it works purely on names. As such it can
18132 * sometimes return %FALSE even if @file is inside a @prefix (from a
18133 * filesystem point of view), because the prefix of @file is an alias
18136 * Virtual: prefix_matches
18137 * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix, %FALSE otherwise.
18142 * g_file_has_uri_scheme:
18143 * @file: input #GFile
18144 * @uri_scheme: a string containing a URI scheme
18146 * Checks to see if a #GFile has a given URI scheme.
18148 * This call does no blocking I/O.
18150 * Returns: %TRUE if #GFile's backend supports the given URI scheme, %FALSE if URI scheme is %NULL, not supported, or #GFile is invalid.
18156 * @file: (type GFile): #gconstpointer to a #GFile
18158 * Creates a hash value for a #GFile.
18160 * This call does no blocking I/O.
18163 * 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.
18168 * g_file_icon_get_file:
18171 * Gets the #GFile associated with the given @icon.
18173 * Returns: (transfer none): a #GFile, or %NULL.
18181 * Creates a new icon for a file.
18183 * Returns: (transfer full) (type GFileIcon): a #GIcon for the given @file, or %NULL on error.
18188 * g_file_info_clear_status:
18189 * @info: a #GFileInfo.
18191 * Clears the status information from @info.
18196 * g_file_info_copy_into:
18197 * @src_info: source to copy attributes from.
18198 * @dest_info: destination to copy attributes to.
18200 * Copies all of the <link linkend="gio-GFileAttribute">GFileAttribute</link>s
18201 * from @src_info to @dest_info.
18207 * @other: a #GFileInfo.
18209 * Duplicates a file info structure.
18211 * Returns: (transfer full): a duplicate #GFileInfo of @other.
18216 * g_file_info_get_attribute_as_string:
18217 * @info: a #GFileInfo.
18218 * @attribute: a file attribute key.
18220 * Gets the value of a attribute, formated as a string.
18221 * This escapes things as needed to make the string valid
18224 * Returns: a UTF-8 string associated with the given @attribute. When you're done with the string it must be freed with g_free().
18229 * g_file_info_get_attribute_boolean:
18230 * @info: a #GFileInfo.
18231 * @attribute: a file attribute key.
18233 * Gets the value of a boolean attribute. If the attribute does not
18234 * contain a boolean value, %FALSE will be returned.
18236 * Returns: the boolean value contained within the attribute.
18241 * g_file_info_get_attribute_byte_string:
18242 * @info: a #GFileInfo.
18243 * @attribute: a file attribute key.
18245 * Gets the value of a byte string attribute. If the attribute does
18246 * not contain a byte string, %NULL will be returned.
18248 * Returns: the contents of the @attribute value as a byte string, or %NULL otherwise.
18253 * g_file_info_get_attribute_data:
18254 * @info: a #GFileInfo
18255 * @attribute: a file attribute key
18256 * @type: (out) (allow-none): return location for the attribute type, or %NULL
18257 * @value_pp: (out) (allow-none): return location for the attribute value, or %NULL
18258 * @status: (out) (allow-none): return location for the attribute status, or %NULL
18260 * Gets the attribute type, value and status for an attribute key.
18262 * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
18267 * g_file_info_get_attribute_int32:
18268 * @info: a #GFileInfo.
18269 * @attribute: a file attribute key.
18271 * Gets a signed 32-bit integer contained within the attribute. If the
18272 * attribute does not contain a signed 32-bit integer, or is invalid,
18273 * 0 will be returned.
18275 * Returns: a signed 32-bit integer from the attribute.
18280 * g_file_info_get_attribute_int64:
18281 * @info: a #GFileInfo.
18282 * @attribute: a file attribute key.
18284 * Gets a signed 64-bit integer contained within the attribute. If the
18285 * attribute does not contain an signed 64-bit integer, or is invalid,
18286 * 0 will be returned.
18288 * Returns: a signed 64-bit integer from the attribute.
18293 * g_file_info_get_attribute_object:
18294 * @info: a #GFileInfo.
18295 * @attribute: a file attribute key.
18297 * Gets the value of a #GObject attribute. If the attribute does
18298 * not contain a #GObject, %NULL will be returned.
18300 * Returns: (transfer none): a #GObject associated with the given @attribute, or %NULL otherwise.
18305 * g_file_info_get_attribute_status:
18306 * @info: a #GFileInfo
18307 * @attribute: a file attribute key
18309 * Gets the attribute status for an attribute key.
18311 * Returns: a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
18316 * g_file_info_get_attribute_string:
18317 * @info: a #GFileInfo.
18318 * @attribute: a file attribute key.
18320 * Gets the value of a string attribute. If the attribute does
18321 * not contain a string, %NULL will be returned.
18323 * Returns: the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
18328 * g_file_info_get_attribute_stringv:
18329 * @info: a #GFileInfo.
18330 * @attribute: a file attribute key.
18332 * Gets the value of a stringv attribute. If the attribute does
18333 * not contain a stringv, %NULL will be returned.
18335 * Returns: (transfer none): the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
18341 * g_file_info_get_attribute_type:
18342 * @info: a #GFileInfo.
18343 * @attribute: a file attribute key.
18345 * Gets the attribute type for an attribute key.
18347 * Returns: a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
18352 * g_file_info_get_attribute_uint32:
18353 * @info: a #GFileInfo.
18354 * @attribute: a file attribute key.
18356 * Gets an unsigned 32-bit integer contained within the attribute. If the
18357 * attribute does not contain an unsigned 32-bit integer, or is invalid,
18358 * 0 will be returned.
18360 * Returns: an unsigned 32-bit integer from the attribute.
18365 * g_file_info_get_attribute_uint64:
18366 * @info: a #GFileInfo.
18367 * @attribute: a file attribute key.
18369 * Gets a unsigned 64-bit integer contained within the attribute. If the
18370 * attribute does not contain an unsigned 64-bit integer, or is invalid,
18371 * 0 will be returned.
18373 * Returns: a unsigned 64-bit integer from the attribute.
18378 * g_file_info_get_content_type:
18379 * @info: a #GFileInfo.
18381 * Gets the file's content type.
18383 * Returns: a string containing the file's content type.
18388 * g_file_info_get_deletion_date:
18389 * @info: a #GFileInfo.
18391 * Returns the #GDateTime representing the deletion date of the file, as
18392 * available in G_FILE_ATTRIBUTE_TRASH_DELETION_DATE. If the
18393 * G_FILE_ATTRIBUTE_TRASH_DELETION_DATE attribute is unset, %NULL is returned.
18395 * Returns: a #GDateTime, or %NULL.
18401 * g_file_info_get_display_name:
18402 * @info: a #GFileInfo.
18404 * Gets a display name for a file.
18406 * Returns: a string containing the display name.
18411 * g_file_info_get_edit_name:
18412 * @info: a #GFileInfo.
18414 * Gets the edit name for a file.
18416 * Returns: a string containing the edit name.
18421 * g_file_info_get_etag:
18422 * @info: a #GFileInfo.
18424 * Gets the <link linkend="gfile-etag">entity tag</link> for a given
18425 * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
18427 * Returns: a string containing the value of the "etag:value" attribute.
18432 * g_file_info_get_file_type:
18433 * @info: a #GFileInfo.
18435 * Gets a file's type (whether it is a regular file, symlink, etc).
18436 * This is different from the file's content type, see g_file_info_get_content_type().
18438 * Returns: a #GFileType for the given file.
18443 * g_file_info_get_icon:
18444 * @info: a #GFileInfo.
18446 * Gets the icon for a file.
18448 * Returns: (transfer none): #GIcon for the given @info.
18453 * g_file_info_get_is_backup:
18454 * @info: a #GFileInfo.
18456 * Checks if a file is a backup file.
18458 * Returns: %TRUE if file is a backup file, %FALSE otherwise.
18463 * g_file_info_get_is_hidden:
18464 * @info: a #GFileInfo.
18466 * Checks if a file is hidden.
18468 * Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
18473 * g_file_info_get_is_symlink:
18474 * @info: a #GFileInfo.
18476 * Checks if a file is a symlink.
18478 * Returns: %TRUE if the given @info is a symlink.
18483 * g_file_info_get_modification_time:
18484 * @info: a #GFileInfo.
18485 * @result: (out caller-allocates): a #GTimeVal.
18487 * Gets the modification time of the current @info and sets it
18493 * g_file_info_get_name:
18494 * @info: a #GFileInfo.
18496 * Gets the name for a file.
18498 * Returns: a string containing the file name.
18503 * g_file_info_get_size:
18504 * @info: a #GFileInfo.
18506 * Gets the file's size.
18508 * Returns: a #goffset containing the file's size.
18513 * g_file_info_get_sort_order:
18514 * @info: a #GFileInfo.
18516 * Gets the value of the sort_order attribute from the #GFileInfo.
18517 * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18519 * Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
18524 * g_file_info_get_symbolic_icon:
18525 * @info: a #GFileInfo.
18527 * Gets the symbolic icon for a file.
18529 * Returns: (transfer none): #GIcon for the given @info.
18535 * g_file_info_get_symlink_target:
18536 * @info: a #GFileInfo.
18538 * Gets the symlink target for a given #GFileInfo.
18540 * Returns: a string containing the symlink target.
18545 * g_file_info_has_attribute:
18546 * @info: a #GFileInfo.
18547 * @attribute: a file attribute key.
18549 * Checks if a file info structure has an attribute named @attribute.
18551 * Returns: %TRUE if @Ginfo has an attribute named @attribute, %FALSE otherwise.
18556 * g_file_info_has_namespace:
18557 * @info: a #GFileInfo.
18558 * @name_space: a file attribute namespace.
18560 * Checks if a file info structure has an attribute in the
18561 * specified @name_space.
18563 * Returns: %TRUE if @Ginfo has an attribute in @name_space, %FALSE otherwise.
18569 * g_file_info_list_attributes:
18570 * @info: a #GFileInfo.
18571 * @name_space: a file attribute key's namespace.
18573 * Lists the file info structure's attributes.
18575 * 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.
18582 * Creates a new file info structure.
18584 * Returns: a #GFileInfo.
18589 * g_file_info_remove_attribute:
18590 * @info: a #GFileInfo.
18591 * @attribute: a file attribute key.
18593 * Removes all cases of @attribute from @info if it exists.
18598 * g_file_info_set_attribute:
18599 * @info: a #GFileInfo.
18600 * @attribute: a file attribute key.
18601 * @type: a #GFileAttributeType
18602 * @value_p: pointer to the value
18604 * Sets the @attribute to contain the given value, if possible. To unset the
18605 * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
18610 * g_file_info_set_attribute_boolean:
18611 * @info: a #GFileInfo.
18612 * @attribute: a file attribute key.
18613 * @attr_value: a boolean value.
18615 * Sets the @attribute to contain the given @attr_value,
18621 * g_file_info_set_attribute_byte_string:
18622 * @info: a #GFileInfo.
18623 * @attribute: a file attribute key.
18624 * @attr_value: a byte string.
18626 * Sets the @attribute to contain the given @attr_value,
18632 * g_file_info_set_attribute_int32:
18633 * @info: a #GFileInfo.
18634 * @attribute: a file attribute key.
18635 * @attr_value: a signed 32-bit integer
18637 * Sets the @attribute to contain the given @attr_value,
18643 * g_file_info_set_attribute_int64:
18644 * @info: a #GFileInfo.
18645 * @attribute: attribute name to set.
18646 * @attr_value: int64 value to set attribute to.
18648 * Sets the @attribute to contain the given @attr_value,
18654 * g_file_info_set_attribute_mask:
18655 * @info: a #GFileInfo.
18656 * @mask: a #GFileAttributeMatcher.
18658 * Sets @mask on @info to match specific attribute types.
18663 * g_file_info_set_attribute_object:
18664 * @info: a #GFileInfo.
18665 * @attribute: a file attribute key.
18666 * @attr_value: a #GObject.
18668 * Sets the @attribute to contain the given @attr_value,
18674 * g_file_info_set_attribute_status:
18675 * @info: a #GFileInfo
18676 * @attribute: a file attribute key
18677 * @status: a #GFileAttributeStatus
18679 * Sets the attribute status for an attribute key. This is only
18680 * needed by external code that implement g_file_set_attributes_from_info()
18681 * or similar functions.
18683 * The attribute must exist in @info for this to work. Otherwise %FALSE
18684 * is returned and @info is unchanged.
18686 * Returns: %TRUE if the status was changed, %FALSE if the key was not set.
18692 * g_file_info_set_attribute_string:
18693 * @info: a #GFileInfo.
18694 * @attribute: a file attribute key.
18695 * @attr_value: a UTF-8 string.
18697 * Sets the @attribute to contain the given @attr_value,
18703 * g_file_info_set_attribute_stringv:
18704 * @info: a #GFileInfo.
18705 * @attribute: a file attribute key
18706 * @attr_value: (array) (element-type utf8): a %NULL terminated array of UTF-8 strings.
18708 * Sets the @attribute to contain the given @attr_value,
18716 * g_file_info_set_attribute_uint32:
18717 * @info: a #GFileInfo.
18718 * @attribute: a file attribute key.
18719 * @attr_value: an unsigned 32-bit integer.
18721 * Sets the @attribute to contain the given @attr_value,
18727 * g_file_info_set_attribute_uint64:
18728 * @info: a #GFileInfo.
18729 * @attribute: a file attribute key.
18730 * @attr_value: an unsigned 64-bit integer.
18732 * Sets the @attribute to contain the given @attr_value,
18738 * g_file_info_set_content_type:
18739 * @info: a #GFileInfo.
18740 * @content_type: a content type. See <link linkend="gio-GContentType">GContentType</link>.
18742 * Sets the content type attribute for a given #GFileInfo.
18743 * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
18748 * g_file_info_set_display_name:
18749 * @info: a #GFileInfo.
18750 * @display_name: a string containing a display name.
18752 * Sets the display name for the current #GFileInfo.
18753 * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
18758 * g_file_info_set_edit_name:
18759 * @info: a #GFileInfo.
18760 * @edit_name: a string containing an edit name.
18762 * Sets the edit name for the current file.
18763 * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
18768 * g_file_info_set_file_type:
18769 * @info: a #GFileInfo.
18770 * @type: a #GFileType.
18772 * Sets the file type in a #GFileInfo to @type.
18773 * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
18778 * g_file_info_set_icon:
18779 * @info: a #GFileInfo.
18782 * Sets the icon for a given #GFileInfo.
18783 * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
18788 * g_file_info_set_is_hidden:
18789 * @info: a #GFileInfo.
18790 * @is_hidden: a #gboolean.
18792 * Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
18793 * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
18798 * g_file_info_set_is_symlink:
18799 * @info: a #GFileInfo.
18800 * @is_symlink: a #gboolean.
18802 * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
18803 * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
18808 * g_file_info_set_modification_time:
18809 * @info: a #GFileInfo.
18810 * @mtime: a #GTimeVal.
18812 * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
18813 * info to the given time value.
18818 * g_file_info_set_name:
18819 * @info: a #GFileInfo.
18820 * @name: a string containing a name.
18822 * Sets the name attribute for the current #GFileInfo.
18823 * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
18828 * g_file_info_set_size:
18829 * @info: a #GFileInfo.
18830 * @size: a #goffset containing the file's size.
18832 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
18833 * to the given size.
18838 * g_file_info_set_sort_order:
18839 * @info: a #GFileInfo.
18840 * @sort_order: a sort order integer.
18842 * Sets the sort order attribute in the file info structure. See
18843 * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18848 * g_file_info_set_symbolic_icon:
18849 * @info: a #GFileInfo.
18852 * Sets the symbolic icon for a given #GFileInfo.
18853 * See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
18860 * g_file_info_set_symlink_target:
18861 * @info: a #GFileInfo.
18862 * @symlink_target: a static string containing a path to a symlink target.
18864 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
18865 * to the given symlink target.
18870 * g_file_info_unset_attribute_mask:
18871 * @info: #GFileInfo.
18873 * Unsets a mask set by g_file_info_set_attribute_mask(), if one
18879 * g_file_input_stream_query_info:
18880 * @stream: a #GFileInputStream.
18881 * @attributes: a file attribute query string.
18882 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18883 * @error: a #GError location to store the error occurring, or %NULL to ignore.
18885 * Queries a file input stream the given @attributes. This function blocks
18886 * while querying the stream. For the asynchronous (non-blocking) version
18887 * of this function, see g_file_input_stream_query_info_async(). While the
18888 * stream is blocked, the stream will set the pending flag internally, and
18889 * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
18891 * Returns: (transfer full): a #GFileInfo, or %NULL on error.
18896 * g_file_input_stream_query_info_async:
18897 * @stream: a #GFileInputStream.
18898 * @attributes: a file attribute query string.
18899 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18900 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18901 * @callback: (scope async): callback to call when the request is satisfied
18902 * @user_data: (closure): the data to pass to callback function
18904 * Queries the stream information asynchronously.
18905 * When the operation is finished @callback will be called.
18906 * You can then call g_file_input_stream_query_info_finish()
18907 * to get the result of the operation.
18909 * For the synchronous version of this function,
18910 * see g_file_input_stream_query_info().
18912 * If @cancellable is not %NULL, then the operation can be cancelled by
18913 * triggering the cancellable object from another thread. If the operation
18914 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set
18919 * g_file_input_stream_query_info_finish:
18920 * @stream: a #GFileInputStream.
18921 * @result: a #GAsyncResult.
18922 * @error: a #GError location to store the error occurring, or %NULL to ignore.
18924 * Finishes an asynchronous info query operation.
18926 * Returns: (transfer full): #GFileInfo.
18931 * g_file_io_stream_get_etag:
18932 * @stream: a #GFileIOStream.
18934 * Gets the entity tag for the file when it has been written.
18935 * This must be called after the stream has been written
18936 * and closed, as the etag can change while writing.
18938 * Returns: the entity tag for the stream.
18944 * g_file_io_stream_query_info:
18945 * @stream: a #GFileIOStream.
18946 * @attributes: a file attribute query string.
18947 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18948 * @error: a #GError, %NULL to ignore.
18950 * Queries a file io stream for the given @attributes.
18951 * This function blocks while querying the stream. For the asynchronous
18952 * version of this function, see g_file_io_stream_query_info_async().
18953 * While the stream is blocked, the stream will set the pending flag
18954 * internally, and any other operations on the stream will fail with
18955 * %G_IO_ERROR_PENDING.
18957 * Can fail if the stream was already closed (with @error being set to
18958 * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
18959 * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
18960 * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
18961 * all cases of failure, %NULL will be returned.
18963 * If @cancellable is not %NULL, then the operation can be cancelled by
18964 * triggering the cancellable object from another thread. If the operation
18965 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
18968 * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
18974 * g_file_io_stream_query_info_async:
18975 * @stream: a #GFileIOStream.
18976 * @attributes: a file attribute query string.
18977 * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
18978 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18979 * @callback: (scope async): callback to call when the request is satisfied
18980 * @user_data: (closure): the data to pass to callback function
18982 * Asynchronously queries the @stream for a #GFileInfo. When completed,
18983 * @callback will be called with a #GAsyncResult which can be used to
18984 * finish the operation with g_file_io_stream_query_info_finish().
18986 * For the synchronous version of this function, see
18987 * g_file_io_stream_query_info().
18994 * g_file_io_stream_query_info_finish:
18995 * @stream: a #GFileIOStream.
18996 * @result: a #GAsyncResult.
18997 * @error: a #GError, %NULL to ignore.
18999 * Finalizes the asynchronous query started
19000 * by g_file_io_stream_query_info_async().
19002 * Returns: (transfer full): A #GFileInfo for the finished query.
19008 * g_file_is_native:
19009 * @file: input #GFile
19011 * Checks to see if a file is native to the platform.
19013 * A native file s one expressed in the platform-native filename format,
19014 * e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
19015 * as it might be on a locally mounted remote filesystem.
19017 * On some systems non-native files may be available using the native
19018 * filesystem via a userspace filesystem (FUSE), in these cases this call
19019 * will return %FALSE, but g_file_get_path() will still return a native path.
19021 * This call does no blocking I/O.
19023 * Returns: %TRUE if @file is native
19028 * g_file_load_contents:
19029 * @file: input #GFile
19030 * @cancellable: optional #GCancellable object, %NULL to ignore
19031 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19032 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19033 * @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
19034 * @error: a #GError, or %NULL
19036 * Loads the content of the file into memory. The data is always
19037 * zero-terminated, but this is not included in the resultant @length.
19038 * The returned @content should be freed with g_free() when no longer
19041 * If @cancellable is not %NULL, then the operation can be cancelled by
19042 * triggering the cancellable object from another thread. If the operation
19043 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19045 * Returns: %TRUE if the @file's contents were successfully loaded. %FALSE if there were errors.
19050 * g_file_load_contents_async:
19051 * @file: input #GFile
19052 * @cancellable: optional #GCancellable object, %NULL to ignore
19053 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19054 * @user_data: the data to pass to callback function
19056 * Starts an asynchronous load of the @file's contents.
19058 * For more details, see g_file_load_contents() which is
19059 * the synchronous version of this call.
19061 * When the load operation has completed, @callback will be called
19062 * with @user data. To finish the operation, call
19063 * g_file_load_contents_finish() with the #GAsyncResult returned by
19066 * If @cancellable is not %NULL, then the operation can be cancelled by
19067 * triggering the cancellable object from another thread. If the operation
19068 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19073 * g_file_load_contents_finish:
19074 * @file: input #GFile
19075 * @res: a #GAsyncResult
19076 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19077 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19078 * @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
19079 * @error: a #GError, or %NULL
19081 * Finishes an asynchronous load of the @file's contents.
19082 * The contents are placed in @contents, and @length is set to the
19083 * size of the @contents string. The @content should be freed with
19084 * g_free() when no longer needed. If @etag_out is present, it will be
19085 * set to the new entity tag for the @file.
19087 * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19092 * g_file_load_partial_contents_async: (skip)
19093 * @file: input #GFile
19094 * @cancellable: optional #GCancellable object, %NULL to ignore
19095 * @read_more_callback: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read
19096 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19097 * @user_data: the data to pass to the callback functions
19099 * Reads the partial contents of a file. A #GFileReadMoreCallback should
19100 * be used to stop reading from the file when appropriate, else this
19101 * function will behave exactly as g_file_load_contents_async(). This
19102 * operation can be finished by g_file_load_partial_contents_finish().
19104 * Users of this function should be aware that @user_data is passed to
19105 * both the @read_more_callback and the @callback.
19107 * If @cancellable is not %NULL, then the operation can be cancelled by
19108 * triggering the cancellable object from another thread. If the operation
19109 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19114 * g_file_load_partial_contents_finish:
19115 * @file: input #GFile
19116 * @res: a #GAsyncResult
19117 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19118 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19119 * @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
19120 * @error: a #GError, or %NULL
19122 * Finishes an asynchronous partial load operation that was started
19123 * with g_file_load_partial_contents_async(). The data is always
19124 * zero-terminated, but this is not included in the resultant @length.
19125 * The returned @content should be freed with g_free() when no longer
19128 * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19133 * g_file_make_directory:
19134 * @file: input #GFile
19135 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19136 * @error: a #GError, or %NULL
19138 * Creates a directory. Note that this will only create a child directory
19139 * of the immediate parent directory of the path or URI given by the #GFile.
19140 * To recursively create directories, see g_file_make_directory_with_parents().
19141 * This function will fail if the parent directory does not exist, setting
19142 * @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support
19143 * creating directories, this function will fail, setting @error to
19144 * %G_IO_ERROR_NOT_SUPPORTED.
19146 * For a local #GFile the newly created directory will have the default
19147 * (current) ownership and permissions of the current process.
19149 * If @cancellable is not %NULL, then the operation can be cancelled by
19150 * triggering the cancellable object from another thread. If the operation
19151 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19153 * Returns: %TRUE on successful creation, %FALSE otherwise.
19158 * g_file_make_directory_async:
19159 * @file: input #GFile
19160 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19161 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19162 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19163 * @user_data: the data to pass to callback function
19165 * Asynchronously creates a directory.
19167 * Virtual: make_directory_async
19173 * g_file_make_directory_finish:
19174 * @file: input #GFile
19175 * @result: a #GAsyncResult
19176 * @error: a #GError, or %NULL
19178 * Finishes an asynchronous directory creation, started with
19179 * g_file_make_directory_async().
19181 * Virtual: make_directory_finish
19182 * Returns: %TRUE on successful directory creation, %FALSE otherwise.
19188 * g_file_make_directory_with_parents:
19189 * @file: input #GFile
19190 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19191 * @error: a #GError, or %NULL
19193 * Creates a directory and any parent directories that may not
19194 * exist similar to 'mkdir -p'. If the file system does not support
19195 * creating directories, this function will fail, setting @error to
19196 * %G_IO_ERROR_NOT_SUPPORTED. If the directory itself already exists,
19197 * this function will fail setting @error to %G_IO_ERROR_EXISTS, unlike
19198 * the similar g_mkdir_with_parents().
19200 * For a local #GFile the newly created directories will have the default
19201 * (current) ownership and permissions of the current process.
19203 * If @cancellable is not %NULL, then the operation can be cancelled by
19204 * triggering the cancellable object from another thread. If the operation
19205 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19207 * Returns: %TRUE if all directories have been successfully created, %FALSE otherwise.
19213 * g_file_make_symbolic_link:
19214 * @file: a #GFile with the name of the symlink to create
19215 * @symlink_value: a string with the path for the target of the new symlink
19216 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19217 * @error: a #GError
19219 * Creates a symbolic link named @file which contains the string
19222 * If @cancellable is not %NULL, then the operation can be cancelled by
19223 * triggering the cancellable object from another thread. If the operation
19224 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19226 * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
19231 * g_file_measure_disk_usage:
19233 * @flags: #GFileMeasureFlags
19234 * @cancellable: (allow-none): optional #GCancellable
19235 * @progress_callback: (allow-none): a #GFileMeasureProgressCallback
19236 * @progress_data: user_data for @progress_callback
19237 * @disk_usage: (allow-none) (out): the number of bytes of disk space used
19238 * @num_dirs: (allow-none) (out): the number of directories encountered
19239 * @num_files: (allow-none) (out): the number of non-directories encountered
19240 * @error: (allow-none): %NULL, or a pointer to a %NULL #GError pointer
19242 * Recursively measures the disk usage of @file.
19244 * This is essentially an analog of the '<literal>du</literal>' command,
19245 * but it also reports the number of directories and non-directory files
19246 * encountered (including things like symbolic links).
19248 * By default, errors are only reported against the toplevel file
19249 * itself. Errors found while recursing are silently ignored, unless
19250 * %G_FILE_DISK_USAGE_REPORT_ALL_ERRORS is given in @flags.
19252 * The returned size, @disk_usage, is in bytes and should be formatted
19253 * with g_format_size() in order to get something reasonable for showing
19254 * in a user interface.
19256 * @progress_callback and @progress_data can be given to request
19257 * periodic progress updates while scanning. See the documentation for
19258 * #GFileMeasureProgressCallback for information about when and how the
19259 * callback will be invoked.
19261 * Returns: %TRUE if successful, with the out parameters set. %FALSE otherwise, with @error set.
19267 * g_file_measure_disk_usage_async:
19269 * @flags: #GFileMeasureFlags
19270 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19271 * @cancellable: (allow-none): optional #GCancellable
19272 * @progress_callback: (allow-none): a #GFileMeasureProgressCallback
19273 * @progress_data: user_data for @progress_callback
19274 * @callback: (allow-none): a #GAsyncReadyCallback to call when complete
19275 * @user_data: the data to pass to callback function
19277 * Recursively measures the disk usage of @file.
19279 * This is the asynchronous version of g_file_measure_disk_usage(). See
19280 * there for more information.
19287 * g_file_measure_disk_usage_finish:
19289 * @result: the #GAsyncResult passed to your #GAsyncReadyCallback
19290 * @disk_usage: (allow-none) (out): the number of bytes of disk space used
19291 * @num_dirs: (allow-none) (out): the number of directories encountered
19292 * @num_files: (allow-none) (out): the number of non-directories encountered
19293 * @error: (allow-none): %NULL, or a pointer to a %NULL #GError pointer
19295 * Collects the results from an earlier call to
19296 * g_file_measure_disk_usage_async(). See g_file_measure_disk_usage() for
19297 * more information.
19299 * Returns: %TRUE if successful, with the out parameters set. %FALSE otherwise, with @error set.
19306 * @file: input #GFile
19307 * @flags: a set of #GFileMonitorFlags
19308 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19309 * @error: a #GError, or %NULL
19311 * Obtains a file or directory monitor for the given file,
19312 * depending on the type of the file.
19314 * If @cancellable is not %NULL, then the operation can be cancelled by
19315 * triggering the cancellable object from another thread. If the operation
19316 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19318 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19324 * g_file_monitor_cancel:
19325 * @monitor: a #GFileMonitor.
19327 * Cancels a file monitor.
19329 * Returns: %TRUE if monitor was cancelled.
19334 * g_file_monitor_directory:
19335 * @file: input #GFile
19336 * @flags: a set of #GFileMonitorFlags
19337 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19338 * @error: a #GError, or %NULL
19340 * Obtains a directory monitor for the given file.
19341 * This may fail if directory monitoring is not supported.
19343 * If @cancellable is not %NULL, then the operation can be cancelled by
19344 * triggering the cancellable object from another thread. If the operation
19345 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19347 * It does not make sense for @flags to contain
19348 * %G_FILE_MONITOR_WATCH_HARD_LINKS, since hard links can not be made to
19349 * directories. It is not possible to monitor all the files in a
19350 * directory for changes made via hard links; if you want to do this then
19351 * you must register individual watches with g_file_monitor().
19353 * Virtual: monitor_dir
19354 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19359 * g_file_monitor_emit_event:
19360 * @monitor: a #GFileMonitor.
19361 * @child: a #GFile.
19362 * @other_file: a #GFile.
19363 * @event_type: a set of #GFileMonitorEvent flags.
19365 * Emits the #GFileMonitor::changed signal if a change
19366 * has taken place. Should be called from file monitor
19367 * implementations only.
19369 * The signal will be emitted from an idle handler (in the <link
19370 * linkend="g-main-context-push-thread-default">thread-default main
19376 * g_file_monitor_file:
19377 * @file: input #GFile
19378 * @flags: a set of #GFileMonitorFlags
19379 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19380 * @error: a #GError, or %NULL
19382 * Obtains a file monitor for the given file. If no file notification
19383 * mechanism exists, then regular polling of the file is used.
19385 * If @cancellable is not %NULL, then the operation can be cancelled by
19386 * triggering the cancellable object from another thread. If the operation
19387 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19389 * If @flags contains %G_FILE_MONITOR_WATCH_HARD_LINKS then the monitor
19390 * will also attempt to report changes made to the file via another
19391 * filename (ie, a hard link). Without this flag, you can only rely on
19392 * changes made through the filename contained in @file to be
19393 * reported. Using this flag may result in an increase in resource
19394 * usage, and may not have any effect depending on the #GFileMonitor
19395 * backend and/or filesystem type.
19397 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19402 * g_file_monitor_is_cancelled:
19403 * @monitor: a #GFileMonitor
19405 * Returns whether the monitor is canceled.
19407 * Returns: %TRUE if monitor is canceled. %FALSE otherwise.
19412 * g_file_monitor_set_rate_limit:
19413 * @monitor: a #GFileMonitor.
19414 * @limit_msecs: a non-negative integer with the limit in milliseconds to poll for changes
19416 * Sets the rate limit to which the @monitor will report
19417 * consecutive change events to the same file.
19422 * g_file_mount_enclosing_volume:
19423 * @location: input #GFile
19424 * @flags: flags affecting the operation
19425 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction
19426 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19427 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19428 * @user_data: the data to pass to callback function
19430 * Starts a @mount_operation, mounting the volume that contains
19431 * the file @location.
19433 * When this operation has completed, @callback will be called with
19434 * @user_user data, and the operation can be finalized with
19435 * g_file_mount_enclosing_volume_finish().
19437 * If @cancellable is not %NULL, then the operation can be cancelled by
19438 * triggering the cancellable object from another thread. If the operation
19439 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19444 * g_file_mount_enclosing_volume_finish:
19445 * @location: input #GFile
19446 * @result: a #GAsyncResult
19447 * @error: a #GError, or %NULL
19449 * Finishes a mount operation started by g_file_mount_enclosing_volume().
19451 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19456 * g_file_mount_mountable:
19457 * @file: input #GFile
19458 * @flags: flags affecting the operation
19459 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
19460 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19461 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19462 * @user_data: (closure): the data to pass to callback function
19464 * Mounts a file of type G_FILE_TYPE_MOUNTABLE.
19465 * Using @mount_operation, you can request callbacks when, for instance,
19466 * passwords are needed during authentication.
19468 * If @cancellable is not %NULL, then the operation can be cancelled by
19469 * triggering the cancellable object from another thread. If the operation
19470 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19472 * When the operation is finished, @callback will be called.
19473 * You can then call g_file_mount_mountable_finish() to get
19474 * the result of the operation.
19479 * g_file_mount_mountable_finish:
19480 * @file: input #GFile
19481 * @result: a #GAsyncResult
19482 * @error: a #GError, or %NULL
19484 * Finishes a mount operation. See g_file_mount_mountable() for details.
19486 * Finish an asynchronous mount operation that was started
19487 * with g_file_mount_mountable().
19489 * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
19495 * @source: #GFile pointing to the source location
19496 * @destination: #GFile pointing to the destination location
19497 * @flags: set of #GFileCopyFlags
19498 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19499 * @progress_callback: (allow-none) (scope call): #GFileProgressCallback function for updates
19500 * @progress_callback_data: (closure): gpointer to user data for the callback function
19501 * @error: #GError for returning error conditions, or %NULL
19503 * Tries to move the file or directory @source to the location specified
19504 * by @destination. If native move operations are supported then this is
19505 * used, otherwise a copy + delete fallback is used. The native
19506 * implementation may support moving directories (for instance on moves
19507 * inside the same filesystem), but the fallback code does not.
19509 * If the flag #G_FILE_COPY_OVERWRITE is specified an already
19510 * existing @destination file is overwritten.
19512 * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
19513 * will be copied as symlinks, otherwise the target of the
19514 * @source symlink will be copied.
19516 * If @cancellable is not %NULL, then the operation can be cancelled by
19517 * triggering the cancellable object from another thread. If the operation
19518 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19520 * If @progress_callback is not %NULL, then the operation can be monitored
19521 * by setting this to a #GFileProgressCallback function.
19522 * @progress_callback_data will be passed to this function. It is
19523 * guaranteed that this callback will be called after all data has been
19524 * transferred with the total number of bytes copied during the operation.
19526 * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND
19527 * error is returned, independent on the status of the @destination.
19529 * If #G_FILE_COPY_OVERWRITE is not specified and the target exists,
19530 * then the error %G_IO_ERROR_EXISTS is returned.
19532 * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
19533 * error is returned. If trying to overwrite a directory with a directory the
19534 * %G_IO_ERROR_WOULD_MERGE error is returned.
19536 * If the source is a directory and the target does not exist, or
19537 * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then
19538 * the %G_IO_ERROR_WOULD_RECURSE error may be returned (if the native
19539 * move operation isn't available).
19541 * Returns: %TRUE on successful move, %FALSE otherwise.
19546 * g_file_new_for_commandline_arg:
19547 * @arg: a command line string
19549 * Creates a #GFile with the given argument from the command line.
19550 * The value of @arg can be either a URI, an absolute path or a
19551 * relative path resolved relative to the current working directory.
19552 * This operation never fails, but the returned object might not
19553 * support any I/O operation if @arg points to a malformed path.
19555 * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19560 * g_file_new_for_commandline_arg_and_cwd:
19561 * @arg: a command line string
19562 * @cwd: the current working directory of the commandline
19564 * Creates a #GFile with the given argument from the command line.
19566 * This function is similar to g_file_new_for_commandline_arg() except
19567 * that it allows for passing the current working directory as an
19568 * argument instead of using the current working directory of the
19571 * This is useful if the commandline argument was given in a context
19572 * other than the invocation of the current process.
19574 * See also g_application_command_line_create_file_for_arg().
19576 * Returns: (transfer full): a new #GFile
19582 * g_file_new_for_path:
19583 * @path: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
19585 * Constructs a #GFile for a given path. This operation never
19586 * fails, but the returned object might not support any I/O
19587 * operation if @path is malformed.
19589 * Returns: (transfer full): a new #GFile for the given @path. Free the returned object with g_object_unref().
19594 * g_file_new_for_uri:
19595 * @uri: a UTF-8 string containing a URI
19597 * Constructs a #GFile for a given URI. This operation never
19598 * fails, but the returned object might not support any I/O
19599 * operation if @uri is malformed or if the uri type is
19602 * Returns: (transfer full): a new #GFile for the given @uri. Free the returned object with g_object_unref().
19608 * @tmpl: (type filename) (allow-none): Template for the file name, as in g_file_open_tmp(), or %NULL for a default template
19609 * @iostream: (out): on return, a #GFileIOStream for the created file
19610 * @error: a #GError, or %NULL
19612 * Opens a file in the preferred directory for temporary files (as
19613 * returned by g_get_tmp_dir()) and returns a #GFile and
19614 * #GFileIOStream pointing to it.
19616 * @tmpl should be a string in the GLib file name encoding
19617 * containing a sequence of six 'X' characters, and containing no
19618 * directory components. If it is %NULL, a default template is used.
19620 * Unlike the other #GFile constructors, this will return %NULL if
19621 * a temporary file could not be created.
19623 * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19629 * g_file_open_readwrite:
19630 * @file: #GFile to open
19631 * @cancellable: (allow-none): a #GCancellable
19632 * @error: a #GError, or %NULL
19634 * Opens an existing file for reading and writing. The result is
19635 * a #GFileIOStream that can be used to read and write the contents
19638 * If @cancellable is not %NULL, then the operation can be cancelled
19639 * by triggering the cancellable object from another thread. If the
19640 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19643 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19644 * be returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
19645 * error will be returned. Other errors are possible too, and depend on
19646 * what kind of filesystem the file is on. Note that in many non-local
19647 * file cases read and write streams are not supported, so make sure you
19648 * really need to do read and write streaming, rather than just opening
19649 * for reading or writing.
19651 * Returns: (transfer full): #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19657 * g_file_open_readwrite_async:
19658 * @file: input #GFile
19659 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19660 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19661 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19662 * @user_data: (closure): the data to pass to callback function
19664 * Asynchronously opens @file for reading and writing.
19666 * For more details, see g_file_open_readwrite() which is
19667 * the synchronous version of this call.
19669 * When the operation is finished, @callback will be called.
19670 * You can then call g_file_open_readwrite_finish() to get
19671 * the result of the operation.
19678 * g_file_open_readwrite_finish:
19679 * @file: input #GFile
19680 * @res: a #GAsyncResult
19681 * @error: a #GError, or %NULL
19683 * Finishes an asynchronous file read operation started with
19684 * g_file_open_readwrite_async().
19686 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19692 * g_file_output_stream_get_etag:
19693 * @stream: a #GFileOutputStream.
19695 * Gets the entity tag for the file when it has been written.
19696 * This must be called after the stream has been written
19697 * and closed, as the etag can change while writing.
19699 * Returns: the entity tag for the stream.
19704 * g_file_output_stream_query_info:
19705 * @stream: a #GFileOutputStream.
19706 * @attributes: a file attribute query string.
19707 * @cancellable: optional #GCancellable object, %NULL to ignore.
19708 * @error: a #GError, %NULL to ignore.
19710 * Queries a file output stream for the given @attributes.
19711 * This function blocks while querying the stream. For the asynchronous
19712 * version of this function, see g_file_output_stream_query_info_async().
19713 * While the stream is blocked, the stream will set the pending flag
19714 * internally, and any other operations on the stream will fail with
19715 * %G_IO_ERROR_PENDING.
19717 * Can fail if the stream was already closed (with @error being set to
19718 * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19719 * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19720 * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
19721 * all cases of failure, %NULL will be returned.
19723 * If @cancellable is not %NULL, then the operation can be cancelled by
19724 * triggering the cancellable object from another thread. If the operation
19725 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19728 * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19733 * g_file_output_stream_query_info_async:
19734 * @stream: a #GFileOutputStream.
19735 * @attributes: a file attribute query string.
19736 * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19737 * @cancellable: optional #GCancellable object, %NULL to ignore.
19738 * @callback: callback to call when the request is satisfied
19739 * @user_data: the data to pass to callback function
19741 * Asynchronously queries the @stream for a #GFileInfo. When completed,
19742 * @callback will be called with a #GAsyncResult which can be used to
19743 * finish the operation with g_file_output_stream_query_info_finish().
19745 * For the synchronous version of this function, see
19746 * g_file_output_stream_query_info().
19751 * g_file_output_stream_query_info_finish:
19752 * @stream: a #GFileOutputStream.
19753 * @result: a #GAsyncResult.
19754 * @error: a #GError, %NULL to ignore.
19756 * Finalizes the asynchronous query started
19757 * by g_file_output_stream_query_info_async().
19759 * Returns: (transfer full): A #GFileInfo for the finished query.
19764 * g_file_parse_name:
19765 * @parse_name: a file name or path to be parsed
19767 * Constructs a #GFile with the given @parse_name (i.e. something
19768 * given by g_file_get_parse_name()). This operation never fails,
19769 * but the returned object might not support any I/O operation if
19770 * the @parse_name cannot be parsed.
19772 * Returns: (transfer full): a new #GFile.
19777 * g_file_poll_mountable:
19778 * @file: input #GFile
19779 * @cancellable: optional #GCancellable object, %NULL to ignore
19780 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19781 * @user_data: the data to pass to callback function
19783 * Polls a file of type #G_FILE_TYPE_MOUNTABLE.
19785 * If @cancellable is not %NULL, then the operation can be cancelled by
19786 * triggering the cancellable object from another thread. If the operation
19787 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19789 * When the operation is finished, @callback will be called.
19790 * You can then call g_file_mount_mountable_finish() to get
19791 * the result of the operation.
19798 * g_file_poll_mountable_finish:
19799 * @file: input #GFile
19800 * @result: a #GAsyncResult
19801 * @error: a #GError, or %NULL
19803 * Finishes a poll operation. See g_file_poll_mountable() for details.
19805 * Finish an asynchronous poll operation that was polled
19806 * with g_file_poll_mountable().
19808 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
19814 * g_file_query_default_handler:
19815 * @file: a #GFile to open
19816 * @cancellable: optional #GCancellable object, %NULL to ignore
19817 * @error: a #GError, or %NULL
19819 * Returns the #GAppInfo that is registered as the default
19820 * application to handle the file specified by @file.
19822 * If @cancellable is not %NULL, then the operation can be cancelled by
19823 * triggering the cancellable object from another thread. If the operation
19824 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19826 * Returns: (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()
19831 * g_file_query_exists:
19832 * @file: input #GFile
19833 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19835 * Utility function to check if a particular file exists. This is
19836 * implemented using g_file_query_info() and as such does blocking I/O.
19838 * Note that in many cases it is racy to first check for file existence
19839 * and then execute something based on the outcome of that, because the
19840 * file might have been created or removed in between the operations. The
19841 * general approach to handling that is to not check, but just do the
19842 * operation and handle the errors as they come.
19844 * As an example of race-free checking, take the case of reading a file,
19845 * and if it doesn't exist, creating it. There are two racy versions: read
19846 * it, and on error create it; and: check if it exists, if not create it.
19847 * These can both result in two processes creating the file (with perhaps
19848 * a partially written file as the result). The correct approach is to
19849 * always try to create the file with g_file_create() which will either
19850 * atomically create the file or fail with a %G_IO_ERROR_EXISTS error.
19852 * However, in many cases an existence check is useful in a user interface,
19853 * for instance to make a menu item sensitive/insensitive, so that you don't
19854 * have to fool users that something is possible and then just show an error
19855 * dialog. If you do this, you should make sure to also handle the errors
19856 * that can happen due to races when you execute the operation.
19858 * Returns: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
19863 * g_file_query_file_type:
19864 * @file: input #GFile
19865 * @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info()
19866 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19868 * Utility function to inspect the #GFileType of a file. This is
19869 * implemented using g_file_query_info() and as such does blocking I/O.
19871 * The primary use case of this method is to check if a file is
19872 * a regular file, directory, or symlink.
19874 * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist
19880 * g_file_query_filesystem_info:
19881 * @file: input #GFile
19882 * @attributes: an attribute query string
19883 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19884 * @error: a #GError
19886 * Similar to g_file_query_info(), but obtains information
19887 * about the filesystem the @file is on, rather than the file itself.
19888 * For instance the amount of space available and the type of
19891 * The @attributes value is a string that specifies the attributes
19892 * that should be gathered. It is not an error if it's not possible
19893 * to read a particular requested attribute from a file - it just
19894 * won't be set. @attributes should be a comma-separated list of
19895 * attributes or attribute wildcards. The wildcard "*" means all
19896 * attributes, and a wildcard like "filesystem::*" means all attributes
19897 * in the filesystem namespace. The standard namespace for filesystem
19898 * attributes is "filesystem". Common attributes of interest are
19899 * #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem
19900 * in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available),
19901 * and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
19903 * If @cancellable is not %NULL, then the operation can be cancelled
19904 * by triggering the cancellable object from another thread. If the
19905 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19908 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19909 * be returned. Other errors are possible too, and depend on what
19910 * kind of filesystem the file is on.
19912 * Returns: (transfer full): a #GFileInfo or %NULL if there was an error. Free the returned object with g_object_unref().
19917 * g_file_query_filesystem_info_async:
19918 * @file: input #GFile
19919 * @attributes: an attribute query string
19920 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19921 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19922 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19923 * @user_data: (closure): the data to pass to callback function
19925 * Asynchronously gets the requested information about the filesystem
19926 * that the specified @file is on. The result is a #GFileInfo object
19927 * that contains key-value attributes (such as type or size for the
19930 * For more details, see g_file_query_filesystem_info() which is the
19931 * synchronous version of this call.
19933 * When the operation is finished, @callback will be called. You can
19934 * then call g_file_query_info_finish() to get the result of the
19940 * g_file_query_filesystem_info_finish:
19941 * @file: input #GFile
19942 * @res: a #GAsyncResult
19943 * @error: a #GError
19945 * Finishes an asynchronous filesystem info query.
19946 * See g_file_query_filesystem_info_async().
19948 * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19953 * g_file_query_info:
19954 * @file: input #GFile
19955 * @attributes: an attribute query string
19956 * @flags: a set of #GFileQueryInfoFlags
19957 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19958 * @error: a #GError
19960 * Gets the requested information about specified @file.
19961 * The result is a #GFileInfo object that contains key-value
19962 * attributes (such as the type or size of the file).
19964 * The @attributes value is a string that specifies the file
19965 * attributes that should be gathered. It is not an error if
19966 * it's not possible to read a particular requested attribute
19967 * from a file - it just won't be set. @attributes should be a
19968 * comma-separated list of attributes or attribute wildcards.
19969 * The wildcard "*" means all attributes, and a wildcard like
19970 * "standard::*" means all attributes in the standard namespace.
19971 * An example attribute query be "standard::*,owner::user".
19972 * The standard attributes are available as defines, like
19973 * #G_FILE_ATTRIBUTE_STANDARD_NAME.
19975 * If @cancellable is not %NULL, then the operation can be cancelled
19976 * by triggering the cancellable object from another thread. If the
19977 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19980 * For symlinks, normally the information about the target of the
19981 * symlink is returned, rather than information about the symlink
19982 * itself. However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS
19983 * in @flags the information about the symlink itself will be returned.
19984 * Also, for symlinks that point to non-existing files the information
19985 * about the symlink itself will be returned.
19987 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
19988 * returned. Other errors are possible too, and depend on what kind of
19989 * filesystem the file is on.
19991 * Returns: (transfer full): a #GFileInfo for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19996 * g_file_query_info_async:
19997 * @file: input #GFile
19998 * @attributes: an attribute query string
19999 * @flags: a set of #GFileQueryInfoFlags
20000 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20001 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20002 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20003 * @user_data: (closure): the data to pass to callback function
20005 * Asynchronously gets the requested information about specified @file.
20006 * The result is a #GFileInfo object that contains key-value attributes
20007 * (such as type or size for the file).
20009 * For more details, see g_file_query_info() which is the synchronous
20010 * version of this call.
20012 * When the operation is finished, @callback will be called. You can
20013 * then call g_file_query_info_finish() to get the result of the operation.
20018 * g_file_query_info_finish:
20019 * @file: input #GFile
20020 * @res: a #GAsyncResult
20021 * @error: a #GError
20023 * Finishes an asynchronous file info query.
20024 * See g_file_query_info_async().
20026 * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
20031 * g_file_query_settable_attributes:
20032 * @file: input #GFile
20033 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20034 * @error: a #GError, or %NULL
20036 * Obtain the list of settable attributes for the file.
20038 * Returns the type and full attribute name of all the attributes
20039 * that can be set on this file. This doesn't mean setting it will
20040 * always succeed though, you might get an access failure, or some
20041 * specific file may not support a specific attribute.
20043 * If @cancellable is not %NULL, then the operation can be cancelled by
20044 * triggering the cancellable object from another thread. If the operation
20045 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20047 * Returns: a #GFileAttributeInfoList describing the settable attributes. When you are done with it, release it with g_file_attribute_info_list_unref()
20052 * g_file_query_writable_namespaces:
20053 * @file: input #GFile
20054 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20055 * @error: a #GError, or %NULL
20057 * Obtain the list of attribute namespaces where new attributes
20058 * can be created by a user. An example of this is extended
20059 * attributes (in the "xattr" namespace).
20061 * If @cancellable is not %NULL, then the operation can be cancelled by
20062 * triggering the cancellable object from another thread. If the operation
20063 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20065 * Returns: a #GFileAttributeInfoList describing the writable namespaces. When you are done with it, release it with g_file_attribute_info_list_unref()
20071 * @file: #GFile to read
20072 * @cancellable: (allow-none): a #GCancellable
20073 * @error: a #GError, or %NULL
20075 * Opens a file for reading. The result is a #GFileInputStream that
20076 * can be used to read the contents of the file.
20078 * If @cancellable is not %NULL, then the operation can be cancelled by
20079 * triggering the cancellable object from another thread. If the operation
20080 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20082 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
20083 * returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
20084 * error will be returned. Other errors are possible too, and depend
20085 * on what kind of filesystem the file is on.
20088 * Returns: (transfer full): #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20093 * g_file_read_async:
20094 * @file: input #GFile
20095 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20096 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20097 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20098 * @user_data: (closure): the data to pass to callback function
20100 * Asynchronously opens @file for reading.
20102 * For more details, see g_file_read() which is
20103 * the synchronous version of this call.
20105 * When the operation is finished, @callback will be called.
20106 * You can then call g_file_read_finish() to get the result
20107 * of the operation.
20112 * g_file_read_finish:
20113 * @file: input #GFile
20114 * @res: a #GAsyncResult
20115 * @error: a #GError, or %NULL
20117 * Finishes an asynchronous file read operation started with
20118 * g_file_read_async().
20120 * Returns: (transfer full): a #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20126 * @file: input #GFile
20127 * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20128 * @make_backup: %TRUE if a backup should be created
20129 * @flags: a set of #GFileCreateFlags
20130 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20131 * @error: a #GError, or %NULL
20133 * Returns an output stream for overwriting the file, possibly
20134 * creating a backup copy of the file first. If the file doesn't exist,
20135 * it will be created.
20137 * This will try to replace the file in the safest way possible so
20138 * that any errors during the writing will not affect an already
20139 * existing copy of the file. For instance, for local files it
20140 * may write to a temporary file and then atomically rename over
20141 * the destination when the stream is closed.
20143 * By default files created are generally readable by everyone,
20144 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
20145 * will be made readable only to the current user, to the level that
20146 * is supported on the target filesystem.
20148 * If @cancellable is not %NULL, then the operation can be cancelled
20149 * by triggering the cancellable object from another thread. If the
20150 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20153 * If you pass in a non-%NULL @etag value, then this value is
20154 * compared to the current entity tag of the file, and if they differ
20155 * an %G_IO_ERROR_WRONG_ETAG error is returned. This generally means
20156 * that the file has been changed since you last read it. You can get
20157 * the new etag from g_file_output_stream_get_etag() after you've
20158 * finished writing and closed the #GFileOutputStream. When you load
20159 * a new file you can use g_file_input_stream_query_info() to get
20160 * the etag of the file.
20162 * If @make_backup is %TRUE, this function will attempt to make a
20163 * backup of the current file before overwriting it. If this fails
20164 * a %G_IO_ERROR_CANT_CREATE_BACKUP error will be returned. If you
20165 * want to replace anyway, try again with @make_backup set to %FALSE.
20167 * If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will
20168 * be returned, and if the file is some other form of non-regular file
20169 * then a %G_IO_ERROR_NOT_REGULAR_FILE error will be returned. Some
20170 * file systems don't allow all file names, and may return an
20171 * %G_IO_ERROR_INVALID_FILENAME error, and if the name is to long
20172 * %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are
20173 * possible too, and depend on what kind of filesystem the file is on.
20175 * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
20180 * g_file_replace_async:
20181 * @file: input #GFile
20182 * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20183 * @make_backup: %TRUE if a backup should be created
20184 * @flags: a set of #GFileCreateFlags
20185 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20186 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20187 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20188 * @user_data: (closure): the data to pass to callback function
20190 * Asynchronously overwrites the file, replacing the contents,
20191 * possibly creating a backup copy of the file first.
20193 * For more details, see g_file_replace() which is
20194 * the synchronous version of this call.
20196 * When the operation is finished, @callback will be called.
20197 * You can then call g_file_replace_finish() to get the result
20198 * of the operation.
20203 * g_file_replace_contents:
20204 * @file: input #GFile
20205 * @contents: (element-type guint8) (array length=length): a string containing the new contents for @file
20206 * @length: the length of @contents in bytes
20207 * @etag: (allow-none): the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
20208 * @make_backup: %TRUE if a backup should be created
20209 * @flags: a set of #GFileCreateFlags
20210 * @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
20211 * @cancellable: optional #GCancellable object, %NULL to ignore
20212 * @error: a #GError, or %NULL
20214 * Replaces the contents of @file with @contents of @length bytes.
20216 * If @etag is specified (not %NULL), any existing file must have that etag,
20217 * or the error %G_IO_ERROR_WRONG_ETAG will be returned.
20219 * If @make_backup is %TRUE, this function will attempt to make a backup
20222 * If @cancellable is not %NULL, then the operation can be cancelled by
20223 * triggering the cancellable object from another thread. If the operation
20224 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20226 * The returned @new_etag can be used to verify that the file hasn't
20227 * changed the next time it is saved over.
20229 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
20234 * g_file_replace_contents_async:
20235 * @file: input #GFile
20236 * @contents: (element-type guint8) (array length=length): string of contents to replace the file with
20237 * @length: the length of @contents in bytes
20238 * @etag: (allow-none): a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
20239 * @make_backup: %TRUE if a backup should be created
20240 * @flags: a set of #GFileCreateFlags
20241 * @cancellable: optional #GCancellable object, %NULL to ignore
20242 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
20243 * @user_data: the data to pass to callback function
20245 * Starts an asynchronous replacement of @file with the given
20246 * @contents of @length bytes. @etag will replace the document's
20247 * current entity tag.
20249 * When this operation has completed, @callback will be called with
20250 * @user_user data, and the operation can be finalized with
20251 * g_file_replace_contents_finish().
20253 * If @cancellable is not %NULL, then the operation can be cancelled by
20254 * triggering the cancellable object from another thread. If the operation
20255 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20257 * If @make_backup is %TRUE, this function will attempt to
20258 * make a backup of @file.
20263 * g_file_replace_contents_finish:
20264 * @file: input #GFile
20265 * @res: a #GAsyncResult
20266 * @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
20267 * @error: a #GError, or %NULL
20269 * Finishes an asynchronous replace of the given @file. See
20270 * g_file_replace_contents_async(). Sets @new_etag to the new entity
20271 * tag for the document, if present.
20273 * Returns: %TRUE on success, %FALSE on failure.
20278 * g_file_replace_finish:
20279 * @file: input #GFile
20280 * @res: a #GAsyncResult
20281 * @error: a #GError, or %NULL
20283 * Finishes an asynchronous file replace operation started with
20284 * g_file_replace_async().
20286 * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
20291 * g_file_replace_readwrite:
20293 * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20294 * @make_backup: %TRUE if a backup should be created
20295 * @flags: a set of #GFileCreateFlags
20296 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20297 * @error: return location for a #GError, or %NULL
20299 * Returns an output stream for overwriting the file in readwrite mode,
20300 * possibly creating a backup copy of the file first. If the file doesn't
20301 * exist, it will be created.
20303 * For details about the behaviour, see g_file_replace() which does the
20304 * same thing but returns an output stream only.
20306 * Note that in many non-local file cases read and write streams are not
20307 * supported, so make sure you really need to do read and write streaming,
20308 * rather than just opening for reading or writing.
20310 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20316 * g_file_replace_readwrite_async:
20317 * @file: input #GFile
20318 * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20319 * @make_backup: %TRUE if a backup should be created
20320 * @flags: a set of #GFileCreateFlags
20321 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20322 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20323 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20324 * @user_data: (closure): the data to pass to callback function
20326 * Asynchronously overwrites the file in read-write mode,
20327 * replacing the contents, possibly creating a backup copy
20328 * of the file first.
20330 * For more details, see g_file_replace_readwrite() which is
20331 * the synchronous version of this call.
20333 * When the operation is finished, @callback will be called.
20334 * You can then call g_file_replace_readwrite_finish() to get
20335 * the result of the operation.
20342 * g_file_replace_readwrite_finish:
20343 * @file: input #GFile
20344 * @res: a #GAsyncResult
20345 * @error: a #GError, or %NULL
20347 * Finishes an asynchronous file replace operation started with
20348 * g_file_replace_readwrite_async().
20350 * Returns: (transfer full): a #GFileIOStream, or %NULL on error. Free the returned object with g_object_unref().
20356 * g_file_resolve_relative_path:
20357 * @file: input #GFile
20358 * @relative_path: a given relative path string
20360 * Resolves a relative path for @file to an absolute path.
20362 * This call does no blocking I/O.
20364 * 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().
20369 * g_file_set_attribute:
20370 * @file: input #GFile
20371 * @attribute: a string containing the attribute's name
20372 * @type: The type of the attribute
20373 * @value_p: (allow-none): a pointer to the value (or the pointer itself if the type is a pointer type)
20374 * @flags: a set of #GFileQueryInfoFlags
20375 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20376 * @error: a #GError, or %NULL
20378 * Sets an attribute in the file with attribute name @attribute to @value.
20380 * Some attributes can be unset by setting @attribute to
20381 * %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
20383 * If @cancellable is not %NULL, then the operation can be cancelled by
20384 * triggering the cancellable object from another thread. If the operation
20385 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20387 * Returns: %TRUE if the attribute was set, %FALSE otherwise.
20392 * g_file_set_attribute_byte_string:
20393 * @file: input #GFile
20394 * @attribute: a string containing the attribute's name
20395 * @value: a string containing the attribute's new value
20396 * @flags: a #GFileQueryInfoFlags
20397 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20398 * @error: a #GError, or %NULL
20400 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
20401 * If @attribute is of a different type, this operation will fail,
20402 * returning %FALSE.
20404 * If @cancellable is not %NULL, then the operation can be cancelled by
20405 * triggering the cancellable object from another thread. If the operation
20406 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20408 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20413 * g_file_set_attribute_int32:
20414 * @file: input #GFile
20415 * @attribute: a string containing the attribute's name
20416 * @value: a #gint32 containing the attribute's new value
20417 * @flags: a #GFileQueryInfoFlags
20418 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20419 * @error: a #GError, or %NULL
20421 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
20422 * If @attribute is of a different type, this operation will fail.
20424 * If @cancellable is not %NULL, then the operation can be cancelled by
20425 * triggering the cancellable object from another thread. If the operation
20426 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20428 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20433 * g_file_set_attribute_int64:
20434 * @file: input #GFile
20435 * @attribute: a string containing the attribute's name
20436 * @value: a #guint64 containing the attribute's new value
20437 * @flags: a #GFileQueryInfoFlags
20438 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20439 * @error: a #GError, or %NULL
20441 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
20442 * If @attribute is of a different type, this operation will fail.
20444 * If @cancellable is not %NULL, then the operation can be cancelled by
20445 * triggering the cancellable object from another thread. If the operation
20446 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20448 * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20453 * g_file_set_attribute_string:
20454 * @file: input #GFile
20455 * @attribute: a string containing the attribute's name
20456 * @value: a string containing the attribute's value
20457 * @flags: #GFileQueryInfoFlags
20458 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20459 * @error: a #GError, or %NULL
20461 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
20462 * If @attribute is of a different type, this operation will fail.
20464 * If @cancellable is not %NULL, then the operation can be cancelled by
20465 * triggering the cancellable object from another thread. If the operation
20466 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20468 * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20473 * g_file_set_attribute_uint32:
20474 * @file: input #GFile
20475 * @attribute: a string containing the attribute's name
20476 * @value: a #guint32 containing the attribute's new value
20477 * @flags: a #GFileQueryInfoFlags
20478 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20479 * @error: a #GError, or %NULL
20481 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
20482 * If @attribute is of a different type, this operation will fail.
20484 * If @cancellable is not %NULL, then the operation can be cancelled by
20485 * triggering the cancellable object from another thread. If the operation
20486 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20488 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20493 * g_file_set_attribute_uint64:
20494 * @file: input #GFile
20495 * @attribute: a string containing the attribute's name
20496 * @value: a #guint64 containing the attribute's new value
20497 * @flags: a #GFileQueryInfoFlags
20498 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20499 * @error: a #GError, or %NULL
20501 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
20502 * If @attribute is of a different type, this operation will fail.
20504 * If @cancellable is not %NULL, then the operation can be cancelled by
20505 * triggering the cancellable object from another thread. If the operation
20506 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20508 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20513 * g_file_set_attributes_async:
20514 * @file: input #GFile
20515 * @info: a #GFileInfo
20516 * @flags: a #GFileQueryInfoFlags
20517 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20518 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20519 * @callback: (scope async): a #GAsyncReadyCallback
20520 * @user_data: (closure): a #gpointer
20522 * Asynchronously sets the attributes of @file with @info.
20524 * For more details, see g_file_set_attributes_from_info(),
20525 * which is the synchronous version of this call.
20527 * When the operation is finished, @callback will be called.
20528 * You can then call g_file_set_attributes_finish() to get
20529 * the result of the operation.
20534 * g_file_set_attributes_finish:
20535 * @file: input #GFile
20536 * @result: a #GAsyncResult
20537 * @info: (out) (transfer full): a #GFileInfo
20538 * @error: a #GError, or %NULL
20540 * Finishes setting an attribute started in g_file_set_attributes_async().
20542 * Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
20547 * g_file_set_attributes_from_info:
20548 * @file: input #GFile
20549 * @info: a #GFileInfo
20550 * @flags: #GFileQueryInfoFlags
20551 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20552 * @error: a #GError, or %NULL
20554 * Tries to set all attributes in the #GFileInfo on the target
20555 * values, not stopping on the first error.
20557 * If there is any error during this operation then @error will
20558 * be set to the first error. Error on particular fields are flagged
20559 * by setting the "status" field in the attribute value to
20560 * %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can
20561 * also detect further errors.
20563 * If @cancellable is not %NULL, then the operation can be cancelled by
20564 * triggering the cancellable object from another thread. If the operation
20565 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20567 * Returns: %FALSE if there was any error, %TRUE otherwise.
20572 * g_file_set_display_name:
20573 * @file: input #GFile
20574 * @display_name: a string
20575 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20576 * @error: a #GError, or %NULL
20578 * Renames @file to the specified display name.
20580 * The display name is converted from UTF-8 to the correct encoding
20581 * for the target filesystem if possible and the @file is renamed to this.
20583 * If you want to implement a rename operation in the user interface the
20584 * edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
20585 * initial value in the rename widget, and then the result after editing
20586 * should be passed to g_file_set_display_name().
20588 * On success the resulting converted filename is returned.
20590 * If @cancellable is not %NULL, then the operation can be cancelled by
20591 * triggering the cancellable object from another thread. If the operation
20592 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20594 * 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().
20599 * g_file_set_display_name_async:
20600 * @file: input #GFile
20601 * @display_name: a string
20602 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20603 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20604 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20605 * @user_data: (closure): the data to pass to callback function
20607 * Asynchronously sets the display name for a given #GFile.
20609 * For more details, see g_file_set_display_name() which is
20610 * the synchronous version of this call.
20612 * When the operation is finished, @callback will be called.
20613 * You can then call g_file_set_display_name_finish() to get
20614 * the result of the operation.
20619 * g_file_set_display_name_finish:
20620 * @file: input #GFile
20621 * @res: a #GAsyncResult
20622 * @error: a #GError, or %NULL
20624 * Finishes setting a display name started with
20625 * g_file_set_display_name_async().
20627 * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
20632 * g_file_start_mountable:
20633 * @file: input #GFile
20634 * @flags: flags affecting the operation
20635 * @start_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20636 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20637 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20638 * @user_data: the data to pass to callback function
20640 * Starts a file of type #G_FILE_TYPE_MOUNTABLE.
20641 * Using @start_operation, you can request callbacks when, for instance,
20642 * passwords are needed during authentication.
20644 * If @cancellable is not %NULL, then the operation can be cancelled by
20645 * triggering the cancellable object from another thread. If the operation
20646 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20648 * When the operation is finished, @callback will be called.
20649 * You can then call g_file_mount_mountable_finish() to get
20650 * the result of the operation.
20657 * g_file_start_mountable_finish:
20658 * @file: input #GFile
20659 * @result: a #GAsyncResult
20660 * @error: a #GError, or %NULL
20662 * Finishes a start operation. See g_file_start_mountable() for details.
20664 * Finish an asynchronous start operation that was started
20665 * with g_file_start_mountable().
20667 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20673 * g_file_stop_mountable:
20674 * @file: input #GFile
20675 * @flags: flags affecting the operation
20676 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
20677 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20678 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20679 * @user_data: the data to pass to callback function
20681 * Stops a file of type #G_FILE_TYPE_MOUNTABLE.
20683 * If @cancellable is not %NULL, then the operation can be cancelled by
20684 * triggering the cancellable object from another thread. If the operation
20685 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20687 * When the operation is finished, @callback will be called.
20688 * You can then call g_file_stop_mountable_finish() to get
20689 * the result of the operation.
20696 * g_file_stop_mountable_finish:
20697 * @file: input #GFile
20698 * @result: a #GAsyncResult
20699 * @error: a #GError, or %NULL
20701 * Finishes an stop operation, see g_file_stop_mountable() for details.
20703 * Finish an asynchronous stop operation that was started
20704 * with g_file_stop_mountable().
20706 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20712 * g_file_supports_thread_contexts:
20715 * Checks if @file supports <link
20716 * linkend="g-main-context-push-thread-default-context">thread-default
20717 * contexts</link>. If this returns %FALSE, you cannot perform
20718 * asynchronous operations on @file in a thread that has a
20719 * thread-default context.
20721 * Returns: Whether or not @file supports thread-default contexts.
20728 * @file: #GFile to send to trash
20729 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20730 * @error: a #GError, or %NULL
20732 * Sends @file to the "Trashcan", if possible. This is similar to
20733 * deleting it, but the user can recover it before emptying the trashcan.
20734 * Not all file systems support trashing, so this call can return the
20735 * %G_IO_ERROR_NOT_SUPPORTED error.
20737 * If @cancellable is not %NULL, then the operation can be cancelled by
20738 * triggering the cancellable object from another thread. If the operation
20739 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20742 * Returns: %TRUE on successful trash, %FALSE otherwise.
20747 * g_file_trash_async:
20748 * @file: input #GFile
20749 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20750 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20751 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
20752 * @user_data: the data to pass to callback function
20754 * Asynchronously sends @file to the Trash location, if possible.
20756 * Virtual: trash_async
20762 * g_file_trash_finish:
20763 * @file: input #GFile
20764 * @result: a #GAsyncResult
20765 * @error: a #GError, or %NULL
20767 * Finishes an asynchronous file trashing operation, started with
20768 * g_file_trash_async().
20770 * Virtual: trash_finish
20771 * Returns: %TRUE on successful trash, %FALSE otherwise.
20777 * g_file_unmount_mountable:
20778 * @file: input #GFile
20779 * @flags: flags affecting the operation
20780 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20781 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20782 * @user_data: (closure): the data to pass to callback function
20784 * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
20786 * If @cancellable is not %NULL, then the operation can be cancelled by
20787 * triggering the cancellable object from another thread. If the operation
20788 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20790 * When the operation is finished, @callback will be called.
20791 * You can then call g_file_unmount_mountable_finish() to get
20792 * the result of the operation.
20794 * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation() instead.
20799 * g_file_unmount_mountable_finish:
20800 * @file: input #GFile
20801 * @result: a #GAsyncResult
20802 * @error: a #GError, or %NULL
20804 * Finishes an unmount operation, see g_file_unmount_mountable() for details.
20806 * Finish an asynchronous unmount operation that was started
20807 * with g_file_unmount_mountable().
20809 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20810 * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation_finish() instead.
20815 * g_file_unmount_mountable_with_operation:
20816 * @file: input #GFile
20817 * @flags: flags affecting the operation
20818 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20819 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20820 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20821 * @user_data: (closure): the data to pass to callback function
20823 * Unmounts a file of type #G_FILE_TYPE_MOUNTABLE.
20825 * If @cancellable is not %NULL, then the operation can be cancelled by
20826 * triggering the cancellable object from another thread. If the operation
20827 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20829 * When the operation is finished, @callback will be called.
20830 * You can then call g_file_unmount_mountable_finish() to get
20831 * the result of the operation.
20838 * g_file_unmount_mountable_with_operation_finish:
20839 * @file: input #GFile
20840 * @result: a #GAsyncResult
20841 * @error: a #GError, or %NULL
20843 * Finishes an unmount operation,
20844 * see g_file_unmount_mountable_with_operation() for details.
20846 * Finish an asynchronous unmount operation that was started
20847 * with g_file_unmount_mountable_with_operation().
20849 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20855 * g_filename_completer_get_completion_suffix:
20856 * @completer: the filename completer.
20857 * @initial_text: text to be completed.
20859 * Obtains a completion for @initial_text from @completer.
20861 * 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.
20866 * g_filename_completer_get_completions:
20867 * @completer: the filename completer.
20868 * @initial_text: text to be completed.
20870 * Gets an array of completion strings for a given initial text.
20872 * 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.
20877 * g_filename_completer_new:
20879 * Creates a new filename completer.
20881 * Returns: a #GFilenameCompleter.
20886 * g_filename_completer_set_dirs_only:
20887 * @completer: the filename completer.
20888 * @dirs_only: a #gboolean.
20890 * If @dirs_only is %TRUE, @completer will only
20891 * complete directory names, and not file names.
20896 * g_filter_input_stream_get_base_stream:
20897 * @stream: a #GFilterInputStream.
20899 * Gets the base stream for the filter stream.
20901 * Returns: (transfer none): a #GInputStream.
20906 * g_filter_input_stream_get_close_base_stream:
20907 * @stream: a #GFilterInputStream.
20909 * Returns whether the base stream will be closed when @stream is
20912 * Returns: %TRUE if the base stream will be closed.
20917 * g_filter_input_stream_set_close_base_stream:
20918 * @stream: a #GFilterInputStream.
20919 * @close_base: %TRUE to close the base stream.
20921 * Sets whether the base stream will be closed when @stream is closed.
20926 * g_filter_output_stream_get_base_stream:
20927 * @stream: a #GFilterOutputStream.
20929 * Gets the base stream for the filter stream.
20931 * Returns: (transfer none): a #GOutputStream.
20936 * g_filter_output_stream_get_close_base_stream:
20937 * @stream: a #GFilterOutputStream.
20939 * Returns whether the base stream will be closed when @stream is
20942 * Returns: %TRUE if the base stream will be closed.
20947 * g_filter_output_stream_set_close_base_stream:
20948 * @stream: a #GFilterOutputStream.
20949 * @close_base: %TRUE to close the base stream.
20951 * Sets whether the base stream will be closed when @stream is closed.
20956 * g_icon_deserialize:
20957 * @value: a #GVariant created with g_icon_serialize()
20959 * Deserializes a #GIcon previously serialized using g_icon_serialize().
20961 * Returns: (transfer full): a #GIcon, or %NULL when deserialization fails.
20968 * @icon1: (allow-none): pointer to the first #GIcon.
20969 * @icon2: (allow-none): pointer to the second #GIcon.
20971 * Checks if two icons are equal.
20973 * Returns: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
20979 * @icon: #gconstpointer to an icon object.
20981 * Gets a hash for an icon.
20984 * Returns: a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure.
20989 * g_icon_new_for_string:
20990 * @str: A string obtained via g_icon_to_string().
20991 * @error: Return location for error.
20993 * Generate a #GIcon instance from @str. This function can fail if
20994 * @str is not valid - see g_icon_to_string() for discussion.
20996 * If your application or library provides one or more #GIcon
20997 * implementations you need to ensure that each #GType is registered
20998 * with the type system prior to calling g_icon_new_for_string().
21000 * Returns: (transfer full): An object implementing the #GIcon interface or %NULL if @error is set.
21006 * g_icon_serialize:
21009 * Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved
21010 * back by calling g_icon_deserialize() on the returned value.
21011 * As serialization will avoid using raw icon data when possible, it only
21012 * makes sense to transfer the #GVariant between processes on the same machine,
21013 * (as opposed to over the network), and within the same file system namespace.
21015 * Returns: (transfer full): a #GVariant, or %NULL when serialization fails.
21021 * g_icon_to_string:
21024 * Generates a textual representation of @icon that can be used for
21025 * serialization such as when passing @icon to a different process or
21026 * saving it to persistent storage. Use g_icon_new_for_string() to
21027 * get @icon back from the returned string.
21029 * The encoding of the returned string is proprietary to #GIcon except
21030 * in the following two cases
21034 * If @icon is a #GFileIcon, the returned string is a native path
21035 * (such as <literal>/path/to/my icon.png</literal>) without escaping
21036 * if the #GFile for @icon is a native file. If the file is not
21037 * native, the returned string is the result of g_file_get_uri()
21038 * (such as <literal>sftp://path/to/my%20icon.png</literal>).
21039 * </para></listitem>
21041 * If @icon is a #GThemedIcon with exactly one name, the encoding is
21042 * simply the name (such as <literal>network-server</literal>).
21043 * </para></listitem>
21046 * Virtual: to_tokens
21047 * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't be serialized. Use g_free() to free.
21053 * g_inet_address_equal:
21054 * @address: A #GInetAddress.
21055 * @other_address: Another #GInetAddress.
21057 * Checks if two #GInetAddress instances are equal, e.g. the same address.
21059 * Returns: %TRUE if @address and @other_address are equal, %FALSE otherwise.
21065 * g_inet_address_get_family:
21066 * @address: a #GInetAddress
21068 * Gets @address's family
21070 * Returns: @address's family
21076 * g_inet_address_get_is_any:
21077 * @address: a #GInetAddress
21079 * Tests whether @address is the "any" address for its family.
21081 * Returns: %TRUE if @address is the "any" address for its family.
21087 * g_inet_address_get_is_link_local:
21088 * @address: a #GInetAddress
21090 * Tests whether @address is a link-local address (that is, if it
21091 * identifies a host on a local network that is not connected to the
21094 * Returns: %TRUE if @address is a link-local address.
21100 * g_inet_address_get_is_loopback:
21101 * @address: a #GInetAddress
21103 * Tests whether @address is the loopback address for its family.
21105 * Returns: %TRUE if @address is the loopback address for its family.
21111 * g_inet_address_get_is_mc_global:
21112 * @address: a #GInetAddress
21114 * Tests whether @address is a global multicast address.
21116 * Returns: %TRUE if @address is a global multicast address.
21122 * g_inet_address_get_is_mc_link_local:
21123 * @address: a #GInetAddress
21125 * Tests whether @address is a link-local multicast address.
21127 * Returns: %TRUE if @address is a link-local multicast address.
21133 * g_inet_address_get_is_mc_node_local:
21134 * @address: a #GInetAddress
21136 * Tests whether @address is a node-local multicast address.
21138 * Returns: %TRUE if @address is a node-local multicast address.
21144 * g_inet_address_get_is_mc_org_local:
21145 * @address: a #GInetAddress
21147 * Tests whether @address is an organization-local multicast address.
21149 * Returns: %TRUE if @address is an organization-local multicast address.
21155 * g_inet_address_get_is_mc_site_local:
21156 * @address: a #GInetAddress
21158 * Tests whether @address is a site-local multicast address.
21160 * Returns: %TRUE if @address is a site-local multicast address.
21166 * g_inet_address_get_is_multicast:
21167 * @address: a #GInetAddress
21169 * Tests whether @address is a multicast address.
21171 * Returns: %TRUE if @address is a multicast address.
21177 * g_inet_address_get_is_site_local:
21178 * @address: a #GInetAddress
21180 * Tests whether @address is a site-local address such as 10.0.0.1
21181 * (that is, the address identifies a host on a local network that can
21182 * not be reached directly from the Internet, but which may have
21183 * outgoing Internet connectivity via a NAT or firewall).
21185 * Returns: %TRUE if @address is a site-local address.
21191 * g_inet_address_get_native_size:
21192 * @address: a #GInetAddress
21194 * Gets the size of the native raw binary address for @address. This
21195 * is the size of the data that you get from g_inet_address_to_bytes().
21197 * Returns: the number of bytes used for the native version of @address.
21203 * g_inet_address_mask_equal:
21204 * @mask: a #GInetAddressMask
21205 * @mask2: another #GInetAddressMask
21207 * Tests if @mask and @mask2 are the same mask.
21209 * Returns: whether @mask and @mask2 are the same mask
21215 * g_inet_address_mask_get_address:
21216 * @mask: a #GInetAddressMask
21218 * Gets @mask's base address
21220 * Returns: (transfer none): @mask's base address
21226 * g_inet_address_mask_get_family:
21227 * @mask: a #GInetAddressMask
21229 * Gets the #GSocketFamily of @mask's address
21231 * Returns: the #GSocketFamily of @mask's address
21237 * g_inet_address_mask_get_length:
21238 * @mask: a #GInetAddressMask
21240 * Gets @mask's length
21242 * Returns: @mask's length
21248 * g_inet_address_mask_matches:
21249 * @mask: a #GInetAddressMask
21250 * @address: a #GInetAddress
21252 * Tests if @address falls within the range described by @mask.
21254 * Returns: whether @address falls within the range described by @mask.
21260 * g_inet_address_mask_new:
21261 * @addr: a #GInetAddress
21262 * @length: number of bits of @addr to use
21263 * @error: return location for #GError, or %NULL
21265 * Creates a new #GInetAddressMask representing all addresses whose
21266 * first @length bits match @addr.
21268 * Returns: a new #GInetAddressMask, or %NULL on error
21274 * g_inet_address_mask_new_from_string:
21275 * @mask_string: an IP address or address/length string
21276 * @error: return location for #GError, or %NULL
21278 * Parses @mask_string as an IP address and (optional) length, and
21279 * creates a new #GInetAddressMask. The length, if present, is
21280 * delimited by a "/". If it is not present, then the length is
21281 * assumed to be the full length of the address.
21283 * Returns: a new #GInetAddressMask corresponding to @string, or %NULL on error.
21289 * g_inet_address_mask_to_string:
21290 * @mask: a #GInetAddressMask
21292 * Converts @mask back to its corresponding string form.
21294 * Returns: a string corresponding to @mask.
21300 * g_inet_address_new_any:
21301 * @family: the address family
21303 * Creates a #GInetAddress for the "any" address (unassigned/"don't
21304 * care") for @family.
21306 * Returns: a new #GInetAddress corresponding to the "any" address for @family.
21312 * g_inet_address_new_from_bytes:
21313 * @bytes: (array) (element-type guint8): raw address data
21314 * @family: the address family of @bytes
21316 * Creates a new #GInetAddress from the given @family and @bytes.
21317 * @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
21318 * %G_SOCKET_FAMILY_IPV6.
21320 * Returns: a new #GInetAddress corresponding to @family and @bytes.
21326 * g_inet_address_new_from_string:
21327 * @string: a string representation of an IP address
21329 * Parses @string as an IP address and creates a new #GInetAddress.
21331 * Returns: a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed.
21337 * g_inet_address_new_loopback:
21338 * @family: the address family
21340 * Creates a #GInetAddress for the loopback address for @family.
21342 * Returns: a new #GInetAddress corresponding to the loopback address for @family.
21348 * g_inet_address_to_bytes: (skip)
21349 * @address: a #GInetAddress
21351 * Gets the raw binary address data from @address.
21353 * 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().
21359 * g_inet_address_to_string:
21360 * @address: a #GInetAddress
21362 * Converts @address to string form.
21364 * Returns: a representation of @address as a string, which should be freed after use.
21370 * g_inet_socket_address_get_address:
21371 * @address: a #GInetSocketAddress
21373 * Gets @address's #GInetAddress.
21375 * Returns: (transfer none): the #GInetAddress for @address, which must be g_object_ref()'d if it will be stored
21381 * g_inet_socket_address_get_flowinfo:
21382 * @address: a %G_SOCKET_FAMILY_IPV6 #GInetSocketAddress
21384 * Gets the <literal>sin6_flowinfo</literal> field from @address,
21385 * which must be an IPv6 address.
21387 * Returns: the flowinfo field
21393 * g_inet_socket_address_get_port:
21394 * @address: a #GInetSocketAddress
21396 * Gets @address's port.
21398 * Returns: the port for @address
21404 * g_inet_socket_address_get_scope_id:
21405 * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress
21407 * Gets the <literal>sin6_scope_id</literal> field from @address,
21408 * which must be an IPv6 address.
21410 * Returns: the scope id field
21416 * g_inet_socket_address_new:
21417 * @address: a #GInetAddress
21418 * @port: a port number
21420 * Creates a new #GInetSocketAddress for @address and @port.
21422 * Returns: a new #GInetSocketAddress
21429 * @initable: a #GInitable.
21430 * @cancellable: optional #GCancellable object, %NULL to ignore.
21431 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21433 * Initializes the object implementing the interface.
21435 * The object must be initialized before any real use after initial
21436 * construction, either with this function or g_async_initable_init_async().
21438 * Implementations may also support cancellation. If @cancellable is not %NULL,
21439 * then initialization can be cancelled by triggering the cancellable object
21440 * from another thread. If the operation was cancelled, the error
21441 * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
21442 * the object doesn't support cancellable initialization the error
21443 * %G_IO_ERROR_NOT_SUPPORTED will be returned.
21445 * If the object is not initialized, or initialization returns with an
21446 * error, then all operations on the object except g_object_ref() and
21447 * g_object_unref() are considered to be invalid, and have undefined
21448 * behaviour. See the <xref linkend="ginitable"/> section introduction
21449 * for more details.
21451 * Implementations of this method must be idempotent, i.e. multiple calls
21452 * to this function with the same argument should return the same results.
21453 * Only the first call initializes the object, further calls return the result
21454 * of the first call. This is so that it's safe to implement the singleton
21455 * pattern in the GObject constructor function.
21457 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
21464 * @object_type: a #GType supporting #GInitable.
21465 * @cancellable: optional #GCancellable object, %NULL to ignore.
21466 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21467 * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
21468 * @...: the value if the first property, followed by and other property value pairs, and ended by %NULL.
21470 * Helper function for constructing #GInitable object. This is
21471 * similar to g_object_new() but also initializes the object
21472 * and returns %NULL, setting an error on failure.
21474 * Returns: (type GObject.Object) (transfer full): a newly allocated #GObject, or %NULL on error
21480 * g_initable_new_valist:
21481 * @object_type: a #GType supporting #GInitable.
21482 * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
21483 * @var_args: The var args list generated from @first_property_name.
21484 * @cancellable: optional #GCancellable object, %NULL to ignore.
21485 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21487 * Helper function for constructing #GInitable object. This is
21488 * similar to g_object_new_valist() but also initializes the object
21489 * and returns %NULL, setting an error on failure.
21491 * Returns: (type GObject.Object) (transfer full): a newly allocated #GObject, or %NULL on error
21498 * @object_type: a #GType supporting #GInitable.
21499 * @n_parameters: the number of parameters in @parameters
21500 * @parameters: (array length=n_parameters): the parameters to use to construct the object
21501 * @cancellable: optional #GCancellable object, %NULL to ignore.
21502 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21504 * Helper function for constructing #GInitable object. This is
21505 * similar to g_object_newv() but also initializes the object
21506 * and returns %NULL, setting an error on failure.
21508 * Returns: (type GObject.Object) (transfer full): a newly allocated #GObject, or %NULL on error
21514 * g_input_stream_clear_pending:
21515 * @stream: input stream
21517 * Clears the pending flag on @stream.
21522 * g_input_stream_close:
21523 * @stream: A #GInputStream.
21524 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21525 * @error: location to store the error occurring, or %NULL to ignore
21527 * Closes the stream, releasing resources related to it.
21529 * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
21530 * Closing a stream multiple times will not return an error.
21532 * Streams will be automatically closed when the last reference
21533 * is dropped, but you might want to call this function to make sure
21534 * resources are released as early as possible.
21536 * Some streams might keep the backing store of the stream (e.g. a file descriptor)
21537 * open after the stream is closed. See the documentation for the individual
21538 * stream for details.
21540 * On failure the first error that happened will be reported, but the close
21541 * operation will finish as much as possible. A stream that failed to
21542 * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
21543 * is important to check and report the error to the user.
21545 * If @cancellable is not %NULL, then the operation can be cancelled by
21546 * triggering the cancellable object from another thread. If the operation
21547 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21548 * Cancelling a close will still leave the stream closed, but some streams
21549 * can use a faster close that doesn't block to e.g. check errors.
21551 * Returns: %TRUE on success, %FALSE on failure
21556 * g_input_stream_close_async:
21557 * @stream: A #GInputStream.
21558 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21559 * @cancellable: (allow-none): optional cancellable object
21560 * @callback: (scope async): callback to call when the request is satisfied
21561 * @user_data: (closure): the data to pass to callback function
21563 * Requests an asynchronous closes of the stream, releasing resources related to it.
21564 * When the operation is finished @callback will be called.
21565 * You can then call g_input_stream_close_finish() to get the result of the
21568 * For behaviour details see g_input_stream_close().
21570 * The asyncronous methods have a default fallback that uses threads to implement
21571 * asynchronicity, so they are optional for inheriting classes. However, if you
21572 * override one you must override all.
21577 * g_input_stream_close_finish:
21578 * @stream: a #GInputStream.
21579 * @result: a #GAsyncResult.
21580 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21582 * Finishes closing a stream asynchronously, started from g_input_stream_close_async().
21584 * Returns: %TRUE if the stream was closed successfully.
21589 * g_input_stream_has_pending:
21590 * @stream: input stream.
21592 * Checks if an input stream has pending actions.
21594 * Returns: %TRUE if @stream has pending actions.
21599 * g_input_stream_is_closed:
21600 * @stream: input stream.
21602 * Checks if an input stream is closed.
21604 * Returns: %TRUE if the stream is closed.
21609 * g_input_stream_read:
21610 * @stream: a #GInputStream.
21611 * @buffer: (array length=count) (element-type guint8): a buffer to read data into (which should be at least count bytes long).
21612 * @count: the number of bytes that will be read from the stream
21613 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21614 * @error: location to store the error occurring, or %NULL to ignore
21616 * Tries to read @count bytes from the stream into the buffer starting at
21617 * @buffer. Will block during this read.
21619 * If count is zero returns zero and does nothing. A value of @count
21620 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21622 * On success, the number of bytes read into the buffer is returned.
21623 * It is not an error if this is not the same as the requested size, as it
21624 * can happen e.g. near the end of a file. Zero is returned on end of file
21625 * (or if @count is zero), but never otherwise.
21627 * If @cancellable is not %NULL, then the operation can be cancelled by
21628 * triggering the cancellable object from another thread. If the operation
21629 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21630 * operation was partially finished when the operation was cancelled the
21631 * partial result will be returned, without an error.
21633 * On error -1 is returned and @error is set accordingly.
21635 * Returns: Number of bytes read, or -1 on error, or 0 on end of file.
21640 * g_input_stream_read_all:
21641 * @stream: a #GInputStream.
21642 * @buffer: (array length=count) (element-type guint8): a buffer to read data into (which should be at least count bytes long).
21643 * @count: the number of bytes that will be read from the stream
21644 * @bytes_read: (out): location to store the number of bytes that was read from the stream
21645 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21646 * @error: location to store the error occurring, or %NULL to ignore
21648 * Tries to read @count bytes from the stream into the buffer starting at
21649 * @buffer. Will block during this read.
21651 * This function is similar to g_input_stream_read(), except it tries to
21652 * read as many bytes as requested, only stopping on an error or end of stream.
21654 * On a successful read of @count bytes, or if we reached the end of the
21655 * stream, %TRUE is returned, and @bytes_read is set to the number of bytes
21656 * read into @buffer.
21658 * If there is an error during the operation %FALSE is returned and @error
21659 * is set to indicate the error status, @bytes_read is updated to contain
21660 * the number of bytes read into @buffer before the error occurred.
21662 * Returns: %TRUE on success, %FALSE if there was an error
21667 * g_input_stream_read_async:
21668 * @stream: A #GInputStream.
21669 * @buffer: (array length=count) (element-type guint8): a buffer to read data into (which should be at least count bytes long).
21670 * @count: the number of bytes that will be read from the stream
21671 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21672 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21673 * @callback: (scope async): callback to call when the request is satisfied
21674 * @user_data: (closure): the data to pass to callback function
21676 * Request an asynchronous read of @count bytes from the stream into the buffer
21677 * starting at @buffer. When the operation is finished @callback will be called.
21678 * You can then call g_input_stream_read_finish() to get the result of the
21681 * During an async request no other sync and async calls are allowed on @stream, and will
21682 * result in %G_IO_ERROR_PENDING errors.
21684 * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21686 * On success, the number of bytes read into the buffer will be passed to the
21687 * callback. It is not an error if this is not the same as the requested size, as it
21688 * can happen e.g. near the end of a file, but generally we try to read
21689 * as many bytes as requested. Zero is returned on end of file
21690 * (or if @count is zero), but never otherwise.
21692 * Any outstanding i/o request with higher priority (lower numerical value) will
21693 * be executed before an outstanding request with lower priority. Default
21694 * priority is %G_PRIORITY_DEFAULT.
21696 * The asyncronous methods have a default fallback that uses threads to implement
21697 * asynchronicity, so they are optional for inheriting classes. However, if you
21698 * override one you must override all.
21703 * g_input_stream_read_bytes:
21704 * @stream: a #GInputStream.
21705 * @count: maximum number of bytes that will be read from the stream. Common values include 4096 and 8192.
21706 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21707 * @error: location to store the error occurring, or %NULL to ignore
21709 * Like g_input_stream_read(), this tries to read @count bytes from
21710 * the stream in a blocking fashion. However, rather than reading into
21711 * a user-supplied buffer, this will create a new #GBytes containing
21712 * the data that was read. This may be easier to use from language
21715 * If count is zero, returns a zero-length #GBytes and does nothing. A
21716 * value of @count larger than %G_MAXSSIZE will cause a
21717 * %G_IO_ERROR_INVALID_ARGUMENT error.
21719 * On success, a new #GBytes is returned. It is not an error if the
21720 * size of this object is not the same as the requested size, as it
21721 * can happen e.g. near the end of a file. A zero-length #GBytes is
21722 * returned on end of file (or if @count is zero), but never
21725 * If @cancellable is not %NULL, then the operation can be cancelled by
21726 * triggering the cancellable object from another thread. If the operation
21727 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21728 * operation was partially finished when the operation was cancelled the
21729 * partial result will be returned, without an error.
21731 * On error %NULL is returned and @error is set accordingly.
21733 * Returns: a new #GBytes, or %NULL on error
21738 * g_input_stream_read_bytes_async:
21739 * @stream: A #GInputStream.
21740 * @count: the number of bytes that will be read from the stream
21741 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21742 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21743 * @callback: (scope async): callback to call when the request is satisfied
21744 * @user_data: (closure): the data to pass to callback function
21746 * Request an asynchronous read of @count bytes from the stream into a
21747 * new #GBytes. When the operation is finished @callback will be
21748 * called. You can then call g_input_stream_read_bytes_finish() to get the
21749 * result of the operation.
21751 * During an async request no other sync and async calls are allowed
21752 * on @stream, and will result in %G_IO_ERROR_PENDING errors.
21754 * A value of @count larger than %G_MAXSSIZE will cause a
21755 * %G_IO_ERROR_INVALID_ARGUMENT error.
21757 * On success, the new #GBytes will be passed to the callback. It is
21758 * not an error if this is smaller than the requested size, as it can
21759 * happen e.g. near the end of a file, but generally we try to read as
21760 * many bytes as requested. Zero is returned on end of file (or if
21761 * @count is zero), but never otherwise.
21763 * Any outstanding I/O request with higher priority (lower numerical
21764 * value) will be executed before an outstanding request with lower
21765 * priority. Default priority is %G_PRIORITY_DEFAULT.
21770 * g_input_stream_read_bytes_finish:
21771 * @stream: a #GInputStream.
21772 * @result: a #GAsyncResult.
21773 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21775 * Finishes an asynchronous stream read-into-#GBytes operation.
21777 * Returns: the newly-allocated #GBytes, or %NULL on error
21782 * g_input_stream_read_finish:
21783 * @stream: a #GInputStream.
21784 * @result: a #GAsyncResult.
21785 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21787 * Finishes an asynchronous stream read operation.
21789 * Returns: number of bytes read in, or -1 on error, or 0 on end of file.
21794 * g_input_stream_set_pending:
21795 * @stream: input stream
21796 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21798 * Sets @stream to have actions pending. If the pending flag is
21799 * already set or @stream is closed, it will return %FALSE and set
21802 * Returns: %TRUE if pending was previously unset and is now set.
21807 * g_input_stream_skip:
21808 * @stream: a #GInputStream.
21809 * @count: the number of bytes that will be skipped from the stream
21810 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21811 * @error: location to store the error occurring, or %NULL to ignore
21813 * Tries to skip @count bytes from the stream. Will block during the operation.
21815 * This is identical to g_input_stream_read(), from a behaviour standpoint,
21816 * but the bytes that are skipped are not returned to the user. Some
21817 * streams have an implementation that is more efficient than reading the data.
21819 * This function is optional for inherited classes, as the default implementation
21820 * emulates it using read.
21822 * If @cancellable is not %NULL, then the operation can be cancelled by
21823 * triggering the cancellable object from another thread. If the operation
21824 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21825 * operation was partially finished when the operation was cancelled the
21826 * partial result will be returned, without an error.
21828 * Returns: Number of bytes skipped, or -1 on error
21833 * g_input_stream_skip_async:
21834 * @stream: A #GInputStream.
21835 * @count: the number of bytes that will be skipped from the stream
21836 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21837 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21838 * @callback: (scope async): callback to call when the request is satisfied
21839 * @user_data: (closure): the data to pass to callback function
21841 * Request an asynchronous skip of @count bytes from the stream.
21842 * When the operation is finished @callback will be called.
21843 * You can then call g_input_stream_skip_finish() to get the result
21844 * of the operation.
21846 * During an async request no other sync and async calls are allowed,
21847 * and will result in %G_IO_ERROR_PENDING errors.
21849 * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21851 * On success, the number of bytes skipped will be passed to the callback.
21852 * It is not an error if this is not the same as the requested size, as it
21853 * can happen e.g. near the end of a file, but generally we try to skip
21854 * as many bytes as requested. Zero is returned on end of file
21855 * (or if @count is zero), but never otherwise.
21857 * Any outstanding i/o request with higher priority (lower numerical value)
21858 * will be executed before an outstanding request with lower priority.
21859 * Default priority is %G_PRIORITY_DEFAULT.
21861 * The asynchronous methods have a default fallback that uses threads to
21862 * implement asynchronicity, so they are optional for inheriting classes.
21863 * However, if you override one, you must override all.
21868 * g_input_stream_skip_finish:
21869 * @stream: a #GInputStream.
21870 * @result: a #GAsyncResult.
21871 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21873 * Finishes a stream skip operation.
21875 * Returns: the size of the bytes skipped, or %-1 on error.
21880 * g_io_error_from_errno:
21881 * @err_no: Error number as defined in errno.h.
21883 * Converts errno.h error codes into GIO error codes.
21885 * Returns: #GIOErrorEnum value for the given errno.h error number.
21890 * g_io_error_from_win32_error:
21891 * @error_code: Windows error number.
21893 * Converts some common error codes into GIO error codes. The
21894 * fallback value G_IO_ERROR_FAILED is returned for error codes not
21897 * Returns: #GIOErrorEnum value for the given error number.
21903 * g_io_error_quark:
21905 * Gets the GIO Error Quark.
21907 * Returns: a #GQuark.
21912 * g_io_extension_get_name:
21913 * @extension: a #GIOExtension
21915 * Gets the name under which @extension was registered.
21917 * Note that the same type may be registered as extension
21918 * for multiple extension points, under different names.
21920 * Returns: the name of @extension.
21925 * g_io_extension_get_priority:
21926 * @extension: a #GIOExtension
21928 * Gets the priority with which @extension was registered.
21930 * Returns: the priority of @extension
21935 * g_io_extension_get_type:
21936 * @extension: a #GIOExtension
21938 * Gets the type associated with @extension.
21940 * Returns: the type of @extension
21945 * g_io_extension_point_get_extension_by_name:
21946 * @extension_point: a #GIOExtensionPoint
21947 * @name: the name of the extension to get
21949 * Finds a #GIOExtension for an extension point by name.
21951 * Returns: (transfer none): the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name
21956 * g_io_extension_point_get_extensions:
21957 * @extension_point: a #GIOExtensionPoint
21959 * Gets a list of all extensions that implement this extension point.
21960 * The list is sorted by priority, beginning with the highest priority.
21962 * Returns: (element-type GIOExtension) (transfer none): a #GList of #GIOExtension<!-- -->s. The list is owned by GIO and should not be modified.
21967 * g_io_extension_point_get_required_type:
21968 * @extension_point: a #GIOExtensionPoint
21970 * Gets the required type for @extension_point.
21972 * Returns: the #GType that all implementations must have, or #G_TYPE_INVALID if the extension point has no required type
21977 * g_io_extension_point_implement:
21978 * @extension_point_name: the name of the extension point
21979 * @type: the #GType to register as extension
21980 * @extension_name: the name for the extension
21981 * @priority: the priority for the extension
21983 * Registers @type as extension for the extension point with name
21984 * @extension_point_name.
21986 * If @type has already been registered as an extension for this
21987 * extension point, the existing #GIOExtension object is returned.
21989 * Returns: (transfer none): a #GIOExtension object for #GType
21994 * g_io_extension_point_lookup:
21995 * @name: the name of the extension point
21997 * Looks up an existing extension point.
21999 * Returns: (transfer none): the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name.
22004 * g_io_extension_point_register:
22005 * @name: The name of the extension point
22007 * Registers an extension point.
22009 * Returns: (transfer none): the new #GIOExtensionPoint. This object is owned by GIO and should not be freed.
22014 * g_io_extension_point_set_required_type:
22015 * @extension_point: a #GIOExtensionPoint
22016 * @type: the #GType to require
22018 * Sets the required type for @extension_point to @type.
22019 * All implementations must henceforth have this type.
22024 * g_io_extension_ref_class:
22025 * @extension: a #GIOExtension
22027 * Gets a reference to the class for the type that is
22028 * associated with @extension.
22030 * Returns: (transfer full): the #GTypeClass for the type of @extension
22036 * @filename: filename of the shared library module.
22038 * Creates a new GIOModule that will load the specific
22039 * shared library when in use.
22041 * Returns: a #GIOModule from given @filename, or %NULL on error.
22046 * g_io_module_scope_block:
22047 * @scope: a module loading scope
22048 * @basename: the basename to block
22050 * Block modules with the given @basename from being loaded when
22051 * this scope is used with g_io_modules_scan_all_in_directory_with_scope()
22052 * or g_io_modules_load_all_in_directory_with_scope().
22059 * g_io_module_scope_free:
22060 * @scope: a module loading scope
22062 * Free a module scope.
22069 * g_io_module_scope_new:
22070 * @flags: flags for the new scope
22072 * Create a new scope for loading of IO modules. A scope can be used for
22073 * blocking duplicate modules, or blocking a module you don't want to load.
22075 * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
22076 * which have the same base name as a module that has already been seen
22079 * Returns: (transfer full): the new module scope
22085 * g_io_modules_load_all_in_directory:
22086 * @dirname: pathname for a directory containing modules to load.
22088 * Loads all the modules in the specified directory.
22090 * If don't require all modules to be initialized (and thus registering
22091 * all gtypes) then you can use g_io_modules_scan_all_in_directory()
22092 * which allows delayed/lazy loading of modules.
22094 * 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().
22099 * g_io_modules_load_all_in_directory_with_scope:
22100 * @dirname: pathname for a directory containing modules to load.
22101 * @scope: a scope to use when scanning the modules.
22103 * Loads all the modules in the specified directory.
22105 * If don't require all modules to be initialized (and thus registering
22106 * all gtypes) then you can use g_io_modules_scan_all_in_directory()
22107 * which allows delayed/lazy loading of modules.
22109 * 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().
22115 * g_io_modules_scan_all_in_directory:
22116 * @dirname: pathname for a directory containing modules to scan.
22118 * Scans all the modules in the specified directory, ensuring that
22119 * any extension point implemented by a module is registered.
22121 * This may not actually load and initialize all the types in each
22122 * module, some modules may be lazily loaded and initialized when
22123 * an extension point it implementes is used with e.g.
22124 * g_io_extension_point_get_extensions() or
22125 * g_io_extension_point_get_extension_by_name().
22127 * If you need to guarantee that all types are loaded in all the modules,
22128 * use g_io_modules_load_all_in_directory().
22135 * g_io_modules_scan_all_in_directory_with_scope:
22136 * @dirname: pathname for a directory containing modules to scan.
22137 * @scope: a scope to use when scanning the modules
22139 * Scans all the modules in the specified directory, ensuring that
22140 * any extension point implemented by a module is registered.
22142 * This may not actually load and initialize all the types in each
22143 * module, some modules may be lazily loaded and initialized when
22144 * an extension point it implementes is used with e.g.
22145 * g_io_extension_point_get_extensions() or
22146 * g_io_extension_point_get_extension_by_name().
22148 * If you need to guarantee that all types are loaded in all the modules,
22149 * use g_io_modules_load_all_in_directory().
22156 * g_io_scheduler_cancel_all_jobs:
22158 * Cancels all cancellable I/O jobs.
22160 * A job is cancellable if a #GCancellable was passed into
22161 * g_io_scheduler_push_job().
22163 * Deprecated: You should never call this function, since you don't know how other libraries in your program might be making use of gioscheduler.
22168 * g_io_scheduler_job_send_to_mainloop:
22169 * @job: a #GIOSchedulerJob
22170 * @func: a #GSourceFunc callback that will be called in the original thread
22171 * @user_data: data to pass to @func
22172 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22174 * Used from an I/O job to send a callback to be run in the thread
22175 * that the job was started from, waiting for the result (and thus
22176 * blocking the I/O job).
22178 * Returns: The return value of @func
22179 * Deprecated: Use g_main_context_invoke().
22184 * g_io_scheduler_job_send_to_mainloop_async:
22185 * @job: a #GIOSchedulerJob
22186 * @func: a #GSourceFunc callback that will be called in the original thread
22187 * @user_data: data to pass to @func
22188 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22190 * Used from an I/O job to send a callback to be run asynchronously in
22191 * the thread that the job was started from. The callback will be run
22192 * when the main loop is available, but at that time the I/O job might
22193 * have finished. The return value from the callback is ignored.
22195 * Note that if you are passing the @user_data from g_io_scheduler_push_job()
22196 * on to this function you have to ensure that it is not freed before
22197 * @func is called, either by passing %NULL as @notify to
22198 * g_io_scheduler_push_job() or by using refcounting for @user_data.
22200 * Deprecated: Use g_main_context_invoke().
22205 * g_io_scheduler_push_job:
22206 * @job_func: a #GIOSchedulerJobFunc.
22207 * @user_data: data to pass to @job_func
22208 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22209 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
22210 * @cancellable: optional #GCancellable object, %NULL to ignore.
22212 * Schedules the I/O job to run in another thread.
22214 * @notify will be called on @user_data after @job_func has returned,
22215 * regardless whether the job was cancelled or has run to completion.
22217 * If @cancellable is not %NULL, it can be used to cancel the I/O job
22218 * by calling g_cancellable_cancel() or by calling
22219 * g_io_scheduler_cancel_all_jobs().
22221 * Deprecated: use #GThreadPool or g_task_run_in_thread()
22226 * g_io_stream_clear_pending:
22227 * @stream: a #GIOStream
22229 * Clears the pending flag on @stream.
22236 * g_io_stream_close:
22237 * @stream: a #GIOStream
22238 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
22239 * @error: location to store the error occurring, or %NULL to ignore
22241 * Closes the stream, releasing resources related to it. This will also
22242 * closes the individual input and output streams, if they are not already
22245 * Once the stream is closed, all other operations will return
22246 * %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
22249 * Closing a stream will automatically flush any outstanding buffers
22252 * Streams will be automatically closed when the last reference
22253 * is dropped, but you might want to call this function to make sure
22254 * resources are released as early as possible.
22256 * Some streams might keep the backing store of the stream (e.g. a file
22257 * descriptor) open after the stream is closed. See the documentation for
22258 * the individual stream for details.
22260 * On failure the first error that happened will be reported, but the
22261 * close operation will finish as much as possible. A stream that failed
22262 * to close will still return %G_IO_ERROR_CLOSED for all operations.
22263 * Still, it is important to check and report the error to the user,
22264 * otherwise there might be a loss of data as all data might not be written.
22266 * If @cancellable is not NULL, then the operation can be cancelled by
22267 * triggering the cancellable object from another thread. If the operation
22268 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
22269 * Cancelling a close will still leave the stream closed, but some streams
22270 * can use a faster close that doesn't block to e.g. check errors.
22272 * The default implementation of this method just calls close on the
22273 * individual input/output streams.
22275 * Returns: %TRUE on success, %FALSE on failure
22281 * g_io_stream_close_async:
22282 * @stream: a #GIOStream
22283 * @io_priority: the io priority of the request
22284 * @cancellable: (allow-none): optional cancellable object
22285 * @callback: (scope async): callback to call when the request is satisfied
22286 * @user_data: (closure): the data to pass to callback function
22288 * Requests an asynchronous close of the stream, releasing resources
22289 * related to it. When the operation is finished @callback will be
22290 * called. You can then call g_io_stream_close_finish() to get
22291 * the result of the operation.
22293 * For behaviour details see g_io_stream_close().
22295 * The asynchronous methods have a default fallback that uses threads
22296 * to implement asynchronicity, so they are optional for inheriting
22297 * classes. However, if you override one you must override all.
22304 * g_io_stream_close_finish:
22305 * @stream: a #GIOStream
22306 * @result: a #GAsyncResult
22307 * @error: a #GError location to store the error occurring, or %NULL to ignore
22311 * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
22317 * g_io_stream_get_input_stream:
22318 * @stream: a #GIOStream
22320 * Gets the input stream for this object. This is used
22323 * Returns: (transfer none): a #GInputStream, owned by the #GIOStream. Do not free.
22329 * g_io_stream_get_output_stream:
22330 * @stream: a #GIOStream
22332 * Gets the output stream for this object. This is used for
22335 * Returns: (transfer none): a #GOutputStream, owned by the #GIOStream. Do not free.
22341 * g_io_stream_has_pending:
22342 * @stream: a #GIOStream
22344 * Checks if a stream has pending actions.
22346 * Returns: %TRUE if @stream has pending actions.
22352 * g_io_stream_is_closed:
22353 * @stream: a #GIOStream
22355 * Checks if a stream is closed.
22357 * Returns: %TRUE if the stream is closed.
22363 * g_io_stream_set_pending:
22364 * @stream: a #GIOStream
22365 * @error: a #GError location to store the error occurring, or %NULL to ignore
22367 * Sets @stream to have actions pending. If the pending flag is
22368 * already set or @stream is closed, it will return %FALSE and set
22371 * Returns: %TRUE if pending was previously unset and is now set.
22377 * g_io_stream_splice_async:
22378 * @stream1: a #GIOStream.
22379 * @stream2: a #GIOStream.
22380 * @flags: a set of #GIOStreamSpliceFlags.
22381 * @io_priority: the io priority of the request.
22382 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22383 * @callback: (scope async): a #GAsyncReadyCallback.
22384 * @user_data: (closure): user data passed to @callback.
22386 * Asyncronously splice the output stream of @stream1 to the input stream of
22387 * @stream2, and splice the output stream of @stream2 to the input stream of
22390 * When the operation is finished @callback will be called.
22391 * You can then call g_io_stream_splice_finish() to get the
22392 * result of the operation.
22399 * g_io_stream_splice_finish:
22400 * @result: a #GAsyncResult.
22401 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22403 * Finishes an asynchronous io stream splice operation.
22405 * Returns: %TRUE on success, %FALSE otherwise.
22411 * g_keyfile_settings_backend_new:
22412 * @filename: the filename of the keyfile
22413 * @root_path: the path under which all settings keys appear
22414 * @root_group: (allow-none): the group name corresponding to @root_path, or %NULL
22416 * Creates a keyfile-backed #GSettingsBackend.
22418 * The filename of the keyfile to use is given by @filename.
22420 * All settings read to or written from the backend must fall under the
22421 * path given in @root_path (which must start and end with a slash and
22422 * not contain two consecutive slashes). @root_path may be "/".
22424 * If @root_group is non-%NULL then it specifies the name of the keyfile
22425 * group used for keys that are written directly below @root_path. For
22426 * example, if @root_path is "/apps/example/" and @root_group is
22427 * "toplevel", then settings the key "/apps/example/enabled" to a value
22428 * of %TRUE will cause the following to appear in the keyfile:
22435 * If @root_group is %NULL then it is not permitted to store keys
22436 * directly below the @root_path.
22438 * For keys not stored directly below @root_path (ie: in a sub-path),
22439 * the name of the subpath (with the final slash stripped) is used as
22440 * the name of the keyfile group. To continue the example, if
22441 * "/apps/example/profiles/default/font-size" were set to
22442 * 12 then the following would appear in the keyfile:
22445 * [profiles/default]
22449 * The backend will refuse writes (and return writability as being
22450 * %FALSE) for keys outside of @root_path and, in the event that
22451 * @root_group is %NULL, also for keys directly under @root_path.
22452 * Writes will also be refused if the backend detects that it has the
22453 * inability to rewrite the keyfile (ie: the containing directory is not
22456 * There is no checking done for your key namespace clashing with the
22457 * syntax of the key file format. For example, if you have '[' or ']'
22458 * characters in your path names or '=' in your key names you may be in
22461 * Returns: (transfer full): a keyfile-backed #GSettingsBackend
22466 * g_loadable_icon_load:
22467 * @icon: a #GLoadableIcon.
22468 * @size: an integer.
22469 * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
22470 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22471 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22473 * Loads a loadable icon. For the asynchronous version of this function,
22474 * see g_loadable_icon_load_async().
22476 * Returns: (transfer full): a #GInputStream to read the icon from.
22481 * g_loadable_icon_load_async:
22482 * @icon: a #GLoadableIcon.
22483 * @size: an integer.
22484 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22485 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
22486 * @user_data: (closure): the data to pass to callback function
22488 * Loads an icon asynchronously. To finish this function, see
22489 * g_loadable_icon_load_finish(). For the synchronous, blocking
22490 * version of this function, see g_loadable_icon_load().
22495 * g_loadable_icon_load_finish:
22496 * @icon: a #GLoadableIcon.
22497 * @res: a #GAsyncResult.
22498 * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
22499 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22501 * Finishes an asynchronous icon load started in g_loadable_icon_load_async().
22503 * Returns: (transfer full): a #GInputStream to read the icon from.
22510 * Returns a new #GVfs handle for a local vfs.
22512 * Returns: a new #GVfs handle.
22517 * g_memory_input_stream_add_bytes:
22518 * @stream: a #GMemoryInputStream
22519 * @bytes: input data
22521 * Appends @bytes to data that can be read from the input stream.
22528 * g_memory_input_stream_add_data:
22529 * @stream: a #GMemoryInputStream
22530 * @data: (array length=len) (element-type guint8) (transfer full): input data
22531 * @len: length of the data, may be -1 if @data is a nul-terminated string
22532 * @destroy: (allow-none): function that is called to free @data, or %NULL
22534 * Appends @data to data that can be read from the input stream
22539 * g_memory_input_stream_new:
22541 * Creates a new empty #GMemoryInputStream.
22543 * Returns: a new #GInputStream
22548 * g_memory_input_stream_new_from_bytes:
22549 * @bytes: a #GBytes
22551 * Creates a new #GMemoryInputStream with data from the given @bytes.
22553 * Returns: new #GInputStream read from @bytes
22559 * g_memory_input_stream_new_from_data:
22560 * @data: (array length=len) (element-type guint8) (transfer full): input data
22561 * @len: length of the data, may be -1 if @data is a nul-terminated string
22562 * @destroy: (allow-none): function that is called to free @data, or %NULL
22564 * Creates a new #GMemoryInputStream with data in memory of a given size.
22566 * Returns: new #GInputStream read from @data of @len bytes.
22571 * g_memory_output_stream_get_data:
22572 * @ostream: a #GMemoryOutputStream
22574 * Gets any loaded data from the @ostream.
22576 * Note that the returned pointer may become invalid on the next
22577 * write or truncate operation on the stream.
22579 * Returns: (transfer none): pointer to the stream's data
22584 * g_memory_output_stream_get_data_size:
22585 * @ostream: a #GMemoryOutputStream
22587 * Returns the number of bytes from the start up
22588 * to including the last byte written in the stream
22589 * that has not been truncated away.
22591 * Returns: the number of bytes written to the stream
22597 * g_memory_output_stream_get_size:
22598 * @ostream: a #GMemoryOutputStream
22600 * Gets the size of the currently allocated data area (available from
22601 * g_memory_output_stream_get_data()). If the stream isn't
22602 * growable (no realloc was passed to g_memory_output_stream_new()) then
22603 * this is the maximum size of the stream and further writes
22604 * will return %G_IO_ERROR_NO_SPACE.
22606 * Note that for growable streams the returned size may become invalid on
22607 * the next write or truncate operation on the stream.
22609 * If you want the number of bytes currently written to the stream, use
22610 * g_memory_output_stream_get_data_size().
22612 * Returns: the number of bytes allocated for the data buffer
22617 * g_memory_output_stream_new: (skip)
22618 * @data: (allow-none): pointer to a chunk of memory to use, or %NULL
22619 * @size: the size of @data
22620 * @realloc_function: (allow-none): a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
22621 * @destroy_function: (allow-none): a function to be called on @data when the stream is finalized, or %NULL
22623 * Creates a new #GMemoryOutputStream.
22625 * If @data is non-%NULL, the stream will use that for its internal storage.
22626 * If @realloc_fn is non-%NULL, it will be used for resizing the internal
22627 * storage when necessary. To construct a fixed-size output stream,
22628 * pass %NULL as @realloc_fn.
22631 * /* a stream that can grow */
22632 * stream = g_memory_output_stream_new (NULL, 0, realloc, free);
22634 * /* another stream that can grow */
22635 * stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
22637 * /* a fixed-size stream */
22638 * data = malloc (200);
22639 * stream3 = g_memory_output_stream_new (data, 200, NULL, free);
22642 * Returns: A newly created #GMemoryOutputStream object.
22647 * g_memory_output_stream_new_resizable:
22649 * Creates a new #GMemoryOutputStream, using g_realloc() and g_free()
22650 * for memory allocation.
22657 * g_memory_output_stream_steal_as_bytes:
22658 * @ostream: a #GMemoryOutputStream
22660 * Returns data from the @ostream as a #GBytes. @ostream must be
22661 * closed before calling this function.
22663 * Returns: (transfer full): the stream's data
22669 * g_memory_output_stream_steal_data:
22670 * @ostream: a #GMemoryOutputStream
22672 * Gets any loaded data from the @ostream. Ownership of the data
22673 * is transferred to the caller; when no longer needed it must be
22674 * freed using the free function set in @ostream's
22675 * #GMemoryOutputStream:destroy-function property.
22677 * @ostream must be closed before calling this function.
22679 * Returns: (transfer full): the stream's data
22685 * g_memory_settings_backend_new:
22687 * Creates a memory-backed #GSettingsBackend.
22689 * This backend allows changes to settings, but does not write them
22690 * to any backing storage, so the next time you run your application,
22691 * the memory backend will start out with the default values again.
22693 * Returns: (transfer full): a newly created #GSettingsBackend
22701 * @label: (allow-none): the section label, or %NULL
22702 * @detailed_action: (allow-none): the detailed action string, or %NULL
22704 * Convenience function for appending a normal menu item to the end of
22705 * @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
22706 * flexible alternative.
22713 * g_menu_append_item:
22715 * @item: a #GMenuItem to append
22717 * Appends @item to the end of @menu.
22719 * See g_menu_insert_item() for more information.
22726 * g_menu_append_section:
22728 * @label: (allow-none): the section label, or %NULL
22729 * @section: a #GMenuModel with the items of the section
22731 * Convenience function for appending a section menu item to the end of
22732 * @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for a
22733 * more flexible alternative.
22740 * g_menu_append_submenu:
22742 * @label: (allow-none): the section label, or %NULL
22743 * @submenu: a #GMenuModel with the items of the submenu
22745 * Convenience function for appending a submenu menu item to the end of
22746 * @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for a
22747 * more flexible alternative.
22754 * g_menu_attribute_iter_get_name:
22755 * @iter: a #GMenuAttributeIter
22757 * Gets the name of the attribute at the current iterator position, as
22760 * The iterator is not advanced.
22762 * Returns: the name of the attribute
22768 * g_menu_attribute_iter_get_next:
22769 * @iter: a #GMenuAttributeIter
22770 * @out_name: (out) (allow-none) (transfer none): the type of the attribute
22771 * @value: (out) (allow-none) (transfer full): the attribute value
22773 * This function combines g_menu_attribute_iter_next() with
22774 * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
22776 * First the iterator is advanced to the next (possibly first) attribute.
22777 * If that fails, then %FALSE is returned and there are no other
22780 * If successful, @name and @value are set to the name and value of the
22781 * attribute that has just been advanced to. At this point,
22782 * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will
22783 * return the same values again.
22785 * The value returned in @name remains valid for as long as the iterator
22786 * remains at the current position. The value returned in @value must
22787 * be unreffed using g_variant_unref() when it is no longer in use.
22789 * Returns: %TRUE on success, or %FALSE if there is no additional attribute
22795 * g_menu_attribute_iter_get_value:
22796 * @iter: a #GMenuAttributeIter
22798 * Gets the value of the attribute at the current iterator position.
22800 * The iterator is not advanced.
22802 * Returns: (transfer full): the value of the current attribute
22808 * g_menu_attribute_iter_next:
22809 * @iter: a #GMenuAttributeIter
22811 * Attempts to advance the iterator to the next (possibly first)
22814 * %TRUE is returned on success, or %FALSE if there are no more
22817 * You must call this function when you first acquire the iterator
22818 * to advance it to the first attribute (and determine if the first
22819 * attribute exists at all).
22821 * Returns: %TRUE on success, or %FALSE when there are no more attributes
22830 * Marks @menu as frozen.
22832 * After the menu is frozen, it is an error to attempt to make any
22833 * changes to it. In effect this means that the #GMenu API must no
22836 * This function causes g_menu_model_is_mutable() to begin returning
22837 * %FALSE, which has some positive performance implications.
22846 * @position: the position at which to insert the item
22847 * @label: (allow-none): the section label, or %NULL
22848 * @detailed_action: (allow-none): the detailed action string, or %NULL
22850 * Convenience function for inserting a normal menu item into @menu.
22851 * Combine g_menu_item_new() and g_menu_insert_item() for a more flexible
22859 * g_menu_insert_item:
22861 * @position: the position at which to insert the item
22862 * @item: the #GMenuItem to insert
22864 * Inserts @item into @menu.
22866 * The "insertion" is actually done by copying all of the attribute and
22867 * link values of @item and using them to form a new item within @menu.
22868 * As such, @item itself is not really inserted, but rather, a menu item
22869 * that is exactly the same as the one presently described by @item.
22871 * This means that @item is essentially useless after the insertion
22872 * occurs. Any changes you make to it are ignored unless it is inserted
22873 * again (at which point its updated values will be copied).
22875 * You should probably just free @item once you're done.
22877 * There are many convenience functions to take care of common cases.
22878 * See g_menu_insert(), g_menu_insert_section() and
22879 * g_menu_insert_submenu() as well as "prepend" and "append" variants of
22880 * each of these functions.
22887 * g_menu_insert_section:
22889 * @position: the position at which to insert the item
22890 * @label: (allow-none): the section label, or %NULL
22891 * @section: a #GMenuModel with the items of the section
22893 * Convenience function for inserting a section menu item into @menu.
22894 * Combine g_menu_item_new_section() and g_menu_insert_item() for a more
22895 * flexible alternative.
22902 * g_menu_insert_submenu:
22904 * @position: the position at which to insert the item
22905 * @label: (allow-none): the section label, or %NULL
22906 * @submenu: a #GMenuModel with the items of the submenu
22908 * Convenience function for inserting a submenu menu item into @menu.
22909 * Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more
22910 * flexible alternative.
22917 * g_menu_item_get_attribute:
22918 * @menu_item: a #GMenuItem
22919 * @attribute: the attribute name to query
22920 * @format_string: a #GVariant format string
22921 * @...: positional parameters, as per @format_string
22923 * Queries the named @attribute on @menu_item.
22925 * If the attribute exists and matches the #GVariantType corresponding
22926 * to @format_string then @format_string is used to deconstruct the
22927 * value into the positional parameters and %TRUE is returned.
22929 * If the attribute does not exist, or it does exist but has the wrong
22930 * type, then the positional parameters are ignored and %FALSE is
22933 * Returns: %TRUE if the named attribute was found with the expected type
22939 * g_menu_item_get_attribute_value:
22940 * @menu_item: a #GMenuItem
22941 * @attribute: the attribute name to query
22942 * @expected_type: (allow-none): the expected type of the attribute
22944 * Queries the named @attribute on @menu_item.
22946 * If @expected_type is specified and the attribute does not have this
22947 * type, %NULL is returned. %NULL is also returned if the attribute
22948 * simply does not exist.
22950 * Returns: (transfer full): the attribute value, or %NULL
22956 * g_menu_item_get_link:
22957 * @menu_item: a #GMenuItem
22958 * @link: the link name to query
22960 * Queries the named @link on @menu_item.
22962 * Returns: (transfer full): the link, or %NULL
22969 * @label: (allow-none): the section label, or %NULL
22970 * @detailed_action: (allow-none): the detailed action string, or %NULL
22972 * Creates a new #GMenuItem.
22974 * If @label is non-%NULL it is used to set the "label" attribute of the
22977 * If @detailed_action is non-%NULL it is used to set the "action" and
22978 * possibly the "target" attribute of the new item. See
22979 * g_menu_item_set_detailed_action() for more information.
22981 * Returns: a new #GMenuItem
22987 * g_menu_item_new_from_model:
22988 * @model: a #GMenuModel
22989 * @item_index: the index of an item in @model
22991 * Creates a #GMenuItem as an exact copy of an existing menu item in a
22994 * @item_index must be valid (ie: be sure to call
22995 * g_menu_model_get_n_items() first).
22997 * Returns: a new #GMenuItem.
23003 * g_menu_item_new_section:
23004 * @label: (allow-none): the section label, or %NULL
23005 * @section: a #GMenuModel with the items of the section
23007 * Creates a new #GMenuItem representing a section.
23009 * This is a convenience API around g_menu_item_new() and
23010 * g_menu_item_set_section().
23012 * The effect of having one menu appear as a section of another is
23013 * exactly as it sounds: the items from @section become a direct part of
23014 * the menu that @menu_item is added to.
23016 * Visual separation is typically displayed between two non-empty
23017 * sections. If @label is non-%NULL then it will be encorporated into
23018 * this visual indication. This allows for labeled subsections of a
23021 * As a simple example, consider a typical "Edit" menu from a simple
23022 * program. It probably contains an "Undo" and "Redo" item, followed by
23023 * a separator, followed by "Cut", "Copy" and "Paste".
23025 * This would be accomplished by creating three #GMenu instances. The
23026 * first would be populated with the "Undo" and "Redo" items, and the
23027 * second with the "Cut", "Copy" and "Paste" items. The first and
23028 * second menus would then be added as submenus of the third. In XML
23029 * format, this would look something like the following:
23031 * <informalexample><programlisting><![CDATA[
23032 * <menu id='edit-menu'>
23034 * <item label='Undo'/>
23035 * <item label='Redo'/>
23038 * <item label='Cut'/>
23039 * <item label='Copy'/>
23040 * <item label='Paste'/>
23043 * ]]></programlisting></informalexample>
23045 * The following example is exactly equivalent. It is more illustrative
23046 * of the exact relationship between the menus and items (keeping in
23047 * mind that the 'link' element defines a new menu that is linked to the
23048 * containing one). The style of the second example is more verbose and
23049 * difficult to read (and therefore not recommended except for the
23050 * purpose of understanding what is really going on).
23052 * <informalexample><programlisting><![CDATA[
23053 * <menu id='edit-menu'>
23055 * <link name='section'>
23056 * <item label='Undo'/>
23057 * <item label='Redo'/>
23061 * <link name='section'>
23062 * <item label='Cut'/>
23063 * <item label='Copy'/>
23064 * <item label='Paste'/>
23068 * ]]></programlisting></informalexample>
23070 * Returns: a new #GMenuItem
23076 * g_menu_item_new_submenu:
23077 * @label: (allow-none): the section label, or %NULL
23078 * @submenu: a #GMenuModel with the items of the submenu
23080 * Creates a new #GMenuItem representing a submenu.
23082 * This is a convenience API around g_menu_item_new() and
23083 * g_menu_item_set_submenu().
23085 * Returns: a new #GMenuItem
23091 * g_menu_item_set_action_and_target:
23092 * @menu_item: a #GMenuItem
23093 * @action: (allow-none): the name of the action for this item
23094 * @format_string: (allow-none): a GVariant format string
23095 * @...: positional parameters, as per @format_string
23097 * Sets or unsets the "action" and "target" attributes of @menu_item.
23099 * If @action is %NULL then both the "action" and "target" attributes
23100 * are unset (and @format_string is ignored along with the positional
23103 * If @action is non-%NULL then the "action" attribute is set.
23104 * @format_string is then inspected. If it is non-%NULL then the proper
23105 * position parameters are collected to create a #GVariant instance to
23106 * use as the target value. If it is %NULL then the positional
23107 * parameters are ignored and the "target" attribute is unset.
23109 * See also g_menu_item_set_action_and_target_value() for an equivalent
23110 * call that directly accepts a #GVariant. See
23111 * g_menu_item_set_detailed_action() for a more convenient version that
23112 * works with string-typed targets.
23114 * See also g_menu_item_set_action_and_target_value() for a
23115 * description of the semantics of the action and target attributes.
23122 * g_menu_item_set_action_and_target_value:
23123 * @menu_item: a #GMenuItem
23124 * @action: (allow-none): the name of the action for this item
23125 * @target_value: (allow-none): a #GVariant to use as the action target
23127 * Sets or unsets the "action" and "target" attributes of @menu_item.
23129 * If @action is %NULL then both the "action" and "target" attributes
23130 * are unset (and @target_value is ignored).
23132 * If @action is non-%NULL then the "action" attribute is set. The
23133 * "target" attribute is then set to the value of @target_value if it is
23134 * non-%NULL or unset otherwise.
23136 * Normal menu items (ie: not submenu, section or other custom item
23137 * types) are expected to have the "action" attribute set to identify
23138 * the action that they are associated with. The state type of the
23139 * action help to determine the disposition of the menu item. See
23140 * #GAction and #GActionGroup for an overview of actions.
23142 * In general, clicking on the menu item will result in activation of
23143 * the named action with the "target" attribute given as the parameter
23144 * to the action invocation. If the "target" attribute is not set then
23145 * the action is invoked with no parameter.
23147 * If the action has no state then the menu item is usually drawn as a
23148 * plain menu item (ie: with no additional decoration).
23150 * If the action has a boolean state then the menu item is usually drawn
23151 * as a toggle menu item (ie: with a checkmark or equivalent
23152 * indication). The item should be marked as 'toggled' or 'checked'
23153 * when the boolean state is %TRUE.
23155 * If the action has a string state then the menu item is usually drawn
23156 * as a radio menu item (ie: with a radio bullet or equivalent
23157 * indication). The item should be marked as 'selected' when the string
23158 * state is equal to the value of the @target property.
23160 * See g_menu_item_set_action_and_target() or
23161 * g_menu_item_set_detailed_action() for two equivalent calls that are
23162 * probably more convenient for most uses.
23169 * g_menu_item_set_attribute:
23170 * @menu_item: a #GMenuItem
23171 * @attribute: the attribute to set
23172 * @format_string: (allow-none): a #GVariant format string, or %NULL
23173 * @...: positional parameters, as per @format_string
23175 * Sets or unsets an attribute on @menu_item.
23177 * The attribute to set or unset is specified by @attribute. This
23178 * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23179 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23181 * Attribute names are restricted to lowercase characters, numbers
23182 * and '-'. Furthermore, the names must begin with a lowercase character,
23183 * must not end with a '-', and must not contain consecutive dashes.
23185 * If @format_string is non-%NULL then the proper position parameters
23186 * are collected to create a #GVariant instance to use as the attribute
23187 * value. If it is %NULL then the positional parameterrs are ignored
23188 * and the named attribute is unset.
23190 * See also g_menu_item_set_attribute_value() for an equivalent call
23191 * that directly accepts a #GVariant.
23198 * g_menu_item_set_attribute_value:
23199 * @menu_item: a #GMenuItem
23200 * @attribute: the attribute to set
23201 * @value: (allow-none): a #GVariant to use as the value, or %NULL
23203 * Sets or unsets an attribute on @menu_item.
23205 * The attribute to set or unset is specified by @attribute. This
23206 * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23207 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23209 * Attribute names are restricted to lowercase characters, numbers
23210 * and '-'. Furthermore, the names must begin with a lowercase character,
23211 * must not end with a '-', and must not contain consecutive dashes.
23213 * must consist only of lowercase
23214 * ASCII characters, digits and '-'.
23216 * If @value is non-%NULL then it is used as the new value for the
23217 * attribute. If @value is %NULL then the attribute is unset. If
23218 * the @value #GVariant is floating, it is consumed.
23220 * See also g_menu_item_set_attribute() for a more convenient way to do
23228 * g_menu_item_set_detailed_action:
23229 * @menu_item: a #GMenuItem
23230 * @detailed_action: the "detailed" action string
23232 * Sets the "action" and possibly the "target" attribute of @menu_item.
23234 * The format of @detailed_action is the same format parsed by
23235 * g_action_parse_detailed_name().
23237 * See g_menu_item_set_action_and_target() or
23238 * g_menu_item_set_action_and_target_value() for more flexible (but
23239 * slightly less convenient) alternatives.
23241 * See also g_menu_item_set_action_and_target_value() for a description of
23242 * the semantics of the action and target attributes.
23249 * g_menu_item_set_icon:
23250 * @menu_item: a #GMenuItem
23251 * @icon: a #GIcon, or %NULL
23253 * Sets (or unsets) the icon on @menu_item.
23255 * This call is the same as calling g_icon_serialize() and using the
23256 * result as the value to g_menu_item_set_attribute_value() for
23257 * %G_MENU_ATTRIBUTE_ICON.
23259 * This API is only intended for use with "noun" menu items; things like
23260 * bookmarks or applications in an "Open With" menu. Don't use it on
23261 * menu items corresponding to verbs (eg: stock icons for 'Save' or
23264 * If @icon is %NULL then the icon is unset.
23271 * g_menu_item_set_label:
23272 * @menu_item: a #GMenuItem
23273 * @label: (allow-none): the label to set, or %NULL to unset
23275 * Sets or unsets the "label" attribute of @menu_item.
23277 * If @label is non-%NULL it is used as the label for the menu item. If
23278 * it is %NULL then the label attribute is unset.
23285 * g_menu_item_set_link:
23286 * @menu_item: a #GMenuItem
23287 * @link: type of link to establish or unset
23288 * @model: (allow-none): the #GMenuModel to link to (or %NULL to unset)
23290 * Creates a link from @menu_item to @model if non-%NULL, or unsets it.
23292 * Links are used to establish a relationship between a particular menu
23293 * item and another menu. For example, %G_MENU_LINK_SUBMENU is used to
23294 * associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
23295 * is used to create a section. Other types of link can be used, but there
23296 * is no guarantee that clients will be able to make sense of them.
23297 * Link types are restricted to lowercase characters, numbers
23298 * and '-'. Furthermore, the names must begin with a lowercase character,
23299 * must not end with a '-', and must not contain consecutive dashes.
23306 * g_menu_item_set_section:
23307 * @menu_item: a #GMenuItem
23308 * @section: (allow-none): a #GMenuModel, or %NULL
23310 * Sets or unsets the "section" link of @menu_item to @section.
23312 * The effect of having one menu appear as a section of another is
23313 * exactly as it sounds: the items from @section become a direct part of
23314 * the menu that @menu_item is added to. See g_menu_item_new_section()
23315 * for more information about what it means for a menu item to be a
23323 * g_menu_item_set_submenu:
23324 * @menu_item: a #GMenuItem
23325 * @submenu: (allow-none): a #GMenuModel, or %NULL
23327 * Sets or unsets the "submenu" link of @menu_item to @submenu.
23329 * If @submenu is non-%NULL, it is linked to. If it is %NULL then the
23332 * The effect of having one menu appear as a submenu of another is
23333 * exactly as it sounds.
23340 * g_menu_link_iter_get_name:
23341 * @iter: a #GMenuLinkIter
23343 * Gets the name of the link at the current iterator position.
23345 * The iterator is not advanced.
23347 * Returns: the type of the link
23353 * g_menu_link_iter_get_next:
23354 * @iter: a #GMenuLinkIter
23355 * @out_link: (out) (allow-none) (transfer none): the name of the link
23356 * @value: (out) (allow-none) (transfer full): the linked #GMenuModel
23358 * This function combines g_menu_link_iter_next() with
23359 * g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
23361 * First the iterator is advanced to the next (possibly first) link.
23362 * If that fails, then %FALSE is returned and there are no other effects.
23364 * If successful, @out_link and @value are set to the name and #GMenuModel
23365 * of the link that has just been advanced to. At this point,
23366 * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
23367 * same values again.
23369 * The value returned in @out_link remains valid for as long as the iterator
23370 * remains at the current position. The value returned in @value must
23371 * be unreffed using g_object_unref() when it is no longer in use.
23373 * Returns: %TRUE on success, or %FALSE if there is no additional link
23379 * g_menu_link_iter_get_value:
23380 * @iter: a #GMenuLinkIter
23382 * Gets the linked #GMenuModel at the current iterator position.
23384 * The iterator is not advanced.
23386 * Returns: (transfer full): the #GMenuModel that is linked to
23392 * g_menu_link_iter_next:
23393 * @iter: a #GMenuLinkIter
23395 * Attempts to advance the iterator to the next (possibly first)
23398 * %TRUE is returned on success, or %FALSE if there are no more links.
23400 * You must call this function when you first acquire the iterator to
23401 * advance it to the first link (and determine if the first link exists
23404 * Returns: %TRUE on success, or %FALSE when there are no more links
23410 * g_menu_model_get_item_attribute:
23411 * @model: a #GMenuModel
23412 * @item_index: the index of the item
23413 * @attribute: the attribute to query
23414 * @format_string: a #GVariant format string
23415 * @...: positional parameters, as per @format_string
23417 * Queries item at position @item_index in @model for the attribute
23418 * specified by @attribute.
23420 * If the attribute exists and matches the #GVariantType corresponding
23421 * to @format_string then @format_string is used to deconstruct the
23422 * value into the positional parameters and %TRUE is returned.
23424 * If the attribute does not exist, or it does exist but has the wrong
23425 * type, then the positional parameters are ignored and %FALSE is
23428 * This function is a mix of g_menu_model_get_item_attribute_value() and
23429 * g_variant_get(), followed by a g_variant_unref(). As such,
23430 * @format_string must make a complete copy of the data (since the
23431 * #GVariant may go away after the call to g_variant_unref()). In
23432 * particular, no '&' characters are allowed in @format_string.
23434 * Returns: %TRUE if the named attribute was found with the expected type
23440 * g_menu_model_get_item_attribute_value:
23441 * @model: a #GMenuModel
23442 * @item_index: the index of the item
23443 * @attribute: the attribute to query
23444 * @expected_type: (allow-none): the expected type of the attribute, or %NULL
23446 * Queries the item at position @item_index in @model for the attribute
23447 * specified by @attribute.
23449 * If @expected_type is non-%NULL then it specifies the expected type of
23450 * the attribute. If it is %NULL then any type will be accepted.
23452 * If the attribute exists and matches @expected_type (or if the
23453 * expected type is unspecified) then the value is returned.
23455 * If the attribute does not exist, or does not match the expected type
23456 * then %NULL is returned.
23458 * Returns: (transfer full): the value of the attribute
23464 * g_menu_model_get_item_link:
23465 * @model: a #GMenuModel
23466 * @item_index: the index of the item
23467 * @link: the link to query
23469 * Queries the item at position @item_index in @model for the link
23470 * specified by @link.
23472 * If the link exists, the linked #GMenuModel is returned. If the link
23473 * does not exist, %NULL is returned.
23475 * Returns: (transfer full): the linked #GMenuModel, or %NULL
23481 * g_menu_model_get_n_items:
23482 * @model: a #GMenuModel
23484 * Query the number of items in @model.
23486 * Returns: the number of items
23492 * g_menu_model_is_mutable:
23493 * @model: a #GMenuModel
23495 * Queries if @model is mutable.
23497 * An immutable #GMenuModel will never emit the #GMenuModel::items-changed
23498 * signal. Consumers of the model may make optimisations accordingly.
23500 * Returns: %TRUE if the model is mutable (ie: "items-changed" may be emitted).
23506 * g_menu_model_items_changed:
23507 * @model: a #GMenuModel
23508 * @position: the position of the change
23509 * @removed: the number of items removed
23510 * @added: the number of items added
23512 * Requests emission of the #GMenuModel::items-changed signal on @model.
23514 * This function should never be called except by #GMenuModel
23515 * subclasses. Any other calls to this function will very likely lead
23516 * to a violation of the interface of the model.
23518 * The implementation should update its internal representation of the
23519 * menu before emitting the signal. The implementation should further
23520 * expect to receive queries about the new state of the menu (and
23521 * particularly added menu items) while signal handlers are running.
23523 * The implementation must dispatch this call directly from a mainloop
23524 * entry and not in response to calls -- particularly those from the
23525 * #GMenuModel API. Said another way: the menu must not change while
23526 * user code is running without returning to the mainloop.
23533 * g_menu_model_iterate_item_attributes:
23534 * @model: a #GMenuModel
23535 * @item_index: the index of the item
23537 * Creates a #GMenuAttributeIter to iterate over the attributes of
23538 * the item at position @item_index in @model.
23540 * You must free the iterator with g_object_unref() when you are done.
23542 * Returns: (transfer full): a new #GMenuAttributeIter
23548 * g_menu_model_iterate_item_links:
23549 * @model: a #GMenuModel
23550 * @item_index: the index of the item
23552 * Creates a #GMenuLinkIter to iterate over the links of the item at
23553 * position @item_index in @model.
23555 * You must free the iterator with g_object_unref() when you are done.
23557 * Returns: (transfer full): a new #GMenuLinkIter
23565 * Creates a new #GMenu.
23567 * The new menu has no items.
23569 * Returns: a new #GMenu
23577 * @label: (allow-none): the section label, or %NULL
23578 * @detailed_action: (allow-none): the detailed action string, or %NULL
23580 * Convenience function for prepending a normal menu item to the start
23581 * of @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
23582 * flexible alternative.
23589 * g_menu_prepend_item:
23591 * @item: a #GMenuItem to prepend
23593 * Prepends @item to the start of @menu.
23595 * See g_menu_insert_item() for more information.
23602 * g_menu_prepend_section:
23604 * @label: (allow-none): the section label, or %NULL
23605 * @section: a #GMenuModel with the items of the section
23607 * Convenience function for prepending a section menu item to the start
23608 * of @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for
23609 * a more flexible alternative.
23616 * g_menu_prepend_submenu:
23618 * @label: (allow-none): the section label, or %NULL
23619 * @submenu: a #GMenuModel with the items of the submenu
23621 * Convenience function for prepending a submenu menu item to the start
23622 * of @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for
23623 * a more flexible alternative.
23632 * @position: the position of the item to remove
23634 * Removes an item from the menu.
23636 * @position gives the index of the item to remove.
23638 * It is an error if position is not in range the range from 0 to one
23639 * less than the number of items in the menu.
23641 * It is not possible to remove items by identity since items are added
23642 * to the menu simply by copying their links and attributes (ie:
23643 * identity of the item itself is not preserved).
23650 * g_menu_remove_all:
23653 * Removes all items in the menu.
23660 * g_mount_can_eject:
23661 * @mount: a #GMount.
23663 * Checks if @mount can be eject.
23665 * Returns: %TRUE if the @mount can be ejected.
23670 * g_mount_can_unmount:
23671 * @mount: a #GMount.
23673 * Checks if @mount can be mounted.
23675 * Returns: %TRUE if the @mount can be unmounted.
23681 * @mount: a #GMount.
23682 * @flags: flags affecting the unmount if required for eject
23683 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23684 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23685 * @user_data: user data passed to @callback.
23687 * Ejects a mount. This is an asynchronous operation, and is
23688 * finished by calling g_mount_eject_finish() with the @mount
23689 * and #GAsyncResult data returned in the @callback.
23691 * Deprecated: 2.22: Use g_mount_eject_with_operation() instead.
23696 * g_mount_eject_finish:
23697 * @mount: a #GMount.
23698 * @result: a #GAsyncResult.
23699 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23701 * Finishes ejecting a mount. If any errors occurred during the operation,
23702 * @error will be set to contain the errors and %FALSE will be returned.
23704 * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23705 * Deprecated: 2.22: Use g_mount_eject_with_operation_finish() instead.
23710 * g_mount_eject_with_operation:
23711 * @mount: a #GMount.
23712 * @flags: flags affecting the unmount if required for eject
23713 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23714 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23715 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23716 * @user_data: user data passed to @callback.
23718 * Ejects a mount. This is an asynchronous operation, and is
23719 * finished by calling g_mount_eject_with_operation_finish() with the @mount
23720 * and #GAsyncResult data returned in the @callback.
23727 * g_mount_eject_with_operation_finish:
23728 * @mount: a #GMount.
23729 * @result: a #GAsyncResult.
23730 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23732 * Finishes ejecting a mount. If any errors occurred during the operation,
23733 * @error will be set to contain the errors and %FALSE will be returned.
23735 * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23741 * g_mount_get_default_location:
23742 * @mount: a #GMount.
23744 * Gets the default location of @mount. The default location of the given
23745 * @mount is a path that reflects the main entry point for the user (e.g.
23746 * the home directory, or the root of the volume).
23748 * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23753 * g_mount_get_drive:
23754 * @mount: a #GMount.
23756 * Gets the drive for the @mount.
23758 * This is a convenience method for getting the #GVolume and then
23759 * using that object to get the #GDrive.
23761 * 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.
23766 * g_mount_get_icon:
23767 * @mount: a #GMount.
23769 * Gets the icon for @mount.
23771 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23776 * g_mount_get_name:
23777 * @mount: a #GMount.
23779 * Gets the name of @mount.
23781 * Returns: the name for the given @mount. The returned string should be freed with g_free() when no longer needed.
23786 * g_mount_get_root:
23787 * @mount: a #GMount.
23789 * Gets the root directory on @mount.
23791 * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23796 * g_mount_get_sort_key:
23797 * @mount: A #GMount.
23799 * Gets the sort key for @mount, if any.
23801 * Returns: Sorting key for @mount or %NULL if no such key is available.
23807 * g_mount_get_symbolic_icon:
23808 * @mount: a #GMount.
23810 * Gets the symbolic icon for @mount.
23812 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23818 * g_mount_get_uuid:
23819 * @mount: a #GMount.
23821 * Gets the UUID for the @mount. The reference is typically based on
23822 * the file system UUID for the mount in question and should be
23823 * considered an opaque string. Returns %NULL if there is no UUID
23826 * 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.
23831 * g_mount_get_volume:
23832 * @mount: a #GMount.
23834 * Gets the volume for the @mount.
23836 * 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.
23841 * g_mount_guess_content_type:
23842 * @mount: a #GMount
23843 * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23844 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23845 * @callback: a #GAsyncReadyCallback
23846 * @user_data: user data passed to @callback
23848 * Tries to guess the type of content stored on @mount. Returns one or
23849 * more textual identifiers of well-known content types (typically
23850 * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23851 * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23852 * specification for more on x-content types.
23854 * This is an asynchronous operation (see
23855 * g_mount_guess_content_type_sync() for the synchronous version), and
23856 * is finished by calling g_mount_guess_content_type_finish() with the
23857 * @mount and #GAsyncResult data returned in the @callback.
23864 * g_mount_guess_content_type_finish:
23865 * @mount: a #GMount
23866 * @result: a #GAsyncResult
23867 * @error: a #GError location to store the error occurring, or %NULL to ignore
23869 * Finishes guessing content types of @mount. If any errors occurred
23870 * during the operation, @error will be set to contain the errors and
23871 * %FALSE will be returned. In particular, you may get an
23872 * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
23875 * 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.
23881 * g_mount_guess_content_type_sync:
23882 * @mount: a #GMount
23883 * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23884 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23885 * @error: a #GError location to store the error occurring, or %NULL to ignore
23887 * Tries to guess the type of content stored on @mount. Returns one or
23888 * more textual identifiers of well-known content types (typically
23889 * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23890 * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23891 * specification for more on x-content types.
23893 * This is an synchronous operation and as such may block doing IO;
23894 * see g_mount_guess_content_type() for the asynchronous version.
23896 * 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.
23902 * g_mount_is_shadowed:
23903 * @mount: A #GMount.
23905 * Determines if @mount is shadowed. Applications or libraries should
23906 * avoid displaying @mount in the user interface if it is shadowed.
23908 * A mount is said to be shadowed if there exists one or more user
23909 * visible objects (currently #GMount objects) with a root that is
23910 * inside the root of @mount.
23912 * One application of shadow mounts is when exposing a single file
23913 * system that is used to address several logical volumes. In this
23914 * situation, a #GVolumeMonitor implementation would create two
23915 * #GVolume objects (for example, one for the camera functionality of
23916 * the device and one for a SD card reader on the device) with
23917 * activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
23918 * and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
23919 * underlying mount (with root
23920 * <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
23921 * #GVolumeMonitor implementation would create two #GMount objects
23922 * (each with their root matching the corresponding volume activation
23923 * root) that would shadow the original mount.
23925 * The proxy monitor in GVfs 2.26 and later, automatically creates and
23926 * manage shadow mounts (and shadows the underlying mount) if the
23927 * activation root on a #GVolume is set.
23929 * Returns: %TRUE if @mount is shadowed.
23935 * g_mount_operation_get_anonymous:
23936 * @op: a #GMountOperation.
23938 * Check to see whether the mount operation is being used
23939 * for an anonymous user.
23941 * Returns: %TRUE if mount operation is anonymous.
23946 * g_mount_operation_get_choice:
23947 * @op: a #GMountOperation.
23949 * Gets a choice from the mount operation.
23951 * Returns: an integer containing an index of the user's choice from the choice's list, or %0.
23956 * g_mount_operation_get_domain:
23957 * @op: a #GMountOperation.
23959 * Gets the domain of the mount operation.
23961 * Returns: a string set to the domain.
23966 * g_mount_operation_get_password:
23967 * @op: a #GMountOperation.
23969 * Gets a password from the mount operation.
23971 * Returns: a string containing the password within @op.
23976 * g_mount_operation_get_password_save:
23977 * @op: a #GMountOperation.
23979 * Gets the state of saving passwords for the mount operation.
23981 * Returns: a #GPasswordSave flag.
23986 * g_mount_operation_get_username:
23987 * @op: a #GMountOperation.
23989 * Get the user name from the mount operation.
23991 * Returns: a string containing the user name.
23996 * g_mount_operation_new:
23998 * Creates a new mount operation.
24000 * Returns: a #GMountOperation.
24005 * g_mount_operation_reply:
24006 * @op: a #GMountOperation
24007 * @result: a #GMountOperationResult
24009 * Emits the #GMountOperation::reply signal.
24014 * g_mount_operation_set_anonymous:
24015 * @op: a #GMountOperation.
24016 * @anonymous: boolean value.
24018 * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
24023 * g_mount_operation_set_choice:
24024 * @op: a #GMountOperation.
24025 * @choice: an integer.
24027 * Sets a default choice for the mount operation.
24032 * g_mount_operation_set_domain:
24033 * @op: a #GMountOperation.
24034 * @domain: the domain to set.
24036 * Sets the mount operation's domain.
24041 * g_mount_operation_set_password:
24042 * @op: a #GMountOperation.
24043 * @password: password to set.
24045 * Sets the mount operation's password to @password.
24050 * g_mount_operation_set_password_save:
24051 * @op: a #GMountOperation.
24052 * @save: a set of #GPasswordSave flags.
24054 * Sets the state of saving passwords for the mount operation.
24059 * g_mount_operation_set_username:
24060 * @op: a #GMountOperation.
24061 * @username: input username.
24063 * Sets the user name within @op to @username.
24069 * @mount: a #GMount.
24070 * @flags: flags affecting the operation
24071 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
24072 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24073 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24074 * @user_data: user data passed to @callback.
24076 * Remounts a mount. This is an asynchronous operation, and is
24077 * finished by calling g_mount_remount_finish() with the @mount
24078 * and #GAsyncResults data returned in the @callback.
24080 * Remounting is useful when some setting affecting the operation
24081 * of the volume has been changed, as these may need a remount to
24082 * take affect. While this is semantically equivalent with unmounting
24083 * and then remounting not all backends might need to actually be
24089 * g_mount_remount_finish:
24090 * @mount: a #GMount.
24091 * @result: a #GAsyncResult.
24092 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24094 * Finishes remounting a mount. If any errors occurred during the operation,
24095 * @error will be set to contain the errors and %FALSE will be returned.
24097 * Returns: %TRUE if the mount was successfully remounted. %FALSE otherwise.
24103 * @mount: A #GMount.
24105 * Increments the shadow count on @mount. Usually used by
24106 * #GVolumeMonitor implementations when creating a shadow mount for
24107 * @mount, see g_mount_is_shadowed() for more information. The caller
24108 * will need to emit the #GMount::changed signal on @mount manually.
24116 * @mount: a #GMount.
24117 * @flags: flags affecting the operation
24118 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24119 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24120 * @user_data: user data passed to @callback.
24122 * Unmounts a mount. This is an asynchronous operation, and is
24123 * finished by calling g_mount_unmount_finish() with the @mount
24124 * and #GAsyncResult data returned in the @callback.
24126 * Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
24131 * g_mount_unmount_finish:
24132 * @mount: a #GMount.
24133 * @result: a #GAsyncResult.
24134 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24136 * Finishes unmounting a mount. If any errors occurred during the operation,
24137 * @error will be set to contain the errors and %FALSE will be returned.
24139 * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
24140 * Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
24145 * g_mount_unmount_with_operation:
24146 * @mount: a #GMount.
24147 * @flags: flags affecting the operation
24148 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
24149 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24150 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
24151 * @user_data: user data passed to @callback.
24153 * Unmounts a mount. This is an asynchronous operation, and is
24154 * finished by calling g_mount_unmount_with_operation_finish() with the @mount
24155 * and #GAsyncResult data returned in the @callback.
24162 * g_mount_unmount_with_operation_finish:
24163 * @mount: a #GMount.
24164 * @result: a #GAsyncResult.
24165 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24167 * Finishes unmounting a mount. If any errors occurred during the operation,
24168 * @error will be set to contain the errors and %FALSE will be returned.
24170 * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
24176 * g_mount_unshadow:
24177 * @mount: A #GMount.
24179 * Decrements the shadow count on @mount. Usually used by
24180 * #GVolumeMonitor implementations when destroying a shadow mount for
24181 * @mount, see g_mount_is_shadowed() for more information. The caller
24182 * will need to emit the #GMount::changed signal on @mount manually.
24189 * g_network_address_get_hostname:
24190 * @addr: a #GNetworkAddress
24192 * Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
24193 * depending on what @addr was created with.
24195 * Returns: @addr's hostname
24201 * g_network_address_get_port:
24202 * @addr: a #GNetworkAddress
24204 * Gets @addr's port number
24206 * Returns: @addr's port (which may be 0)
24212 * g_network_address_get_scheme:
24213 * @addr: a #GNetworkAddress
24215 * Gets @addr's scheme
24217 * Returns: @addr's scheme (%NULL if not built from URI)
24223 * g_network_address_new:
24224 * @hostname: the hostname
24227 * Creates a new #GSocketConnectable for connecting to the given
24228 * @hostname and @port.
24230 * Returns: (transfer full) (type GNetworkAddress): the new #GNetworkAddress
24236 * g_network_address_parse:
24237 * @host_and_port: the hostname and optionally a port
24238 * @default_port: the default port if not in @host_and_port
24239 * @error: a pointer to a #GError, or %NULL
24241 * Creates a new #GSocketConnectable for connecting to the given
24242 * @hostname and @port. May fail and return %NULL in case
24243 * parsing @host_and_port fails.
24245 * @host_and_port may be in any of a number of recognised formats; an IPv6
24246 * address, an IPv4 address, or a domain name (in which case a DNS
24247 * lookup is performed). Quoting with [] is supported for all address
24248 * types. A port override may be specified in the usual way with a
24251 * If no port is specified in @host_and_port then @default_port will be
24252 * used as the port number to connect to.
24254 * In general, @host_and_port is expected to be provided by the user
24255 * (allowing them to give the hostname, and a port overide if necessary)
24256 * and @default_port is expected to be provided by the application.
24258 * (The port component of @host_and_port can also be specified as a
24259 * service name rather than as a numeric port, but this functionality
24260 * is deprecated, because it depends on the contents of /etc/services,
24261 * which is generally quite sparse on platforms other than Linux.)
24263 * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24269 * g_network_address_parse_uri:
24270 * @uri: the hostname and optionally a port
24271 * @default_port: The default port if none is found in the URI
24272 * @error: a pointer to a #GError, or %NULL
24274 * Creates a new #GSocketConnectable for connecting to the given
24275 * @uri. May fail and return %NULL in case parsing @uri fails.
24277 * Using this rather than g_network_address_new() or
24278 * g_network_address_parse() allows #GSocketClient to determine
24279 * when to use application-specific proxy protocols.
24281 * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24287 * g_network_monitor_base_add_network:
24288 * @monitor: the #GNetworkMonitorBase
24289 * @network: a #GInetAddressMask
24291 * Adds @network to @monitor's list of available networks.
24298 * g_network_monitor_base_remove_network:
24299 * @monitor: the #GNetworkMonitorBase
24300 * @network: a #GInetAddressMask
24302 * Removes @network from @monitor's list of available networks.
24309 * g_network_monitor_base_set_networks:
24310 * @monitor: the #GNetworkMonitorBase
24311 * @networks: (array length=length): an array of #GInetAddressMask
24312 * @length: length of @networks
24314 * Drops @monitor's current list of available networks and replaces
24315 * it with @networks.
24320 * g_network_monitor_can_reach:
24321 * @monitor: a #GNetworkMonitor
24322 * @connectable: a #GSocketConnectable
24323 * @cancellable: (allow-none): a #GCancellable, or %NULL
24324 * @error: return location for a #GError, or %NULL
24326 * Attempts to determine whether or not the host pointed to by
24327 * @connectable can be reached, without actually trying to connect to
24330 * This may return %TRUE even when #GNetworkMonitor:network-available
24331 * is %FALSE, if, for example, @monitor can determine that
24332 * @connectable refers to a host on a local network.
24334 * If @monitor believes that an attempt to connect to @connectable
24335 * will succeed, it will return %TRUE. Otherwise, it will return
24336 * %FALSE and set @error to an appropriate error (such as
24337 * %G_IO_ERROR_HOST_UNREACHABLE).
24339 * Note that although this does not attempt to connect to
24340 * @connectable, it may still block for a brief period of time (eg,
24341 * trying to do multicast DNS on the local network), so if you do not
24342 * want to block, you should use g_network_monitor_can_reach_async().
24344 * Returns: %TRUE if @connectable is reachable, %FALSE if not.
24350 * g_network_monitor_can_reach_async:
24351 * @monitor: a #GNetworkMonitor
24352 * @connectable: a #GSocketConnectable
24353 * @cancellable: (allow-none): a #GCancellable, or %NULL
24354 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24355 * @user_data: (closure): the data to pass to callback function
24357 * Asynchronously attempts to determine whether or not the host
24358 * pointed to by @connectable can be reached, without actually
24359 * trying to connect to it.
24361 * For more details, see g_network_monitor_can_reach().
24363 * When the operation is finished, @callback will be called.
24364 * You can then call g_network_monitor_can_reach_finish()
24365 * to get the result of the operation.
24370 * g_network_monitor_can_reach_finish:
24371 * @monitor: a #GNetworkMonitor
24372 * @result: a #GAsyncResult
24373 * @error: return location for errors, or %NULL
24375 * Finishes an async network connectivity test.
24376 * See g_network_monitor_can_reach_async().
24378 * Returns: %TRUE if network is reachable, %FALSE if not.
24383 * g_network_monitor_get_default:
24385 * Gets the default #GNetworkMonitor for the system.
24387 * Returns: (transfer none): a #GNetworkMonitor
24393 * g_network_monitor_get_network_available:
24394 * @monitor: the #GNetworkMonitor
24396 * Checks if the network is available. "Available" here means that the
24397 * system has a default route available for at least one of IPv4 or
24398 * IPv6. It does not necessarily imply that the public Internet is
24399 * reachable. See #GNetworkMonitor:network-available for more details.
24401 * Returns: whether the network is available
24407 * g_network_service_get_domain:
24408 * @srv: a #GNetworkService
24410 * Gets the domain that @srv serves. This might be either UTF-8 or
24411 * ASCII-encoded, depending on what @srv was created with.
24413 * Returns: @srv's domain name
24419 * g_network_service_get_protocol:
24420 * @srv: a #GNetworkService
24422 * Gets @srv's protocol name (eg, "tcp").
24424 * Returns: @srv's protocol name
24430 * g_network_service_get_scheme:
24431 * @srv: a #GNetworkService
24433 * Get's the URI scheme used to resolve proxies. By default, the service name
24434 * is used as scheme.
24436 * Returns: @srv's scheme name
24442 * g_network_service_get_service:
24443 * @srv: a #GNetworkService
24445 * Gets @srv's service name (eg, "ldap").
24447 * Returns: @srv's service name
24453 * g_network_service_new:
24454 * @service: the service type to look up (eg, "ldap")
24455 * @protocol: the networking protocol to use for @service (eg, "tcp")
24456 * @domain: the DNS domain to look up the service in
24458 * Creates a new #GNetworkService representing the given @service,
24459 * @protocol, and @domain. This will initially be unresolved; use the
24460 * #GSocketConnectable interface to resolve it.
24462 * Returns: (transfer full) (type GNetworkService): a new #GNetworkService
24468 * g_network_service_set_scheme:
24469 * @srv: a #GNetworkService
24470 * @scheme: a URI scheme
24472 * Set's the URI scheme used to resolve proxies. By default, the service name
24473 * is used as scheme.
24480 * g_networking_init:
24482 * Initializes the platform networking libraries (eg, on Windows, this
24483 * calls WSAStartup()). GLib will call this itself if it is needed, so
24484 * you only need to call it if you directly call system networking
24485 * functions (without calling any GLib networking functions first).
24492 * g_null_settings_backend_new:
24494 * Creates a readonly #GSettingsBackend.
24496 * This backend does not allow changes to settings, so all settings
24497 * will always have their default values.
24499 * Returns: (transfer full): a newly created #GSettingsBackend
24505 * g_output_stream_clear_pending:
24506 * @stream: output stream
24508 * Clears the pending flag on @stream.
24513 * g_output_stream_close:
24514 * @stream: A #GOutputStream.
24515 * @cancellable: (allow-none): optional cancellable object
24516 * @error: location to store the error occurring, or %NULL to ignore
24518 * Closes the stream, releasing resources related to it.
24520 * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
24521 * Closing a stream multiple times will not return an error.
24523 * Closing a stream will automatically flush any outstanding buffers in the
24526 * Streams will be automatically closed when the last reference
24527 * is dropped, but you might want to call this function to make sure
24528 * resources are released as early as possible.
24530 * Some streams might keep the backing store of the stream (e.g. a file descriptor)
24531 * open after the stream is closed. See the documentation for the individual
24532 * stream for details.
24534 * On failure the first error that happened will be reported, but the close
24535 * operation will finish as much as possible. A stream that failed to
24536 * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
24537 * is important to check and report the error to the user, otherwise
24538 * there might be a loss of data as all data might not be written.
24540 * If @cancellable is not %NULL, then the operation can be cancelled by
24541 * triggering the cancellable object from another thread. If the operation
24542 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24543 * Cancelling a close will still leave the stream closed, but there some streams
24544 * can use a faster close that doesn't block to e.g. check errors. On
24545 * cancellation (as with any error) there is no guarantee that all written
24546 * data will reach the target.
24548 * Returns: %TRUE on success, %FALSE on failure
24553 * g_output_stream_close_async:
24554 * @stream: A #GOutputStream.
24555 * @io_priority: the io priority of the request.
24556 * @cancellable: (allow-none): optional cancellable object
24557 * @callback: (scope async): callback to call when the request is satisfied
24558 * @user_data: (closure): the data to pass to callback function
24560 * Requests an asynchronous close of the stream, releasing resources
24561 * related to it. When the operation is finished @callback will be
24562 * called. You can then call g_output_stream_close_finish() to get
24563 * the result of the operation.
24565 * For behaviour details see g_output_stream_close().
24567 * The asyncronous methods have a default fallback that uses threads
24568 * to implement asynchronicity, so they are optional for inheriting
24569 * classes. However, if you override one you must override all.
24574 * g_output_stream_close_finish:
24575 * @stream: a #GOutputStream.
24576 * @result: a #GAsyncResult.
24577 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24579 * Closes an output stream.
24581 * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
24586 * g_output_stream_flush:
24587 * @stream: a #GOutputStream.
24588 * @cancellable: (allow-none): optional cancellable object
24589 * @error: location to store the error occurring, or %NULL to ignore
24591 * Forces a write of all user-space buffered data for the given
24592 * @stream. Will block during the operation. Closing the stream will
24593 * implicitly cause a flush.
24595 * This function is optional for inherited classes.
24597 * If @cancellable is not %NULL, then the operation can be cancelled by
24598 * triggering the cancellable object from another thread. If the operation
24599 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24601 * Returns: %TRUE on success, %FALSE on error
24606 * g_output_stream_flush_async:
24607 * @stream: a #GOutputStream.
24608 * @io_priority: the io priority of the request.
24609 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24610 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24611 * @user_data: (closure): the data to pass to callback function
24613 * Forces an asynchronous write of all user-space buffered data for
24614 * the given @stream.
24615 * For behaviour details see g_output_stream_flush().
24617 * When the operation is finished @callback will be
24618 * called. You can then call g_output_stream_flush_finish() to get the
24619 * result of the operation.
24624 * g_output_stream_flush_finish:
24625 * @stream: a #GOutputStream.
24626 * @result: a GAsyncResult.
24627 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24629 * Finishes flushing an output stream.
24631 * Returns: %TRUE if flush operation succeeded, %FALSE otherwise.
24636 * g_output_stream_has_pending:
24637 * @stream: a #GOutputStream.
24639 * Checks if an ouput stream has pending actions.
24641 * Returns: %TRUE if @stream has pending actions.
24646 * g_output_stream_is_closed:
24647 * @stream: a #GOutputStream.
24649 * Checks if an output stream has already been closed.
24651 * Returns: %TRUE if @stream is closed. %FALSE otherwise.
24656 * g_output_stream_is_closing:
24657 * @stream: a #GOutputStream.
24659 * Checks if an output stream is being closed. This can be
24660 * used inside e.g. a flush implementation to see if the
24661 * flush (or other i/o operation) is called from within
24662 * the closing operation.
24664 * Returns: %TRUE if @stream is being closed. %FALSE otherwise.
24670 * g_output_stream_set_pending:
24671 * @stream: a #GOutputStream.
24672 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24674 * Sets @stream to have actions pending. If the pending flag is
24675 * already set or @stream is closed, it will return %FALSE and set
24678 * Returns: %TRUE if pending was previously unset and is now set.
24683 * g_output_stream_splice:
24684 * @stream: a #GOutputStream.
24685 * @source: a #GInputStream.
24686 * @flags: a set of #GOutputStreamSpliceFlags.
24687 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24688 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24690 * Splices an input stream into an output stream.
24692 * 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.
24697 * g_output_stream_splice_async:
24698 * @stream: a #GOutputStream.
24699 * @source: a #GInputStream.
24700 * @flags: a set of #GOutputStreamSpliceFlags.
24701 * @io_priority: the io priority of the request.
24702 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24703 * @callback: (scope async): a #GAsyncReadyCallback.
24704 * @user_data: (closure): user data passed to @callback.
24706 * Splices a stream asynchronously.
24707 * When the operation is finished @callback will be called.
24708 * You can then call g_output_stream_splice_finish() to get the
24709 * result of the operation.
24711 * For the synchronous, blocking version of this function, see
24712 * g_output_stream_splice().
24717 * g_output_stream_splice_finish:
24718 * @stream: a #GOutputStream.
24719 * @result: a #GAsyncResult.
24720 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24722 * Finishes an asynchronous stream splice operation.
24724 * 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.
24729 * g_output_stream_write:
24730 * @stream: a #GOutputStream.
24731 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24732 * @count: the number of bytes to write
24733 * @cancellable: (allow-none): optional cancellable object
24734 * @error: location to store the error occurring, or %NULL to ignore
24736 * Tries to write @count bytes from @buffer into the stream. Will block
24737 * during the operation.
24739 * If count is 0, returns 0 and does nothing. A value of @count
24740 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24742 * On success, the number of bytes written to the stream is returned.
24743 * It is not an error if this is not the same as the requested size, as it
24744 * can happen e.g. on a partial I/O error, or if there is not enough
24745 * storage in the stream. All writes block until at least one byte
24746 * is written or an error occurs; 0 is never returned (unless
24749 * If @cancellable is not %NULL, then the operation can be cancelled by
24750 * triggering the cancellable object from another thread. If the operation
24751 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24752 * operation was partially finished when the operation was cancelled the
24753 * partial result will be returned, without an error.
24755 * On error -1 is returned and @error is set accordingly.
24757 * Virtual: write_fn
24758 * Returns: Number of bytes written, or -1 on error
24763 * g_output_stream_write_all:
24764 * @stream: a #GOutputStream.
24765 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24766 * @count: the number of bytes to write
24767 * @bytes_written: (out): location to store the number of bytes that was written to the stream
24768 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24769 * @error: location to store the error occurring, or %NULL to ignore
24771 * Tries to write @count bytes from @buffer into the stream. Will block
24772 * during the operation.
24774 * This function is similar to g_output_stream_write(), except it tries to
24775 * write as many bytes as requested, only stopping on an error.
24777 * On a successful write of @count bytes, %TRUE is returned, and @bytes_written
24778 * is set to @count.
24780 * If there is an error during the operation %FALSE is returned and @error
24781 * is set to indicate the error status, @bytes_written is updated to contain
24782 * the number of bytes written into the stream before the error occurred.
24784 * Returns: %TRUE on success, %FALSE if there was an error
24789 * g_output_stream_write_async:
24790 * @stream: A #GOutputStream.
24791 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24792 * @count: the number of bytes to write
24793 * @io_priority: the io priority of the request.
24794 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24795 * @callback: (scope async): callback to call when the request is satisfied
24796 * @user_data: (closure): the data to pass to callback function
24798 * Request an asynchronous write of @count bytes from @buffer into
24799 * the stream. When the operation is finished @callback will be called.
24800 * You can then call g_output_stream_write_finish() to get the result of the
24803 * During an async request no other sync and async calls are allowed,
24804 * and will result in %G_IO_ERROR_PENDING errors.
24806 * A value of @count larger than %G_MAXSSIZE will cause a
24807 * %G_IO_ERROR_INVALID_ARGUMENT error.
24809 * On success, the number of bytes written will be passed to the
24810 * @callback. It is not an error if this is not the same as the
24811 * requested size, as it can happen e.g. on a partial I/O error,
24812 * but generally we try to write as many bytes as requested.
24814 * You are guaranteed that this method will never fail with
24815 * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24816 * method will just wait until this changes.
24818 * Any outstanding I/O request with higher priority (lower numerical
24819 * value) will be executed before an outstanding request with lower
24820 * priority. Default priority is %G_PRIORITY_DEFAULT.
24822 * The asyncronous methods have a default fallback that uses threads
24823 * to implement asynchronicity, so they are optional for inheriting
24824 * classes. However, if you override one you must override all.
24826 * For the synchronous, blocking version of this function, see
24827 * g_output_stream_write().
24832 * g_output_stream_write_bytes:
24833 * @stream: a #GOutputStream.
24834 * @bytes: the #GBytes to write
24835 * @cancellable: (allow-none): optional cancellable object
24836 * @error: location to store the error occurring, or %NULL to ignore
24838 * Tries to write the data from @bytes into the stream. Will block
24839 * during the operation.
24841 * If @bytes is 0-length, returns 0 and does nothing. A #GBytes larger
24842 * than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24844 * On success, the number of bytes written to the stream is returned.
24845 * It is not an error if this is not the same as the requested size, as it
24846 * can happen e.g. on a partial I/O error, or if there is not enough
24847 * storage in the stream. All writes block until at least one byte
24848 * is written or an error occurs; 0 is never returned (unless
24849 * the size of @bytes is 0).
24851 * If @cancellable is not %NULL, then the operation can be cancelled by
24852 * triggering the cancellable object from another thread. If the operation
24853 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24854 * operation was partially finished when the operation was cancelled the
24855 * partial result will be returned, without an error.
24857 * On error -1 is returned and @error is set accordingly.
24859 * Returns: Number of bytes written, or -1 on error
24864 * g_output_stream_write_bytes_async:
24865 * @stream: A #GOutputStream.
24866 * @bytes: The bytes to write
24867 * @io_priority: the io priority of the request.
24868 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24869 * @callback: (scope async): callback to call when the request is satisfied
24870 * @user_data: (closure): the data to pass to callback function
24872 * Request an asynchronous write of the data in @bytes to the stream.
24873 * When the operation is finished @callback will be called. You can
24874 * then call g_output_stream_write_bytes_finish() to get the result of
24877 * During an async request no other sync and async calls are allowed,
24878 * and will result in %G_IO_ERROR_PENDING errors.
24880 * A #GBytes larger than %G_MAXSSIZE will cause a
24881 * %G_IO_ERROR_INVALID_ARGUMENT error.
24883 * On success, the number of bytes written will be passed to the
24884 * @callback. It is not an error if this is not the same as the
24885 * requested size, as it can happen e.g. on a partial I/O error,
24886 * but generally we try to write as many bytes as requested.
24888 * You are guaranteed that this method will never fail with
24889 * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24890 * method will just wait until this changes.
24892 * Any outstanding I/O request with higher priority (lower numerical
24893 * value) will be executed before an outstanding request with lower
24894 * priority. Default priority is %G_PRIORITY_DEFAULT.
24896 * For the synchronous, blocking version of this function, see
24897 * g_output_stream_write_bytes().
24902 * g_output_stream_write_bytes_finish:
24903 * @stream: a #GOutputStream.
24904 * @result: a #GAsyncResult.
24905 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24907 * Finishes a stream write-from-#GBytes operation.
24909 * Returns: a #gssize containing the number of bytes written to the stream.
24914 * g_output_stream_write_finish:
24915 * @stream: a #GOutputStream.
24916 * @result: a #GAsyncResult.
24917 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24919 * Finishes a stream write operation.
24921 * Returns: a #gssize containing the number of bytes written to the stream.
24926 * g_permission_acquire:
24927 * @permission: a #GPermission instance
24928 * @cancellable: (allow-none): a #GCancellable, or %NULL
24929 * @error: a pointer to a %NULL #GError, or %NULL
24931 * Attempts to acquire the permission represented by @permission.
24933 * The precise method by which this happens depends on the permission
24934 * and the underlying authentication mechanism. A simple example is
24935 * that a dialog may appear asking the user to enter their password.
24937 * You should check with g_permission_get_can_acquire() before calling
24940 * If the permission is acquired then %TRUE is returned. Otherwise,
24941 * %FALSE is returned and @error is set appropriately.
24943 * This call is blocking, likely for a very long time (in the case that
24944 * user interaction is required). See g_permission_acquire_async() for
24945 * the non-blocking version.
24947 * Returns: %TRUE if the permission was successfully acquired
24953 * g_permission_acquire_async:
24954 * @permission: a #GPermission instance
24955 * @cancellable: (allow-none): a #GCancellable, or %NULL
24956 * @callback: the #GAsyncReadyCallback to call when done
24957 * @user_data: the user data to pass to @callback
24959 * Attempts to acquire the permission represented by @permission.
24961 * This is the first half of the asynchronous version of
24962 * g_permission_acquire().
24969 * g_permission_acquire_finish:
24970 * @permission: a #GPermission instance
24971 * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24972 * @error: a pointer to a %NULL #GError, or %NULL
24974 * Collects the result of attempting to acquire the permission
24975 * represented by @permission.
24977 * This is the second half of the asynchronous version of
24978 * g_permission_acquire().
24980 * Returns: %TRUE if the permission was successfully acquired
24986 * g_permission_get_allowed:
24987 * @permission: a #GPermission instance
24989 * Gets the value of the 'allowed' property. This property is %TRUE if
24990 * the caller currently has permission to perform the action that
24991 * @permission represents the permission to perform.
24993 * Returns: the value of the 'allowed' property
24999 * g_permission_get_can_acquire:
25000 * @permission: a #GPermission instance
25002 * Gets the value of the 'can-acquire' property. This property is %TRUE
25003 * if it is generally possible to acquire the permission by calling
25004 * g_permission_acquire().
25006 * Returns: the value of the 'can-acquire' property
25012 * g_permission_get_can_release:
25013 * @permission: a #GPermission instance
25015 * Gets the value of the 'can-release' property. This property is %TRUE
25016 * if it is generally possible to release the permission by calling
25017 * g_permission_release().
25019 * Returns: the value of the 'can-release' property
25025 * g_permission_impl_update:
25026 * @permission: a #GPermission instance
25027 * @allowed: the new value for the 'allowed' property
25028 * @can_acquire: the new value for the 'can-acquire' property
25029 * @can_release: the new value for the 'can-release' property
25031 * This function is called by the #GPermission implementation to update
25032 * the properties of the permission. You should never call this
25033 * function except from a #GPermission implementation.
25035 * GObject notify signals are generated, as appropriate.
25042 * g_permission_release:
25043 * @permission: a #GPermission instance
25044 * @cancellable: (allow-none): a #GCancellable, or %NULL
25045 * @error: a pointer to a %NULL #GError, or %NULL
25047 * Attempts to release the permission represented by @permission.
25049 * The precise method by which this happens depends on the permission
25050 * and the underlying authentication mechanism. In most cases the
25051 * permission will be dropped immediately without further action.
25053 * You should check with g_permission_get_can_release() before calling
25056 * If the permission is released then %TRUE is returned. Otherwise,
25057 * %FALSE is returned and @error is set appropriately.
25059 * This call is blocking, likely for a very long time (in the case that
25060 * user interaction is required). See g_permission_release_async() for
25061 * the non-blocking version.
25063 * Returns: %TRUE if the permission was successfully released
25069 * g_permission_release_async:
25070 * @permission: a #GPermission instance
25071 * @cancellable: (allow-none): a #GCancellable, or %NULL
25072 * @callback: the #GAsyncReadyCallback to call when done
25073 * @user_data: the user data to pass to @callback
25075 * Attempts to release the permission represented by @permission.
25077 * This is the first half of the asynchronous version of
25078 * g_permission_release().
25085 * g_permission_release_finish:
25086 * @permission: a #GPermission instance
25087 * @result: the #GAsyncResult given to the #GAsyncReadyCallback
25088 * @error: a pointer to a %NULL #GError, or %NULL
25090 * Collects the result of attempting to release the permission
25091 * represented by @permission.
25093 * This is the second half of the asynchronous version of
25094 * g_permission_release().
25096 * Returns: %TRUE if the permission was successfully released
25102 * g_poll_file_monitor_new:
25105 * Polls @file for changes.
25107 * Returns: a new #GFileMonitor for the given #GFile.
25112 * g_pollable_input_stream_can_poll:
25113 * @stream: a #GPollableInputStream.
25115 * Checks if @stream is actually pollable. Some classes may implement
25116 * #GPollableInputStream but have only certain instances of that class
25117 * be pollable. If this method returns %FALSE, then the behavior of
25118 * other #GPollableInputStream methods is undefined.
25120 * For any given stream, the value returned by this method is constant;
25121 * a stream cannot switch from pollable to non-pollable or vice versa.
25123 * Returns: %TRUE if @stream is pollable, %FALSE if not.
25129 * g_pollable_input_stream_create_source:
25130 * @stream: a #GPollableInputStream.
25131 * @cancellable: (allow-none): a #GCancellable, or %NULL
25133 * Creates a #GSource that triggers when @stream can be read, or
25134 * @cancellable is triggered or an error occurs. The callback on the
25135 * source is of the #GPollableSourceFunc type.
25137 * As with g_pollable_input_stream_is_readable(), it is possible that
25138 * the stream may not actually be readable even after the source
25139 * triggers, so you should use g_pollable_input_stream_read_nonblocking()
25140 * rather than g_input_stream_read() from the callback.
25142 * Returns: (transfer full): a new #GSource
25148 * g_pollable_input_stream_is_readable:
25149 * @stream: a #GPollableInputStream.
25151 * Checks if @stream can be read.
25153 * Note that some stream types may not be able to implement this 100%
25154 * reliably, and it is possible that a call to g_input_stream_read()
25155 * after this returns %TRUE would still block. To guarantee
25156 * non-blocking behavior, you should always use
25157 * g_pollable_input_stream_read_nonblocking(), which will return a
25158 * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
25160 * 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.
25166 * g_pollable_input_stream_read_nonblocking:
25167 * @stream: a #GPollableInputStream
25168 * @buffer: a buffer to read data into (which should be at least @count bytes long).
25169 * @count: the number of bytes you want to read
25170 * @cancellable: (allow-none): a #GCancellable, or %NULL
25171 * @error: #GError for error reporting, or %NULL to ignore.
25173 * Attempts to read up to @count bytes from @stream into @buffer, as
25174 * with g_input_stream_read(). If @stream is not currently readable,
25175 * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
25176 * use g_pollable_input_stream_create_source() to create a #GSource
25177 * that will be triggered when @stream is readable.
25179 * Note that since this method never blocks, you cannot actually
25180 * use @cancellable to cancel it. However, it will return an error
25181 * if @cancellable has already been cancelled when you call, which
25182 * may happen if you call this method after a source triggers due
25183 * to having been cancelled.
25185 * Virtual: read_nonblocking
25186 * Returns: the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
25191 * g_pollable_output_stream_can_poll:
25192 * @stream: a #GPollableOutputStream.
25194 * Checks if @stream is actually pollable. Some classes may implement
25195 * #GPollableOutputStream but have only certain instances of that
25196 * class be pollable. If this method returns %FALSE, then the behavior
25197 * of other #GPollableOutputStream methods is undefined.
25199 * For any given stream, the value returned by this method is constant;
25200 * a stream cannot switch from pollable to non-pollable or vice versa.
25202 * Returns: %TRUE if @stream is pollable, %FALSE if not.
25208 * g_pollable_output_stream_create_source:
25209 * @stream: a #GPollableOutputStream.
25210 * @cancellable: (allow-none): a #GCancellable, or %NULL
25212 * Creates a #GSource that triggers when @stream can be written, or
25213 * @cancellable is triggered or an error occurs. The callback on the
25214 * source is of the #GPollableSourceFunc type.
25216 * As with g_pollable_output_stream_is_writable(), it is possible that
25217 * the stream may not actually be writable even after the source
25218 * triggers, so you should use g_pollable_output_stream_write_nonblocking()
25219 * rather than g_output_stream_write() from the callback.
25221 * Returns: (transfer full): a new #GSource
25227 * g_pollable_output_stream_is_writable:
25228 * @stream: a #GPollableOutputStream.
25230 * Checks if @stream can be written.
25232 * Note that some stream types may not be able to implement this 100%
25233 * reliably, and it is possible that a call to g_output_stream_write()
25234 * after this returns %TRUE would still block. To guarantee
25235 * non-blocking behavior, you should always use
25236 * g_pollable_output_stream_write_nonblocking(), which will return a
25237 * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
25239 * 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.
25245 * g_pollable_output_stream_write_nonblocking:
25246 * @stream: a #GPollableOutputStream
25247 * @buffer: (array length=count) (element-type guint8): a buffer to write data from
25248 * @count: the number of bytes you want to write
25249 * @cancellable: (allow-none): a #GCancellable, or %NULL
25250 * @error: #GError for error reporting, or %NULL to ignore.
25252 * Attempts to write up to @count bytes from @buffer to @stream, as
25253 * with g_output_stream_write(). If @stream is not currently writable,
25254 * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
25255 * use g_pollable_output_stream_create_source() to create a #GSource
25256 * that will be triggered when @stream is writable.
25258 * Note that since this method never blocks, you cannot actually
25259 * use @cancellable to cancel it. However, it will return an error
25260 * if @cancellable has already been cancelled when you call, which
25261 * may happen if you call this method after a source triggers due
25262 * to having been cancelled.
25264 * Virtual: write_nonblocking
25265 * Returns: the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
25270 * g_pollable_source_new:
25271 * @pollable_stream: the stream associated with the new source
25273 * Utility method for #GPollableInputStream and #GPollableOutputStream
25274 * implementations. Creates a new #GSource that expects a callback of
25275 * type #GPollableSourceFunc. The new source does not actually do
25276 * anything on its own; use g_source_add_child_source() to add other
25277 * sources to it to cause it to trigger.
25279 * Returns: (transfer full): the new #GSource.
25285 * g_pollable_source_new_full:
25286 * @pollable_stream: (type GObject): the stream associated with the new source
25287 * @child_source: (allow-none): optional child source to attach
25288 * @cancellable: (allow-none): optional #GCancellable to attach
25290 * Utility method for #GPollableInputStream and #GPollableOutputStream
25291 * implementations. Creates a new #GSource, as with
25292 * g_pollable_source_new(), but also attaching @child_source (with a
25293 * dummy callback), and @cancellable, if they are non-%NULL.
25295 * Returns: (transfer full): the new #GSource.
25301 * g_pollable_stream_read:
25302 * @stream: a #GInputStream
25303 * @buffer: a buffer to read data into
25304 * @count: the number of bytes to read
25305 * @blocking: whether to do blocking I/O
25306 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25307 * @error: location to store the error occurring, or %NULL to ignore
25309 * Tries to read from @stream, as with g_input_stream_read() (if
25310 * @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
25311 * (if @blocking is %FALSE). This can be used to more easily share
25312 * code between blocking and non-blocking implementations of a method.
25314 * If @blocking is %FALSE, then @stream must be a
25315 * #GPollableInputStream for which g_pollable_input_stream_can_poll()
25316 * returns %TRUE, or else the behavior is undefined. If @blocking is
25317 * %TRUE, then @stream does not need to be a #GPollableInputStream.
25319 * Returns: the number of bytes read, or -1 on error.
25325 * g_pollable_stream_write:
25326 * @stream: a #GOutputStream.
25327 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25328 * @count: the number of bytes to write
25329 * @blocking: whether to do blocking I/O
25330 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25331 * @error: location to store the error occurring, or %NULL to ignore
25333 * Tries to write to @stream, as with g_output_stream_write() (if
25334 * @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
25335 * (if @blocking is %FALSE). This can be used to more easily share
25336 * code between blocking and non-blocking implementations of a method.
25338 * If @blocking is %FALSE, then @stream must be a
25339 * #GPollableOutputStream for which
25340 * g_pollable_output_stream_can_poll() returns %TRUE or else the
25341 * behavior is undefined. If @blocking is %TRUE, then @stream does not
25342 * need to be a #GPollableOutputStream.
25344 * Returns: the number of bytes written, or -1 on error.
25350 * g_pollable_stream_write_all:
25351 * @stream: a #GOutputStream.
25352 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25353 * @count: the number of bytes to write
25354 * @blocking: whether to do blocking I/O
25355 * @bytes_written: (out): location to store the number of bytes that was written to the stream
25356 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25357 * @error: location to store the error occurring, or %NULL to ignore
25359 * Tries to write @count bytes to @stream, as with
25360 * g_output_stream_write_all(), but using g_pollable_stream_write()
25361 * rather than g_output_stream_write().
25363 * On a successful write of @count bytes, %TRUE is returned, and
25364 * @bytes_written is set to @count.
25366 * If there is an error during the operation (including
25367 * %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is
25368 * returned and @error is set to indicate the error status,
25369 * @bytes_written is updated to contain the number of bytes written
25370 * into the stream before the error occurred.
25372 * As with g_pollable_stream_write(), if @blocking is %FALSE, then
25373 * @stream must be a #GPollableOutputStream for which
25374 * g_pollable_output_stream_can_poll() returns %TRUE or else the
25375 * behavior is undefined. If @blocking is %TRUE, then @stream does not
25376 * need to be a #GPollableOutputStream.
25378 * Returns: %TRUE on success, %FALSE if there was an error
25384 * g_property_action_new:
25385 * @name: the name of the action to create
25386 * @object: the object that has the property to wrap
25387 * @property_name: the name of the property
25389 * Creates a #GAction corresponding to the value of property
25390 * @property_name on @object.
25392 * The property must be existent and readable and writable (and not
25395 * This function takes a reference on @object and doesn't release it
25396 * until the action is destroyed.
25398 * Returns: a new #GPropertyAction
25404 * g_proxy_address_get_destination_hostname:
25405 * @proxy: a #GProxyAddress
25407 * Gets @proxy's destination hostname; that is, the name of the host
25408 * that will be connected to via the proxy, not the name of the proxy
25411 * Returns: the @proxy's destination hostname
25417 * g_proxy_address_get_destination_port:
25418 * @proxy: a #GProxyAddress
25420 * Gets @proxy's destination port; that is, the port on the
25421 * destination host that will be connected to via the proxy, not the
25422 * port number of the proxy itself.
25424 * Returns: the @proxy's destination port
25430 * g_proxy_address_get_destination_protocol:
25431 * @proxy: a #GProxyAddress
25433 * Gets the protocol that is being spoken to the destination
25434 * server; eg, "http" or "ftp".
25436 * Returns: the @proxy's destination protocol
25442 * g_proxy_address_get_password:
25443 * @proxy: a #GProxyAddress
25445 * Gets @proxy's password.
25447 * Returns: the @proxy's password
25453 * g_proxy_address_get_protocol:
25454 * @proxy: a #GProxyAddress
25456 * Gets @proxy's protocol. eg, "socks" or "http"
25458 * Returns: the @proxy's protocol
25464 * g_proxy_address_get_uri:
25465 * @proxy: a #GProxyAddress
25467 * Gets the proxy URI that @proxy was constructed from.
25469 * Returns: the @proxy's URI, or %NULL if unknown
25475 * g_proxy_address_get_username:
25476 * @proxy: a #GProxyAddress
25478 * Gets @proxy's username.
25480 * Returns: the @proxy's username
25486 * g_proxy_address_new:
25487 * @inetaddr: The proxy server #GInetAddress.
25488 * @port: The proxy server port.
25489 * @protocol: The proxy protocol to support, in lower case (e.g. socks, http).
25490 * @dest_hostname: The destination hostname the proxy should tunnel to.
25491 * @dest_port: The destination port to tunnel to.
25492 * @username: (allow-none): The username to authenticate to the proxy server (or %NULL).
25493 * @password: (allow-none): The password to authenticate to the proxy server (or %NULL).
25495 * Creates a new #GProxyAddress for @inetaddr with @protocol that should
25496 * tunnel through @dest_hostname and @dest_port.
25498 * (Note that this method doesn't set the #GProxyAddress:uri or
25499 * #GProxyAddress:destination-protocol fields; use g_object_new()
25500 * directly if you want to set those.)
25502 * Returns: a new #GProxyAddress
25509 * @proxy: a #GProxy
25510 * @connection: a #GIOStream
25511 * @proxy_address: a #GProxyAddress
25512 * @cancellable: (allow-none): a #GCancellable
25513 * @error: return #GError
25515 * Given @connection to communicate with a proxy (eg, a
25516 * #GSocketConnection that is connected to the proxy server), this
25517 * does the necessary handshake to connect to @proxy_address, and if
25518 * required, wraps the #GIOStream to handle proxy payload.
25520 * Returns: (transfer full): a #GIOStream that will replace @connection. This might be the same as @connection, in which case a reference will be added.
25526 * g_proxy_connect_async:
25527 * @proxy: a #GProxy
25528 * @connection: a #GIOStream
25529 * @proxy_address: a #GProxyAddress
25530 * @cancellable: (allow-none): a #GCancellable
25531 * @callback: (scope async): a #GAsyncReadyCallback
25532 * @user_data: (closure): callback data
25534 * Asynchronous version of g_proxy_connect().
25541 * g_proxy_connect_finish:
25542 * @proxy: a #GProxy
25543 * @result: a #GAsyncResult
25544 * @error: return #GError
25546 * See g_proxy_connect().
25548 * Returns: (transfer full): a #GIOStream.
25554 * g_proxy_get_default_for_protocol:
25555 * @protocol: the proxy protocol name (e.g. http, socks, etc)
25557 * Lookup "gio-proxy" extension point for a proxy implementation that supports
25558 * specified protocol.
25560 * Returns: (transfer full): return a #GProxy or NULL if protocol is not supported.
25566 * g_proxy_resolver_get_default:
25568 * Gets the default #GProxyResolver for the system.
25570 * Returns: (transfer none): the default #GProxyResolver.
25576 * g_proxy_resolver_is_supported:
25577 * @resolver: a #GProxyResolver
25579 * Checks if @resolver can be used on this system. (This is used
25580 * internally; g_proxy_resolver_get_default() will only return a proxy
25581 * resolver that returns %TRUE for this method.)
25583 * Returns: %TRUE if @resolver is supported.
25589 * g_proxy_resolver_lookup:
25590 * @resolver: a #GProxyResolver
25591 * @uri: a URI representing the destination to connect to
25592 * @cancellable: (allow-none): a #GCancellable, or %NULL
25593 * @error: return location for a #GError, or %NULL
25595 * Looks into the system proxy configuration to determine what proxy,
25596 * if any, to use to connect to @uri. The returned proxy URIs are of the
25597 * form <literal><protocol>://[user[:password]@]host:port</literal>
25598 * or <literal>direct://</literal>, where <protocol> could be
25599 * http, rtsp, socks or other proxying protocol.
25601 * If you don't know what network protocol is being used on the
25602 * socket, you should use <literal>none</literal> as the URI protocol.
25603 * In this case, the resolver might still return a generic proxy type
25604 * (such as SOCKS), but would not return protocol-specific proxy types
25607 * <literal>direct://</literal> is used when no proxy is needed.
25608 * Direct connection should not be attempted unless it is part of the
25609 * returned array of proxies.
25611 * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25617 * g_proxy_resolver_lookup_async:
25618 * @resolver: a #GProxyResolver
25619 * @uri: a URI representing the destination to connect to
25620 * @cancellable: (allow-none): a #GCancellable, or %NULL
25621 * @callback: (scope async): callback to call after resolution completes
25622 * @user_data: (closure): data for @callback
25624 * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
25632 * g_proxy_resolver_lookup_finish:
25633 * @resolver: a #GProxyResolver
25634 * @result: the result passed to your #GAsyncReadyCallback
25635 * @error: return location for a #GError, or %NULL
25637 * Call this function to obtain the array of proxy URIs when
25638 * g_proxy_resolver_lookup_async() is complete. See
25639 * g_proxy_resolver_lookup() for more details.
25641 * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25647 * g_proxy_supports_hostname:
25648 * @proxy: a #GProxy
25650 * Some proxy protocols expect to be passed a hostname, which they
25651 * will resolve to an IP address themselves. Others, like SOCKS4, do
25652 * not allow this. This function will return %FALSE if @proxy is
25653 * implementing such a protocol. When %FALSE is returned, the caller
25654 * should resolve the destination hostname first, and then pass a
25655 * #GProxyAddress containing the stringified IP address to
25656 * g_proxy_connect() or g_proxy_connect_async().
25658 * Returns: %TRUE if hostname resolution is supported.
25664 * g_remote_action_group_activate_action_full:
25665 * @remote: a #GDBusActionGroup
25666 * @action_name: the name of the action to activate
25667 * @parameter: (allow-none): the optional parameter to the activation
25668 * @platform_data: the platform data to send
25670 * Activates the remote action.
25672 * This is the same as g_action_group_activate_action() except that it
25673 * allows for provision of "platform data" to be sent along with the
25674 * activation request. This typically contains details such as the user
25675 * interaction timestamp or startup notification information.
25677 * @platform_data must be non-%NULL and must have the type
25678 * %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
25685 * g_remote_action_group_change_action_state_full:
25686 * @remote: a #GRemoteActionGroup
25687 * @action_name: the name of the action to change the state of
25688 * @value: the new requested value for the state
25689 * @platform_data: the platform data to send
25691 * Changes the state of a remote action.
25693 * This is the same as g_action_group_change_action_state() except that
25694 * it allows for provision of "platform data" to be sent along with the
25695 * state change request. This typically contains details such as the
25696 * user interaction timestamp or startup notification information.
25698 * @platform_data must be non-%NULL and must have the type
25699 * %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
25706 * g_resolver_error_quark:
25708 * Gets the #GResolver Error Quark.
25710 * Returns: a #GQuark.
25716 * g_resolver_free_addresses: (skip)
25717 * @addresses: a #GList of #GInetAddress
25719 * Frees @addresses (which should be the return value from
25720 * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
25721 * (This is a convenience method; you can also simply free the results
25729 * g_resolver_free_targets: (skip)
25730 * @targets: a #GList of #GSrvTarget
25732 * Frees @targets (which should be the return value from
25733 * g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
25734 * (This is a convenience method; you can also simply free the
25735 * results by hand.)
25742 * g_resolver_get_default:
25744 * Gets the default #GResolver. You should unref it when you are done
25745 * with it. #GResolver may use its reference count as a hint about how
25746 * many threads it should allocate for concurrent DNS resolutions.
25748 * Returns: (transfer full): the default #GResolver.
25754 * g_resolver_lookup_by_address:
25755 * @resolver: a #GResolver
25756 * @address: the address to reverse-resolve
25757 * @cancellable: (allow-none): a #GCancellable, or %NULL
25758 * @error: return location for a #GError, or %NULL
25760 * Synchronously reverse-resolves @address to determine its
25761 * associated hostname.
25763 * If the DNS resolution fails, @error (if non-%NULL) will be set to
25764 * a value from #GResolverError.
25766 * If @cancellable is non-%NULL, it can be used to cancel the
25767 * operation, in which case @error (if non-%NULL) will be set to
25768 * %G_IO_ERROR_CANCELLED.
25770 * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25776 * g_resolver_lookup_by_address_async:
25777 * @resolver: a #GResolver
25778 * @address: the address to reverse-resolve
25779 * @cancellable: (allow-none): a #GCancellable, or %NULL
25780 * @callback: (scope async): callback to call after resolution completes
25781 * @user_data: (closure): data for @callback
25783 * Begins asynchronously reverse-resolving @address to determine its
25784 * associated hostname, and eventually calls @callback, which must
25785 * call g_resolver_lookup_by_address_finish() to get the final result.
25792 * g_resolver_lookup_by_address_finish:
25793 * @resolver: a #GResolver
25794 * @result: the result passed to your #GAsyncReadyCallback
25795 * @error: return location for a #GError, or %NULL
25797 * Retrieves the result of a previous call to
25798 * g_resolver_lookup_by_address_async().
25800 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25801 * a value from #GResolverError. If the operation was cancelled,
25802 * @error will be set to %G_IO_ERROR_CANCELLED.
25804 * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25810 * g_resolver_lookup_by_name:
25811 * @resolver: a #GResolver
25812 * @hostname: the hostname to look up
25813 * @cancellable: (allow-none): a #GCancellable, or %NULL
25814 * @error: return location for a #GError, or %NULL
25816 * Synchronously resolves @hostname to determine its associated IP
25817 * address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
25818 * the textual form of an IP address (in which case this just becomes
25819 * a wrapper around g_inet_address_new_from_string()).
25821 * On success, g_resolver_lookup_by_name() will return a #GList of
25822 * #GInetAddress, sorted in order of preference and guaranteed to not
25823 * contain duplicates. That is, if using the result to connect to
25824 * @hostname, you should attempt to connect to the first address
25825 * first, then the second if the first fails, etc. If you are using
25826 * the result to listen on a socket, it is appropriate to add each
25827 * result using e.g. g_socket_listener_add_address().
25829 * If the DNS resolution fails, @error (if non-%NULL) will be set to a
25830 * value from #GResolverError.
25832 * If @cancellable is non-%NULL, it can be used to cancel the
25833 * operation, in which case @error (if non-%NULL) will be set to
25834 * %G_IO_ERROR_CANCELLED.
25836 * If you are planning to connect to a socket on the resolved IP
25837 * address, it may be easier to create a #GNetworkAddress and use its
25838 * #GSocketConnectable interface.
25840 * 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.)
25846 * g_resolver_lookup_by_name_async:
25847 * @resolver: a #GResolver
25848 * @hostname: the hostname to look up the address of
25849 * @cancellable: (allow-none): a #GCancellable, or %NULL
25850 * @callback: (scope async): callback to call after resolution completes
25851 * @user_data: (closure): data for @callback
25853 * Begins asynchronously resolving @hostname to determine its
25854 * associated IP address(es), and eventually calls @callback, which
25855 * must call g_resolver_lookup_by_name_finish() to get the result.
25856 * See g_resolver_lookup_by_name() for more details.
25863 * g_resolver_lookup_by_name_finish:
25864 * @resolver: a #GResolver
25865 * @result: the result passed to your #GAsyncReadyCallback
25866 * @error: return location for a #GError, or %NULL
25868 * Retrieves the result of a call to
25869 * g_resolver_lookup_by_name_async().
25871 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25872 * a value from #GResolverError. If the operation was cancelled,
25873 * @error will be set to %G_IO_ERROR_CANCELLED.
25875 * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name() for more details.
25881 * g_resolver_lookup_records:
25882 * @resolver: a #GResolver
25883 * @rrname: the DNS name to lookup the record for
25884 * @record_type: the type of DNS record to lookup
25885 * @cancellable: (allow-none): a #GCancellable, or %NULL
25886 * @error: return location for a #GError, or %NULL
25888 * Synchronously performs a DNS record lookup for the given @rrname and returns
25889 * a list of records as #GVariant tuples. See #GResolverRecordType for
25890 * information on what the records contain for each @record_type.
25892 * If the DNS resolution fails, @error (if non-%NULL) will be set to
25893 * a value from #GResolverError.
25895 * If @cancellable is non-%NULL, it can be used to cancel the
25896 * operation, in which case @error (if non-%NULL) will be set to
25897 * %G_IO_ERROR_CANCELLED.
25899 * 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.)
25905 * g_resolver_lookup_records_async:
25906 * @resolver: a #GResolver
25907 * @rrname: the DNS name to lookup the record for
25908 * @record_type: the type of DNS record to lookup
25909 * @cancellable: (allow-none): a #GCancellable, or %NULL
25910 * @callback: (scope async): callback to call after resolution completes
25911 * @user_data: (closure): data for @callback
25913 * Begins asynchronously performing a DNS lookup for the given
25914 * @rrname, and eventually calls @callback, which must call
25915 * g_resolver_lookup_records_finish() to get the final result. See
25916 * g_resolver_lookup_records() for more details.
25923 * g_resolver_lookup_records_finish:
25924 * @resolver: a #GResolver
25925 * @result: the result passed to your #GAsyncReadyCallback
25926 * @error: return location for a #GError, or %NULL
25928 * Retrieves the result of a previous call to
25929 * g_resolver_lookup_records_async(). Returns a list of records as #GVariant
25930 * tuples. See #GResolverRecordType for information on what the records contain.
25932 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25933 * a value from #GResolverError. If the operation was cancelled,
25934 * @error will be set to %G_IO_ERROR_CANCELLED.
25936 * 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.)
25942 * g_resolver_lookup_service:
25943 * @resolver: a #GResolver
25944 * @service: the service type to look up (eg, "ldap")
25945 * @protocol: the networking protocol to use for @service (eg, "tcp")
25946 * @domain: the DNS domain to look up the service in
25947 * @cancellable: (allow-none): a #GCancellable, or %NULL
25948 * @error: return location for a #GError, or %NULL
25950 * Synchronously performs a DNS SRV lookup for the given @service and
25951 * @protocol in the given @domain and returns an array of #GSrvTarget.
25952 * @domain may be an ASCII-only or UTF-8 hostname. Note also that the
25953 * @service and @protocol arguments <emphasis>do not</emphasis>
25954 * include the leading underscore that appears in the actual DNS
25957 * On success, g_resolver_lookup_service() will return a #GList of
25958 * #GSrvTarget, sorted in order of preference. (That is, you should
25959 * attempt to connect to the first target first, then the second if
25960 * the first fails, etc.)
25962 * If the DNS resolution fails, @error (if non-%NULL) will be set to
25963 * a value from #GResolverError.
25965 * If @cancellable is non-%NULL, it can be used to cancel the
25966 * operation, in which case @error (if non-%NULL) will be set to
25967 * %G_IO_ERROR_CANCELLED.
25969 * If you are planning to connect to the service, it is usually easier
25970 * to create a #GNetworkService and use its #GSocketConnectable
25973 * 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.)
25979 * g_resolver_lookup_service_async:
25980 * @resolver: a #GResolver
25981 * @service: the service type to look up (eg, "ldap")
25982 * @protocol: the networking protocol to use for @service (eg, "tcp")
25983 * @domain: the DNS domain to look up the service in
25984 * @cancellable: (allow-none): a #GCancellable, or %NULL
25985 * @callback: (scope async): callback to call after resolution completes
25986 * @user_data: (closure): data for @callback
25988 * Begins asynchronously performing a DNS SRV lookup for the given
25989 * @service and @protocol in the given @domain, and eventually calls
25990 * @callback, which must call g_resolver_lookup_service_finish() to
25991 * get the final result. See g_resolver_lookup_service() for more
25999 * g_resolver_lookup_service_finish:
26000 * @resolver: a #GResolver
26001 * @result: the result passed to your #GAsyncReadyCallback
26002 * @error: return location for a #GError, or %NULL
26004 * Retrieves the result of a previous call to
26005 * g_resolver_lookup_service_async().
26007 * If the DNS resolution failed, @error (if non-%NULL) will be set to
26008 * a value from #GResolverError. If the operation was cancelled,
26009 * @error will be set to %G_IO_ERROR_CANCELLED.
26011 * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. See g_resolver_lookup_service() for more details.
26017 * g_resolver_set_default:
26018 * @resolver: the new default #GResolver
26020 * Sets @resolver to be the application's default resolver (reffing
26021 * @resolver, and unreffing the previous default resolver, if any).
26022 * Future calls to g_resolver_get_default() will return this resolver.
26024 * This can be used if an application wants to perform any sort of DNS
26025 * caching or "pinning"; it can implement its own #GResolver that
26026 * calls the original default resolver for DNS operations, and
26027 * implements its own cache policies on top of that, and then set
26028 * itself as the default resolver for all later code to use.
26035 * g_resource_enumerate_children:
26036 * @resource: A #GResource
26037 * @path: A pathname inside the resource
26038 * @lookup_flags: A #GResourceLookupFlags
26039 * @error: return location for a #GError, or %NULL
26041 * Returns all the names of children at the specified @path in the resource.
26042 * The return result is a %NULL terminated list of strings which should
26043 * be released with g_strfreev().
26045 * @lookup_flags controls the behaviour of the lookup.
26047 * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
26053 * g_resource_error_quark:
26055 * Gets the #GResource Error Quark.
26057 * Returns: a #GQuark
26063 * g_resource_get_info:
26064 * @resource: A #GResource
26065 * @path: A pathname inside the resource
26066 * @lookup_flags: A #GResourceLookupFlags
26067 * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
26068 * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
26069 * @error: return location for a #GError, or %NULL
26071 * Looks for a file at the specified @path in the resource and
26072 * if found returns information about it.
26074 * @lookup_flags controls the behaviour of the lookup.
26076 * Returns: %TRUE if the file was found. %FALSE if there were errors
26083 * @filename: (type filename): the path of a filename to load, in the GLib filename encoding
26084 * @error: return location for a #GError, or %NULL
26086 * Loads a binary resource bundle and creates a #GResource representation of it, allowing
26087 * you to query it for data.
26089 * If you want to use this resource in the global resource namespace you need
26090 * to register it with g_resources_register().
26092 * Returns: (transfer full): a new #GResource, or %NULL on error
26098 * g_resource_lookup_data:
26099 * @resource: A #GResource
26100 * @path: A pathname inside the resource
26101 * @lookup_flags: A #GResourceLookupFlags
26102 * @error: return location for a #GError, or %NULL
26104 * Looks for a file at the specified @path in the resource and
26105 * returns a #GBytes that lets you directly access the data in
26108 * The data is always followed by a zero byte, so you
26109 * can safely use the data as a C string. However, that byte
26110 * is not included in the size of the GBytes.
26112 * For uncompressed resource files this is a pointer directly into
26113 * the resource bundle, which is typically in some readonly data section
26114 * in the program binary. For compressed files we allocate memory on
26115 * the heap and automatically uncompress the data.
26117 * @lookup_flags controls the behaviour of the lookup.
26119 * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
26125 * g_resource_new_from_data:
26127 * @error: return location for a #GError, or %NULL
26129 * Creates a GResource from a reference to the binary resource bundle.
26130 * This will keep a reference to @data while the resource lives, so
26131 * the data should not be modified or freed.
26133 * If you want to use this resource in the global resource namespace you need
26134 * to register it with g_resources_register().
26136 * Returns: (transfer full): a new #GResource, or %NULL on error
26142 * g_resource_open_stream:
26143 * @resource: A #GResource
26144 * @path: A pathname inside the resource
26145 * @lookup_flags: A #GResourceLookupFlags
26146 * @error: return location for a #GError, or %NULL
26148 * Looks for a file at the specified @path in the resource and
26149 * returns a #GInputStream that lets you read the data.
26151 * @lookup_flags controls the behaviour of the lookup.
26153 * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
26160 * @resource: A #GResource
26162 * Atomically increments the reference count of @array by one. This
26163 * function is MT-safe and may be called from any thread.
26165 * Returns: The passed in #GResource
26171 * g_resource_unref:
26172 * @resource: A #GResource
26174 * Atomically decrements the reference count of @resource by one. If the
26175 * reference count drops to 0, all memory allocated by the array is
26176 * released. This function is MT-safe and may be called from any
26184 * g_resources_enumerate_children:
26185 * @path: A pathname inside the resource
26186 * @lookup_flags: A #GResourceLookupFlags
26187 * @error: return location for a #GError, or %NULL
26189 * Returns all the names of children at the specified @path in the set of
26190 * globally registered resources.
26191 * The return result is a %NULL terminated list of strings which should
26192 * be released with g_strfreev().
26194 * @lookup_flags controls the behaviour of the lookup.
26196 * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
26202 * g_resources_get_info:
26203 * @path: A pathname inside the resource
26204 * @lookup_flags: A #GResourceLookupFlags
26205 * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
26206 * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
26207 * @error: return location for a #GError, or %NULL
26209 * Looks for a file at the specified @path in the set of
26210 * globally registered resources and if found returns information about it.
26212 * @lookup_flags controls the behaviour of the lookup.
26214 * Returns: %TRUE if the file was found. %FALSE if there were errors
26220 * g_resources_lookup_data:
26221 * @path: A pathname inside the resource
26222 * @lookup_flags: A #GResourceLookupFlags
26223 * @error: return location for a #GError, or %NULL
26225 * Looks for a file at the specified @path in the set of
26226 * globally registered resources and returns a #GBytes that
26227 * lets you directly access the data in memory.
26229 * The data is always followed by a zero byte, so you
26230 * can safely use the data as a C string. However, that byte
26231 * is not included in the size of the GBytes.
26233 * For uncompressed resource files this is a pointer directly into
26234 * the resource bundle, which is typically in some readonly data section
26235 * in the program binary. For compressed files we allocate memory on
26236 * the heap and automatically uncompress the data.
26238 * @lookup_flags controls the behaviour of the lookup.
26240 * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
26246 * g_resources_open_stream:
26247 * @path: A pathname inside the resource
26248 * @lookup_flags: A #GResourceLookupFlags
26249 * @error: return location for a #GError, or %NULL
26251 * Looks for a file at the specified @path in the set of
26252 * globally registered resources and returns a #GInputStream
26253 * that lets you read the data.
26255 * @lookup_flags controls the behaviour of the lookup.
26257 * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
26263 * g_resources_register:
26264 * @resource: A #GResource
26266 * Registers the resource with the process-global set of resources.
26267 * Once a resource is registered the files in it can be accessed
26268 * with the global resource lookup functions like g_resources_lookup_data().
26275 * g_resources_unregister:
26276 * @resource: A #GResource
26278 * Unregisters the resource from the process-global set of resources.
26285 * g_seekable_can_seek:
26286 * @seekable: a #GSeekable.
26288 * Tests if the stream supports the #GSeekableIface.
26290 * Returns: %TRUE if @seekable can be seeked. %FALSE otherwise.
26295 * g_seekable_can_truncate:
26296 * @seekable: a #GSeekable.
26298 * Tests if the stream can be truncated.
26300 * Returns: %TRUE if the stream can be truncated, %FALSE otherwise.
26306 * @seekable: a #GSeekable.
26307 * @offset: a #goffset.
26308 * @type: a #GSeekType.
26309 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26310 * @error: a #GError location to store the error occurring, or %NULL to ignore.
26312 * Seeks in the stream by the given @offset, modified by @type.
26314 * If @cancellable is not %NULL, then the operation can be cancelled by
26315 * triggering the cancellable object from another thread. If the operation
26316 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
26318 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26324 * @seekable: a #GSeekable.
26326 * Tells the current position within the stream.
26328 * Returns: the offset from the beginning of the buffer.
26333 * g_seekable_truncate:
26334 * @seekable: a #GSeekable.
26335 * @offset: a #goffset.
26336 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26337 * @error: a #GError location to store the error occurring, or %NULL to ignore.
26339 * Truncates a stream with a given #offset.
26341 * If @cancellable is not %NULL, then the operation can be cancelled by
26342 * triggering the cancellable object from another thread. If the operation
26343 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
26344 * operation was partially finished when the operation was cancelled the
26345 * partial result will be returned, without an error.
26347 * Virtual: truncate_fn
26348 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26353 * g_settings_apply:
26354 * @settings: a #GSettings instance
26356 * Applies any changes that have been made to the settings. This
26357 * function does nothing unless @settings is in 'delay-apply' mode;
26358 * see g_settings_delay(). In the normal case settings are always
26359 * applied immediately.
26364 * g_settings_backend_changed:
26365 * @backend: a #GSettingsBackend implementation
26366 * @key: the name of the key
26367 * @origin_tag: the origin tag
26369 * Signals that a single key has possibly changed. Backend
26370 * implementations should call this if a key has possibly changed its
26373 * @key must be a valid key (ie starting with a slash, not containing
26374 * '//', and not ending with a slash).
26376 * The implementation must call this function during any call to
26377 * g_settings_backend_write(), before the call returns (except in the
26378 * case that no keys are actually changed and it cares to detect this
26379 * fact). It may not rely on the existence of a mainloop for
26380 * dispatching the signal later.
26382 * The implementation may call this function at any other time it likes
26383 * in response to other events (such as changes occurring outside of the
26384 * program). These calls may originate from a mainloop or may originate
26385 * in response to any other action (including from calls to
26386 * g_settings_backend_write()).
26388 * In the case that this call is in response to a call to
26389 * g_settings_backend_write() then @origin_tag must be set to the same
26390 * value that was passed to that call.
26397 * g_settings_backend_changed_tree:
26398 * @backend: a #GSettingsBackend implementation
26399 * @tree: a #GTree containing the changes
26400 * @origin_tag: the origin tag
26402 * This call is a convenience wrapper. It gets the list of changes from
26403 * @tree, computes the longest common prefix and calls
26404 * g_settings_backend_changed().
26411 * g_settings_backend_flatten_tree:
26412 * @tree: a #GTree containing the changes
26413 * @path: (out): the location to save the path
26414 * @keys: (out) (transfer container) (array zero-terminated=1): the location to save the relative keys
26415 * @values: (out) (allow-none) (transfer container) (array zero-terminated=1): the location to save the values, or %NULL
26417 * Calculate the longest common prefix of all keys in a tree and write
26418 * out an array of the key names relative to that prefix and,
26419 * optionally, the value to store at each of those keys.
26421 * You must free the value returned in @path, @keys and @values using
26422 * g_free(). You should not attempt to free or unref the contents of
26423 * @keys or @values.
26430 * g_settings_backend_get_default:
26432 * Returns the default #GSettingsBackend. It is possible to override
26433 * the default by setting the <envar>GSETTINGS_BACKEND</envar>
26434 * environment variable to the name of a settings backend.
26436 * The user gets a reference to the backend.
26438 * Returns: (transfer full): the default #GSettingsBackend
26444 * g_settings_backend_keys_changed:
26445 * @backend: a #GSettingsBackend implementation
26446 * @path: the path containing the changes
26447 * @items: (array zero-terminated=1): the %NULL-terminated list of changed keys
26448 * @origin_tag: the origin tag
26450 * Signals that a list of keys have possibly changed. Backend
26451 * implementations should call this if keys have possibly changed their
26454 * @path must be a valid path (ie starting and ending with a slash and
26455 * not containing '//'). Each string in @items must form a valid key
26456 * name when @path is prefixed to it (ie: each item must not start or
26457 * end with '/' and must not contain '//').
26459 * The meaning of this signal is that any of the key names resulting
26460 * from the contatenation of @path with each item in @items may have
26463 * The same rules for when notifications must occur apply as per
26464 * g_settings_backend_changed(). These two calls can be used
26465 * interchangeably if exactly one item has changed (although in that
26466 * case g_settings_backend_changed() is definitely preferred).
26468 * For efficiency reasons, the implementation should strive for @path to
26469 * be as long as possible (ie: the longest common prefix of all of the
26470 * keys that were changed) but this is not strictly required.
26477 * g_settings_backend_path_changed:
26478 * @backend: a #GSettingsBackend implementation
26479 * @path: the path containing the changes
26480 * @origin_tag: the origin tag
26482 * Signals that all keys below a given path may have possibly changed.
26483 * Backend implementations should call this if an entire path of keys
26484 * have possibly changed their values.
26486 * @path must be a valid path (ie starting and ending with a slash and
26487 * not containing '//').
26489 * The meaning of this signal is that any of the key which has a name
26490 * starting with @path may have changed.
26492 * The same rules for when notifications must occur apply as per
26493 * g_settings_backend_changed(). This call might be an appropriate
26494 * reasponse to a 'reset' call but implementations are also free to
26495 * explicitly list the keys that were affected by that call if they can
26498 * For efficiency reasons, the implementation should strive for @path to
26499 * be as long as possible (ie: the longest common prefix of all of the
26500 * keys that were changed) but this is not strictly required. As an
26501 * example, if this function is called with the path of "/" then every
26502 * single key in the application will be notified of a possible change.
26509 * g_settings_backend_path_writable_changed:
26510 * @backend: a #GSettingsBackend implementation
26511 * @path: the name of the path
26513 * Signals that the writability of all keys below a given path may have
26516 * Since GSettings performs no locking operations for itself, this call
26517 * will always be made in response to external events.
26524 * g_settings_backend_writable_changed:
26525 * @backend: a #GSettingsBackend implementation
26526 * @key: the name of the key
26528 * Signals that the writability of a single key has possibly changed.
26530 * Since GSettings performs no locking operations for itself, this call
26531 * will always be made in response to external events.
26539 * @settings: a #GSettings object
26540 * @key: the key to bind
26541 * @object: (type GObject.Object): a #GObject
26542 * @property: the name of the property to bind
26543 * @flags: flags for the binding
26545 * Create a binding between the @key in the @settings object
26546 * and the property @property of @object.
26548 * The binding uses the default GIO mapping functions to map
26549 * between the settings and property values. These functions
26550 * handle booleans, numeric types and string types in a
26551 * straightforward way. Use g_settings_bind_with_mapping() if
26552 * you need a custom mapping, or map between types that are not
26553 * supported by the default mapping functions.
26555 * Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
26556 * function also establishes a binding between the writability of
26557 * @key and the "sensitive" property of @object (if @object has
26558 * a boolean property by that name). See g_settings_bind_writable()
26559 * for more details about writable bindings.
26561 * Note that the lifecycle of the binding is tied to the object,
26562 * and that you can have only one binding per object property.
26563 * If you bind the same property twice on the same object, the second
26564 * binding overrides the first one.
26571 * g_settings_bind_with_mapping: (skip)
26572 * @settings: a #GSettings object
26573 * @key: the key to bind
26574 * @object: (type GObject.Object): a #GObject
26575 * @property: the name of the property to bind
26576 * @flags: flags for the binding
26577 * @get_mapping: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
26578 * @set_mapping: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
26579 * @user_data: data that gets passed to @get_mapping and @set_mapping
26580 * @destroy: #GDestroyNotify function for @user_data
26582 * Create a binding between the @key in the @settings object
26583 * and the property @property of @object.
26585 * The binding uses the provided mapping functions to map between
26586 * settings and property values.
26588 * Note that the lifecycle of the binding is tied to the object,
26589 * and that you can have only one binding per object property.
26590 * If you bind the same property twice on the same object, the second
26591 * binding overrides the first one.
26598 * g_settings_bind_writable:
26599 * @settings: a #GSettings object
26600 * @key: the key to bind
26601 * @object: (type GObject.Object): a #GObject
26602 * @property: the name of a boolean property to bind
26603 * @inverted: whether to 'invert' the value
26605 * Create a binding between the writability of @key in the
26606 * @settings object and the property @property of @object.
26607 * The property must be boolean; "sensitive" or "visible"
26608 * properties of widgets are the most likely candidates.
26610 * Writable bindings are always uni-directional; changes of the
26611 * writability of the setting will be propagated to the object
26612 * property, not the other way.
26614 * When the @inverted argument is %TRUE, the binding inverts the
26615 * value as it passes from the setting to the object, i.e. @property
26616 * will be set to %TRUE if the key is <emphasis>not</emphasis>
26619 * Note that the lifecycle of the binding is tied to the object,
26620 * and that you can have only one binding per object property.
26621 * If you bind the same property twice on the same object, the second
26622 * binding overrides the first one.
26629 * g_settings_create_action:
26630 * @settings: a #GSettings
26631 * @key: the name of a key in @settings
26633 * Creates a #GAction corresponding to a given #GSettings key.
26635 * The action has the same name as the key.
26637 * The value of the key becomes the state of the action and the action
26638 * is enabled when the key is writable. Changing the state of the
26639 * action results in the key being written to. Changes to the value or
26640 * writability of the key cause appropriate change notifications to be
26641 * emitted for the action.
26643 * For boolean-valued keys, action activations take no parameter and
26644 * result in the toggling of the value. For all other types,
26645 * activations take the new value for the key (which must have the
26648 * Returns: (transfer full): a new #GAction
26654 * g_settings_delay:
26655 * @settings: a #GSettings object
26657 * Changes the #GSettings object into 'delay-apply' mode. In this
26658 * mode, changes to @settings are not immediately propagated to the
26659 * backend, but kept locally until g_settings_apply() is called.
26667 * @settings: a #GSettings object
26668 * @key: the key to get the value for
26669 * @format: a #GVariant format string
26670 * @...: arguments as per @format
26672 * Gets the value that is stored at @key in @settings.
26674 * A convenience function that combines g_settings_get_value() with
26677 * It is a programmer error to give a @key that isn't contained in the
26678 * schema for @settings or for the #GVariantType of @format to mismatch
26679 * the type given in the schema.
26686 * g_settings_get_boolean:
26687 * @settings: a #GSettings object
26688 * @key: the key to get the value for
26690 * Gets the value that is stored at @key in @settings.
26692 * A convenience variant of g_settings_get() for booleans.
26694 * It is a programmer error to give a @key that isn't specified as
26695 * having a boolean type in the schema for @settings.
26697 * Returns: a boolean
26703 * g_settings_get_child:
26704 * @settings: a #GSettings object
26705 * @name: the name of the 'child' schema
26707 * Creates a 'child' settings object which has a base path of
26708 * <replaceable>base-path</replaceable>/@name, where
26709 * <replaceable>base-path</replaceable> is the base path of @settings.
26711 * The schema for the child settings object must have been declared
26712 * in the schema of @settings using a <tag class="starttag">child</tag> element.
26714 * Returns: (transfer full): a 'child' settings object
26720 * g_settings_get_double:
26721 * @settings: a #GSettings object
26722 * @key: the key to get the value for
26724 * Gets the value that is stored at @key in @settings.
26726 * A convenience variant of g_settings_get() for doubles.
26728 * It is a programmer error to give a @key that isn't specified as
26729 * having a 'double' type in the schema for @settings.
26731 * Returns: a double
26737 * g_settings_get_enum:
26738 * @settings: a #GSettings object
26739 * @key: the key to get the value for
26741 * Gets the value that is stored in @settings for @key and converts it
26742 * to the enum value that it represents.
26744 * In order to use this function the type of the value must be a string
26745 * and it must be marked in the schema file as an enumerated type.
26747 * It is a programmer error to give a @key that isn't contained in the
26748 * schema for @settings or is not marked as an enumerated type.
26750 * If the value stored in the configuration database is not a valid
26751 * value for the enumerated type then this function will return the
26754 * Returns: the enum value
26760 * g_settings_get_flags:
26761 * @settings: a #GSettings object
26762 * @key: the key to get the value for
26764 * Gets the value that is stored in @settings for @key and converts it
26765 * to the flags value that it represents.
26767 * In order to use this function the type of the value must be an array
26768 * of strings and it must be marked in the schema file as an flags type.
26770 * It is a programmer error to give a @key that isn't contained in the
26771 * schema for @settings or is not marked as a flags type.
26773 * If the value stored in the configuration database is not a valid
26774 * value for the flags type then this function will return the default
26777 * Returns: the flags value
26783 * g_settings_get_has_unapplied:
26784 * @settings: a #GSettings object
26786 * Returns whether the #GSettings object has any unapplied
26787 * changes. This can only be the case if it is in 'delayed-apply' mode.
26789 * Returns: %TRUE if @settings has unapplied changes
26795 * g_settings_get_int:
26796 * @settings: a #GSettings object
26797 * @key: the key to get the value for
26799 * Gets the value that is stored at @key in @settings.
26801 * A convenience variant of g_settings_get() for 32-bit integers.
26803 * It is a programmer error to give a @key that isn't specified as
26804 * having a int32 type in the schema for @settings.
26806 * Returns: an integer
26812 * g_settings_get_mapped:
26813 * @settings: a #GSettings object
26814 * @key: the key to get the value for
26815 * @mapping: (scope call): the function to map the value in the settings database to the value used by the application
26816 * @user_data: user data for @mapping
26818 * Gets the value that is stored at @key in @settings, subject to
26819 * application-level validation/mapping.
26821 * You should use this function when the application needs to perform
26822 * some processing on the value of the key (for example, parsing). The
26823 * @mapping function performs that processing. If the function
26824 * indicates that the processing was unsuccessful (due to a parse error,
26825 * for example) then the mapping is tried again with another value.
26827 * This allows a robust 'fall back to defaults' behaviour to be
26828 * implemented somewhat automatically.
26830 * The first value that is tried is the user's setting for the key. If
26831 * the mapping function fails to map this value, other values may be
26832 * tried in an unspecified order (system or site defaults, translated
26833 * schema default values, untranslated schema default values, etc).
26835 * If the mapping function fails for all possible values, one additional
26836 * attempt is made: the mapping function is called with a %NULL value.
26837 * If the mapping function still indicates failure at this point then
26838 * the application will be aborted.
26840 * The result parameter for the @mapping function is pointed to a
26841 * #gpointer which is initially set to %NULL. The same pointer is given
26842 * to each invocation of @mapping. The final value of that #gpointer is
26843 * what is returned by this function. %NULL is valid; it is returned
26844 * just as any other value would be.
26846 * Returns: (transfer full): the result, which may be %NULL
26851 * g_settings_get_range:
26852 * @settings: a #GSettings
26853 * @key: the key to query the range of
26855 * Queries the range of a key.
26857 * This function will return a #GVariant that fully describes the range
26858 * of values that are valid for @key.
26860 * The type of #GVariant returned is <literal>(sv)</literal>. The
26861 * string describes the type of range restriction in effect. The type
26862 * and meaning of the value contained in the variant depends on the
26865 * If the string is <literal>'type'</literal> then the variant contains
26866 * an empty array. The element type of that empty array is the expected
26867 * type of value and all values of that type are valid.
26869 * If the string is <literal>'enum'</literal> then the variant contains
26870 * an array enumerating the possible values. Each item in the array is
26871 * a possible valid value and no other values are valid.
26873 * If the string is <literal>'flags'</literal> then the variant contains
26874 * an array. Each item in the array is a value that may appear zero or
26875 * one times in an array to be used as the value for this key. For
26876 * example, if the variant contained the array <literal>['x',
26877 * 'y']</literal> then the valid values for the key would be
26878 * <literal>[]</literal>, <literal>['x']</literal>,
26879 * <literal>['y']</literal>, <literal>['x', 'y']</literal> and
26880 * <literal>['y', 'x']</literal>.
26882 * Finally, if the string is <literal>'range'</literal> then the variant
26883 * contains a pair of like-typed values -- the minimum and maximum
26884 * permissible values for this key.
26886 * This information should not be used by normal programs. It is
26887 * considered to be a hint for introspection purposes. Normal programs
26888 * should already know what is permitted by their own schema. The
26889 * format may change in any way in the future -- but particularly, new
26890 * forms may be added to the possibilities described above.
26892 * It is a programmer error to give a @key that isn't contained in the
26893 * schema for @settings.
26895 * You should free the returned value with g_variant_unref() when it is
26896 * no longer needed.
26898 * Returns: a #GVariant describing the range
26904 * g_settings_get_string:
26905 * @settings: a #GSettings object
26906 * @key: the key to get the value for
26908 * Gets the value that is stored at @key in @settings.
26910 * A convenience variant of g_settings_get() for strings.
26912 * It is a programmer error to give a @key that isn't specified as
26913 * having a string type in the schema for @settings.
26915 * Returns: a newly-allocated string
26921 * g_settings_get_strv:
26922 * @settings: a #GSettings object
26923 * @key: the key to get the value for
26925 * A convenience variant of g_settings_get() for string arrays.
26927 * It is a programmer error to give a @key that isn't specified as
26928 * having an array of strings type in the schema for @settings.
26930 * Returns: (array zero-terminated=1) (transfer full): a newly-allocated, %NULL-terminated array of strings, the value that is stored at @key in @settings.
26936 * g_settings_get_uint:
26937 * @settings: a #GSettings object
26938 * @key: the key to get the value for
26940 * Gets the value that is stored at @key in @settings.
26942 * A convenience variant of g_settings_get() for 32-bit unsigned
26945 * It is a programmer error to give a @key that isn't specified as
26946 * having a uint32 type in the schema for @settings.
26948 * Returns: an unsigned integer
26954 * g_settings_get_value:
26955 * @settings: a #GSettings object
26956 * @key: the key to get the value for
26958 * Gets the value that is stored in @settings for @key.
26960 * It is a programmer error to give a @key that isn't contained in the
26961 * schema for @settings.
26963 * Returns: a new #GVariant
26969 * g_settings_is_writable:
26970 * @settings: a #GSettings object
26971 * @name: the name of a key
26973 * Finds out if a key can be written or not
26975 * Returns: %TRUE if the key @name is writable
26981 * g_settings_list_children:
26982 * @settings: a #GSettings object
26984 * Gets the list of children on @settings.
26986 * The list is exactly the list of strings for which it is not an error
26987 * to call g_settings_get_child().
26989 * For GSettings objects that are lists, this value can change at any
26990 * time and you should connect to the "children-changed" signal to watch
26991 * for those changes. Note that there is a race condition here: you may
26992 * request a child after listing it only for it to have been destroyed
26993 * in the meantime. For this reason, g_settings_get_child() may return
26994 * %NULL even for a child that was listed by this function.
26996 * For GSettings objects that are not lists, you should probably not be
26997 * calling this function from "normal" code (since you should already
26998 * know what children are in your schema). This function may still be
26999 * useful there for introspection reasons, however.
27001 * You should free the return value with g_strfreev() when you are done
27004 * Returns: (transfer full) (element-type utf8): a list of the children on @settings
27009 * g_settings_list_keys:
27010 * @settings: a #GSettings object
27012 * Introspects the list of keys on @settings.
27014 * You should probably not be calling this function from "normal" code
27015 * (since you should already know what keys are in your schema). This
27016 * function is intended for introspection reasons.
27018 * You should free the return value with g_strfreev() when you are done
27021 * Returns: (transfer full) (element-type utf8): a list of the keys on @settings
27026 * g_settings_list_relocatable_schemas:
27028 * Gets a list of the relocatable #GSettings schemas installed on the
27029 * system. These are schemas that do not provide their own path. It is
27030 * usual to instantiate these schemas directly, but if you want to you
27031 * can use g_settings_new_with_path() to specify the path.
27033 * The output of this function, taken together with the output of
27034 * g_settings_list_schemas() represents the complete list of all
27035 * installed schemas.
27037 * Returns: (element-type utf8) (transfer none): a list of relocatable #GSettings schemas that are available. The list must not be modified or freed.
27043 * g_settings_list_schemas:
27045 * Gets a list of the #GSettings schemas installed on the system. The
27046 * returned list is exactly the list of schemas for which you may call
27047 * g_settings_new() without adverse effects.
27049 * This function does not list the schemas that do not provide their own
27050 * paths (ie: schemas for which you must use
27051 * g_settings_new_with_path()). See
27052 * g_settings_list_relocatable_schemas() for that.
27054 * Returns: (element-type utf8) (transfer none): a list of #GSettings schemas that are available. The list must not be modified or freed.
27061 * @schema_id: the id of the schema
27063 * Creates a new #GSettings object with the schema specified by
27066 * Signals on the newly created #GSettings object will be dispatched
27067 * via the thread-default #GMainContext in effect at the time of the
27068 * call to g_settings_new(). The new #GSettings will hold a reference
27069 * on the context. See g_main_context_push_thread_default().
27071 * Returns: a new #GSettings object
27077 * g_settings_new_full:
27078 * @schema: a #GSettingsSchema
27079 * @backend: (allow-none): a #GSettingsBackend
27080 * @path: (allow-none): the path to use
27082 * Creates a new #GSettings object with a given schema, backend and
27085 * It should be extremely rare that you ever want to use this function.
27086 * It is made available for advanced use-cases (such as plugin systems
27087 * that want to provide access to schemas loaded from custom locations,
27090 * At the most basic level, a #GSettings object is a pure composition of
27091 * 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
27092 * backend, and a #GMainContext to which signals are dispatched.
27094 * This constructor therefore gives you full control over constructing
27095 * #GSettings instances. The first 4 parameters are given directly as
27096 * @schema, @backend and @path, and the main context is taken from the
27097 * thread-default (as per g_settings_new()).
27099 * If @backend is %NULL then the default backend is used.
27101 * If @path is %NULL then the path from the schema is used. It is an
27102 * error f @path is %NULL and the schema has no path of its own or if
27103 * @path is non-%NULL and not equal to the path that the schema does
27106 * Returns: a new #GSettings object
27112 * g_settings_new_with_backend:
27113 * @schema_id: the id of the schema
27114 * @backend: the #GSettingsBackend to use
27116 * Creates a new #GSettings object with the schema specified by
27117 * @schema_id and a given #GSettingsBackend.
27119 * Creating a #GSettings object with a different backend allows accessing
27120 * settings from a database other than the usual one. For example, it may make
27121 * sense to pass a backend corresponding to the "defaults" settings database on
27122 * the system to get a settings object that modifies the system default
27123 * settings instead of the settings for this user.
27125 * Returns: a new #GSettings object
27131 * g_settings_new_with_backend_and_path:
27132 * @schema_id: the id of the schema
27133 * @backend: the #GSettingsBackend to use
27134 * @path: the path to use
27136 * Creates a new #GSettings object with the schema specified by
27137 * @schema_id and a given #GSettingsBackend and path.
27139 * This is a mix of g_settings_new_with_backend() and
27140 * g_settings_new_with_path().
27142 * Returns: a new #GSettings object
27148 * g_settings_new_with_path:
27149 * @schema_id: the id of the schema
27150 * @path: the path to use
27152 * Creates a new #GSettings object with the relocatable schema specified
27153 * by @schema_id and a given path.
27155 * You only need to do this if you want to directly create a settings
27156 * object with a schema that doesn't have a specified path of its own.
27157 * That's quite rare.
27159 * It is a programmer error to call this function for a schema that
27160 * has an explicitly specified path.
27162 * Returns: a new #GSettings object
27168 * g_settings_range_check:
27169 * @settings: a #GSettings
27170 * @key: the key to check
27171 * @value: the value to check
27173 * Checks if the given @value is of the correct type and within the
27174 * permitted range for @key.
27176 * This API is not intended to be used by normal programs -- they should
27177 * already know what is permitted by their own schemas. This API is
27178 * meant to be used by programs such as editors or commandline tools.
27180 * It is a programmer error to give a @key that isn't contained in the
27181 * schema for @settings.
27183 * Returns: %TRUE if @value is valid for @key
27189 * g_settings_reset:
27190 * @settings: a #GSettings object
27191 * @key: the name of a key
27193 * Resets @key to its default value.
27195 * This call resets the key, as much as possible, to its default value.
27196 * That might the value specified in the schema or the one set by the
27202 * g_settings_revert:
27203 * @settings: a #GSettings instance
27205 * Reverts all non-applied changes to the settings. This function
27206 * does nothing unless @settings is in 'delay-apply' mode; see
27207 * g_settings_delay(). In the normal case settings are always applied
27210 * Change notifications will be emitted for affected keys.
27215 * g_settings_schema_get_id:
27216 * @schema: a #GSettingsSchema
27218 * Get the ID of @schema.
27220 * Returns: (transfer none): the ID
27225 * g_settings_schema_get_path:
27226 * @schema: a #GSettingsSchema
27228 * Gets the path associated with @schema, or %NULL.
27230 * Schemas may be single-instance or relocatable. Single-instance
27231 * schemas correspond to exactly one set of keys in the backend
27232 * database: those located at the path returned by this function.
27234 * Relocatable schemas can be referenced by other schemas and can
27235 * threfore describe multiple sets of keys at different locations. For
27236 * relocatable schemas, this function will return %NULL.
27238 * Returns: (transfer none): the path of the schema, or %NULL
27244 * g_settings_schema_ref:
27245 * @schema: a #GSettingsSchema
27247 * Increase the reference count of @schema, returning a new reference.
27249 * Returns: a new reference to @schema
27255 * g_settings_schema_source_get_default:
27257 * Gets the default system schema source.
27259 * This function is not required for normal uses of #GSettings but it
27260 * may be useful to authors of plugin management systems or to those who
27261 * want to introspect the content of schemas.
27263 * If no schemas are installed, %NULL will be returned.
27265 * The returned source may actually consist of multiple schema sources
27266 * from different directories, depending on which directories were given
27267 * in <envar>XDG_DATA_DIRS</envar> and
27268 * <envar>GSETTINGS_SCHEMA_DIR</envar>. For this reason, all lookups
27269 * performed against the default source should probably be done
27272 * Returns: (transfer none): the default schema source
27278 * g_settings_schema_source_lookup:
27279 * @source: a #GSettingsSchemaSource
27280 * @schema_id: a schema ID
27281 * @recursive: %TRUE if the lookup should be recursive
27283 * Looks up a schema with the identifier @schema_id in @source.
27285 * This function is not required for normal uses of #GSettings but it
27286 * may be useful to authors of plugin management systems or to those who
27287 * want to introspect the content of schemas.
27289 * If the schema isn't found directly in @source and @recursive is %TRUE
27290 * then the parent sources will also be checked.
27292 * If the schema isn't found, %NULL is returned.
27294 * Returns: (transfer full): a new #GSettingsSchema
27300 * g_settings_schema_source_new_from_directory:
27301 * @directory: the filename of a directory
27302 * @parent: (allow-none): a #GSettingsSchemaSource, or %NULL
27303 * @trusted: %TRUE, if the directory is trusted
27304 * @error: a pointer to a #GError pointer set to %NULL, or %NULL
27306 * Attempts to create a new schema source corresponding to the contents
27307 * of the given directory.
27309 * This function is not required for normal uses of #GSettings but it
27310 * may be useful to authors of plugin management systems.
27312 * The directory should contain a file called
27313 * <filename>gschemas.compiled</filename> as produced by
27314 * <command>glib-compile-schemas</command>.
27316 * If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
27317 * trusted not to be corrupted. This assumption has a performance
27318 * advantage, but can result in crashes or inconsistent behaviour in the
27319 * case of a corrupted file. Generally, you should set @trusted to
27320 * %TRUE for files installed by the system and to %FALSE for files in
27321 * the home directory.
27323 * If @parent is non-%NULL then there are two effects.
27325 * First, if g_settings_schema_source_lookup() is called with the
27326 * @recursive flag set to %TRUE and the schema can not be found in the
27327 * source, the lookup will recurse to the parent.
27329 * Second, any references to other schemas specified within this
27330 * source (ie: <literal>child</literal> or <literal>extends</literal>)
27331 * references may be resolved from the @parent.
27333 * For this second reason, except in very unusual situations, the
27334 * @parent should probably be given as the default schema source, as
27335 * returned by g_settings_schema_source_get_default().
27342 * g_settings_schema_source_ref:
27343 * @source: a #GSettingsSchemaSource
27345 * Increase the reference count of @source, returning a new reference.
27347 * Returns: a new reference to @source
27353 * g_settings_schema_source_unref:
27354 * @source: a #GSettingsSchemaSource
27356 * Decrease the reference count of @source, possibly freeing it.
27363 * g_settings_schema_unref:
27364 * @schema: a #GSettingsSchema
27366 * Decrease the reference count of @schema, possibly freeing it.
27374 * @settings: a #GSettings object
27375 * @key: the name of the key to set
27376 * @format: a #GVariant format string
27377 * @...: arguments as per @format
27379 * Sets @key in @settings to @value.
27381 * A convenience function that combines g_settings_set_value() with
27384 * It is a programmer error to give a @key that isn't contained in the
27385 * schema for @settings or for the #GVariantType of @format to mismatch
27386 * the type given in the schema.
27388 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27394 * g_settings_set_boolean:
27395 * @settings: a #GSettings object
27396 * @key: the name of the key to set
27397 * @value: the value to set it to
27399 * Sets @key in @settings to @value.
27401 * A convenience variant of g_settings_set() for booleans.
27403 * It is a programmer error to give a @key that isn't specified as
27404 * having a boolean type in the schema for @settings.
27406 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27412 * g_settings_set_double:
27413 * @settings: a #GSettings object
27414 * @key: the name of the key to set
27415 * @value: the value to set it to
27417 * Sets @key in @settings to @value.
27419 * A convenience variant of g_settings_set() for doubles.
27421 * It is a programmer error to give a @key that isn't specified as
27422 * having a 'double' type in the schema for @settings.
27424 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27430 * g_settings_set_enum:
27431 * @settings: a #GSettings object
27432 * @key: a key, within @settings
27433 * @value: an enumerated value
27435 * Looks up the enumerated type nick for @value and writes it to @key,
27436 * within @settings.
27438 * It is a programmer error to give a @key that isn't contained in the
27439 * schema for @settings or is not marked as an enumerated type, or for
27440 * @value not to be a valid value for the named type.
27442 * After performing the write, accessing @key directly with
27443 * g_settings_get_string() will return the 'nick' associated with
27446 * Returns: %TRUE, if the set succeeds
27451 * g_settings_set_flags:
27452 * @settings: a #GSettings object
27453 * @key: a key, within @settings
27454 * @value: a flags value
27456 * Looks up the flags type nicks for the bits specified by @value, puts
27457 * them in an array of strings and writes the array to @key, within
27460 * It is a programmer error to give a @key that isn't contained in the
27461 * schema for @settings or is not marked as a flags type, or for @value
27462 * to contain any bits that are not value for the named type.
27464 * After performing the write, accessing @key directly with
27465 * g_settings_get_strv() will return an array of 'nicks'; one for each
27468 * Returns: %TRUE, if the set succeeds
27473 * g_settings_set_int:
27474 * @settings: a #GSettings object
27475 * @key: the name of the key to set
27476 * @value: the value to set it to
27478 * Sets @key in @settings to @value.
27480 * A convenience variant of g_settings_set() for 32-bit integers.
27482 * It is a programmer error to give a @key that isn't specified as
27483 * having a int32 type in the schema for @settings.
27485 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27491 * g_settings_set_string:
27492 * @settings: a #GSettings object
27493 * @key: the name of the key to set
27494 * @value: the value to set it to
27496 * Sets @key in @settings to @value.
27498 * A convenience variant of g_settings_set() for strings.
27500 * It is a programmer error to give a @key that isn't specified as
27501 * having a string type in the schema for @settings.
27503 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27509 * g_settings_set_strv:
27510 * @settings: a #GSettings object
27511 * @key: the name of the key to set
27512 * @value: (allow-none) (array zero-terminated=1): the value to set it to, or %NULL
27514 * Sets @key in @settings to @value.
27516 * A convenience variant of g_settings_set() for string arrays. If
27517 * @value is %NULL, then @key is set to be the empty array.
27519 * It is a programmer error to give a @key that isn't specified as
27520 * having an array of strings type in the schema for @settings.
27522 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27528 * g_settings_set_uint:
27529 * @settings: a #GSettings object
27530 * @key: the name of the key to set
27531 * @value: the value to set it to
27533 * Sets @key in @settings to @value.
27535 * A convenience variant of g_settings_set() for 32-bit unsigned
27538 * It is a programmer error to give a @key that isn't specified as
27539 * having a uint32 type in the schema for @settings.
27541 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27547 * g_settings_set_value:
27548 * @settings: a #GSettings object
27549 * @key: the name of the key to set
27550 * @value: a #GVariant of the correct type
27552 * Sets @key in @settings to @value.
27554 * It is a programmer error to give a @key that isn't contained in the
27555 * schema for @settings or for @value to have the incorrect type, per
27558 * If @value is floating then this function consumes the reference.
27560 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27568 * Ensures that all pending operations for the given are complete for
27569 * the default backend.
27571 * Writes made to a #GSettings are handled asynchronously. For this
27572 * reason, it is very unlikely that the changes have it to disk by the
27573 * time g_settings_set() returns.
27575 * This call will block until all of the writes have made it to the
27576 * backend. Since the mainloop is not running, no change notifications
27577 * will be dispatched during this call (but some may be queued by the
27578 * time the call is done).
27583 * g_settings_unbind:
27584 * @object: the object
27585 * @property: the property whose binding is removed
27587 * Removes an existing binding for @property on @object.
27589 * Note that bindings are automatically removed when the
27590 * object is finalized, so it is rarely necessary to call this
27598 * g_simple_action_group_add_entries:
27599 * @simple: a #GSimpleActionGroup
27600 * @entries: (array length=n_entries): a pointer to the first item in an array of #GActionEntry structs
27601 * @n_entries: the length of @entries, or -1
27602 * @user_data: the user data for signal connections
27604 * A convenience function for creating multiple #GSimpleAction instances
27605 * and adding them to the action group.
27608 * Deprecated: 2.38: Use g_action_map_add_action_entries()
27613 * g_simple_action_group_insert:
27614 * @simple: a #GSimpleActionGroup
27615 * @action: a #GAction
27617 * Adds an action to the action group.
27619 * If the action group already contains an action with the same name as
27620 * @action then the old action is dropped from the group.
27622 * The action group takes its own reference on @action.
27625 * Deprecated: 2.38: Use g_action_map_add_action()
27630 * g_simple_action_group_lookup:
27631 * @simple: a #GSimpleActionGroup
27632 * @action_name: the name of an action
27634 * Looks up the action with the name @action_name in the group.
27636 * If no such action exists, returns %NULL.
27638 * Returns: (transfer none): a #GAction, or %NULL
27640 * Deprecated: 2.38: Use g_action_map_lookup_action()
27645 * g_simple_action_group_new:
27647 * Creates a new, empty, #GSimpleActionGroup.
27649 * Returns: a new #GSimpleActionGroup
27655 * g_simple_action_group_remove:
27656 * @simple: a #GSimpleActionGroup
27657 * @action_name: the name of the action
27659 * Removes the named action from the action group.
27661 * If no action of this name is in the group then nothing happens.
27664 * Deprecated: 2.38: Use g_action_map_remove_action()
27669 * g_simple_action_new:
27670 * @name: the name of the action
27671 * @parameter_type: (allow-none): the type of parameter to the activate function
27673 * Creates a new action.
27675 * The created action is stateless. See g_simple_action_new_stateful().
27677 * Returns: a new #GSimpleAction
27683 * g_simple_action_new_stateful:
27684 * @name: the name of the action
27685 * @parameter_type: (allow-none): the type of the parameter to the activate function
27686 * @state: the initial state of the action
27688 * Creates a new stateful action.
27690 * @state is the initial state of the action. All future state values
27691 * must have the same #GVariantType as the initial state.
27693 * If the @state GVariant is floating, it is consumed.
27695 * Returns: a new #GSimpleAction
27701 * g_simple_action_set_enabled:
27702 * @simple: a #GSimpleAction
27703 * @enabled: whether the action is enabled
27705 * Sets the action as enabled or not.
27707 * An action must be enabled in order to be activated or in order to
27708 * have its state changed from outside callers.
27710 * This should only be called by the implementor of the action. Users
27711 * of the action should not attempt to modify its enabled flag.
27718 * g_simple_action_set_state:
27719 * @simple: a #GSimpleAction
27720 * @value: the new #GVariant for the state
27722 * Sets the state of the action.
27724 * This directly updates the 'state' property to the given value.
27726 * This should only be called by the implementor of the action. Users
27727 * of the action should not attempt to directly modify the 'state'
27728 * property. Instead, they should call g_action_change_state() to
27729 * request the change.
27731 * If the @value GVariant is floating, it is consumed.
27738 * g_simple_async_report_error_in_idle: (skip)
27739 * @object: (allow-none): a #GObject, or %NULL.
27740 * @callback: a #GAsyncReadyCallback.
27741 * @user_data: user data passed to @callback.
27742 * @domain: a #GQuark containing the error domain (usually #G_IO_ERROR).
27743 * @code: a specific error code.
27744 * @format: a formatted error reporting string.
27745 * @...: a list of variables to fill in @format.
27747 * Reports an error in an asynchronous function in an idle function by
27748 * directly setting the contents of the #GAsyncResult with the given error
27754 * g_simple_async_report_gerror_in_idle:
27755 * @object: (allow-none): a #GObject, or %NULL
27756 * @callback: (scope async): a #GAsyncReadyCallback.
27757 * @user_data: (closure): user data passed to @callback.
27758 * @error: the #GError to report
27760 * Reports an error in an idle function. Similar to
27761 * g_simple_async_report_error_in_idle(), but takes a #GError rather
27762 * than building a new one.
27767 * g_simple_async_report_take_gerror_in_idle: (skip)
27768 * @object: (allow-none): a #GObject, or %NULL
27769 * @callback: a #GAsyncReadyCallback.
27770 * @user_data: user data passed to @callback.
27771 * @error: the #GError to report
27773 * Reports an error in an idle function. Similar to
27774 * g_simple_async_report_gerror_in_idle(), but takes over the caller's
27775 * ownership of @error, so the caller does not have to free it any more.
27782 * g_simple_async_result_complete:
27783 * @simple: a #GSimpleAsyncResult.
27785 * Completes an asynchronous I/O job immediately. Must be called in
27786 * the thread where the asynchronous result was to be delivered, as it
27787 * invokes the callback directly. If you are in a different thread use
27788 * g_simple_async_result_complete_in_idle().
27790 * Calling this function takes a reference to @simple for as long as
27791 * is needed to complete the call.
27796 * g_simple_async_result_complete_in_idle:
27797 * @simple: a #GSimpleAsyncResult.
27799 * Completes an asynchronous function in an idle handler in the <link
27800 * linkend="g-main-context-push-thread-default">thread-default main
27801 * loop</link> of the thread that @simple was initially created in
27802 * (and re-pushes that context around the invocation of the callback).
27804 * Calling this function takes a reference to @simple for as long as
27805 * is needed to complete the call.
27810 * g_simple_async_result_get_op_res_gboolean:
27811 * @simple: a #GSimpleAsyncResult.
27813 * Gets the operation result boolean from within the asynchronous result.
27815 * Returns: %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE.
27820 * g_simple_async_result_get_op_res_gpointer: (skip)
27821 * @simple: a #GSimpleAsyncResult.
27823 * Gets a pointer result as returned by the asynchronous function.
27825 * Returns: a pointer from the result.
27830 * g_simple_async_result_get_op_res_gssize:
27831 * @simple: a #GSimpleAsyncResult.
27833 * Gets a gssize from the asynchronous result.
27835 * Returns: a gssize returned from the asynchronous function.
27840 * g_simple_async_result_get_source_tag: (skip)
27841 * @simple: a #GSimpleAsyncResult.
27843 * Gets the source tag for the #GSimpleAsyncResult.
27845 * Returns: a #gpointer to the source object for the #GSimpleAsyncResult.
27850 * g_simple_async_result_is_valid:
27851 * @result: the #GAsyncResult passed to the _finish function.
27852 * @source: the #GObject passed to the _finish function.
27853 * @source_tag: the asynchronous function.
27855 * Ensures that the data passed to the _finish function of an async
27856 * operation is consistent. Three checks are performed.
27858 * First, @result is checked to ensure that it is really a
27859 * #GSimpleAsyncResult. Second, @source is checked to ensure that it
27860 * matches the source object of @result. Third, @source_tag is
27861 * checked to ensure that it is either %NULL (as it is when the result was
27862 * created by g_simple_async_report_error_in_idle() or
27863 * g_simple_async_report_gerror_in_idle()) or equal to the
27864 * @source_tag argument given to g_simple_async_result_new() (which, by
27865 * convention, is a pointer to the _async function corresponding to the
27866 * _finish function from which this function is called).
27868 * Returns: #TRUE if all checks passed or #FALSE if any failed.
27874 * g_simple_async_result_new:
27875 * @source_object: (allow-none): a #GObject, or %NULL.
27876 * @callback: (scope async): a #GAsyncReadyCallback.
27877 * @user_data: (closure): user data passed to @callback.
27878 * @source_tag: the asynchronous function.
27880 * Creates a #GSimpleAsyncResult.
27882 * The common convention is to create the #GSimpleAsyncResult in the
27883 * function that starts the asynchronous operation and use that same
27884 * function as the @source_tag.
27886 * If your operation supports cancellation with #GCancellable (which it
27887 * probably should) then you should provide the user's cancellable to
27888 * g_simple_async_result_set_check_cancellable() immediately after
27889 * this function returns.
27891 * Returns: a #GSimpleAsyncResult.
27896 * g_simple_async_result_new_error:
27897 * @source_object: (allow-none): a #GObject, or %NULL.
27898 * @callback: (scope async): a #GAsyncReadyCallback.
27899 * @user_data: (closure): user data passed to @callback.
27900 * @domain: a #GQuark.
27901 * @code: an error code.
27902 * @format: a string with format characters.
27903 * @...: a list of values to insert into @format.
27905 * Creates a new #GSimpleAsyncResult with a set error.
27907 * Returns: a #GSimpleAsyncResult.
27912 * g_simple_async_result_new_from_error:
27913 * @source_object: (allow-none): a #GObject, or %NULL.
27914 * @callback: (scope async): a #GAsyncReadyCallback.
27915 * @user_data: (closure): user data passed to @callback.
27916 * @error: a #GError
27918 * Creates a #GSimpleAsyncResult from an error condition.
27920 * Returns: a #GSimpleAsyncResult.
27925 * g_simple_async_result_new_take_error: (skip)
27926 * @source_object: (allow-none): a #GObject, or %NULL
27927 * @callback: (scope async): a #GAsyncReadyCallback
27928 * @user_data: (closure): user data passed to @callback
27929 * @error: a #GError
27931 * Creates a #GSimpleAsyncResult from an error condition, and takes over the
27932 * caller's ownership of @error, so the caller does not need to free it anymore.
27934 * Returns: a #GSimpleAsyncResult
27940 * g_simple_async_result_propagate_error:
27941 * @simple: a #GSimpleAsyncResult.
27942 * @dest: (out): a location to propagate the error to.
27944 * Propagates an error from within the simple asynchronous result to
27945 * a given destination.
27947 * If the #GCancellable given to a prior call to
27948 * g_simple_async_result_set_check_cancellable() is cancelled then this
27949 * function will return %TRUE with @dest set appropriately.
27951 * Returns: %TRUE if the error was propagated to @dest. %FALSE otherwise.
27956 * g_simple_async_result_run_in_thread: (skip)
27957 * @simple: a #GSimpleAsyncResult.
27958 * @func: a #GSimpleAsyncThreadFunc.
27959 * @io_priority: the io priority of the request.
27960 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27962 * Runs the asynchronous job in a separate thread and then calls
27963 * g_simple_async_result_complete_in_idle() on @simple to return
27964 * the result to the appropriate main loop.
27966 * Calling this function takes a reference to @simple for as long as
27967 * is needed to run the job and report its completion.
27972 * g_simple_async_result_set_check_cancellable:
27973 * @simple: a #GSimpleAsyncResult
27974 * @check_cancellable: (allow-none): a #GCancellable to check, or %NULL to unset
27976 * Sets a #GCancellable to check before dispatching results.
27978 * This function has one very specific purpose: the provided cancellable
27979 * is checked at the time of g_simple_async_result_propagate_error() If
27980 * it is cancelled, these functions will return an "Operation was
27981 * cancelled" error (%G_IO_ERROR_CANCELLED).
27983 * Implementors of cancellable asynchronous functions should use this in
27984 * order to provide a guarantee to their callers that cancelling an
27985 * async operation will reliably result in an error being returned for
27986 * that operation (even if a positive result for the operation has
27987 * already been sent as an idle to the main context to be dispatched).
27989 * The checking described above is done regardless of any call to the
27990 * unrelated g_simple_async_result_set_handle_cancellation() function.
27997 * g_simple_async_result_set_error: (skip)
27998 * @simple: a #GSimpleAsyncResult.
27999 * @domain: a #GQuark (usually #G_IO_ERROR).
28000 * @code: an error code.
28001 * @format: a formatted error reporting string.
28002 * @...: a list of variables to fill in @format.
28004 * Sets an error within the asynchronous result without a #GError.
28009 * g_simple_async_result_set_error_va: (skip)
28010 * @simple: a #GSimpleAsyncResult.
28011 * @domain: a #GQuark (usually #G_IO_ERROR).
28012 * @code: an error code.
28013 * @format: a formatted error reporting string.
28014 * @args: va_list of arguments.
28016 * Sets an error within the asynchronous result without a #GError.
28017 * Unless writing a binding, see g_simple_async_result_set_error().
28022 * g_simple_async_result_set_from_error:
28023 * @simple: a #GSimpleAsyncResult.
28026 * Sets the result from a #GError.
28031 * g_simple_async_result_set_handle_cancellation:
28032 * @simple: a #GSimpleAsyncResult.
28033 * @handle_cancellation: a #gboolean.
28035 * Sets whether to handle cancellation within the asynchronous operation.
28037 * This function has nothing to do with
28038 * g_simple_async_result_set_check_cancellable(). It only refers to the
28039 * #GCancellable passed to g_simple_async_result_run_in_thread().
28044 * g_simple_async_result_set_op_res_gboolean:
28045 * @simple: a #GSimpleAsyncResult.
28046 * @op_res: a #gboolean.
28048 * Sets the operation result to a boolean within the asynchronous result.
28053 * g_simple_async_result_set_op_res_gpointer: (skip)
28054 * @simple: a #GSimpleAsyncResult.
28055 * @op_res: a pointer result from an asynchronous function.
28056 * @destroy_op_res: a #GDestroyNotify function.
28058 * Sets the operation result within the asynchronous result to a pointer.
28063 * g_simple_async_result_set_op_res_gssize:
28064 * @simple: a #GSimpleAsyncResult.
28065 * @op_res: a #gssize.
28067 * Sets the operation result within the asynchronous result to
28068 * the given @op_res.
28073 * g_simple_async_result_take_error: (skip)
28074 * @simple: a #GSimpleAsyncResult
28075 * @error: a #GError
28077 * Sets the result from @error, and takes over the caller's ownership
28078 * of @error, so the caller does not need to free it any more.
28085 * g_simple_permission_new:
28086 * @allowed: %TRUE if the action is allowed
28088 * Creates a new #GPermission instance that represents an action that is
28089 * either always or never allowed.
28091 * Returns: the #GSimplePermission, as a #GPermission
28097 * g_simple_proxy_resolver_new:
28098 * @default_proxy: (allow-none): the default proxy to use, eg "socks://192.168.1.1"
28099 * @ignore_hosts: (allow-none): an optional list of hosts/IP addresses to not use a proxy for.
28101 * Creates a new #GSimpleProxyResolver. See
28102 * #GSimpleProxyResolver:default-proxy and
28103 * #GSimpleProxyResolver:ignore-hosts for more details on how the
28104 * arguments are interpreted.
28106 * Returns: a new #GSimpleProxyResolver
28112 * g_simple_proxy_resolver_set_default_proxy:
28113 * @resolver: a #GSimpleProxyResolver
28114 * @default_proxy: the default proxy to use
28116 * Sets the default proxy on @resolver, to be used for any URIs that
28117 * don't match #GSimpleProxyResolver:ignore-hosts or a proxy set
28118 * via g_simple_proxy_resolver_set_uri_proxy().
28120 * If @default_proxy starts with "<literal>socks://</literal>",
28121 * #GSimpleProxyResolver will treat it as referring to all three of
28122 * the <literal>socks5</literal>, <literal>socks4a</literal>, and
28123 * <literal>socks4</literal> proxy types.
28130 * g_simple_proxy_resolver_set_ignore_hosts:
28131 * @resolver: a #GSimpleProxyResolver
28132 * @ignore_hosts: %NULL-terminated list of hosts/IP addresses to not use a proxy for
28134 * Sets the list of ignored hosts.
28136 * See #GSimpleProxyResolver:ignore-hosts for more details on how the
28137 * @ignore_hosts argument is interpreted.
28144 * g_simple_proxy_resolver_set_uri_proxy:
28145 * @resolver: a #GSimpleProxyResolver
28146 * @uri_scheme: the URI scheme to add a proxy for
28147 * @proxy: the proxy to use for @uri_scheme
28149 * Adds a URI-scheme-specific proxy to @resolver; URIs whose scheme
28150 * matches @uri_scheme (and which don't match
28151 * #GSimpleProxyResolver:ignore-hosts) will be proxied via @proxy.
28153 * As with #GSimpleProxyResolver:default-proxy, if @proxy starts with
28154 * "<literal>socks://</literal>", #GSimpleProxyResolver will treat it
28155 * as referring to all three of the <literal>socks5</literal>,
28156 * <literal>socks4a</literal>, and <literal>socks4</literal> proxy
28165 * @socket: a #GSocket.
28166 * @cancellable: (allow-none): a %GCancellable or %NULL
28167 * @error: #GError for error reporting, or %NULL to ignore.
28169 * Accept incoming connections on a connection-based socket. This removes
28170 * the first outstanding connection request from the listening socket and
28171 * creates a #GSocket object for it.
28173 * The @socket must be bound to a local address with g_socket_bind() and
28174 * must be listening for incoming connections (g_socket_listen()).
28176 * If there are no outstanding connections then the operation will block
28177 * or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
28178 * To be notified of an incoming connection, wait for the %G_IO_IN condition.
28180 * Returns: (transfer full): a new #GSocket, or %NULL on error. Free the returned object with g_object_unref().
28186 * g_socket_address_enumerator_next:
28187 * @enumerator: a #GSocketAddressEnumerator
28188 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28189 * @error: a #GError.
28191 * Retrieves the next #GSocketAddress from @enumerator. Note that this
28192 * may block for some amount of time. (Eg, a #GNetworkAddress may need
28193 * to do a DNS lookup before it can return an address.) Use
28194 * g_socket_address_enumerator_next_async() if you need to avoid
28197 * If @enumerator is expected to yield addresses, but for some reason
28198 * is unable to (eg, because of a DNS error), then the first call to
28199 * g_socket_address_enumerator_next() will return an appropriate error
28200 * in *@error. However, if the first call to
28201 * g_socket_address_enumerator_next() succeeds, then any further
28202 * internal errors (other than @cancellable being triggered) will be
28205 * 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.
28210 * g_socket_address_enumerator_next_async:
28211 * @enumerator: a #GSocketAddressEnumerator
28212 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28213 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
28214 * @user_data: (closure): the data to pass to callback function
28216 * Asynchronously retrieves the next #GSocketAddress from @enumerator
28217 * and then calls @callback, which must call
28218 * g_socket_address_enumerator_next_finish() to get the result.
28223 * g_socket_address_enumerator_next_finish:
28224 * @enumerator: a #GSocketAddressEnumerator
28225 * @result: a #GAsyncResult
28226 * @error: a #GError
28228 * Retrieves the result of a completed call to
28229 * g_socket_address_enumerator_next_async(). See
28230 * g_socket_address_enumerator_next() for more information about
28233 * 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.
28238 * g_socket_address_get_family:
28239 * @address: a #GSocketAddress
28241 * Gets the socket family type of @address.
28243 * Returns: the socket family type of @address.
28249 * g_socket_address_get_native_size:
28250 * @address: a #GSocketAddress
28252 * Gets the size of @address's native <type>struct sockaddr</type>.
28253 * You can use this to allocate memory to pass to
28254 * g_socket_address_to_native().
28256 * Returns: the size of the native <type>struct sockaddr</type> that @address represents
28262 * g_socket_address_new_from_native:
28263 * @native: a pointer to a <type>struct sockaddr</type>
28264 * @len: the size of the memory location pointed to by @native
28266 * Creates a #GSocketAddress subclass corresponding to the native
28267 * <type>struct sockaddr</type> @native.
28269 * Returns: a new #GSocketAddress if @native could successfully be converted, otherwise %NULL.
28275 * g_socket_address_to_native:
28276 * @address: a #GSocketAddress
28277 * @dest: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
28278 * @destlen: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
28279 * @error: #GError for error reporting, or %NULL to ignore.
28281 * Converts a #GSocketAddress to a native <type>struct
28282 * sockaddr</type>, which can be passed to low-level functions like
28283 * connect() or bind().
28285 * If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
28286 * returned. If the address type is not known on the system
28287 * then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
28289 * Returns: %TRUE if @dest was filled in, %FALSE on error
28296 * @socket: a #GSocket.
28297 * @address: a #GSocketAddress specifying the local address.
28298 * @allow_reuse: whether to allow reusing this address
28299 * @error: #GError for error reporting, or %NULL to ignore.
28301 * When a socket is created it is attached to an address family, but it
28302 * doesn't have an address in this family. g_socket_bind() assigns the
28303 * address (sometimes called name) of the socket.
28305 * It is generally required to bind to a local address before you can
28306 * receive connections. (See g_socket_listen() and g_socket_accept() ).
28307 * In certain situations, you may also want to bind a socket that will be
28308 * used to initiate connections, though this is not normally required.
28310 * If @socket is a TCP socket, then @allow_reuse controls the setting
28311 * of the <literal>SO_REUSEADDR</literal> socket option; normally it
28312 * should be %TRUE for server sockets (sockets that you will
28313 * eventually call g_socket_accept() on), and %FALSE for client
28314 * sockets. (Failing to set this flag on a server socket may cause
28315 * g_socket_bind() to return %G_IO_ERROR_ADDRESS_IN_USE if the server
28316 * program is stopped and then immediately restarted.)
28318 * If @socket is a UDP socket, then @allow_reuse determines whether or
28319 * not other UDP sockets can be bound to the same address at the same
28320 * time. In particular, you can have several UDP sockets bound to the
28321 * same address, and they will all receive all of the multicast and
28322 * broadcast packets sent to that address. (The behavior of unicast
28323 * UDP packets to an address with multiple listeners is not defined.)
28325 * Returns: %TRUE on success, %FALSE on error.
28331 * g_socket_check_connect_result:
28332 * @socket: a #GSocket
28333 * @error: #GError for error reporting, or %NULL to ignore.
28335 * Checks and resets the pending connect error for the socket.
28336 * This is used to check for errors when g_socket_connect() is
28337 * used in non-blocking mode.
28339 * Returns: %TRUE if no error, %FALSE otherwise, setting @error to the error
28345 * g_socket_client_add_application_proxy:
28346 * @client: a #GSocketClient
28347 * @protocol: The proxy protocol
28349 * Enable proxy protocols to be handled by the application. When the
28350 * indicated proxy protocol is returned by the #GProxyResolver,
28351 * #GSocketClient will consider this protocol as supported but will
28352 * not try to find a #GProxy instance to handle handshaking. The
28353 * application must check for this case by calling
28354 * g_socket_connection_get_remote_address() on the returned
28355 * #GSocketConnection, and seeing if it's a #GProxyAddress of the
28356 * appropriate type, to determine whether or not it needs to handle
28357 * the proxy handshaking itself.
28359 * This should be used for proxy protocols that are dialects of
28360 * another protocol such as HTTP proxy. It also allows cohabitation of
28361 * proxy protocols that are reused between protocols. A good example
28362 * is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
28363 * be use as generic socket proxy through the HTTP CONNECT method.
28365 * When the proxy is detected as being an application proxy, TLS handshake
28366 * will be skipped. This is required to let the application do the proxy
28367 * specific handshake.
28372 * g_socket_client_connect:
28373 * @client: a #GSocketClient.
28374 * @connectable: a #GSocketConnectable specifying the remote address.
28375 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28376 * @error: #GError for error reporting, or %NULL to ignore.
28378 * Tries to resolve the @connectable and make a network connection to it.
28380 * Upon a successful connection, a new #GSocketConnection is constructed
28381 * and returned. The caller owns this new object and must drop their
28382 * reference to it when finished with it.
28384 * The type of the #GSocketConnection object returned depends on the type of
28385 * the underlying socket that is used. For instance, for a TCP/IP connection
28386 * it will be a #GTcpConnection.
28388 * The socket created will be the same family as the address that the
28389 * @connectable resolves to, unless family is set with g_socket_client_set_family()
28390 * or indirectly via g_socket_client_set_local_address(). The socket type
28391 * defaults to %G_SOCKET_TYPE_STREAM but can be set with
28392 * g_socket_client_set_socket_type().
28394 * If a local address is specified with g_socket_client_set_local_address() the
28395 * socket will be bound to this address before connecting.
28397 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28403 * g_socket_client_connect_async:
28404 * @client: a #GSocketClient
28405 * @connectable: a #GSocketConnectable specifying the remote address.
28406 * @cancellable: (allow-none): a #GCancellable, or %NULL
28407 * @callback: (scope async): a #GAsyncReadyCallback
28408 * @user_data: (closure): user data for the callback
28410 * This is the asynchronous version of g_socket_client_connect().
28412 * When the operation is finished @callback will be
28413 * called. You can then call g_socket_client_connect_finish() to get
28414 * the result of the operation.
28421 * g_socket_client_connect_finish:
28422 * @client: a #GSocketClient.
28423 * @result: a #GAsyncResult.
28424 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28426 * Finishes an async connect operation. See g_socket_client_connect_async()
28428 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28434 * g_socket_client_connect_to_host:
28435 * @client: a #GSocketClient
28436 * @host_and_port: the name and optionally port of the host to connect to
28437 * @default_port: the default port to connect to
28438 * @cancellable: (allow-none): a #GCancellable, or %NULL
28439 * @error: a pointer to a #GError, or %NULL
28441 * This is a helper function for g_socket_client_connect().
28443 * Attempts to create a TCP connection to the named host.
28445 * @host_and_port may be in any of a number of recognized formats; an IPv6
28446 * address, an IPv4 address, or a domain name (in which case a DNS
28447 * lookup is performed). Quoting with [] is supported for all address
28448 * types. A port override may be specified in the usual way with a
28449 * colon. Ports may be given as decimal numbers or symbolic names (in
28450 * which case an /etc/services lookup is performed).
28452 * If no port override is given in @host_and_port then @default_port will be
28453 * used as the port number to connect to.
28455 * In general, @host_and_port is expected to be provided by the user (allowing
28456 * them to give the hostname, and a port override if necessary) and
28457 * @default_port is expected to be provided by the application.
28459 * In the case that an IP address is given, a single connection
28460 * attempt is made. In the case that a name is given, multiple
28461 * connection attempts may be made, in turn and according to the
28462 * number of address records in DNS, until a connection succeeds.
28464 * Upon a successful connection, a new #GSocketConnection is constructed
28465 * and returned. The caller owns this new object and must drop their
28466 * reference to it when finished with it.
28468 * In the event of any failure (DNS error, service not found, no hosts
28469 * connectable) %NULL is returned and @error (if non-%NULL) is set
28472 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28478 * g_socket_client_connect_to_host_async:
28479 * @client: a #GSocketClient
28480 * @host_and_port: the name and optionally the port of the host to connect to
28481 * @default_port: the default port to connect to
28482 * @cancellable: (allow-none): a #GCancellable, or %NULL
28483 * @callback: (scope async): a #GAsyncReadyCallback
28484 * @user_data: (closure): user data for the callback
28486 * This is the asynchronous version of g_socket_client_connect_to_host().
28488 * When the operation is finished @callback will be
28489 * called. You can then call g_socket_client_connect_to_host_finish() to get
28490 * the result of the operation.
28497 * g_socket_client_connect_to_host_finish:
28498 * @client: a #GSocketClient.
28499 * @result: a #GAsyncResult.
28500 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28502 * Finishes an async connect operation. See g_socket_client_connect_to_host_async()
28504 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28510 * g_socket_client_connect_to_service:
28511 * @client: a #GSocketConnection
28512 * @domain: a domain name
28513 * @service: the name of the service to connect to
28514 * @cancellable: (allow-none): a #GCancellable, or %NULL
28515 * @error: a pointer to a #GError, or %NULL
28517 * Attempts to create a TCP connection to a service.
28519 * This call looks up the SRV record for @service at @domain for the
28520 * "tcp" protocol. It then attempts to connect, in turn, to each of
28521 * the hosts providing the service until either a connection succeeds
28522 * or there are no hosts remaining.
28524 * Upon a successful connection, a new #GSocketConnection is constructed
28525 * and returned. The caller owns this new object and must drop their
28526 * reference to it when finished with it.
28528 * In the event of any failure (DNS error, service not found, no hosts
28529 * connectable) %NULL is returned and @error (if non-%NULL) is set
28532 * Returns: (transfer full): a #GSocketConnection if successful, or %NULL on error
28537 * g_socket_client_connect_to_service_async:
28538 * @client: a #GSocketClient
28539 * @domain: a domain name
28540 * @service: the name of the service to connect to
28541 * @cancellable: (allow-none): a #GCancellable, or %NULL
28542 * @callback: (scope async): a #GAsyncReadyCallback
28543 * @user_data: (closure): user data for the callback
28545 * This is the asynchronous version of
28546 * g_socket_client_connect_to_service().
28553 * g_socket_client_connect_to_service_finish:
28554 * @client: a #GSocketClient.
28555 * @result: a #GAsyncResult.
28556 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28558 * Finishes an async connect operation. See g_socket_client_connect_to_service_async()
28560 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28566 * g_socket_client_connect_to_uri:
28567 * @client: a #GSocketClient
28568 * @uri: A network URI
28569 * @default_port: the default port to connect to
28570 * @cancellable: (allow-none): a #GCancellable, or %NULL
28571 * @error: a pointer to a #GError, or %NULL
28573 * This is a helper function for g_socket_client_connect().
28575 * Attempts to create a TCP connection with a network URI.
28577 * @uri may be any valid URI containing an "authority" (hostname/port)
28578 * component. If a port is not specified in the URI, @default_port
28579 * will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
28580 * (#GSocketClient does not know to automatically assume TLS for
28581 * certain URI schemes.)
28583 * Using this rather than g_socket_client_connect() or
28584 * g_socket_client_connect_to_host() allows #GSocketClient to
28585 * determine when to use application-specific proxy protocols.
28587 * Upon a successful connection, a new #GSocketConnection is constructed
28588 * and returned. The caller owns this new object and must drop their
28589 * reference to it when finished with it.
28591 * In the event of any failure (DNS error, service not found, no hosts
28592 * connectable) %NULL is returned and @error (if non-%NULL) is set
28595 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28601 * g_socket_client_connect_to_uri_async:
28602 * @client: a #GSocketClient
28603 * @uri: a network uri
28604 * @default_port: the default port to connect to
28605 * @cancellable: (allow-none): a #GCancellable, or %NULL
28606 * @callback: (scope async): a #GAsyncReadyCallback
28607 * @user_data: (closure): user data for the callback
28609 * This is the asynchronous version of g_socket_client_connect_to_uri().
28611 * When the operation is finished @callback will be
28612 * called. You can then call g_socket_client_connect_to_uri_finish() to get
28613 * the result of the operation.
28620 * g_socket_client_connect_to_uri_finish:
28621 * @client: a #GSocketClient.
28622 * @result: a #GAsyncResult.
28623 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28625 * Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
28627 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28633 * g_socket_client_get_enable_proxy:
28634 * @client: a #GSocketClient.
28636 * Gets the proxy enable state; see g_socket_client_set_enable_proxy()
28638 * Returns: whether proxying is enabled
28644 * g_socket_client_get_family:
28645 * @client: a #GSocketClient.
28647 * Gets the socket family of the socket client.
28649 * See g_socket_client_set_family() for details.
28651 * Returns: a #GSocketFamily
28657 * g_socket_client_get_local_address:
28658 * @client: a #GSocketClient.
28660 * Gets the local address of the socket client.
28662 * See g_socket_client_set_local_address() for details.
28664 * Returns: (transfer none): a #GSocketAddress or %NULL. Do not free.
28670 * g_socket_client_get_protocol:
28671 * @client: a #GSocketClient
28673 * Gets the protocol name type of the socket client.
28675 * See g_socket_client_set_protocol() for details.
28677 * Returns: a #GSocketProtocol
28683 * g_socket_client_get_proxy_resolver:
28684 * @client: a #GSocketClient.
28686 * Gets the #GProxyResolver being used by @client. Normally, this will
28687 * be the resolver returned by g_proxy_resolver_get_default(), but you
28688 * can override it with g_socket_client_set_proxy_resolver().
28690 * Returns: (transfer none): The #GProxyResolver being used by @client.
28696 * g_socket_client_get_socket_type:
28697 * @client: a #GSocketClient.
28699 * Gets the socket type of the socket client.
28701 * See g_socket_client_set_socket_type() for details.
28703 * Returns: a #GSocketFamily
28709 * g_socket_client_get_timeout:
28710 * @client: a #GSocketClient
28712 * Gets the I/O timeout time for sockets created by @client.
28714 * See g_socket_client_set_timeout() for details.
28716 * Returns: the timeout in seconds
28722 * g_socket_client_get_tls:
28723 * @client: a #GSocketClient.
28725 * Gets whether @client creates TLS connections. See
28726 * g_socket_client_set_tls() for details.
28728 * Returns: whether @client uses TLS
28734 * g_socket_client_get_tls_validation_flags:
28735 * @client: a #GSocketClient.
28737 * Gets the TLS validation flags used creating TLS connections via
28740 * Returns: the TLS validation flags
28746 * g_socket_client_new:
28748 * Creates a new #GSocketClient with the default options.
28750 * Returns: a #GSocketClient. Free the returned object with g_object_unref().
28756 * g_socket_client_set_enable_proxy:
28757 * @client: a #GSocketClient.
28758 * @enable: whether to enable proxies
28760 * Sets whether or not @client attempts to make connections via a
28761 * proxy server. When enabled (the default), #GSocketClient will use a
28762 * #GProxyResolver to determine if a proxy protocol such as SOCKS is
28763 * needed, and automatically do the necessary proxy negotiation.
28765 * See also g_socket_client_set_proxy_resolver().
28772 * g_socket_client_set_family:
28773 * @client: a #GSocketClient.
28774 * @family: a #GSocketFamily
28776 * Sets the socket family of the socket client.
28777 * If this is set to something other than %G_SOCKET_FAMILY_INVALID
28778 * then the sockets created by this object will be of the specified
28781 * This might be useful for instance if you want to force the local
28782 * connection to be an ipv4 socket, even though the address might
28783 * be an ipv6 mapped to ipv4 address.
28790 * g_socket_client_set_local_address:
28791 * @client: a #GSocketClient.
28792 * @address: (allow-none): a #GSocketAddress, or %NULL
28794 * Sets the local address of the socket client.
28795 * The sockets created by this object will bound to the
28796 * specified address (if not %NULL) before connecting.
28798 * This is useful if you want to ensure that the local
28799 * side of the connection is on a specific port, or on
28800 * a specific interface.
28807 * g_socket_client_set_protocol:
28808 * @client: a #GSocketClient.
28809 * @protocol: a #GSocketProtocol
28811 * Sets the protocol of the socket client.
28812 * The sockets created by this object will use of the specified
28815 * If @protocol is %0 that means to use the default
28816 * protocol for the socket family and type.
28823 * g_socket_client_set_proxy_resolver:
28824 * @client: a #GSocketClient.
28825 * @proxy_resolver: (allow-none): a #GProxyResolver, or %NULL for the default.
28827 * Overrides the #GProxyResolver used by @client. You can call this if
28828 * you want to use specific proxies, rather than using the system
28829 * default proxy settings.
28831 * Note that whether or not the proxy resolver is actually used
28832 * depends on the setting of #GSocketClient:enable-proxy, which is not
28833 * changed by this function (but which is %TRUE by default)
28840 * g_socket_client_set_socket_type:
28841 * @client: a #GSocketClient.
28842 * @type: a #GSocketType
28844 * Sets the socket type of the socket client.
28845 * The sockets created by this object will be of the specified
28848 * It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
28849 * as GSocketClient is used for connection oriented services.
28856 * g_socket_client_set_timeout:
28857 * @client: a #GSocketClient.
28858 * @timeout: the timeout
28860 * Sets the I/O timeout for sockets created by @client. @timeout is a
28861 * time in seconds, or 0 for no timeout (the default).
28863 * The timeout value affects the initial connection attempt as well,
28864 * so setting this may cause calls to g_socket_client_connect(), etc,
28865 * to fail with %G_IO_ERROR_TIMED_OUT.
28872 * g_socket_client_set_tls:
28873 * @client: a #GSocketClient.
28874 * @tls: whether to use TLS
28876 * Sets whether @client creates TLS (aka SSL) connections. If @tls is
28877 * %TRUE, @client will wrap its connections in a #GTlsClientConnection
28878 * and perform a TLS handshake when connecting.
28880 * Note that since #GSocketClient must return a #GSocketConnection,
28881 * but #GTlsClientConnection is not a #GSocketConnection, this
28882 * actually wraps the resulting #GTlsClientConnection in a
28883 * #GTcpWrapperConnection when returning it. You can use
28884 * g_tcp_wrapper_connection_get_base_io_stream() on the return value
28885 * to extract the #GTlsClientConnection.
28887 * If you need to modify the behavior of the TLS handshake (eg, by
28888 * setting a client-side certificate to use, or connecting to the
28889 * #GTlsConnection::accept-certificate signal), you can connect to
28890 * @client's #GSocketClient::event signal and wait for it to be
28891 * emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
28892 * a chance to see the #GTlsClientConnection before the handshake
28900 * g_socket_client_set_tls_validation_flags:
28901 * @client: a #GSocketClient.
28902 * @flags: the validation flags
28904 * Sets the TLS validation flags used when creating TLS connections
28905 * via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
28913 * @socket: a #GSocket
28914 * @error: #GError for error reporting, or %NULL to ignore.
28916 * Closes the socket, shutting down any active connection.
28918 * Closing a socket does not wait for all outstanding I/O operations
28919 * to finish, so the caller should not rely on them to be guaranteed
28920 * to complete even if the close returns with no error.
28922 * Once the socket is closed, all other operations will return
28923 * %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
28926 * Sockets will be automatically closed when the last reference
28927 * is dropped, but you might want to call this function to make sure
28928 * resources are released as early as possible.
28930 * Beware that due to the way that TCP works, it is possible for
28931 * recently-sent data to be lost if either you close a socket while the
28932 * %G_IO_IN condition is set, or else if the remote connection tries to
28933 * send something to you after you close the socket but before it has
28934 * finished reading all of the data you sent. There is no easy generic
28935 * way to avoid this problem; the easiest fix is to design the network
28936 * protocol such that the client will never send data "out of turn".
28937 * Another solution is for the server to half-close the connection by
28938 * calling g_socket_shutdown() with only the @shutdown_write flag set,
28939 * and then wait for the client to notice this and close its side of the
28940 * connection, after which the server can safely call g_socket_close().
28941 * (This is what #GTcpConnection does if you call
28942 * g_tcp_connection_set_graceful_disconnect(). But of course, this
28943 * only works if the client will close its connection after the server
28946 * Returns: %TRUE on success, %FALSE on error
28952 * g_socket_condition_check:
28953 * @socket: a #GSocket
28954 * @condition: a #GIOCondition mask to check
28956 * Checks on the readiness of @socket to perform operations.
28957 * The operations specified in @condition are checked for and masked
28958 * against the currently-satisfied conditions on @socket. The result
28961 * Note that on Windows, it is possible for an operation to return
28962 * %G_IO_ERROR_WOULD_BLOCK even immediately after
28963 * g_socket_condition_check() has claimed that the socket is ready for
28964 * writing. Rather than calling g_socket_condition_check() and then
28965 * writing to the socket if it succeeds, it is generally better to
28966 * simply try writing to the socket right away, and try again later if
28967 * the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
28969 * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
28970 * these conditions will always be set in the output if they are true.
28972 * This call never blocks.
28974 * Returns: the @GIOCondition mask of the current state
28980 * g_socket_condition_timed_wait:
28981 * @socket: a #GSocket
28982 * @condition: a #GIOCondition mask to wait for
28983 * @timeout: the maximum time (in microseconds) to wait, or -1
28984 * @cancellable: (allow-none): a #GCancellable, or %NULL
28985 * @error: a #GError pointer, or %NULL
28987 * Waits for up to @timeout microseconds for @condition to become true
28988 * on @socket. If the condition is met, %TRUE is returned.
28990 * If @cancellable is cancelled before the condition is met, or if
28991 * @timeout (or the socket's #GSocket:timeout) is reached before the
28992 * condition is met, then %FALSE is returned and @error, if non-%NULL,
28993 * is set to the appropriate value (%G_IO_ERROR_CANCELLED or
28994 * %G_IO_ERROR_TIMED_OUT).
28996 * If you don't want a timeout, use g_socket_condition_wait().
28997 * (Alternatively, you can pass -1 for @timeout.)
28999 * Note that although @timeout is in microseconds for consistency with
29000 * other GLib APIs, this function actually only has millisecond
29001 * resolution, and the behavior is undefined if @timeout is not an
29002 * exact number of milliseconds.
29004 * Returns: %TRUE if the condition was met, %FALSE otherwise
29010 * g_socket_condition_wait:
29011 * @socket: a #GSocket
29012 * @condition: a #GIOCondition mask to wait for
29013 * @cancellable: (allow-none): a #GCancellable, or %NULL
29014 * @error: a #GError pointer, or %NULL
29016 * Waits for @condition to become true on @socket. When the condition
29017 * is met, %TRUE is returned.
29019 * If @cancellable is cancelled before the condition is met, or if the
29020 * socket has a timeout set and it is reached before the condition is
29021 * met, then %FALSE is returned and @error, if non-%NULL, is set to
29022 * the appropriate value (%G_IO_ERROR_CANCELLED or
29023 * %G_IO_ERROR_TIMED_OUT).
29025 * See also g_socket_condition_timed_wait().
29027 * Returns: %TRUE if the condition was met, %FALSE otherwise
29033 * g_socket_connect:
29034 * @socket: a #GSocket.
29035 * @address: a #GSocketAddress specifying the remote address.
29036 * @cancellable: (allow-none): a %GCancellable or %NULL
29037 * @error: #GError for error reporting, or %NULL to ignore.
29039 * Connect the socket to the specified remote address.
29041 * For connection oriented socket this generally means we attempt to make
29042 * a connection to the @address. For a connection-less socket it sets
29043 * the default address for g_socket_send() and discards all incoming datagrams
29044 * from other sources.
29046 * Generally connection oriented sockets can only connect once, but
29047 * connection-less sockets can connect multiple times to change the
29050 * If the connect call needs to do network I/O it will block, unless
29051 * non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
29052 * and the user can be notified of the connection finishing by waiting
29053 * for the G_IO_OUT condition. The result of the connection must then be
29054 * checked with g_socket_check_connect_result().
29056 * Returns: %TRUE if connected, %FALSE on error.
29062 * g_socket_connectable_enumerate:
29063 * @connectable: a #GSocketConnectable
29065 * Creates a #GSocketAddressEnumerator for @connectable.
29067 * Returns: (transfer full): a new #GSocketAddressEnumerator.
29073 * g_socket_connectable_proxy_enumerate:
29074 * @connectable: a #GSocketConnectable
29076 * Creates a #GSocketAddressEnumerator for @connectable that will
29077 * return #GProxyAddress<!-- -->es for addresses that you must connect
29080 * If @connectable does not implement
29081 * g_socket_connectable_proxy_enumerate(), this will fall back to
29082 * calling g_socket_connectable_enumerate().
29084 * Returns: (transfer full): a new #GSocketAddressEnumerator.
29090 * g_socket_connection_connect:
29091 * @connection: a #GSocketConnection
29092 * @address: a #GSocketAddress specifying the remote address.
29093 * @cancellable: (allow-none): a %GCancellable or %NULL
29094 * @error: #GError for error reporting, or %NULL to ignore.
29096 * Connect @connection to the specified remote address.
29098 * Returns: %TRUE if the connection succeeded, %FALSE on error
29104 * g_socket_connection_connect_async:
29105 * @connection: a #GSocketConnection
29106 * @address: a #GSocketAddress specifying the remote address.
29107 * @cancellable: (allow-none): a %GCancellable or %NULL
29108 * @callback: (scope async): a #GAsyncReadyCallback
29109 * @user_data: (closure): user data for the callback
29111 * Asynchronously connect @connection to the specified remote address.
29113 * This clears the #GSocket:blocking flag on @connection's underlying
29114 * socket if it is currently set.
29116 * Use g_socket_connection_connect_finish() to retrieve the result.
29123 * g_socket_connection_connect_finish:
29124 * @connection: a #GSocketConnection
29125 * @result: the #GAsyncResult
29126 * @error: #GError for error reporting, or %NULL to ignore.
29128 * Gets the result of a g_socket_connection_connect_async() call.
29130 * Returns: %TRUE if the connection succeeded, %FALSE on error
29136 * g_socket_connection_factory_create_connection:
29137 * @socket: a #GSocket
29139 * Creates a #GSocketConnection subclass of the right type for
29142 * Returns: (transfer full): a #GSocketConnection
29148 * g_socket_connection_factory_lookup_type:
29149 * @family: a #GSocketFamily
29150 * @type: a #GSocketType
29151 * @protocol_id: a protocol id
29153 * Looks up the #GType to be used when creating socket connections on
29154 * sockets with the specified @family, @type and @protocol_id.
29156 * If no type is registered, the #GSocketConnection base type is returned.
29158 * Returns: a #GType
29164 * g_socket_connection_factory_register_type:
29165 * @g_type: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
29166 * @family: a #GSocketFamily
29167 * @type: a #GSocketType
29168 * @protocol: a protocol id
29170 * Looks up the #GType to be used when creating socket connections on
29171 * sockets with the specified @family, @type and @protocol.
29173 * If no type is registered, the #GSocketConnection base type is returned.
29180 * g_socket_connection_get_local_address:
29181 * @connection: a #GSocketConnection
29182 * @error: #GError for error reporting, or %NULL to ignore.
29184 * Try to get the local address of a socket connection.
29186 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29192 * g_socket_connection_get_remote_address:
29193 * @connection: a #GSocketConnection
29194 * @error: #GError for error reporting, or %NULL to ignore.
29196 * Try to get the remote address of a socket connection.
29198 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29204 * g_socket_connection_get_socket:
29205 * @connection: a #GSocketConnection
29207 * Gets the underlying #GSocket object of the connection.
29208 * This can be useful if you want to do something unusual on it
29209 * not supported by the #GSocketConnection APIs.
29211 * Returns: (transfer none): a #GSocketAddress or %NULL on error.
29217 * g_socket_connection_is_connected:
29218 * @connection: a #GSocketConnection
29220 * Checks if @connection is connected. This is equivalent to calling
29221 * g_socket_is_connected() on @connection's underlying #GSocket.
29223 * Returns: whether @connection is connected
29229 * g_socket_control_message_deserialize:
29230 * @level: a socket level
29231 * @type: a socket control message type for the given @level
29232 * @size: the size of the data in bytes
29233 * @data: (array length=size) (element-type guint8): pointer to the message data
29235 * Tries to deserialize a socket control message of a given
29236 * @level and @type. This will ask all known (to GType) subclasses
29237 * of #GSocketControlMessage if they can understand this kind
29238 * of message and if so deserialize it into a #GSocketControlMessage.
29240 * If there is no implementation for this kind of control message, %NULL
29241 * will be returned.
29243 * Returns: (transfer full): the deserialized message or %NULL
29249 * g_socket_control_message_get_level:
29250 * @message: a #GSocketControlMessage
29252 * Returns the "level" (i.e. the originating protocol) of the control message.
29253 * This is often SOL_SOCKET.
29255 * Returns: an integer describing the level
29261 * g_socket_control_message_get_msg_type:
29262 * @message: a #GSocketControlMessage
29264 * Returns the protocol specific type of the control message.
29265 * For instance, for UNIX fd passing this would be SCM_RIGHTS.
29267 * Returns: an integer describing the type of control message
29273 * g_socket_control_message_get_size:
29274 * @message: a #GSocketControlMessage
29276 * Returns the space required for the control message, not including
29277 * headers or alignment.
29279 * Returns: The number of bytes required.
29285 * g_socket_control_message_serialize:
29286 * @message: a #GSocketControlMessage
29287 * @data: A buffer to write data to
29289 * Converts the data in the message to bytes placed in the
29292 * @data is guaranteed to have enough space to fit the size
29293 * returned by g_socket_control_message_get_size() on this
29301 * g_socket_create_source: (skip)
29302 * @socket: a #GSocket
29303 * @condition: a #GIOCondition mask to monitor
29304 * @cancellable: (allow-none): a %GCancellable or %NULL
29306 * Creates a %GSource that can be attached to a %GMainContext to monitor
29307 * for the availibility of the specified @condition on the socket.
29309 * The callback on the source is of the #GSocketSourceFunc type.
29311 * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
29312 * these conditions will always be reported output if they are true.
29314 * @cancellable if not %NULL can be used to cancel the source, which will
29315 * cause the source to trigger, reporting the current condition (which
29316 * is likely 0 unless cancellation happened at the same time as a
29317 * condition change). You can check for this in the callback using
29318 * g_cancellable_is_cancelled().
29320 * If @socket has a timeout set, and it is reached before @condition
29321 * occurs, the source will then trigger anyway, reporting %G_IO_IN or
29322 * %G_IO_OUT depending on @condition. However, @socket will have been
29323 * marked as having had a timeout, and so the next #GSocket I/O method
29324 * you call will then fail with a %G_IO_ERROR_TIMED_OUT.
29326 * Returns: (transfer full): a newly allocated %GSource, free with g_source_unref().
29332 * g_socket_get_available_bytes:
29333 * @socket: a #GSocket
29335 * Get the amount of data pending in the OS input buffer.
29337 * If @socket is a UDP or SCTP socket, this will return the size of
29338 * just the next packet, even if additional packets are buffered after
29341 * Note that on Windows, this function is rather inefficient in the
29342 * UDP case, and so if you know any plausible upper bound on the size
29343 * of the incoming packet, it is better to just do a
29344 * g_socket_receive() with a buffer of that size, rather than calling
29345 * g_socket_get_available_bytes() first and then doing a receive of
29346 * exactly the right size.
29348 * Returns: the number of bytes that can be read from the socket without blocking or truncating, or -1 on error.
29354 * g_socket_get_blocking:
29355 * @socket: a #GSocket.
29357 * Gets the blocking mode of the socket. For details on blocking I/O,
29358 * see g_socket_set_blocking().
29360 * Returns: %TRUE if blocking I/O is used, %FALSE otherwise.
29366 * g_socket_get_broadcast:
29367 * @socket: a #GSocket.
29369 * Gets the broadcast setting on @socket; if %TRUE,
29370 * it is possible to send packets to broadcast
29373 * Returns: the broadcast setting on @socket
29379 * g_socket_get_credentials:
29380 * @socket: a #GSocket.
29381 * @error: #GError for error reporting, or %NULL to ignore.
29383 * Returns the credentials of the foreign process connected to this
29384 * socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
29387 * If this operation isn't supported on the OS, the method fails with
29388 * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
29389 * by reading the %SO_PEERCRED option on the underlying socket.
29391 * Other ways to obtain credentials from a foreign peer includes the
29392 * #GUnixCredentialsMessage type and
29393 * g_unix_connection_send_credentials() /
29394 * g_unix_connection_receive_credentials() functions.
29396 * Returns: (transfer full): %NULL if @error is set, otherwise a #GCredentials object that must be freed with g_object_unref().
29402 * g_socket_get_family:
29403 * @socket: a #GSocket.
29405 * Gets the socket family of the socket.
29407 * Returns: a #GSocketFamily
29414 * @socket: a #GSocket.
29416 * Returns the underlying OS socket object. On unix this
29417 * is a socket file descriptor, and on Windows this is
29418 * a Winsock2 SOCKET handle. This may be useful for
29419 * doing platform specific or otherwise unusual operations
29422 * Returns: the file descriptor of the socket.
29428 * g_socket_get_keepalive:
29429 * @socket: a #GSocket.
29431 * Gets the keepalive mode of the socket. For details on this,
29432 * see g_socket_set_keepalive().
29434 * Returns: %TRUE if keepalive is active, %FALSE otherwise.
29440 * g_socket_get_listen_backlog:
29441 * @socket: a #GSocket.
29443 * Gets the listen backlog setting of the socket. For details on this,
29444 * see g_socket_set_listen_backlog().
29446 * Returns: the maximum number of pending connections.
29452 * g_socket_get_local_address:
29453 * @socket: a #GSocket.
29454 * @error: #GError for error reporting, or %NULL to ignore.
29456 * Try to get the local address of a bound socket. This is only
29457 * useful if the socket has been bound to a local address,
29458 * either explicitly or implicitly when connecting.
29460 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29466 * g_socket_get_multicast_loopback:
29467 * @socket: a #GSocket.
29469 * Gets the multicast loopback setting on @socket; if %TRUE (the
29470 * default), outgoing multicast packets will be looped back to
29471 * multicast listeners on the same host.
29473 * Returns: the multicast loopback setting on @socket
29479 * g_socket_get_multicast_ttl:
29480 * @socket: a #GSocket.
29482 * Gets the multicast time-to-live setting on @socket; see
29483 * g_socket_set_multicast_ttl() for more details.
29485 * Returns: the multicast time-to-live setting on @socket
29491 * g_socket_get_option:
29492 * @socket: a #GSocket
29493 * @level: the "API level" of the option (eg, <literal>SOL_SOCKET</literal>)
29494 * @optname: the "name" of the option (eg, <literal>SO_BROADCAST</literal>)
29495 * @value: (out): return location for the option value
29496 * @error: #GError for error reporting, or %NULL to ignore.
29498 * Gets the value of an integer-valued option on @socket, as with
29499 * <literal>getsockopt ()</literal>. (If you need to fetch a
29500 * non-integer-valued option, you will need to call
29501 * <literal>getsockopt ()</literal> directly.)
29503 * The <link linkend="gio-gnetworking.h"><literal><gio/gnetworking.h></literal></link>
29504 * header pulls in system headers that will define most of the
29505 * standard/portable socket options. For unusual socket protocols or
29506 * platform-dependent options, you may need to include additional
29509 * Note that even for socket options that are a single byte in size,
29510 * @value is still a pointer to a #gint variable, not a #guchar;
29511 * g_socket_get_option() will handle the conversion internally.
29513 * 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.
29519 * g_socket_get_protocol:
29520 * @socket: a #GSocket.
29522 * Gets the socket protocol id the socket was created with.
29523 * In case the protocol is unknown, -1 is returned.
29525 * Returns: a protocol id, or -1 if unknown
29531 * g_socket_get_remote_address:
29532 * @socket: a #GSocket.
29533 * @error: #GError for error reporting, or %NULL to ignore.
29535 * Try to get the remove address of a connected socket. This is only
29536 * useful for connection oriented sockets that have been connected.
29538 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29544 * g_socket_get_socket_type:
29545 * @socket: a #GSocket.
29547 * Gets the socket type of the socket.
29549 * Returns: a #GSocketType
29555 * g_socket_get_timeout:
29556 * @socket: a #GSocket.
29558 * Gets the timeout setting of the socket. For details on this, see
29559 * g_socket_set_timeout().
29561 * Returns: the timeout in seconds
29567 * g_socket_get_ttl:
29568 * @socket: a #GSocket.
29570 * Gets the unicast time-to-live setting on @socket; see
29571 * g_socket_set_ttl() for more details.
29573 * Returns: the time-to-live setting on @socket
29579 * g_socket_is_closed:
29580 * @socket: a #GSocket
29582 * Checks whether a socket is closed.
29584 * Returns: %TRUE if socket is closed, %FALSE otherwise
29590 * g_socket_is_connected:
29591 * @socket: a #GSocket.
29593 * Check whether the socket is connected. This is only useful for
29594 * connection-oriented sockets.
29596 * Returns: %TRUE if socket is connected, %FALSE otherwise.
29602 * g_socket_join_multicast_group:
29603 * @socket: a #GSocket.
29604 * @group: a #GInetAddress specifying the group address to join.
29605 * @iface: (allow-none): Name of the interface to use, or %NULL
29606 * @source_specific: %TRUE if source-specific multicast should be used
29607 * @error: #GError for error reporting, or %NULL to ignore.
29609 * Registers @socket to receive multicast messages sent to @group.
29610 * @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
29611 * been bound to an appropriate interface and port with
29614 * If @iface is %NULL, the system will automatically pick an interface
29615 * to bind to based on @group.
29617 * If @source_specific is %TRUE, source-specific multicast as defined
29618 * in RFC 4604 is used. Note that on older platforms this may fail
29619 * with a %G_IO_ERROR_NOT_SUPPORTED error.
29621 * Returns: %TRUE on success, %FALSE on error.
29627 * g_socket_leave_multicast_group:
29628 * @socket: a #GSocket.
29629 * @group: a #GInetAddress specifying the group address to leave.
29630 * @iface: (allow-none): Interface used
29631 * @source_specific: %TRUE if source-specific multicast was used
29632 * @error: #GError for error reporting, or %NULL to ignore.
29634 * Removes @socket from the multicast group defined by @group, @iface,
29635 * and @source_specific (which must all have the same values they had
29636 * when you joined the group).
29638 * @socket remains bound to its address and port, and can still receive
29639 * unicast messages after calling this.
29641 * Returns: %TRUE on success, %FALSE on error.
29648 * @socket: a #GSocket.
29649 * @error: #GError for error reporting, or %NULL to ignore.
29651 * Marks the socket as a server socket, i.e. a socket that is used
29652 * to accept incoming requests using g_socket_accept().
29654 * Before calling this the socket must be bound to a local address using
29657 * To set the maximum amount of outstanding clients, use
29658 * g_socket_set_listen_backlog().
29660 * Returns: %TRUE on success, %FALSE on error.
29666 * g_socket_listener_accept:
29667 * @listener: a #GSocketListener
29668 * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL
29669 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29670 * @error: #GError for error reporting, or %NULL to ignore.
29672 * Blocks waiting for a client to connect to any of the sockets added
29673 * to the listener. Returns a #GSocketConnection for the socket that was
29676 * If @source_object is not %NULL it will be filled out with the source
29677 * object specified when the corresponding socket or address was added
29680 * If @cancellable is not %NULL, then the operation can be cancelled by
29681 * triggering the cancellable object from another thread. If the operation
29682 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29684 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29690 * g_socket_listener_accept_async:
29691 * @listener: a #GSocketListener
29692 * @cancellable: (allow-none): a #GCancellable, or %NULL
29693 * @callback: (scope async): a #GAsyncReadyCallback
29694 * @user_data: (closure): user data for the callback
29696 * This is the asynchronous version of g_socket_listener_accept().
29698 * When the operation is finished @callback will be
29699 * called. You can then call g_socket_listener_accept_socket()
29700 * to get the result of the operation.
29707 * g_socket_listener_accept_finish:
29708 * @listener: a #GSocketListener
29709 * @result: a #GAsyncResult.
29710 * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29711 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29713 * Finishes an async accept operation. See g_socket_listener_accept_async()
29715 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29721 * g_socket_listener_accept_socket:
29722 * @listener: a #GSocketListener
29723 * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL.
29724 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29725 * @error: #GError for error reporting, or %NULL to ignore.
29727 * Blocks waiting for a client to connect to any of the sockets added
29728 * to the listener. Returns the #GSocket that was accepted.
29730 * If you want to accept the high-level #GSocketConnection, not a #GSocket,
29731 * which is often the case, then you should use g_socket_listener_accept()
29734 * If @source_object is not %NULL it will be filled out with the source
29735 * object specified when the corresponding socket or address was added
29738 * If @cancellable is not %NULL, then the operation can be cancelled by
29739 * triggering the cancellable object from another thread. If the operation
29740 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29742 * Returns: (transfer full): a #GSocket on success, %NULL on error.
29748 * g_socket_listener_accept_socket_async:
29749 * @listener: a #GSocketListener
29750 * @cancellable: (allow-none): a #GCancellable, or %NULL
29751 * @callback: (scope async): a #GAsyncReadyCallback
29752 * @user_data: (closure): user data for the callback
29754 * This is the asynchronous version of g_socket_listener_accept_socket().
29756 * When the operation is finished @callback will be
29757 * called. You can then call g_socket_listener_accept_socket_finish()
29758 * to get the result of the operation.
29765 * g_socket_listener_accept_socket_finish:
29766 * @listener: a #GSocketListener
29767 * @result: a #GAsyncResult.
29768 * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29769 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29771 * Finishes an async accept operation. See g_socket_listener_accept_socket_async()
29773 * Returns: (transfer full): a #GSocket on success, %NULL on error.
29779 * g_socket_listener_add_address:
29780 * @listener: a #GSocketListener
29781 * @address: a #GSocketAddress
29782 * @type: a #GSocketType
29783 * @protocol: a #GSocketProtocol
29784 * @source_object: (allow-none): Optional #GObject identifying this source
29785 * @effective_address: (out) (allow-none): location to store the address that was bound to, or %NULL.
29786 * @error: #GError for error reporting, or %NULL to ignore.
29788 * Creates a socket of type @type and protocol @protocol, binds
29789 * it to @address and adds it to the set of sockets we're accepting
29792 * Note that adding an IPv6 address, depending on the platform,
29793 * may or may not result in a listener that also accepts IPv4
29794 * connections. For more deterministic behavior, see
29795 * g_socket_listener_add_inet_port().
29797 * @source_object will be passed out in the various calls
29798 * to accept to identify this particular source, which is
29799 * useful if you're listening on multiple addresses and do
29800 * different things depending on what address is connected to.
29802 * If successful and @effective_address is non-%NULL then it will
29803 * be set to the address that the binding actually occurred at. This
29804 * is helpful for determining the port number that was used for when
29805 * requesting a binding to port 0 (ie: "any port"). This address, if
29806 * requested, belongs to the caller and must be freed.
29808 * Returns: %TRUE on success, %FALSE on error.
29814 * g_socket_listener_add_any_inet_port:
29815 * @listener: a #GSocketListener
29816 * @source_object: (allow-none): Optional #GObject identifying this source
29817 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29819 * Listens for TCP connections on any available port number for both
29820 * IPv6 and IPv4 (if each is available).
29822 * This is useful if you need to have a socket for incoming connections
29823 * but don't care about the specific port number.
29825 * @source_object will be passed out in the various calls
29826 * to accept to identify this particular source, which is
29827 * useful if you're listening on multiple addresses and do
29828 * different things depending on what address is connected to.
29830 * Returns: the port number, or 0 in case of failure.
29836 * g_socket_listener_add_inet_port:
29837 * @listener: a #GSocketListener
29838 * @port: an IP port number (non-zero)
29839 * @source_object: (allow-none): Optional #GObject identifying this source
29840 * @error: #GError for error reporting, or %NULL to ignore.
29842 * Helper function for g_socket_listener_add_address() that
29843 * creates a TCP/IP socket listening on IPv4 and IPv6 (if
29844 * supported) on the specified port on all interfaces.
29846 * @source_object will be passed out in the various calls
29847 * to accept to identify this particular source, which is
29848 * useful if you're listening on multiple addresses and do
29849 * different things depending on what address is connected to.
29851 * Returns: %TRUE on success, %FALSE on error.
29857 * g_socket_listener_add_socket:
29858 * @listener: a #GSocketListener
29859 * @socket: a listening #GSocket
29860 * @source_object: (allow-none): Optional #GObject identifying this source
29861 * @error: #GError for error reporting, or %NULL to ignore.
29863 * Adds @socket to the set of sockets that we try to accept
29864 * new clients from. The socket must be bound to a local
29865 * address and listened to.
29867 * @source_object will be passed out in the various calls
29868 * to accept to identify this particular source, which is
29869 * useful if you're listening on multiple addresses and do
29870 * different things depending on what address is connected to.
29872 * Returns: %TRUE on success, %FALSE on error.
29878 * g_socket_listener_close:
29879 * @listener: a #GSocketListener
29881 * Closes all the sockets in the listener.
29888 * g_socket_listener_new:
29890 * Creates a new #GSocketListener with no sockets to listen for.
29891 * New listeners can be added with e.g. g_socket_listener_add_address()
29892 * or g_socket_listener_add_inet_port().
29894 * Returns: a new #GSocketListener.
29900 * g_socket_listener_set_backlog:
29901 * @listener: a #GSocketListener
29902 * @listen_backlog: an integer
29904 * Sets the listen backlog on the sockets in the listener.
29906 * See g_socket_set_listen_backlog() for details
29914 * @family: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
29915 * @type: the socket type to use.
29916 * @protocol: the id of the protocol to use, or 0 for default.
29917 * @error: #GError for error reporting, or %NULL to ignore.
29919 * Creates a new #GSocket with the defined family, type and protocol.
29920 * If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
29921 * for the family and type is used.
29923 * The @protocol is a family and type specific int that specifies what
29924 * kind of protocol to use. #GSocketProtocol lists several common ones.
29925 * Many families only support one protocol, and use 0 for this, others
29926 * support several and using 0 means to use the default protocol for
29927 * the family and type.
29929 * The protocol id is passed directly to the operating
29930 * system, so you can use protocols not listed in #GSocketProtocol if you
29931 * know the protocol number used for it.
29933 * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29939 * g_socket_new_from_fd:
29940 * @fd: a native socket file descriptor.
29941 * @error: #GError for error reporting, or %NULL to ignore.
29943 * Creates a new #GSocket from a native file descriptor
29944 * or winsock SOCKET handle.
29946 * This reads all the settings from the file descriptor so that
29947 * all properties should work. Note that the file descriptor
29948 * will be set to non-blocking mode, independent on the blocking
29949 * mode of the #GSocket.
29951 * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29957 * g_socket_receive:
29958 * @socket: a #GSocket
29959 * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29960 * @size: the number of bytes you want to read from the socket
29961 * @cancellable: (allow-none): a %GCancellable or %NULL
29962 * @error: #GError for error reporting, or %NULL to ignore.
29964 * Receive data (up to @size bytes) from a socket. This is mainly used by
29965 * connection-oriented sockets; it is identical to g_socket_receive_from()
29966 * with @address set to %NULL.
29968 * For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
29969 * g_socket_receive() will always read either 0 or 1 complete messages from
29970 * the socket. If the received message is too large to fit in @buffer, then
29971 * the data beyond @size bytes will be discarded, without any explicit
29972 * indication that this has occurred.
29974 * For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
29975 * number of bytes, up to @size. If more than @size bytes have been
29976 * received, the additional data will be returned in future calls to
29977 * g_socket_receive().
29979 * If the socket is in blocking mode the call will block until there
29980 * is some data to receive, the connection is closed, or there is an
29981 * error. If there is no data available and the socket is in
29982 * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29983 * returned. To be notified when data is available, wait for the
29984 * %G_IO_IN condition.
29986 * On error -1 is returned and @error is set accordingly.
29988 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29994 * g_socket_receive_from:
29995 * @socket: a #GSocket
29996 * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29997 * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29998 * @size: the number of bytes you want to read from the socket
29999 * @cancellable: (allow-none): a %GCancellable or %NULL
30000 * @error: #GError for error reporting, or %NULL to ignore.
30002 * Receive data (up to @size bytes) from a socket.
30004 * If @address is non-%NULL then @address will be set equal to the
30005 * source address of the received packet.
30006 * @address is owned by the caller.
30008 * See g_socket_receive() for additional information.
30010 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30016 * g_socket_receive_message:
30017 * @socket: a #GSocket
30018 * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
30019 * @vectors: (array length=num_vectors): an array of #GInputVector structs
30020 * @num_vectors: the number of elements in @vectors, or -1
30021 * @messages: (array length=num_messages) (allow-none): a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
30022 * @num_messages: a pointer which will be filled with the number of elements in @messages, or %NULL
30023 * @flags: a pointer to an int containing #GSocketMsgFlags flags
30024 * @cancellable: (allow-none): a %GCancellable or %NULL
30025 * @error: a #GError pointer, or %NULL
30027 * Receive data from a socket. This is the most complicated and
30028 * fully-featured version of this call. For easier use, see
30029 * g_socket_receive() and g_socket_receive_from().
30031 * If @address is non-%NULL then @address will be set equal to the
30032 * source address of the received packet.
30033 * @address is owned by the caller.
30035 * @vector must point to an array of #GInputVector structs and
30036 * @num_vectors must be the length of this array. These structs
30037 * describe the buffers that received data will be scattered into.
30038 * If @num_vectors is -1, then @vectors is assumed to be terminated
30039 * by a #GInputVector with a %NULL buffer pointer.
30041 * As a special case, if @num_vectors is 0 (in which case, @vectors
30042 * may of course be %NULL), then a single byte is received and
30043 * discarded. This is to facilitate the common practice of sending a
30044 * single '\0' byte for the purposes of transferring ancillary data.
30046 * @messages, if non-%NULL, will be set to point to a newly-allocated
30047 * array of #GSocketControlMessage instances or %NULL if no such
30048 * messages was received. These correspond to the control messages
30049 * received from the kernel, one #GSocketControlMessage per message
30050 * from the kernel. This array is %NULL-terminated and must be freed
30051 * by the caller using g_free() after calling g_object_unref() on each
30052 * element. If @messages is %NULL, any control messages received will
30055 * @num_messages, if non-%NULL, will be set to the number of control
30056 * messages received.
30058 * If both @messages and @num_messages are non-%NULL, then
30059 * @num_messages gives the number of #GSocketControlMessage instances
30060 * in @messages (ie: not including the %NULL terminator).
30062 * @flags is an in/out parameter. The commonly available arguments
30063 * for this are available in the #GSocketMsgFlags enum, but the
30064 * values there are the same as the system values, and the flags
30065 * are passed in as-is, so you can pass in system-specific flags too
30066 * (and g_socket_receive_message() may pass system-specific flags out).
30068 * As with g_socket_receive(), data may be discarded if @socket is
30069 * %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
30070 * provide enough buffer space to read a complete message. You can pass
30071 * %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
30072 * removing it from the receive queue, but there is no portable way to find
30073 * out the length of the message other than by reading it into a
30074 * sufficiently-large buffer.
30076 * If the socket is in blocking mode the call will block until there
30077 * is some data to receive, the connection is closed, or there is an
30078 * error. If there is no data available and the socket is in
30079 * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
30080 * returned. To be notified when data is available, wait for the
30081 * %G_IO_IN condition.
30083 * On error -1 is returned and @error is set accordingly.
30085 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30091 * g_socket_receive_with_blocking:
30092 * @socket: a #GSocket
30093 * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
30094 * @size: the number of bytes you want to read from the socket
30095 * @blocking: whether to do blocking or non-blocking I/O
30096 * @cancellable: (allow-none): a %GCancellable or %NULL
30097 * @error: #GError for error reporting, or %NULL to ignore.
30099 * This behaves exactly the same as g_socket_receive(), except that
30100 * the choice of blocking or non-blocking behavior is determined by
30101 * the @blocking argument rather than by @socket's properties.
30103 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
30110 * @socket: a #GSocket
30111 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
30112 * @size: the number of bytes to send
30113 * @cancellable: (allow-none): a %GCancellable or %NULL
30114 * @error: #GError for error reporting, or %NULL to ignore.
30116 * Tries to send @size bytes from @buffer on the socket. This is
30117 * mainly used by connection-oriented sockets; it is identical to
30118 * g_socket_send_to() with @address set to %NULL.
30120 * If the socket is in blocking mode the call will block until there is
30121 * space for the data in the socket queue. If there is no space available
30122 * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
30123 * will be returned. To be notified when space is available, wait for the
30124 * %G_IO_OUT condition. Note though that you may still receive
30125 * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
30126 * notified of a %G_IO_OUT condition. (On Windows in particular, this is
30127 * very common due to the way the underlying APIs work.)
30129 * On error -1 is returned and @error is set accordingly.
30131 * Returns: Number of bytes written (which may be less than @size), or -1 on error
30137 * g_socket_send_message:
30138 * @socket: a #GSocket
30139 * @address: (allow-none): a #GSocketAddress, or %NULL
30140 * @vectors: (array length=num_vectors): an array of #GOutputVector structs
30141 * @num_vectors: the number of elements in @vectors, or -1
30142 * @messages: (array length=num_messages) (allow-none): a pointer to an array of #GSocketControlMessages, or %NULL.
30143 * @num_messages: number of elements in @messages, or -1.
30144 * @flags: an int containing #GSocketMsgFlags flags
30145 * @cancellable: (allow-none): a %GCancellable or %NULL
30146 * @error: #GError for error reporting, or %NULL to ignore.
30148 * Send data to @address on @socket. This is the most complicated and
30149 * fully-featured version of this call. For easier use, see
30150 * g_socket_send() and g_socket_send_to().
30152 * If @address is %NULL then the message is sent to the default receiver
30153 * (set by g_socket_connect()).
30155 * @vectors must point to an array of #GOutputVector structs and
30156 * @num_vectors must be the length of this array. (If @num_vectors is -1,
30157 * then @vectors is assumed to be terminated by a #GOutputVector with a
30158 * %NULL buffer pointer.) The #GOutputVector structs describe the buffers
30159 * that the sent data will be gathered from. Using multiple
30160 * #GOutputVector<!-- -->s is more memory-efficient than manually copying
30161 * data from multiple sources into a single buffer, and more
30162 * network-efficient than making multiple calls to g_socket_send().
30164 * @messages, if non-%NULL, is taken to point to an array of @num_messages
30165 * #GSocketControlMessage instances. These correspond to the control
30166 * messages to be sent on the socket.
30167 * If @num_messages is -1 then @messages is treated as a %NULL-terminated
30170 * @flags modify how the message is sent. The commonly available arguments
30171 * for this are available in the #GSocketMsgFlags enum, but the
30172 * values there are the same as the system values, and the flags
30173 * are passed in as-is, so you can pass in system-specific flags too.
30175 * If the socket is in blocking mode the call will block until there is
30176 * space for the data in the socket queue. If there is no space available
30177 * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
30178 * will be returned. To be notified when space is available, wait for the
30179 * %G_IO_OUT condition. Note though that you may still receive
30180 * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
30181 * notified of a %G_IO_OUT condition. (On Windows in particular, this is
30182 * very common due to the way the underlying APIs work.)
30184 * On error -1 is returned and @error is set accordingly.
30186 * Returns: Number of bytes written (which may be less than @size), or -1 on error
30192 * g_socket_send_to:
30193 * @socket: a #GSocket
30194 * @address: (allow-none): a #GSocketAddress, or %NULL
30195 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
30196 * @size: the number of bytes to send
30197 * @cancellable: (allow-none): a %GCancellable or %NULL
30198 * @error: #GError for error reporting, or %NULL to ignore.
30200 * Tries to send @size bytes from @buffer to @address. If @address is
30201 * %NULL then the message is sent to the default receiver (set by
30202 * g_socket_connect()).
30204 * See g_socket_send() for additional information.
30206 * Returns: Number of bytes written (which may be less than @size), or -1 on error
30212 * g_socket_send_with_blocking:
30213 * @socket: a #GSocket
30214 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
30215 * @size: the number of bytes to send
30216 * @blocking: whether to do blocking or non-blocking I/O
30217 * @cancellable: (allow-none): a %GCancellable or %NULL
30218 * @error: #GError for error reporting, or %NULL to ignore.
30220 * This behaves exactly the same as g_socket_send(), except that
30221 * the choice of blocking or non-blocking behavior is determined by
30222 * the @blocking argument rather than by @socket's properties.
30224 * Returns: Number of bytes written (which may be less than @size), or -1 on error
30230 * g_socket_service_is_active:
30231 * @service: a #GSocketService
30233 * Check whether the service is active or not. An active
30234 * service will accept new clients that connect, while
30235 * a non-active service will let connecting clients queue
30236 * up until the service is started.
30238 * Returns: %TRUE if the service is active, %FALSE otherwise
30244 * g_socket_service_new:
30246 * Creates a new #GSocketService with no sockets to listen for.
30247 * New listeners can be added with e.g. g_socket_listener_add_address()
30248 * or g_socket_listener_add_inet_port().
30250 * Returns: a new #GSocketService.
30256 * g_socket_service_start:
30257 * @service: a #GSocketService
30259 * Starts the service, i.e. start accepting connections
30260 * from the added sockets when the mainloop runs.
30262 * This call is thread-safe, so it may be called from a thread
30263 * handling an incoming client request.
30270 * g_socket_service_stop:
30271 * @service: a #GSocketService
30273 * Stops the service, i.e. stops accepting connections
30274 * from the added sockets when the mainloop runs.
30276 * This call is thread-safe, so it may be called from a thread
30277 * handling an incoming client request.
30284 * g_socket_set_blocking:
30285 * @socket: a #GSocket.
30286 * @blocking: Whether to use blocking I/O or not.
30288 * Sets the blocking mode of the socket. In blocking mode
30289 * all operations block until they succeed or there is an error. In
30290 * non-blocking mode all functions return results immediately or
30291 * with a %G_IO_ERROR_WOULD_BLOCK error.
30293 * All sockets are created in blocking mode. However, note that the
30294 * platform level socket is always non-blocking, and blocking mode
30295 * is a GSocket level feature.
30302 * g_socket_set_broadcast:
30303 * @socket: a #GSocket.
30304 * @broadcast: whether @socket should allow sending to broadcast addresses
30306 * Sets whether @socket should allow sending to broadcast addresses.
30307 * This is %FALSE by default.
30314 * g_socket_set_keepalive:
30315 * @socket: a #GSocket.
30316 * @keepalive: Value for the keepalive flag
30318 * Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
30319 * this flag is set on a socket, the system will attempt to verify that the
30320 * remote socket endpoint is still present if a sufficiently long period of
30321 * time passes with no data being exchanged. If the system is unable to
30322 * verify the presence of the remote endpoint, it will automatically close
30325 * This option is only functional on certain kinds of sockets. (Notably,
30326 * %G_SOCKET_PROTOCOL_TCP sockets.)
30328 * The exact time between pings is system- and protocol-dependent, but will
30329 * normally be at least two hours. Most commonly, you would set this flag
30330 * on a server socket if you want to allow clients to remain idle for long
30331 * periods of time, but also want to ensure that connections are eventually
30332 * garbage-collected if clients crash or become unreachable.
30339 * g_socket_set_listen_backlog:
30340 * @socket: a #GSocket.
30341 * @backlog: the maximum number of pending connections.
30343 * Sets the maximum number of outstanding connections allowed
30344 * when listening on this socket. If more clients than this are
30345 * connecting to the socket and the application is not handling them
30346 * on time then the new connections will be refused.
30348 * Note that this must be called before g_socket_listen() and has no
30349 * effect if called after that.
30356 * g_socket_set_multicast_loopback:
30357 * @socket: a #GSocket.
30358 * @loopback: whether @socket should receive messages sent to its multicast groups from the local host
30360 * Sets whether outgoing multicast packets will be received by sockets
30361 * listening on that multicast address on the same host. This is %TRUE
30369 * g_socket_set_multicast_ttl:
30370 * @socket: a #GSocket.
30371 * @ttl: the time-to-live value for all multicast datagrams on @socket
30373 * Sets the time-to-live for outgoing multicast datagrams on @socket.
30374 * By default, this is 1, meaning that multicast packets will not leave
30375 * the local network.
30382 * g_socket_set_option:
30383 * @socket: a #GSocket
30384 * @level: the "API level" of the option (eg, <literal>SOL_SOCKET</literal>)
30385 * @optname: the "name" of the option (eg, <literal>SO_BROADCAST</literal>)
30386 * @value: the value to set the option to
30387 * @error: #GError for error reporting, or %NULL to ignore.
30389 * Sets the value of an integer-valued option on @socket, as with
30390 * <literal>setsockopt ()</literal>. (If you need to set a
30391 * non-integer-valued option, you will need to call
30392 * <literal>setsockopt ()</literal> directly.)
30394 * The <link linkend="gio-gnetworking.h"><literal><gio/gnetworking.h></literal></link>
30395 * header pulls in system headers that will define most of the
30396 * standard/portable socket options. For unusual socket protocols or
30397 * platform-dependent options, you may need to include additional
30400 * 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.
30406 * g_socket_set_timeout:
30407 * @socket: a #GSocket.
30408 * @timeout: the timeout for @socket, in seconds, or 0 for none
30410 * Sets the time in seconds after which I/O operations on @socket will
30411 * time out if they have not yet completed.
30413 * On a blocking socket, this means that any blocking #GSocket
30414 * operation will time out after @timeout seconds of inactivity,
30415 * returning %G_IO_ERROR_TIMED_OUT.
30417 * On a non-blocking socket, calls to g_socket_condition_wait() will
30418 * also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
30419 * created with g_socket_create_source() will trigger after
30420 * @timeout seconds of inactivity, with the requested condition
30421 * set, at which point calling g_socket_receive(), g_socket_send(),
30422 * g_socket_check_connect_result(), etc, will fail with
30423 * %G_IO_ERROR_TIMED_OUT.
30425 * If @timeout is 0 (the default), operations will never time out
30428 * Note that if an I/O operation is interrupted by a signal, this may
30429 * cause the timeout to be reset.
30436 * g_socket_set_ttl:
30437 * @socket: a #GSocket.
30438 * @ttl: the time-to-live value for all unicast packets on @socket
30440 * Sets the time-to-live for outgoing unicast packets on @socket.
30441 * By default the platform-specific default value is used.
30448 * g_socket_shutdown:
30449 * @socket: a #GSocket
30450 * @shutdown_read: whether to shut down the read side
30451 * @shutdown_write: whether to shut down the write side
30452 * @error: #GError for error reporting, or %NULL to ignore.
30454 * Shut down part of a full-duplex connection.
30456 * If @shutdown_read is %TRUE then the receiving side of the connection
30457 * is shut down, and further reading is disallowed.
30459 * If @shutdown_write is %TRUE then the sending side of the connection
30460 * is shut down, and further writing is disallowed.
30462 * It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
30464 * One example where this is used is graceful disconnect for TCP connections
30465 * where you close the sending side, then wait for the other side to close
30466 * the connection, thus ensuring that the other side saw all sent data.
30468 * Returns: %TRUE on success, %FALSE on error
30474 * g_socket_speaks_ipv4:
30475 * @socket: a #GSocket
30477 * Checks if a socket is capable of speaking IPv4.
30479 * IPv4 sockets are capable of speaking IPv4. On some operating systems
30480 * and under some combinations of circumstances IPv6 sockets are also
30481 * capable of speaking IPv4. See RFC 3493 section 3.7 for more
30484 * No other types of sockets are currently considered as being capable
30485 * of speaking IPv4.
30487 * Returns: %TRUE if this socket can be used with IPv4.
30493 * g_srv_target_copy:
30494 * @target: a #GSrvTarget
30498 * Returns: a copy of @target
30504 * g_srv_target_free:
30505 * @target: a #GSrvTarget
30514 * g_srv_target_get_hostname:
30515 * @target: a #GSrvTarget
30517 * Gets @target's hostname (in ASCII form; if you are going to present
30518 * this to the user, you should use g_hostname_is_ascii_encoded() to
30519 * check if it contains encoded Unicode segments, and use
30520 * g_hostname_to_unicode() to convert it if it does.)
30522 * Returns: @target's hostname
30528 * g_srv_target_get_port:
30529 * @target: a #GSrvTarget
30531 * Gets @target's port
30533 * Returns: @target's port
30539 * g_srv_target_get_priority:
30540 * @target: a #GSrvTarget
30542 * Gets @target's priority. You should not need to look at this;
30543 * #GResolver already sorts the targets according to the algorithm in
30546 * Returns: @target's priority
30552 * g_srv_target_get_weight:
30553 * @target: a #GSrvTarget
30555 * Gets @target's weight. You should not need to look at this;
30556 * #GResolver already sorts the targets according to the algorithm in
30559 * Returns: @target's weight
30565 * g_srv_target_list_sort: (skip)
30566 * @targets: a #GList of #GSrvTarget
30568 * Sorts @targets in place according to the algorithm in RFC 2782.
30570 * Returns: (transfer full): the head of the sorted list.
30576 * g_srv_target_new:
30577 * @hostname: the host that the service is running on
30578 * @port: the port that the service is running on
30579 * @priority: the target's priority
30580 * @weight: the target's weight
30582 * Creates a new #GSrvTarget with the given parameters.
30584 * You should not need to use this; normally #GSrvTarget<!-- -->s are
30585 * created by #GResolver.
30587 * Returns: a new #GSrvTarget.
30593 * g_static_resource_fini:
30594 * @static_resource: pointer to a static #GStaticResource
30596 * Finalized a GResource initialized by g_static_resource_init().
30598 * This is normally used by code generated by
30599 * <link linkend="glib-compile-resources">glib-compile-resources</link>
30600 * and is not typically used by other code.
30607 * g_static_resource_get_resource:
30608 * @static_resource: pointer to a static #GStaticResource
30610 * Gets the GResource that was registered by a call to g_static_resource_init().
30612 * This is normally used by code generated by
30613 * <link linkend="glib-compile-resources">glib-compile-resources</link>
30614 * and is not typically used by other code.
30616 * Returns: (transfer none): a #GResource
30622 * g_static_resource_init:
30623 * @static_resource: pointer to a static #GStaticResource
30625 * Initializes a GResource from static data using a
30628 * This is normally used by code generated by
30629 * <link linkend="glib-compile-resources">glib-compile-resources</link>
30630 * and is not typically used by other code.
30637 * g_task_attach_source:
30639 * @source: the source to attach
30640 * @callback: the callback to invoke when @source triggers
30642 * A utility function for dealing with async operations where you need
30643 * to wait for a #GSource to trigger. Attaches @source to @task's
30644 * #GMainContext with @task's <link
30645 * linkend="io-priority">priority</link>, and sets @source's callback
30646 * to @callback, with @task as the callback's
30647 * <literal>user_data</literal>.
30649 * This takes a reference on @task until @source is destroyed.
30656 * g_task_get_cancellable:
30659 * Gets @task's #GCancellable
30661 * Returns: (transfer none): @task's #GCancellable
30667 * g_task_get_check_cancellable:
30668 * @task: the #GTask
30670 * Gets @task's check-cancellable flag. See
30671 * g_task_set_check_cancellable() for more details.
30678 * g_task_get_context:
30681 * Gets the #GMainContext that @task will return its result in (that
30682 * is, the context that was the <link
30683 * linkend="g-main-context-push-thread-default">thread-default main
30684 * context</link> at the point when @task was created).
30686 * This will always return a non-%NULL value, even if the task's
30687 * context is the default #GMainContext.
30689 * Returns: (transfer none): @task's #GMainContext
30695 * g_task_get_priority:
30698 * Gets @task's priority
30700 * Returns: @task's priority
30706 * g_task_get_return_on_cancel:
30707 * @task: the #GTask
30709 * Gets @task's return-on-cancel flag. See
30710 * g_task_set_return_on_cancel() for more details.
30717 * g_task_get_source_object:
30720 * Gets the source object from @task. Like
30721 * g_async_result_get_source_object(), but does not ref the object.
30723 * Returns: (transfer none) (type GObject): @task's source object, or %NULL
30729 * g_task_get_source_tag:
30732 * Gets @task's source tag. See g_task_set_source_tag().
30734 * Returns: (transfer none): @task's source tag
30740 * g_task_get_task_data:
30743 * Gets @task's <literal>task_data</literal>.
30745 * Returns: (transfer none): @task's <literal>task_data</literal>.
30751 * g_task_had_error:
30754 * Tests if @task resulted in an error.
30756 * Returns: %TRUE if the task resulted in an error, %FALSE otherwise.
30763 * @result: (type Gio.AsyncResult): A #GAsyncResult
30764 * @source_object: (allow-none) (type GObject): the source object expected to be associated with the task
30766 * Checks that @result is a #GTask, and that @source_object is its
30767 * source object (or that @source_object is %NULL and @result has no
30768 * source object). This can be used in g_return_if_fail() checks.
30770 * Returns: %TRUE if @result and @source_object are valid, %FALSE if not
30777 * @source_object: (allow-none) (type GObject): the #GObject that owns this task, or %NULL.
30778 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
30779 * @callback: (scope async): a #GAsyncReadyCallback.
30780 * @callback_data: (closure): user data passed to @callback.
30782 * Creates a #GTask acting on @source_object, which will eventually be
30783 * used to invoke @callback in the current <link
30784 * linkend="g-main-context-push-thread-default">thread-default main
30787 * Call this in the "start" method of your asynchronous method, and
30788 * pass the #GTask around throughout the asynchronous operation. You
30789 * can use g_task_set_task_data() to attach task-specific data to the
30790 * object, which you can retrieve later via g_task_get_task_data().
30792 * By default, if @cancellable is cancelled, then the return value of
30793 * the task will always be %G_IO_ERROR_CANCELLED, even if the task had
30794 * already completed before the cancellation. This allows for
30795 * simplified handling in cases where cancellation may imply that
30796 * other objects that the task depends on have been destroyed. If you
30797 * do not want this behavior, you can use
30798 * g_task_set_check_cancellable() to change it.
30800 * Returns: a #GTask.
30806 * g_task_propagate_boolean:
30808 * @error: return location for a #GError
30810 * Gets the result of @task as a #gboolean.
30812 * If the task resulted in an error, or was cancelled, then this will
30813 * instead return %FALSE and set @error.
30815 * Since this method transfers ownership of the return value (or
30816 * error) to the caller, you may only call it once.
30818 * Returns: the task result, or %FALSE on error
30824 * g_task_propagate_int:
30826 * @error: return location for a #GError
30828 * Gets the result of @task as an integer (#gssize).
30830 * If the task resulted in an error, or was cancelled, then this will
30831 * instead return -1 and set @error.
30833 * Since this method transfers ownership of the return value (or
30834 * error) to the caller, you may only call it once.
30836 * Returns: the task result, or -1 on error
30842 * g_task_propagate_pointer:
30844 * @error: return location for a #GError
30846 * Gets the result of @task as a pointer, and transfers ownership
30847 * of that value to the caller.
30849 * If the task resulted in an error, or was cancelled, then this will
30850 * instead return %NULL and set @error.
30852 * Since this method transfers ownership of the return value (or
30853 * error) to the caller, you may only call it once.
30855 * Returns: (transfer full): the task result, or %NULL on error
30861 * g_task_report_error:
30862 * @source_object: (allow-none) (type GObject): the #GObject that owns this task, or %NULL.
30863 * @callback: (scope async): a #GAsyncReadyCallback.
30864 * @callback_data: (closure): user data passed to @callback.
30865 * @source_tag: an opaque pointer indicating the source of this task
30866 * @error: (transfer full): error to report
30868 * Creates a #GTask and then immediately calls g_task_return_error()
30869 * on it. Use this in the wrapper function of an asynchronous method
30870 * when you want to avoid even calling the virtual method. You can
30871 * then use g_async_result_is_tagged() in the finish method wrapper to
30872 * check if the result there is tagged as having been created by the
30873 * wrapper method, and deal with it appropriately if so.
30875 * See also g_task_report_new_error().
30882 * g_task_report_new_error:
30883 * @source_object: (allow-none) (type GObject): the #GObject that owns this task, or %NULL.
30884 * @callback: (scope async): a #GAsyncReadyCallback.
30885 * @callback_data: (closure): user data passed to @callback.
30886 * @source_tag: an opaque pointer indicating the source of this task
30887 * @domain: a #GQuark.
30888 * @code: an error code.
30889 * @format: a string with format characters.
30890 * @...: a list of values to insert into @format.
30892 * Creates a #GTask and then immediately calls
30893 * g_task_return_new_error() on it. Use this in the wrapper function
30894 * of an asynchronous method when you want to avoid even calling the
30895 * virtual method. You can then use g_async_result_is_tagged() in the
30896 * finish method wrapper to check if the result there is tagged as
30897 * having been created by the wrapper method, and deal with it
30898 * appropriately if so.
30900 * See also g_task_report_error().
30907 * g_task_return_boolean:
30909 * @result: the #gboolean result of a task function.
30911 * Sets @task's result to @result and completes the task (see
30912 * g_task_return_pointer() for more discussion of exactly what this
30920 * g_task_return_error:
30922 * @error: (transfer full): the #GError result of a task function.
30924 * Sets @task's result to @error (which @task assumes ownership of)
30925 * and completes the task (see g_task_return_pointer() for more
30926 * discussion of exactly what this means).
30928 * Note that since the task takes ownership of @error, and since the
30929 * task may be completed before returning from g_task_return_error(),
30930 * you cannot assume that @error is still valid after calling this.
30931 * Call g_error_copy() on the error if you need to keep a local copy
30934 * See also g_task_return_new_error().
30941 * g_task_return_error_if_cancelled:
30944 * Checks if @task's #GCancellable has been cancelled, and if so, sets
30945 * @task's error accordingly and completes the task (see
30946 * g_task_return_pointer() for more discussion of exactly what this
30949 * Returns: %TRUE if @task has been cancelled, %FALSE if not
30955 * g_task_return_int:
30957 * @result: the integer (#gssize) result of a task function.
30959 * Sets @task's result to @result and completes the task (see
30960 * g_task_return_pointer() for more discussion of exactly what this
30968 * g_task_return_new_error:
30970 * @domain: a #GQuark.
30971 * @code: an error code.
30972 * @format: a string with format characters.
30973 * @...: a list of values to insert into @format.
30975 * Sets @task's result to a new #GError created from @domain, @code,
30976 * @format, and the remaining arguments, and completes the task (see
30977 * g_task_return_pointer() for more discussion of exactly what this
30980 * See also g_task_return_error().
30987 * g_task_return_pointer:
30989 * @result: (allow-none) (transfer full): the pointer result of a task function
30990 * @result_destroy: (allow-none): a #GDestroyNotify function.
30992 * Sets @task's result to @result and completes the task. If @result
30993 * is not %NULL, then @result_destroy will be used to free @result if
30994 * the caller does not take ownership of it with
30995 * g_task_propagate_pointer().
30997 * "Completes the task" means that for an ordinary asynchronous task
30998 * it will either invoke the task's callback, or else queue that
30999 * callback to be invoked in the proper #GMainContext, or in the next
31000 * iteration of the current #GMainContext. For a task run via
31001 * g_task_run_in_thread() or g_task_run_in_thread_sync(), calling this
31002 * method will save @result to be returned to the caller later, but
31003 * the task will not actually be completed until the #GTaskThreadFunc
31006 * Note that since the task may be completed before returning from
31007 * g_task_return_pointer(), you cannot assume that @result is still
31008 * valid after calling this, unless you are still holding another
31016 * g_task_run_in_thread:
31018 * @task_func: a #GTaskThreadFunc
31020 * Runs @task_func in another thread. When @task_func returns, @task's
31021 * #GAsyncReadyCallback will be invoked in @task's #GMainContext.
31023 * This takes a ref on @task until the task completes.
31025 * See #GTaskThreadFunc for more details about how @task_func is handled.
31032 * g_task_run_in_thread_sync:
31034 * @task_func: a #GTaskThreadFunc
31036 * Runs @task_func in another thread, and waits for it to return or be
31037 * cancelled. You can use g_task_propagate_pointer(), etc, afterward
31038 * to get the result of @task_func.
31040 * See #GTaskThreadFunc for more details about how @task_func is handled.
31042 * Normally this is used with tasks created with a %NULL
31043 * <literal>callback</literal>, but note that even if the task does
31044 * have a callback, it will not be invoked when @task_func returns.
31051 * g_task_set_check_cancellable:
31052 * @task: the #GTask
31053 * @check_cancellable: whether #GTask will check the state of its #GCancellable for you.
31055 * Sets or clears @task's check-cancellable flag. If this is %TRUE
31056 * (the default), then g_task_propagate_pointer(), etc, and
31057 * g_task_had_error() will check the task's #GCancellable first, and
31058 * if it has been cancelled, then they will consider the task to have
31059 * returned an "Operation was cancelled" error
31060 * (%G_IO_ERROR_CANCELLED), regardless of any other error or return
31061 * value the task may have had.
31063 * If @check_cancellable is %FALSE, then the #GTask will not check the
31064 * cancellable itself, and it is up to @task's owner to do this (eg,
31065 * via g_task_return_error_if_cancelled()).
31067 * If you are using g_task_set_return_on_cancel() as well, then
31068 * you must leave check-cancellable set %TRUE.
31075 * g_task_set_priority:
31076 * @task: the #GTask
31077 * @priority: the <link linkend="io-priority">priority</link> of the request.
31079 * Sets @task's priority. If you do not call this, it will default to
31080 * %G_PRIORITY_DEFAULT.
31082 * This will affect the priority of #GSources created with
31083 * g_task_attach_source() and the scheduling of tasks run in threads,
31084 * and can also be explicitly retrieved later via
31085 * g_task_get_priority().
31092 * g_task_set_return_on_cancel:
31093 * @task: the #GTask
31094 * @return_on_cancel: whether the task returns automatically when it is cancelled.
31096 * Sets or clears @task's return-on-cancel flag. This is only
31097 * meaningful for tasks run via g_task_run_in_thread() or
31098 * g_task_run_in_thread_sync().
31100 * If @return_on_cancel is %TRUE, then cancelling @task's
31101 * #GCancellable will immediately cause it to return, as though the
31102 * task's #GTaskThreadFunc had called
31103 * g_task_return_error_if_cancelled() and then returned.
31105 * This allows you to create a cancellable wrapper around an
31106 * uninterruptable function. The #GTaskThreadFunc just needs to be
31107 * careful that it does not modify any externally-visible state after
31108 * it has been cancelled. To do that, the thread should call
31109 * g_task_set_return_on_cancel() again to (atomically) set
31110 * return-on-cancel %FALSE before making externally-visible changes;
31111 * if the task gets cancelled before the return-on-cancel flag could
31112 * be changed, g_task_set_return_on_cancel() will indicate this by
31113 * returning %FALSE.
31115 * You can disable and re-enable this flag multiple times if you wish.
31116 * If the task's #GCancellable is cancelled while return-on-cancel is
31117 * %FALSE, then calling g_task_set_return_on_cancel() to set it %TRUE
31118 * again will cause the task to be cancelled at that point.
31120 * If the task's #GCancellable is already cancelled before you call
31121 * g_task_run_in_thread()/g_task_run_in_thread_sync(), then the
31122 * #GTaskThreadFunc will still be run (for consistency), but the task
31123 * will also be completed right away.
31125 * Returns: %TRUE if @task's return-on-cancel flag was changed to match @return_on_cancel. %FALSE if @task has already been cancelled.
31131 * g_task_set_source_tag:
31132 * @task: the #GTask
31133 * @source_tag: an opaque pointer indicating the source of this task
31135 * Sets @task's source tag. You can use this to tag a task return
31136 * value with a particular pointer (usually a pointer to the function
31137 * doing the tagging) and then later check it using
31138 * g_task_get_source_tag() (or g_async_result_is_tagged()) in the
31139 * task's "finish" function, to figure out if the response came from a
31140 * particular place.
31147 * g_task_set_task_data:
31148 * @task: the #GTask
31149 * @task_data: (allow-none): task-specific data
31150 * @task_data_destroy: (allow-none): #GDestroyNotify for @task_data
31152 * Sets @task's task data (freeing the existing task data, if any).
31159 * g_tcp_connection_get_graceful_disconnect:
31160 * @connection: a #GTcpConnection
31162 * Checks if graceful disconnects are used. See
31163 * g_tcp_connection_set_graceful_disconnect().
31165 * Returns: %TRUE if graceful disconnect is used on close, %FALSE otherwise
31171 * g_tcp_connection_set_graceful_disconnect:
31172 * @connection: a #GTcpConnection
31173 * @graceful_disconnect: Whether to do graceful disconnects or not
31175 * This enabled graceful disconnects on close. A graceful disconnect
31176 * means that we signal the receiving end that the connection is terminated
31177 * and wait for it to close the connection before closing the connection.
31179 * A graceful disconnect means that we can be sure that we successfully sent
31180 * all the outstanding data to the other end, or get an error reported.
31181 * However, it also means we have to wait for all the data to reach the
31182 * other side and for it to acknowledge this by closing the socket, which may
31183 * take a while. For this reason it is disabled by default.
31190 * g_tcp_wrapper_connection_get_base_io_stream:
31191 * @conn: a #GTcpWrapperConnection
31193 * Get's @conn's base #GIOStream
31195 * Returns: (transfer none): @conn's base #GIOStream
31200 * g_tcp_wrapper_connection_new:
31201 * @base_io_stream: the #GIOStream to wrap
31202 * @socket: the #GSocket associated with @base_io_stream
31204 * Wraps @base_io_stream and @socket together as a #GSocketConnection.
31206 * Returns: the new #GSocketConnection.
31212 * g_test_dbus_add_service_dir:
31213 * @self: a #GTestDBus
31214 * @path: path to a directory containing .service files
31216 * Add a path where dbus-daemon will lookup for .services files. This can't be
31217 * called after g_test_dbus_up().
31222 * g_test_dbus_down:
31223 * @self: a #GTestDBus
31225 * Stop the session bus started by g_test_dbus_up().
31227 * This will wait for the singleton returned by g_bus_get() or g_bus_get_sync()
31228 * is destroyed. This is done to ensure that the next unit test won't get a
31229 * leaked singleton from this test.
31234 * g_test_dbus_get_bus_address:
31235 * @self: a #GTestDBus
31237 * Get the address on which dbus-daemon is running. if g_test_dbus_up() has not
31238 * been called yet, %NULL is returned. This can be used with
31239 * g_dbus_connection_new_for_address()
31241 * Returns: the address of the bus, or %NULL.
31246 * g_test_dbus_get_flags:
31247 * @self: a #GTestDBus
31249 * Gets the flags of the #GTestDBus object.
31251 * Returns: the value of #GTestDBus:flags property
31257 * @flags: a #GTestDBusFlags
31259 * Create a new #GTestDBus object.
31261 * Returns: (transfer full): a new #GTestDBus.
31266 * g_test_dbus_stop:
31267 * @self: a #GTestDBus
31269 * Stop the session bus started by g_test_dbus_up().
31271 * Unlike g_test_dbus_down(), this won't verify the #GDBusConnection
31272 * singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit
31273 * tests wanting to verify behaviour after the session bus has been stopped
31274 * can use this function but should still call g_test_dbus_down() when done.
31279 * g_test_dbus_unset:
31281 * Unset DISPLAY and DBUS_SESSION_BUS_ADDRESS env variables to ensure the test
31282 * won't use user's session bus.
31284 * This is useful for unit tests that want to verify behaviour when no session
31285 * bus is running. It is not necessary to call this if unit test already calls
31286 * g_test_dbus_up() before acquiring the session bus.
31292 * @self: a #GTestDBus
31294 * Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this
31295 * call, it is safe for unit tests to start sending messages on the session bus.
31297 * If this function is called from setup callback of g_test_add(),
31298 * g_test_dbus_down() must be called in its teardown callback.
31300 * If this function is called from unit test's main(), then g_test_dbus_down()
31301 * must be called after g_test_run().
31306 * g_themed_icon_append_name:
31307 * @icon: a #GThemedIcon
31308 * @iconname: name of icon to append to list of icons from within @icon.
31310 * Append a name to the list of icons from within @icon.
31313 * Note that doing so invalidates the hash computed by prior calls
31314 * to g_icon_hash().
31320 * g_themed_icon_get_names:
31321 * @icon: a #GThemedIcon.
31323 * Gets the names of icons from within @icon.
31325 * Returns: (transfer none): a list of icon names.
31330 * g_themed_icon_new:
31331 * @iconname: a string containing an icon name.
31333 * Creates a new themed icon for @iconname.
31335 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
31340 * g_themed_icon_new_from_names:
31341 * @iconnames: (array length=len): an array of strings containing icon names.
31342 * @len: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
31344 * Creates a new themed icon for @iconnames.
31346 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon
31351 * g_themed_icon_new_with_default_fallbacks:
31352 * @iconname: a string containing an icon name
31354 * Creates a new themed icon for @iconname, and all the names
31355 * that can be created by shortening @iconname at '-' characters.
31357 * In the following example, @icon1 and @icon2 are equivalent:
31359 * const char *names[] = {
31360 * "gnome-dev-cdrom-audio",
31361 * "gnome-dev-cdrom",
31366 * icon1 = g_themed_icon_new_from_names (names, 4);
31367 * icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
31370 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
31375 * g_themed_icon_prepend_name:
31376 * @icon: a #GThemedIcon
31377 * @iconname: name of icon to prepend to list of icons from within @icon.
31379 * Prepend a name to the list of icons from within @icon.
31382 * Note that doing so invalidates the hash computed by prior calls
31383 * to g_icon_hash().
31391 * g_threaded_socket_service_new:
31392 * @max_threads: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
31394 * Creates a new #GThreadedSocketService with no listeners. Listeners
31395 * must be added with one of the #GSocketListener "add" methods.
31397 * Returns: a new #GSocketService.
31403 * g_tls_backend_get_certificate_type:
31404 * @backend: the #GTlsBackend
31406 * Gets the #GType of @backend's #GTlsCertificate implementation.
31408 * Returns: the #GType of @backend's #GTlsCertificate implementation.
31414 * g_tls_backend_get_client_connection_type:
31415 * @backend: the #GTlsBackend
31417 * Gets the #GType of @backend's #GTlsClientConnection implementation.
31419 * Returns: the #GType of @backend's #GTlsClientConnection implementation.
31425 * g_tls_backend_get_default:
31427 * Gets the default #GTlsBackend for the system.
31429 * Returns: (transfer none): a #GTlsBackend
31435 * g_tls_backend_get_default_database:
31436 * @backend: the #GTlsBackend
31438 * Gets the default #GTlsDatabase used to verify TLS connections.
31440 * Returns: (transfer full): the default database, which should be unreffed when done.
31446 * g_tls_backend_get_file_database_type:
31447 * @backend: the #GTlsBackend
31449 * Gets the #GType of @backend's #GTlsFileDatabase implementation.
31451 * Returns: the #GType of backend's #GTlsFileDatabase implementation.
31457 * g_tls_backend_get_server_connection_type:
31458 * @backend: the #GTlsBackend
31460 * Gets the #GType of @backend's #GTlsServerConnection implementation.
31462 * Returns: the #GType of @backend's #GTlsServerConnection implementation.
31468 * g_tls_backend_supports_tls:
31469 * @backend: the #GTlsBackend
31471 * Checks if TLS is supported; if this returns %FALSE for the default
31472 * #GTlsBackend, it means no "real" TLS backend is available.
31474 * Returns: whether or not TLS is supported
31480 * g_tls_certificate_get_issuer:
31481 * @cert: a #GTlsCertificate
31483 * Gets the #GTlsCertificate representing @cert's issuer, if known
31485 * Returns: (transfer none): The certificate of @cert's issuer, or %NULL if @cert is self-signed or signed with an unknown certificate.
31491 * g_tls_certificate_is_same:
31492 * @cert_one: first certificate to compare
31493 * @cert_two: second certificate to compare
31495 * Check if two #GTlsCertificate objects represent the same certificate.
31496 * The raw DER byte data of the two certificates are checked for equality.
31497 * This has the effect that two certificates may compare equal even if
31498 * their #GTlsCertificate:issuer, #GTlsCertificate:private-key, or
31499 * #GTlsCertificate:private-key-pem properties differ.
31501 * Returns: whether the same or not
31507 * g_tls_certificate_list_new_from_file:
31508 * @file: file containing PEM-encoded certificates to import
31509 * @error: #GError for error reporting, or %NULL to ignore.
31511 * Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
31512 * data in @file. If @file cannot be read or parsed, the function will
31513 * return %NULL and set @error. If @file does not contain any
31514 * PEM-encoded certificates, this will return an empty list and not
31517 * 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.
31523 * g_tls_certificate_new_from_file:
31524 * @file: file containing a PEM-encoded certificate to import
31525 * @error: #GError for error reporting, or %NULL to ignore.
31527 * Creates a #GTlsCertificate from the PEM-encoded data in @file. If
31528 * @file cannot be read or parsed, the function will return %NULL and
31529 * set @error. Otherwise, this behaves like
31530 * g_tls_certificate_new_from_pem().
31532 * Returns: the new certificate, or %NULL on error
31538 * g_tls_certificate_new_from_files:
31539 * @cert_file: file containing a PEM-encoded certificate to import
31540 * @key_file: file containing a PEM-encoded private key to import
31541 * @error: #GError for error reporting, or %NULL to ignore.
31543 * Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
31544 * and @key_file. If either file cannot be read or parsed, the
31545 * function will return %NULL and set @error. Otherwise, this behaves
31546 * like g_tls_certificate_new_from_pem().
31548 * Returns: the new certificate, or %NULL on error
31554 * g_tls_certificate_new_from_pem:
31555 * @data: PEM-encoded certificate data
31556 * @length: the length of @data, or -1 if it's 0-terminated.
31557 * @error: #GError for error reporting, or %NULL to ignore.
31559 * Creates a new #GTlsCertificate from the PEM-encoded data in @data.
31560 * If @data includes both a certificate and a private key, then the
31561 * returned certificate will include the private key data as well. (See
31562 * the #GTlsCertificate:private-key-pem property for information about
31563 * supported formats.)
31565 * If @data includes multiple certificates, only the first one will be
31568 * Returns: the new certificate, or %NULL if @data is invalid
31574 * g_tls_certificate_verify:
31575 * @cert: a #GTlsCertificate
31576 * @identity: (allow-none): the expected peer identity
31577 * @trusted_ca: (allow-none): the certificate of a trusted authority
31579 * This verifies @cert and returns a set of #GTlsCertificateFlags
31580 * indicating any problems found with it. This can be used to verify a
31581 * certificate outside the context of making a connection, or to
31582 * check a certificate against a CA that is not part of the system
31585 * If @identity is not %NULL, @cert's name(s) will be compared against
31586 * it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
31587 * value if it does not match. If @identity is %NULL, that bit will
31588 * never be set in the return value.
31590 * If @trusted_ca is not %NULL, then @cert (or one of the certificates
31591 * in its chain) must be signed by it, or else
31592 * %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
31593 * @trusted_ca is %NULL, that bit will never be set in the return
31596 * (All other #GTlsCertificateFlags values will always be set or unset
31599 * Returns: the appropriate #GTlsCertificateFlags
31605 * g_tls_client_connection_get_accepted_cas:
31606 * @conn: the #GTlsClientConnection
31608 * Gets the list of distinguished names of the Certificate Authorities
31609 * that the server will accept certificates from. This will be set
31610 * during the TLS handshake if the server requests a certificate.
31611 * Otherwise, it will be %NULL.
31613 * Each item in the list is a #GByteArray which contains the complete
31614 * subject DN of the certificate authority.
31616 * 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().
31622 * g_tls_client_connection_get_server_identity:
31623 * @conn: the #GTlsClientConnection
31625 * Gets @conn's expected server identity
31627 * Returns: (transfer none): a #GSocketConnectable describing the expected server identity, or %NULL if the expected identity is not known.
31633 * g_tls_client_connection_get_use_ssl3:
31634 * @conn: the #GTlsClientConnection
31636 * Gets whether @conn will use SSL 3.0 rather than the
31637 * highest-supported version of TLS; see
31638 * g_tls_client_connection_set_use_ssl3().
31640 * Returns: whether @conn will use SSL 3.0
31646 * g_tls_client_connection_get_validation_flags:
31647 * @conn: the #GTlsClientConnection
31649 * Gets @conn's validation flags
31651 * Returns: the validation flags
31657 * g_tls_client_connection_new:
31658 * @base_io_stream: the #GIOStream to wrap
31659 * @server_identity: (allow-none): the expected identity of the server
31660 * @error: #GError for error reporting, or %NULL to ignore.
31662 * Creates a new #GTlsClientConnection wrapping @base_io_stream (which
31663 * must have pollable input and output streams) which is assumed to
31664 * communicate with the server identified by @server_identity.
31666 * Returns: (transfer full) (type GTlsClientConnection): the new #GTlsClientConnection, or %NULL on error
31672 * g_tls_client_connection_set_server_identity:
31673 * @conn: the #GTlsClientConnection
31674 * @identity: a #GSocketConnectable describing the expected server identity
31676 * Sets @conn's expected server identity, which is used both to tell
31677 * servers on virtual hosts which certificate to present, and also
31678 * to let @conn know what name to look for in the certificate when
31679 * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
31686 * g_tls_client_connection_set_use_ssl3:
31687 * @conn: the #GTlsClientConnection
31688 * @use_ssl3: whether to use SSL 3.0
31690 * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
31691 * trying to properly negotiate the right version of TLS or SSL to use.
31692 * This can be used when talking to servers that do not implement the
31693 * fallbacks correctly and which will therefore fail to handshake with
31694 * a "modern" TLS handshake attempt.
31701 * g_tls_client_connection_set_validation_flags:
31702 * @conn: the #GTlsClientConnection
31703 * @flags: the #GTlsCertificateFlags to use
31705 * Sets @conn's validation flags, to override the default set of
31706 * checks performed when validating a server certificate. By default,
31707 * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
31714 * g_tls_connection_emit_accept_certificate:
31715 * @conn: a #GTlsConnection
31716 * @peer_cert: the peer's #GTlsCertificate
31717 * @errors: the problems with @peer_cert
31719 * Used by #GTlsConnection implementations to emit the
31720 * #GTlsConnection::accept-certificate signal.
31722 * Returns: %TRUE if one of the signal handlers has returned %TRUE to accept @peer_cert
31728 * g_tls_connection_get_certificate:
31729 * @conn: a #GTlsConnection
31731 * Gets @conn's certificate, as set by
31732 * g_tls_connection_set_certificate().
31734 * Returns: (transfer none): @conn's certificate, or %NULL
31740 * g_tls_connection_get_database:
31741 * @conn: a #GTlsConnection
31743 * Gets the certificate database that @conn uses to verify
31744 * peer certificates. See g_tls_connection_set_database().
31746 * Returns: (transfer none): the certificate database that @conn uses or %NULL
31752 * g_tls_connection_get_interaction:
31753 * @conn: a connection
31755 * Get the object that will be used to interact with the user. It will be used
31756 * for things like prompting the user for passwords. If %NULL is returned, then
31757 * no user interaction will occur for this connection.
31759 * Returns: (transfer none): The interaction object.
31765 * g_tls_connection_get_peer_certificate:
31766 * @conn: a #GTlsConnection
31768 * Gets @conn's peer's certificate after the handshake has completed.
31769 * (It is not set during the emission of
31770 * #GTlsConnection::accept-certificate.)
31772 * Returns: (transfer none): @conn's peer's certificate, or %NULL
31778 * g_tls_connection_get_peer_certificate_errors:
31779 * @conn: a #GTlsConnection
31781 * Gets the errors associated with validating @conn's peer's
31782 * certificate, after the handshake has completed. (It is not set
31783 * during the emission of #GTlsConnection::accept-certificate.)
31785 * Returns: @conn's peer's certificate errors
31791 * g_tls_connection_get_rehandshake_mode:
31792 * @conn: a #GTlsConnection
31794 * Gets @conn rehandshaking mode. See
31795 * g_tls_connection_set_rehandshake_mode() for details.
31797 * Returns: @conn's rehandshaking mode
31803 * g_tls_connection_get_require_close_notify:
31804 * @conn: a #GTlsConnection
31806 * Tests whether or not @conn expects a proper TLS close notification
31807 * when the connection is closed. See
31808 * g_tls_connection_set_require_close_notify() for details.
31810 * Returns: %TRUE if @conn requires a proper TLS close notification.
31816 * g_tls_connection_get_use_system_certdb:
31817 * @conn: a #GTlsConnection
31819 * Gets whether @conn uses the system certificate database to verify
31820 * peer certificates. See g_tls_connection_set_use_system_certdb().
31822 * Returns: whether @conn uses the system certificate database
31823 * Deprecated: 2.30: Use g_tls_connection_get_database() instead
31828 * g_tls_connection_handshake:
31829 * @conn: a #GTlsConnection
31830 * @cancellable: (allow-none): a #GCancellable, or %NULL
31831 * @error: a #GError, or %NULL
31833 * Attempts a TLS handshake on @conn.
31835 * On the client side, it is never necessary to call this method;
31836 * although the connection needs to perform a handshake after
31837 * connecting (or after sending a "STARTTLS"-type command) and may
31838 * need to rehandshake later if the server requests it,
31839 * #GTlsConnection will handle this for you automatically when you try
31840 * to send or receive data on the connection. However, you can call
31841 * g_tls_connection_handshake() manually if you want to know for sure
31842 * whether the initial handshake succeeded or failed (as opposed to
31843 * just immediately trying to write to @conn's output stream, in which
31844 * case if it fails, it may not be possible to tell if it failed
31845 * before or after completing the handshake).
31847 * Likewise, on the server side, although a handshake is necessary at
31848 * the beginning of the communication, you do not need to call this
31849 * function explicitly unless you want clearer error reporting.
31850 * However, you may call g_tls_connection_handshake() later on to
31851 * renegotiate parameters (encryption methods, etc) with the client.
31853 * #GTlsConnection::accept_certificate may be emitted during the
31856 * Returns: success or failure
31862 * g_tls_connection_handshake_async:
31863 * @conn: a #GTlsConnection
31864 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
31865 * @cancellable: (allow-none): a #GCancellable, or %NULL
31866 * @callback: callback to call when the handshake is complete
31867 * @user_data: the data to pass to the callback function
31869 * Asynchronously performs a TLS handshake on @conn. See
31870 * g_tls_connection_handshake() for more information.
31877 * g_tls_connection_handshake_finish:
31878 * @conn: a #GTlsConnection
31879 * @result: a #GAsyncResult.
31880 * @error: a #GError pointer, or %NULL
31882 * Finish an asynchronous TLS handshake operation. See
31883 * g_tls_connection_handshake() for more information.
31885 * Returns: %TRUE on success, %FALSE on failure, in which case @error will be set.
31891 * g_tls_connection_set_certificate:
31892 * @conn: a #GTlsConnection
31893 * @certificate: the certificate to use for @conn
31895 * This sets the certificate that @conn will present to its peer
31896 * during the TLS handshake. For a #GTlsServerConnection, it is
31897 * mandatory to set this, and that will normally be done at construct
31900 * For a #GTlsClientConnection, this is optional. If a handshake fails
31901 * with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
31902 * requires a certificate, and if you try connecting again, you should
31903 * call this method first. You can call
31904 * g_tls_client_connection_get_accepted_cas() on the failed connection
31905 * to get a list of Certificate Authorities that the server will
31906 * accept certificates from.
31908 * (It is also possible that a server will allow the connection with
31909 * or without a certificate; in that case, if you don't provide a
31910 * certificate, you can tell that the server requested one by the fact
31911 * that g_tls_client_connection_get_accepted_cas() will return
31919 * g_tls_connection_set_database:
31920 * @conn: a #GTlsConnection
31921 * @database: a #GTlsDatabase
31923 * Sets the certificate database that is used to verify peer certificates.
31924 * This is set to the default database by default. See
31925 * g_tls_backend_get_default_database(). If set to %NULL, then
31926 * peer certificate validation will always set the
31927 * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
31928 * #GTlsConnection::accept-certificate will always be emitted on
31929 * client-side connections, unless that bit is not set in
31930 * #GTlsClientConnection:validation-flags).
31937 * g_tls_connection_set_interaction:
31938 * @conn: a connection
31939 * @interaction: (allow-none): an interaction object, or %NULL
31941 * Set the object that will be used to interact with the user. It will be used
31942 * for things like prompting the user for passwords.
31944 * The @interaction argument will normally be a derived subclass of
31945 * #GTlsInteraction. %NULL can also be provided if no user interaction
31946 * should occur for this connection.
31953 * g_tls_connection_set_rehandshake_mode:
31954 * @conn: a #GTlsConnection
31955 * @mode: the rehandshaking mode
31957 * Sets how @conn behaves with respect to rehandshaking requests.
31959 * %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
31960 * rehandshake after the initial handshake is complete. (For a client,
31961 * this means it will refuse rehandshake requests from the server, and
31962 * for a server, this means it will close the connection with an error
31963 * if the client attempts to rehandshake.)
31965 * %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
31966 * rehandshake only if the other end of the connection supports the
31967 * TLS <literal>renegotiation_info</literal> extension. This is the
31968 * default behavior, but means that rehandshaking will not work
31969 * against older implementations that do not support that extension.
31971 * %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
31972 * rehandshaking even without the
31973 * <literal>renegotiation_info</literal> extension. On the server side
31974 * in particular, this is not recommended, since it leaves the server
31975 * open to certain attacks. However, this mode is necessary if you
31976 * need to allow renegotiation with older client software.
31983 * g_tls_connection_set_require_close_notify:
31984 * @conn: a #GTlsConnection
31985 * @require_close_notify: whether or not to require close notification
31987 * Sets whether or not @conn expects a proper TLS close notification
31988 * before the connection is closed. If this is %TRUE (the default),
31989 * then @conn will expect to receive a TLS close notification from its
31990 * peer before the connection is closed, and will return a
31991 * %G_TLS_ERROR_EOF error if the connection is closed without proper
31992 * notification (since this may indicate a network error, or
31993 * man-in-the-middle attack).
31995 * In some protocols, the application will know whether or not the
31996 * connection was closed cleanly based on application-level data
31997 * (because the application-level data includes a length field, or is
31998 * somehow self-delimiting); in this case, the close notify is
31999 * redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
32000 * in TLS 1.0 it is technically an error, but often done anyway.) You
32001 * can use g_tls_connection_set_require_close_notify() to tell @conn
32002 * to allow an "unannounced" connection close, in which case the close
32003 * will show up as a 0-length read, as in a non-TLS
32004 * #GSocketConnection, and it is up to the application to check that
32005 * the data has been fully received.
32007 * Note that this only affects the behavior when the peer closes the
32008 * connection; when the application calls g_io_stream_close() itself
32009 * on @conn, this will send a close notification regardless of the
32010 * setting of this property. If you explicitly want to do an unclean
32011 * close, you can close @conn's #GTlsConnection:base-io-stream rather
32012 * than closing @conn itself.
32019 * g_tls_connection_set_use_system_certdb:
32020 * @conn: a #GTlsConnection
32021 * @use_system_certdb: whether to use the system certificate database
32023 * Sets whether @conn uses the system certificate database to verify
32024 * peer certificates. This is %TRUE by default. If set to %FALSE, then
32025 * peer certificate validation will always set the
32026 * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
32027 * #GTlsConnection::accept-certificate will always be emitted on
32028 * client-side connections, unless that bit is not set in
32029 * #GTlsClientConnection:validation-flags).
32031 * Deprecated: 2.30: Use g_tls_connection_set_database() instead
32036 * g_tls_database_create_certificate_handle:
32037 * @self: a #GTlsDatabase
32038 * @certificate: certificate for which to create a handle.
32040 * Create a handle string for the certificate. The database will only be able
32041 * to create a handle for certificates that originate from the database. In
32042 * cases where the database cannot create a handle for a certificate, %NULL
32043 * will be returned.
32045 * This handle should be stable across various instances of the application,
32046 * and between applications. If a certificate is modified in the database,
32047 * then it is not guaranteed that this handle will continue to point to it.
32049 * Returns: (allow-none): a newly allocated string containing the handle.
32055 * g_tls_database_lookup_certificate_for_handle:
32056 * @self: a #GTlsDatabase
32057 * @handle: a certificate handle
32058 * @interaction: (allow-none): used to interact with the user if necessary
32059 * @flags: Flags which affect the lookup.
32060 * @cancellable: (allow-none): a #GCancellable, or %NULL
32061 * @error: (allow-none): a #GError, or %NULL
32063 * Lookup a certificate by its handle.
32065 * The handle should have been created by calling
32066 * g_tls_database_create_certificate_handle() on a #GTlsDatabase object of
32067 * the same TLS backend. The handle is designed to remain valid across
32068 * instantiations of the database.
32070 * If the handle is no longer valid, or does not point to a certificate in
32071 * this database, then %NULL will be returned.
32073 * This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
32074 * the lookup operation asynchronously.
32076 * Returns: (transfer full) (allow-none): a newly allocated #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
32082 * g_tls_database_lookup_certificate_for_handle_async:
32083 * @self: a #GTlsDatabase
32084 * @handle: a certificate handle
32085 * @interaction: (allow-none): used to interact with the user if necessary
32086 * @flags: Flags which affect the lookup.
32087 * @cancellable: (allow-none): a #GCancellable, or %NULL
32088 * @callback: callback to call when the operation completes
32089 * @user_data: the data to pass to the callback function
32091 * Asynchronously lookup a certificate by its handle in the database. See
32092 * g_tls_database_lookup_certificate_for_handle() for more information.
32099 * g_tls_database_lookup_certificate_for_handle_finish:
32100 * @self: a #GTlsDatabase
32101 * @result: a #GAsyncResult.
32102 * @error: a #GError pointer, or %NULL
32104 * Finish an asynchronous lookup of a certificate by its handle. See
32105 * g_tls_database_lookup_certificate_handle() for more information.
32107 * If the handle is no longer valid, or does not point to a certificate in
32108 * this database, then %NULL will be returned.
32110 * Returns: (transfer full): a newly allocated #GTlsCertificate object. Use g_object_unref() to release the certificate.
32116 * g_tls_database_lookup_certificate_issuer:
32117 * @self: a #GTlsDatabase
32118 * @certificate: a #GTlsCertificate
32119 * @interaction: (allow-none): used to interact with the user if necessary
32120 * @flags: flags which affect the lookup operation
32121 * @cancellable: (allow-none): a #GCancellable, or %NULL
32122 * @error: (allow-none): a #GError, or %NULL
32124 * Lookup the issuer of @certificate in the database.
32126 * The %issuer property
32127 * of @certificate is not modified, and the two certificates are not hooked
32130 * This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
32131 * the lookup operation asynchronously.
32133 * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
32139 * g_tls_database_lookup_certificate_issuer_async:
32140 * @self: a #GTlsDatabase
32141 * @certificate: a #GTlsCertificate
32142 * @interaction: (allow-none): used to interact with the user if necessary
32143 * @flags: flags which affect the lookup operation
32144 * @cancellable: (allow-none): a #GCancellable, or %NULL
32145 * @callback: callback to call when the operation completes
32146 * @user_data: the data to pass to the callback function
32148 * Asynchronously lookup the issuer of @certificate in the database. See
32149 * g_tls_database_lookup_certificate_issuer() for more information.
32156 * g_tls_database_lookup_certificate_issuer_finish:
32157 * @self: a #GTlsDatabase
32158 * @result: a #GAsyncResult.
32159 * @error: a #GError pointer, or %NULL
32161 * Finish an asynchronous lookup issuer operation. See
32162 * g_tls_database_lookup_certificate_issuer() for more information.
32164 * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
32170 * g_tls_database_lookup_certificates_issued_by:
32171 * @self: a #GTlsDatabase
32172 * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
32173 * @interaction: (allow-none): used to interact with the user if necessary
32174 * @flags: Flags which affect the lookup operation.
32175 * @cancellable: (allow-none): a #GCancellable, or %NULL
32176 * @error: (allow-none): a #GError, or %NULL
32178 * Lookup certificates issued by this issuer in the database.
32180 * This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
32181 * the lookup operation asynchronously.
32183 * 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.
32189 * g_tls_database_lookup_certificates_issued_by_async:
32190 * @self: a #GTlsDatabase
32191 * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
32192 * @interaction: (allow-none): used to interact with the user if necessary
32193 * @flags: Flags which affect the lookup operation.
32194 * @cancellable: (allow-none): a #GCancellable, or %NULL
32195 * @callback: callback to call when the operation completes
32196 * @user_data: the data to pass to the callback function
32198 * Asynchronously lookup certificates issued by this issuer in the database. See
32199 * g_tls_database_lookup_certificates_issued_by() for more information.
32201 * The database may choose to hold a reference to the issuer byte array for the duration
32202 * of of this asynchronous operation. The byte array should not be modified during
32210 * g_tls_database_lookup_certificates_issued_by_finish:
32211 * @self: a #GTlsDatabase
32212 * @result: a #GAsyncResult.
32213 * @error: a #GError pointer, or %NULL
32215 * Finish an asynchronous lookup of certificates. See
32216 * g_tls_database_lookup_certificates_issued_by() for more information.
32218 * 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.
32224 * g_tls_database_verify_chain:
32225 * @self: a #GTlsDatabase
32226 * @chain: a #GTlsCertificate chain
32227 * @purpose: the purpose that this certificate chain will be used for.
32228 * @identity: (allow-none): the expected peer identity
32229 * @interaction: (allow-none): used to interact with the user if necessary
32230 * @flags: additional verify flags
32231 * @cancellable: (allow-none): a #GCancellable, or %NULL
32232 * @error: (allow-none): a #GError, or %NULL
32234 * Verify's a certificate chain after looking up and adding any missing
32235 * certificates to the chain.
32237 * @chain is a chain of #GTlsCertificate objects each pointing to the next
32238 * certificate in the chain by its %issuer property. The chain may initially
32239 * consist of one or more certificates. After the verification process is
32240 * complete, @chain may be modified by adding missing certificates, or removing
32241 * extra certificates. If a certificate anchor was found, then it is added to
32244 * @purpose describes the purpose (or usage) for which the certificate
32245 * is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
32246 * which means that the certificate is being used to authenticate a server
32247 * (and we are acting as the client).
32249 * The @identity is used to check for pinned certificates (trust exceptions)
32250 * in the database. These will override the normal verification process on a
32251 * host by host basis.
32253 * Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
32256 * This function can block, use g_tls_database_verify_chain_async() to perform
32257 * the verification operation asynchronously.
32259 * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
32265 * g_tls_database_verify_chain_async:
32266 * @self: a #GTlsDatabase
32267 * @chain: a #GTlsCertificate chain
32268 * @purpose: the purpose that this certificate chain will be used for.
32269 * @identity: (allow-none): the expected peer identity
32270 * @interaction: (allow-none): used to interact with the user if necessary
32271 * @flags: additional verify flags
32272 * @cancellable: (allow-none): a #GCancellable, or %NULL
32273 * @callback: callback to call when the operation completes
32274 * @user_data: the data to pass to the callback function
32276 * Asynchronously verify's a certificate chain after looking up and adding
32277 * any missing certificates to the chain. See g_tls_database_verify_chain()
32278 * for more information.
32285 * g_tls_database_verify_chain_finish:
32286 * @self: a #GTlsDatabase
32287 * @result: a #GAsyncResult.
32288 * @error: a #GError pointer, or %NULL
32290 * Finish an asynchronous verify chain operation. See
32291 * g_tls_database_verify_chain() for more information. *
32293 * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
32299 * g_tls_error_quark:
32301 * Gets the TLS error quark.
32303 * Returns: a #GQuark.
32309 * g_tls_file_database_new:
32310 * @anchors: filename of anchor certificate authorities.
32311 * @error: #GError for error reporting, or %NULL to ignore.
32313 * Creates a new #GTlsFileDatabase which uses anchor certificate authorities
32314 * in @anchors to verify certificate chains.
32316 * The certificates in @anchors must be PEM encoded.
32318 * Returns: (transfer full) (type GTlsFileDatabase): the new #GTlsFileDatabase, or %NULL on error
32324 * g_tls_interaction_ask_password:
32325 * @interaction: a #GTlsInteraction object
32326 * @password: a #GTlsPassword object
32327 * @cancellable: an optional #GCancellable cancellation object
32328 * @error: an optional location to place an error on failure
32330 * Run synchronous interaction to ask the user for a password. In general,
32331 * g_tls_interaction_invoke_ask_password() should be used instead of this
32334 * Derived subclasses usually implement a password prompt, although they may
32335 * also choose to provide a password from elsewhere. The @password value will
32336 * be filled in and then @callback will be called. Alternatively the user may
32337 * abort this password request, which will usually abort the TLS connection.
32339 * If the interaction is cancelled by the cancellation object, or by the
32340 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32341 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
32342 * not support immediate cancellation.
32344 * Returns: The status of the ask password interaction.
32350 * g_tls_interaction_ask_password_async:
32351 * @interaction: a #GTlsInteraction object
32352 * @password: a #GTlsPassword object
32353 * @cancellable: an optional #GCancellable cancellation object
32354 * @callback: (allow-none): will be called when the interaction completes
32355 * @user_data: (allow-none): data to pass to the @callback
32357 * Run asynchronous interaction to ask the user for a password. In general,
32358 * g_tls_interaction_invoke_ask_password() should be used instead of this
32361 * Derived subclasses usually implement a password prompt, although they may
32362 * also choose to provide a password from elsewhere. The @password value will
32363 * be filled in and then @callback will be called. Alternatively the user may
32364 * abort this password request, which will usually abort the TLS connection.
32366 * If the interaction is cancelled by the cancellation object, or by the
32367 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32368 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
32369 * not support immediate cancellation.
32371 * Certain implementations may not support immediate cancellation.
32378 * g_tls_interaction_ask_password_finish:
32379 * @interaction: a #GTlsInteraction object
32380 * @result: the result passed to the callback
32381 * @error: an optional location to place an error on failure
32383 * Complete an ask password user interaction request. This should be once
32384 * the g_tls_interaction_ask_password_async() completion callback is called.
32386 * If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
32387 * to g_tls_interaction_ask_password() will have its password filled in.
32389 * If the interaction is cancelled by the cancellation object, or by the
32390 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32391 * contains a %G_IO_ERROR_CANCELLED error code.
32393 * Returns: The status of the ask password interaction.
32399 * g_tls_interaction_invoke_ask_password:
32400 * @interaction: a #GTlsInteraction object
32401 * @password: a #GTlsPassword object
32402 * @cancellable: an optional #GCancellable cancellation object
32403 * @error: an optional location to place an error on failure
32405 * Invoke the interaction to ask the user for a password. It invokes this
32406 * interaction in the main loop, specifically the #GMainContext returned by
32407 * g_main_context_get_thread_default() when the interaction is created. This
32408 * is called by called by #GTlsConnection or #GTlsDatabase to ask the user
32411 * Derived subclasses usually implement a password prompt, although they may
32412 * also choose to provide a password from elsewhere. The @password value will
32413 * be filled in and then @callback will be called. Alternatively the user may
32414 * abort this password request, which will usually abort the TLS connection.
32416 * The implementation can either be a synchronous (eg: modal dialog) or an
32417 * asynchronous one (eg: modeless dialog). This function will take care of
32418 * calling which ever one correctly.
32420 * If the interaction is cancelled by the cancellation object, or by the
32421 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
32422 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
32423 * not support immediate cancellation.
32425 * Returns: The status of the ask password interaction.
32431 * g_tls_password_get_description:
32432 * @password: a #GTlsPassword object
32434 * Get a description string about what the password will be used for.
32436 * Returns: The description of the password.
32442 * g_tls_password_get_flags:
32443 * @password: a #GTlsPassword object
32445 * Get flags about the password.
32447 * Returns: The flags about the password.
32453 * g_tls_password_get_value:
32454 * @password: a #GTlsPassword object
32455 * @length: (allow-none): location to place the length of the password.
32457 * Get the password value. If @length is not %NULL then it will be
32458 * filled in with the length of the password value. (Note that the
32459 * password value is not nul-terminated, so you can only pass %NULL
32460 * for @length in contexts where you know the password will have a
32461 * certain fixed length.)
32463 * Returns: The password value (owned by the password object).
32469 * g_tls_password_get_warning:
32470 * @password: a #GTlsPassword object
32472 * Get a user readable translated warning. Usually this warning is a
32473 * representation of the password flags returned from
32474 * g_tls_password_get_flags().
32476 * Returns: The warning.
32482 * g_tls_password_new:
32483 * @flags: the password flags
32484 * @description: description of what the password is for
32486 * Create a new #GTlsPassword object.
32488 * Returns: (transfer full): The newly allocated password object
32493 * g_tls_password_set_description:
32494 * @password: a #GTlsPassword object
32495 * @description: The description of the password
32497 * Set a description string about what the password will be used for.
32504 * g_tls_password_set_flags:
32505 * @password: a #GTlsPassword object
32506 * @flags: The flags about the password
32508 * Set flags about the password.
32515 * g_tls_password_set_value:
32516 * @password: a #GTlsPassword object
32517 * @value: the new password value
32518 * @length: the length of the password, or -1
32520 * Set the value for this password. The @value will be copied by the password
32523 * Specify the @length, for a non-nul-terminated password. Pass -1 as
32524 * @length if using a nul-terminated password, and @length will be
32525 * calculated automatically. (Note that the terminating nul is not
32526 * considered part of the password in this case.)
32533 * g_tls_password_set_value_full:
32534 * @password: a #GTlsPassword object
32535 * @value: the value for the password
32536 * @length: the length of the password, or -1
32537 * @destroy: (allow-none): a function to use to free the password.
32539 * Provide the value for this password.
32541 * The @value will be owned by the password object, and later freed using
32542 * the @destroy function callback.
32544 * Specify the @length, for a non-nul-terminated password. Pass -1 as
32545 * @length if using a nul-terminated password, and @length will be
32546 * calculated automatically. (Note that the terminating nul is not
32547 * considered part of the password in this case.)
32549 * Virtual: set_value
32555 * g_tls_password_set_warning:
32556 * @password: a #GTlsPassword object
32557 * @warning: The user readable warning
32559 * Set a user readable translated warning. Usually this warning is a
32560 * representation of the password flags returned from
32561 * g_tls_password_get_flags().
32568 * g_tls_server_connection_new:
32569 * @base_io_stream: the #GIOStream to wrap
32570 * @certificate: (allow-none): the default server certificate, or %NULL
32571 * @error: #GError for error reporting, or %NULL to ignore.
32573 * Creates a new #GTlsServerConnection wrapping @base_io_stream (which
32574 * must have pollable input and output streams).
32576 * Returns: (transfer full) (type GTlsServerConnection): the new #GTlsServerConnection, or %NULL on error
32582 * g_unix_connection_receive_credentials:
32583 * @connection: A #GUnixConnection.
32584 * @cancellable: (allow-none): A #GCancellable or %NULL.
32585 * @error: Return location for error or %NULL.
32587 * Receives credentials from the sending end of the connection. The
32588 * sending end has to call g_unix_connection_send_credentials() (or
32589 * similar) for this to work.
32591 * As well as reading the credentials this also reads (and discards) a
32592 * single byte from the stream, as this is required for credentials
32593 * passing to work on some implementations.
32595 * Other ways to exchange credentials with a foreign peer includes the
32596 * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
32598 * Returns: (transfer full): Received credentials on success (free with g_object_unref()), %NULL if @error is set.
32604 * g_unix_connection_receive_credentials_async:
32605 * @connection: A #GUnixConnection.
32606 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32607 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
32608 * @user_data: (closure): the data to pass to callback function
32610 * Asynchronously receive credentials.
32612 * For more details, see g_unix_connection_receive_credentials() which is
32613 * the synchronous version of this call.
32615 * When the operation is finished, @callback will be called. You can then call
32616 * g_unix_connection_receive_credentials_finish() to get the result of the operation.
32623 * g_unix_connection_receive_credentials_finish:
32624 * @connection: A #GUnixConnection.
32625 * @result: a #GAsyncResult.
32626 * @error: a #GError, or %NULL
32628 * Finishes an asynchronous receive credentials operation started with
32629 * g_unix_connection_receive_credentials_async().
32631 * Returns: (transfer full): a #GCredentials, or %NULL on error. Free the returned object with g_object_unref().
32637 * g_unix_connection_receive_fd:
32638 * @connection: a #GUnixConnection
32639 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
32640 * @error: (allow-none): #GError for error reporting, or %NULL to ignore
32642 * Receives a file descriptor from the sending end of the connection.
32643 * The sending end has to call g_unix_connection_send_fd() for this
32646 * As well as reading the fd this also reads a single byte from the
32647 * stream, as this is required for fd passing to work on some
32650 * Returns: a file descriptor on success, -1 on error.
32656 * g_unix_connection_send_credentials:
32657 * @connection: A #GUnixConnection.
32658 * @cancellable: (allow-none): A #GCancellable or %NULL.
32659 * @error: Return location for error or %NULL.
32661 * Passes the credentials of the current user the receiving side
32662 * of the connection. The receiving end has to call
32663 * g_unix_connection_receive_credentials() (or similar) to accept the
32666 * As well as sending the credentials this also writes a single NUL
32667 * byte to the stream, as this is required for credentials passing to
32668 * work on some implementations.
32670 * Other ways to exchange credentials with a foreign peer includes the
32671 * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
32673 * Returns: %TRUE on success, %FALSE if @error is set.
32679 * g_unix_connection_send_credentials_async:
32680 * @connection: A #GUnixConnection.
32681 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32682 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
32683 * @user_data: (closure): the data to pass to callback function
32685 * Asynchronously send credentials.
32687 * For more details, see g_unix_connection_send_credentials() which is
32688 * the synchronous version of this call.
32690 * When the operation is finished, @callback will be called. You can then call
32691 * g_unix_connection_send_credentials_finish() to get the result of the operation.
32698 * g_unix_connection_send_credentials_finish:
32699 * @connection: A #GUnixConnection.
32700 * @result: a #GAsyncResult.
32701 * @error: a #GError, or %NULL
32703 * Finishes an asynchronous send credentials operation started with
32704 * g_unix_connection_send_credentials_async().
32706 * Returns: %TRUE if the operation was successful, otherwise %FALSE.
32712 * g_unix_connection_send_fd:
32713 * @connection: a #GUnixConnection
32714 * @fd: a file descriptor
32715 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32716 * @error: (allow-none): #GError for error reporting, or %NULL to ignore.
32718 * Passes a file descriptor to the receiving side of the
32719 * connection. The receiving end has to call g_unix_connection_receive_fd()
32720 * to accept the file descriptor.
32722 * As well as sending the fd this also writes a single byte to the
32723 * stream, as this is required for fd passing to work on some
32726 * Returns: a %TRUE on success, %NULL on error.
32732 * g_unix_credentials_message_get_credentials:
32733 * @message: A #GUnixCredentialsMessage.
32735 * Gets the credentials stored in @message.
32737 * Returns: (transfer none): A #GCredentials instance. Do not free, it is owned by @message.
32743 * g_unix_credentials_message_is_supported:
32745 * Checks if passing #GCredentials on a #GSocket is supported on this platform.
32747 * Returns: %TRUE if supported, %FALSE otherwise
32753 * g_unix_credentials_message_new:
32755 * Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
32757 * Returns: a new #GUnixCredentialsMessage
32763 * g_unix_credentials_message_new_with_credentials:
32764 * @credentials: A #GCredentials object.
32766 * Creates a new #GUnixCredentialsMessage holding @credentials.
32768 * Returns: a new #GUnixCredentialsMessage
32774 * g_unix_fd_list_append:
32775 * @list: a #GUnixFDList
32776 * @fd: a valid open file descriptor
32777 * @error: a #GError pointer
32779 * Adds a file descriptor to @list.
32781 * The file descriptor is duplicated using dup(). You keep your copy
32782 * of the descriptor and the copy contained in @list will be closed
32783 * when @list is finalized.
32785 * A possible cause of failure is exceeding the per-process or
32786 * system-wide file descriptor limit.
32788 * The index of the file descriptor in the list is returned. If you use
32789 * this index with g_unix_fd_list_get() then you will receive back a
32790 * duplicated copy of the same file descriptor.
32792 * Returns: the index of the appended fd in case of success, else -1 (and @error is set)
32798 * g_unix_fd_list_get:
32799 * @list: a #GUnixFDList
32800 * @index_: the index into the list
32801 * @error: a #GError pointer
32803 * Gets a file descriptor out of @list.
32805 * @index_ specifies the index of the file descriptor to get. It is a
32806 * programmer error for @index_ to be out of range; see
32807 * g_unix_fd_list_get_length().
32809 * The file descriptor is duplicated using dup() and set as
32810 * close-on-exec before being returned. You must call close() on it
32811 * when you are done.
32813 * A possible cause of failure is exceeding the per-process or
32814 * system-wide file descriptor limit.
32816 * Returns: the file descriptor, or -1 in case of error
32822 * g_unix_fd_list_get_length:
32823 * @list: a #GUnixFDList
32825 * Gets the length of @list (ie: the number of file descriptors
32826 * contained within).
32828 * Returns: the length of @list
32834 * g_unix_fd_list_new:
32836 * Creates a new #GUnixFDList containing no file descriptors.
32838 * Returns: a new #GUnixFDList
32844 * g_unix_fd_list_new_from_array:
32845 * @fds: (array length=n_fds): the initial list of file descriptors
32846 * @n_fds: the length of #fds, or -1
32848 * Creates a new #GUnixFDList containing the file descriptors given in
32849 * @fds. The file descriptors become the property of the new list and
32850 * may no longer be used by the caller. The array itself is owned by
32853 * Each file descriptor in the array should be set to close-on-exec.
32855 * If @n_fds is -1 then @fds must be terminated with -1.
32857 * Returns: a new #GUnixFDList
32863 * g_unix_fd_list_peek_fds:
32864 * @list: a #GUnixFDList
32865 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32867 * Returns the array of file descriptors that is contained in this
32870 * After this call, the descriptors remain the property of @list. The
32871 * caller must not close them and must not free the array. The array is
32872 * valid only until @list is changed in any way.
32874 * If @length is non-%NULL then it is set to the number of file
32875 * descriptors in the returned array. The returned array is also
32876 * terminated with -1.
32878 * This function never returns %NULL. In case there are no file
32879 * descriptors contained in @list, an empty array is returned.
32881 * Returns: (array length=length) (transfer none): an array of file descriptors
32887 * g_unix_fd_list_steal_fds:
32888 * @list: a #GUnixFDList
32889 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32891 * Returns the array of file descriptors that is contained in this
32894 * After this call, the descriptors are no longer contained in
32895 * @list. Further calls will return an empty list (unless more
32896 * descriptors have been added).
32898 * The return result of this function must be freed with g_free().
32899 * The caller is also responsible for closing all of the file
32900 * descriptors. The file descriptors in the array are set to
32903 * If @length is non-%NULL then it is set to the number of file
32904 * descriptors in the returned array. The returned array is also
32905 * terminated with -1.
32907 * This function never returns %NULL. In case there are no file
32908 * descriptors contained in @list, an empty array is returned.
32910 * Returns: (array length=length) (transfer full): an array of file descriptors
32916 * g_unix_fd_message_append_fd:
32917 * @message: a #GUnixFDMessage
32918 * @fd: a valid open file descriptor
32919 * @error: a #GError pointer
32921 * Adds a file descriptor to @message.
32923 * The file descriptor is duplicated using dup(). You keep your copy
32924 * of the descriptor and the copy contained in @message will be closed
32925 * when @message is finalized.
32927 * A possible cause of failure is exceeding the per-process or
32928 * system-wide file descriptor limit.
32930 * Returns: %TRUE in case of success, else %FALSE (and @error is set)
32936 * g_unix_fd_message_get_fd_list:
32937 * @message: a #GUnixFDMessage
32939 * Gets the #GUnixFDList contained in @message. This function does not
32940 * return a reference to the caller, but the returned list is valid for
32941 * the lifetime of @message.
32943 * Returns: (transfer none): the #GUnixFDList from @message
32949 * g_unix_fd_message_new:
32951 * Creates a new #GUnixFDMessage containing an empty file descriptor
32954 * Returns: a new #GUnixFDMessage
32960 * g_unix_fd_message_new_with_fd_list:
32961 * @fd_list: a #GUnixFDList
32963 * Creates a new #GUnixFDMessage containing @list.
32965 * Returns: a new #GUnixFDMessage
32971 * g_unix_fd_message_steal_fds:
32972 * @message: a #GUnixFDMessage
32973 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32975 * Returns the array of file descriptors that is contained in this
32978 * After this call, the descriptors are no longer contained in
32979 * @message. Further calls will return an empty list (unless more
32980 * descriptors have been added).
32982 * The return result of this function must be freed with g_free().
32983 * The caller is also responsible for closing all of the file
32986 * If @length is non-%NULL then it is set to the number of file
32987 * descriptors in the returned array. The returned array is also
32988 * terminated with -1.
32990 * This function never returns %NULL. In case there are no file
32991 * descriptors contained in @message, an empty array is returned.
32993 * Returns: (array length=length) (transfer full): an array of file descriptors
32999 * g_unix_input_stream_get_close_fd:
33000 * @stream: a #GUnixInputStream
33002 * Returns whether the file descriptor of @stream will be
33003 * closed when the stream is closed.
33005 * Returns: %TRUE if the file descriptor is closed when done
33011 * g_unix_input_stream_get_fd:
33012 * @stream: a #GUnixInputStream
33014 * Return the UNIX file descriptor that the stream reads from.
33016 * Returns: The file descriptor of @stream
33022 * g_unix_input_stream_new:
33023 * @fd: a UNIX file descriptor
33024 * @close_fd: %TRUE to close the file descriptor when done
33026 * Creates a new #GUnixInputStream for the given @fd.
33028 * If @close_fd is %TRUE, the file descriptor will be closed
33029 * when the stream is closed.
33031 * Returns: a new #GUnixInputStream
33036 * g_unix_input_stream_set_close_fd:
33037 * @stream: a #GUnixInputStream
33038 * @close_fd: %TRUE to close the file descriptor when done
33040 * Sets whether the file descriptor of @stream shall be closed
33041 * when the stream is closed.
33048 * g_unix_is_mount_path_system_internal:
33049 * @mount_path: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
33051 * Determines if @mount_path is considered an implementation of the
33052 * OS. This is primarily used for hiding mountable and mounted volumes
33053 * that only are used in the OS and has little to no relevance to the
33056 * Returns: %TRUE if @mount_path is considered an implementation detail of the OS.
33061 * g_unix_mount_at: (skip)
33062 * @mount_path: path for a possible unix mount.
33063 * @time_read: (out) (allow-none): guint64 to contain a timestamp.
33065 * Gets a #GUnixMountEntry for a given mount path. If @time_read
33066 * is set, it will be filled with a unix timestamp for checking
33067 * if the mounts have changed since with g_unix_mounts_changed_since().
33069 * Returns: (transfer full): a #GUnixMountEntry.
33074 * g_unix_mount_compare:
33075 * @mount1: first #GUnixMountEntry to compare.
33076 * @mount2: second #GUnixMountEntry to compare.
33078 * Compares two unix mounts.
33080 * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
33085 * g_unix_mount_free:
33086 * @mount_entry: a #GUnixMountEntry.
33088 * Frees a unix mount.
33093 * g_unix_mount_get_device_path:
33094 * @mount_entry: a #GUnixMount.
33096 * Gets the device path for a unix mount.
33098 * Returns: a string containing the device path.
33103 * g_unix_mount_get_fs_type:
33104 * @mount_entry: a #GUnixMount.
33106 * Gets the filesystem type for the unix mount.
33108 * Returns: a string containing the file system type.
33113 * g_unix_mount_get_mount_path:
33114 * @mount_entry: input #GUnixMountEntry to get the mount path for.
33116 * Gets the mount path for a unix mount.
33118 * Returns: the mount path for @mount_entry.
33123 * g_unix_mount_guess_can_eject:
33124 * @mount_entry: a #GUnixMountEntry
33126 * Guesses whether a Unix mount can be ejected.
33128 * Returns: %TRUE if @mount_entry is deemed to be ejectable.
33133 * g_unix_mount_guess_icon:
33134 * @mount_entry: a #GUnixMountEntry
33136 * Guesses the icon of a Unix mount.
33138 * Returns: (transfer full): a #GIcon
33143 * g_unix_mount_guess_name:
33144 * @mount_entry: a #GUnixMountEntry
33146 * Guesses the name of a Unix mount.
33147 * The result is a translated string.
33149 * Returns: A newly allocated string that must be freed with g_free()
33154 * g_unix_mount_guess_should_display:
33155 * @mount_entry: a #GUnixMountEntry
33157 * Guesses whether a Unix mount should be displayed in the UI.
33159 * Returns: %TRUE if @mount_entry is deemed to be displayable.
33164 * g_unix_mount_guess_symbolic_icon:
33165 * @mount_entry: a #GUnixMountEntry
33167 * Guesses the symbolic icon of a Unix mount.
33169 * Returns: (transfer full): a #GIcon
33175 * g_unix_mount_is_readonly:
33176 * @mount_entry: a #GUnixMount.
33178 * Checks if a unix mount is mounted read only.
33180 * Returns: %TRUE if @mount_entry is read only.
33185 * g_unix_mount_is_system_internal:
33186 * @mount_entry: a #GUnixMount.
33188 * Checks if a unix mount is a system path.
33190 * Returns: %TRUE if the unix mount is for a system path.
33195 * g_unix_mount_monitor_new:
33197 * Gets a new #GUnixMountMonitor. The default rate limit for which the
33198 * monitor will report consecutive changes for the mount and mount
33199 * point entry files is the default for a #GFileMonitor. Use
33200 * g_unix_mount_monitor_set_rate_limit() to change this.
33202 * Returns: a #GUnixMountMonitor.
33207 * g_unix_mount_monitor_set_rate_limit:
33208 * @mount_monitor: a #GUnixMountMonitor
33209 * @limit_msec: a integer with the limit in milliseconds to poll for changes.
33211 * Sets the rate limit to which the @mount_monitor will report
33212 * consecutive change events to the mount and mount point entry files.
33219 * g_unix_mount_point_compare:
33220 * @mount1: a #GUnixMount.
33221 * @mount2: a #GUnixMount.
33223 * Compares two unix mount points.
33225 * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
33230 * g_unix_mount_point_free:
33231 * @mount_point: unix mount point to free.
33233 * Frees a unix mount point.
33238 * g_unix_mount_point_get_device_path:
33239 * @mount_point: a #GUnixMountPoint.
33241 * Gets the device path for a unix mount point.
33243 * Returns: a string containing the device path.
33248 * g_unix_mount_point_get_fs_type:
33249 * @mount_point: a #GUnixMountPoint.
33251 * Gets the file system type for the mount point.
33253 * Returns: a string containing the file system type.
33258 * g_unix_mount_point_get_mount_path:
33259 * @mount_point: a #GUnixMountPoint.
33261 * Gets the mount path for a unix mount point.
33263 * Returns: a string containing the mount path.
33268 * g_unix_mount_point_get_options:
33269 * @mount_point: a #GUnixMountPoint.
33271 * Gets the options for the mount point.
33273 * Returns: a string containing the options.
33279 * g_unix_mount_point_guess_can_eject:
33280 * @mount_point: a #GUnixMountPoint
33282 * Guesses whether a Unix mount point can be ejected.
33284 * Returns: %TRUE if @mount_point is deemed to be ejectable.
33289 * g_unix_mount_point_guess_icon:
33290 * @mount_point: a #GUnixMountPoint
33292 * Guesses the icon of a Unix mount point.
33294 * Returns: (transfer full): a #GIcon
33299 * g_unix_mount_point_guess_name:
33300 * @mount_point: a #GUnixMountPoint
33302 * Guesses the name of a Unix mount point.
33303 * The result is a translated string.
33305 * Returns: A newly allocated string that must be freed with g_free()
33310 * g_unix_mount_point_guess_symbolic_icon:
33311 * @mount_point: a #GUnixMountPoint
33313 * Guesses the symbolic icon of a Unix mount point.
33315 * Returns: (transfer full): a #GIcon
33321 * g_unix_mount_point_is_loopback:
33322 * @mount_point: a #GUnixMountPoint.
33324 * Checks if a unix mount point is a loopback device.
33326 * Returns: %TRUE if the mount point is a loopback. %FALSE otherwise.
33331 * g_unix_mount_point_is_readonly:
33332 * @mount_point: a #GUnixMountPoint.
33334 * Checks if a unix mount point is read only.
33336 * Returns: %TRUE if a mount point is read only.
33341 * g_unix_mount_point_is_user_mountable:
33342 * @mount_point: a #GUnixMountPoint.
33344 * Checks if a unix mount point is mountable by the user.
33346 * Returns: %TRUE if the mount point is user mountable.
33351 * g_unix_mount_points_changed_since:
33352 * @time: guint64 to contain a timestamp.
33354 * Checks if the unix mount points have changed since a given unix time.
33356 * Returns: %TRUE if the mount points have changed since @time.
33361 * g_unix_mount_points_get: (skip)
33362 * @time_read: (out) (allow-none): guint64 to contain a timestamp.
33364 * Gets a #GList of #GUnixMountPoint containing the unix mount points.
33365 * If @time_read is set, it will be filled with the mount timestamp,
33366 * allowing for checking if the mounts have changed with
33367 * g_unix_mount_points_changed_since().
33369 * Returns: (element-type GUnixMountPoint) (transfer full): a #GList of the UNIX mountpoints.
33374 * g_unix_mounts_changed_since:
33375 * @time: guint64 to contain a timestamp.
33377 * Checks if the unix mounts have changed since a given unix time.
33379 * Returns: %TRUE if the mounts have changed since @time.
33384 * g_unix_mounts_get: (skip)
33385 * @time_read: (out) (allow-none): guint64 to contain a timestamp, or %NULL
33387 * Gets a #GList of #GUnixMountEntry containing the unix mounts.
33388 * If @time_read is set, it will be filled with the mount
33389 * timestamp, allowing for checking if the mounts have changed
33390 * with g_unix_mounts_changed_since().
33392 * Returns: (element-type GUnixMountEntry) (transfer full): a #GList of the UNIX mounts.
33397 * g_unix_output_stream_get_close_fd:
33398 * @stream: a #GUnixOutputStream
33400 * Returns whether the file descriptor of @stream will be
33401 * closed when the stream is closed.
33403 * Returns: %TRUE if the file descriptor is closed when done
33409 * g_unix_output_stream_get_fd:
33410 * @stream: a #GUnixOutputStream
33412 * Return the UNIX file descriptor that the stream writes to.
33414 * Returns: The file descriptor of @stream
33420 * g_unix_output_stream_new:
33421 * @fd: a UNIX file descriptor
33422 * @close_fd: %TRUE to close the file descriptor when done
33424 * Creates a new #GUnixOutputStream for the given @fd.
33426 * If @close_fd, is %TRUE, the file descriptor will be closed when
33427 * the output stream is destroyed.
33429 * Returns: a new #GOutputStream
33434 * g_unix_output_stream_set_close_fd:
33435 * @stream: a #GUnixOutputStream
33436 * @close_fd: %TRUE to close the file descriptor when done
33438 * Sets whether the file descriptor of @stream shall be closed
33439 * when the stream is closed.
33446 * g_unix_socket_address_abstract_names_supported:
33448 * Checks if abstract UNIX domain socket names are supported.
33450 * Returns: %TRUE if supported, %FALSE otherwise
33456 * g_unix_socket_address_get_address_type:
33457 * @address: a #GInetSocketAddress
33459 * Gets @address's type.
33461 * Returns: a #GUnixSocketAddressType
33467 * g_unix_socket_address_get_is_abstract:
33468 * @address: a #GInetSocketAddress
33470 * Tests if @address is abstract.
33472 * Returns: %TRUE if the address is abstract, %FALSE otherwise
33474 * Deprecated: Use g_unix_socket_address_get_address_type()
33479 * g_unix_socket_address_get_path:
33480 * @address: a #GInetSocketAddress
33482 * Gets @address's path, or for abstract sockets the "name".
33484 * Guaranteed to be zero-terminated, but an abstract socket
33485 * may contain embedded zeros, and thus you should use
33486 * g_unix_socket_address_get_path_len() to get the true length
33489 * Returns: the path for @address
33495 * g_unix_socket_address_get_path_len:
33496 * @address: a #GInetSocketAddress
33498 * Gets the length of @address's path.
33500 * For details, see g_unix_socket_address_get_path().
33502 * Returns: the length of the path
33508 * g_unix_socket_address_new:
33509 * @path: the socket path
33511 * Creates a new #GUnixSocketAddress for @path.
33513 * To create abstract socket addresses, on systems that support that,
33514 * use g_unix_socket_address_new_abstract().
33516 * Returns: a new #GUnixSocketAddress
33522 * g_unix_socket_address_new_abstract:
33523 * @path: (array length=path_len) (element-type gchar): the abstract name
33524 * @path_len: the length of @path, or -1
33526 * Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
33527 * #GUnixSocketAddress for @path.
33529 * Returns: a new #GUnixSocketAddress
33530 * Deprecated: Use g_unix_socket_address_new_with_type().
33535 * g_unix_socket_address_new_with_type:
33536 * @path: (array length=path_len) (element-type gchar): the name
33537 * @path_len: the length of @path, or -1
33538 * @type: a #GUnixSocketAddressType
33540 * Creates a new #GUnixSocketAddress of type @type with name @path.
33542 * If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
33543 * calling g_unix_socket_address_new().
33545 * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
33546 * bytes of @path will be copied to the socket's path, and only those
33547 * bytes will be considered part of the name. (If @path_len is -1,
33548 * then @path is assumed to be NUL-terminated.) For example, if @path
33549 * was "test", then calling g_socket_address_get_native_size() on the
33550 * returned socket would return 7 (2 bytes of overhead, 1 byte for the
33551 * abstract-socket indicator byte, and 4 bytes for the name "test").
33553 * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
33554 * @path_len bytes of @path will be copied to the socket's path, the
33555 * rest of the path will be padded with 0 bytes, and the entire
33556 * zero-padded buffer will be considered the name. (As above, if
33557 * @path_len is -1, then @path is assumed to be NUL-terminated.) In
33558 * this case, g_socket_address_get_native_size() will always return
33559 * the full size of a <literal>struct sockaddr_un</literal>, although
33560 * g_unix_socket_address_get_path_len() will still return just the
33563 * %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
33564 * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
33565 * when connecting to a server created by another process, you must
33566 * use the appropriate type corresponding to how that process created
33567 * its listening socket.
33569 * Returns: a new #GUnixSocketAddress
33575 * g_vfs_get_default:
33577 * Gets the default #GVfs for the system.
33579 * Returns: (transfer none): a #GVfs.
33584 * g_vfs_get_file_for_path:
33586 * @path: a string containing a VFS path.
33588 * Gets a #GFile for @path.
33590 * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
33595 * g_vfs_get_file_for_uri:
33597 * @uri: a string containing a URI
33599 * Gets a #GFile for @uri.
33601 * This operation never fails, but the returned object
33602 * might not support any I/O operation if the URI
33603 * is malformed or if the URI scheme is not supported.
33605 * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
33612 * Gets the local #GVfs for the system.
33614 * Returns: (transfer none): a #GVfs.
33619 * g_vfs_get_supported_uri_schemes:
33622 * Gets a list of URI schemes supported by @vfs.
33624 * Returns: (transfer none): a %NULL-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
33632 * Checks if the VFS is active.
33634 * Returns: %TRUE if construction of the @vfs was successful and it is now active.
33639 * g_vfs_parse_name:
33641 * @parse_name: a string to be parsed by the VFS module.
33643 * This operation never fails, but the returned object might
33644 * not support any I/O operations if the @parse_name cannot
33645 * be parsed by the #GVfs module.
33647 * Returns: (transfer full): a #GFile for the given @parse_name. Free the returned object with g_object_unref().
33652 * g_volume_can_eject:
33653 * @volume: a #GVolume.
33655 * Checks if a volume can be ejected.
33657 * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise.
33662 * g_volume_can_mount:
33663 * @volume: a #GVolume.
33665 * Checks if a volume can be mounted.
33667 * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise.
33673 * @volume: a #GVolume.
33674 * @flags: flags affecting the unmount if required for eject
33675 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33676 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33677 * @user_data: user data that gets passed to @callback
33679 * Ejects a volume. This is an asynchronous operation, and is
33680 * finished by calling g_volume_eject_finish() with the @volume
33681 * and #GAsyncResult returned in the @callback.
33683 * Deprecated: 2.22: Use g_volume_eject_with_operation() instead.
33688 * g_volume_eject_finish:
33689 * @volume: pointer to a #GVolume.
33690 * @result: a #GAsyncResult.
33691 * @error: a #GError location to store an error, or %NULL to ignore
33693 * Finishes ejecting a volume. If any errors occurred during the operation,
33694 * @error will be set to contain the errors and %FALSE will be returned.
33696 * Returns: %TRUE, %FALSE if operation failed.
33697 * Deprecated: 2.22: Use g_volume_eject_with_operation_finish() instead.
33702 * g_volume_eject_with_operation:
33703 * @volume: a #GVolume.
33704 * @flags: flags affecting the unmount if required for eject
33705 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
33706 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33707 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33708 * @user_data: user data passed to @callback.
33710 * Ejects a volume. This is an asynchronous operation, and is
33711 * finished by calling g_volume_eject_with_operation_finish() with the @volume
33712 * and #GAsyncResult data returned in the @callback.
33719 * g_volume_eject_with_operation_finish:
33720 * @volume: a #GVolume.
33721 * @result: a #GAsyncResult.
33722 * @error: a #GError location to store the error occurring, or %NULL to ignore.
33724 * Finishes ejecting a volume. If any errors occurred during the operation,
33725 * @error will be set to contain the errors and %FALSE will be returned.
33727 * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise.
33733 * g_volume_enumerate_identifiers:
33734 * @volume: a #GVolume
33736 * Gets the kinds of <link linkend="volume-identifier">identifiers</link>
33737 * that @volume has. Use g_volume_get_identifier() to obtain
33738 * the identifiers themselves.
33740 * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
33745 * g_volume_get_activation_root:
33746 * @volume: a #GVolume
33748 * Gets the activation root for a #GVolume if it is known ahead of
33749 * mount time. Returns %NULL otherwise. If not %NULL and if @volume
33750 * is mounted, then the result of g_mount_get_root() on the
33751 * #GMount object obtained from g_volume_get_mount() will always
33752 * either be equal or a prefix of what this function returns. In
33753 * other words, in code
33757 * GFile *mount_root
33758 * GFile *volume_activation_root;
33760 * mount = g_volume_get_mount (volume); /* mounted, so never NULL */
33761 * mount_root = g_mount_get_root (mount);
33762 * volume_activation_root = g_volume_get_activation_root(volume); /* assume not NULL */
33763 * </programlisting>
33765 * then the expression
33768 * (g_file_has_prefix (volume_activation_root, mount_root) ||
33769 * g_file_equal (volume_activation_root, mount_root))
33770 * </programlisting>
33772 * will always be %TRUE.
33774 * Activation roots are typically used in #GVolumeMonitor
33775 * implementations to find the underlying mount to shadow, see
33776 * g_mount_is_shadowed() for more details.
33778 * Returns: (transfer full): the activation root of @volume or %NULL. Use g_object_unref() to free.
33784 * g_volume_get_drive:
33785 * @volume: a #GVolume.
33787 * Gets the drive for the @volume.
33789 * 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.
33794 * g_volume_get_icon:
33795 * @volume: a #GVolume.
33797 * Gets the icon for @volume.
33799 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
33804 * g_volume_get_identifier:
33805 * @volume: a #GVolume
33806 * @kind: the kind of identifier to return
33808 * Gets the identifier of the given kind for @volume.
33809 * See the <link linkend="volume-identifier">introduction</link>
33810 * for more information about volume identifiers.
33812 * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GVolume doesn't have this kind of identifier
33817 * g_volume_get_mount:
33818 * @volume: a #GVolume.
33820 * Gets the mount for the @volume.
33822 * 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.
33827 * g_volume_get_name:
33828 * @volume: a #GVolume.
33830 * Gets the name of @volume.
33832 * Returns: the name for the given @volume. The returned string should be freed with g_free() when no longer needed.
33837 * g_volume_get_sort_key:
33838 * @volume: A #GVolume.
33840 * Gets the sort key for @volume, if any.
33842 * Returns: Sorting key for @volume or %NULL if no such key is available.
33848 * g_volume_get_symbolic_icon:
33849 * @volume: a #GVolume.
33851 * Gets the symbolic icon for @volume.
33853 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
33859 * g_volume_get_uuid:
33860 * @volume: a #GVolume.
33862 * Gets the UUID for the @volume. The reference is typically based on
33863 * the file system UUID for the volume in question and should be
33864 * considered an opaque string. Returns %NULL if there is no UUID
33867 * 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.
33872 * g_volume_monitor_adopt_orphan_mount:
33873 * @mount: a #GMount object to find a parent for
33875 * This function should be called by any #GVolumeMonitor
33876 * implementation when a new #GMount object is created that is not
33877 * associated with a #GVolume object. It must be called just before
33878 * emitting the @mount_added signal.
33880 * If the return value is not %NULL, the caller must associate the
33881 * returned #GVolume object with the #GMount. This involves returning
33882 * it in its g_mount_get_volume() implementation. The caller must
33883 * also listen for the "removed" signal on the returned object
33884 * and give up its reference when handling that signal
33886 * Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
33887 * the implementor must take a reference to @mount and return it in
33888 * its g_volume_get_mount() implemented. Also, the implementor must
33889 * listen for the "unmounted" signal on @mount and give up its
33890 * reference upon handling that signal.
33892 * There are two main use cases for this function.
33894 * One is when implementing a user space file system driver that reads
33895 * blocks of a block device that is already represented by the native
33896 * volume monitor (for example a CD Audio file system driver). Such
33897 * a driver will generate its own #GMount object that needs to be
33898 * associated with the #GVolume object that represents the volume.
33900 * The other is for implementing a #GVolumeMonitor whose sole purpose
33901 * is to return #GVolume objects representing entries in the users
33902 * "favorite servers" list or similar.
33904 * Returns: (transfer full): the #GVolume object that is the parent for @mount or %NULL if no wants to adopt the #GMount.
33905 * 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.
33910 * g_volume_monitor_get:
33912 * Gets the volume monitor used by gio.
33914 * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call g_object_unref() when done with it.
33919 * g_volume_monitor_get_connected_drives:
33920 * @volume_monitor: a #GVolumeMonitor.
33922 * Gets a list of drives connected to the system.
33924 * The returned list should be freed with g_list_free(), after
33925 * its elements have been unreffed with g_object_unref().
33927 * Returns: (element-type GDrive) (transfer full): a #GList of connected #GDrive objects.
33932 * g_volume_monitor_get_mount_for_uuid:
33933 * @volume_monitor: a #GVolumeMonitor.
33934 * @uuid: the UUID to look for
33936 * Finds a #GMount object by its UUID (see g_mount_get_uuid())
33938 * Returns: (transfer full): a #GMount or %NULL if no such mount is available. Free the returned object with g_object_unref().
33943 * g_volume_monitor_get_mounts:
33944 * @volume_monitor: a #GVolumeMonitor.
33946 * Gets a list of the mounts on the system.
33948 * The returned list should be freed with g_list_free(), after
33949 * its elements have been unreffed with g_object_unref().
33951 * Returns: (element-type GMount) (transfer full): a #GList of #GMount objects.
33956 * g_volume_monitor_get_volume_for_uuid:
33957 * @volume_monitor: a #GVolumeMonitor.
33958 * @uuid: the UUID to look for
33960 * Finds a #GVolume object by its UUID (see g_volume_get_uuid())
33962 * Returns: (transfer full): a #GVolume or %NULL if no such volume is available. Free the returned object with g_object_unref().
33967 * g_volume_monitor_get_volumes:
33968 * @volume_monitor: a #GVolumeMonitor.
33970 * Gets a list of the volumes on the system.
33972 * The returned list should be freed with g_list_free(), after
33973 * its elements have been unreffed with g_object_unref().
33975 * Returns: (element-type GVolume) (transfer full): a #GList of #GVolume objects.
33981 * @volume: a #GVolume.
33982 * @flags: flags affecting the operation
33983 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
33984 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33985 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33986 * @user_data: user data that gets passed to @callback
33988 * Mounts a volume. This is an asynchronous operation, and is
33989 * finished by calling g_volume_mount_finish() with the @volume
33990 * and #GAsyncResult returned in the @callback.
33992 * Virtual: mount_fn
33997 * g_volume_mount_finish:
33998 * @volume: a #GVolume
33999 * @result: a #GAsyncResult
34000 * @error: a #GError location to store an error, or %NULL to ignore
34002 * Finishes mounting a volume. If any errors occurred during the operation,
34003 * @error will be set to contain the errors and %FALSE will be returned.
34005 * If the mount operation succeeded, g_volume_get_mount() on @volume
34006 * is guaranteed to return the mount right after calling this
34007 * function; there's no need to listen for the 'mount-added' signal on
34010 * Returns: %TRUE, %FALSE if operation failed.
34015 * g_volume_should_automount:
34016 * @volume: a #GVolume
34018 * Returns whether the volume should be automatically mounted.
34020 * Returns: %TRUE if the volume should be automatically mounted.
34025 * g_win32_input_stream_get_close_handle:
34026 * @stream: a #GWin32InputStream
34028 * Returns whether the handle of @stream will be
34029 * closed when the stream is closed.
34031 * Returns: %TRUE if the handle is closed when done
34037 * g_win32_input_stream_get_handle:
34038 * @stream: a #GWin32InputStream
34040 * Return the Windows file handle that the stream reads from.
34042 * Returns: The file handle of @stream
34048 * g_win32_input_stream_new:
34049 * @handle: a Win32 file handle
34050 * @close_handle: %TRUE to close the handle when done
34052 * Creates a new #GWin32InputStream for the given @handle.
34054 * If @close_handle is %TRUE, the handle will be closed
34055 * when the stream is closed.
34057 * Note that "handle" here means a Win32 HANDLE, not a "file descriptor"
34058 * as used in the Windows C libraries.
34060 * Returns: a new #GWin32InputStream
34065 * g_win32_input_stream_set_close_handle:
34066 * @stream: a #GWin32InputStream
34067 * @close_handle: %TRUE to close the handle when done
34069 * Sets whether the handle of @stream shall be closed
34070 * when the stream is closed.
34077 * g_win32_output_stream_get_close_handle:
34078 * @stream: a #GWin32OutputStream
34080 * Returns whether the handle of @stream will be closed when the
34081 * stream is closed.
34083 * Returns: %TRUE if the handle is closed when done
34089 * g_win32_output_stream_get_handle:
34090 * @stream: a #GWin32OutputStream
34092 * Return the Windows handle that the stream writes to.
34094 * Returns: The handle descriptor of @stream
34100 * g_win32_output_stream_new:
34101 * @handle: a Win32 file handle
34102 * @close_handle: %TRUE to close the handle when done
34104 * Creates a new #GWin32OutputStream for the given @handle.
34106 * If @close_handle, is %TRUE, the handle will be closed when the
34107 * output stream is destroyed.
34109 * Returns: a new #GOutputStream
34115 * g_win32_output_stream_set_close_handle:
34116 * @stream: a #GWin32OutputStream
34117 * @close_handle: %TRUE to close the handle when done
34119 * Sets whether the handle of @stream shall be closed when the stream
34127 * g_zlib_compressor_get_file_info:
34128 * @compressor: a #GZlibCompressor
34130 * Returns the #GZlibCompressor:file-info property.
34132 * Returns: (transfer none): a #GFileInfo, or %NULL
34138 * g_zlib_compressor_new:
34139 * @format: The format to use for the compressed data
34140 * @level: compression level (0-9), -1 for default
34142 * Creates a new #GZlibCompressor.
34144 * Returns: a new #GZlibCompressor
34150 * g_zlib_compressor_set_file_info:
34151 * @compressor: a #GZlibCompressor
34152 * @file_info: (allow-none): a #GFileInfo
34154 * Sets @file_info in @compressor. If non-%NULL, and @compressor's
34155 * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
34156 * it will be used to set the file name and modification time in
34157 * the GZIP header of the compressed data.
34159 * Note: it is an error to call this function while a compression is in
34160 * progress; it may only be called immediately after creation of @compressor,
34161 * or after resetting it with g_converter_reset().
34168 * g_zlib_decompressor_get_file_info:
34169 * @decompressor: a #GZlibDecompressor
34171 * Retrieves the #GFileInfo constructed from the GZIP header data
34172 * of compressed data processed by @compressor, or %NULL if @decompressor's
34173 * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
34174 * or the header data was not fully processed yet, or it not present in the
34175 * data stream at all.
34177 * Returns: (transfer none): a #GFileInfo, or %NULL
34183 * g_zlib_decompressor_new:
34184 * @format: The format to use for the compressed data
34186 * Creates a new #GZlibDecompressor.
34188 * Returns: a new #GZlibDecompressor
34194 * get_all_desktop_entries_for_mime_type:
34195 * @mime_type: a mime type.
34196 * @except: NULL or a strv list
34198 * Returns all the desktop ids for @mime_type. The desktop files
34199 * are listed in an order so that default applications are listed before
34200 * non-default ones, and handlers for inherited mimetypes are listed
34201 * after the base ones.
34203 * Optionally doesn't list the desktop ids given in the @except
34205 * Returns: a #GList containing the desktop ids which claim to handle @mime_type.
34210 * mime_info_cache_reload:
34211 * @dir: directory path which needs reloading.
34213 * Reload the mime information for the @dir.
34218 /************************************************************/
34219 /* THIS FILE IS GENERATED DO NOT EDIT */
34220 /************************************************************/