1 /************************************************************/
2 /* THIS FILE IS GENERATED DO NOT EDIT */
3 /************************************************************/
8 * If @action is currently enabled.
10 * If the action is disabled then calls to g_action_activate() and
11 * g_action_change_state() have no effect.
20 * The name of the action. This is mostly meaningful for identifying
21 * the action once it has been added to a #GActionGroup.
28 * GAction:parameter-type:
30 * The type of the parameter that must be given when activating the
40 * The state of the action, or %NULL if the action is stateless.
49 * The #GVariantType of the state that the action has, or %NULL if the
50 * action is stateless.
58 * @name: the name of the action
59 * @activate: the callback to connect to the "activate" signal of the action
60 * @parameter_type: the type of the parameter that must be passed to the activate function for this action, given as a single GVariant type string (or %NULL for no parameter)
61 * @state: the initial state for this action, given in GVariant text format. The state is parsed with no extra type information, so type tags must be added to the string if they are necessary.
62 * @change_state: the callback to connect to the "change-state" signal of the action
64 * This struct defines a single action. It is for use with
65 * g_action_map_add_action_entries().
67 * The order of the items in the structure are intended to reflect
68 * frequency of use. It is permissible to use an incomplete initialiser
69 * in order to leave some of the later values as %NULL. All values
70 * after @name are optional. Additional optional fields may be added in
73 * See g_action_map_add_action_entries() for an example.
78 * GActionGroup::action-added:
79 * @action_group: the #GActionGroup that changed
80 * @action_name: the name of the action in @action_group
82 * Signals that a new action was just added to the group.
83 * This signal is emitted after the action has been added
91 * GActionGroup::action-enabled-changed:
92 * @action_group: the #GActionGroup that changed
93 * @action_name: the name of the action in @action_group
94 * @enabled: whether the action is enabled or not
96 * Signals that the enabled status of the named action has changed.
103 * GActionGroup::action-removed:
104 * @action_group: the #GActionGroup that changed
105 * @action_name: the name of the action in @action_group
107 * Signals that an action is just about to be removed from the group.
108 * This signal is emitted before the action is removed, so the action
109 * is still visible and can be queried from the signal handler.
116 * GActionGroup::action-state-changed:
117 * @action_group: the #GActionGroup that changed
118 * @action_name: the name of the action in @action_group
119 * @value: the new value of the state
121 * Signals that the state of the named action has changed.
128 * GActionGroupInterface:
129 * @has_action: the virtual function pointer for g_action_group_has_action()
130 * @list_actions: the virtual function pointer for g_action_group_list_actions()
131 * @get_action_parameter_type: the virtual function pointer for g_action_group_get_action_parameter_type()
132 * @get_action_state_type: the virtual function pointer for g_action_group_get_action_state_type()
133 * @get_action_state_hint: the virtual function pointer for g_action_group_get_action_state_hint()
134 * @get_action_enabled: the virtual function pointer for g_action_group_get_action_enabled()
135 * @get_action_state: the virtual function pointer for g_action_group_get_action_state()
136 * @change_action_state: the virtual function pointer for g_action_group_change_action_state()
137 * @query_action: the virtual function pointer for g_action_group_query_action()
138 * @activate_action: the virtual function pointer for g_action_group_activate_action()
139 * @action_added: the class closure for the #GActionGroup::action-added signal
140 * @action_removed: the class closure for the #GActionGroup::action-removed signal
141 * @action_enabled_changed: the class closure for the #GActionGroup::action-enabled-changed signal
142 * @action_state_changed: the class closure for the #GActionGroup::action-enabled-changed signal
144 * The virtual function table for #GActionGroup.
152 * @get_name: the virtual function pointer for g_action_get_name()
153 * @get_parameter_type: the virtual function pointer for g_action_get_parameter_type()
154 * @get_state_type: the virtual function pointer for g_action_get_state_type()
155 * @get_state_hint: the virtual function pointer for g_action_get_state_hint()
156 * @get_enabled: the virtual function pointer for g_action_get_enabled()
157 * @get_state: the virtual function pointer for g_action_get_state()
158 * @change_state: the virtual function pointer for g_action_change_state()
159 * @activate: the virtual function pointer for g_action_activate(). Note that #GAction does not have an 'activate' signal but that implementations of it may have one.
161 * The virtual function table for #GAction.
168 * GActionMapInterface:
169 * @lookup_action: the virtual function pointer for g_action_map_lookup_action()
170 * @add_action: the virtual function pointer for g_action_map_add_action()
171 * @remove_action: the virtual function pointer for g_action_map_remove_action()
173 * The virtual function table for #GActionMap.
180 * GApplication::activate:
181 * @application: the application
183 * The ::activate signal is emitted on the primary instance when an
184 * activation occurs. See g_application_activate().
189 * GApplication::command-line:
190 * @application: the application
191 * @command_line: a #GApplicationCommandLine representing the passed commandline
193 * The ::command-line signal is emitted on the primary instance when
194 * a commandline is not handled locally. See g_application_run() and
195 * the #GApplicationCommandLine documentation for more information.
197 * Returns: An integer that is set as the exit status for the calling process. See g_application_command_line_set_exit_status().
202 * GApplication::open:
203 * @application: the application
204 * @files: (array length=n_files) (element-type GFile): an array of #GFiles
205 * @n_files: the length of @files
206 * @hint: a hint provided by the calling instance
208 * The ::open signal is emitted on the primary instance when there are
209 * files to open. See g_application_open() for more information.
214 * GApplication::shutdown:
215 * @application: the application
217 * The ::shutdown signal is emitted only on the registered primary instance
218 * immediately after the main loop terminates.
223 * GApplication::startup:
224 * @application: the application
226 * The ::startup signal is emitted on the primary instance immediately
227 * after registration. See g_application_register().
233 * @startup: invoked on the primary instance immediately after registration
234 * @shutdown: invoked only on the registered primary instance immediately after the main loop terminates
235 * @activate: invoked on the primary instance when an activation occurs
236 * @open: invoked on the primary instance when there are files to open
237 * @command_line: invoked on the primary instance when a command-line is not handled locally
238 * @local_command_line: invoked (locally) when the process has been invoked via commandline execution (as opposed to, say, D-Bus activation - which is not currently supported by GApplication). The virtual function has the chance to inspect (and possibly replace) the list of command line arguments. See g_application_run() for more information.
239 * @before_emit: invoked on the primary instance before 'activate', 'open', 'command-line' or any action invocation, gets the 'platform data' from the calling instance
240 * @after_emit: invoked on the primary instance after 'activate', 'open', 'command-line' or any action invocation, gets the 'platform data' from the calling instance
241 * @add_platform_data: invoked (locally) to add 'platform data' to be sent to the primary instance when activating, opening or invoking actions
242 * @quit_mainloop: Used to be invoked on the primary instance when the use count of the application drops to zero (and after any inactivity timeout, if requested). Not used anymore since 2.32
243 * @run_mainloop: Used to be invoked on the primary instance from g_application_run() if the use-count is non-zero. Since 2.32, GApplication is iterating the main context directly and is not using @run_mainloop anymore
244 * @dbus_register: invoked locally during registration, if the application is using its D-Bus backend. You can use this to export extra objects on the bus, that need to exist before the application tries to own the bus name. The function is passed the #GDBusConnection to to session bus, and the object path that #GApplication will use to export is D-Bus API. If this function returns %TRUE, registration will proceed; otherwise registration will abort. Since: 2.34
245 * @dbus_unregister: invoked locally during unregistration, if the application is using its D-Bus backend. Use this to undo anything done by the @dbus_register vfunc. Since: 2.34
247 * Virtual function table for #GApplication.
254 * GApplicationCommandLineClass:
256 * The <structname>GApplicationCommandLineClass</structname> structure
257 * contains private data only
264 * GCancellable::cancelled:
265 * @cancellable: a #GCancellable.
267 * Emitted when the operation has been cancelled.
269 * Can be used by implementations of cancellable operations. If the
270 * operation is cancelled from another thread, the signal will be
271 * emitted in the thread that cancelled the operation, not the
272 * thread that is running the operation.
274 * Note that disconnecting from this signal (or any signal) in a
275 * multi-threaded program is prone to race conditions. For instance
276 * it is possible that a signal handler may be invoked even
277 * <emphasis>after</emphasis> a call to
278 * g_signal_handler_disconnect() for that handler has already
281 * There is also a problem when cancellation happen
282 * right before connecting to the signal. If this happens the
283 * signal will unexpectedly not be emitted, and checking before
284 * connecting to the signal leaves a race condition where this is
287 * In order to make it safe and easy to connect handlers there
288 * are two helper functions: g_cancellable_connect() and
289 * g_cancellable_disconnect() which protect against problems
292 * An example of how to us this:
294 * /<!-- -->* Make sure we don't do any unnecessary work if already cancelled *<!-- -->/
295 * if (g_cancellable_set_error_if_cancelled (cancellable))
298 * /<!-- -->* Set up all the data needed to be able to
299 * * handle cancellation of the operation *<!-- -->/
300 * my_data = my_data_new (...);
304 * id = g_cancellable_connect (cancellable,
305 * G_CALLBACK (cancelled_handler)
308 * /<!-- -->* cancellable operation here... *<!-- -->/
310 * g_cancellable_disconnect (cancellable, id);
312 * /<!-- -->* cancelled_handler is never called after this, it
313 * * is now safe to free the data *<!-- -->/
314 * my_data_free (my_data);
317 * Note that the cancelled signal is emitted in the thread that
318 * the user cancelled from, which may be the main thread. So, the
319 * cancellable signal should not do something that can block.
326 * Conversions between character sets.
333 * The #GCredentials structure contains only private data and
334 * should only be accessed using the provided API.
343 * Class structure for #GCredentials.
350 * GDBusAuthMechanism:credentials:
352 * If authenticating as a server, this property contains the
353 * received credentials, if any.
355 * If authenticating as a client, the property contains the
356 * credentials that were sent, if any.
363 * The #GDBusAuthObserver structure contains only private data and
364 * should only be accessed using the provided API.
371 * GDBusAuthObserver::allow-mechanism:
372 * @observer: The #GDBusAuthObserver emitting the signal.
373 * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
375 * Emitted to check if @mechanism is allowed to be used.
377 * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
383 * GDBusAuthObserver::authorize-authenticated-peer:
384 * @observer: The #GDBusAuthObserver emitting the signal.
385 * @stream: A #GIOStream for the #GDBusConnection.
386 * @credentials: (allow-none): Credentials received from the peer or %NULL.
388 * Emitted to check if a peer that is successfully authenticated
391 * Returns: %TRUE if the peer is authorized, %FALSE if not.
397 * GDBusAuthObserverClass:
398 * @authorize_authenticated_peer: Signal class handler for the #GDBusAuthObserver::authorize-authenticated-peer signal.
400 * Class structure for #GDBusAuthObserverClass.
409 * The #GDBusConnection structure contains only private data and
410 * should only be accessed using the provided API.
417 * GDBusConnection::closed:
418 * @connection: The #GDBusConnection emitting the signal.
419 * @remote_peer_vanished: %TRUE if @connection is closed because the remote peer closed its end of the connection.
420 * @error: (allow-none): A #GError with more details about the event or %NULL.
422 * Emitted when the connection is closed.
424 * The cause of this event can be
427 * If g_dbus_connection_close() is called. In this case
428 * @remote_peer_vanished is set to %FALSE and @error is %NULL.
431 * If the remote peer closes the connection. In this case
432 * @remote_peer_vanished is set to %TRUE and @error is set.
435 * If the remote peer sends invalid or malformed data. In this
436 * case @remote_peer_vanished is set to %FALSE and @error
441 * Upon receiving this signal, you should give up your reference to
442 * @connection. You are guaranteed that this signal is emitted only
450 * GDBusConnection:address:
452 * A D-Bus address specifying potential endpoints that can be used
453 * when establishing the connection.
460 * GDBusConnection:authentication-observer:
462 * A #GDBusAuthObserver object to assist in the authentication process or %NULL.
469 * GDBusConnection:capabilities:
471 * Flags from the #GDBusCapabilityFlags enumeration
472 * representing connection features negotiated with the other peer.
479 * GDBusConnection:closed:
481 * A boolean specifying whether the connection has been closed.
488 * GDBusConnection:exit-on-close:
490 * A boolean specifying whether the process will be terminated (by
491 * calling <literal>raise(SIGTERM)</literal>) if the connection
492 * is closed by the remote peer.
494 * Note that #GDBusConnection objects returned by g_bus_get_finish() and
495 * g_bus_get_sync() will (usually) have this property set to %TRUE.
502 * GDBusConnection:flags:
504 * Flags from the #GDBusConnectionFlags enumeration.
511 * GDBusConnection:guid:
513 * The GUID of the peer performing the role of server when
516 * If you are constructing a #GDBusConnection and pass
517 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER in the
518 * #GDBusConnection:flags property then you MUST also set this
519 * property to a valid guid.
521 * If you are constructing a #GDBusConnection and pass
522 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT in the
523 * #GDBusConnection:flags property you will be able to read the GUID
524 * of the other peer here after the connection has been successfully
532 * GDBusConnection:locked:
534 * A boolean specifying whether the message is locked.
541 * GDBusConnection:stream:
543 * The underlying #GIOStream used for I/O.
545 * If this is passed on construction and is a #GSocketConnection,
546 * then the corresponding #GSocket will be put into non-blocking mode.
548 * While the #GDBusConnection is active, it will interact with this
549 * stream from a worker thread, so it is not safe to interact with
550 * the stream directly.
557 * GDBusConnection:unique-name:
559 * The unique name as assigned by the message bus or %NULL if the
560 * connection is not open or not a message bus connection.
567 * GDBusConnectionClass:
568 * @closed: Signal class handler for the #GDBusConnection::closed signal.
570 * Class structure for #GDBusConnection.
577 * GDBusInterfaceSkeleton::g-authorize-method:
578 * @interface: The #GDBusInterfaceSkeleton emitting the signal.
579 * @invocation: A #GDBusMethodInvocation.
581 * Emitted when a method is invoked by a remote caller and used to
582 * determine if the method call is authorized.
584 * Note that this signal is emitted in a thread dedicated to
585 * handling the method call so handlers are allowed to perform
586 * blocking IO. This means that it is appropriate to call
588 * url="http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#polkit-authority-check-authorization-sync">polkit_authority_check_authorization_sync()</ulink>
590 * url="http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#POLKIT-CHECK-AUTHORIZATION-FLAGS-ALLOW-USER-INTERACTION:CAPS">POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION</ulink> flag set.
592 * If %FALSE is returned then no further handlers are run and the
593 * signal handler must take a reference to @invocation and finish
594 * handling the call (e.g. return an error via
595 * g_dbus_method_invocation_return_error()).
597 * Otherwise, if %TRUE is returned, signal emission continues. If no
598 * handlers return %FALSE, then the method is dispatched. If
599 * @interface has an enclosing #GDBusObjectSkeleton, then the
600 * #GDBusObjectSkeleton::authorize-method signal handlers run before
601 * the handlers for this signal.
603 * The default class handler just returns %TRUE.
605 * Please note that the common case is optimized: if no signals
606 * handlers are connected and the default class handler isn't
607 * overridden (for both @interface and the enclosing
608 * #GDBusObjectSkeleton, if any) and #GDBusInterfaceSkeleton:g-flags does
610 * %G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD
611 * flags set, no dedicated thread is ever used and the call will be
612 * handled in the same thread as the object that @interface belongs
613 * to was exported in.
615 * Returns: %TRUE if the call is authorized, %FALSE otherwise.
621 * GDBusInterfaceSkeleton:g-flags:
623 * Flags from the #GDBusInterfaceSkeletonFlags enumeration.
632 * The #GDBusMessage structure contains only private data and should
633 * only be accessed using the provided API.
642 * Class structure for #GDBusMessage.
649 * GDBusMethodInvocation:
651 * The #GDBusMethodInvocation structure contains only private data and
652 * should only be accessed using the provided API.
659 * GDBusMethodInvocationClass:
661 * Class structure for #GDBusMethodInvocation.
668 * GDBusObject::interface-added:
669 * @object: The #GDBusObject emitting the signal.
670 * @interface: The #GDBusInterface that was added.
672 * Emitted when @interface is added to @object.
679 * GDBusObject::interface-removed:
680 * @object: The #GDBusObject emitting the signal.
681 * @interface: The #GDBusInterface that was removed.
683 * Emitted when @interface is removed from @object.
690 * GDBusObjectManager::interface-added:
691 * @manager: The #GDBusObjectManager emitting the signal.
692 * @object: The #GDBusObject on which an interface was added.
693 * @interface: The #GDBusInterface that was added.
695 * Emitted when @interface is added to @object.
697 * This signal exists purely as a convenience to avoid having to
698 * connect signals to all objects managed by @manager.
705 * GDBusObjectManager::interface-removed:
706 * @manager: The #GDBusObjectManager emitting the signal.
707 * @object: The #GDBusObject on which an interface was removed.
708 * @interface: The #GDBusInterface that was removed.
710 * Emitted when @interface has been removed from @object.
712 * This signal exists purely as a convenience to avoid having to
713 * connect signals to all objects managed by @manager.
720 * GDBusObjectManager::object-added:
721 * @manager: The #GDBusObjectManager emitting the signal.
722 * @object: The #GDBusObject that was added.
724 * Emitted when @object is added to @manager.
731 * GDBusObjectManager::object-removed:
732 * @manager: The #GDBusObjectManager emitting the signal.
733 * @object: The #GDBusObject that was removed.
735 * Emitted when @object is removed from @manager.
742 * GDBusObjectManagerClient::interface-proxy-properties-changed:
743 * @manager: The #GDBusObjectManagerClient emitting the signal.
744 * @object_proxy: The #GDBusObjectProxy on which an interface has properties that are changing.
745 * @interface_proxy: The #GDBusProxy that has properties that are changing.
746 * @changed_properties: A #GVariant containing the properties that changed.
747 * @invalidated_properties: A %NULL terminated array of properties that was invalidated.
749 * Emitted when one or more D-Bus properties on proxy changes. The
750 * local cache has already been updated when this signal fires. Note
751 * that both @changed_properties and @invalidated_properties are
752 * guaranteed to never be %NULL (either may be empty though).
754 * This signal exists purely as a convenience to avoid having to
755 * connect signals to all interface proxies managed by @manager.
757 * This signal is emitted in the
758 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
759 * that @manager was constructed in.
766 * GDBusObjectManagerClient::interface-proxy-signal:
767 * @manager: The #GDBusObjectManagerClient emitting the signal.
768 * @object_proxy: The #GDBusObjectProxy on which an interface is emitting a D-Bus signal.
769 * @interface_proxy: The #GDBusProxy that is emitting a D-Bus signal.
770 * @sender_name: The sender of the signal or NULL if the connection is not a bus connection.
771 * @signal_name: The signal name.
772 * @parameters: A #GVariant tuple with parameters for the signal.
774 * Emitted when a D-Bus signal is received on @interface_proxy.
776 * This signal exists purely as a convenience to avoid having to
777 * connect signals to all interface proxies managed by @manager.
779 * This signal is emitted in the
780 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
781 * that @manager was constructed in.
788 * GDBusObjectManagerClient:bus-type:
790 * If this property is not %G_BUS_TYPE_NONE, then
791 * #GDBusObjectManagerClient:connection must be %NULL and will be set to the
792 * #GDBusConnection obtained by calling g_bus_get() with the value
800 * GDBusObjectManagerClient:connection:
802 * The #GDBusConnection to use.
809 * GDBusObjectManagerClient:flags:
811 * Flags from the #GDBusObjectManagerClientFlags enumeration.
818 * GDBusObjectManagerClient:get-proxy-type-destroy-notify:
820 * A #GDestroyNotify for the #gpointer user_data in #GDBusObjectManagerClient:get-proxy-type-user-data.
827 * GDBusObjectManagerClient:get-proxy-type-func:
829 * The #GDBusProxyTypeFunc to use when determining what #GType to
830 * use for interface proxies or %NULL.
837 * GDBusObjectManagerClient:get-proxy-type-user-data:
839 * The #gpointer user_data to pass to #GDBusObjectManagerClient:get-proxy-type-func.
846 * GDBusObjectManagerClient:name:
848 * The well-known name or unique name that the manager is for.
855 * GDBusObjectManagerClient:name-owner:
857 * The unique name that owns #GDBusObjectManagerClient:name or %NULL if
858 * no-one is currently owning the name. Connect to the
859 * #GObject::notify signal to track changes to this property.
866 * GDBusObjectManagerClient:object-path:
868 * The object path the manager is for.
875 * GDBusObjectManagerServer:connection:
877 * The #GDBusConnection to export objects on.
884 * GDBusObjectManagerServer:object-path:
886 * The object path to register the manager object at.
893 * GDBusObjectProxy:g-connection:
895 * The connection of the proxy.
902 * GDBusObjectProxy:g-object-path:
904 * The object path of the proxy.
911 * GDBusObjectSkeleton::authorize-method:
912 * @object: The #GDBusObjectSkeleton emitting the signal.
913 * @interface: The #GDBusInterfaceSkeleton that @invocation is for.
914 * @invocation: A #GDBusMethodInvocation.
916 * Emitted when a method is invoked by a remote caller and used to
917 * determine if the method call is authorized.
919 * This signal is like #GDBusInterfaceSkeleton<!-- -->'s
920 * #GDBusInterfaceSkeleton::g-authorize-method signal, except that it is
921 * for the enclosing object.
923 * The default class handler just returns %TRUE.
925 * Returns: %TRUE if the call is authorized, %FALSE otherwise.
931 * GDBusObjectSkeleton:g-object-path:
933 * The object path where the object is exported.
940 * GDBusProxy::g-properties-changed:
941 * @proxy: The #GDBusProxy emitting the signal.
942 * @changed_properties: A #GVariant containing the properties that changed
943 * @invalidated_properties: A %NULL terminated array of properties that was invalidated
945 * Emitted when one or more D-Bus properties on @proxy changes. The
946 * local cache has already been updated when this signal fires. Note
947 * that both @changed_properties and @invalidated_properties are
948 * guaranteed to never be %NULL (either may be empty though).
950 * If the proxy has the flag
951 * %G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES set, then
952 * @invalidated_properties will always be empty.
954 * This signal corresponds to the
955 * <literal>PropertiesChanged</literal> D-Bus signal on the
956 * <literal>org.freedesktop.DBus.Properties</literal> interface.
963 * GDBusProxy::g-signal:
964 * @proxy: The #GDBusProxy emitting the signal.
965 * @sender_name: (allow-none): The sender of the signal or %NULL if the connection is not a bus connection.
966 * @signal_name: The name of the signal.
967 * @parameters: A #GVariant tuple with parameters for the signal.
969 * Emitted when a signal from the remote object and interface that @proxy is for, has been received.
976 * GDBusProxy:g-bus-type:
978 * If this property is not %G_BUS_TYPE_NONE, then
979 * #GDBusProxy:g-connection must be %NULL and will be set to the
980 * #GDBusConnection obtained by calling g_bus_get() with the value
988 * GDBusProxy:g-connection:
990 * The #GDBusConnection the proxy is for.
997 * GDBusProxy:g-default-timeout:
999 * The timeout to use if -1 (specifying default timeout) is passed
1000 * as @timeout_msec in the g_dbus_proxy_call() and
1001 * g_dbus_proxy_call_sync() functions.
1003 * This allows applications to set a proxy-wide timeout for all
1004 * remote method invocations on the proxy. If this property is -1,
1005 * the default timeout (typically 25 seconds) is used. If set to
1006 * %G_MAXINT, then no timeout is used.
1013 * GDBusProxy:g-flags:
1015 * Flags from the #GDBusProxyFlags enumeration.
1022 * GDBusProxy:g-interface-info:
1024 * Ensure that interactions with this proxy conform to the given
1025 * interface. This is mainly to ensure that malformed data received
1026 * from the other peer is ignored. The given #GDBusInterfaceInfo is
1027 * said to be the <emphasis>expected interface</emphasis>.
1029 * The checks performed are:
1032 * When completing a method call, if the type signature of
1033 * the reply message isn't what's expected, the reply is
1034 * discarded and the #GError is set to %G_IO_ERROR_INVALID_ARGUMENT.
1035 * </para></listitem>
1037 * Received signals that have a type signature mismatch are dropped and
1038 * a warning is logged via g_warning().
1039 * </para></listitem>
1041 * Properties received via the initial <literal>GetAll()</literal> call
1042 * or via the <literal>::PropertiesChanged</literal> signal (on the
1043 * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties">org.freedesktop.DBus.Properties</ulink> interface) or
1044 * set using g_dbus_proxy_set_cached_property() with a type signature
1045 * mismatch are ignored and a warning is logged via g_warning().
1046 * </para></listitem>
1048 * Note that these checks are never done on methods, signals and
1049 * properties that are not referenced in the given
1050 * #GDBusInterfaceInfo, since extending a D-Bus interface on the
1051 * service-side is not considered an ABI break.
1058 * GDBusProxy:g-interface-name:
1060 * The D-Bus interface name the proxy is for.
1067 * GDBusProxy:g-name:
1069 * The well-known or unique name that the proxy is for.
1076 * GDBusProxy:g-name-owner:
1078 * The unique name that owns #GDBusProxy:g-name or %NULL if no-one
1079 * currently owns that name. You may connect to #GObject::notify signal to
1080 * track changes to this property.
1087 * GDBusProxy:g-object-path:
1089 * The object path the proxy is for.
1098 * The #GDBusServer structure contains only private data and
1099 * should only be accessed using the provided API.
1106 * GDBusServer::new-connection:
1107 * @server: The #GDBusServer emitting the signal.
1108 * @connection: A #GDBusConnection for the new connection.
1110 * Emitted when a new authenticated connection has been made. Use
1111 * g_dbus_connection_get_peer_credentials() to figure out what
1112 * identity (if any), was authenticated.
1114 * If you want to accept the connection, take a reference to the
1115 * @connection object and return %TRUE. When you are done with the
1116 * connection call g_dbus_connection_close() and give up your
1117 * reference. Note that the other peer may disconnect at any time -
1118 * a typical thing to do when accepting a connection is to listen to
1119 * the #GDBusConnection::closed signal.
1121 * If #GDBusServer:flags contains %G_DBUS_SERVER_FLAGS_RUN_IN_THREAD
1122 * then the signal is emitted in a new thread dedicated to the
1123 * connection. Otherwise the signal is emitted in the <link
1124 * linkend="g-main-context-push-thread-default">thread-default main
1125 * loop</link> of the thread that @server was constructed in.
1127 * You are guaranteed that signal handlers for this signal runs
1128 * before incoming messages on @connection are processed. This means
1129 * that it's suitable to call g_dbus_connection_register_object() or
1130 * similar from the signal handler.
1132 * Returns: %TRUE to claim @connection, %FALSE to let other handlers run.
1138 * GDBusServer:active:
1140 * Whether the server is currently active.
1147 * GDBusServer:address:
1149 * The D-Bus address to listen on.
1156 * GDBusServer:authentication-observer:
1158 * A #GDBusAuthObserver object to assist in the authentication process or %NULL.
1165 * GDBusServer:client-address:
1167 * The D-Bus address that clients can use.
1174 * GDBusServer:flags:
1176 * Flags from the #GDBusServerFlags enumeration.
1185 * The guid of the server.
1193 * @new_connection: Signal class handler for the #GDBusServer::new-connection signal.
1195 * Class structure for #GDBusServer.
1202 * GDataOutputStream:byte-order:
1204 * Determines the byte ordering that is used when writing
1205 * multi-byte entities (such as integers) to the stream.
1210 * GDataStream:byte-order:
1212 * The ::byte-order property determines the byte ordering that
1213 * is used when reading multi-byte entities (such as integers)
1219 * GDataStream:newline-type:
1221 * The :newline-type property determines what is considered
1222 * as a line ending when reading complete lines from the stream.
1229 * Information about an installed application from a desktop file.
1234 * GDesktopAppInfo:filename:
1236 * The origin filename of this #GDesktopAppInfo
1242 * @drive: a #GDrive.
1244 * Emitted when the drive's state has changed.
1249 * GDrive::disconnected:
1250 * @drive: a #GDrive.
1252 * This signal is emitted when the #GDrive have been
1253 * disconnected. If the recipient is holding references to the
1254 * object they should release them so the object can be
1260 * GDrive::eject-button:
1261 * @drive: a #GDrive.
1263 * Emitted when the physical eject button (if any) of a drive has
1269 * GDrive::stop-button:
1270 * @drive: a #GDrive.
1272 * Emitted when the physical stop button (if any) of a drive has
1282 * The file containing the icon.
1287 * GFileMonitor::changed:
1288 * @monitor: a #GFileMonitor.
1290 * @other_file: (allow-none): a #GFile or #NULL.
1291 * @event_type: a #GFileMonitorEvent.
1293 * Emitted when @file has been changed.
1295 * If using #G_FILE_MONITOR_SEND_MOVED flag and @event_type is
1296 * #G_FILE_MONITOR_EVENT_MOVED, @file will be set to a #GFile containing the
1297 * old path, and @other_file will be set to a #GFile containing the new path.
1299 * In all the other cases, @other_file will be set to #NULL.
1304 * GFilenameCompleter::got-completion-data:
1306 * Emitted when the file name completion information comes available.
1313 * Represents a scope for loading IO modules. A scope can be used for blocking
1314 * duplicate modules, or blocking a module you don't want to load.
1316 * The scope can be used with g_io_modules_load_all_in_directory_with_scope()
1317 * or g_io_modules_scan_all_in_directory_with_scope().
1326 * An IPv4 or IPv6 internet address.
1331 * GInetAddress:is-any:
1333 * Whether this is the "any" address for its family.
1334 * See g_inet_address_get_is_any().
1341 * GInetAddress:is-link-local:
1343 * Whether this is a link-local address.
1344 * See g_inet_address_get_is_link_local().
1351 * GInetAddress:is-loopback:
1353 * Whether this is the loopback address for its family.
1354 * See g_inet_address_get_is_loopback().
1361 * GInetAddress:is-mc-global:
1363 * Whether this is a global multicast address.
1364 * See g_inet_address_get_is_mc_global().
1371 * GInetAddress:is-mc-link-local:
1373 * Whether this is a link-local multicast address.
1374 * See g_inet_address_get_is_mc_link_local().
1381 * GInetAddress:is-mc-node-local:
1383 * Whether this is a node-local multicast address.
1384 * See g_inet_address_get_is_mc_node_local().
1391 * GInetAddress:is-mc-org-local:
1393 * Whether this is an organization-local multicast address.
1394 * See g_inet_address_get_is_mc_org_local().
1401 * GInetAddress:is-mc-site-local:
1403 * Whether this is a site-local multicast address.
1404 * See g_inet_address_get_is_mc_site_local().
1411 * GInetAddress:is-multicast:
1413 * Whether this is a multicast address.
1414 * See g_inet_address_get_is_multicast().
1421 * GInetAddress:is-site-local:
1423 * Whether this is a site-local address.
1424 * See g_inet_address_get_is_loopback().
1433 * A combination of an IPv4 or IPv6 base address and a length,
1434 * representing a range of IP addresses.
1441 * GInetSocketAddress:
1443 * An IPv4 or IPv6 socket address, corresponding to a <type>struct
1444 * sockaddr_in</type> or <type>struct sockaddr_in6</type>.
1449 * GInetSocketAddress:flowinfo:
1451 * The <literal>sin6_flowinfo</literal> field, for IPv6 addresses.
1458 * GInetSocketAddress:scope_id:
1460 * The <literal>sin6_scope_id</literal> field, for IPv6 addresses.
1467 * GMemoryOutputStream:data:
1469 * Pointer to buffer where data will be written.
1476 * GMemoryOutputStream:data-size:
1478 * Size of data written to the buffer.
1485 * GMemoryOutputStream:destroy-function: (skip)
1487 * Function called with the buffer as argument when the stream is destroyed.
1494 * GMemoryOutputStream:realloc-function: (skip)
1496 * Function with realloc semantics called to enlarge the buffer.
1503 * GMemoryOutputStream:size:
1505 * Current size of the data buffer.
1514 * #GMenu is an opaque structure type. You must access it using the
1522 * GMenuAttributeIter:
1524 * #GMenuAttributeIter is an opaque structure type. You must access it
1525 * using the functions below.
1534 * #GMenuItem is an opaque structure type. You must access it using the
1544 * #GMenuLinkIter is an opaque structure type. You must access it using
1545 * the functions below.
1554 * #GMenuModel is an opaque structure type. You must access it using the
1562 * GMenuModel::items-changed:
1563 * @model: the #GMenuModel that is changing
1564 * @position: the position of the change
1565 * @removed: the number of items removed
1566 * @added: the number of items added
1568 * Emitted when a change has occured to the menu.
1570 * The only changes that can occur to a menu is that items are removed
1571 * or added. Items may not change (except by being removed and added
1572 * back in the same location). This signal is capable of describing
1573 * both of those changes (at the same time).
1575 * The signal means that starting at the index @position, @removed
1576 * items were removed and @added items were added in their place. If
1577 * @removed is zero then only items were added. If @added is zero
1578 * then only items were removed.
1580 * As an example, if the menu contains items a, b, c, d (in that
1581 * order) and the signal (2, 1, 3) occurs then the new composition of
1582 * the menu will be a, b, _, _, _, d (with each _ representing some
1585 * Signal handlers may query the model (particularly the added items)
1586 * and expect to see the results of the modification that is being
1587 * reported. The signal is emitted after the modification.
1593 * @mount: the object on which the signal is emitted
1595 * Emitted when the mount has been changed.
1600 * GMount::pre-unmount:
1601 * @mount: the object on which the signal is emitted
1603 * This signal is emitted when the #GMount is about to be
1611 * GMount::unmounted:
1612 * @mount: the object on which the signal is emitted
1614 * This signal is emitted when the #GMount have been
1615 * unmounted. If the recipient is holding references to the
1616 * object they should release them so the object can be
1622 * GMountOperation::aborted:
1624 * Emitted by the backend when e.g. a device becomes unavailable
1625 * while a mount operation is in progress.
1627 * Implementations of GMountOperation should handle this signal
1628 * by dismissing open password dialogs.
1635 * GMountOperation::ask-password:
1636 * @op: a #GMountOperation requesting a password.
1637 * @message: string containing a message to display to the user.
1638 * @default_user: string containing the default user name.
1639 * @default_domain: string containing the default domain.
1640 * @flags: a set of #GAskPasswordFlags.
1642 * Emitted when a mount operation asks the user for a password.
1644 * If the message contains a line break, the first line should be
1645 * presented as a heading. For example, it may be used as the
1646 * primary text in a #GtkMessageDialog.
1651 * GMountOperation::ask-question:
1652 * @op: a #GMountOperation asking a question.
1653 * @message: string containing a message to display to the user.
1654 * @choices: an array of strings for each possible choice.
1656 * Emitted when asking the user a question and gives a list of
1657 * choices for the user to choose from.
1659 * If the message contains a line break, the first line should be
1660 * presented as a heading. For example, it may be used as the
1661 * primary text in a #GtkMessageDialog.
1666 * GMountOperation::reply:
1667 * @op: a #GMountOperation.
1668 * @result: a #GMountOperationResult indicating how the request was handled
1670 * Emitted when the user has replied to the mount operation.
1675 * GMountOperation::show-processes:
1676 * @op: a #GMountOperation.
1677 * @message: string containing a message to display to the user.
1678 * @processes: (element-type GPid): an array of #GPid for processes blocking the operation.
1679 * @choices: an array of strings for each possible choice.
1681 * Emitted when one or more processes are blocking an operation
1682 * e.g. unmounting/ejecting a #GMount or stopping a #GDrive.
1684 * Note that this signal may be emitted several times to update the
1685 * list of blocking processes as processes close files. The
1686 * application should only respond with g_mount_operation_reply() to
1687 * the latest signal (setting #GMountOperation:choice to the choice
1690 * If the message contains a line break, the first line should be
1691 * presented as a heading. For example, it may be used as the
1692 * primary text in a #GtkMessageDialog.
1699 * GMountOperation::show-unmount-progress:
1700 * @op: a #GMountOperation:
1701 * @message: string containing a mesage to display to the user
1702 * @time_left: the estimated time left before the operation completes, in microseconds, or -1
1703 * @bytes_left: the amount of bytes to be written before the operation completes (or -1 if such amount is not known), or zero if the operation is completed
1705 * Emitted when an unmount operation has been busy for more than some time
1706 * (typically 1.5 seconds).
1708 * When unmounting or ejecting a volume, the kernel might need to flush
1709 * pending data in its buffers to the volume stable storage, and this operation
1710 * can take a considerable amount of time. This signal may be emitted several
1711 * times as long as the unmount operation is outstanding, and then one
1712 * last time when the operation is completed, with @bytes_left set to zero.
1714 * Implementations of GMountOperation should handle this signal by
1715 * showing an UI notification, and then dismiss it, or show another notification
1716 * of completion, when @bytes_left reaches zero.
1718 * If the message contains a line break, the first line should be
1719 * presented as a heading. For example, it may be used as the
1720 * primary text in a #GtkMessageDialog.
1727 * GMountOperation:anonymous:
1729 * Whether to use an anonymous user when authenticating.
1734 * GMountOperation:choice:
1736 * The index of the user's choice when a question is asked during the
1737 * mount operation. See the #GMountOperation::ask-question signal.
1742 * GMountOperation:domain:
1744 * The domain to use for the mount operation.
1749 * GMountOperation:password:
1751 * The password that is used for authentication when carrying out
1752 * the mount operation.
1757 * GMountOperation:password-save:
1759 * Determines if and how the password information should be saved.
1764 * GMountOperation:username:
1766 * The user name that is used for authentication when carrying out
1767 * the mount operation.
1774 * A #GSocketConnectable for resolving a hostname and connecting to
1782 * #GNetworkMonitor monitors the status of network connections and
1783 * indicates when a possibly-user-visible change has occurred.
1790 * GNetworkMonitor::network-changed:
1791 * @monitor: a #GNetworkMonitor
1792 * @available: the current value of #GNetworkMonitor:network-available
1794 * Emitted when the network configuration changes. If @available is
1795 * %TRUE, then some hosts may be reachable that were not reachable
1796 * before, while others that were reachable before may no longer be
1797 * reachable. If @available is %FALSE, then no remote hosts are
1805 * GNetworkMonitor:network-available:
1807 * Whether the network is considered available. That is, whether the
1808 * system has a default route for at least one of IPv4 or IPv6.
1810 * Real-world networks are of course much more complicated than
1811 * this; the machine may be connected to a wifi hotspot that
1812 * requires payment before allowing traffic through, or may be
1813 * connected to a functioning router that has lost its own upstream
1814 * connectivity. Some hosts might only be accessible when a VPN is
1815 * active. Other hosts might only be accessible when the VPN is
1816 * <emphasis>not</emphasis> active. Thus, it is best to use
1817 * g_network_monitor_can_reach() or
1818 * g_network_monitor_can_reach_async() to test for reachability on a
1819 * host-by-host basis. (On the other hand, when the property is
1820 * %FALSE, the application can reasonably expect that no remote
1821 * hosts at all are reachable, and should indicate this to the user
1824 * See also #GNetworkMonitor::network-changed.
1833 * A #GSocketConnectable for resolving a SRV record and connecting to
1841 * #GPermission is an opaque data structure and can only be accessed
1842 * using the following functions.
1847 * GPermission:allowed:
1849 * %TRUE if the caller currently has permission to perform the action that
1850 * @permission represents the permission to perform.
1855 * GPermission:can-acquire:
1857 * %TRUE if it is generally possible to acquire the permission by calling
1858 * g_permission_acquire().
1863 * GPermission:can-release:
1865 * %TRUE if it is generally possible to release the permission by calling
1866 * g_permission_release().
1873 * A #GInetSocketAddress representing a connection via a proxy server
1880 * GProxyAddress:destination-protocol:
1882 * The protocol being spoke to the destination host, or %NULL if
1883 * the #GProxyAddress doesn't know.
1890 * GProxyAddress:uri:
1892 * The URI string that the proxy was constructed from (or %NULL
1893 * if the creator didn't specify this).
1900 * GRemoteActionGroupInterface:
1901 * @activate_action_full: the virtual function pointer for g_remote_action_group_activate_action_full()
1902 * @change_action_state_full: the virtual function pointer for g_remote_action_group_change_action_state_full()
1904 * The virtual function table for #GRemoteActionGroup.
1913 * The object that handles DNS resolution. Use g_resolver_get_default()
1914 * to get the default resolver.
1919 * GResolver::reload:
1920 * @resolver: a #GResolver
1922 * Emitted when the resolver notices that the system resolver
1923 * configuration has changed.
1928 * GSettings::change-event:
1929 * @settings: the object on which the signal was emitted
1930 * @keys: (array length=n_keys) (element-type GQuark) (allow-none): an array of #GQuark<!-- -->s for the changed keys, or %NULL
1931 * @n_keys: the length of the @keys array, or 0
1933 * The "change-event" signal is emitted once per change event that
1934 * affects this settings object. You should connect to this signal
1935 * only if you are interested in viewing groups of changes before they
1936 * are split out into multiple emissions of the "changed" signal.
1937 * For most use cases it is more appropriate to use the "changed" signal.
1939 * In the event that the change event applies to one or more specified
1940 * keys, @keys will be an array of #GQuark of length @n_keys. In the
1941 * event that the change event applies to the #GSettings object as a
1942 * whole (ie: potentially every key has been changed) then @keys will
1943 * be %NULL and @n_keys will be 0.
1945 * The default handler for this signal invokes the "changed" signal
1946 * for each affected key. If any other connected handler returns
1947 * %TRUE then this default functionality will be suppressed.
1949 * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
1954 * GSettings::changed:
1955 * @settings: the object on which the signal was emitted
1956 * @key: the name of the key that changed
1958 * The "changed" signal is emitted when a key has potentially changed.
1959 * You should call one of the g_settings_get() calls to check the new
1962 * This signal supports detailed connections. You can connect to the
1963 * detailed signal "changed::x" in order to only receive callbacks
1964 * when key "x" changes.
1969 * GSettings::writable-change-event:
1970 * @settings: the object on which the signal was emitted
1971 * @key: the quark of the key, or 0
1973 * The "writable-change-event" signal is emitted once per writability
1974 * change event that affects this settings object. You should connect
1975 * to this signal if you are interested in viewing groups of changes
1976 * before they are split out into multiple emissions of the
1977 * "writable-changed" signal. For most use cases it is more
1978 * appropriate to use the "writable-changed" signal.
1980 * In the event that the writability change applies only to a single
1981 * key, @key will be set to the #GQuark for that key. In the event
1982 * that the writability change affects the entire settings object,
1985 * The default handler for this signal invokes the "writable-changed"
1986 * and "changed" signals for each affected key. This is done because
1987 * changes in writability might also imply changes in value (if for
1988 * example, a new mandatory setting is introduced). If any other
1989 * connected handler returns %TRUE then this default functionality
1990 * will be suppressed.
1992 * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
1997 * GSettings::writable-changed:
1998 * @settings: the object on which the signal was emitted
2001 * The "writable-changed" signal is emitted when the writability of a
2002 * key has potentially changed. You should call
2003 * g_settings_is_writable() in order to determine the new status.
2005 * This signal supports detailed connections. You can connect to the
2006 * detailed signal "writable-changed::x" in order to only receive
2007 * callbacks when the writability of "x" changes.
2012 * GSettings:context:
2014 * The name of the context that the settings are stored in.
2019 * GSettings:delay-apply:
2021 * Whether the #GSettings object is in 'delay-apply' mode. See
2022 * g_settings_delay() for details.
2029 * GSettings:has-unapplied:
2031 * If this property is %TRUE, the #GSettings object has outstanding
2032 * changes that will be applied when g_settings_apply() is called.
2039 * The path within the backend where the settings are stored.
2046 * The name of the schema that describes the types of keys
2047 * for this #GSettings object.
2049 * The type of this property is *not* #GSettingsSchema.
2050 * #GSettingsSchema has only existed since version 2.32 and
2051 * unfortunately this name was used in previous versions to refer to
2052 * the schema ID rather than the schema itself. Take care to use the
2053 * 'settings-schema' property if you wish to pass in a
2056 * Deprecated: 2.32:Use the 'schema-id' property instead. In a future version, this property may instead refer to a #GSettingsSchema.
2061 * GSettings:schema-id:
2063 * The name of the schema that describes the types of keys
2064 * for this #GSettings object.
2069 * GSettings:settings-schema:
2071 * The #GSettingsSchema describing the types of keys for this
2072 * #GSettings object.
2074 * Ideally, this property would be called 'schema'. #GSettingsSchema
2075 * has only existed since version 2.32, however, and before then the
2076 * 'schema' property was used to refer to the ID of the schema rather
2077 * than the schema itself. Take care.
2084 * This is an opaque structure type. You may not access it directly.
2091 * GSettingsSchemaSource:
2093 * This is an opaque structure type. You may not access it directly.
2100 * GSimpleAction::activate:
2101 * @simple: the #GSimpleAction
2102 * @parameter: (allow-none): the parameter to the activation
2104 * Indicates that the action was just activated.
2106 * @parameter will always be of the expected type. In the event that
2107 * an incorrect type was given, no signal will be emitted.
2114 * GSimpleAction::change-state:
2115 * @simple: the #GSimpleAction
2116 * @value: (allow-none): the requested value for the state
2118 * Indicates that the action just received a request to change its
2121 * @value will always be of the correct state type. In the event that
2122 * an incorrect type was given, no signal will be emitted.
2124 * If no handler is connected to this signal then the default
2125 * behaviour is to call g_simple_action_set_state() to set the state
2126 * to the requested value. If you connect a signal handler then no
2127 * default action is taken. If the state should change then you must
2128 * call g_simple_action_set_state() from the handler.
2131 * <title>Example 'change-state' handler</title>
2134 * change_volume_state (GSimpleAction *action,
2136 * gpointer user_data)
2140 * requested = g_variant_get_int32 (value);
2142 * // Volume only goes from 0 to 10
2143 * if (0 <= requested && requested <= 10)
2144 * g_simple_action_set_state (action, value);
2149 * The handler need not set the state to the requested value. It
2150 * could set it to any value at all, or take some other action.
2157 * GSimpleAction:enabled:
2159 * If @action is currently enabled.
2161 * If the action is disabled then calls to g_action_activate() and
2162 * g_action_change_state() have no effect.
2169 * GSimpleAction:name:
2171 * The name of the action. This is mostly meaningful for identifying
2172 * the action once it has been added to a #GSimpleActionGroup.
2179 * GSimpleAction:parameter-type:
2181 * The type of the parameter that must be given when activating the
2189 * GSimpleAction:state:
2191 * The state of the action, or %NULL if the action is stateless.
2198 * GSimpleAction:state-type:
2200 * The #GVariantType of the state that the action has, or %NULL if the
2201 * action is stateless.
2208 * GSimplePermission:
2210 * #GSimplePermission is an opaque data structure. There are no methods
2211 * except for those defined by #GPermission.
2216 * GSocket:broadcast:
2218 * Whether the socket should allow sending to and receiving from broadcast addresses.
2225 * GSocket:multicast-loopback:
2227 * Whether outgoing multicast packets loop back to the local host.
2234 * GSocket:multicast-ttl:
2236 * Time-to-live out outgoing multicast packets
2245 * The timeout in seconds on socket I/O
2254 * Time-to-live for outgoing unicast packets
2263 * A socket endpoint address, corresponding to <type>struct sockaddr</type>
2264 * or one of its subtypes.
2269 * GSocketClient::event:
2270 * @client: the #GSocketClient
2271 * @event: the event that is occurring
2272 * @connectable: the #GSocketConnectable that @event is occurring on
2273 * @connection: the current representation of the connection
2275 * Emitted when @client's activity on @connectable changes state.
2276 * Among other things, this can be used to provide progress
2277 * information about a network connection in the UI. The meanings of
2278 * the different @event values are as follows:
2282 * <term>%G_SOCKET_CLIENT_RESOLVING:</term>
2284 * @client is about to look up @connectable in DNS.
2285 * @connection will be %NULL.
2286 * </para></listitem>
2289 * <term>%G_SOCKET_CLIENT_RESOLVED:</term>
2291 * @client has successfully resolved @connectable in DNS.
2292 * @connection will be %NULL.
2293 * </para></listitem>
2296 * <term>%G_SOCKET_CLIENT_CONNECTING:</term>
2298 * @client is about to make a connection to a remote host;
2299 * either a proxy server or the destination server itself.
2300 * @connection is the #GSocketConnection, which is not yet
2302 * </para></listitem>
2305 * <term>%G_SOCKET_CLIENT_CONNECTED:</term>
2307 * @client has successfully connected to a remote host.
2308 * @connection is the connected #GSocketConnection.
2309 * </para></listitem>
2312 * <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATING:</term>
2314 * @client is about to negotiate with a proxy to get it to
2315 * connect to @connectable. @connection is the
2316 * #GSocketConnection to the proxy server.
2317 * </para></listitem>
2320 * <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATED:</term>
2322 * @client has negotiated a connection to @connectable through
2323 * a proxy server. @connection is the stream returned from
2324 * g_proxy_connect(), which may or may not be a
2325 * #GSocketConnection.
2326 * </para></listitem>
2329 * <term>%G_SOCKET_CLIENT_TLS_HANDSHAKING:</term>
2331 * @client is about to begin a TLS handshake. @connection is a
2332 * #GTlsClientConnection.
2333 * </para></listitem>
2336 * <term>%G_SOCKET_CLIENT_TLS_HANDSHAKED:</term>
2338 * @client has successfully completed the TLS handshake.
2339 * @connection is a #GTlsClientConnection.
2340 * </para></listitem>
2343 * <term>%G_SOCKET_CLIENT_COMPLETE:</term>
2345 * @client has either successfully connected to @connectable
2346 * (in which case @connection is the #GSocketConnection that
2347 * it will be returning to the caller) or has failed (in which
2348 * case @connection is %NULL and the client is about to return
2350 * </para></listitem>
2354 * Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted
2355 * multiple times (or not at all) for a given connectable (in
2356 * particular, if @client ends up attempting to connect to more than
2357 * one address). However, if @client emits the #GSocketClient::event
2358 * signal at all for a given connectable, that it will always emit
2359 * it with %G_SOCKET_CLIENT_COMPLETE when it is done.
2361 * Note that there may be additional #GSocketClientEvent values in
2362 * the future; unrecognized @event values should be ignored.
2369 * GSocketService::incoming:
2370 * @service: the #GSocketService
2371 * @connection: a new #GSocketConnection object
2372 * @source_object: (allow-none): the source_object passed to g_socket_listener_add_address()
2374 * The ::incoming signal is emitted when a new incoming connection
2375 * to @service needs to be handled. The handler must initiate the
2376 * handling of @connection, but may not block; in essence,
2377 * asynchronous operations must be used.
2379 * @connection will be unreffed once the signal handler returns,
2380 * so you need to ref it yourself if you are planning to use it.
2382 * Returns: %TRUE to stop other handlers from being called
2390 * A single target host/port that a network service is running on.
2397 * The #GTestDBus structure contains only private data and
2398 * should only be accessed using the provided API.
2407 * #GTestDBusFlags specifying the behaviour of the dbus session
2421 * GThemedIcon:names:
2423 * A %NULL-terminated array of icon names.
2428 * GThemedIcon:use-default-fallbacks:
2430 * Whether to use the default fallbacks found by shortening the icon name
2431 * at '-' characters. If the "names" array has more than one element,
2432 * ignores any past the first.
2434 * For example, if the icon name was "gnome-dev-cdrom-audio", the array
2438 * "gnome-dev-cdrom-audio",
2439 * "gnome-dev-cdrom",
2449 * GThreadedSocketService::run:
2450 * @service: the #GThreadedSocketService.
2451 * @connection: a new #GSocketConnection object.
2452 * @source_object: the source_object passed to g_socket_listener_add_address().
2454 * The ::run signal is emitted in a worker thread in response to an
2455 * incoming connection. This thread is dedicated to handling
2456 * @connection and may perform blocking IO. The signal handler need
2457 * not return until the connection is closed.
2459 * Returns: %TRUE to stop further signal handlers from being called
2466 * TLS (Transport Layer Security, aka SSL) backend. This is an
2467 * internal type used to coordinate the different classes implemented
2477 * Abstract base class for TLS certificate types.
2484 * GTlsCertificate:certificate:
2486 * The DER (binary) encoded representation of the certificate.
2487 * This property and the #GTlsCertificate:certificate-pem property
2488 * represent the same data, just in different forms.
2495 * GTlsCertificate:certificate-pem:
2497 * The PEM (ASCII) encoded representation of the certificate.
2498 * This property and the #GTlsCertificate:certificate
2499 * property represent the same data, just in different forms.
2506 * GTlsCertificate:issuer:
2508 * A #GTlsCertificate representing the entity that issued this
2509 * certificate. If %NULL, this means that the certificate is either
2510 * self-signed, or else the certificate of the issuer is not
2518 * GTlsCertificate:private-key:
2520 * The DER (binary) encoded representation of the certificate's
2521 * private key, in either PKCS#1 format or unencrypted PKCS#8
2522 * format. This property (or the #GTlsCertificate:private-key-pem
2523 * property) can be set when constructing a key (eg, from a file),
2524 * but cannot be read.
2526 * PKCS#8 format is supported since 2.32; earlier releases only
2527 * support PKCS#1. You can use the <literal>openssl rsa</literal>
2528 * tool to convert PKCS#8 keys to PKCS#1.
2535 * GTlsCertificate:private-key-pem:
2537 * The PEM (ASCII) encoded representation of the certificate's
2538 * private key in either PKCS#1 format ("<literal>BEGIN RSA PRIVATE
2539 * KEY</literal>") or unencrypted PKCS#8 format ("<literal>BEGIN
2540 * PRIVATE KEY</literal>"). This property (or the
2541 * #GTlsCertificate:private-key property) can be set when
2542 * constructing a key (eg, from a file), but cannot be read.
2544 * PKCS#8 format is supported since 2.32; earlier releases only
2545 * support PKCS#1. You can use the <literal>openssl rsa</literal>
2546 * tool to convert PKCS#8 keys to PKCS#1.
2553 * GTlsClientConnection:
2555 * Abstract base class for the backend-specific client connection
2563 * GTlsClientConnection:accepted-cas:
2565 * A list of the distinguished names of the Certificate Authorities
2566 * that the server will accept client certificates signed by. If the
2567 * server requests a client certificate during the handshake, then
2568 * this property will be set after the handshake completes.
2570 * Each item in the list is a #GByteArray which contains the complete
2571 * subject DN of the certificate authority.
2578 * GTlsClientConnection:server-identity:
2580 * A #GSocketConnectable describing the identity of the server that
2581 * is expected on the other end of the connection.
2583 * If the %G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in
2584 * #GTlsClientConnection:validation-flags, this object will be used
2585 * to determine the expected identify of the remote end of the
2586 * connection; if #GTlsClientConnection:server-identity is not set,
2587 * or does not match the identity presented by the server, then the
2588 * %G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail.
2590 * In addition to its use in verifying the server certificate,
2591 * this is also used to give a hint to the server about what
2592 * certificate we expect, which is useful for servers that serve
2600 * GTlsClientConnection:use-ssl3:
2602 * If %TRUE, tells the connection to use SSL 3.0 rather than trying
2603 * to negotiate the best version of TLS or SSL to use. This can be
2604 * used when talking to servers that don't implement version
2605 * negotiation correctly and therefore refuse to handshake at all with
2606 * a "modern" TLS handshake.
2613 * GTlsClientConnection:validation-flags:
2615 * What steps to perform when validating a certificate received from
2616 * a server. Server certificates that fail to validate in all of the
2617 * ways indicated here will be rejected unless the application
2618 * overrides the default via #GTlsConnection::accept-certificate.
2627 * Abstract base class for the backend-specific #GTlsClientConnection
2628 * and #GTlsServerConnection types.
2635 * GTlsConnection::accept-certificate:
2636 * @conn: a #GTlsConnection
2637 * @peer_cert: the peer's #GTlsCertificate
2638 * @errors: the problems with @peer_cert.
2640 * Emitted during the TLS handshake after the peer certificate has
2641 * been received. You can examine @peer_cert's certification path by
2642 * calling g_tls_certificate_get_issuer() on it.
2644 * For a client-side connection, @peer_cert is the server's
2645 * certificate, and the signal will only be emitted if the
2646 * certificate was not acceptable according to @conn's
2647 * #GTlsClientConnection:validation_flags. If you would like the
2648 * certificate to be accepted despite @errors, return %TRUE from the
2649 * signal handler. Otherwise, if no handler accepts the certificate,
2650 * the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE.
2652 * For a server-side connection, @peer_cert is the certificate
2653 * presented by the client, if this was requested via the server's
2654 * #GTlsServerConnection:authentication_mode. On the server side,
2655 * the signal is always emitted when the client presents a
2656 * certificate, and the certificate will only be accepted if a
2657 * handler returns %TRUE.
2659 * Note that if this signal is emitted as part of asynchronous I/O
2660 * in the main thread, then you should not attempt to interact with
2661 * the user before returning from the signal handler. If you want to
2662 * let the user decide whether or not to accept the certificate, you
2663 * would have to return %FALSE from the signal handler on the first
2664 * attempt, and then after the connection attempt returns a
2665 * %G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if
2666 * the user decides to accept the certificate, remember that fact,
2667 * create a new connection, and return %TRUE from the signal handler
2670 * If you are doing I/O in another thread, you do not
2671 * need to worry about this, and can simply block in the signal
2672 * handler until the UI thread returns an answer.
2674 * 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.
2680 * GTlsConnection:base-io-stream:
2682 * The #GIOStream that the connection wraps
2689 * GTlsConnection:certificate:
2691 * The connection's certificate; see
2692 * g_tls_connection_set_certificate().
2699 * GTlsConnection:database:
2701 * The certificate database to use when verifying this TLS connection.
2702 * If no cerificate database is set, then the default database will be
2703 * used. See g_tls_backend_get_default_database().
2710 * GTlsConnection:interaction:
2712 * A #GTlsInteraction object to be used when the connection or certificate
2713 * database need to interact with the user. This will be used to prompt the
2714 * user for passwords where necessary.
2721 * GTlsConnection:peer-certificate:
2723 * The connection's peer's certificate, after the TLS handshake has
2724 * completed and the certificate has been accepted. Note in
2725 * particular that this is not yet set during the emission of
2726 * #GTlsConnection::accept-certificate.
2728 * (You can watch for a #GObject::notify signal on this property to
2729 * detect when a handshake has occurred.)
2736 * GTlsConnection:peer-certificate-errors:
2738 * The errors noticed-and-ignored while verifying
2739 * #GTlsConnection:peer-certificate. Normally this should be 0, but
2740 * it may not be if #GTlsClientConnection:validation-flags is not
2741 * %G_TLS_CERTIFICATE_VALIDATE_ALL, or if
2742 * #GTlsConnection::accept-certificate overrode the default
2750 * GTlsConnection:rehandshake-mode:
2752 * The rehandshaking mode. See
2753 * g_tls_connection_set_rehandshake_mode().
2760 * GTlsConnection:require-close-notify:
2762 * Whether or not proper TLS close notification is required.
2763 * See g_tls_connection_set_require_close_notify().
2770 * GTlsConnection:use-system-certdb:
2772 * Whether or not the system certificate database will be used to
2773 * verify peer certificates. See
2774 * g_tls_connection_set_use_system_certdb().
2776 * Deprecated: 2.30: Use GTlsConnection:database instead
2783 * Abstract base class for the backend-specific database types.
2792 * Implemented by a #GTlsDatabase which allows you to load certificates
2800 * GTlsFileDatabase:anchors:
2802 * The path to a file containing PEM encoded certificate authority
2803 * root anchors. The certificates in this file will be treated as
2804 * root authorities for the purpose of verifying other certificates
2805 * via the g_tls_database_verify_chain() operation.
2814 * An object representing interaction that the TLS connection and database
2815 * might have with the user.
2822 * GTlsInteractionClass:
2823 * @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.
2824 * @ask_password_async: ask for a password asynchronously.
2825 * @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.
2827 * The class for #GTlsInteraction. Derived classes implement the various
2828 * virtual interaction methods to handle TLS interactions.
2830 * Derived classes can choose to implement whichever interactions methods they'd
2831 * like to support by overriding those virtual methods in their class
2832 * initialization function. If a derived class implements an async method,
2833 * it must also implement the corresponding finish method.
2835 * The synchronous interaction methods should implement to display modal dialogs,
2836 * and the asynchronous methods to display modeless dialogs.
2838 * If the user cancels an interaction, then the result should be
2839 * %G_TLS_INTERACTION_FAILED and the error should be set with a domain of
2840 * %G_IO_ERROR and code of %G_IO_ERROR_CANCELLED.
2849 * An abstract interface representing a password used in TLS. Often used in
2850 * user interaction such as unlocking a key storage token.
2857 * GTlsServerConnection:authentication-mode:
2859 * The #GTlsAuthenticationMode for the server. This can be changed
2860 * before calling g_tls_connection_handshake() if you want to
2861 * rehandshake with a different mode from the initial handshake.
2868 * GUnixCredentialsMessage:credentials:
2870 * The credentials stored in the message.
2877 * GUnixInputStream:close-fd:
2879 * Whether to close the file descriptor when the stream is closed.
2886 * GUnixInputStream:fd:
2888 * The file descriptor that the stream reads from.
2895 * GUnixMountMonitor::mountpoints-changed:
2896 * @monitor: the object on which the signal is emitted
2898 * Emitted when the unix mount points have changed.
2903 * GUnixMountMonitor::mounts-changed:
2904 * @monitor: the object on which the signal is emitted
2906 * Emitted when the unix mounts have changed.
2911 * GUnixOutputStream:close-fd:
2913 * Whether to close the file descriptor when the stream is closed.
2920 * GUnixOutputStream:fd:
2922 * The file descriptor that the stream writes to.
2929 * GUnixSocketAddress:
2931 * A UNIX-domain (local) socket address, corresponding to a
2932 * <type>struct sockaddr_un</type>.
2937 * GUnixSocketAddress:abstract:
2939 * Whether or not this is an abstract address
2941 * Deprecated: Use #GUnixSocketAddress:address-type, which distinguishes between zero-padded and non-zero-padded abstract addresses.
2948 * Emitted when the volume has been changed.
2955 * This signal is emitted when the #GVolume have been removed. If
2956 * the recipient is holding references to the object they should
2957 * release them so the object can be finalized.
2962 * GVolumeMonitor::drive-changed:
2963 * @volume_monitor: The volume monitor emitting the signal.
2964 * @drive: the drive that changed
2966 * Emitted when a drive changes.
2971 * GVolumeMonitor::drive-connected:
2972 * @volume_monitor: The volume monitor emitting the signal.
2973 * @drive: a #GDrive that was connected.
2975 * Emitted when a drive is connected to the system.
2980 * GVolumeMonitor::drive-disconnected:
2981 * @volume_monitor: The volume monitor emitting the signal.
2982 * @drive: a #GDrive that was disconnected.
2984 * Emitted when a drive is disconnected from the system.
2989 * GVolumeMonitor::drive-eject-button:
2990 * @volume_monitor: The volume monitor emitting the signal.
2991 * @drive: the drive where the eject button was pressed
2993 * Emitted when the eject button is pressed on @drive.
3000 * GVolumeMonitor::drive-stop-button:
3001 * @volume_monitor: The volume monitor emitting the signal.
3002 * @drive: the drive where the stop button was pressed
3004 * Emitted when the stop button is pressed on @drive.
3011 * GVolumeMonitor::mount-added:
3012 * @volume_monitor: The volume monitor emitting the signal.
3013 * @mount: a #GMount that was added.
3015 * Emitted when a mount is added.
3020 * GVolumeMonitor::mount-changed:
3021 * @volume_monitor: The volume monitor emitting the signal.
3022 * @mount: a #GMount that changed.
3024 * Emitted when a mount changes.
3029 * GVolumeMonitor::mount-pre-unmount:
3030 * @volume_monitor: The volume monitor emitting the signal.
3031 * @mount: a #GMount that is being unmounted.
3033 * Emitted when a mount is about to be removed.
3038 * GVolumeMonitor::mount-removed:
3039 * @volume_monitor: The volume monitor emitting the signal.
3040 * @mount: a #GMount that was removed.
3042 * Emitted when a mount is removed.
3047 * GVolumeMonitor::volume-added:
3048 * @volume_monitor: The volume monitor emitting the signal.
3049 * @volume: a #GVolume that was added.
3051 * Emitted when a mountable volume is added to the system.
3056 * GVolumeMonitor::volume-changed:
3057 * @volume_monitor: The volume monitor emitting the signal.
3058 * @volume: a #GVolume that changed.
3060 * Emitted when mountable volume is changed.
3065 * GVolumeMonitor::volume-removed:
3066 * @volume_monitor: The volume monitor emitting the signal.
3067 * @volume: a #GVolume that was removed.
3069 * Emitted when a mountable volume is removed from the system.
3074 * GWin32InputStream:close-handle:
3076 * Whether to close the file handle when the stream is closed.
3083 * GWin32InputStream:handle:
3085 * The handle that the stream reads from.
3092 * GWin32OutputStream:close-handle:
3094 * Whether to close the file handle when the stream is closed.
3101 * GWin32OutputStream:handle:
3103 * The file handle that the stream writes to.
3112 * Zlib decompression
3117 * GZlibCompressor:file-info:
3119 * If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is
3120 * %G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name
3121 * and modification time from the file info to the GZIP header.
3128 * GZlibDecompressor:
3130 * Zlib decompression
3135 * GZlibDecompressor:file-info:
3137 * A #GFileInfo containing the information found in the GZIP header
3138 * of the data stream processed, or %NULL if the header was not yet
3139 * fully processed, is not present at all, or the compressor's
3140 * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP.
3147 * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT:
3149 * The purpose used to verify the client certificate in a TLS connection.
3150 * Used by TLS servers.
3155 * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER:
3157 * The purpose used to verify the server certificate in a TLS connection. This
3158 * is the most common purpose in use. Used by TLS clients.
3163 * G_TYPE_SETTINGS_SCHEMA:
3165 * A boxed #GType corresponding to #GSettingsSchema.
3172 * G_TYPE_SETTINGS_SCHEMA_SOURCE:
3174 * A boxed #GType corresponding to #GSettingsSchemaSource.
3181 * SECTION:_GFreedesktopDBus
3182 * @title: _GFreedesktopDBus
3183 * @short_description: Generated C code for the org.freedesktop.DBus D-Bus interface
3185 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link> D-Bus interface in C.
3190 * SECTION:extensionpoints
3191 * @short_description: Extension Points
3193 * @see_also: <link linkend="extending-gio">Extending GIO</link>
3195 * #GIOExtensionPoint provides a mechanism for modules to extend the
3196 * functionality of the library or application that loaded it in an
3197 * organized fashion.
3199 * An extension point is identified by a name, and it may optionally
3200 * require that any implementation must by of a certain type (or derived
3201 * thereof). Use g_io_extension_point_register() to register an
3202 * extension point, and g_io_extension_point_set_required_type() to
3203 * set a required type.
3205 * A module can implement an extension point by specifying the #GType
3206 * that implements the functionality. Additionally, each implementation
3207 * of an extension point has a name, and a priority. Use
3208 * g_io_extension_point_implement() to implement an extension point.
3211 * GIOExtensionPoint *ep;
3213 * /* Register an extension point */
3214 * ep = g_io_extension_point_register ("my-extension-point");
3215 * g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE);
3219 * /* Implement an extension point */
3220 * G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
3221 * g_io_extension_point_implement ("my-extension-point",
3222 * my_example_impl_get_type (),
3227 * It is up to the code that registered the extension point how
3228 * it uses the implementations that have been associated with it.
3229 * Depending on the use case, it may use all implementations, or
3230 * only the one with the highest priority, or pick a specific
3233 * To avoid opening all modules just to find out what extension
3234 * points they implement, GIO makes use of a caching mechanism,
3235 * see <link linkend="gio-querymodules">gio-querymodules</link>.
3236 * You are expected to run this command after installing a
3239 * The <envar>GIO_EXTRA_MODULES</envar> environment variable can be
3240 * used to specify additional directories to automatically load modules
3241 * from. This environment variable has the same syntax as the
3242 * <envar>PATH</envar>. If two modules have the same base name in different
3243 * directories, then the latter one will be ignored. If additional
3244 * directories are specified GIO will load modules from the built-in
3252 * @short_description: An action interface
3254 * #GAction represents a single named action.
3256 * The main interface to an action is that it can be activated with
3257 * g_action_activate(). This results in the 'activate' signal being
3258 * emitted. An activation has a #GVariant parameter (which may be
3259 * %NULL). The correct type for the parameter is determined by a static
3260 * parameter type (which is given at construction time).
3262 * An action may optionally have a state, in which case the state may be
3263 * set with g_action_change_state(). This call takes a #GVariant. The
3264 * correct type for the state is determined by a static state type
3265 * (which is given at construction time).
3267 * The state may have a hint associated with it, specifying its valid
3270 * #GAction is merely the interface to the concept of an action, as
3271 * described above. Various implementations of actions exist, including
3272 * #GSimpleAction and #GtkAction.
3274 * In all cases, the implementing class is responsible for storing the
3275 * name of the action, the parameter type, the enabled state, the
3276 * optional state type and the state and emitting the appropriate
3277 * signals when these change. The implementor responsible for filtering
3278 * calls to g_action_activate() and g_action_change_state() for type
3279 * safety and for the state being enabled.
3281 * Probably the only useful thing to do with a #GAction is to put it
3282 * inside of a #GSimpleActionGroup.
3287 * SECTION:gactiongroup
3288 * @title: GActionGroup
3289 * @short_description: A group of actions
3290 * @see_also: #GAction
3292 * #GActionGroup represents a group of actions. Actions can be used to
3293 * expose functionality in a structured way, either from one part of a
3294 * program to another, or to the outside world. Action groups are often
3295 * used together with a #GMenuModel that provides additional
3296 * representation data for displaying the actions to the user, e.g. in
3299 * The main way to interact with the actions in a GActionGroup is to
3300 * activate them with g_action_group_activate_action(). Activating an
3301 * action may require a #GVariant parameter. The required type of the
3302 * parameter can be inquired with g_action_group_get_action_parameter_type().
3303 * Actions may be disabled, see g_action_group_get_action_enabled().
3304 * Activating a disabled action has no effect.
3306 * Actions may optionally have a state in the form of a #GVariant. The
3307 * current state of an action can be inquired with
3308 * g_action_group_get_action_state(). Activating a stateful action may
3309 * change its state, but it is also possible to set the state by calling
3310 * g_action_group_change_action_state().
3312 * As typical example, consider a text editing application which has an
3313 * option to change the current font to 'bold'. A good way to represent
3314 * this would be a stateful action, with a boolean state. Activating the
3315 * action would toggle the state.
3317 * Each action in the group has a unique name (which is a string). All
3318 * method calls, except g_action_group_list_actions() take the name of
3319 * an action as an argument.
3321 * The #GActionGroup API is meant to be the 'public' API to the action
3322 * group. The calls here are exactly the interaction that 'external
3323 * forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have
3324 * with actions. 'Internal' APIs (ie: ones meant only to be accessed by
3325 * the action group implementation) are found on subclasses. This is
3326 * why you will find - for example - g_action_group_get_action_enabled()
3327 * but not an equivalent <function>set()</function> call.
3329 * Signals are emitted on the action group in response to state changes
3330 * on individual actions.
3332 * Implementations of #GActionGroup should provide implementations for
3333 * the virtual functions g_action_group_list_actions() and
3334 * g_action_group_query_action(). The other virtual functions should
3335 * not be implemented - their "wrappers" are actually implemented with
3336 * calls to g_action_group_query_action().
3341 * SECTION:gactiongroupexporter
3342 * @title: GActionGroup exporter
3343 * @short_description: Export GActionGroups on D-Bus
3344 * @see_also: #GActionGroup, #GDBusActionGroup
3346 * These functions support exporting a #GActionGroup on D-Bus.
3347 * The D-Bus interface that is used is a private implementation
3350 * To access an exported #GActionGroup remotely, use
3351 * g_dbus_action_group_get() to obtain a #GDBusActionGroup.
3356 * SECTION:gactionmap
3357 * @title: GActionMap
3358 * @short_description: Interface for action containers
3360 * The GActionMap interface is implemented by #GActionGroup
3361 * implementations that operate by containing a number of
3362 * named #GAction instances, such as #GSimpleActionGroup.
3364 * One useful application of this interface is to map the
3365 * names of actions from various action groups to unique,
3366 * prefixed names (e.g. by prepending "app." or "win.").
3367 * This is the motivation for the 'Map' part of the interface
3376 * @short_description: Application information and launch contexts
3377 * @include: gio/gio.h
3379 * #GAppInfo and #GAppLaunchContext are used for describing and launching
3380 * applications installed on the system.
3382 * As of GLib 2.20, URIs will always be converted to POSIX paths
3383 * (using g_file_get_path()) when using g_app_info_launch() even if
3384 * the application requested an URI and not a POSIX path. For example
3385 * for an desktop-file based application with Exec key <literal>totem
3386 * %U</literal> and a single URI,
3387 * <literal>sftp://foo/file.avi</literal>, then
3388 * <literal>/home/user/.gvfs/sftp on foo/file.avi</literal> will be
3389 * passed. This will only work if a set of suitable GIO extensions
3390 * (such as gvfs 2.26 compiled with FUSE support), is available and
3391 * operational; if this is not the case, the URI will be passed
3392 * unmodified to the application. Some URIs, such as
3393 * <literal>mailto:</literal>, of course cannot be mapped to a POSIX
3394 * path (in gvfs there's no FUSE mount for it); such URIs will be
3395 * passed unmodified to the application.
3397 * Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
3398 * back to the GIO URI in the #GFile constructors (since gvfs
3399 * implements the #GVfs extension point). As such, if the application
3400 * needs to examine the URI, it needs to use g_file_get_uri() or
3401 * similar on #GFile. In other words, an application cannot assume
3402 * that the URI passed to e.g. g_file_new_for_commandline_arg() is
3403 * equal to the result of g_file_get_uri(). The following snippet
3410 * file = g_file_new_for_commandline_arg (uri_from_commandline);
3412 * uri = g_file_get_uri (file);
3413 * strcmp (uri, uri_from_commandline) == 0; // FALSE
3416 * if (g_file_has_uri_scheme (file, "cdda"))
3418 * // do something special with uri
3420 * g_object_unref (file);
3423 * This code will work when both <literal>cdda://sr0/Track
3424 * 1.wav</literal> and <literal>/home/user/.gvfs/cdda on sr0/Track
3425 * 1.wav</literal> is passed to the application. It should be noted
3426 * that it's generally not safe for applications to rely on the format
3427 * of a particular URIs. Different launcher applications (e.g. file
3428 * managers) may have different ideas of what a given URI means.
3433 * SECTION:gapplication
3434 * @title: GApplication
3435 * @short_description: Core application class
3437 * A #GApplication is the foundation of an application. It wraps some
3438 * low-level platform-specific services and is intended to act as the
3439 * foundation for higher-level application classes such as
3440 * #GtkApplication or #MxApplication. In general, you should not use
3441 * this class outside of a higher level framework.
3443 * GApplication provides convenient life cycle management by maintaining
3444 * a <firstterm>use count</firstterm> for the primary application instance.
3445 * The use count can be changed using g_application_hold() and
3446 * g_application_release(). If it drops to zero, the application exits.
3447 * Higher-level classes such as #GtkApplication employ the use count to
3448 * ensure that the application stays alive as long as it has any opened
3451 * Another feature that GApplication (optionally) provides is process
3452 * uniqueness. Applications can make use of this functionality by
3453 * providing a unique application ID. If given, only one application
3454 * with this ID can be running at a time per session. The session
3455 * concept is platform-dependent, but corresponds roughly to a graphical
3456 * desktop login. When your application is launched again, its
3457 * arguments are passed through platform communication to the already
3458 * running program. The already running instance of the program is
3459 * called the <firstterm>primary instance</firstterm>; for non-unique
3460 * applications this is the always the current instance.
3461 * On Linux, the D-Bus session bus is used for communication.
3463 * If used, the expected form of an application identifier is very close
3465 * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface">DBus bus name</ulink>.
3466 * Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator".
3467 * For details on valid application identifiers, see g_application_id_is_valid().
3469 * On Linux, the application identifier is claimed as a well-known bus name
3470 * on the user's session bus. This means that the uniqueness of your
3471 * application is scoped to the current session. It also means that your
3472 * application may provide additional services (through registration of other
3473 * object paths) at that bus name. The registration of these object paths
3474 * should be done with the shared GDBus session bus. Note that due to the
3475 * internal architecture of GDBus, method calls can be dispatched at any time
3476 * (even if a main loop is not running). For this reason, you must ensure that
3477 * any object paths that you wish to register are registered before #GApplication
3478 * attempts to acquire the bus name of your application (which happens in
3479 * g_application_register()). Unfortunately, this means that you cannot use
3480 * g_application_get_is_remote() to decide if you want to register object paths.
3482 * GApplication also implements the #GActionGroup and #GActionMap
3483 * interfaces and lets you easily export actions by adding them with
3484 * g_action_map_add_action(). When invoking an action by calling
3485 * g_action_group_activate_action() on the application, it is always
3486 * invoked in the primary instance. The actions are also exported on
3487 * the session bus, and GIO provides the #GDBusActionGroup wrapper to
3488 * conveniently access them remotely. GIO provides a #GDBusMenuModel wrapper
3489 * for remote access to exported #GMenuModels.
3491 * There is a number of different entry points into a GApplication:
3493 * <listitem>via 'Activate' (i.e. just starting the application)</listitem>
3494 * <listitem>via 'Open' (i.e. opening some files)</listitem>
3495 * <listitem>by handling a command-line</listitem>
3496 * <listitem>via activating an action</listitem>
3498 * The #GApplication::startup signal lets you handle the application
3499 * initialization for all of these in a single place.
3501 * Regardless of which of these entry points is used to start the application,
3502 * GApplication passes some <firstterm id="platform-data">platform
3503 * data</firstterm> from the launching instance to the primary instance,
3504 * in the form of a #GVariant dictionary mapping strings to variants.
3505 * To use platform data, override the @before_emit or @after_emit virtual
3506 * functions in your #GApplication subclass. When dealing with
3507 * #GApplicationCommandLine objects, the platform data is directly
3508 * available via g_application_command_line_get_cwd(),
3509 * g_application_command_line_get_environ() and
3510 * g_application_command_line_get_platform_data().
3512 * As the name indicates, the platform data may vary depending on the
3513 * operating system, but it always includes the current directory (key
3514 * "cwd"), and optionally the environment (ie the set of environment
3515 * variables and their values) of the calling process (key "environ").
3516 * The environment is only added to the platform data if the
3517 * %G_APPLICATION_SEND_ENVIRONMENT flag is set. #GApplication subclasses
3518 * can add their own platform data by overriding the @add_platform_data
3519 * virtual function. For instance, #GtkApplication adds startup notification
3522 * To parse commandline arguments you may handle the
3523 * #GApplication::command-line signal or override the local_command_line()
3524 * vfunc, to parse them in either the primary instance or the local instance,
3527 * <example id="gapplication-example-open"><title>Opening files with a GApplication</title>
3529 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-open.c">
3530 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3535 * <example id="gapplication-example-actions"><title>A GApplication with actions</title>
3537 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-actions.c">
3538 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3543 * <example id="gapplication-example-menu"><title>A GApplication with menus</title>
3545 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-menu.c">
3546 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3551 * <example id="gapplication-example-dbushooks"><title>Using extra D-Bus hooks with a GApplication</title>
3553 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-dbushooks.c">
3554 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3562 * SECTION:gapplicationcommandline
3563 * @title: GApplicationCommandLine
3564 * @short_description: A command-line invocation of an application
3565 * @see_also: #GApplication
3567 * #GApplicationCommandLine represents a command-line invocation of
3568 * an application. It is created by #GApplication and emitted
3569 * in the #GApplication::command-line signal and virtual function.
3571 * The class contains the list of arguments that the program was invoked
3572 * with. It is also possible to query if the commandline invocation was
3573 * local (ie: the current process is running in direct response to the
3574 * invocation) or remote (ie: some other process forwarded the
3575 * commandline to this process).
3577 * The GApplicationCommandLine object can provide the @argc and @argv
3578 * parameters for use with the #GOptionContext command-line parsing API,
3579 * with the g_application_command_line_get_arguments() function. See
3580 * <xref linkend="gapplication-example-cmdline3"/> for an example.
3582 * The exit status of the originally-invoked process may be set and
3583 * messages can be printed to stdout or stderr of that process. The
3584 * lifecycle of the originally-invoked process is tied to the lifecycle
3585 * of this object (ie: the process exits when the last reference is
3588 * The main use for #GApplicationCommandLine (and the
3589 * #GApplication::command-line signal) is 'Emacs server' like use cases:
3590 * You can set the <envar>EDITOR</envar> environment variable to have
3591 * e.g. git use your favourite editor to edit commit messages, and if you
3592 * already have an instance of the editor running, the editing will happen
3593 * in the running instance, instead of opening a new one. An important
3594 * aspect of this use case is that the process that gets started by git
3595 * does not return until the editing is done.
3597 * <example id="gapplication-example-cmdline"><title>Handling commandline arguments with GApplication</title>
3599 * A simple example where the commandline is completely handled
3600 * in the #GApplication::command-line handler. The launching instance exits
3601 * once the signal handler in the primary instance has returned, and the
3602 * return value of the signal handler becomes the exit status of the launching
3606 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline.c">
3607 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3612 * <example id="gapplication-example-cmdline2"><title>Split commandline handling</title>
3614 * An example of split commandline handling. Options that start with
3615 * <literal>--local-</literal> are handled locally, all other options are
3616 * passed to the #GApplication::command-line handler which runs in the primary
3620 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline2.c">
3621 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3626 * <example id="gapplication-example-cmdline3"><title>Deferred commandline handling</title>
3628 * An example of deferred commandline handling. Here, the commandline is
3629 * not completely handled before the #GApplication::command-line handler
3630 * returns. Instead, we keep a reference to the GApplicationCommandLine
3631 * object and handle it later(in this example, in an idle). Note that it
3632 * is necessary to hold the application until you are done with the
3636 * This example also shows how to use #GOptionContext for parsing the
3637 * commandline arguments. Note that it is necessary to disable the
3638 * built-in help-handling of #GOptionContext, since it calls exit()
3639 * after printing help, which is not what you want to happen in
3640 * the primary instance.
3643 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline3.c">
3644 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3652 * SECTION:gasyncinitable
3653 * @short_description: Asynchronously failable object initialization interface
3654 * @include: gio/gio.h
3655 * @see_also: #GInitable
3657 * This is the asynchronous version of #GInitable; it behaves the same
3658 * in all ways except that initialization is asynchronous. For more details
3659 * see the descriptions on #GInitable.
3661 * A class may implement both the #GInitable and #GAsyncInitable interfaces.
3663 * Users of objects implementing this are not intended to use the interface
3664 * method directly; instead it will be used automatically in various ways.
3665 * For C applications you generally just call g_async_initable_new_async()
3666 * directly, or indirectly via a foo_thing_new_async() wrapper. This will call
3667 * g_async_initable_init_async() under the cover, calling back with %NULL and
3668 * a set %GError on failure.
3670 * A typical implementation might look something like this:
3680 * _foo_ready_cb (Foo *self)
3684 * self->priv->state = INITIALIZED;
3686 * for (l = self->priv->init_results; l != NULL; l = l->next)
3688 * GSimpleAsyncResult *simple = l->data;
3690 * if (!self->priv->success)
3691 * g_simple_async_result_set_error (simple, ...);
3693 * g_simple_async_result_complete (simple);
3694 * g_object_unref (simple);
3697 * g_list_free (self->priv->init_results);
3698 * self->priv->init_results = NULL;
3702 * foo_init_async (GAsyncInitable *initable,
3704 * GCancellable *cancellable,
3705 * GAsyncReadyCallback callback,
3706 * gpointer user_data)
3708 * Foo *self = FOO (initable);
3709 * GSimpleAsyncResult *simple;
3711 * simple = g_simple_async_result_new (G_OBJECT (initable)
3716 * switch (self->priv->state)
3718 * case NOT_INITIALIZED:
3719 * _foo_get_ready (self);
3720 * self->priv->init_results = g_list_append (self->priv->init_results,
3722 * self->priv->state = INITIALIZING;
3724 * case INITIALIZING:
3725 * self->priv->init_results = g_list_append (self->priv->init_results,
3729 * if (!self->priv->success)
3730 * g_simple_async_result_set_error (simple, ...);
3732 * g_simple_async_result_complete_in_idle (simple);
3733 * g_object_unref (simple);
3739 * foo_init_finish (GAsyncInitable *initable,
3740 * GAsyncResult *result,
3743 * g_return_val_if_fail (g_simple_async_result_is_valid (result,
3744 * G_OBJECT (initable), foo_init_async), FALSE);
3746 * if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
3754 * foo_async_initable_iface_init (gpointer g_iface,
3757 * GAsyncInitableIface *iface = g_iface;
3759 * iface->init_async = foo_init_async;
3760 * iface->init_finish = foo_init_finish;
3767 * SECTION:gasyncresult
3768 * @short_description: Asynchronous Function Results
3769 * @include: gio/gio.h
3770 * @see_also: #GSimpleAsyncResult
3772 * Provides a base class for implementing asynchronous function results.
3774 * Asynchronous operations are broken up into two separate operations
3775 * which are chained together by a #GAsyncReadyCallback. To begin
3776 * an asynchronous operation, provide a #GAsyncReadyCallback to the
3777 * asynchronous function. This callback will be triggered when the
3778 * operation has completed, and will be passed a #GAsyncResult instance
3779 * filled with the details of the operation's success or failure, the
3780 * object the asynchronous function was started for and any error codes
3781 * returned. The asynchronous callback function is then expected to call
3782 * the corresponding "_finish()" function, passing the object the
3783 * function was called for, the #GAsyncResult instance, and (optionally)
3784 * an @error to grab any error conditions that may have occurred.
3786 * The "_finish()" function for an operation takes the generic result
3787 * (of type #GAsyncResult) and returns the specific result that the
3788 * operation in question yields (e.g. a #GFileEnumerator for a
3789 * "enumerate children" operation). If the result or error status of the
3790 * operation is not needed, there is no need to call the "_finish()"
3791 * function; GIO will take care of cleaning up the result and error
3792 * information after the #GAsyncReadyCallback returns. You can pass
3793 * %NULL for the #GAsyncReadyCallback if you don't need to take any
3794 * action at all after the operation completes. Applications may also
3795 * take a reference to the #GAsyncResult and call "_finish()" later;
3796 * however, the "_finish()" function may be called at most once.
3798 * Example of a typical asynchronous operation flow:
3800 * void _theoretical_frobnitz_async (Theoretical *t,
3802 * GAsyncReadyCallback *cb,
3805 * gboolean _theoretical_frobnitz_finish (Theoretical *t,
3806 * GAsyncResult *res,
3810 * frobnitz_result_func (GObject *source_object,
3811 * GAsyncResult *res,
3812 * gpointer user_data)
3814 * gboolean success = FALSE;
3816 * success = _theoretical_frobnitz_finish (source_object, res, NULL);
3819 * g_printf ("Hurray!\n");
3821 * g_printf ("Uh oh!\n");
3823 * /<!-- -->* ... *<!-- -->/
3827 * int main (int argc, void *argv[])
3829 * /<!-- -->* ... *<!-- -->/
3831 * _theoretical_frobnitz_async (theoretical_data,
3833 * frobnitz_result_func,
3836 * /<!-- -->* ... *<!-- -->/
3840 * The callback for an asynchronous operation is called only once, and is
3841 * always called, even in the case of a cancelled operation. On cancellation
3842 * the result is a %G_IO_ERROR_CANCELLED error.
3847 * SECTION:gbufferedinputstream
3848 * @short_description: Buffered Input Stream
3849 * @include: gio/gio.h
3850 * @see_also: #GFilterInputStream, #GInputStream
3852 * Buffered input stream implements #GFilterInputStream and provides
3853 * for buffered reads.
3855 * By default, #GBufferedInputStream's buffer size is set at 4 kilobytes.
3857 * To create a buffered input stream, use g_buffered_input_stream_new(),
3858 * or g_buffered_input_stream_new_sized() to specify the buffer's size at
3861 * To get the size of a buffer within a buffered input stream, use
3862 * g_buffered_input_stream_get_buffer_size(). To change the size of a
3863 * buffered input stream's buffer, use
3864 * g_buffered_input_stream_set_buffer_size(). Note that the buffer's size
3865 * cannot be reduced below the size of the data within the buffer.
3870 * SECTION:gbufferedoutputstream
3871 * @short_description: Buffered Output Stream
3872 * @include: gio/gio.h
3873 * @see_also: #GFilterOutputStream, #GOutputStream
3875 * Buffered output stream implements #GFilterOutputStream and provides
3876 * for buffered writes.
3878 * By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.
3880 * To create a buffered output stream, use g_buffered_output_stream_new(),
3881 * or g_buffered_output_stream_new_sized() to specify the buffer's size
3884 * To get the size of a buffer within a buffered input stream, use
3885 * g_buffered_output_stream_get_buffer_size(). To change the size of a
3886 * buffered output stream's buffer, use
3887 * g_buffered_output_stream_set_buffer_size(). Note that the buffer's
3888 * size cannot be reduced below the size of the data within the buffer.
3893 * SECTION:gcancellable
3894 * @short_description: Thread-safe Operation Cancellation Stack
3895 * @include: gio/gio.h
3897 * GCancellable is a thread-safe operation cancellation stack used
3898 * throughout GIO to allow for cancellation of synchronous and
3899 * asynchronous operations.
3904 * SECTION:gcharsetconverter
3905 * @short_description: Convert between charsets
3906 * @include: gio/gio.h
3908 * #GCharsetConverter is an implementation of #GConverter based on
3914 * SECTION:gcontenttype
3915 * @short_description: Platform-specific content typing
3916 * @include: gio/gio.h
3918 * A content type is a platform specific string that defines the type
3919 * 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".
3920 * On Win32 it is an extension string like ".doc", ".txt" or a perceived
3921 * string like "audio". Such strings can be looked up in the registry at
3922 * HKEY_CLASSES_ROOT.
3927 * SECTION:gconverter
3928 * @short_description: Data conversion interface
3929 * @include: gio/gio.h
3930 * @see_also: #GInputStream, #GOutputStream
3932 * #GConverter is implemented by objects that convert
3933 * binary data in various ways. The conversion can be
3934 * stateful and may fail at any place.
3936 * Some example conversions are: character set conversion,
3937 * compression, decompression and regular expression
3945 * SECTION:gconverterinputstream
3946 * @short_description: Converter Input Stream
3947 * @include: gio/gio.h
3948 * @see_also: #GInputStream, #GConverter
3950 * Converter input stream implements #GInputStream and allows
3951 * conversion of data of various types during reading.
3953 * As of GLib 2.34, #GConverterInputStream implements
3954 * #GPollableInputStream.
3959 * SECTION:gconverteroutputstream
3960 * @short_description: Converter Output Stream
3961 * @include: gio/gio.h
3962 * @see_also: #GOutputStream, #GConverter
3964 * Converter output stream implements #GOutputStream and allows
3965 * conversion of data of various types during reading.
3967 * As of GLib 2.34, #GConverterOutputStream implements
3968 * #GPollableOutputStream.
3973 * SECTION:gcredentials
3974 * @short_description: An object containing credentials
3975 * @include: gio/gio.h
3977 * The #GCredentials type is a reference-counted wrapper for native
3978 * credentials. This information is typically used for identifying,
3979 * authenticating and authorizing other processes.
3981 * Some operating systems supports looking up the credentials of the
3982 * remote peer of a communication endpoint - see e.g.
3983 * g_socket_get_credentials().
3985 * Some operating systems supports securely sending and receiving
3986 * credentials over a Unix Domain Socket, see
3987 * #GUnixCredentialsMessage, g_unix_connection_send_credentials() and
3988 * g_unix_connection_receive_credentials() for details.
3990 * On Linux, the native credential type is a <type>struct ucred</type>
3992 * <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>
3993 * man page for details. This corresponds to
3994 * %G_CREDENTIALS_TYPE_LINUX_UCRED.
3996 * On FreeBSD, the native credential type is a <type>struct cmsgcred</type>.
3997 * This corresponds to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED.
3999 * On OpenBSD, the native credential type is a <type>struct sockpeercred</type>.
4000 * This corresponds to %G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED.
4005 * SECTION:gdatainputstream
4006 * @short_description: Data Input Stream
4007 * @include: gio/gio.h
4008 * @see_also: #GInputStream
4010 * Data input stream implements #GInputStream and includes functions for
4011 * reading structured data directly from a binary input stream.
4016 * SECTION:gdataoutputstream
4017 * @short_description: Data Output Stream
4018 * @include: gio/gio.h
4019 * @see_also: #GOutputStream
4021 * Data output stream implements #GOutputStream and includes functions for
4022 * writing data directly to an output stream.
4027 * SECTION:gdbusactiongroup
4028 * @title: GDBusActionGroup
4029 * @short_description: A D-Bus GActionGroup implementation
4030 * @see_also: <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
4032 * #GDBusActionGroup is an implementation of the #GActionGroup
4033 * interface that can be used as a proxy for an action group
4034 * that is exported over D-Bus with g_dbus_connection_export_action_group().
4039 * SECTION:gdbusaddress
4040 * @title: D-Bus Addresses
4041 * @short_description: D-Bus connection endpoints
4042 * @include: gio/gio.h
4044 * Routines for working with D-Bus addresses. A D-Bus address is a string
4045 * like "unix:tmpdir=/tmp/my-app-name". The exact format of addresses
4046 * is explained in detail in the <link linkend="http://dbus.freedesktop.org/doc/dbus-specification.html#addresses">D-Bus specification</link>.
4051 * SECTION:gdbusauthobserver
4052 * @short_description: Object used for authenticating connections
4053 * @include: gio/gio.h
4055 * The #GDBusAuthObserver type provides a mechanism for participating
4056 * in how a #GDBusServer (or a #GDBusConnection) authenticates remote
4057 * peers. Simply instantiate a #GDBusAuthObserver and connect to the
4058 * signals you are interested in. Note that new signals may be added
4061 * For example, if you only want to allow D-Bus connections from
4062 * processes owned by the same uid as the server, you would use a
4063 * signal handler like the following:
4064 * <example id="auth-observer"><title>Controlling Authentication</title><programlisting>
4066 * on_authorize_authenticated_peer (GDBusAuthObserver *observer,
4067 * GIOStream *stream,
4068 * GCredentials *credentials,
4069 * gpointer user_data)
4071 * gboolean authorized;
4073 * authorized = FALSE;
4074 * if (credentials != NULL)
4076 * GCredentials *own_credentials;
4077 * own_credentials = g_credentials_new ();
4078 * if (g_credentials_is_same_user (credentials, own_credentials, NULL))
4079 * authorized = TRUE;
4080 * g_object_unref (own_credentials);
4083 * return authorized;
4085 * </programlisting></example>
4090 * SECTION:gdbusconnection
4091 * @short_description: D-Bus Connections
4092 * @include: gio/gio.h
4094 * The #GDBusConnection type is used for D-Bus connections to remote
4095 * peers such as a message buses. It is a low-level API that offers a
4096 * lot of flexibility. For instance, it lets you establish a connection
4097 * over any transport that can by represented as an #GIOStream.
4099 * This class is rarely used directly in D-Bus clients. If you are writing
4100 * an D-Bus client, it is often easier to use the g_bus_own_name(),
4101 * g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs.
4103 * As an exception to the usual GLib rule that a particular object must not be
4104 * used by two threads at the same time, #GDBusConnection's methods may be
4105 * called from any thread<footnote>
4107 * This is so that g_bus_get() and g_bus_get_sync() can safely return the
4108 * same #GDBusConnection when called from any thread.
4112 * Most of the ways to obtain a #GDBusConnection automatically initialize it
4113 * (i.e. connect to D-Bus): for instance, g_dbus_connection_new() and
4114 * g_bus_get(), and the synchronous versions of those methods, give you an
4115 * initialized connection. Language bindings for GIO should use
4116 * g_initable_new() or g_async_initable_new_async(), which also initialize the
4119 * If you construct an uninitialized #GDBusConnection, such as via
4120 * g_object_new(), you must initialize it via g_initable_init() or
4121 * g_async_initable_init_async() before using its methods or properties.
4122 * Calling methods or accessing properties on a #GDBusConnection that has not
4123 * completed initialization successfully is considered to be invalid, and leads
4124 * to undefined behaviour. In particular, if initialization fails with a
4125 * #GError, the only valid thing you can do with that #GDBusConnection is to
4126 * free it with g_object_unref().
4128 * <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>
4130 * <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>
4132 * <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>
4134 * <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>
4139 * SECTION:gdbuserror
4140 * @title: GDBusError
4141 * @short_description: Mapping D-Bus errors to and from GError
4142 * @include: gio/gio.h
4144 * All facilities that return errors from remote methods (such as
4145 * g_dbus_connection_call_sync()) use #GError to represent both D-Bus
4146 * errors (e.g. errors returned from the other peer) and locally
4147 * in-process generated errors.
4149 * To check if a returned #GError is an error from a remote peer, use
4150 * g_dbus_error_is_remote_error(). To get the actual D-Bus error name,
4151 * use g_dbus_error_get_remote_error(). Before presenting an error,
4152 * always use g_dbus_error_strip_remote_error().
4154 * In addition, facilities used to return errors to a remote peer also
4155 * use #GError. See g_dbus_method_invocation_return_error() for
4156 * discussion about how the D-Bus error name is set.
4158 * Applications can associate a #GError error domain with a set of D-Bus errors in order to
4159 * automatically map from D-Bus errors to #GError and back. This
4160 * is typically done in the function returning the #GQuark for the
4162 * <example id="error-registration"><title>Error Registration</title><programlisting>
4163 * /<!-- -->* foo-bar-error.h: *<!-- -->/
4165 * #define FOO_BAR_ERROR (foo_bar_error_quark ())
4166 * GQuark foo_bar_error_quark (void);
4170 * FOO_BAR_ERROR_FAILED,
4171 * FOO_BAR_ERROR_ANOTHER_ERROR,
4172 * FOO_BAR_ERROR_SOME_THIRD_ERROR,
4173 * FOO_BAR_N_ERRORS /<!-- -->*< skip >*<!-- -->/
4176 * /<!-- -->* foo-bar-error.c: *<!-- -->/
4178 * static const GDBusErrorEntry foo_bar_error_entries[] =
4180 * {FOO_BAR_ERROR_FAILED, "org.project.Foo.Bar.Error.Failed"},
4181 * {FOO_BAR_ERROR_ANOTHER_ERROR, "org.project.Foo.Bar.Error.AnotherError"},
4182 * {FOO_BAR_ERROR_SOME_THIRD_ERROR, "org.project.Foo.Bar.Error.SomeThirdError"},
4185 * /<!-- -->* Ensure that every error code has an associated D-Bus error name *<!-- -->/
4186 * G_STATIC_ASSERT (G_N_ELEMENTS (foo_bar_error_entries) == FOO_BAR_N_ERRORS);
4189 * foo_bar_error_quark (void)
4191 * static volatile gsize quark_volatile = 0;
4192 * g_dbus_error_register_error_domain ("foo-bar-error-quark",
4194 * foo_bar_error_entries,
4195 * G_N_ELEMENTS (foo_bar_error_entries));
4196 * return (GQuark) quark_volatile;
4198 * </programlisting></example>
4199 * With this setup, a D-Bus peer can transparently pass e.g. %FOO_BAR_ERROR_ANOTHER_ERROR and
4200 * other peers will see the D-Bus error name <literal>org.project.Foo.Bar.Error.AnotherError</literal>.
4201 * If the other peer is using GDBus, the peer will see also %FOO_BAR_ERROR_ANOTHER_ERROR instead
4202 * of %G_IO_ERROR_DBUS_ERROR. Note that GDBus clients can still recover
4203 * <literal>org.project.Foo.Bar.Error.AnotherError</literal> using g_dbus_error_get_remote_error().
4205 * Note that errors in the %G_DBUS_ERROR error domain is intended only
4206 * for returning errors from a remote message bus process. Errors
4207 * generated locally in-process by e.g. #GDBusConnection is from the
4208 * %G_IO_ERROR domain.
4213 * SECTION:gdbusinterface
4214 * @short_description: Base type for D-Bus interfaces
4215 * @include: gio/gio.h
4217 * The #GDBusInterface type is the base type for D-Bus interfaces both
4218 * on the service side (see #GDBusInterfaceSkeleton) and client side
4219 * (see #GDBusProxy).
4224 * SECTION:gdbusinterfaceskeleton
4225 * @short_description: Service-side D-Bus interface
4226 * @include: gio/gio.h
4228 * Abstract base class for D-Bus interfaces on the service side.
4233 * SECTION:gdbusintrospection
4234 * @title: D-Bus Introspection Data
4235 * @short_description: Node and interface description data structures
4236 * @include: gio/gio.h
4238 * Various data structures and convenience routines to parse and
4239 * generate D-Bus introspection XML. Introspection information is
4240 * used when registering objects with g_dbus_connection_register_object().
4242 * The format of D-Bus introspection XML is specified in the
4243 * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format">D-Bus specification</ulink>.
4248 * SECTION:gdbusmenumodel
4249 * @title: GDBusMenuModel
4250 * @short_description: A D-Bus GMenuModel implementation
4251 * @see_also: <link linkend="gio-GMenuModel-exporter">GMenuModel Exporter</link>
4253 * #GDBusMenuModel is an implementation of #GMenuModel that can be used
4254 * as a proxy for a menu model that is exported over D-Bus with
4255 * g_dbus_connection_export_menu_model().
4260 * SECTION:gdbusmessage
4261 * @short_description: D-Bus Message
4262 * @include: gio/gio.h
4264 * A type for representing D-Bus messages that can be sent or received
4265 * on a #GDBusConnection.
4270 * SECTION:gdbusmethodinvocation
4271 * @short_description: Object for handling remote calls
4272 * @include: gio/gio.h
4274 * Instances of the #GDBusMethodInvocation class are used when
4275 * handling D-Bus method calls. It provides a way to asynchronously
4276 * return results and errors.
4278 * The normal way to obtain a #GDBusMethodInvocation object is to receive
4279 * it as an argument to the handle_method_call() function in a
4280 * #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
4285 * SECTION:gdbusnameowning
4286 * @title: Owning Bus Names
4287 * @short_description: Simple API for owning bus names
4288 * @include: gio/gio.h
4290 * Convenience API for owning bus names.
4292 * <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>
4297 * SECTION:gdbusnamewatching
4298 * @title: Watching Bus Names
4299 * @short_description: Simple API for watching bus names
4300 * @include: gio/gio.h
4302 * Convenience API for watching bus names.
4304 * <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>
4309 * SECTION:gdbusobject
4310 * @short_description: Base type for D-Bus objects
4311 * @include: gio/gio.h
4313 * The #GDBusObject type is the base type for D-Bus objects on both
4314 * the service side (see #GDBusObjectSkeleton) and the client side
4315 * (see #GDBusObjectProxy). It is essentially just a container of
4321 * SECTION:gdbusobjectmanager
4322 * @short_description: Base type for D-Bus object managers
4323 * @include: gio/gio.h
4325 * The #GDBusObjectManager type is the base type for service- and
4326 * client-side implementations of the standardized <ulink
4327 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4330 * See #GDBusObjectManagerClient for the client-side implementation
4331 * and #GDBusObjectManagerServer for the service-side implementation.
4336 * SECTION:gdbusobjectmanagerclient
4337 * @short_description: Client-side object manager
4338 * @include: gio/gio.h
4340 * #GDBusObjectManagerClient is used to create, monitor and delete object
4341 * proxies for remote objects exported by a #GDBusObjectManagerServer (or any
4342 * code implementing the <ulink
4343 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4346 * Once an instance of this type has been created, you can connect to
4347 * the #GDBusObjectManager::object-added and
4348 * #GDBusObjectManager::object-removed signals and inspect the
4349 * #GDBusObjectProxy objects returned by
4350 * g_dbus_object_manager_get_objects().
4352 * If the name for a #GDBusObjectManagerClient is not owned by anyone at
4353 * object construction time, the default behavior is to request the
4354 * message bus to launch an owner for the name. This behavior can be
4355 * disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
4356 * flag. It's also worth noting that this only works if the name of
4357 * interest is activatable in the first place. E.g. in some cases it
4358 * is not possible to launch an owner for the requested name. In this
4359 * case, #GDBusObjectManagerClient object construction still succeeds but
4360 * there will be no object proxies
4361 * (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
4362 * the #GDBusObjectManagerClient:name-owner property is %NULL.
4364 * The owner of the requested name can come and go (for example
4365 * consider a system service being restarted) – #GDBusObjectManagerClient
4366 * handles this case too; simply connect to the #GObject::notify
4367 * signal to watch for changes on the #GDBusObjectManagerClient:name-owner
4368 * property. When the name owner vanishes, the behavior is that
4369 * #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
4370 * emission of the #GObject::notify signal) and then
4371 * #GDBusObjectManager::object-removed signals are synthesized
4372 * for all currently existing object proxies. Since
4373 * #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
4374 * use this information to disambiguate a synthesized signal from a
4375 * genuine signal caused by object removal on the remote
4376 * #GDBusObjectManager. Similarly, when a new name owner appears,
4377 * #GDBusObjectManager::object-added signals are synthesized
4378 * while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
4379 * object proxies have been added, the #GDBusObjectManagerClient:name-owner
4380 * is set to the new name owner (this includes emission of the
4381 * #GObject::notify signal). Furthermore, you are guaranteed that
4382 * #GDBusObjectManagerClient:name-owner will alternate between a name owner
4383 * (e.g. <literal>:1.42</literal>) and %NULL even in the case where
4384 * the name of interest is atomically replaced
4386 * Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
4387 * instances. All signals (including the
4388 * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
4389 * signal) delivered to #GDBusProxy instances are guaranteed to
4390 * originate from the name owner. This guarantee along with the
4391 * behavior described above, means that certain race conditions
4392 * including the <emphasis><quote>half the proxy is from the old owner
4393 * and the other half is from the new owner</quote></emphasis> problem
4396 * To avoid having the application connect to signals on the returned
4397 * #GDBusObjectProxy and #GDBusProxy objects, the
4398 * #GDBusObject::interface-added,
4399 * #GDBusObject::interface-removed,
4400 * #GDBusProxy::g-properties-changed and
4401 * #GDBusProxy::g-signal signals
4402 * are also emitted on the #GDBusObjectManagerClient instance managing these
4403 * objects. The signals emitted are
4404 * #GDBusObjectManager::interface-added,
4405 * #GDBusObjectManager::interface-removed,
4406 * #GDBusObjectManagerClient::interface-proxy-properties-changed and
4407 * #GDBusObjectManagerClient::interface-proxy-signal.
4409 * Note that all callbacks and signals are emitted in the
4410 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4411 * that the #GDBusObjectManagerClient object was constructed
4412 * in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
4413 * originating from the #GDBusObjectManagerClient object will be created in
4414 * the same context and, consequently, will deliver signals in the
4420 * SECTION:gdbusobjectmanagerserver
4421 * @short_description: Service-side object manager
4422 * @include: gio/gio.h
4424 * #GDBusObjectManagerServer is used to export #GDBusObject instances using
4425 * the standardized <ulink
4426 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4427 * interface. For example, remote D-Bus clients can get all objects
4428 * and properties in a single call. Additionally, any change in the
4429 * object hierarchy is broadcast using signals. This means that D-Bus
4430 * clients can keep caches up to date by only listening to D-Bus
4433 * See #GDBusObjectManagerClient for the client-side code that is
4434 * intended to be used with #GDBusObjectManagerServer or any D-Bus
4435 * object implementing the org.freedesktop.DBus.ObjectManager
4441 * SECTION:gdbusobjectproxy
4442 * @short_description: Client-side D-Bus object
4443 * @include: gio/gio.h
4445 * A #GDBusObjectProxy is an object used to represent a remote object
4446 * with one or more D-Bus interfaces. Normally, you don't instantiate
4447 * a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
4448 * is used to obtain it.
4455 * SECTION:gdbusobjectskeleton
4456 * @short_description: Service-side D-Bus object
4457 * @include: gio/gio.h
4459 * A #GDBusObjectSkeleton instance is essentially a group of D-Bus
4460 * interfaces. The set of exported interfaces on the object may be
4461 * dynamic and change at runtime.
4463 * This type is intended to be used with #GDBusObjectManager.
4468 * SECTION:gdbusproxy
4469 * @short_description: Client-side D-Bus interface proxy
4470 * @include: gio/gio.h
4472 * #GDBusProxy is a base class used for proxies to access a D-Bus
4473 * interface on a remote object. A #GDBusProxy can be constructed for
4474 * both well-known and unique names.
4476 * By default, #GDBusProxy will cache all properties (and listen to
4477 * changes) of the remote object, and proxy all signals that gets
4478 * emitted. This behaviour can be changed by passing suitable
4479 * #GDBusProxyFlags when the proxy is created. If the proxy is for a
4480 * well-known name, the property cache is flushed when the name owner
4481 * vanishes and reloaded when a name owner appears.
4483 * If a #GDBusProxy is used for a well-known name, the owner of the
4484 * name is tracked and can be read from
4485 * #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
4486 * get notified of changes. Additionally, only signals and property
4487 * changes emitted from the current name owner are considered and
4488 * calls are always sent to the current name owner. This avoids a
4489 * number of race conditions when the name is lost by one owner and
4490 * claimed by another. However, if no name owner currently exists,
4491 * then calls will be sent to the well-known name which may result in
4492 * the message bus launching an owner (unless
4493 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
4495 * The generic #GDBusProxy::g-properties-changed and
4496 * #GDBusProxy::g-signal signals are not very convenient to work
4497 * with. Therefore, the recommended way of working with proxies is to
4498 * subclass #GDBusProxy, and have more natural properties and signals
4499 * in your derived class. See <xref linkend="gdbus-example-gdbus-codegen"/>
4500 * for how this can easily be done using the
4501 * <command><link linkend="gdbus-codegen">gdbus-codegen</link></command>
4504 * A #GDBusProxy instance can be used from multiple threads but note
4505 * that all signals (e.g. #GDBusProxy::g-signal, #GDBusProxy::g-properties-changed
4506 * and #GObject::notify) are emitted in the
4507 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4508 * of the thread where the instance was constructed.
4510 * <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>
4515 * SECTION:gdbusserver
4516 * @short_description: Helper for accepting connections
4517 * @include: gio/gio.h
4519 * #GDBusServer is a helper for listening to and accepting D-Bus
4520 * connections. This can be used to create a new D-Bus server, allowing two
4521 * peers to use the D-Bus protocol for their own specialized communication.
4522 * A server instance provided in this way will not perform message routing or
4523 * implement the org.freedesktop.DBus interface.
4525 * To just export an object on a well-known name on a message bus, such as the
4526 * session or system bus, you should instead use g_bus_own_name().
4528 * <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>
4533 * SECTION:gdbusutils
4534 * @title: D-Bus Utilities
4535 * @short_description: Various utilities related to D-Bus.
4536 * @include: gio/gio.h
4538 * Various utility routines related to D-Bus.
4543 * SECTION:gdesktopappinfo
4544 * @title: GDesktopAppInfo
4545 * @short_description: Application information from desktop files
4546 * @include: gio/gdesktopappinfo.h
4548 * #GDesktopAppInfo is an implementation of #GAppInfo based on
4551 * Note that <filename><gio/gdesktopappinfo.h></filename> belongs to
4552 * the UNIX-specific GIO interfaces, thus you have to use the
4553 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4559 * @short_description: Drive management
4560 * @include: gio/gio.h
4562 * #GDrive - this represent a piece of hardware connected to the machine.
4563 * It's generally only created for removable hardware or hardware with
4566 * #GDrive is a container class for #GVolume objects that stem from
4567 * the same piece of media. As such, #GDrive abstracts a drive with
4568 * (or without) removable media and provides operations for querying
4569 * whether media is available, determing whether media change is
4570 * automatically detected and ejecting the media.
4572 * If the #GDrive reports that media isn't automatically detected, one
4573 * can poll for media; typically one should not do this periodically
4574 * as a poll for media operation is potententially expensive and may
4575 * spin up the drive creating noise.
4577 * #GDrive supports starting and stopping drives with authentication
4578 * support for the former. This can be used to support a diverse set
4579 * of use cases including connecting/disconnecting iSCSI devices,
4580 * powering down external disk enclosures and starting/stopping
4581 * multi-disk devices such as RAID devices. Note that the actual
4582 * semantics and side-effects of starting/stopping a #GDrive may vary
4583 * according to implementation. To choose the correct verbs in e.g. a
4584 * file manager, use g_drive_get_start_stop_type().
4586 * For porting from GnomeVFS note that there is no equivalent of
4587 * #GDrive in that API.
4593 * @short_description: An object for emblems
4594 * @include: gio/gio.h
4595 * @see_also: #GIcon, #GEmblemedIcon, #GLoadableIcon, #GThemedIcon
4597 * #GEmblem is an implementation of #GIcon that supports
4598 * having an emblem, which is an icon with additional properties.
4599 * It can than be added to a #GEmblemedIcon.
4601 * Currently, only metainformation about the emblem's origin is
4602 * supported. More may be added in the future.
4607 * SECTION:gemblemedicon
4608 * @short_description: Icon with emblems
4609 * @include: gio/gio.h
4610 * @see_also: #GIcon, #GLoadableIcon, #GThemedIcon, #GEmblem
4612 * #GEmblemedIcon is an implementation of #GIcon that supports
4613 * adding an emblem to an icon. Adding multiple emblems to an
4614 * icon is ensured via g_emblemed_icon_add_emblem().
4616 * Note that #GEmblemedIcon allows no control over the position
4617 * of the emblems. See also #GEmblem for more information.
4623 * @short_description: File and Directory Handling
4624 * @include: gio/gio.h
4625 * @see_also: #GFileInfo, #GFileEnumerator
4627 * #GFile is a high level abstraction for manipulating files on a
4628 * virtual file system. #GFiles are lightweight, immutable objects
4629 * that do no I/O upon creation. It is necessary to understand that
4630 * #GFile objects do not represent files, merely an identifier for a
4631 * file. All file content I/O is implemented as streaming operations
4632 * (see #GInputStream and #GOutputStream).
4634 * To construct a #GFile, you can use:
4636 * <member>g_file_new_for_path() if you have a path.</member>
4637 * <member>g_file_new_for_uri() if you have a URI.</member>
4638 * <member>g_file_new_for_commandline_arg() for a command line argument.</member>
4639 * <member>g_file_new_tmp() to create a temporary file from a template.</member>
4640 * <member>g_file_parse_name() from a UTF-8 string gotten from g_file_get_parse_name().</member>
4643 * One way to think of a #GFile is as an abstraction of a pathname. For
4644 * normal files the system pathname is what is stored internally, but as
4645 * #GFiles are extensible it could also be something else that corresponds
4646 * to a pathname in a userspace implementation of a filesystem.
4648 * #GFiles make up hierarchies of directories and files that correspond to
4649 * the files on a filesystem. You can move through the file system with
4650 * #GFile using g_file_get_parent() to get an identifier for the parent
4651 * directory, g_file_get_child() to get a child within a directory,
4652 * g_file_resolve_relative_path() to resolve a relative path between two
4653 * #GFiles. There can be multiple hierarchies, so you may not end up at
4654 * the same root if you repeatedly call g_file_get_parent() on two different
4657 * All #GFiles have a basename (get with g_file_get_basename()). These names
4658 * are byte strings that are used to identify the file on the filesystem
4659 * (relative to its parent directory) and there is no guarantees that they
4660 * have any particular charset encoding or even make any sense at all. If
4661 * you want to use filenames in a user interface you should use the display
4662 * name that you can get by requesting the
4663 * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
4664 * This is guaranteed to be in UTF-8 and can be used in a user interface.
4665 * But always store the real basename or the #GFile to use to actually
4666 * access the file, because there is no way to go from a display name to
4669 * Using #GFile as an identifier has the same weaknesses as using a path
4670 * in that there may be multiple aliases for the same file. For instance,
4671 * hard or soft links may cause two different #GFiles to refer to the same
4672 * file. Other possible causes for aliases are: case insensitive filesystems,
4673 * short and long names on FAT/NTFS, or bind mounts in Linux. If you want to
4674 * check if two #GFiles point to the same file you can query for the
4675 * %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
4676 * canonicalization of pathnames passed in, so that trivial differences in
4677 * the path string used at creation (duplicated slashes, slash at end of
4678 * path, "." or ".." path segments, etc) does not create different #GFiles.
4680 * Many #GFile operations have both synchronous and asynchronous versions
4681 * to suit your application. Asynchronous versions of synchronous functions
4682 * simply have _async() appended to their function names. The asynchronous
4683 * I/O functions call a #GAsyncReadyCallback which is then used to finalize
4684 * the operation, producing a GAsyncResult which is then passed to the
4685 * function's matching _finish() operation.
4687 * Some #GFile operations do not have synchronous analogs, as they may
4688 * take a very long time to finish, and blocking may leave an application
4689 * unusable. Notable cases include:
4691 * <member>g_file_mount_mountable() to mount a mountable file.</member>
4692 * <member>g_file_unmount_mountable_with_operation() to unmount a mountable file.</member>
4693 * <member>g_file_eject_mountable_with_operation() to eject a mountable file.</member>
4696 * <para id="gfile-etag"><indexterm><primary>entity tag</primary></indexterm>
4697 * One notable feature of #GFiles are entity tags, or "etags" for
4698 * short. Entity tags are somewhat like a more abstract version of the
4699 * traditional mtime, and can be used to quickly determine if the file has
4700 * been modified from the version on the file system. See the HTTP 1.1
4701 * <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">specification</ulink>
4702 * for HTTP Etag headers, which are a very similar concept.
4708 * SECTION:gfileattribute
4709 * @short_description: Key-Value Paired File Attributes
4710 * @include: gio/gio.h
4711 * @see_also: #GFile, #GFileInfo
4713 * File attributes in GIO consist of a list of key-value pairs.
4715 * Keys are strings that contain a key namespace and a key name, separated
4716 * by a colon, e.g. "namespace:keyname". Namespaces are included to sort
4717 * key-value pairs by namespaces for relevance. Keys can be retrived
4718 * using wildcards, e.g. "standard::*" will return all of the keys in the
4719 * "standard" namespace.
4721 * The list of possible attributes for a filesystem (pointed to by a #GFile) is
4722 * available as a #GFileAttributeInfoList. This list is queryable by key names
4723 * as indicated earlier.
4725 * Information is stored within the list in #GFileAttributeInfo structures.
4726 * The info structure can store different types, listed in the enum
4727 * #GFileAttributeType. Upon creation of a #GFileAttributeInfo, the type will
4728 * be set to %G_FILE_ATTRIBUTE_TYPE_INVALID.
4730 * Classes that implement #GFileIface will create a #GFileAttributeInfoList and
4731 * install default keys and values for their given file system, architecture,
4732 * and other possible implementation details (e.g., on a UNIX system, a file
4733 * attribute key will be registered for the user id for a given file).
4737 * <title>GFileAttributes Default Namespaces</title>
4738 * <tgroup cols='2' align='left'><thead>
4739 * <row><entry>Namspace</entry><entry>Description</entry></row>
4742 * <row><entry>"standard"</entry><entry>The "Standard" namespace. General file
4743 * information that any application may need should be put in this namespace.
4744 * Examples include the file's name, type, and size.</entry></row>
4745 * <row><entry>"etag"</entry><entry>The <link linkend="gfile-etag">"Entity Tag"</link>
4746 * namespace. Currently, the only key in this namespace is "value", which contains
4747 * the value of the current entity tag.</entry></row>
4748 * <row><entry>"id"</entry><entry>The "Identification" namespace. This
4749 * namespace is used by file managers and applications that list directories
4750 * to check for loops and to uniquely identify files.</entry></row>
4751 * <row><entry>"access"</entry><entry>The "Access" namespace. Used to check
4752 * if a user has the proper privilidges to access files and perform
4753 * file operations. Keys in this namespace are made to be generic
4754 * and easily understood, e.g. the "can_read" key is %TRUE if
4755 * the current user has permission to read the file. UNIX permissions and
4756 * NTFS ACLs in Windows should be mapped to these values.</entry></row>
4757 * <row><entry>"mountable"</entry><entry>The "Mountable" namespace. Includes
4758 * simple boolean keys for checking if a file or path supports mount operations, e.g.
4759 * mount, unmount, eject. These are used for files of type %G_FILE_TYPE_MOUNTABLE.</entry></row>
4760 * <row><entry>"time"</entry><entry>The "Time" namespace. Includes file
4761 * access, changed, created times. </entry></row>
4762 * <row><entry>"unix"</entry><entry>The "Unix" namespace. Includes UNIX-specific
4763 * information and may not be available for all files. Examples include
4764 * the UNIX "UID", "GID", etc.</entry></row>
4765 * <row><entry>"dos"</entry><entry>The "DOS" namespace. Includes DOS-specific
4766 * information and may not be available for all files. Examples include
4767 * "is_system" for checking if a file is marked as a system file, and "is_archive"
4768 * for checking if a file is marked as an archive file.</entry></row>
4769 * <row><entry>"owner"</entry><entry>The "Owner" namespace. Includes information
4770 * about who owns a file. May not be available for all file systems. Examples include
4771 * "user" for getting the user name of the file owner. This information is often mapped from
4772 * some backend specific data such as a unix UID.</entry></row>
4773 * <row><entry>"thumbnail"</entry><entry>The "Thumbnail" namespace. Includes
4774 * information about file thumbnails and their location within the file system. Examples of
4775 * keys in this namespace include "path" to get the location of a thumbnail, and "failed"
4776 * to check if thumbnailing of the file failed.</entry></row>
4777 * <row><entry>"filesystem"</entry><entry>The "Filesystem" namespace. Gets information
4778 * about the file system where a file is located, such as its type, how much
4779 * space is left available, and the overall size of the file system.</entry></row>
4780 * <row><entry>"gvfs"</entry><entry>The "GVFS" namespace. Keys in this namespace
4781 * contain information about the current GVFS backend in use. </entry></row>
4782 * <row><entry>"xattr"</entry><entry>The "xattr" namespace. Gets information
4783 * about extended user attributes. See attr(5). The "user." prefix of the
4784 * extended user attribute name is stripped away when constructing keys in
4785 * this namespace, e.g. "xattr::mime_type" for the extended attribute with
4786 * the name "user.mime_type". Note that this information is only available
4787 * if GLib has been built with extended attribute support.</entry></row>
4788 * <row><entry>"xattr-sys"</entry><entry>The "xattr-sys" namespace.
4789 * Gets information about extended attributes which are not user-specific.
4790 * See attr(5). Note that this information is only available if GLib
4791 * has been built with extended attribute support.</entry></row>
4792 * <row><entry>"selinux"</entry><entry>The "SELinux" namespace. Includes
4793 * information about the SELinux context of files. Note that this information
4794 * is only available if GLib has been built with SELinux support.</entry></row>
4800 * Please note that these are not all of the possible namespaces.
4801 * More namespaces can be added from GIO modules or by individual applications.
4802 * For more information about writing GIO modules, see #GIOModule.
4804 * <!-- TODO: Implementation note about using extended attributes on supported
4808 * <title>GFileAttributes Built-in Keys and Value Types</title>
4809 * <tgroup cols='3' align='left'><thead>
4810 * <row><entry>Enum Value</entry><entry>Namespace:Key</entry><entry>Value Type</entry></row>
4812 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TYPE</entry><entry>standard::type</entry><entry>uint32 (#GFileType)</entry></row>
4813 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN</entry><entry>standard::is-hidden</entry><entry>boolean</entry></row>
4814 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP</entry><entry>standard::is-backup</entry><entry>boolean</entry></row>
4815 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK</entry><entry>standard::is-symlink</entry><entry>boolean</entry></row>
4816 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL</entry><entry>standard::is-virtual</entry><entry>boolean</entry></row>
4817 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_NAME</entry><entry>standard::name</entry><entry>byte string</entry></row>
4818 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</entry><entry>standard::display-name</entry><entry>string</entry></row>
4819 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME</entry><entry>standard::edit-name</entry><entry>string</entry></row>
4820 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ICON</entry><entry>standard::icon</entry><entry>object (#GIcon)</entry></row>
4821 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE</entry><entry>standard::content-type</entry><entry>string</entry></row>
4822 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE</entry><entry>standard::fast-content-type</entry><entry>string</entry></row>
4823 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SIZE</entry><entry>standard::size</entry><entry>uint64</entry></row>
4824 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE</entry><entry>standard::allocated-size</entry><entry>uint64</entry></row>
4825 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET</entry><entry>standard::symlink-target</entry><entry>byte string</entry></row>
4826 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TARGET_URI</entry><entry>standard::target-uri</entry><entry>string</entry></row>
4827 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER</entry><entry>standard::sort-order</entry><entry>int32</entry></row>
4828 * <row><entry>%G_FILE_ATTRIBUTE_ETAG_VALUE</entry><entry>etag::value</entry><entry>string</entry></row>
4829 * <row><entry>%G_FILE_ATTRIBUTE_ID_FILE</entry><entry>id::file</entry><entry>string</entry></row>
4830 * <row><entry>%G_FILE_ATTRIBUTE_ID_FILESYSTEM</entry><entry>id::filesystem</entry><entry>string</entry></row>
4831 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_READ</entry><entry>access::can-read</entry><entry>boolean</entry></row>
4832 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE</entry><entry>access::can-write</entry><entry>boolean</entry></row>
4833 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE</entry><entry>access::can-execute</entry><entry>boolean</entry></row>
4834 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE</entry><entry>access::can-delete</entry><entry>boolean</entry></row>
4835 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH</entry><entry>access::can-trash</entry><entry>boolean</entry></row>
4836 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME</entry><entry>access::can-rename</entry><entry>boolean</entry></row>
4837 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT</entry><entry>mountable::can-mount</entry><entry>boolean</entry></row>
4838 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT</entry><entry>mountable::can-unmount</entry><entry>boolean</entry></row>
4839 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT</entry><entry>mountable::can-eject</entry><entry>boolean</entry></row>
4840 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE</entry><entry>mountable::unix-device</entry><entry>uint32</entry></row>
4841 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE</entry><entry>mountable::unix-device-file</entry><entry>string</entry></row>
4842 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI</entry><entry>mountable::hal-udi</entry><entry>string</entry></row>
4843 * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED</entry><entry>time::modified</entry><entry>uint64</entry></row>
4844 * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC</entry><entry>time::modified-usec</entry><entry>uint32</entry></row>
4845 * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS</entry><entry>time::access</entry><entry>uint64</entry></row>
4846 * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS_USEC</entry><entry>time::access-usec</entry><entry>uint32</entry></row>
4847 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED</entry><entry>time::changed</entry><entry>uint64</entry></row>
4848 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED_USEC</entry><entry>time::changed-usec</entry><entry>uint32</entry></row>
4849 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED</entry><entry>time::created</entry><entry>uint64</entry></row>
4850 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED_USEC</entry><entry>time::created-usec</entry><entry>uint32</entry></row>
4851 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_DEVICE</entry><entry>unix::device</entry><entry>uint32</entry></row>
4852 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_INODE</entry><entry>unix::inode</entry><entry>uint64</entry></row>
4853 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_MODE</entry><entry>unix::mode</entry><entry>uint32</entry></row>
4854 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_NLINK</entry><entry>unix::nlink</entry><entry>uint32</entry></row>
4855 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_UID</entry><entry>unix::uid</entry><entry>uint32</entry></row>
4856 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_GID</entry><entry>unix::gid</entry><entry>uint32</entry></row>
4857 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_RDEV</entry><entry>unix::rdev</entry><entry>uint32</entry></row>
4858 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE</entry><entry>unix::block-size</entry><entry>uint32</entry></row>
4859 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCKS</entry><entry>unix::blocks</entry><entry>uint64</entry></row>
4860 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT</entry><entry>unix::is-mountpoint</entry><entry>boolean</entry></row>
4861 * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE</entry><entry>dos::is-archive</entry><entry>boolean</entry></row>
4862 * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_SYSTEM</entry><entry>dos::is-system</entry><entry>boolean</entry></row>
4863 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER</entry><entry>owner::user</entry><entry>string</entry></row>
4864 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER_REAL</entry><entry>owner::user-real</entry><entry>string</entry></row>
4865 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_GROUP</entry><entry>owner::group</entry><entry>string</entry></row>
4866 * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAIL_PATH</entry><entry>thumbnail::path</entry><entry>bytestring</entry></row>
4867 * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAILING_FAILED</entry><entry>thumbnail::failed</entry><entry>boolean</entry></row>
4868 * <row><entry>%G_FILE_ATTRIBUTE_PREVIEW_ICON</entry><entry>preview::icon</entry><entry>object (#GIcon)</entry></row>
4869 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_SIZE</entry><entry>filesystem::size</entry><entry>uint64</entry></row>
4870 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_FREE</entry><entry>filesystem::free</entry><entry>uint64</entry></row>
4871 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_USED</entry><entry>filesystem::used</entry><entry>uint64</entry></row>
4872 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_TYPE</entry><entry>filesystem::type</entry><entry>string</entry></row>
4873 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_READONLY</entry><entry>filesystem::readonly</entry><entry>boolean</entry></row>
4874 * <row><entry>%G_FILE_ATTRIBUTE_GVFS_BACKEND</entry><entry>gvfs::backend</entry><entry>string</entry></row>
4875 * <row><entry>%G_FILE_ATTRIBUTE_SELINUX_CONTEXT</entry><entry>selinux::context</entry><entry>string</entry></row>
4876 * </tbody></tgroup></table></para>
4878 * Note that there are no predefined keys in the "xattr" and "xattr-sys"
4879 * namespaces. Keys for the "xattr" namespace are constructed by stripping
4880 * away the "user." prefix from the extended user attribute, and prepending
4881 * "xattr::". Keys for the "xattr-sys" namespace are constructed by
4882 * concatenating "xattr-sys::" with the extended attribute name. All extended
4883 * attribute values are returned as hex-encoded strings in which bytes outside
4884 * the ASCII range are encoded as hexadecimal escape sequences of the form
4885 * \x<replaceable>nn</replaceable>.
4890 * SECTION:gfiledescriptorbased
4891 * @short_description: Interface for file descriptor based IO
4892 * @include: gio/gfiledescriptorbased.h
4893 * @see_also: #GInputStream, #GOutputStream
4895 * #GFileDescriptorBased is implemented by streams (implementations of
4896 * #GInputStream or #GOutputStream) that are based on file descriptors.
4898 * Note that <filename><gio/gfiledescriptorbased.h></filename> belongs to
4899 * the UNIX-specific GIO interfaces, thus you have to use the
4900 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4907 * SECTION:gfileenumerator
4908 * @short_description: Enumerated Files Routines
4909 * @include: gio/gio.h
4911 * #GFileEnumerator allows you to operate on a set of #GFile<!-- -->s,
4912 * returning a #GFileInfo structure for each file enumerated (e.g.
4913 * g_file_enumerate_children() will return a #GFileEnumerator for each
4914 * of the children within a directory).
4916 * To get the next file's information from a #GFileEnumerator, use
4917 * g_file_enumerator_next_file() or its asynchronous version,
4918 * g_file_enumerator_next_files_async(). Note that the asynchronous
4919 * version will return a list of #GFileInfo<!---->s, whereas the
4920 * synchronous will only return the next file in the enumerator.
4922 * To close a #GFileEnumerator, use g_file_enumerator_close(), or
4923 * its asynchronous version, g_file_enumerator_close_async(). Once
4924 * a #GFileEnumerator is closed, no further actions may be performed
4925 * on it, and it should be freed with g_object_unref().
4931 * @short_description: Icons pointing to an image file
4932 * @include: gio/gio.h
4933 * @see_also: #GIcon, #GLoadableIcon
4935 * #GFileIcon specifies an icon by pointing to an image file
4936 * to be used as icon.
4942 * @short_description: File Information and Attributes
4943 * @include: gio/gio.h
4944 * @see_also: #GFile, <link linkend="gio-GFileAttribute">GFileAttribute</link>
4946 * Functionality for manipulating basic metadata for files. #GFileInfo
4947 * implements methods for getting information that all files should
4948 * contain, and allows for manipulation of extended attributes.
4950 * See <link linkend="gio-GFileAttribute">GFileAttribute</link> for more
4951 * information on how GIO handles file attributes.
4953 * To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
4954 * async variant). To obtain a #GFileInfo for a file input or output
4955 * stream, use g_file_input_stream_query_info() or
4956 * g_file_output_stream_query_info() (or their async variants).
4958 * To change the actual attributes of a file, you should then set the
4959 * attribute in the #GFileInfo and call g_file_set_attributes_from_info()
4960 * or g_file_set_attributes_async() on a GFile.
4962 * However, not all attributes can be changed in the file. For instance,
4963 * the actual size of a file cannot be changed via g_file_info_set_size().
4964 * You may call g_file_query_settable_attributes() and
4965 * g_file_query_writable_namespaces() to discover the settable attributes
4966 * of a particular file at runtime.
4968 * #GFileAttributeMatcher allows for searching through a #GFileInfo for
4974 * SECTION:gfileinputstream
4975 * @short_description: File input streaming operations
4976 * @include: gio/gio.h
4977 * @see_also: #GInputStream, #GDataInputStream, #GSeekable
4979 * GFileInputStream provides input streams that take their
4980 * content from a file.
4982 * GFileInputStream implements #GSeekable, which allows the input
4983 * stream to jump to arbitrary positions in the file, provided the
4984 * filesystem of the file allows it. To find the position of a file
4985 * input stream, use g_seekable_tell(). To find out if a file input
4986 * stream supports seeking, use g_seekable_can_seek().
4987 * To position a file input stream, use g_seekable_seek().
4992 * SECTION:gfileiostream
4993 * @short_description: File read and write streaming operations
4994 * @include: gio/gio.h
4995 * @see_also: #GIOStream, #GFileInputStream, #GFileOutputStream, #GSeekable
4997 * GFileIOStream provides io streams that both read and write to the same
5000 * GFileIOStream implements #GSeekable, which allows the io
5001 * stream to jump to arbitrary positions in the file and to truncate
5002 * the file, provided the filesystem of the file supports these
5005 * To find the position of a file io stream, use
5006 * g_seekable_tell().
5008 * To find out if a file io stream supports seeking, use g_seekable_can_seek().
5009 * To position a file io stream, use g_seekable_seek().
5010 * To find out if a file io stream supports truncating, use
5011 * g_seekable_can_truncate(). To truncate a file io
5012 * stream, use g_seekable_truncate().
5014 * The default implementation of all the #GFileIOStream operations
5015 * and the implementation of #GSeekable just call into the same operations
5016 * on the output stream.
5023 * SECTION:gfilemonitor
5024 * @short_description: File Monitor
5025 * @include: gio/gio.h
5027 * Monitors a file or directory for changes.
5029 * To obtain a #GFileMonitor for a file or directory, use
5030 * g_file_monitor(), g_file_monitor_file(), or
5031 * g_file_monitor_directory().
5033 * To get informed about changes to the file or directory you are
5034 * monitoring, connect to the #GFileMonitor::changed signal. The
5035 * signal will be emitted in the <link
5036 * linkend="g-main-context-push-thread-default">thread-default main
5037 * context</link> of the thread that the monitor was created in
5038 * (though if the global default main context is blocked, this may
5039 * cause notifications to be blocked even if the thread-default
5040 * context is still running).
5045 * SECTION:gfilenamecompleter
5046 * @short_description: Filename Completer
5047 * @include: gio/gio.h
5049 * Completes partial file and directory names given a partial string by
5050 * looking in the file system for clues. Can return a list of possible
5051 * completion strings for widget implementations.
5056 * SECTION:gfileoutputstream
5057 * @short_description: File output streaming operations
5058 * @include: gio/gio.h
5059 * @see_also: #GOutputStream, #GDataOutputStream, #GSeekable
5061 * GFileOutputStream provides output streams that write their
5062 * content to a file.
5064 * GFileOutputStream implements #GSeekable, which allows the output
5065 * stream to jump to arbitrary positions in the file and to truncate
5066 * the file, provided the filesystem of the file supports these
5069 * To find the position of a file output stream, use g_seekable_tell().
5070 * To find out if a file output stream supports seeking, use
5071 * g_seekable_can_seek().To position a file output stream, use
5072 * g_seekable_seek(). To find out if a file output stream supports
5073 * truncating, use g_seekable_can_truncate(). To truncate a file output
5074 * stream, use g_seekable_truncate().
5079 * SECTION:gfilterinputstream
5080 * @short_description: Filter Input Stream
5081 * @include: gio/gio.h
5083 * Base class for input stream implementations that perform some
5084 * kind of filtering operation on a base stream. Typical examples
5085 * of filtering operations are character set conversion, compression
5086 * and byte order flipping.
5091 * SECTION:gfilteroutputstream
5092 * @short_description: Filter Output Stream
5093 * @include: gio/gio.h
5095 * Base class for output stream implementations that perform some
5096 * kind of filtering operation on a base stream. Typical examples
5097 * of filtering operations are character set conversion, compression
5098 * and byte order flipping.
5104 * @short_description: Interface for icons
5105 * @include: gio/gio.h
5107 * #GIcon is a very minimal interface for icons. It provides functions
5108 * for checking the equality of two icons, hashing of icons and
5109 * serializing an icon to and from strings.
5111 * #GIcon does not provide the actual pixmap for the icon as this is out
5112 * of GIO's scope, however implementations of #GIcon may contain the name
5113 * of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
5115 * To obtain a hash of a #GIcon, see g_icon_hash().
5117 * To check if two #GIcons are equal, see g_icon_equal().
5119 * For serializing a #GIcon, use g_icon_to_string() and
5120 * g_icon_new_for_string().
5122 * If your application or library provides one or more #GIcon
5123 * implementations you need to ensure that each #GType is registered
5124 * with the type system prior to calling g_icon_new_for_string().
5129 * SECTION:ginetaddress
5130 * @short_description: An IPv4/IPv6 address
5132 * #GInetAddress represents an IPv4 or IPv6 internet address. Use
5133 * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
5134 * look up the #GInetAddress for a hostname. Use
5135 * g_resolver_lookup_by_address() or
5136 * g_resolver_lookup_by_address_async() to look up the hostname for a
5139 * To actually connect to a remote host, you will need a
5140 * #GInetSocketAddress (which includes a #GInetAddress as well as a
5146 * SECTION:ginetaddressmask
5147 * @short_description: An IPv4/IPv6 address mask
5149 * #GInetAddressMask represents a range of IPv4 or IPv6 addresses
5150 * described by a base address and a length indicating how many bits
5151 * of the base address are relevant for matching purposes. These are
5152 * often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".
5157 * SECTION:ginetsocketaddress
5158 * @short_description: Internet GSocketAddress
5160 * An IPv4 or IPv6 socket address; that is, the combination of a
5161 * #GInetAddress and a port number.
5167 * @short_description: Failable object initialization interface
5168 * @include: gio/gio.h
5169 * @see_also: #GAsyncInitable
5171 * #GInitable is implemented by objects that can fail during
5172 * initialization. If an object implements this interface then
5173 * it must be initialized as the first thing after construction,
5174 * either via g_initable_init() or g_async_initable_init_async()
5175 * (the latter is only available if it also implements #GAsyncInitable).
5177 * If the object is not initialized, or initialization returns with an
5178 * error, then all operations on the object except g_object_ref() and
5179 * g_object_unref() are considered to be invalid, and have undefined
5180 * behaviour. They will often fail with g_critical() or g_warning(), but
5181 * this must not be relied on.
5183 * Users of objects implementing this are not intended to use
5184 * the interface method directly, instead it will be used automatically
5185 * in various ways. For C applications you generally just call
5186 * g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
5187 * This will call g_initable_init() under the cover, returning %NULL and
5188 * setting a #GError on failure (at which point the instance is
5191 * For bindings in languages where the native constructor supports
5192 * exceptions the binding could check for objects implemention %GInitable
5193 * during normal construction and automatically initialize them, throwing
5194 * an exception on failure.
5199 * SECTION:ginputstream
5200 * @short_description: Base class for implementing streaming input
5201 * @include: gio/gio.h
5203 * #GInputStream has functions to read from a stream (g_input_stream_read()),
5204 * to close a stream (g_input_stream_close()) and to skip some content
5205 * (g_input_stream_skip()).
5207 * To copy the content of an input stream to an output stream without
5208 * manually handling the reads and writes, use g_output_stream_splice().
5210 * All of these functions have async variants too.
5216 * @short_description: Error helper functions
5217 * @include: gio/gio.h
5219 * Contains helper functions for reporting errors to the user.
5225 * @short_description: Loadable GIO Modules
5226 * @include: gio/gio.h
5228 * Provides an interface and default functions for loading and unloading
5229 * modules. This is used internally to make GIO extensible, but can also
5230 * be used by others to implement module loading.
5235 * SECTION:gioscheduler
5236 * @short_description: I/O Scheduler
5237 * @include: gio/gio.h
5239 * Schedules asynchronous I/O operations. #GIOScheduler integrates
5240 * into the main event loop (#GMainLoop) and uses threads.
5242 * <para id="io-priority"><indexterm><primary>I/O priority</primary></indexterm>
5243 * Each I/O operation has a priority, and the scheduler uses the priorities
5244 * to determine the order in which operations are executed. They are
5245 * <emphasis>not</emphasis> used to determine system-wide I/O scheduling.
5246 * Priorities are integers, with lower numbers indicating higher priority.
5247 * It is recommended to choose priorities between %G_PRIORITY_LOW and
5248 * %G_PRIORITY_HIGH, with %G_PRIORITY_DEFAULT as a default.
5255 * @short_description: Base class for implementing read/write streams
5256 * @include: gio/gio.h
5257 * @see_also: #GInputStream, #GOutputStream
5259 * GIOStream represents an object that has both read and write streams.
5260 * Generally the two streams acts as separate input and output streams,
5261 * but they share some common resources and state. For instance, for
5262 * seekable streams they may use the same position in both streams.
5264 * Examples of #GIOStream objects are #GSocketConnection which represents
5265 * a two-way network connection, and #GFileIOStream which represent a
5266 * file handle opened in read-write mode.
5268 * To do the actual reading and writing you need to get the substreams
5269 * with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
5271 * The #GIOStream object owns the input and the output streams, not the other
5272 * way around, so keeping the substreams alive will not keep the #GIOStream
5273 * object alive. If the #GIOStream object is freed it will be closed, thus
5274 * closing the substream, so even if the substreams stay alive they will
5275 * always just return a %G_IO_ERROR_CLOSED for all operations.
5277 * To close a stream use g_io_stream_close() which will close the common
5278 * stream object and also the individual substreams. You can also close
5279 * the substreams themselves. In most cases this only marks the
5280 * substream as closed, so further I/O on it fails. However, some streams
5281 * may support "half-closed" states where one direction of the stream
5282 * is actually shut down.
5289 * SECTION:gloadableicon
5290 * @short_description: Loadable Icons
5291 * @include: gio/gio.h
5292 * @see_also: #GIcon, #GThemedIcon
5294 * Extends the #GIcon interface and adds the ability to
5295 * load icons from streams.
5300 * SECTION:gmemoryinputstream
5301 * @short_description: Streaming input operations on memory chunks
5302 * @include: gio/gio.h
5303 * @see_also: #GMemoryOutputStream
5305 * #GMemoryInputStream is a class for using arbitrary
5306 * memory chunks as input for GIO streaming input operations.
5308 * As of GLib 2.34, #GMemoryInputStream implements
5309 * #GPollableInputStream.
5314 * SECTION:gmemoryoutputstream
5315 * @short_description: Streaming output operations on memory chunks
5316 * @include: gio/gio.h
5317 * @see_also: #GMemoryInputStream
5319 * #GMemoryOutputStream is a class for using arbitrary
5320 * memory chunks as output for GIO streaming output operations.
5322 * As of GLib 2.34, #GMemoryOutputStream implements
5323 * #GPollableOutputStream.
5330 * @short_description: A simple implementation of GMenuModel
5332 * #GMenu is a simple implementation of #GMenuModel.
5333 * You populate a #GMenu by adding #GMenuItem instances to it.
5335 * There are some convenience functions to allow you to directly
5336 * add items (avoiding #GMenuItem) for the common cases. To add
5337 * a regular item, use g_menu_insert(). To add a section, use
5338 * g_menu_insert_section(). To add a submenu, use
5339 * g_menu_insert_submenu().
5344 * SECTION:gmenuexporter
5345 * @title: GMenuModel exporter
5346 * @short_description: Export GMenuModels on D-Bus
5347 * @see_also: #GMenuModel, #GDBusMenuModel
5349 * These functions support exporting a #GMenuModel on D-Bus.
5350 * The D-Bus interface that is used is a private implementation
5353 * To access an exported #GMenuModel remotely, use
5354 * g_dbus_menu_model_get() to obtain a #GDBusMenuModel.
5359 * SECTION:gmenumodel
5360 * @title: GMenuModel
5361 * @short_description: An abstract class representing the contents of a menu
5362 * @see_also: #GActionGroup
5364 * #GMenuModel represents the contents of a menu -- an ordered list of
5365 * menu items. The items are associated with actions, which can be
5366 * activated through them. Items can be grouped in sections, and may
5367 * have submenus associated with them. Both items and sections usually
5368 * have some representation data, such as labels or icons. The type of
5369 * the associated action (ie whether it is stateful, and what kind of
5370 * state it has) can influence the representation of the item.
5372 * The conceptual model of menus in #GMenuModel is hierarchical:
5373 * sections and submenus are again represented by #GMenuModels.
5374 * Menus themselves do not define their own roles. Rather, the role
5375 * of a particular #GMenuModel is defined by the item that references
5376 * it (or, in the case of the 'root' menu, is defined by the context
5377 * in which it is used).
5379 * As an example, consider the visible portions of the menu in
5380 * <xref linkend="menu-example"/>.
5382 * <figure id="menu-example">
5383 * <title>An example menu</title>
5384 * <graphic fileref="menu-example.png" format="PNG"></graphic>
5387 * There are 8 "menus" visible in the screenshot: one menubar, two
5388 * submenus and 5 sections:
5390 * <listitem>the toplevel menubar (containing 4 items)</listitem>
5391 * <listitem>the View submenu (containing 3 sections)</listitem>
5392 * <listitem>the first section of the View submenu (containing 2 items)</listitem>
5393 * <listitem>the second section of the View submenu (containing 1 item)</listitem>
5394 * <listitem>the final section of the View submenu (containing 1 item)</listitem>
5395 * <listitem>the Highlight Mode submenu (containing 2 sections)</listitem>
5396 * <listitem>the Sources section (containing 2 items)</listitem>
5397 * <listitem>the Markup section (containing 2 items)</listitem>
5400 * <xref linkend="menu-model"/> illustrates the conceptual connection between
5401 * these 8 menus. Each large block in the figure represents a menu and the
5402 * smaller blocks within the large block represent items in that menu. Some
5403 * items contain references to other menus.
5405 * <figure id="menu-model">
5406 * <title>A menu model</title>
5407 * <graphic fileref="menu-model.png" format="PNG"></graphic>
5410 * Notice that the separators visible in <xref linkend="menu-example"/>
5411 * appear nowhere in <xref linkend="menu-model"/>. This is because
5412 * separators are not explicitly represented in the menu model. Instead,
5413 * a separator is inserted between any two non-empty sections of a menu.
5414 * Section items can have labels just like any other item. In that case,
5415 * a display system may show a section header instead of a separator.
5417 * The motivation for this abstract model of application controls is
5418 * that modern user interfaces tend to make these controls available
5419 * outside the application. Examples include global menus, jumplists,
5420 * dash boards, etc. To support such uses, it is necessary to 'export'
5421 * information about actions and their representation in menus, which
5422 * is exactly what the
5423 * <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
5425 * <link linkend="gio-GMenuModel-exporter">GMenuModel exporter</link>
5426 * do for #GActionGroup and #GMenuModel. The client-side counterparts
5427 * to make use of the exported information are #GDBusActionGroup and
5430 * The API of #GMenuModel is very generic, with iterators for the
5431 * attributes and links of an item, see g_menu_model_iterate_item_attributes()
5432 * and g_menu_model_iterate_item_links(). The 'standard' attributes and
5433 * link types have predefined names: %G_MENU_ATTRIBUTE_LABEL,
5434 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, %G_MENU_LINK_SECTION
5435 * and %G_MENU_LINK_SUBMENU.
5437 * Items in a #GMenuModel represent active controls if they refer to
5438 * an action that can get activated when the user interacts with the
5439 * menu item. The reference to the action is encoded by the string id
5440 * in the %G_MENU_ATTRIBUTE_ACTION attribute. An action id uniquely
5441 * identifies an action in an action group. Which action group(s) provide
5442 * actions depends on the context in which the menu model is used.
5443 * E.g. when the model is exported as the application menu of a
5444 * #GtkApplication, actions can be application-wide or window-specific
5445 * (and thus come from two different action groups). By convention, the
5446 * application-wide actions have names that start with "app.", while the
5447 * names of window-specific actions start with "win.".
5449 * While a wide variety of stateful actions is possible, the following
5450 * is the minimum that is expected to be supported by all users of exported
5453 * <listitem>an action with no parameter type and no state</listitem>
5454 * <listitem>an action with no parameter type and boolean state</listitem>
5455 * <listitem>an action with string parameter type and string state</listitem>
5458 * <formalpara><title>Stateless</title>
5460 * A stateless action typically corresponds to an ordinary menu item.
5463 * Selecting such a menu item will activate the action (with no parameter).
5467 * <formalpara><title>Boolean State</title>
5469 * An action with a boolean state will most typically be used with a "toggle"
5470 * or "switch" menu item. The state can be set directly, but activating the
5471 * action (with no parameter) results in the state being toggled.
5474 * Selecting a toggle menu item will activate the action. The menu item should
5475 * be rendered as "checked" when the state is true.
5479 * <formalpara><title>String Parameter and State</title>
5481 * Actions with string parameters and state will most typically be used to
5482 * represent an enumerated choice over the items available for a group of
5483 * radio menu items. Activating the action with a string parameter is
5484 * equivalent to setting that parameter as the state.
5487 * Radio menu items, in addition to being associated with the action, will
5488 * have a target value. Selecting that menu item will result in activation
5489 * of the action with the target value as the parameter. The menu item should
5490 * be rendered as "selected" when the state of the action is equal to the
5491 * target value of the menu item.
5499 * @short_description: Mount management
5500 * @include: gio/gio.h
5501 * @see_also: GVolume, GUnixMountEntry, GUnixMountPoint
5503 * The #GMount interface represents user-visible mounts. Note, when
5504 * porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
5506 * #GMount is a "mounted" filesystem that you can access. Mounted is in
5507 * quotes because it's not the same as a unix mount, it might be a gvfs
5508 * mount, but you can still access the files on it if you use GIO. Might or
5509 * might not be related to a volume object.
5511 * Unmounting a #GMount instance is an asynchronous operation. For
5512 * more information about asynchronous operations, see #GAsyncResult
5513 * and #GSimpleAsyncResult. To unmount a #GMount instance, first call
5514 * g_mount_unmount_with_operation() with (at least) the #GMount instance and a
5515 * #GAsyncReadyCallback. The callback will be fired when the
5516 * operation has resolved (either with success or failure), and a
5517 * #GAsyncReady structure will be passed to the callback. That
5518 * callback should then call g_mount_unmount_with_operation_finish() with the #GMount
5519 * and the #GAsyncReady data to see if the operation was completed
5520 * successfully. If an @error is present when g_mount_unmount_with_operation_finish()
5521 * is called, then it will be filled with any error information.
5526 * SECTION:gmountoperation
5527 * @short_description: Object used for authentication and user interaction
5528 * @include: gio/gio.h
5530 * #GMountOperation provides a mechanism for interacting with the user.
5531 * It can be used for authenticating mountable operations, such as loop
5532 * mounting files, hard drive partitions or server locations. It can
5533 * also be used to ask the user questions or show a list of applications
5534 * preventing unmount or eject operations from completing.
5536 * Note that #GMountOperation is used for more than just #GMount
5537 * objects – for example it is also used in g_drive_start() and
5540 * Users should instantiate a subclass of this that implements all the
5541 * various callbacks to show the required dialogs, such as
5542 * #GtkMountOperation. If no user interaction is desired (for example
5543 * when automounting filesystems at login time), usually %NULL can be
5544 * passed, see each method taking a #GMountOperation for details.
5549 * SECTION:gnetworkaddress
5550 * @short_description: A GSocketConnectable for resolving hostnames
5551 * @include: gio/gio.h
5553 * #GNetworkAddress provides an easy way to resolve a hostname and
5554 * then attempt to connect to that host, handling the possibility of
5555 * multiple IP addresses and multiple address families.
5557 * See #GSocketConnectable for and example of using the connectable
5563 * SECTION:gnetworkmonitor
5564 * @title: GNetworkMonitor
5565 * @short_description: Network status monitor
5566 * @include: gio/gio.h
5568 * #GNetworkMonitor provides an easy-to-use cross-platform API
5569 * for monitoring network connectivity. On Linux, the implementation
5570 * is based on the kernels netlink interface.
5575 * SECTION:gnetworkservice
5576 * @short_description: A GSocketConnectable for resolving SRV records
5577 * @include: gio/gio.h
5579 * Like #GNetworkAddress does with hostnames, #GNetworkService
5580 * provides an easy way to resolve a SRV record, and then attempt to
5581 * connect to one of the hosts that implements that service, handling
5582 * service priority/weighting, multiple IP addresses, and multiple
5585 * See #GSrvTarget for more information about SRV records, and see
5586 * #GSocketConnectable for and example of using the connectable
5592 * SECTION:goutputstream
5593 * @short_description: Base class for implementing streaming output
5594 * @include: gio/gio.h
5596 * #GOutputStream has functions to write to a stream (g_output_stream_write()),
5597 * to close a stream (g_output_stream_close()) and to flush pending writes
5598 * (g_output_stream_flush()).
5600 * To copy the content of an input stream to an output stream without
5601 * manually handling the reads and writes, use g_output_stream_splice().
5603 * All of these functions have async variants too.
5608 * SECTION:gpermission
5609 * @title: GPermission
5610 * @short_description: An object representing the permission to perform a certain action
5612 * A #GPermission represents the status of the caller's permission to
5613 * perform a certain action.
5615 * You can query if the action is currently allowed and if it is
5616 * possible to acquire the permission so that the action will be allowed
5619 * There is also an API to actually acquire the permission and one to
5622 * As an example, a #GPermission might represent the ability for the
5623 * user to write to a #GSettings object. This #GPermission object could
5624 * then be used to decide if it is appropriate to show a "Click here to
5625 * unlock" button in a dialog and to provide the mechanism to invoke
5626 * when that button is clicked.
5631 * SECTION:gpollableinputstream
5632 * @short_description: Interface for pollable input streams
5633 * @include: gio/gio.h
5634 * @see_also: #GInputStream, #GPollableOutputStream, #GFileDescriptorBased
5636 * #GPollableInputStream is implemented by #GInputStreams that
5637 * can be polled for readiness to read. This can be used when
5638 * interfacing with a non-GIO API that expects
5639 * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5646 * SECTION:gpollableoutputstream
5647 * @short_description: Interface for pollable output streams
5648 * @include: gio/gio.h
5649 * @see_also: #GOutputStream, #GFileDescriptorBased, #GPollableInputStream
5651 * #GPollableOutputStream is implemented by #GOutputStreams that
5652 * can be polled for readiness to write. This can be used when
5653 * interfacing with a non-GIO API that expects
5654 * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5661 * SECTION:gpollableutils
5662 * @short_description: #GPollableInputStream / #GPollableOutputStream utilities
5663 * @include: gio/gio.h
5665 * Utility functions for #GPollableInputStream and
5666 * #GPollableOutputStream implementations.
5672 * @short_description: Interface for proxy handling
5674 * A #GProxy handles connecting to a remote host via a given type of
5675 * proxy server. It is implemented by the 'gio-proxy' extension point.
5676 * The extensions are named after their proxy protocol name. As an
5677 * example, a SOCKS5 proxy implementation can be retrieved with the
5678 * name 'socks5' using the function
5679 * g_io_extension_point_get_extension_by_name().
5686 * SECTION:gproxyaddress
5687 * @short_description: An internet address with proxy information
5689 * Support for proxied #GInetSocketAddress.
5694 * SECTION:gproxyresolver
5695 * @short_description: Asynchronous and cancellable network proxy resolver
5696 * @include: gio/gio.h
5698 * #GProxyResolver provides synchronous and asynchronous network proxy
5699 * resolution. #GProxyResolver is used within #GSocketClient through
5700 * the method g_socket_connectable_proxy_enumerate().
5705 * SECTION:gremoteactiongroup
5706 * @title: GRemoteActionGroup
5707 * @short_description: a #GActionGroup that interacts with other processes
5709 * The GRemoteActionGroup interface is implemented by #GActionGroup
5710 * instances that either transmit action invocations to other processes
5711 * or receive action invocations in the local process from other
5714 * The interface has <literal>_full</literal> variants of the two
5715 * methods on #GActionGroup used to activate actions:
5716 * g_action_group_activate_action() and
5717 * g_action_group_change_action_state(). These variants allow a
5718 * "platform data" #GVariant to be specified: a dictionary providing
5719 * context for the action invocation (for example: timestamps, startup
5720 * notification IDs, etc).
5722 * #GDBusActionGroup implements #GRemoteActionGroup. This provides a
5723 * mechanism to send platform data for action invocations over D-Bus.
5725 * Additionally, g_dbus_connection_export_action_group() will check if
5726 * the exported #GActionGroup implements #GRemoteActionGroup and use the
5727 * <literal>_full</literal> variants of the calls if available. This
5728 * provides a mechanism by which to receive platform data for action
5729 * invocations that arrive by way of D-Bus.
5737 * @short_description: Asynchronous and cancellable DNS resolver
5738 * @include: gio/gio.h
5740 * #GResolver provides cancellable synchronous and asynchronous DNS
5741 * resolution, for hostnames (g_resolver_lookup_by_address(),
5742 * g_resolver_lookup_by_name() and their async variants) and SRV
5743 * (service) records (g_resolver_lookup_service()).
5745 * #GNetworkAddress and #GNetworkService provide wrappers around
5746 * #GResolver functionality that also implement #GSocketConnectable,
5747 * making it easy to connect to a remote host/service.
5753 * @short_description: Resource framework
5754 * @include: gio/gio.h
5756 * Applications and libraries often contain binary or textual data that is really part of the
5757 * application, rather than user data. For instance #GtkBuilder .ui files, splashscreen images,
5758 * GMenu markup xml, CSS files, icons, etc. These are often shipped as files in <filename>$datadir/appname</filename>, or
5759 * manually included as literal strings in the code.
5761 * The #GResource API and the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5762 * provide a convenient and efficient alternative to this which has some nice properties. You
5763 * maintain the files as normal files, so its easy to edit them, but during the build the files
5764 * are combined into a binary bundle that is linked into the executable. This means that loading
5765 * the resource files are efficient (as they are already in memory, shared with other instances) and
5766 * simple (no need to check for things like I/O errors or locate the files in the filesystem). It
5767 * also makes it easier to create relocatable applications.
5769 * Resource files can also be marked as compressed. Such files will be included in the resource bundle
5770 * in a compressed form, but will be automatically uncompressed when the resource is used. This
5771 * is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away.
5773 * Resource files can also be marked to be preprocessed, by setting the value of the
5774 * <literal>preprocess</literal> attribute to a comma-separated list of preprocessing options.
5775 * The only options currently supported are:
5777 * <literal>xml-stripblanks</literal> which will use <command>xmllint</command> to strip
5778 * ignorable whitespace from the xml file. For this to work, the <envar>XMLLINT</envar>
5779 * environment variable must be set to the full path to the xmllint executable, or xmllint
5780 * must be in the PATH; otherwise the preprocessing step is skipped.
5782 * <literal>to-pixdata</literal> which will use <command>gdk-pixbuf-pixdata</command> to convert
5783 * images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside
5784 * the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata
5785 * program must be in the PATH, or the <envar>GDK_PIXBUF_PIXDATA</envar> environment variable must be
5786 * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will
5789 * Resource bundles are created by the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5790 * which takes an xml file that describes the bundle, and a set of files that the xml references. These
5791 * are combined into a binary resource bundle.
5793 * <example id="resource-example"><title>Example resource description</title>
5794 * <programlisting><![CDATA[
5795 * <?xml version="1.0" encoding="UTF-8"?>
5797 * <gresource prefix="/org/gtk/Example">
5798 * <file>data/splashscreen.png</file>
5799 * <file compressed="true">dialog.ui</file>
5800 * <file preprocess="xml-stripblanks">menumarkup.xml</file>
5803 * ]]></programlisting></example>
5805 * This will create a resource bundle with the following files:
5806 * <programlisting><![CDATA[
5807 * /org/gtk/Example/data/splashscreen.png
5808 * /org/gtk/Example/dialog.ui
5809 * /org/gtk/Example/menumarkup.xml
5810 * ]]></programlisting>
5812 * Note that all resources in the process share the same namespace, so use java-style
5813 * path prefixes (like in the above example) to avoid conflicts.
5815 * You can then use <link linkend="glib-compile-resources">glib-compile-resources</link> to compile the xml to a
5816 * binary bundle that you can load with g_resource_load(). However, its more common to use the --generate-source and
5817 * --generate-header arguments to create a source file and header to link directly into your application.
5819 * Once a #GResource has been created and registered all the data in it can be accessed globally in the process by
5820 * using API calls like g_resources_open_stream() to stream the data or g_resources_lookup_data() to get a direct pointer
5821 * to the data. You can also use uris like "resource:///org/gtk/Example/data/splashscreen.png" with #GFile to access
5822 * the resource data.
5824 * There are two forms of the generated source, the default version uses the compiler support for constructor
5825 * and destructor functions (where available) to automatically create and register the #GResource on startup
5826 * or library load time. If you pass --manual-register two functions to register/unregister the resource is instead
5827 * created. This requires an explicit initialization call in your application/library, but it works on all platforms,
5828 * even on the minor ones where this is not available. (Constructor support is available for at least Win32, MacOS and Linux.)
5830 * Note that resource data can point directly into the data segment of e.g. a library, so if you are unloading libraries
5831 * during runtime you need to be very careful with keeping around pointers to data from a resource, as this goes away
5832 * when the library is unloaded. However, in practice this is not generally a problem, since most resource accesses
5833 * is for your own resources, and resource data is often used once, during parsing, and then released.
5841 * @short_description: Stream seeking interface
5842 * @include: gio/gio.h
5843 * @see_also: #GInputStream, #GOutputStream
5845 * #GSeekable is implemented by streams (implementations of
5846 * #GInputStream or #GOutputStream) that support seeking.
5852 * @short_description: High-level API for application settings
5854 * The #GSettings class provides a convenient API for storing and retrieving
5855 * application settings.
5857 * Reads and writes can be considered to be non-blocking. Reading
5858 * settings with #GSettings is typically extremely fast: on
5859 * approximately the same order of magnitude (but slower than) a
5860 * #GHashTable lookup. Writing settings is also extremely fast in terms
5861 * of time to return to your application, but can be extremely expensive
5862 * for other threads and other processes. Many settings backends
5863 * (including dconf) have lazy initialisation which means in the common
5864 * case of the user using their computer without modifying any settings
5865 * a lot of work can be avoided. For dconf, the D-Bus service doesn't
5866 * even need to be started in this case. For this reason, you should
5867 * only ever modify #GSettings keys in response to explicit user action.
5868 * Particular care should be paid to ensure that modifications are not
5869 * made during startup -- for example, when setting the initial value
5870 * of preferences widgets. The built-in g_settings_bind() functionality
5871 * is careful not to write settings in response to notify signals as a
5872 * result of modifications that it makes to widgets.
5874 * When creating a GSettings instance, you have to specify a schema
5875 * that describes the keys in your settings and their types and default
5876 * values, as well as some other information.
5878 * Normally, a schema has as fixed path that determines where the settings
5879 * are stored in the conceptual global tree of settings. However, schemas
5880 * can also be 'relocatable', i.e. not equipped with a fixed path. This is
5881 * useful e.g. when the schema describes an 'account', and you want to be
5882 * able to store a arbitrary number of accounts.
5884 * Paths must start with and end with a forward slash character ('/')
5885 * and must not contain two sequential slash characters. Paths should
5886 * be chosen based on a domain name associated with the program or
5887 * library to which the settings belong. Examples of paths are
5888 * "/org/gtk/settings/file-chooser/" and "/ca/desrt/dconf-editor/".
5889 * Paths should not start with "/apps/", "/desktop/" or "/system/" as
5890 * they often did in GConf.
5892 * Unlike other configuration systems (like GConf), GSettings does not
5893 * restrict keys to basic types like strings and numbers. GSettings stores
5894 * values as #GVariant, and allows any #GVariantType for keys. Key names
5895 * are restricted to lowercase characters, numbers and '-'. Furthermore,
5896 * the names must begin with a lowercase character, must not end
5897 * with a '-', and must not contain consecutive dashes.
5899 * Similar to GConf, the default values in GSettings schemas can be
5900 * localized, but the localized values are stored in gettext catalogs
5901 * and looked up with the domain that is specified in the
5902 * <tag class="attribute">gettext-domain</tag> attribute of the
5903 * <tag class="starttag">schemalist</tag> or <tag class="starttag">schema</tag>
5904 * elements and the category that is specified in the l10n attribute of the
5905 * <tag class="starttag">key</tag> element.
5907 * GSettings uses schemas in a compact binary form that is created
5908 * by the <link linkend="glib-compile-schemas">glib-compile-schemas</link>
5909 * utility. The input is a schema description in an XML format that can be
5910 * described by the following DTD:
5911 * |[<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>]|
5913 * glib-compile-schemas expects schema files to have the extension <filename>.gschema.xml</filename>
5915 * At runtime, schemas are identified by their id (as specified
5916 * in the <tag class="attribute">id</tag> attribute of the
5917 * <tag class="starttag">schema</tag> element). The
5918 * convention for schema ids is to use a dotted name, similar in
5919 * style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
5920 * if the settings are for a specific service that owns a D-Bus bus name,
5921 * the D-Bus bus name and schema id should match. For schemas which deal
5922 * with settings not associated with one named application, the id should
5923 * not use StudlyCaps, e.g. "org.gnome.font-rendering".
5925 * In addition to #GVariant types, keys can have types that have enumerated
5926 * types. These can be described by a <tag class="starttag">choice</tag>,
5927 * <tag class="starttag">enum</tag> or <tag class="starttag">flags</tag> element, see
5928 * <xref linkend="schema-enumerated"/>. The underlying type of
5929 * such a key is string, but you can use g_settings_get_enum(),
5930 * g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags()
5931 * access the numeric values corresponding to the string value of enum
5934 * <example id="schema-default-values"><title>Default values</title>
5935 * <programlisting><![CDATA[
5937 * <schema id="org.gtk.Test" path="/org/gtk/Test/" gettext-domain="test">
5939 * <key name="greeting" type="s">
5940 * <default l10n="messages">"Hello, earthlings"</default>
5941 * <summary>A greeting</summary>
5943 * Greeting of the invading martians
5947 * <key name="box" type="(ii)">
5948 * <default>(20,30)</default>
5953 * ]]></programlisting></example>
5955 * <example id="schema-enumerated"><title>Ranges, choices and enumerated types</title>
5956 * <programlisting><![CDATA[
5959 * <enum id="org.gtk.Test.myenum">
5960 * <value nick="first" value="1"/>
5961 * <value nick="second" value="2"/>
5964 * <flags id="org.gtk.Test.myflags">
5965 * <value nick="flag1" value="1"/>
5966 * <value nick="flag2" value="2"/>
5967 * <value nick="flag3" value="4"/>
5970 * <schema id="org.gtk.Test">
5972 * <key name="key-with-range" type="i">
5973 * <range min="1" max="100"/>
5974 * <default>10</default>
5977 * <key name="key-with-choices" type="s">
5979 * <choice value='Elisabeth'/>
5980 * <choice value='Annabeth'/>
5981 * <choice value='Joe'/>
5984 * <alias value='Anna' target='Annabeth'/>
5985 * <alias value='Beth' target='Elisabeth'/>
5987 * <default>'Joe'</default>
5990 * <key name='enumerated-key' enum='org.gtk.Test.myenum'>
5991 * <default>'first'</default>
5994 * <key name='flags-key' flags='org.gtk.Test.myflags'>
5995 * <default>["flag1",flag2"]</default>
5999 * ]]></programlisting></example>
6002 * <title>Vendor overrides</title>
6004 * Default values are defined in the schemas that get installed by
6005 * an application. Sometimes, it is necessary for a vendor or distributor
6006 * to adjust these defaults. Since patching the XML source for the schema
6007 * is inconvenient and error-prone,
6008 * <link linkend="glib-compile-schemas">glib-compile-schemas</link> reads
6009 * so-called 'vendor override' files. These are keyfiles in the same
6010 * directory as the XML schema sources which can override default values.
6011 * The schema id serves as the group name in the key file, and the values
6012 * are expected in serialized GVariant form, as in the following example:
6013 * <informalexample><programlisting>
6017 * </programlisting></informalexample>
6020 * glib-compile-schemas expects schema files to have the extension
6021 * <filename>.gschema.override</filename>
6026 * <title>Binding</title>
6028 * A very convenient feature of GSettings lets you bind #GObject properties
6029 * directly to settings, using g_settings_bind(). Once a GObject property
6030 * has been bound to a setting, changes on either side are automatically
6031 * propagated to the other side. GSettings handles details like
6032 * mapping between GObject and GVariant types, and preventing infinite
6036 * This makes it very easy to hook up a preferences dialog to the
6037 * underlying settings. To make this even more convenient, GSettings
6038 * looks for a boolean property with the name "sensitivity" and
6039 * automatically binds it to the writability of the bound setting.
6040 * If this 'magic' gets in the way, it can be suppressed with the
6041 * #G_SETTINGS_BIND_NO_SENSITIVITY flag.
6048 * SECTION:gsettingsbackend
6049 * @title: GSettingsBackend
6050 * @short_description: Interface for settings backend implementations
6051 * @include: gio/gsettingsbackend.h
6052 * @see_also: #GSettings, #GIOExtensionPoint
6054 * The #GSettingsBackend interface defines a generic interface for
6055 * non-strictly-typed data that is stored in a hierarchy. To implement
6056 * an alternative storage backend for #GSettings, you need to implement
6057 * the #GSettingsBackend interface and then make it implement the
6058 * extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.
6060 * The interface defines methods for reading and writing values, a
6061 * method for determining if writing of certain values will fail
6062 * (lockdown) and a change notification mechanism.
6064 * The semantics of the interface are very precisely defined and
6065 * implementations must carefully adhere to the expectations of
6066 * callers that are documented on each of the interface methods.
6068 * Some of the GSettingsBackend functions accept or return a #GTree.
6069 * These trees always have strings as keys and #GVariant as values.
6070 * g_settings_backend_create_tree() is a convenience function to create
6074 * The #GSettingsBackend API is exported to allow third-party
6075 * implementations, but does not carry the same stability guarantees
6076 * as the public GIO API. For this reason, you have to define the
6077 * C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including
6078 * <filename>gio/gsettingsbackend.h</filename>
6084 * SECTION:gsettingsschema
6085 * @short_description: introspecting and controlling the loading of GSettings schemas
6087 * The #GSettingsSchemaSource and #GSettingsSchema APIs provide a
6088 * mechanism for advanced control over the loading of schemas and a
6089 * mechanism for introspecting their content.
6091 * Plugin loading systems that wish to provide plugins a way to access
6092 * settings face the problem of how to make the schemas for these
6093 * settings visible to GSettings. Typically, a plugin will want to ship
6094 * the schema along with itself and it won't be installed into the
6095 * standard system directories for schemas.
6097 * #GSettingsSchemaSource provides a mechanism for dealing with this by
6098 * allowing the creation of a new 'schema source' from which schemas can
6099 * be acquired. This schema source can then become part of the metadata
6100 * associated with the plugin and queried whenever the plugin requires
6101 * access to some settings.
6103 * Consider the following example:
6109 * GSettingsSchemaSource *schema_source;
6114 * initialise_plugin (const gchar *dir)
6120 * plugin->schema_source =
6121 * g_settings_new_schema_source_from_directory (dir,
6122 * g_settings_schema_source_get_default (), FALSE, NULL);
6132 * plugin_get_settings (Plugin *plugin,
6133 * const gchar *schema_id)
6135 * GSettingsSchema *schema;
6137 * if (schema_id == NULL)
6138 * schema_id = plugin->identifier;
6140 * schema = g_settings_schema_source_lookup (plugin->schema_source,
6141 * schema_id, FALSE);
6143 * if (schema == NULL)
6145 * ... disable the plugin or abort, etc ...
6148 * return g_settings_new_full (schema, NULL, NULL);
6152 * The code above shows how hooks should be added to the code that
6153 * initialises (or enables) the plugin to create the schema source and
6154 * how an API can be added to the plugin system to provide a convenient
6155 * way for the plugin to access its settings, using the schemas that it
6158 * From the standpoint of the plugin, it would need to ensure that it
6159 * ships a gschemas.compiled file as part of itself, and then simply do
6164 * GSettings *settings;
6167 * settings = plugin_get_settings (self, NULL);
6168 * some_value = g_settings_get_int (settings, "some-value");
6173 * It's also possible that the plugin system expects the schema source
6174 * files (ie: .gschema.xml files) instead of a gschemas.compiled file.
6175 * In that case, the plugin loading system must compile the schemas for
6176 * itself before attempting to create the settings source.
6183 * SECTION:gsimpleaction
6184 * @title: GSimpleAction
6185 * @short_description: A simple GAction implementation
6187 * A #GSimpleAction is the obvious simple implementation of the #GAction
6188 * interface. This is the easiest way to create an action for purposes of
6189 * adding it to a #GSimpleActionGroup.
6191 * See also #GtkAction.
6196 * SECTION:gsimpleactiongroup
6197 * @title: GSimpleActionGroup
6198 * @short_description: A simple GActionGroup implementation
6200 * #GSimpleActionGroup is a hash table filled with #GAction objects,
6201 * implementing the #GActionGroup and #GActionMap interfaces.
6206 * SECTION:gsimpleasyncresult
6207 * @short_description: Simple asynchronous results implementation
6208 * @include: gio/gio.h
6209 * @see_also: #GAsyncResult
6211 * Implements #GAsyncResult for simple cases. Most of the time, this
6212 * will be all an application needs, and will be used transparently.
6213 * Because of this, #GSimpleAsyncResult is used throughout GIO for
6214 * handling asynchronous functions.
6216 * GSimpleAsyncResult handles #GAsyncReadyCallback<!-- -->s, error
6217 * reporting, operation cancellation and the final state of an operation,
6218 * completely transparent to the application. Results can be returned
6219 * as a pointer e.g. for functions that return data that is collected
6220 * asynchronously, a boolean value for checking the success or failure
6221 * of an operation, or a #gssize for operations which return the number
6222 * of bytes modified by the operation; all of the simple return cases
6225 * Most of the time, an application will not need to know of the details
6226 * of this API; it is handled transparently, and any necessary operations
6227 * are handled by #GAsyncResult's interface. However, if implementing a
6228 * new GIO module, for writing language bindings, or for complex
6229 * applications that need better control of how asynchronous operations
6230 * are completed, it is important to understand this functionality.
6232 * GSimpleAsyncResults are tagged with the calling function to ensure
6233 * that asynchronous functions and their finishing functions are used
6234 * together correctly.
6236 * To create a new #GSimpleAsyncResult, call g_simple_async_result_new().
6237 * If the result needs to be created for a #GError, use
6238 * g_simple_async_result_new_from_error() or
6239 * g_simple_async_result_new_take_error(). If a #GError is not available
6240 * (e.g. the asynchronous operation's doesn't take a #GError argument),
6241 * but the result still needs to be created for an error condition, use
6242 * g_simple_async_result_new_error() (or g_simple_async_result_set_error_va()
6243 * if your application or binding requires passing a variable argument list
6244 * directly), and the error can then be propagated through the use of
6245 * g_simple_async_result_propagate_error().
6247 * An asynchronous operation can be made to ignore a cancellation event by
6248 * calling g_simple_async_result_set_handle_cancellation() with a
6249 * #GSimpleAsyncResult for the operation and %FALSE. This is useful for
6250 * operations that are dangerous to cancel, such as close (which would
6251 * cause a leak if cancelled before being run).
6253 * GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
6254 * or it can use #GThread<!-- -->s.
6255 * g_simple_async_result_complete() will finish an I/O task directly
6256 * from the point where it is called. g_simple_async_result_complete_in_idle()
6257 * will finish it from an idle handler in the <link
6258 * linkend="g-main-context-push-thread-default">thread-default main
6259 * context</link>. g_simple_async_result_run_in_thread() will run the
6260 * job in a separate thread and then deliver the result to the
6261 * thread-default main context.
6263 * To set the results of an asynchronous function,
6264 * g_simple_async_result_set_op_res_gpointer(),
6265 * g_simple_async_result_set_op_res_gboolean(), and
6266 * g_simple_async_result_set_op_res_gssize()
6267 * are provided, setting the operation's result to a gpointer, gboolean, or
6268 * gssize, respectively.
6270 * Likewise, to get the result of an asynchronous function,
6271 * g_simple_async_result_get_op_res_gpointer(),
6272 * g_simple_async_result_get_op_res_gboolean(), and
6273 * g_simple_async_result_get_op_res_gssize() are
6274 * provided, getting the operation's result as a gpointer, gboolean, and
6275 * gssize, respectively.
6277 * For the details of the requirements implementations must respect, see
6278 * #GAsyncResult. A typical implementation of an asynchronous operation
6279 * using GSimpleAsyncResult looks something like this:
6283 * baked_cb (Cake *cake,
6284 * gpointer user_data)
6286 * /* In this example, this callback is not given a reference to the cake, so
6287 * * the GSimpleAsyncResult has to take a reference to it.
6289 * GSimpleAsyncResult *result = user_data;
6292 * g_simple_async_result_set_error (result,
6294 * BAKER_ERROR_NO_FLOUR,
6295 * "Go to the supermarket");
6297 * g_simple_async_result_set_op_res_gpointer (result,
6298 * g_object_ref (cake),
6302 * /* In this example, we assume that baked_cb is called as a callback from
6303 * * the mainloop, so it's safe to complete the operation synchronously here.
6304 * * If, however, _baker_prepare_cake () might call its callback without
6305 * * first returning to the mainloop — inadvisable, but some APIs do so —
6306 * * we would need to use g_simple_async_result_complete_in_idle().
6308 * g_simple_async_result_complete (result);
6309 * g_object_unref (result);
6313 * baker_bake_cake_async (Baker *self,
6315 * GAsyncReadyCallback callback,
6316 * gpointer user_data)
6318 * GSimpleAsyncResult *simple;
6323 * g_simple_async_report_error_in_idle (G_OBJECT (self),
6327 * BAKER_ERROR_TOO_SMALL,
6328 * "%ucm radius cakes are silly",
6333 * simple = g_simple_async_result_new (G_OBJECT (self),
6336 * baker_bake_cake_async);
6337 * cake = _baker_get_cached_cake (self, radius);
6341 * g_simple_async_result_set_op_res_gpointer (simple,
6342 * g_object_ref (cake),
6344 * g_simple_async_result_complete_in_idle (simple);
6345 * g_object_unref (simple);
6346 * /* Drop the reference returned by _baker_get_cached_cake(); the
6347 * * GSimpleAsyncResult has taken its own reference.
6349 * g_object_unref (cake);
6353 * _baker_prepare_cake (self, radius, baked_cb, simple);
6357 * baker_bake_cake_finish (Baker *self,
6358 * GAsyncResult *result,
6361 * GSimpleAsyncResult *simple;
6364 * g_return_val_if_fail (g_simple_async_result_is_valid (result,
6366 * baker_bake_cake_async),
6369 * simple = (GSimpleAsyncResult *) result;
6371 * if (g_simple_async_result_propagate_error (simple, error))
6374 * cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
6375 * return g_object_ref (cake);
6382 * SECTION:gsimplepermission
6383 * @title: GSimplePermission
6384 * @short_description: A GPermission that doesn't change value
6386 * #GSimplePermission is a trivial implementation of #GPermission that
6387 * represents a permission that is either always or never allowed. The
6388 * value is given at construction and doesn't change.
6390 * Calling request or release will result in errors.
6396 * @short_description: Low-level socket object
6397 * @include: gio/gio.h
6398 * @see_also: #GInitable
6400 * A #GSocket is a low-level networking primitive. It is a more or less
6401 * direct mapping of the BSD socket API in a portable GObject based API.
6402 * It supports both the UNIX socket implementations and winsock2 on Windows.
6404 * #GSocket is the platform independent base upon which the higher level
6405 * network primitives are based. Applications are not typically meant to
6406 * use it directly, but rather through classes like #GSocketClient,
6407 * #GSocketService and #GSocketConnection. However there may be cases where
6408 * direct use of #GSocket is useful.
6410 * #GSocket implements the #GInitable interface, so if it is manually constructed
6411 * by e.g. g_object_new() you must call g_initable_init() and check the
6412 * results before using the object. This is done automatically in
6413 * g_socket_new() and g_socket_new_from_fd(), so these functions can return
6416 * Sockets operate in two general modes, blocking or non-blocking. When
6417 * in blocking mode all operations block until the requested operation
6418 * is finished or there is an error. In non-blocking mode all calls that
6419 * would block return immediately with a %G_IO_ERROR_WOULD_BLOCK error.
6420 * To know when a call would successfully run you can call g_socket_condition_check(),
6421 * or g_socket_condition_wait(). You can also use g_socket_create_source() and
6422 * attach it to a #GMainContext to get callbacks when I/O is possible.
6423 * Note that all sockets are always set to non blocking mode in the system, and
6424 * blocking mode is emulated in GSocket.
6426 * When working in non-blocking mode applications should always be able to
6427 * handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other
6428 * function said that I/O was possible. This can easily happen in case
6429 * of a race condition in the application, but it can also happen for other
6430 * reasons. For instance, on Windows a socket is always seen as writable
6431 * until a write returns %G_IO_ERROR_WOULD_BLOCK.
6433 * #GSocket<!-- -->s can be either connection oriented or datagram based.
6434 * For connection oriented types you must first establish a connection by
6435 * either connecting to an address or accepting a connection from another
6436 * address. For connectionless socket types the target/source address is
6437 * specified or received in each I/O operation.
6439 * All socket file descriptors are set to be close-on-exec.
6441 * Note that creating a #GSocket causes the signal %SIGPIPE to be
6442 * ignored for the remainder of the program. If you are writing a
6443 * command-line utility that uses #GSocket, you may need to take into
6444 * account the fact that your program will not automatically be killed
6445 * if it tries to write to %stdout after it has been closed.
6452 * SECTION:gsocketaddress
6453 * @short_description: Abstract base class representing endpoints for socket communication
6455 * #GSocketAddress is the equivalent of <type>struct sockaddr</type>
6456 * in the BSD sockets API. This is an abstract class; use
6457 * #GInetSocketAddress for internet sockets, or #GUnixSocketAddress
6458 * for UNIX domain sockets.
6463 * SECTION:gsocketclient
6464 * @short_description: Helper for connecting to a network service
6465 * @include: gio/gio.h
6466 * @see_also: #GSocketConnection, #GSocketListener
6468 * #GSocketClient is a lightweight high-level utility class for connecting to
6469 * a network host using a connection oriented socket type.
6471 * You create a #GSocketClient object, set any options you want, and then
6472 * call a sync or async connect operation, which returns a #GSocketConnection
6473 * subclass on success.
6475 * The type of the #GSocketConnection object returned depends on the type of
6476 * the underlying socket that is in use. For instance, for a TCP/IP connection
6477 * it will be a #GTcpConnection.
6479 * As #GSocketClient is a lightweight object, you don't need to cache it. You
6480 * can just create a new one any time you need one.
6487 * SECTION:gsocketconnectable
6488 * @short_description: Interface for potential socket endpoints
6490 * Objects that describe one or more potential socket endpoints
6491 * implement #GSocketConnectable. Callers can then use
6492 * g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator
6493 * to try out each socket address in turn until one succeeds, as shown
6494 * in the sample code below.
6497 * MyConnectionType *
6498 * connect_to_host (const char *hostname,
6500 * GCancellable *cancellable,
6503 * MyConnection *conn = NULL;
6504 * GSocketConnectable *addr;
6505 * GSocketAddressEnumerator *enumerator;
6506 * GSocketAddress *sockaddr;
6507 * GError *conn_error = NULL;
6509 * addr = g_network_address_new ("www.gnome.org", 80);
6510 * enumerator = g_socket_connectable_enumerate (addr);
6511 * g_object_unref (addr);
6513 * /<!-- -->* Try each sockaddr until we succeed. Record the first
6514 * * connection error, but not any further ones (since they'll probably
6515 * * be basically the same as the first).
6517 * while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error))
6519 * conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error);
6520 * g_object_unref (sockaddr);
6522 * g_object_unref (enumerator);
6528 * /<!-- -->* We couldn't connect to the first address, but we succeeded
6529 * * in connecting to a later address.
6531 * g_error_free (conn_error);
6537 * /<!-- -->* Either the initial lookup failed, or else the caller
6541 * g_error_free (conn_error);
6546 * g_error_propagate (error, conn_error);
6555 * SECTION:gsocketconnection
6556 * @short_description: A socket connection
6557 * @include: gio/gio.h
6558 * @see_also: #GIOStream, #GSocketClient, #GSocketListener
6560 * #GSocketConnection is a #GIOStream for a connected socket. They
6561 * can be created either by #GSocketClient when connecting to a host,
6562 * or by #GSocketListener when accepting a new client.
6564 * The type of the #GSocketConnection object returned from these calls
6565 * depends on the type of the underlying socket that is in use. For
6566 * instance, for a TCP/IP connection it will be a #GTcpConnection.
6568 * Choosing what type of object to construct is done with the socket
6569 * connection factory, and it is possible for 3rd parties to register
6570 * custom socket connection types for specific combination of socket
6571 * family/type/protocol using g_socket_connection_factory_register_type().
6578 * SECTION:gsocketcontrolmessage
6579 * @title: GSocketControlMessage
6580 * @short_description: A GSocket control message
6581 * @see_also: #GSocket.
6583 * A #GSocketControlMessage is a special-purpose utility message that
6584 * can be sent to or received from a #GSocket. These types of
6585 * messages are often called "ancillary data".
6587 * The message can represent some sort of special instruction to or
6588 * information from the socket or can represent a special kind of
6589 * transfer to the peer (for example, sending a file description over
6592 * These messages are sent with g_socket_send_message() and received
6593 * with g_socket_receive_message().
6595 * To extend the set of control message that can be sent, subclass this
6596 * class and override the get_size, get_level, get_type and serialize
6599 * To extend the set of control messages that can be received, subclass
6600 * this class and implement the deserialize method. Also, make sure your
6601 * class is registered with the GType typesystem before calling
6602 * g_socket_receive_message() to read such a message.
6609 * SECTION:gsocketlistener
6610 * @title: GSocketListener
6611 * @short_description: Helper for accepting network client connections
6612 * @see_also: #GThreadedSocketService, #GSocketService.
6614 * A #GSocketListener is an object that keeps track of a set
6615 * of server sockets and helps you accept sockets from any of the
6616 * socket, either sync or async.
6618 * If you want to implement a network server, also look at #GSocketService
6619 * and #GThreadedSocketService which are subclass of #GSocketListener
6620 * that makes this even easier.
6627 * SECTION:gsocketservice
6628 * @title: GSocketService
6629 * @short_description: Make it easy to implement a network service
6630 * @see_also: #GThreadedSocketService, #GSocketListener.
6632 * A #GSocketService is an object that represents a service that
6633 * is provided to the network or over local sockets. When a new
6634 * connection is made to the service the #GSocketService::incoming
6635 * signal is emitted.
6637 * A #GSocketService is a subclass of #GSocketListener and you need
6638 * to add the addresses you want to accept connections on with the
6639 * #GSocketListener APIs.
6641 * There are two options for implementing a network service based on
6642 * #GSocketService. The first is to create the service using
6643 * g_socket_service_new() and to connect to the #GSocketService::incoming
6644 * signal. The second is to subclass #GSocketService and override the
6645 * default signal handler implementation.
6647 * In either case, the handler must immediately return, or else it
6648 * will block additional incoming connections from being serviced.
6649 * If you are interested in writing connection handlers that contain
6650 * blocking code then see #GThreadedSocketService.
6652 * The socket service runs on the main loop of the <link
6653 * linkend="g-main-context-push-thread-default-context">thread-default
6654 * context</link> of the thread it is created in, and is not
6655 * threadsafe in general. However, the calls to start and stop the
6656 * service are thread-safe so these can be used from threads that
6657 * handle incoming clients.
6664 * SECTION:gsrvtarget
6665 * @short_description: DNS SRV record target
6666 * @include: gio/gio.h
6668 * SRV (service) records are used by some network protocols to provide
6669 * service-specific aliasing and load-balancing. For example, XMPP
6670 * (Jabber) uses SRV records to locate the XMPP server for a domain;
6671 * rather than connecting directly to "example.com" or assuming a
6672 * specific server hostname like "xmpp.example.com", an XMPP client
6673 * would look up the "xmpp-client" SRV record for "example.com", and
6674 * then connect to whatever host was pointed to by that record.
6676 * You can use g_resolver_lookup_service() or
6677 * g_resolver_lookup_service_async() to find the #GSrvTarget<!-- -->s
6678 * for a given service. However, if you are simply planning to connect
6679 * to the remote service, you can use #GNetworkService's
6680 * #GSocketConnectable interface and not need to worry about
6681 * #GSrvTarget at all.
6686 * SECTION:gtcpconnection
6687 * @title: GTcpConnection
6688 * @short_description: A TCP GSocketConnection
6689 * @see_also: #GSocketConnection.
6691 * This is the subclass of #GSocketConnection that is created
6692 * for TCP/IP sockets.
6699 * SECTION:gtcpwrapperconnection
6700 * @title: GTcpWrapperConnection
6701 * @short_description: wrapper for non-GSocketConnection-based, GSocket-based GIOStreams
6702 * @see_also: #GSocketConnection.
6704 * A #GTcpWrapperConnection can be used to wrap a #GIOStream that is
6705 * based on a #GSocket, but which is not actually a
6706 * #GSocketConnection. This is used by #GSocketClient so that it can
6707 * always return a #GSocketConnection, even when the connection it has
6708 * actually created is not directly a #GSocketConnection.
6716 * @short_description: D-Bus testing helper
6717 * @include: gio/gio.h
6719 * Helper to test D-Bus code wihtout messing up with user' session bus.
6724 * SECTION:gthemedicon
6725 * @short_description: Icon theming support
6726 * @include: gio/gio.h
6727 * @see_also: #GIcon, #GLoadableIcon
6729 * #GThemedIcon is an implementation of #GIcon that supports icon themes.
6730 * #GThemedIcon contains a list of all of the icons present in an icon
6731 * theme, so that icons can be looked up quickly. #GThemedIcon does
6732 * not provide actual pixmaps for icons, just the icon names.
6733 * Ideally something like gtk_icon_theme_choose_icon() should be used to
6734 * resolve the list of names so that fallback icons work nicely with
6735 * themes that inherit other themes.
6740 * SECTION:gthreadedsocketservice
6741 * @title: GThreadedSocketService
6742 * @short_description: A threaded GSocketService
6743 * @see_also: #GSocketService.
6745 * A #GThreadedSocketService is a simple subclass of #GSocketService
6746 * that handles incoming connections by creating a worker thread and
6747 * dispatching the connection to it by emitting the
6748 * #GThreadedSocketService::run signal in the new thread.
6750 * The signal handler may perform blocking IO and need not return
6751 * until the connection is closed.
6753 * The service is implemented using a thread pool, so there is a
6754 * limited amount of threads available to serve incoming requests.
6755 * The service automatically stops the #GSocketService from accepting
6756 * new connections when all threads are busy.
6758 * As with #GSocketService, you may connect to #GThreadedSocketService::run,
6759 * or subclass and override the default handler.
6765 * @title: TLS Overview
6766 * @short_description: TLS (aka SSL) support for GSocketConnection
6767 * @include: gio/gio.h
6769 * #GTlsConnection and related classes provide TLS (Transport Layer
6770 * Security, previously known as SSL, Secure Sockets Layer) support for
6771 * gio-based network streams.
6773 * In the simplest case, for a client connection, you can just set the
6774 * #GSocketClient:tls flag on a #GSocketClient, and then any
6775 * connections created by that client will have TLS negotiated
6776 * automatically, using appropriate default settings, and rejecting
6777 * any invalid or self-signed certificates (unless you change that
6778 * default by setting the #GSocketClient:tls-validation-flags
6779 * property). The returned object will be a #GTcpWrapperConnection,
6780 * which wraps the underlying #GTlsClientConnection.
6782 * For greater control, you can create your own #GTlsClientConnection,
6783 * wrapping a #GSocketConnection (or an arbitrary #GIOStream with
6784 * pollable input and output streams) and then connect to its signals,
6785 * such as #GTlsConnection::accept-certificate, before starting the
6788 * Server-side TLS is similar, using #GTlsServerConnection. At the
6789 * moment, there is no support for automatically wrapping server-side
6790 * connections in the way #GSocketClient does for client-side
6796 * SECTION:gtlsbackend
6797 * @title: GTlsBackend
6798 * @short_description: TLS backend implementation
6799 * @include: gio/gio.h
6806 * SECTION:gtlscertificate
6807 * @title: GTlsCertificate
6808 * @short_description: TLS certificate
6809 * @see_also: #GTlsConnection
6811 * A certificate used for TLS authentication and encryption.
6812 * This can represent either a certificate only (eg, the certificate
6813 * received by a client from a server), or the combination of
6814 * a certificate and a private key (which is needed when acting as a
6815 * #GTlsServerConnection).
6822 * SECTION:gtlsclientconnection
6823 * @short_description: TLS client-side connection
6824 * @include: gio/gio.h
6826 * #GTlsClientConnection is the client-side subclass of
6827 * #GTlsConnection, representing a client-side TLS connection.
6832 * SECTION:gtlsconnection
6833 * @short_description: TLS connection type
6834 * @include: gio/gio.h
6836 * #GTlsConnection is the base TLS connection class type, which wraps
6837 * a #GIOStream and provides TLS encryption on top of it. Its
6838 * subclasses, #GTlsClientConnection and #GTlsServerConnection,
6839 * implement client-side and server-side TLS, respectively.
6846 * SECTION:gtlsdatabase
6847 * @short_description: TLS database type
6848 * @include: gio/gio.h
6850 * #GTlsDatabase is used to lookup certificates and other information
6851 * from a certificate or key store. It is an abstract base class which
6852 * TLS library specific subtypes override.
6854 * Most common client applications will not directly interact with
6855 * #GTlsDatabase. It is used internally by #GTlsConnection.
6862 * SECTION:gtlsfiledatabase
6863 * @short_description: TLS file based database type
6864 * @include: gio/gio.h
6866 * #GTlsFileDatabase is implemented by #GTlsDatabase objects which load
6867 * their certificate information from a file. It is in interface which
6868 * TLS library specific subtypes implement.
6875 * SECTION:gtlsinteraction
6876 * @short_description: Interaction with the user during TLS operations.
6877 * @include: gio/gio.h
6879 * #GTlsInteraction provides a mechanism for the TLS connection and database
6880 * code to interact with the user. It can be used to ask the user for passwords.
6882 * To use a #GTlsInteraction with a TLS connection use
6883 * g_tls_connection_set_interaction().
6885 * Callers should instantiate a derived class that implements the various
6886 * interaction methods to show the required dialogs.
6888 * Callers should use the 'invoke' functions like
6889 * g_tls_interaction_invoke_ask_password() to run interaction methods. These
6890 * functions make sure that the interaction is invoked in the main loop
6891 * and not in the current thread, if the current thread is not running the
6894 * Derived classes can choose to implement whichever interactions methods they'd
6895 * like to support by overriding those virtual methods in their class
6896 * initialization function. Any interactions not implemented will return
6897 * %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
6898 * it must also implement the corresponding finish method.
6903 * SECTION:gtlspassword
6904 * @title: GTlsPassword
6905 * @short_description: TLS Passwords for prompting
6906 * @include: gio/gio.h
6908 * Holds a password used in TLS.
6913 * SECTION:gtlsserverconnection
6914 * @short_description: TLS server-side connection
6915 * @include: gio/gio.h
6917 * #GTlsServerConnection is the server-side subclass of #GTlsConnection,
6918 * representing a server-side TLS connection.
6925 * SECTION:gunixconnection
6926 * @title: GUnixConnection
6927 * @short_description: A UNIX domain GSocketConnection
6928 * @include: gio/gunixconnection.h
6929 * @see_also: #GSocketConnection.
6931 * This is the subclass of #GSocketConnection that is created
6932 * for UNIX domain sockets.
6934 * It contains functions to do some of the UNIX socket specific
6935 * functionality like passing file descriptors.
6937 * Note that <filename><gio/gunixconnection.h></filename> belongs to
6938 * the UNIX-specific GIO interfaces, thus you have to use the
6939 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6946 * SECTION:gunixcredentialsmessage
6947 * @title: GUnixCredentialsMessage
6948 * @short_description: A GSocketControlMessage containing credentials
6949 * @include: gio/gunixcredentialsmessage.h
6950 * @see_also: #GUnixConnection, #GSocketControlMessage
6952 * This #GSocketControlMessage contains a #GCredentials instance. It
6953 * may be sent using g_socket_send_message() and received using
6954 * g_socket_receive_message() over UNIX sockets (ie: sockets in the
6955 * %G_SOCKET_FAMILY_UNIX family).
6957 * For an easier way to send and receive credentials over
6958 * stream-oriented UNIX sockets, see
6959 * g_unix_connection_send_credentials() and
6960 * g_unix_connection_receive_credentials(). To receive credentials of
6961 * a foreign process connected to a socket, use
6962 * g_socket_get_credentials().
6967 * SECTION:gunixfdlist
6968 * @title: GUnixFDList
6969 * @short_description: An object containing a set of UNIX file descriptors
6970 * @include: gio/gunixfdlist.h
6971 * @see_also: #GUnixFDMessage
6973 * A #GUnixFDList contains a list of file descriptors. It owns the file
6974 * descriptors that it contains, closing them when finalized.
6976 * It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
6977 * the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
6978 * and received using g_socket_receive_message().
6980 * Note that <filename><gio/gunixfdlist.h></filename> belongs to
6981 * the UNIX-specific GIO interfaces, thus you have to use the
6982 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6987 * SECTION:gunixfdmessage
6988 * @title: GUnixFDMessage
6989 * @short_description: A GSocketControlMessage containing a GUnixFDList
6990 * @include: gio/gunixfdmessage.h
6991 * @see_also: #GUnixConnection, #GUnixFDList, #GSocketControlMessage
6993 * This #GSocketControlMessage contains a #GUnixFDList.
6994 * It may be sent using g_socket_send_message() and received using
6995 * g_socket_receive_message() over UNIX sockets (ie: sockets in the
6996 * %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied
6997 * between processes by the kernel.
6999 * For an easier way to send and receive file descriptors over
7000 * stream-oriented UNIX sockets, see g_unix_connection_send_fd() and
7001 * g_unix_connection_receive_fd().
7003 * Note that <filename><gio/gunixfdmessage.h></filename> belongs to
7004 * the UNIX-specific GIO interfaces, thus you have to use the
7005 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7010 * SECTION:gunixinputstream
7011 * @short_description: Streaming input operations for UNIX file descriptors
7012 * @include: gio/gunixinputstream.h
7013 * @see_also: #GInputStream
7015 * #GUnixInputStream implements #GInputStream for reading from a UNIX
7016 * file descriptor, including asynchronous operations. (If the file
7017 * descriptor refers to a socket or pipe, this will use poll() to do
7018 * asynchronous I/O. If it refers to a regular file, it will fall back
7019 * to doing asynchronous I/O in another thread.)
7021 * Note that <filename><gio/gunixinputstream.h></filename> belongs
7022 * to the UNIX-specific GIO interfaces, thus you have to use the
7023 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7028 * SECTION:gunixmounts
7029 * @include: gio/gunixmounts.h
7030 * @short_description: UNIX mounts
7032 * Routines for managing mounted UNIX mount points and paths.
7034 * Note that <filename><gio/gunixmounts.h></filename> belongs to the
7035 * UNIX-specific GIO interfaces, thus you have to use the
7036 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7041 * SECTION:gunixoutputstream
7042 * @short_description: Streaming output operations for UNIX file descriptors
7043 * @include: gio/gunixoutputstream.h
7044 * @see_also: #GOutputStream
7046 * #GUnixOutputStream implements #GOutputStream for writing to a UNIX
7047 * file descriptor, including asynchronous operations. (If the file
7048 * descriptor refers to a socket or pipe, this will use poll() to do
7049 * asynchronous I/O. If it refers to a regular file, it will fall back
7050 * to doing asynchronous I/O in another thread.)
7052 * Note that <filename><gio/gunixoutputstream.h></filename> belongs
7053 * to the UNIX-specific GIO interfaces, thus you have to use the
7054 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7059 * SECTION:gunixsocketaddress
7060 * @short_description: UNIX GSocketAddress
7061 * @include: gio/gunixsocketaddress.h
7063 * Support for UNIX-domain (also known as local) sockets.
7065 * UNIX domain sockets are generally visible in the filesystem.
7066 * However, some systems support abstract socket names which are not
7067 * visible in the filesystem and not affected by the filesystem
7068 * permissions, visibility, etc. Currently this is only supported
7069 * under Linux. If you attempt to use abstract sockets on other
7070 * systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED
7071 * errors. You can use g_unix_socket_address_abstract_names_supported()
7072 * to see if abstract names are supported.
7074 * Note that <filename><gio/gunixsocketaddress.h></filename> belongs to
7075 * the UNIX-specific GIO interfaces, thus you have to use the
7076 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7082 * @short_description: Virtual File System
7083 * @include: gio/gio.h
7085 * Entry point for using GIO functionality.
7091 * @short_description: Volume management
7092 * @include: gio/gio.h
7094 * The #GVolume interface represents user-visible objects that can be
7095 * mounted. Note, when porting from GnomeVFS, #GVolume is the moral
7096 * equivalent of #GnomeVFSDrive.
7098 * Mounting a #GVolume instance is an asynchronous operation. For more
7099 * information about asynchronous operations, see #GAsyncResult and
7100 * #GSimpleAsyncResult. To mount a #GVolume, first call
7101 * g_volume_mount() with (at least) the #GVolume instance, optionally
7102 * a #GMountOperation object and a #GAsyncReadyCallback.
7104 * Typically, one will only want to pass %NULL for the
7105 * #GMountOperation if automounting all volumes when a desktop session
7106 * starts since it's not desirable to put up a lot of dialogs asking
7109 * The callback will be fired when the operation has resolved (either
7110 * with success or failure), and a #GAsyncReady structure will be
7111 * passed to the callback. That callback should then call
7112 * g_volume_mount_finish() with the #GVolume instance and the
7113 * #GAsyncReady data to see if the operation was completed
7114 * successfully. If an @error is present when g_volume_mount_finish()
7115 * is called, then it will be filled with any error information.
7117 * <para id="volume-identifier">
7118 * It is sometimes necessary to directly access the underlying
7119 * operating system object behind a volume (e.g. for passing a volume
7120 * to an application via the commandline). For this purpose, GIO
7121 * allows to obtain an 'identifier' for the volume. There can be
7122 * different kinds of identifiers, such as Hal UDIs, filesystem labels,
7123 * traditional Unix devices (e.g. <filename>/dev/sda2</filename>),
7124 * uuids. GIO uses predefind strings as names for the different kinds
7125 * of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
7126 * #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
7127 * to obtain an identifier for a volume.
7130 * Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
7131 * when the gvfs hal volume monitor is in use. Other volume monitors
7132 * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
7133 * identifier, which can be used to obtain a hal device by means of
7134 * libhal_manager_find_device_string_match().
7139 * SECTION:gvolumemonitor
7140 * @short_description: Volume Monitor
7141 * @include: gio/gio.h
7142 * @see_also: #GFileMonitor
7144 * #GVolumeMonitor is for listing the user interesting devices and volumes
7145 * on the computer. In other words, what a file selector or file manager
7146 * would show in a sidebar.
7148 * #GVolumeMonitor is not <link
7149 * linkend="g-main-context-push-thread-default">thread-default-context
7150 * aware</link>, and so should not be used other than from the main
7151 * thread, with no thread-default-context active.
7156 * SECTION:gwin32inputstream
7157 * @short_description: Streaming input operations for Windows file handles
7158 * @include: gio/gwin32inputstream.h
7159 * @see_also: #GInputStream
7161 * #GWin32InputStream implements #GInputStream for reading from a
7162 * Windows file handle.
7164 * Note that <filename><gio/gwin32inputstream.h></filename> belongs
7165 * to the Windows-specific GIO interfaces, thus you have to use the
7166 * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7171 * SECTION:gwin32outputstream
7172 * @short_description: Streaming output operations for Windows file handles
7173 * @include: gio/gwin32outputstream.h
7174 * @see_also: #GOutputStream
7176 * #GWin32OutputStream implements #GOutputStream for writing to a
7177 * Windows file handle.
7179 * Note that <filename><gio/gwin32outputstream.h></filename> belongs
7180 * to the Windows-specific GIO interfaces, thus you have to use the
7181 * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7186 * SECTION:gzcompressor
7187 * @short_description: Zlib compressor
7188 * @include: gio/gio.h
7190 * #GZlibCompressor is an implementation of #GConverter that
7191 * compresses data using zlib.
7196 * SECTION:gzdecompressor
7197 * @short_description: Zlib decompressor
7198 * @include: gio/gio.h
7200 * #GZlibDecompressor is an implementation of #GConverter that
7201 * decompresses data compressed with zlib.
7206 * _GFreedesktopDBus:
7208 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
7213 * _GFreedesktopDBus::handle-add-match:
7214 * @object: A #_GFreedesktopDBus.
7215 * @invocation: A #GDBusMethodInvocation.
7216 * @arg_rule: Argument passed by remote caller.
7218 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method.
7220 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_add_match() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7222 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7227 * _GFreedesktopDBus::handle-get-connection-selinux-security-context:
7228 * @object: A #_GFreedesktopDBus.
7229 * @invocation: A #GDBusMethodInvocation.
7230 * @arg_name: Argument passed by remote caller.
7232 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method.
7234 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_connection_selinux_security_context() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7236 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7241 * _GFreedesktopDBus::handle-get-connection-unix-process-id:
7242 * @object: A #_GFreedesktopDBus.
7243 * @invocation: A #GDBusMethodInvocation.
7244 * @arg_name: Argument passed by remote caller.
7246 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method.
7248 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_connection_unix_process_id() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7250 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7255 * _GFreedesktopDBus::handle-get-connection-unix-user:
7256 * @object: A #_GFreedesktopDBus.
7257 * @invocation: A #GDBusMethodInvocation.
7258 * @arg_name: Argument passed by remote caller.
7260 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method.
7262 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_connection_unix_user() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7264 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7269 * _GFreedesktopDBus::handle-get-id:
7270 * @object: A #_GFreedesktopDBus.
7271 * @invocation: A #GDBusMethodInvocation.
7273 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method.
7275 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_id() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7277 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7282 * _GFreedesktopDBus::handle-get-name-owner:
7283 * @object: A #_GFreedesktopDBus.
7284 * @invocation: A #GDBusMethodInvocation.
7285 * @arg_name: Argument passed by remote caller.
7287 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method.
7289 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_name_owner() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7291 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7296 * _GFreedesktopDBus::handle-hello:
7297 * @object: A #_GFreedesktopDBus.
7298 * @invocation: A #GDBusMethodInvocation.
7300 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method.
7302 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_hello() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7304 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7309 * _GFreedesktopDBus::handle-list-activatable-names:
7310 * @object: A #_GFreedesktopDBus.
7311 * @invocation: A #GDBusMethodInvocation.
7313 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method.
7315 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_list_activatable_names() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7317 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7322 * _GFreedesktopDBus::handle-list-names:
7323 * @object: A #_GFreedesktopDBus.
7324 * @invocation: A #GDBusMethodInvocation.
7326 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method.
7328 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_list_names() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7330 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7335 * _GFreedesktopDBus::handle-list-queued-owners:
7336 * @object: A #_GFreedesktopDBus.
7337 * @invocation: A #GDBusMethodInvocation.
7338 * @arg_name: Argument passed by remote caller.
7340 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method.
7342 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_list_queued_owners() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7344 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7349 * _GFreedesktopDBus::handle-name-has-owner:
7350 * @object: A #_GFreedesktopDBus.
7351 * @invocation: A #GDBusMethodInvocation.
7352 * @arg_name: Argument passed by remote caller.
7354 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method.
7356 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_name_has_owner() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7358 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7363 * _GFreedesktopDBus::handle-release-name:
7364 * @object: A #_GFreedesktopDBus.
7365 * @invocation: A #GDBusMethodInvocation.
7366 * @arg_name: Argument passed by remote caller.
7368 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method.
7370 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_release_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7372 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7377 * _GFreedesktopDBus::handle-reload-config:
7378 * @object: A #_GFreedesktopDBus.
7379 * @invocation: A #GDBusMethodInvocation.
7381 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method.
7383 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_reload_config() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7385 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7390 * _GFreedesktopDBus::handle-remove-match:
7391 * @object: A #_GFreedesktopDBus.
7392 * @invocation: A #GDBusMethodInvocation.
7393 * @arg_rule: Argument passed by remote caller.
7395 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method.
7397 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_remove_match() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7399 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7404 * _GFreedesktopDBus::handle-request-name:
7405 * @object: A #_GFreedesktopDBus.
7406 * @invocation: A #GDBusMethodInvocation.
7407 * @arg_name: Argument passed by remote caller.
7408 * @arg_flags: Argument passed by remote caller.
7410 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method.
7412 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_request_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7414 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7419 * _GFreedesktopDBus::handle-start-service-by-name:
7420 * @object: A #_GFreedesktopDBus.
7421 * @invocation: A #GDBusMethodInvocation.
7422 * @arg_name: Argument passed by remote caller.
7423 * @arg_flags: Argument passed by remote caller.
7425 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method.
7427 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_start_service_by_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7429 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7434 * _GFreedesktopDBus::handle-update-activation-environment:
7435 * @object: A #_GFreedesktopDBus.
7436 * @invocation: A #GDBusMethodInvocation.
7437 * @arg_environment: Argument passed by remote caller.
7439 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method.
7441 * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_update_activation_environment() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7443 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7448 * _GFreedesktopDBus::name-acquired:
7449 * @object: A #_GFreedesktopDBus.
7450 * @arg_name: Argument.
7452 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-DBus.NameAcquired">"NameAcquired"</link> is received.
7454 * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
7459 * _GFreedesktopDBus::name-lost:
7460 * @object: A #_GFreedesktopDBus.
7461 * @arg_name: Argument.
7463 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-DBus.NameLost">"NameLost"</link> is received.
7465 * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
7470 * _GFreedesktopDBus::name-owner-changed:
7471 * @object: A #_GFreedesktopDBus.
7472 * @arg_name: Argument.
7473 * @arg_old_owner: Argument.
7474 * @arg_new_owner: Argument.
7476 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-DBus.NameOwnerChanged">"NameOwnerChanged"</link> is received.
7478 * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
7483 * _GFreedesktopDBusIface:
7484 * @parent_iface: The parent interface.
7485 * @handle_add_match: Handler for the #_GFreedesktopDBus::handle-add-match signal.
7486 * @handle_get_connection_selinux_security_context: Handler for the #_GFreedesktopDBus::handle-get-connection-selinux-security-context signal.
7487 * @handle_get_connection_unix_process_id: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-process-id signal.
7488 * @handle_get_connection_unix_user: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-user signal.
7489 * @handle_get_id: Handler for the #_GFreedesktopDBus::handle-get-id signal.
7490 * @handle_get_name_owner: Handler for the #_GFreedesktopDBus::handle-get-name-owner signal.
7491 * @handle_hello: Handler for the #_GFreedesktopDBus::handle-hello signal.
7492 * @handle_list_activatable_names: Handler for the #_GFreedesktopDBus::handle-list-activatable-names signal.
7493 * @handle_list_names: Handler for the #_GFreedesktopDBus::handle-list-names signal.
7494 * @handle_list_queued_owners: Handler for the #_GFreedesktopDBus::handle-list-queued-owners signal.
7495 * @handle_name_has_owner: Handler for the #_GFreedesktopDBus::handle-name-has-owner signal.
7496 * @handle_release_name: Handler for the #_GFreedesktopDBus::handle-release-name signal.
7497 * @handle_reload_config: Handler for the #_GFreedesktopDBus::handle-reload-config signal.
7498 * @handle_remove_match: Handler for the #_GFreedesktopDBus::handle-remove-match signal.
7499 * @handle_request_name: Handler for the #_GFreedesktopDBus::handle-request-name signal.
7500 * @handle_start_service_by_name: Handler for the #_GFreedesktopDBus::handle-start-service-by-name signal.
7501 * @handle_update_activation_environment: Handler for the #_GFreedesktopDBus::handle-update-activation-environment signal.
7502 * @name_acquired: Handler for the #_GFreedesktopDBus::name-acquired signal.
7503 * @name_lost: Handler for the #_GFreedesktopDBus::name-lost signal.
7504 * @name_owner_changed: Handler for the #_GFreedesktopDBus::name-owner-changed signal.
7506 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
7511 * _GFreedesktopDBusProxy:
7513 * The #_GFreedesktopDBusProxy structure contains only private data and should only be accessed using the provided API.
7518 * _GFreedesktopDBusProxyClass:
7519 * @parent_class: The parent class.
7521 * Class structure for #_GFreedesktopDBusProxy.
7526 * _GFreedesktopDBusSkeleton:
7528 * The #_GFreedesktopDBusSkeleton structure contains only private data and should only be accessed using the provided API.
7533 * _GFreedesktopDBusSkeletonClass:
7534 * @parent_class: The parent class.
7536 * Class structure for #_GFreedesktopDBusSkeleton.
7541 * _g_freedesktop_dbus_call_add_match:
7542 * @proxy: A #_GFreedesktopDBusProxy.
7543 * @arg_rule: Argument to pass with the method invocation.
7544 * @cancellable: (allow-none): A #GCancellable or %NULL.
7545 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7546 * @user_data: User data to pass to @callback.
7548 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method on @proxy.
7549 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7550 * You can then call _g_freedesktop_dbus_call_add_match_finish() to get the result of the operation.
7552 * See _g_freedesktop_dbus_call_add_match_sync() for the synchronous, blocking version of this method.
7557 * _g_freedesktop_dbus_call_add_match_finish:
7558 * @proxy: A #_GFreedesktopDBusProxy.
7559 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_add_match().
7560 * @error: Return location for error or %NULL.
7562 * Finishes an operation started with _g_freedesktop_dbus_call_add_match().
7564 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7569 * _g_freedesktop_dbus_call_add_match_sync:
7570 * @proxy: A #_GFreedesktopDBusProxy.
7571 * @arg_rule: Argument to pass with the method invocation.
7572 * @cancellable: (allow-none): A #GCancellable or %NULL.
7573 * @error: Return location for error or %NULL.
7575 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7577 * See _g_freedesktop_dbus_call_add_match() for the asynchronous version of this method.
7579 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7584 * _g_freedesktop_dbus_call_get_connection_selinux_security_context:
7585 * @proxy: A #_GFreedesktopDBusProxy.
7586 * @arg_name: Argument to pass with the method invocation.
7587 * @cancellable: (allow-none): A #GCancellable or %NULL.
7588 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7589 * @user_data: User data to pass to @callback.
7591 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method on @proxy.
7592 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7593 * You can then call _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish() to get the result of the operation.
7595 * See _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync() for the synchronous, blocking version of this method.
7600 * _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish:
7601 * @proxy: A #_GFreedesktopDBusProxy.
7602 * @out_security_context: (out): Return location for return parameter or %NULL to ignore.
7603 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_selinux_security_context().
7604 * @error: Return location for error or %NULL.
7606 * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_selinux_security_context().
7608 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7613 * _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync:
7614 * @proxy: A #_GFreedesktopDBusProxy.
7615 * @arg_name: Argument to pass with the method invocation.
7616 * @out_security_context: (out): Return location for return parameter or %NULL to ignore.
7617 * @cancellable: (allow-none): A #GCancellable or %NULL.
7618 * @error: Return location for error or %NULL.
7620 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7622 * See _g_freedesktop_dbus_call_get_connection_selinux_security_context() for the asynchronous version of this method.
7624 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7629 * _g_freedesktop_dbus_call_get_connection_unix_process_id:
7630 * @proxy: A #_GFreedesktopDBusProxy.
7631 * @arg_name: Argument to pass with the method invocation.
7632 * @cancellable: (allow-none): A #GCancellable or %NULL.
7633 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7634 * @user_data: User data to pass to @callback.
7636 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method on @proxy.
7637 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7638 * You can then call _g_freedesktop_dbus_call_get_connection_unix_process_id_finish() to get the result of the operation.
7640 * See _g_freedesktop_dbus_call_get_connection_unix_process_id_sync() for the synchronous, blocking version of this method.
7645 * _g_freedesktop_dbus_call_get_connection_unix_process_id_finish:
7646 * @proxy: A #_GFreedesktopDBusProxy.
7647 * @out_pid: (out): Return location for return parameter or %NULL to ignore.
7648 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_process_id().
7649 * @error: Return location for error or %NULL.
7651 * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_process_id().
7653 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7658 * _g_freedesktop_dbus_call_get_connection_unix_process_id_sync:
7659 * @proxy: A #_GFreedesktopDBusProxy.
7660 * @arg_name: Argument to pass with the method invocation.
7661 * @out_pid: (out): Return location for return parameter or %NULL to ignore.
7662 * @cancellable: (allow-none): A #GCancellable or %NULL.
7663 * @error: Return location for error or %NULL.
7665 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7667 * See _g_freedesktop_dbus_call_get_connection_unix_process_id() for the asynchronous version of this method.
7669 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7674 * _g_freedesktop_dbus_call_get_connection_unix_user:
7675 * @proxy: A #_GFreedesktopDBusProxy.
7676 * @arg_name: Argument to pass with the method invocation.
7677 * @cancellable: (allow-none): A #GCancellable or %NULL.
7678 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7679 * @user_data: User data to pass to @callback.
7681 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method on @proxy.
7682 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7683 * You can then call _g_freedesktop_dbus_call_get_connection_unix_user_finish() to get the result of the operation.
7685 * See _g_freedesktop_dbus_call_get_connection_unix_user_sync() for the synchronous, blocking version of this method.
7690 * _g_freedesktop_dbus_call_get_connection_unix_user_finish:
7691 * @proxy: A #_GFreedesktopDBusProxy.
7692 * @out_uid: (out): Return location for return parameter or %NULL to ignore.
7693 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_user().
7694 * @error: Return location for error or %NULL.
7696 * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_user().
7698 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7703 * _g_freedesktop_dbus_call_get_connection_unix_user_sync:
7704 * @proxy: A #_GFreedesktopDBusProxy.
7705 * @arg_name: Argument to pass with the method invocation.
7706 * @out_uid: (out): Return location for return parameter or %NULL to ignore.
7707 * @cancellable: (allow-none): A #GCancellable or %NULL.
7708 * @error: Return location for error or %NULL.
7710 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7712 * See _g_freedesktop_dbus_call_get_connection_unix_user() for the asynchronous version of this method.
7714 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7719 * _g_freedesktop_dbus_call_get_id:
7720 * @proxy: A #_GFreedesktopDBusProxy.
7721 * @cancellable: (allow-none): A #GCancellable or %NULL.
7722 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7723 * @user_data: User data to pass to @callback.
7725 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method on @proxy.
7726 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7727 * You can then call _g_freedesktop_dbus_call_get_id_finish() to get the result of the operation.
7729 * See _g_freedesktop_dbus_call_get_id_sync() for the synchronous, blocking version of this method.
7734 * _g_freedesktop_dbus_call_get_id_finish:
7735 * @proxy: A #_GFreedesktopDBusProxy.
7736 * @out_unique_id: (out): Return location for return parameter or %NULL to ignore.
7737 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_id().
7738 * @error: Return location for error or %NULL.
7740 * Finishes an operation started with _g_freedesktop_dbus_call_get_id().
7742 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7747 * _g_freedesktop_dbus_call_get_id_sync:
7748 * @proxy: A #_GFreedesktopDBusProxy.
7749 * @out_unique_id: (out): Return location for return parameter or %NULL to ignore.
7750 * @cancellable: (allow-none): A #GCancellable or %NULL.
7751 * @error: Return location for error or %NULL.
7753 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7755 * See _g_freedesktop_dbus_call_get_id() for the asynchronous version of this method.
7757 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7762 * _g_freedesktop_dbus_call_get_name_owner:
7763 * @proxy: A #_GFreedesktopDBusProxy.
7764 * @arg_name: Argument to pass with the method invocation.
7765 * @cancellable: (allow-none): A #GCancellable or %NULL.
7766 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7767 * @user_data: User data to pass to @callback.
7769 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method on @proxy.
7770 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7771 * You can then call _g_freedesktop_dbus_call_get_name_owner_finish() to get the result of the operation.
7773 * See _g_freedesktop_dbus_call_get_name_owner_sync() for the synchronous, blocking version of this method.
7778 * _g_freedesktop_dbus_call_get_name_owner_finish:
7779 * @proxy: A #_GFreedesktopDBusProxy.
7780 * @out_unique_name: (out): Return location for return parameter or %NULL to ignore.
7781 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_name_owner().
7782 * @error: Return location for error or %NULL.
7784 * Finishes an operation started with _g_freedesktop_dbus_call_get_name_owner().
7786 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7791 * _g_freedesktop_dbus_call_get_name_owner_sync:
7792 * @proxy: A #_GFreedesktopDBusProxy.
7793 * @arg_name: Argument to pass with the method invocation.
7794 * @out_unique_name: (out): Return location for return parameter or %NULL to ignore.
7795 * @cancellable: (allow-none): A #GCancellable or %NULL.
7796 * @error: Return location for error or %NULL.
7798 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7800 * See _g_freedesktop_dbus_call_get_name_owner() for the asynchronous version of this method.
7802 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7807 * _g_freedesktop_dbus_call_hello:
7808 * @proxy: A #_GFreedesktopDBusProxy.
7809 * @cancellable: (allow-none): A #GCancellable or %NULL.
7810 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7811 * @user_data: User data to pass to @callback.
7813 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method on @proxy.
7814 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7815 * You can then call _g_freedesktop_dbus_call_hello_finish() to get the result of the operation.
7817 * See _g_freedesktop_dbus_call_hello_sync() for the synchronous, blocking version of this method.
7822 * _g_freedesktop_dbus_call_hello_finish:
7823 * @proxy: A #_GFreedesktopDBusProxy.
7824 * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore.
7825 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_hello().
7826 * @error: Return location for error or %NULL.
7828 * Finishes an operation started with _g_freedesktop_dbus_call_hello().
7830 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7835 * _g_freedesktop_dbus_call_hello_sync:
7836 * @proxy: A #_GFreedesktopDBusProxy.
7837 * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore.
7838 * @cancellable: (allow-none): A #GCancellable or %NULL.
7839 * @error: Return location for error or %NULL.
7841 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7843 * See _g_freedesktop_dbus_call_hello() for the asynchronous version of this method.
7845 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7850 * _g_freedesktop_dbus_call_list_activatable_names:
7851 * @proxy: A #_GFreedesktopDBusProxy.
7852 * @cancellable: (allow-none): A #GCancellable or %NULL.
7853 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7854 * @user_data: User data to pass to @callback.
7856 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method on @proxy.
7857 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7858 * You can then call _g_freedesktop_dbus_call_list_activatable_names_finish() to get the result of the operation.
7860 * See _g_freedesktop_dbus_call_list_activatable_names_sync() for the synchronous, blocking version of this method.
7865 * _g_freedesktop_dbus_call_list_activatable_names_finish:
7866 * @proxy: A #_GFreedesktopDBusProxy.
7867 * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore.
7868 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_activatable_names().
7869 * @error: Return location for error or %NULL.
7871 * Finishes an operation started with _g_freedesktop_dbus_call_list_activatable_names().
7873 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7878 * _g_freedesktop_dbus_call_list_activatable_names_sync:
7879 * @proxy: A #_GFreedesktopDBusProxy.
7880 * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore.
7881 * @cancellable: (allow-none): A #GCancellable or %NULL.
7882 * @error: Return location for error or %NULL.
7884 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7886 * See _g_freedesktop_dbus_call_list_activatable_names() for the asynchronous version of this method.
7888 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7893 * _g_freedesktop_dbus_call_list_names:
7894 * @proxy: A #_GFreedesktopDBusProxy.
7895 * @cancellable: (allow-none): A #GCancellable or %NULL.
7896 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7897 * @user_data: User data to pass to @callback.
7899 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method on @proxy.
7900 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7901 * You can then call _g_freedesktop_dbus_call_list_names_finish() to get the result of the operation.
7903 * See _g_freedesktop_dbus_call_list_names_sync() for the synchronous, blocking version of this method.
7908 * _g_freedesktop_dbus_call_list_names_finish:
7909 * @proxy: A #_GFreedesktopDBusProxy.
7910 * @out_names: (out): Return location for return parameter or %NULL to ignore.
7911 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_names().
7912 * @error: Return location for error or %NULL.
7914 * Finishes an operation started with _g_freedesktop_dbus_call_list_names().
7916 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7921 * _g_freedesktop_dbus_call_list_names_sync:
7922 * @proxy: A #_GFreedesktopDBusProxy.
7923 * @out_names: (out): Return location for return parameter or %NULL to ignore.
7924 * @cancellable: (allow-none): A #GCancellable or %NULL.
7925 * @error: Return location for error or %NULL.
7927 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7929 * See _g_freedesktop_dbus_call_list_names() for the asynchronous version of this method.
7931 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7936 * _g_freedesktop_dbus_call_list_queued_owners:
7937 * @proxy: A #_GFreedesktopDBusProxy.
7938 * @arg_name: Argument to pass with the method invocation.
7939 * @cancellable: (allow-none): A #GCancellable or %NULL.
7940 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7941 * @user_data: User data to pass to @callback.
7943 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method on @proxy.
7944 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7945 * You can then call _g_freedesktop_dbus_call_list_queued_owners_finish() to get the result of the operation.
7947 * See _g_freedesktop_dbus_call_list_queued_owners_sync() for the synchronous, blocking version of this method.
7952 * _g_freedesktop_dbus_call_list_queued_owners_finish:
7953 * @proxy: A #_GFreedesktopDBusProxy.
7954 * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore.
7955 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_queued_owners().
7956 * @error: Return location for error or %NULL.
7958 * Finishes an operation started with _g_freedesktop_dbus_call_list_queued_owners().
7960 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7965 * _g_freedesktop_dbus_call_list_queued_owners_sync:
7966 * @proxy: A #_GFreedesktopDBusProxy.
7967 * @arg_name: Argument to pass with the method invocation.
7968 * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore.
7969 * @cancellable: (allow-none): A #GCancellable or %NULL.
7970 * @error: Return location for error or %NULL.
7972 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7974 * See _g_freedesktop_dbus_call_list_queued_owners() for the asynchronous version of this method.
7976 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7981 * _g_freedesktop_dbus_call_name_has_owner:
7982 * @proxy: A #_GFreedesktopDBusProxy.
7983 * @arg_name: Argument to pass with the method invocation.
7984 * @cancellable: (allow-none): A #GCancellable or %NULL.
7985 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7986 * @user_data: User data to pass to @callback.
7988 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method on @proxy.
7989 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
7990 * You can then call _g_freedesktop_dbus_call_name_has_owner_finish() to get the result of the operation.
7992 * See _g_freedesktop_dbus_call_name_has_owner_sync() for the synchronous, blocking version of this method.
7997 * _g_freedesktop_dbus_call_name_has_owner_finish:
7998 * @proxy: A #_GFreedesktopDBusProxy.
7999 * @out_has_owner: (out): Return location for return parameter or %NULL to ignore.
8000 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_name_has_owner().
8001 * @error: Return location for error or %NULL.
8003 * Finishes an operation started with _g_freedesktop_dbus_call_name_has_owner().
8005 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8010 * _g_freedesktop_dbus_call_name_has_owner_sync:
8011 * @proxy: A #_GFreedesktopDBusProxy.
8012 * @arg_name: Argument to pass with the method invocation.
8013 * @out_has_owner: (out): Return location for return parameter or %NULL to ignore.
8014 * @cancellable: (allow-none): A #GCancellable or %NULL.
8015 * @error: Return location for error or %NULL.
8017 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8019 * See _g_freedesktop_dbus_call_name_has_owner() for the asynchronous version of this method.
8021 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8026 * _g_freedesktop_dbus_call_release_name:
8027 * @proxy: A #_GFreedesktopDBusProxy.
8028 * @arg_name: Argument to pass with the method invocation.
8029 * @cancellable: (allow-none): A #GCancellable or %NULL.
8030 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8031 * @user_data: User data to pass to @callback.
8033 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method on @proxy.
8034 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8035 * You can then call _g_freedesktop_dbus_call_release_name_finish() to get the result of the operation.
8037 * See _g_freedesktop_dbus_call_release_name_sync() for the synchronous, blocking version of this method.
8042 * _g_freedesktop_dbus_call_release_name_finish:
8043 * @proxy: A #_GFreedesktopDBusProxy.
8044 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8045 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_release_name().
8046 * @error: Return location for error or %NULL.
8048 * Finishes an operation started with _g_freedesktop_dbus_call_release_name().
8050 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8055 * _g_freedesktop_dbus_call_release_name_sync:
8056 * @proxy: A #_GFreedesktopDBusProxy.
8057 * @arg_name: Argument to pass with the method invocation.
8058 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8059 * @cancellable: (allow-none): A #GCancellable or %NULL.
8060 * @error: Return location for error or %NULL.
8062 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8064 * See _g_freedesktop_dbus_call_release_name() for the asynchronous version of this method.
8066 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8071 * _g_freedesktop_dbus_call_reload_config:
8072 * @proxy: A #_GFreedesktopDBusProxy.
8073 * @cancellable: (allow-none): A #GCancellable or %NULL.
8074 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8075 * @user_data: User data to pass to @callback.
8077 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method on @proxy.
8078 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8079 * You can then call _g_freedesktop_dbus_call_reload_config_finish() to get the result of the operation.
8081 * See _g_freedesktop_dbus_call_reload_config_sync() for the synchronous, blocking version of this method.
8086 * _g_freedesktop_dbus_call_reload_config_finish:
8087 * @proxy: A #_GFreedesktopDBusProxy.
8088 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_reload_config().
8089 * @error: Return location for error or %NULL.
8091 * Finishes an operation started with _g_freedesktop_dbus_call_reload_config().
8093 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8098 * _g_freedesktop_dbus_call_reload_config_sync:
8099 * @proxy: A #_GFreedesktopDBusProxy.
8100 * @cancellable: (allow-none): A #GCancellable or %NULL.
8101 * @error: Return location for error or %NULL.
8103 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8105 * See _g_freedesktop_dbus_call_reload_config() for the asynchronous version of this method.
8107 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8112 * _g_freedesktop_dbus_call_remove_match:
8113 * @proxy: A #_GFreedesktopDBusProxy.
8114 * @arg_rule: Argument to pass with the method invocation.
8115 * @cancellable: (allow-none): A #GCancellable or %NULL.
8116 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8117 * @user_data: User data to pass to @callback.
8119 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method on @proxy.
8120 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8121 * You can then call _g_freedesktop_dbus_call_remove_match_finish() to get the result of the operation.
8123 * See _g_freedesktop_dbus_call_remove_match_sync() for the synchronous, blocking version of this method.
8128 * _g_freedesktop_dbus_call_remove_match_finish:
8129 * @proxy: A #_GFreedesktopDBusProxy.
8130 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_remove_match().
8131 * @error: Return location for error or %NULL.
8133 * Finishes an operation started with _g_freedesktop_dbus_call_remove_match().
8135 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8140 * _g_freedesktop_dbus_call_remove_match_sync:
8141 * @proxy: A #_GFreedesktopDBusProxy.
8142 * @arg_rule: Argument to pass with the method invocation.
8143 * @cancellable: (allow-none): A #GCancellable or %NULL.
8144 * @error: Return location for error or %NULL.
8146 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8148 * See _g_freedesktop_dbus_call_remove_match() for the asynchronous version of this method.
8150 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8155 * _g_freedesktop_dbus_call_request_name:
8156 * @proxy: A #_GFreedesktopDBusProxy.
8157 * @arg_name: Argument to pass with the method invocation.
8158 * @arg_flags: Argument to pass with the method invocation.
8159 * @cancellable: (allow-none): A #GCancellable or %NULL.
8160 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8161 * @user_data: User data to pass to @callback.
8163 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method on @proxy.
8164 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8165 * You can then call _g_freedesktop_dbus_call_request_name_finish() to get the result of the operation.
8167 * See _g_freedesktop_dbus_call_request_name_sync() for the synchronous, blocking version of this method.
8172 * _g_freedesktop_dbus_call_request_name_finish:
8173 * @proxy: A #_GFreedesktopDBusProxy.
8174 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8175 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_request_name().
8176 * @error: Return location for error or %NULL.
8178 * Finishes an operation started with _g_freedesktop_dbus_call_request_name().
8180 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8185 * _g_freedesktop_dbus_call_request_name_sync:
8186 * @proxy: A #_GFreedesktopDBusProxy.
8187 * @arg_name: Argument to pass with the method invocation.
8188 * @arg_flags: Argument to pass with the method invocation.
8189 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8190 * @cancellable: (allow-none): A #GCancellable or %NULL.
8191 * @error: Return location for error or %NULL.
8193 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8195 * See _g_freedesktop_dbus_call_request_name() for the asynchronous version of this method.
8197 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8202 * _g_freedesktop_dbus_call_start_service_by_name:
8203 * @proxy: A #_GFreedesktopDBusProxy.
8204 * @arg_name: Argument to pass with the method invocation.
8205 * @arg_flags: Argument to pass with the method invocation.
8206 * @cancellable: (allow-none): A #GCancellable or %NULL.
8207 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8208 * @user_data: User data to pass to @callback.
8210 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method on @proxy.
8211 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8212 * You can then call _g_freedesktop_dbus_call_start_service_by_name_finish() to get the result of the operation.
8214 * See _g_freedesktop_dbus_call_start_service_by_name_sync() for the synchronous, blocking version of this method.
8219 * _g_freedesktop_dbus_call_start_service_by_name_finish:
8220 * @proxy: A #_GFreedesktopDBusProxy.
8221 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8222 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_start_service_by_name().
8223 * @error: Return location for error or %NULL.
8225 * Finishes an operation started with _g_freedesktop_dbus_call_start_service_by_name().
8227 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8232 * _g_freedesktop_dbus_call_start_service_by_name_sync:
8233 * @proxy: A #_GFreedesktopDBusProxy.
8234 * @arg_name: Argument to pass with the method invocation.
8235 * @arg_flags: Argument to pass with the method invocation.
8236 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8237 * @cancellable: (allow-none): A #GCancellable or %NULL.
8238 * @error: Return location for error or %NULL.
8240 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8242 * See _g_freedesktop_dbus_call_start_service_by_name() for the asynchronous version of this method.
8244 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8249 * _g_freedesktop_dbus_call_update_activation_environment:
8250 * @proxy: A #_GFreedesktopDBusProxy.
8251 * @arg_environment: Argument to pass with the method invocation.
8252 * @cancellable: (allow-none): A #GCancellable or %NULL.
8253 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8254 * @user_data: User data to pass to @callback.
8256 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method on @proxy.
8257 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8258 * You can then call _g_freedesktop_dbus_call_update_activation_environment_finish() to get the result of the operation.
8260 * See _g_freedesktop_dbus_call_update_activation_environment_sync() for the synchronous, blocking version of this method.
8265 * _g_freedesktop_dbus_call_update_activation_environment_finish:
8266 * @proxy: A #_GFreedesktopDBusProxy.
8267 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_update_activation_environment().
8268 * @error: Return location for error or %NULL.
8270 * Finishes an operation started with _g_freedesktop_dbus_call_update_activation_environment().
8272 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8277 * _g_freedesktop_dbus_call_update_activation_environment_sync:
8278 * @proxy: A #_GFreedesktopDBusProxy.
8279 * @arg_environment: Argument to pass with the method invocation.
8280 * @cancellable: (allow-none): A #GCancellable or %NULL.
8281 * @error: Return location for error or %NULL.
8283 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
8285 * See _g_freedesktop_dbus_call_update_activation_environment() for the asynchronous version of this method.
8287 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8292 * _g_freedesktop_dbus_complete_add_match:
8293 * @object: A #_GFreedesktopDBus.
8294 * @invocation: (transfer full): A #GDBusMethodInvocation.
8296 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8298 * This method will free @invocation, you cannot use it afterwards.
8303 * _g_freedesktop_dbus_complete_get_connection_selinux_security_context:
8304 * @object: A #_GFreedesktopDBus.
8305 * @invocation: (transfer full): A #GDBusMethodInvocation.
8306 * @security_context: Parameter to return.
8308 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8310 * This method will free @invocation, you cannot use it afterwards.
8315 * _g_freedesktop_dbus_complete_get_connection_unix_process_id:
8316 * @object: A #_GFreedesktopDBus.
8317 * @invocation: (transfer full): A #GDBusMethodInvocation.
8318 * @pid: Parameter to return.
8320 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8322 * This method will free @invocation, you cannot use it afterwards.
8327 * _g_freedesktop_dbus_complete_get_connection_unix_user:
8328 * @object: A #_GFreedesktopDBus.
8329 * @invocation: (transfer full): A #GDBusMethodInvocation.
8330 * @uid: Parameter to return.
8332 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8334 * This method will free @invocation, you cannot use it afterwards.
8339 * _g_freedesktop_dbus_complete_get_id:
8340 * @object: A #_GFreedesktopDBus.
8341 * @invocation: (transfer full): A #GDBusMethodInvocation.
8342 * @unique_id: Parameter to return.
8344 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8346 * This method will free @invocation, you cannot use it afterwards.
8351 * _g_freedesktop_dbus_complete_get_name_owner:
8352 * @object: A #_GFreedesktopDBus.
8353 * @invocation: (transfer full): A #GDBusMethodInvocation.
8354 * @unique_name: Parameter to return.
8356 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8358 * This method will free @invocation, you cannot use it afterwards.
8363 * _g_freedesktop_dbus_complete_hello:
8364 * @object: A #_GFreedesktopDBus.
8365 * @invocation: (transfer full): A #GDBusMethodInvocation.
8366 * @assigned_name: Parameter to return.
8368 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8370 * This method will free @invocation, you cannot use it afterwards.
8375 * _g_freedesktop_dbus_complete_list_activatable_names:
8376 * @object: A #_GFreedesktopDBus.
8377 * @invocation: (transfer full): A #GDBusMethodInvocation.
8378 * @activatable_names: Parameter to return.
8380 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8382 * This method will free @invocation, you cannot use it afterwards.
8387 * _g_freedesktop_dbus_complete_list_names:
8388 * @object: A #_GFreedesktopDBus.
8389 * @invocation: (transfer full): A #GDBusMethodInvocation.
8390 * @names: Parameter to return.
8392 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8394 * This method will free @invocation, you cannot use it afterwards.
8399 * _g_freedesktop_dbus_complete_list_queued_owners:
8400 * @object: A #_GFreedesktopDBus.
8401 * @invocation: (transfer full): A #GDBusMethodInvocation.
8402 * @queued_owners: Parameter to return.
8404 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8406 * This method will free @invocation, you cannot use it afterwards.
8411 * _g_freedesktop_dbus_complete_name_has_owner:
8412 * @object: A #_GFreedesktopDBus.
8413 * @invocation: (transfer full): A #GDBusMethodInvocation.
8414 * @has_owner: Parameter to return.
8416 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8418 * This method will free @invocation, you cannot use it afterwards.
8423 * _g_freedesktop_dbus_complete_release_name:
8424 * @object: A #_GFreedesktopDBus.
8425 * @invocation: (transfer full): A #GDBusMethodInvocation.
8426 * @value: Parameter to return.
8428 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8430 * This method will free @invocation, you cannot use it afterwards.
8435 * _g_freedesktop_dbus_complete_reload_config:
8436 * @object: A #_GFreedesktopDBus.
8437 * @invocation: (transfer full): A #GDBusMethodInvocation.
8439 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8441 * This method will free @invocation, you cannot use it afterwards.
8446 * _g_freedesktop_dbus_complete_remove_match:
8447 * @object: A #_GFreedesktopDBus.
8448 * @invocation: (transfer full): A #GDBusMethodInvocation.
8450 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8452 * This method will free @invocation, you cannot use it afterwards.
8457 * _g_freedesktop_dbus_complete_request_name:
8458 * @object: A #_GFreedesktopDBus.
8459 * @invocation: (transfer full): A #GDBusMethodInvocation.
8460 * @value: Parameter to return.
8462 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8464 * This method will free @invocation, you cannot use it afterwards.
8469 * _g_freedesktop_dbus_complete_start_service_by_name:
8470 * @object: A #_GFreedesktopDBus.
8471 * @invocation: (transfer full): A #GDBusMethodInvocation.
8472 * @value: Parameter to return.
8474 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8476 * This method will free @invocation, you cannot use it afterwards.
8481 * _g_freedesktop_dbus_complete_update_activation_environment:
8482 * @object: A #_GFreedesktopDBus.
8483 * @invocation: (transfer full): A #GDBusMethodInvocation.
8485 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
8487 * This method will free @invocation, you cannot use it afterwards.
8492 * _g_freedesktop_dbus_emit_name_acquired:
8493 * @object: A #_GFreedesktopDBus.
8494 * @arg_name: Argument to pass with the signal.
8496 * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameAcquired">"NameAcquired"</link> D-Bus signal.
8501 * _g_freedesktop_dbus_emit_name_lost:
8502 * @object: A #_GFreedesktopDBus.
8503 * @arg_name: Argument to pass with the signal.
8505 * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameLost">"NameLost"</link> D-Bus signal.
8510 * _g_freedesktop_dbus_emit_name_owner_changed:
8511 * @object: A #_GFreedesktopDBus.
8512 * @arg_name: Argument to pass with the signal.
8513 * @arg_old_owner: Argument to pass with the signal.
8514 * @arg_new_owner: Argument to pass with the signal.
8516 * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameOwnerChanged">"NameOwnerChanged"</link> D-Bus signal.
8521 * _g_freedesktop_dbus_interface_info:
8523 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link> D-Bus interface.
8525 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
8530 * _g_freedesktop_dbus_override_properties:
8531 * @klass: The class structure for a #GObject<!-- -->-derived class.
8532 * @property_id_begin: The property id to assign to the first overridden property.
8534 * Overrides all #GObject properties in the #_GFreedesktopDBus interface for a concrete class.
8535 * The properties are overridden in the order they are defined.
8537 * Returns: The last property id.
8542 * _g_freedesktop_dbus_proxy_new:
8543 * @connection: A #GDBusConnection.
8544 * @flags: Flags from the #GDBusProxyFlags enumeration.
8545 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
8546 * @object_path: An object path.
8547 * @cancellable: (allow-none): A #GCancellable or %NULL.
8548 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
8549 * @user_data: User data to pass to @callback.
8551 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>. See g_dbus_proxy_new() for more details.
8553 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8554 * You can then call _g_freedesktop_dbus_proxy_new_finish() to get the result of the operation.
8556 * See _g_freedesktop_dbus_proxy_new_sync() for the synchronous, blocking version of this constructor.
8561 * _g_freedesktop_dbus_proxy_new_finish:
8562 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new().
8563 * @error: Return location for error or %NULL
8565 * Finishes an operation started with _g_freedesktop_dbus_proxy_new().
8567 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8572 * _g_freedesktop_dbus_proxy_new_for_bus:
8573 * @bus_type: A #GBusType.
8574 * @flags: Flags from the #GDBusProxyFlags enumeration.
8575 * @name: A bus name (well-known or unique).
8576 * @object_path: An object path.
8577 * @cancellable: (allow-none): A #GCancellable or %NULL.
8578 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
8579 * @user_data: User data to pass to @callback.
8581 * Like _g_freedesktop_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
8583 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8584 * You can then call _g_freedesktop_dbus_proxy_new_for_bus_finish() to get the result of the operation.
8586 * See _g_freedesktop_dbus_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
8591 * _g_freedesktop_dbus_proxy_new_for_bus_finish:
8592 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new_for_bus().
8593 * @error: Return location for error or %NULL
8595 * Finishes an operation started with _g_freedesktop_dbus_proxy_new_for_bus().
8597 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8602 * _g_freedesktop_dbus_proxy_new_for_bus_sync:
8603 * @bus_type: A #GBusType.
8604 * @flags: Flags from the #GDBusProxyFlags enumeration.
8605 * @name: A bus name (well-known or unique).
8606 * @object_path: An object path.
8607 * @cancellable: (allow-none): A #GCancellable or %NULL.
8608 * @error: Return location for error or %NULL
8610 * Like _g_freedesktop_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
8612 * The calling thread is blocked until a reply is received.
8614 * See _g_freedesktop_dbus_proxy_new_for_bus() for the asynchronous version of this constructor.
8616 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8621 * _g_freedesktop_dbus_proxy_new_sync:
8622 * @connection: A #GDBusConnection.
8623 * @flags: Flags from the #GDBusProxyFlags enumeration.
8624 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
8625 * @object_path: An object path.
8626 * @cancellable: (allow-none): A #GCancellable or %NULL.
8627 * @error: Return location for error or %NULL
8629 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>. See g_dbus_proxy_new_sync() for more details.
8631 * The calling thread is blocked until a reply is received.
8633 * See _g_freedesktop_dbus_proxy_new() for the asynchronous version of this constructor.
8635 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8640 * _g_freedesktop_dbus_skeleton_new:
8642 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
8644 * Returns: (transfer full) (type _GFreedesktopDBusSkeleton): The skeleton object.
8649 * _g_io_module_get_default:
8650 * @extension_point: the name of an extension point
8651 * @envvar: (allow-none): the name of an environment variable to override the default implementation.
8652 * @verify_func: (allow-none): a function to call to verify that a given implementation is usable in the current environment.
8654 * Retrieves the default object implementing @extension_point.
8656 * If @envvar is not %NULL, and the environment variable with that
8657 * name is set, then the implementation it specifies will be tried
8658 * first. After that, or if @envvar is not set, all other
8659 * implementations will be tried in order of decreasing priority.
8661 * If an extension point implementation implements #GInitable, then
8662 * that implementation will only be used if it initializes
8663 * successfully. Otherwise, if @verify_func is not %NULL, then it will
8664 * be called on each candidate implementation after construction, to
8665 * check if it is actually usable or not.
8667 * The result is cached after it is generated the first time, and
8668 * the function is thread-safe.
8670 * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
8675 * g_action_activate:
8676 * @action: a #GAction
8677 * @parameter: (allow-none): the parameter to the activation
8679 * Activates the action.
8681 * @parameter must be the correct type of parameter for the action (ie:
8682 * the parameter type given at construction time). If the parameter
8683 * type was %NULL then @parameter must also be %NULL.
8690 * g_action_change_state:
8691 * @action: a #GAction
8692 * @value: the new state
8694 * Request for the state of @action to be changed to @value.
8696 * The action must be stateful and @value must be of the correct type.
8697 * See g_action_get_state_type().
8699 * This call merely requests a change. The action may refuse to change
8700 * its state or may change its state to something other than @value.
8701 * See g_action_get_state_hint().
8703 * If the @value GVariant is floating, it is consumed.
8710 * g_action_get_enabled:
8711 * @action: a #GAction
8713 * Checks if @action is currently enabled.
8715 * An action must be enabled in order to be activated or in order to
8716 * have its state changed from outside callers.
8718 * Returns: whether the action is enabled
8724 * g_action_get_name:
8725 * @action: a #GAction
8727 * Queries the name of @action.
8729 * Returns: the name of the action
8735 * g_action_get_parameter_type:
8736 * @action: a #GAction
8738 * Queries the type of the parameter that must be given when activating
8741 * When activating the action using g_action_activate(), the #GVariant
8742 * given to that function must be of the type returned by this function.
8744 * In the case that this function returns %NULL, you must not give any
8745 * #GVariant, but %NULL instead.
8747 * Returns: (allow-none): the parameter type
8753 * g_action_get_state:
8754 * @action: a #GAction
8756 * Queries the current state of @action.
8758 * If the action is not stateful then %NULL will be returned. If the
8759 * action is stateful then the type of the return value is the type
8760 * given by g_action_get_state_type().
8762 * The return value (if non-%NULL) should be freed with
8763 * g_variant_unref() when it is no longer required.
8765 * Returns: (transfer full): the current state of the action
8771 * g_action_get_state_hint:
8772 * @action: a #GAction
8774 * Requests a hint about the valid range of values for the state of
8777 * If %NULL is returned it either means that the action is not stateful
8778 * or that there is no hint about the valid range of values for the
8779 * state of the action.
8781 * If a #GVariant array is returned then each item in the array is a
8782 * possible value for the state. If a #GVariant pair (ie: two-tuple) is
8783 * returned then the tuple specifies the inclusive lower and upper bound
8784 * of valid values for the state.
8786 * In any case, the information is merely a hint. It may be possible to
8787 * have a state value outside of the hinted range and setting a value
8788 * within the range may fail.
8790 * The return value (if non-%NULL) should be freed with
8791 * g_variant_unref() when it is no longer required.
8793 * Returns: (transfer full): the state range hint
8799 * g_action_get_state_type:
8800 * @action: a #GAction
8802 * Queries the type of the state of @action.
8804 * If the action is stateful (e.g. created with
8805 * g_simple_action_new_stateful()) then this function returns the
8806 * #GVariantType of the state. This is the type of the initial value
8807 * given as the state. All calls to g_action_change_state() must give a
8808 * #GVariant of this type and g_action_get_state() will return a
8809 * #GVariant of the same type.
8811 * If the action is not stateful (e.g. created with g_simple_action_new())
8812 * then this function will return %NULL. In that case, g_action_get_state()
8813 * will return %NULL and you must not call g_action_change_state().
8815 * Returns: (allow-none): the state type, if the action is stateful
8821 * g_action_group_action_added:
8822 * @action_group: a #GActionGroup
8823 * @action_name: the name of an action in the group
8825 * Emits the #GActionGroup::action-added signal on @action_group.
8827 * This function should only be called by #GActionGroup implementations.
8834 * g_action_group_action_enabled_changed:
8835 * @action_group: a #GActionGroup
8836 * @action_name: the name of an action in the group
8837 * @enabled: whether or not the action is now enabled
8839 * Emits the #GActionGroup::action-enabled-changed signal on @action_group.
8841 * This function should only be called by #GActionGroup implementations.
8848 * g_action_group_action_removed:
8849 * @action_group: a #GActionGroup
8850 * @action_name: the name of an action in the group
8852 * Emits the #GActionGroup::action-removed signal on @action_group.
8854 * This function should only be called by #GActionGroup implementations.
8861 * g_action_group_action_state_changed:
8862 * @action_group: a #GActionGroup
8863 * @action_name: the name of an action in the group
8864 * @state: the new state of the named action
8866 * Emits the #GActionGroup::action-state-changed signal on @action_group.
8868 * This function should only be called by #GActionGroup implementations.
8875 * g_action_group_activate_action:
8876 * @action_group: a #GActionGroup
8877 * @action_name: the name of the action to activate
8878 * @parameter: (allow-none): parameters to the activation
8880 * Activate the named action within @action_group.
8882 * If the action is expecting a parameter, then the correct type of
8883 * parameter must be given as @parameter. If the action is expecting no
8884 * parameters then @parameter must be %NULL. See
8885 * g_action_group_get_action_parameter_type().
8892 * g_action_group_change_action_state:
8893 * @action_group: a #GActionGroup
8894 * @action_name: the name of the action to request the change on
8895 * @value: the new state
8897 * Request for the state of the named action within @action_group to be
8898 * changed to @value.
8900 * The action must be stateful and @value must be of the correct type.
8901 * See g_action_group_get_action_state_type().
8903 * This call merely requests a change. The action may refuse to change
8904 * its state or may change its state to something other than @value.
8905 * See g_action_group_get_action_state_hint().
8907 * If the @value GVariant is floating, it is consumed.
8914 * g_action_group_get_action_enabled:
8915 * @action_group: a #GActionGroup
8916 * @action_name: the name of the action to query
8918 * Checks if the named action within @action_group is currently enabled.
8920 * An action must be enabled in order to be activated or in order to
8921 * have its state changed from outside callers.
8923 * Returns: whether or not the action is currently enabled
8929 * g_action_group_get_action_parameter_type:
8930 * @action_group: a #GActionGroup
8931 * @action_name: the name of the action to query
8933 * Queries the type of the parameter that must be given when activating
8934 * the named action within @action_group.
8936 * When activating the action using g_action_group_activate_action(),
8937 * the #GVariant given to that function must be of the type returned
8940 * In the case that this function returns %NULL, you must not give any
8941 * #GVariant, but %NULL instead.
8943 * The parameter type of a particular action will never change but it is
8944 * possible for an action to be removed and for a new action to be added
8945 * with the same name but a different parameter type.
8947 * Returns: the parameter type
8953 * g_action_group_get_action_state:
8954 * @action_group: a #GActionGroup
8955 * @action_name: the name of the action to query
8957 * Queries the current state of the named action within @action_group.
8959 * If the action is not stateful then %NULL will be returned. If the
8960 * action is stateful then the type of the return value is the type
8961 * given by g_action_group_get_action_state_type().
8963 * The return value (if non-%NULL) should be freed with
8964 * g_variant_unref() when it is no longer required.
8966 * Returns: (allow-none): the current state of the action
8972 * g_action_group_get_action_state_hint:
8973 * @action_group: a #GActionGroup
8974 * @action_name: the name of the action to query
8976 * Requests a hint about the valid range of values for the state of the
8977 * named action within @action_group.
8979 * If %NULL is returned it either means that the action is not stateful
8980 * or that there is no hint about the valid range of values for the
8981 * state of the action.
8983 * If a #GVariant array is returned then each item in the array is a
8984 * possible value for the state. If a #GVariant pair (ie: two-tuple) is
8985 * returned then the tuple specifies the inclusive lower and upper bound
8986 * of valid values for the state.
8988 * In any case, the information is merely a hint. It may be possible to
8989 * have a state value outside of the hinted range and setting a value
8990 * within the range may fail.
8992 * The return value (if non-%NULL) should be freed with
8993 * g_variant_unref() when it is no longer required.
8995 * Returns: (transfer full): the state range hint
9001 * g_action_group_get_action_state_type:
9002 * @action_group: a #GActionGroup
9003 * @action_name: the name of the action to query
9005 * Queries the type of the state of the named action within
9008 * If the action is stateful then this function returns the
9009 * #GVariantType of the state. All calls to
9010 * g_action_group_change_action_state() must give a #GVariant of this
9011 * type and g_action_group_get_action_state() will return a #GVariant
9014 * If the action is not stateful then this function will return %NULL.
9015 * In that case, g_action_group_get_action_state() will return %NULL
9016 * and you must not call g_action_group_change_action_state().
9018 * The state type of a particular action will never change but it is
9019 * possible for an action to be removed and for a new action to be added
9020 * with the same name but a different state type.
9022 * Returns: (transfer full): the state type, if the action is stateful
9028 * g_action_group_has_action:
9029 * @action_group: a #GActionGroup
9030 * @action_name: the name of the action to check for
9032 * Checks if the named action exists within @action_group.
9034 * Returns: whether the named action exists
9040 * g_action_group_list_actions:
9041 * @action_group: a #GActionGroup
9043 * Lists the actions contained within @action_group.
9045 * The caller is responsible for freeing the list with g_strfreev() when
9046 * it is no longer required.
9048 * Returns: (transfer full): a %NULL-terminated array of the names of the actions in the groupb
9054 * g_action_group_query_action:
9055 * @action_group: a #GActionGroup
9056 * @action_name: the name of an action in the group
9057 * @enabled: (out): if the action is presently enabled
9058 * @parameter_type: (out) (allow-none): the parameter type, or %NULL if none needed
9059 * @state_type: (out) (allow-none): the state type, or %NULL if stateless
9060 * @state_hint: (out) (allow-none): the state hint, or %NULL if none
9061 * @state: (out) (allow-none): the current state, or %NULL if stateless
9063 * Queries all aspects of the named action within an @action_group.
9065 * This function acquires the information available from
9066 * g_action_group_has_action(), g_action_group_get_action_enabled(),
9067 * g_action_group_get_action_parameter_type(),
9068 * g_action_group_get_action_state_type(),
9069 * g_action_group_get_action_state_hint() and
9070 * g_action_group_get_action_state() with a single function call.
9072 * This provides two main benefits.
9074 * The first is the improvement in efficiency that comes with not having
9075 * to perform repeated lookups of the action in order to discover
9076 * different things about it. The second is that implementing
9077 * #GActionGroup can now be done by only overriding this one virtual
9080 * The interface provides a default implementation of this function that
9081 * calls the individual functions, as required, to fetch the
9082 * information. The interface also provides default implementations of
9083 * those functions that call this function. All implementations,
9084 * therefore, must override either this function or all of the others.
9086 * If the action exists, %TRUE is returned and any of the requested
9087 * fields (as indicated by having a non-%NULL reference passed in) are
9088 * filled. If the action doesn't exist, %FALSE is returned and the
9089 * fields may or may not have been modified.
9091 * Returns: %TRUE if the action exists, else %FALSE
9097 * g_action_map_add_action:
9098 * @action_map: a #GActionMap
9099 * @action: a #GAction
9101 * Adds an action to the @action_map.
9103 * If the action map already contains an action with the same name
9104 * as @action then the old action is dropped from the action map.
9106 * The action map takes its own reference on @action.
9113 * g_action_map_add_action_entries:
9114 * @action_map: a #GActionMap
9115 * @entries: a pointer to the first item in an array of #GActionEntry structs
9116 * @n_entries: the length of @entries, or -1 if @entries is %NULL-terminated
9117 * @user_data: the user data for signal connections
9119 * A convenience function for creating multiple #GSimpleAction instances
9120 * and adding them to a #GActionMap.
9122 * Each action is constructed as per one #GActionEntry.
9125 * <title>Using g_action_map_add_action_entries()</title>
9128 * activate_quit (GSimpleAction *simple,
9129 * GVariant *parameter,
9130 * gpointer user_data)
9136 * activate_print_string (GSimpleAction *simple,
9137 * GVariant *parameter,
9138 * gpointer user_data)
9140 * g_print ("%s\n", g_variant_get_string (parameter, NULL));
9143 * static GActionGroup *
9144 * create_action_group (void)
9146 * const GActionEntry entries[] = {
9147 * { "quit", activate_quit },
9148 * { "print-string", activate_print_string, "s" }
9150 * GSimpleActionGroup *group;
9152 * group = g_simple_action_group_new ();
9153 * g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
9155 * return G_ACTION_GROUP (group);
9165 * g_action_map_lookup_action:
9166 * @action_map: a #GActionMap
9167 * @action_name: the name of an action
9169 * Looks up the action with the name @action_name in @action_map.
9171 * If no such action exists, returns %NULL.
9173 * Returns: (transfer none): a #GAction, or %NULL
9179 * g_action_map_remove_action:
9180 * @action_map: a #GActionMap
9181 * @action_name: the name of the action
9183 * Removes the named action from the action map.
9185 * If no action of this name is in the map then nothing happens.
9192 * g_app_info_add_supports_type:
9193 * @appinfo: a #GAppInfo.
9194 * @content_type: a string.
9195 * @error: a #GError.
9197 * Adds a content type to the application information to indicate the
9198 * application is capable of opening files with the given content type.
9200 * Returns: %TRUE on success, %FALSE on error.
9205 * g_app_info_can_delete:
9206 * @appinfo: a #GAppInfo
9208 * Obtains the information whether the #GAppInfo can be deleted.
9209 * See g_app_info_delete().
9211 * Returns: %TRUE if @appinfo can be deleted
9217 * g_app_info_can_remove_supports_type:
9218 * @appinfo: a #GAppInfo.
9220 * Checks if a supported content type can be removed from an application.
9222 * Returns: %TRUE if it is possible to remove supported content types from a given @appinfo, %FALSE if not.
9227 * g_app_info_create_from_commandline:
9228 * @commandline: the commandline to use
9229 * @application_name: (allow-none): the application name, or %NULL to use @commandline
9230 * @flags: flags that can specify details of the created #GAppInfo
9231 * @error: a #GError location to store the error occurring, %NULL to ignore.
9233 * Creates a new #GAppInfo from the given information.
9235 * Note that for @commandline, the quoting rules of the Exec key of the
9236 * <ulink url="http://freedesktop.org/Standards/desktop-entry-spec">freedesktop.org Desktop
9237 * Entry Specification</ulink> are applied. For example, if the @commandline contains
9238 * percent-encoded URIs, the percent-character must be doubled in order to prevent it from
9239 * being swallowed by Exec key unquoting. See the specification for exact quoting rules.
9241 * Returns: (transfer full): new #GAppInfo for given command.
9246 * g_app_info_delete:
9247 * @appinfo: a #GAppInfo
9249 * Tries to delete a #GAppInfo.
9251 * On some platforms, there may be a difference between user-defined
9252 * #GAppInfo<!-- -->s which can be deleted, and system-wide ones which
9253 * cannot. See g_app_info_can_delete().
9255 * Virtual: do_delete
9256 * Returns: %TRUE if @appinfo has been deleted
9263 * @appinfo: a #GAppInfo.
9265 * Creates a duplicate of a #GAppInfo.
9267 * Returns: (transfer full): a duplicate of @appinfo.
9273 * @appinfo1: the first #GAppInfo.
9274 * @appinfo2: the second #GAppInfo.
9276 * Checks if two #GAppInfo<!-- -->s are equal.
9278 * Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
9283 * g_app_info_get_all:
9285 * Gets a list of all of the applications currently registered
9288 * For desktop files, this includes applications that have
9289 * <literal>NoDisplay=true</literal> set or are excluded from
9290 * display by means of <literal>OnlyShowIn</literal> or
9291 * <literal>NotShowIn</literal>. See g_app_info_should_show().
9292 * The returned list does not include applications which have
9293 * the <literal>Hidden</literal> key set.
9295 * Returns: (element-type GAppInfo) (transfer full): a newly allocated #GList of references to #GAppInfo<!---->s.
9300 * g_app_info_get_all_for_type:
9301 * @content_type: the content type to find a #GAppInfo for
9303 * Gets a list of all #GAppInfos for a given content type,
9304 * including the recommended and fallback #GAppInfos. See
9305 * g_app_info_get_recommended_for_type() and
9306 * g_app_info_get_fallback_for_type().
9308 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9313 * g_app_info_get_commandline:
9314 * @appinfo: a #GAppInfo
9316 * Gets the commandline with which the application will be
9319 * Returns: a string containing the @appinfo's commandline, or %NULL if this information is not available
9325 * g_app_info_get_default_for_type:
9326 * @content_type: the content type to find a #GAppInfo for
9327 * @must_support_uris: if %TRUE, the #GAppInfo is expected to support URIs
9329 * Gets the default #GAppInfo for a given content type.
9331 * Returns: (transfer full): #GAppInfo for given @content_type or %NULL on error.
9336 * g_app_info_get_default_for_uri_scheme:
9337 * @uri_scheme: a string containing a URI scheme.
9339 * Gets the default application for handling URIs with
9340 * the given URI scheme. A URI scheme is the initial part
9341 * of the URI, up to but not including the ':', e.g. "http",
9344 * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
9349 * g_app_info_get_description:
9350 * @appinfo: a #GAppInfo.
9352 * Gets a human-readable description of an installed application.
9354 * Returns: a string containing a description of the application @appinfo, or %NULL if none.
9359 * g_app_info_get_display_name:
9360 * @appinfo: a #GAppInfo.
9362 * Gets the display name of the application. The display name is often more
9363 * descriptive to the user than the name itself.
9365 * Returns: the display name of the application for @appinfo, or the name if no display name is available.
9371 * g_app_info_get_executable:
9372 * @appinfo: a #GAppInfo
9374 * Gets the executable's name for the installed application.
9376 * Returns: a string containing the @appinfo's application binaries name
9381 * g_app_info_get_fallback_for_type:
9382 * @content_type: the content type to find a #GAppInfo for
9384 * Gets a list of fallback #GAppInfos for a given content type, i.e.
9385 * those applications which claim to support the given content type
9386 * by MIME type subclassing and not directly.
9388 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9394 * g_app_info_get_icon:
9395 * @appinfo: a #GAppInfo.
9397 * Gets the icon for the application.
9399 * Returns: (transfer none): the default #GIcon for @appinfo or %NULL if there is no default icon.
9404 * g_app_info_get_id:
9405 * @appinfo: a #GAppInfo.
9407 * Gets the ID of an application. An id is a string that
9408 * identifies the application. The exact format of the id is
9409 * platform dependent. For instance, on Unix this is the
9410 * desktop file id from the xdg menu specification.
9412 * Note that the returned ID may be %NULL, depending on how
9413 * the @appinfo has been constructed.
9415 * Returns: a string containing the application's ID.
9420 * g_app_info_get_name:
9421 * @appinfo: a #GAppInfo.
9423 * Gets the installed name of the application.
9425 * Returns: the name of the application for @appinfo.
9430 * g_app_info_get_recommended_for_type:
9431 * @content_type: the content type to find a #GAppInfo for
9433 * Gets a list of recommended #GAppInfos for a given content type, i.e.
9434 * those applications which claim to support the given content type exactly,
9435 * and not by MIME type subclassing.
9436 * Note that the first application of the list is the last used one, i.e.
9437 * the last one for which g_app_info_set_as_last_used_for_type() has been
9440 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9446 * g_app_info_get_supported_types:
9447 * @appinfo: a #GAppInfo that can handle files
9449 * Retrieves the list of content types that @app_info claims to support.
9450 * If this information is not provided by the environment, this function
9451 * will return %NULL.
9452 * This function does not take in consideration associations added with
9453 * g_app_info_add_supports_type(), but only those exported directly by
9456 * Returns: (transfer none) (array zero-terminated=1) (element-type utf8): a list of content types.
9462 * g_app_info_launch:
9463 * @appinfo: a #GAppInfo
9464 * @files: (allow-none) (element-type GFile): a #GList of #GFile objects
9465 * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
9468 * Launches the application. Passes @files to the launched application
9469 * as arguments, using the optional @launch_context to get information
9470 * about the details of the launcher (like what screen it is on).
9471 * On error, @error will be set accordingly.
9473 * To launch the application without arguments pass a %NULL @files list.
9475 * Note that even if the launch is successful the application launched
9476 * can fail to start if it runs into problems during startup. There is
9477 * no way to detect this.
9479 * Some URIs can be changed when passed through a GFile (for instance
9480 * unsupported URIs with strange formats like mailto:), so if you have
9481 * a textual URI you want to pass in as argument, consider using
9482 * g_app_info_launch_uris() instead.
9484 * The launched application inherits the environment of the launching
9485 * process, but it can be modified with g_app_launch_context_setenv() and
9486 * g_app_launch_context_unsetenv().
9488 * On UNIX, this function sets the <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>
9489 * environment variable with the path of the launched desktop file and
9490 * <envar>GIO_LAUNCHED_DESKTOP_FILE_PID</envar> to the process
9491 * id of the launched process. This can be used to ignore
9492 * <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>, should it be inherited
9493 * by further processes. The <envar>DISPLAY</envar> and
9494 * <envar>DESKTOP_STARTUP_ID</envar> environment variables are also
9495 * set, based on information provided in @launch_context.
9497 * Returns: %TRUE on successful launch, %FALSE otherwise.
9502 * g_app_info_launch_default_for_uri:
9503 * @uri: the uri to show
9504 * @launch_context: (allow-none): an optional #GAppLaunchContext.
9505 * @error: a #GError.
9507 * Utility function that launches the default application
9508 * registered to handle the specified uri. Synchronous I/O
9509 * is done on the uri to detect the type of the file if
9512 * Returns: %TRUE on success, %FALSE on error.
9517 * g_app_info_launch_uris:
9518 * @appinfo: a #GAppInfo
9519 * @uris: (allow-none) (element-type utf8): a #GList containing URIs to launch.
9520 * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
9523 * Launches the application. This passes the @uris to the launched application
9524 * as arguments, using the optional @launch_context to get information
9525 * about the details of the launcher (like what screen it is on).
9526 * On error, @error will be set accordingly.
9528 * To launch the application without arguments pass a %NULL @uris list.
9530 * Note that even if the launch is successful the application launched
9531 * can fail to start if it runs into problems during startup. There is
9532 * no way to detect this.
9534 * Returns: %TRUE on successful launch, %FALSE otherwise.
9539 * g_app_info_remove_supports_type:
9540 * @appinfo: a #GAppInfo.
9541 * @content_type: a string.
9542 * @error: a #GError.
9544 * Removes a supported type from an application, if possible.
9546 * Returns: %TRUE on success, %FALSE on error.
9551 * g_app_info_reset_type_associations:
9552 * @content_type: a content type
9554 * Removes all changes to the type associations done by
9555 * g_app_info_set_as_default_for_type(),
9556 * g_app_info_set_as_default_for_extension(),
9557 * g_app_info_add_supports_type() or
9558 * g_app_info_remove_supports_type().
9565 * g_app_info_set_as_default_for_extension:
9566 * @appinfo: a #GAppInfo.
9567 * @extension: a string containing the file extension (without the dot).
9568 * @error: a #GError.
9570 * Sets the application as the default handler for the given file extension.
9572 * Returns: %TRUE on success, %FALSE on error.
9577 * g_app_info_set_as_default_for_type:
9578 * @appinfo: a #GAppInfo.
9579 * @content_type: the content type.
9580 * @error: a #GError.
9582 * Sets the application as the default handler for a given type.
9584 * Returns: %TRUE on success, %FALSE on error.
9589 * g_app_info_set_as_last_used_for_type:
9590 * @appinfo: a #GAppInfo.
9591 * @content_type: the content type.
9592 * @error: a #GError.
9594 * Sets the application as the last used application for a given type.
9595 * This will make the application appear as first in the list returned
9596 * by g_app_info_get_recommended_for_type(), regardless of the default
9597 * application for that content type.
9599 * Returns: %TRUE on success, %FALSE on error.
9604 * g_app_info_should_show:
9605 * @appinfo: a #GAppInfo.
9607 * Checks if the application info should be shown in menus that
9608 * list available applications.
9610 * Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
9615 * g_app_info_supports_files:
9616 * @appinfo: a #GAppInfo.
9618 * Checks if the application accepts files as arguments.
9620 * Returns: %TRUE if the @appinfo supports files.
9625 * g_app_info_supports_uris:
9626 * @appinfo: a #GAppInfo.
9628 * Checks if the application supports reading files and directories from URIs.
9630 * Returns: %TRUE if the @appinfo supports URIs.
9635 * g_app_launch_context_get_display:
9636 * @context: a #GAppLaunchContext
9637 * @info: a #GAppInfo
9638 * @files: (element-type GFile): a #GList of #GFile objects
9640 * Gets the display string for the @context. This is used to ensure new
9641 * applications are started on the same display as the launching
9642 * application, by setting the <envar>DISPLAY</envar> environment variable.
9644 * Returns: a display string for the display.
9649 * g_app_launch_context_get_environment:
9650 * @context: a #GAppLaunchContext
9652 * Gets the complete environment variable list to be passed to
9653 * the child process when @context is used to launch an application.
9654 * This is a %NULL-terminated array of strings, where each string has
9655 * the form <literal>KEY=VALUE</literal>.
9657 * Returns: (array zero-terminated=1) (transfer full): the child's environment
9663 * g_app_launch_context_get_startup_notify_id:
9664 * @context: a #GAppLaunchContext
9665 * @info: a #GAppInfo
9666 * @files: (element-type GFile): a #GList of of #GFile objects
9668 * Initiates startup notification for the application and returns the
9669 * <envar>DESKTOP_STARTUP_ID</envar> for the launched operation,
9672 * Startup notification IDs are defined in the <ulink
9673 * url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
9674 * FreeDesktop.Org Startup Notifications standard</ulink>.
9676 * Returns: a startup notification ID for the application, or %NULL if not supported.
9681 * g_app_launch_context_launch_failed:
9682 * @context: a #GAppLaunchContext.
9683 * @startup_notify_id: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
9685 * Called when an application has failed to launch, so that it can cancel
9686 * the application startup notification started in g_app_launch_context_get_startup_notify_id().
9691 * g_app_launch_context_new:
9693 * Creates a new application launch context. This is not normally used,
9694 * instead you instantiate a subclass of this, such as #GdkAppLaunchContext.
9696 * Returns: a #GAppLaunchContext.
9701 * g_app_launch_context_setenv:
9702 * @context: a #GAppLaunchContext
9703 * @variable: the environment variable to set
9704 * @value: the value for to set the variable to.
9706 * Arranges for @variable to be set to @value in the child's
9707 * environment when @context is used to launch an application.
9714 * g_app_launch_context_unsetenv:
9715 * @context: a #GAppLaunchContext
9716 * @variable: the environment variable to remove
9718 * Arranges for @variable to be unset in the child's environment
9719 * when @context is used to launch an application.
9726 * g_application_activate:
9727 * @application: a #GApplication
9729 * Activates the application.
9731 * In essence, this results in the #GApplication::activate signal being
9732 * emitted in the primary instance.
9734 * The application must be registered before calling this function.
9741 * g_application_command_line_get_arguments:
9742 * @cmdline: a #GApplicationCommandLine
9743 * @argc: (out) (allow-none): the length of the arguments array, or %NULL
9745 * Gets the list of arguments that was passed on the command line.
9747 * The strings in the array may contain non-utf8 data.
9749 * The return value is %NULL-terminated and should be freed using
9752 * Returns: (array length=argc) (transfer full): the string array containing the arguments (the argv)
9758 * g_application_command_line_get_cwd:
9759 * @cmdline: a #GApplicationCommandLine
9761 * Gets the working directory of the command line invocation.
9762 * The string may contain non-utf8 data.
9764 * It is possible that the remote application did not send a working
9765 * directory, so this may be %NULL.
9767 * The return value should not be modified or freed and is valid for as
9768 * long as @cmdline exists.
9770 * Returns: the current directory, or %NULL
9776 * g_application_command_line_get_environ:
9777 * @cmdline: a #GApplicationCommandLine
9779 * Gets the contents of the 'environ' variable of the command line
9780 * invocation, as would be returned by g_get_environ(), ie as a
9781 * %NULL-terminated list of strings in the form 'NAME=VALUE'.
9782 * The strings may contain non-utf8 data.
9784 * The remote application usually does not send an environment. Use
9785 * %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
9786 * set it is possible that the environment is still not available (due
9787 * to invocation messages from other applications).
9789 * The return value should not be modified or freed and is valid for as
9790 * long as @cmdline exists.
9792 * See g_application_command_line_getenv() if you are only interested
9793 * in the value of a single environment variable.
9795 * Returns: (array zero-terminated=1) (transfer none): the environment strings, or %NULL if they were not sent
9801 * g_application_command_line_get_exit_status:
9802 * @cmdline: a #GApplicationCommandLine
9804 * Gets the exit status of @cmdline. See
9805 * g_application_command_line_set_exit_status() for more information.
9807 * Returns: the exit status
9813 * g_application_command_line_get_is_remote:
9814 * @cmdline: a #GApplicationCommandLine
9816 * Determines if @cmdline represents a remote invocation.
9818 * Returns: %TRUE if the invocation was remote
9824 * g_application_command_line_get_platform_data:
9825 * @cmdline: #GApplicationCommandLine
9827 * Gets the platform data associated with the invocation of @cmdline.
9829 * This is a #GVariant dictionary containing information about the
9830 * context in which the invocation occurred. It typically contains
9831 * information like the current working directory and the startup
9834 * For local invocation, it will be %NULL.
9836 * Returns: (allow-none): the platform data, or %NULL
9842 * g_application_command_line_getenv:
9843 * @cmdline: a #GApplicationCommandLine
9844 * @name: the environment variable to get
9846 * Gets the value of a particular environment variable of the command
9847 * line invocation, as would be returned by g_getenv(). The strings may
9848 * contain non-utf8 data.
9850 * The remote application usually does not send an environment. Use
9851 * %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
9852 * set it is possible that the environment is still not available (due
9853 * to invocation messages from other applications).
9855 * The return value should not be modified or freed and is valid for as
9856 * long as @cmdline exists.
9858 * Returns: the value of the variable, or %NULL if unset or unsent
9864 * g_application_command_line_print:
9865 * @cmdline: a #GApplicationCommandLine
9866 * @format: a printf-style format string
9867 * @...: arguments, as per @format
9869 * Formats a message and prints it using the stdout print handler in the
9872 * If @cmdline is a local invocation then this is exactly equivalent to
9873 * g_print(). If @cmdline is remote then this is equivalent to calling
9874 * g_print() in the invoking process.
9881 * g_application_command_line_printerr:
9882 * @cmdline: a #GApplicationCommandLine
9883 * @format: a printf-style format string
9884 * @...: arguments, as per @format
9886 * Formats a message and prints it using the stderr print handler in the
9889 * If @cmdline is a local invocation then this is exactly equivalent to
9890 * g_printerr(). If @cmdline is remote then this is equivalent to
9891 * calling g_printerr() in the invoking process.
9898 * g_application_command_line_set_exit_status:
9899 * @cmdline: a #GApplicationCommandLine
9900 * @exit_status: the exit status
9902 * Sets the exit status that will be used when the invoking process
9905 * The return value of the #GApplication::command-line signal is
9906 * passed to this function when the handler returns. This is the usual
9907 * way of setting the exit status.
9909 * In the event that you want the remote invocation to continue running
9910 * and want to decide on the exit status in the future, you can use this
9911 * call. For the case of a remote invocation, the remote process will
9912 * typically exit when the last reference is dropped on @cmdline. The
9913 * exit status of the remote process will be equal to the last value
9914 * that was set with this function.
9916 * In the case that the commandline invocation is local, the situation
9917 * is slightly more complicated. If the commandline invocation results
9918 * in the mainloop running (ie: because the use-count of the application
9919 * increased to a non-zero value) then the application is considered to
9920 * have been 'successful' in a certain sense, and the exit status is
9921 * always zero. If the application use count is zero, though, the exit
9922 * status of the local #GApplicationCommandLine is used.
9929 * g_application_get_application_id:
9930 * @application: a #GApplication
9932 * Gets the unique identifier for @application.
9934 * Returns: the identifier for @application, owned by @application
9940 * g_application_get_dbus_connection:
9941 * @application: a #GApplication
9943 * Gets the #GDBusConnection being used by the application, or %NULL.
9945 * If #GApplication is using its D-Bus backend then this function will
9946 * return the #GDBusConnection being used for uniqueness and
9947 * communication with the desktop environment and other instances of the
9950 * If #GApplication is not using D-Bus then this function will return
9951 * %NULL. This includes the situation where the D-Bus backend would
9952 * normally be in use but we were unable to connect to the bus.
9954 * This function must not be called before the application has been
9955 * registered. See g_application_get_is_registered().
9957 * Returns: (transfer none): a #GDBusConnection, or %NULL
9963 * g_application_get_dbus_object_path:
9964 * @application: a #GApplication
9966 * Gets the D-Bus object path being used by the application, or %NULL.
9968 * If #GApplication is using its D-Bus backend then this function will
9969 * return the D-Bus object path that #GApplication is using. If the
9970 * application is the primary instance then there is an object published
9971 * at this path. If the application is not the primary instance then
9972 * the result of this function is undefined.
9974 * If #GApplication is not using D-Bus then this function will return
9975 * %NULL. This includes the situation where the D-Bus backend would
9976 * normally be in use but we were unable to connect to the bus.
9978 * This function must not be called before the application has been
9979 * registered. See g_application_get_is_registered().
9981 * Returns: the object path, or %NULL
9987 * g_application_get_default:
9989 * Returns the default #GApplication instance for this process.
9991 * Normally there is only one #GApplication per process and it becomes
9992 * the default when it is created. You can exercise more control over
9993 * this by using g_application_set_default().
9995 * If there is no default application then %NULL is returned.
9997 * Returns: (transfer none): the default application for this process, or %NULL
10003 * g_application_get_flags:
10004 * @application: a #GApplication
10006 * Gets the flags for @application.
10008 * See #GApplicationFlags.
10010 * Returns: the flags for @application
10016 * g_application_get_inactivity_timeout:
10017 * @application: a #GApplication
10019 * Gets the current inactivity timeout for the application.
10021 * This is the amount of time (in milliseconds) after the last call to
10022 * g_application_release() before the application stops running.
10024 * Returns: the timeout, in milliseconds
10030 * g_application_get_is_registered:
10031 * @application: a #GApplication
10033 * Checks if @application is registered.
10035 * An application is registered if g_application_register() has been
10036 * successfully called.
10038 * Returns: %TRUE if @application is registered
10044 * g_application_get_is_remote:
10045 * @application: a #GApplication
10047 * Checks if @application is remote.
10049 * If @application is remote then it means that another instance of
10050 * application already exists (the 'primary' instance). Calls to
10051 * perform actions on @application will result in the actions being
10052 * performed by the primary instance.
10054 * The value of this property cannot be accessed before
10055 * g_application_register() has been called. See
10056 * g_application_get_is_registered().
10058 * Returns: %TRUE if @application is remote
10064 * g_application_hold:
10065 * @application: a #GApplication
10067 * Increases the use count of @application.
10069 * Use this function to indicate that the application has a reason to
10070 * continue to run. For example, g_application_hold() is called by GTK+
10071 * when a toplevel window is on the screen.
10073 * To cancel the hold, call g_application_release().
10078 * g_application_id_is_valid:
10079 * @application_id: a potential application identifier
10081 * Checks if @application_id is a valid application identifier.
10083 * A valid ID is required for calls to g_application_new() and
10084 * g_application_set_application_id().
10086 * For convenience, the restrictions on application identifiers are
10089 * <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-." and must not begin with a digit.</listitem>
10090 * <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least three elements).</listitem>
10091 * <listitem>Application identifiers must not begin or end with a '.' (period) character.</listitem>
10092 * <listitem>Application identifiers must not contain consecutive '.' (period) characters.</listitem>
10093 * <listitem>Application identifiers must not exceed 255 characters.</listitem>
10096 * Returns: %TRUE if @application_id is valid
10101 * g_application_new:
10102 * @application_id: (allow-none): the application id
10103 * @flags: the application flags
10105 * Creates a new #GApplication instance.
10107 * This function calls g_type_init() for you.
10109 * If non-%NULL, the application id must be valid. See
10110 * g_application_id_is_valid().
10112 * If no application ID is given then some features of #GApplication
10113 * (most notably application uniqueness) will be disabled.
10115 * Returns: a new #GApplication instance
10120 * g_application_open:
10121 * @application: a #GApplication
10122 * @files: (array length=n_files): an array of #GFiles to open
10123 * @n_files: the length of the @files array
10124 * @hint: a hint (or ""), but never %NULL
10126 * Opens the given files.
10128 * In essence, this results in the #GApplication::open signal being emitted
10129 * in the primary instance.
10131 * @n_files must be greater than zero.
10133 * @hint is simply passed through to the ::open signal. It is
10134 * intended to be used by applications that have multiple modes for
10135 * opening files (eg: "view" vs "edit", etc). Unless you have a need
10136 * for this functionality, you should use "".
10138 * The application must be registered before calling this function
10139 * and it must have the %G_APPLICATION_HANDLES_OPEN flag set.
10146 * g_application_quit:
10147 * @application: a #GApplication
10149 * Immediately quits the application.
10151 * Upon return to the mainloop, g_application_run() will return,
10152 * calling only the 'shutdown' function before doing so.
10154 * The hold count is ignored.
10156 * The result of calling g_application_run() again after it returns is
10164 * g_application_register:
10165 * @application: a #GApplication
10166 * @cancellable: (allow-none): a #GCancellable, or %NULL
10167 * @error: a pointer to a NULL #GError, or %NULL
10169 * Attempts registration of the application.
10171 * This is the point at which the application discovers if it is the
10172 * primary instance or merely acting as a remote for an already-existing
10173 * primary instance. This is implemented by attempting to acquire the
10174 * application identifier as a unique bus name on the session bus using
10177 * If there is no application ID or if %G_APPLICATION_NON_UNIQUE was
10178 * given, then this process will always become the primary instance.
10180 * Due to the internal architecture of GDBus, method calls can be
10181 * dispatched at any time (even if a main loop is not running). For
10182 * this reason, you must ensure that any object paths that you wish to
10183 * register are registered before calling this function.
10185 * If the application has already been registered then %TRUE is
10186 * returned with no work performed.
10188 * The #GApplication::startup signal is emitted if registration succeeds
10189 * and @application is the primary instance (including the non-unique
10192 * In the event of an error (such as @cancellable being cancelled, or a
10193 * failure to connect to the session bus), %FALSE is returned and @error
10194 * is set appropriately.
10196 * Note: the return value of this function is not an indicator that this
10197 * instance is or is not the primary instance of the application. See
10198 * g_application_get_is_remote() for that.
10200 * Returns: %TRUE if registration succeeded
10206 * g_application_release:
10207 * @application: a #GApplication
10209 * Decrease the use count of @application.
10211 * When the use count reaches zero, the application will stop running.
10213 * Never call this function except to cancel the effect of a previous
10214 * call to g_application_hold().
10219 * g_application_run:
10220 * @application: a #GApplication
10221 * @argc: the argc from main() (or 0 if @argv is %NULL)
10222 * @argv: (array length=argc) (allow-none): the argv from main(), or %NULL
10224 * Runs the application.
10226 * This function is intended to be run from main() and its return value
10227 * is intended to be returned by main(). Although you are expected to pass
10228 * the @argc, @argv parameters from main() to this function, it is possible
10229 * to pass %NULL if @argv is not available or commandline handling is not
10232 * First, the local_command_line() virtual function is invoked.
10233 * This function always runs on the local instance. It gets passed a pointer
10234 * to a %NULL-terminated copy of @argv and is expected to remove the arguments
10235 * that it handled (shifting up remaining arguments). See
10236 * <xref linkend="gapplication-example-cmdline2"/> for an example of
10237 * parsing @argv manually. Alternatively, you may use the #GOptionContext API,
10238 * after setting <literal>argc = g_strv_length (argv);</literal>.
10240 * The last argument to local_command_line() is a pointer to the @status
10241 * variable which can used to set the exit status that is returned from
10242 * g_application_run().
10244 * If local_command_line() returns %TRUE, the command line is expected
10245 * to be completely handled, including possibly registering as the primary
10246 * instance, calling g_application_activate() or g_application_open(), etc.
10248 * If local_command_line() returns %FALSE then the application is registered
10249 * and the #GApplication::command-line signal is emitted in the primary
10250 * instance (which may or may not be this instance). The signal handler
10251 * gets passed a #GApplicationCommandLine object that (among other things)
10252 * contains the remaining commandline arguments that have not been handled
10253 * by local_command_line().
10255 * If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE
10256 * flag set then the default implementation of local_command_line()
10257 * always returns %FALSE immediately, resulting in the commandline
10258 * always being handled in the primary instance.
10260 * Otherwise, the default implementation of local_command_line() tries
10261 * to do a couple of things that are probably reasonable for most
10262 * applications. First, g_application_register() is called to attempt
10263 * to register the application. If that works, then the command line
10264 * arguments are inspected. If no commandline arguments are given, then
10265 * g_application_activate() is called. If commandline arguments are
10266 * given and the %G_APPLICATION_HANDLES_OPEN flag is set then they
10267 * are assumed to be filenames and g_application_open() is called.
10269 * If you need to handle commandline arguments that are not filenames,
10270 * and you don't mind commandline handling to happen in the primary
10271 * instance, you should set %G_APPLICATION_HANDLES_COMMAND_LINE and
10272 * process the commandline arguments in your #GApplication::command-line
10273 * signal handler, either manually or using the #GOptionContext API.
10275 * If you are interested in doing more complicated local handling of the
10276 * commandline then you should implement your own #GApplication subclass
10277 * and override local_command_line(). In this case, you most likely want
10278 * to return %TRUE from your local_command_line() implementation to
10279 * suppress the default handling. See
10280 * <xref linkend="gapplication-example-cmdline2"/> for an example.
10282 * If, after the above is done, the use count of the application is zero
10283 * then the exit status is returned immediately. If the use count is
10284 * non-zero then the default main context is iterated until the use count
10285 * falls to zero, at which point 0 is returned.
10287 * If the %G_APPLICATION_IS_SERVICE flag is set, then the exiting at
10288 * use count of zero is delayed for a while (ie: the instance stays
10289 * around to provide its <emphasis>service</emphasis> to others).
10291 * Returns: the exit status
10297 * g_application_set_action_group:
10298 * @application: a #GApplication
10299 * @action_group: (allow-none): a #GActionGroup, or %NULL
10301 * This used to be how actions were associated with a #GApplication.
10302 * Now there is #GActionMap for that.
10305 * 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.
10310 * g_application_set_application_id:
10311 * @application: a #GApplication
10312 * @application_id: (allow-none): the identifier for @application
10314 * Sets the unique identifier for @application.
10316 * The application id can only be modified if @application has not yet
10319 * If non-%NULL, the application id must be valid. See
10320 * g_application_id_is_valid().
10327 * g_application_set_default:
10328 * @application: (allow-none): the application to set as default, or %NULL
10330 * Sets or unsets the default application for the process, as returned
10331 * by g_application_get_default().
10333 * This function does not take its own reference on @application. If
10334 * @application is destroyed then the default application will revert
10342 * g_application_set_flags:
10343 * @application: a #GApplication
10344 * @flags: the flags for @application
10346 * Sets the flags for @application.
10348 * The flags can only be modified if @application has not yet been
10351 * See #GApplicationFlags.
10358 * g_application_set_inactivity_timeout:
10359 * @application: a #GApplication
10360 * @inactivity_timeout: the timeout, in milliseconds
10362 * Sets the current inactivity timeout for the application.
10364 * This is the amount of time (in milliseconds) after the last call to
10365 * g_application_release() before the application stops running.
10367 * This call has no side effects of its own. The value set here is only
10368 * used for next time g_application_release() drops the use count to
10369 * zero. Any timeouts currently in progress are not impacted.
10376 * g_async_initable_init_async:
10377 * @initable: a #GAsyncInitable.
10378 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10379 * @cancellable: optional #GCancellable object, %NULL to ignore.
10380 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
10381 * @user_data: the data to pass to callback function
10383 * Starts asynchronous initialization of the object implementing the
10384 * interface. This must be done before any real use of the object after
10385 * initial construction. If the object also implements #GInitable you can
10386 * optionally call g_initable_init() instead.
10388 * When the initialization is finished, @callback will be called. You can
10389 * then call g_async_initable_init_finish() to get the result of the
10392 * Implementations may also support cancellation. If @cancellable is not
10393 * %NULL, then initialization can be cancelled by triggering the cancellable
10394 * object from another thread. If the operation was cancelled, the error
10395 * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
10396 * the object doesn't support cancellable initialization, the error
10397 * %G_IO_ERROR_NOT_SUPPORTED will be returned.
10399 * As with #GInitable, if the object is not initialized, or initialization
10400 * returns with an error, then all operations on the object except
10401 * g_object_ref() and g_object_unref() are considered to be invalid, and
10402 * have undefined behaviour. They will often fail with g_critical() or
10403 * g_warning(), but this must not be relied on.
10405 * Implementations of this method must be idempotent: i.e. multiple calls
10406 * to this function with the same argument should return the same results.
10407 * Only the first call initializes the object; further calls return the result
10408 * of the first call. This is so that it's safe to implement the singleton
10409 * pattern in the GObject constructor function.
10411 * For classes that also support the #GInitable interface, the default
10412 * implementation of this method will run the g_initable_init() function
10413 * in a thread, so if you want to support asynchronous initialization via
10414 * threads, just implement the #GAsyncInitable interface without overriding
10415 * any interface methods.
10422 * g_async_initable_init_finish:
10423 * @initable: a #GAsyncInitable.
10424 * @res: a #GAsyncResult.
10425 * @error: a #GError location to store the error occurring, or %NULL to ignore.
10427 * Finishes asynchronous initialization and returns the result.
10428 * See g_async_initable_init_async().
10430 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
10436 * g_async_initable_new_async:
10437 * @object_type: a #GType supporting #GAsyncInitable.
10438 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10439 * @cancellable: optional #GCancellable object, %NULL to ignore.
10440 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10441 * @user_data: the data to pass to callback function
10442 * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
10443 * @...: the value of the first property, followed by other property value pairs, and ended by %NULL.
10445 * Helper function for constructing #GAsyncInitable object. This is
10446 * similar to g_object_new() but also initializes the object asynchronously.
10448 * When the initialization is finished, @callback will be called. You can
10449 * then call g_async_initable_new_finish() to get the new object and check
10457 * g_async_initable_new_finish:
10458 * @initable: the #GAsyncInitable from the callback
10459 * @res: the #GAsyncResult from the callback
10460 * @error: return location for errors, or %NULL to ignore
10462 * Finishes the async construction for the various g_async_initable_new
10463 * calls, returning the created object or %NULL on error.
10465 * Returns: (transfer full): a newly created #GObject, or %NULL on error. Free with g_object_unref().
10471 * g_async_initable_new_valist_async:
10472 * @object_type: a #GType supporting #GAsyncInitable.
10473 * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
10474 * @var_args: The var args list generated from @first_property_name.
10475 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10476 * @cancellable: optional #GCancellable object, %NULL to ignore.
10477 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10478 * @user_data: the data to pass to callback function
10480 * Helper function for constructing #GAsyncInitable object. This is
10481 * similar to g_object_new_valist() but also initializes the object
10484 * When the initialization is finished, @callback will be called. You can
10485 * then call g_async_initable_new_finish() to get the new object and check
10493 * g_async_initable_newv_async:
10494 * @object_type: a #GType supporting #GAsyncInitable.
10495 * @n_parameters: the number of parameters in @parameters
10496 * @parameters: the parameters to use to construct the object
10497 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10498 * @cancellable: optional #GCancellable object, %NULL to ignore.
10499 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10500 * @user_data: the data to pass to callback function
10502 * Helper function for constructing #GAsyncInitable object. This is
10503 * similar to g_object_newv() but also initializes the object asynchronously.
10505 * When the initialization is finished, @callback will be called. You can
10506 * then call g_async_initable_new_finish() to get the new object and check
10514 * g_async_result_get_source_object:
10515 * @res: a #GAsyncResult
10517 * Gets the source object from a #GAsyncResult.
10519 * Returns: (transfer full): a new reference to the source object for the @res, or %NULL if there is none.
10524 * g_async_result_get_user_data:
10525 * @res: a #GAsyncResult.
10527 * Gets the user data from a #GAsyncResult.
10529 * Returns: (transfer full): the user data for @res.
10534 * g_async_result_is_tagged:
10535 * @result: a #GAsyncResult
10536 * @source_tag: an application-defined tag
10538 * Checks if @result has the given @source_tag (generally a function
10539 * pointer indicating the function @result was created by).
10541 * Returns: %TRUE if @result has the indicated @source_tag, %FALSE if not.
10547 * g_async_result_legacy_propagate_error:
10548 * @result: a #GAsyncResult
10549 * @dest: (out): a location to propagate the error to.
10551 * If @result is a #GSimpleAsyncResult, this is equivalent to
10552 * g_simple_async_result_propagate_error(). Otherwise it returns
10555 * This can be used for legacy error handling in async
10556 * <literal>_finish ()</literal> wrapper functions that traditionally
10557 * handled #GSimpleAsyncResult error returns themselves rather than
10558 * calling into the virtual method. This should not be used in new
10559 * code; #GAsyncResult errors that are set by virtual methods should
10560 * also be extracted by virtual methods, to enable subclasses to chain
10563 * Returns: %TRUE if @error is has been filled in with an error from @res, %FALSE if not.
10569 * g_buffered_input_stream_fill:
10570 * @stream: a #GBufferedInputStream
10571 * @count: the number of bytes that will be read from the stream
10572 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10573 * @error: location to store the error occurring, or %NULL to ignore
10575 * Tries to read @count bytes from the stream into the buffer.
10576 * Will block during this read.
10578 * If @count is zero, returns zero and does nothing. A value of @count
10579 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
10581 * On success, the number of bytes read into the buffer is returned.
10582 * It is not an error if this is not the same as the requested size, as it
10583 * can happen e.g. near the end of a file. Zero is returned on end of file
10584 * (or if @count is zero), but never otherwise.
10586 * If @count is -1 then the attempted read size is equal to the number of
10587 * bytes that are required to fill the buffer.
10589 * If @cancellable is not %NULL, then the operation can be cancelled by
10590 * triggering the cancellable object from another thread. If the operation
10591 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
10592 * operation was partially finished when the operation was cancelled the
10593 * partial result will be returned, without an error.
10595 * On error -1 is returned and @error is set accordingly.
10597 * For the asynchronous, non-blocking, version of this function, see
10598 * g_buffered_input_stream_fill_async().
10600 * Returns: the number of bytes read into @stream's buffer, up to @count, or -1 on error.
10605 * g_buffered_input_stream_fill_async:
10606 * @stream: a #GBufferedInputStream
10607 * @count: the number of bytes that will be read from the stream
10608 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
10609 * @cancellable: (allow-none): optional #GCancellable object
10610 * @callback: (scope async): a #GAsyncReadyCallback
10611 * @user_data: (closure): a #gpointer
10613 * Reads data into @stream's buffer asynchronously, up to @count size.
10614 * @io_priority can be used to prioritize reads. For the synchronous
10615 * version of this function, see g_buffered_input_stream_fill().
10617 * If @count is -1 then the attempted read size is equal to the number
10618 * of bytes that are required to fill the buffer.
10623 * g_buffered_input_stream_fill_finish:
10624 * @stream: a #GBufferedInputStream
10625 * @result: a #GAsyncResult
10626 * @error: a #GError
10628 * Finishes an asynchronous read.
10630 * Returns: a #gssize of the read stream, or %-1 on an error.
10635 * g_buffered_input_stream_get_available:
10636 * @stream: #GBufferedInputStream
10638 * Gets the size of the available data within the stream.
10640 * Returns: size of the available stream.
10645 * g_buffered_input_stream_get_buffer_size:
10646 * @stream: a #GBufferedInputStream
10648 * Gets the size of the input buffer.
10650 * Returns: the current buffer size.
10655 * g_buffered_input_stream_new:
10656 * @base_stream: a #GInputStream
10658 * Creates a new #GInputStream from the given @base_stream, with
10659 * a buffer set to the default size (4 kilobytes).
10661 * Returns: a #GInputStream for the given @base_stream.
10666 * g_buffered_input_stream_new_sized:
10667 * @base_stream: a #GInputStream
10670 * Creates a new #GBufferedInputStream from the given @base_stream,
10671 * with a buffer set to @size.
10673 * Returns: a #GInputStream.
10678 * g_buffered_input_stream_peek:
10679 * @stream: a #GBufferedInputStream
10680 * @buffer: (array length=count) (element-type guint8): a pointer to an allocated chunk of memory
10681 * @offset: a #gsize
10684 * Peeks in the buffer, copying data of size @count into @buffer,
10685 * offset @offset bytes.
10687 * Returns: a #gsize of the number of bytes peeked, or -1 on error.
10692 * g_buffered_input_stream_peek_buffer:
10693 * @stream: a #GBufferedInputStream
10694 * @count: (out): a #gsize to get the number of bytes available in the buffer
10696 * Returns the buffer with the currently available bytes. The returned
10697 * buffer must not be modified and will become invalid when reading from
10698 * the stream or filling the buffer.
10700 * Returns: (array length=count) (element-type guint8) (transfer none): read-only buffer
10705 * g_buffered_input_stream_read_byte:
10706 * @stream: a #GBufferedInputStream
10707 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10708 * @error: location to store the error occurring, or %NULL to ignore
10710 * Tries to read a single byte from the stream or the buffer. Will block
10711 * during this read.
10713 * On success, the byte read from the stream is returned. On end of stream
10714 * -1 is returned but it's not an exceptional error and @error is not set.
10716 * If @cancellable is not %NULL, then the operation can be cancelled by
10717 * triggering the cancellable object from another thread. If the operation
10718 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
10719 * operation was partially finished when the operation was cancelled the
10720 * partial result will be returned, without an error.
10722 * On error -1 is returned and @error is set accordingly.
10724 * Returns: the byte read from the @stream, or -1 on end of stream or error.
10729 * g_buffered_input_stream_set_buffer_size:
10730 * @stream: a #GBufferedInputStream
10733 * Sets the size of the internal buffer of @stream to @size, or to the
10734 * size of the contents of the buffer. The buffer can never be resized
10735 * smaller than its current contents.
10740 * g_buffered_output_stream_get_auto_grow:
10741 * @stream: a #GBufferedOutputStream.
10743 * Checks if the buffer automatically grows as data is added.
10745 * Returns: %TRUE if the @stream's buffer automatically grows, %FALSE otherwise.
10750 * g_buffered_output_stream_get_buffer_size:
10751 * @stream: a #GBufferedOutputStream.
10753 * Gets the size of the buffer in the @stream.
10755 * Returns: the current size of the buffer.
10760 * g_buffered_output_stream_new:
10761 * @base_stream: a #GOutputStream.
10763 * Creates a new buffered output stream for a base stream.
10765 * Returns: a #GOutputStream for the given @base_stream.
10770 * g_buffered_output_stream_new_sized:
10771 * @base_stream: a #GOutputStream.
10774 * Creates a new buffered output stream with a given buffer size.
10776 * Returns: a #GOutputStream with an internal buffer set to @size.
10781 * g_buffered_output_stream_set_auto_grow:
10782 * @stream: a #GBufferedOutputStream.
10783 * @auto_grow: a #gboolean.
10785 * Sets whether or not the @stream's buffer should automatically grow.
10786 * If @auto_grow is true, then each write will just make the buffer
10787 * larger, and you must manually flush the buffer to actually write out
10788 * the data to the underlying stream.
10793 * g_buffered_output_stream_set_buffer_size:
10794 * @stream: a #GBufferedOutputStream.
10797 * Sets the size of the internal buffer to @size.
10803 * @bus_type: A #GBusType.
10804 * @cancellable: (allow-none): A #GCancellable or %NULL.
10805 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
10806 * @user_data: The data to pass to @callback.
10808 * Asynchronously connects to the message bus specified by @bus_type.
10810 * When the operation is finished, @callback will be invoked. You can
10811 * then call g_bus_get_finish() to get the result of the operation.
10813 * This is a asynchronous failable function. See g_bus_get_sync() for
10814 * the synchronous version.
10821 * g_bus_get_finish:
10822 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
10823 * @error: Return location for error or %NULL.
10825 * Finishes an operation started with g_bus_get().
10827 * The returned object is a singleton, that is, shared with other
10828 * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10829 * event that you need a private message bus connection, use
10830 * g_dbus_address_get_for_bus_sync() and
10831 * g_dbus_connection_new_for_address().
10833 * Note that the returned #GDBusConnection object will (usually) have
10834 * the #GDBusConnection:exit-on-close property set to %TRUE.
10836 * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10843 * @bus_type: A #GBusType.
10844 * @cancellable: (allow-none): A #GCancellable or %NULL.
10845 * @error: Return location for error or %NULL.
10847 * Synchronously connects to the message bus specified by @bus_type.
10848 * Note that the returned object may shared with other callers,
10849 * e.g. if two separate parts of a process calls this function with
10850 * the same @bus_type, they will share the same object.
10852 * This is a synchronous failable function. See g_bus_get() and
10853 * g_bus_get_finish() for the asynchronous version.
10855 * The returned object is a singleton, that is, shared with other
10856 * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10857 * event that you need a private message bus connection, use
10858 * g_dbus_address_get_for_bus_sync() and
10859 * g_dbus_connection_new_for_address().
10861 * Note that the returned #GDBusConnection object will (usually) have
10862 * the #GDBusConnection:exit-on-close property set to %TRUE.
10864 * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10871 * @bus_type: The type of bus to own a name on.
10872 * @name: The well-known name to own.
10873 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10874 * @bus_acquired_handler: (allow-none): Handler to invoke when connected to the bus of type @bus_type or %NULL.
10875 * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10876 * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10877 * @user_data: User data to pass to handlers.
10878 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10880 * Starts acquiring @name on the bus specified by @bus_type and calls
10881 * @name_acquired_handler and @name_lost_handler when the name is
10882 * acquired respectively lost. Callbacks will be invoked in the <link
10883 * linkend="g-main-context-push-thread-default">thread-default main
10884 * loop</link> of the thread you are calling this function from.
10886 * You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
10887 * callbacks will be invoked after calling this function - there are three
10891 * @name_lost_handler with a %NULL connection (if a connection to the bus can't be made).
10892 * </para></listitem>
10894 * @bus_acquired_handler then @name_lost_handler (if the name can't be obtained)
10895 * </para></listitem>
10897 * @bus_acquired_handler then @name_acquired_handler (if the name was obtained).
10898 * </para></listitem>
10900 * When you are done owning the name, just call g_bus_unown_name()
10901 * with the owner id this function returns.
10903 * If the name is acquired or lost (for example another application
10904 * could acquire the name if you allow replacement or the application
10905 * currently owning the name exits), the handlers are also invoked. If the
10906 * #GDBusConnection that is used for attempting to own the name
10907 * closes, then @name_lost_handler is invoked since it is no
10908 * longer possible for other processes to access the process.
10910 * You cannot use g_bus_own_name() several times for the same name (unless
10911 * interleaved with calls to g_bus_unown_name()) - only the first call
10914 * Another guarantee is that invocations of @name_acquired_handler
10915 * and @name_lost_handler are guaranteed to alternate; that
10916 * is, if @name_acquired_handler is invoked then you are
10917 * guaranteed that the next time one of the handlers is invoked, it
10918 * will be @name_lost_handler. The reverse is also true.
10920 * If you plan on exporting objects (using e.g.
10921 * g_dbus_connection_register_object()), note that it is generally too late
10922 * to export the objects in @name_acquired_handler. Instead, you can do this
10923 * in @bus_acquired_handler since you are guaranteed that this will run
10924 * before @name is requested from the bus.
10926 * This behavior makes it very simple to write applications that wants
10927 * to own names and export objects, see <xref linkend="gdbus-owning-names"/>.
10928 * Simply register objects to be exported in @bus_acquired_handler and
10929 * unregister the objects (if any) in @name_lost_handler.
10931 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10937 * g_bus_own_name_on_connection:
10938 * @connection: A #GDBusConnection.
10939 * @name: The well-known name to own.
10940 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10941 * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10942 * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10943 * @user_data: User data to pass to handlers.
10944 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10946 * Like g_bus_own_name() but takes a #GDBusConnection instead of a
10949 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10955 * g_bus_own_name_on_connection_with_closures:
10956 * @connection: A #GDBusConnection.
10957 * @name: The well-known name to own.
10958 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10959 * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10960 * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10962 * Version of g_bus_own_name_on_connection() using closures instead of callbacks for
10963 * easier binding in other languages.
10965 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10966 * Rename to: g_bus_own_name_on_connection
10972 * g_bus_own_name_with_closures:
10973 * @bus_type: The type of bus to own a name on.
10974 * @name: The well-known name to own.
10975 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10976 * @bus_acquired_closure: (allow-none): #GClosure to invoke when connected to the bus of type @bus_type or %NULL.
10977 * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10978 * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10980 * Version of g_bus_own_name() using closures instead of callbacks for
10981 * easier binding in other languages.
10983 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10984 * Rename to: g_bus_own_name
10990 * g_bus_unown_name:
10991 * @owner_id: An identifier obtained from g_bus_own_name()
10993 * Stops owning a name.
11000 * g_bus_unwatch_name:
11001 * @watcher_id: An identifier obtained from g_bus_watch_name()
11003 * Stops watching a name.
11010 * g_bus_watch_name:
11011 * @bus_type: The type of bus to watch a name on.
11012 * @name: The name (well-known or unique) to watch.
11013 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11014 * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
11015 * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
11016 * @user_data: User data to pass to handlers.
11017 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11019 * Starts watching @name on the bus specified by @bus_type and calls
11020 * @name_appeared_handler and @name_vanished_handler when the name is
11021 * known to have a owner respectively known to lose its
11022 * owner. Callbacks will be invoked in the <link
11023 * linkend="g-main-context-push-thread-default">thread-default main
11024 * loop</link> of the thread you are calling this function from.
11026 * You are guaranteed that one of the handlers will be invoked after
11027 * calling this function. When you are done watching the name, just
11028 * call g_bus_unwatch_name() with the watcher id this function
11031 * If the name vanishes or appears (for example the application owning
11032 * the name could restart), the handlers are also invoked. If the
11033 * #GDBusConnection that is used for watching the name disconnects, then
11034 * @name_vanished_handler is invoked since it is no longer
11035 * possible to access the name.
11037 * Another guarantee is that invocations of @name_appeared_handler
11038 * and @name_vanished_handler are guaranteed to alternate; that
11039 * is, if @name_appeared_handler is invoked then you are
11040 * guaranteed that the next time one of the handlers is invoked, it
11041 * will be @name_vanished_handler. The reverse is also true.
11043 * This behavior makes it very simple to write applications that wants
11044 * to take action when a certain name exists, see <xref
11045 * linkend="gdbus-watching-names"/>. Basically, the application
11046 * should create object proxies in @name_appeared_handler and destroy
11047 * them again (if any) in @name_vanished_handler.
11049 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11055 * g_bus_watch_name_on_connection:
11056 * @connection: A #GDBusConnection.
11057 * @name: The name (well-known or unique) to watch.
11058 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11059 * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
11060 * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
11061 * @user_data: User data to pass to handlers.
11062 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
11064 * Like g_bus_watch_name() but takes a #GDBusConnection instead of a
11067 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11073 * g_bus_watch_name_on_connection_with_closures:
11074 * @connection: A #GDBusConnection.
11075 * @name: The name (well-known or unique) to watch.
11076 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11077 * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
11078 * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
11080 * Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
11081 * easier binding in other languages.
11083 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11084 * Rename to: g_bus_watch_name_on_connection
11090 * g_bus_watch_name_with_closures:
11091 * @bus_type: The type of bus to watch a name on.
11092 * @name: The name (well-known or unique) to watch.
11093 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11094 * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
11095 * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
11097 * Version of g_bus_watch_name() using closures instead of callbacks for
11098 * easier binding in other languages.
11100 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11101 * Rename to: g_bus_watch_name
11107 * g_cancellable_cancel:
11108 * @cancellable: a #GCancellable object.
11110 * Will set @cancellable to cancelled, and will emit the
11111 * #GCancellable::cancelled signal. (However, see the warning about
11112 * race conditions in the documentation for that signal if you are
11113 * planning to connect to it.)
11115 * This function is thread-safe. In other words, you can safely call
11116 * it from a thread other than the one running the operation that was
11117 * passed the @cancellable.
11119 * The convention within gio is that cancelling an asynchronous
11120 * operation causes it to complete asynchronously. That is, if you
11121 * cancel the operation from the same thread in which it is running,
11122 * then the operation's #GAsyncReadyCallback will not be invoked until
11123 * the application returns to the main loop.
11128 * g_cancellable_connect:
11129 * @cancellable: A #GCancellable.
11130 * @callback: The #GCallback to connect.
11131 * @data: Data to pass to @callback.
11132 * @data_destroy_func: (allow-none): Free function for @data or %NULL.
11134 * Convenience function to connect to the #GCancellable::cancelled
11135 * signal. Also handles the race condition that may happen
11136 * if the cancellable is cancelled right before connecting.
11138 * @callback is called at most once, either directly at the
11139 * time of the connect if @cancellable is already cancelled,
11140 * or when @cancellable is cancelled in some thread.
11142 * @data_destroy_func will be called when the handler is
11143 * disconnected, or immediately if the cancellable is already
11146 * See #GCancellable::cancelled for details on how to use this.
11148 * Returns: The id of the signal handler or 0 if @cancellable has already been cancelled.
11154 * g_cancellable_disconnect:
11155 * @cancellable: (allow-none): A #GCancellable or %NULL.
11156 * @handler_id: Handler id of the handler to be disconnected, or %0.
11158 * Disconnects a handler from a cancellable instance similar to
11159 * g_signal_handler_disconnect(). Additionally, in the event that a
11160 * signal handler is currently running, this call will block until the
11161 * handler has finished. Calling this function from a
11162 * #GCancellable::cancelled signal handler will therefore result in a
11165 * This avoids a race condition where a thread cancels at the
11166 * same time as the cancellable operation is finished and the
11167 * signal handler is removed. See #GCancellable::cancelled for
11168 * details on how to use this.
11170 * If @cancellable is %NULL or @handler_id is %0 this function does
11178 * g_cancellable_get_current:
11180 * Gets the top cancellable from the stack.
11182 * Returns: (transfer none): a #GCancellable from the top of the stack, or %NULL if the stack is empty.
11187 * g_cancellable_get_fd:
11188 * @cancellable: a #GCancellable.
11190 * Gets the file descriptor for a cancellable job. This can be used to
11191 * implement cancellable operations on Unix systems. The returned fd will
11192 * turn readable when @cancellable is cancelled.
11194 * You are not supposed to read from the fd yourself, just check for
11195 * readable status. Reading to unset the readable status is done
11196 * with g_cancellable_reset().
11198 * After a successful return from this function, you should use
11199 * g_cancellable_release_fd() to free up resources allocated for
11200 * the returned file descriptor.
11202 * See also g_cancellable_make_pollfd().
11204 * Returns: A valid file descriptor. %-1 if the file descriptor is not supported, or on errors.
11209 * g_cancellable_is_cancelled:
11210 * @cancellable: (allow-none): a #GCancellable or %NULL
11212 * Checks if a cancellable job has been cancelled.
11214 * Returns: %TRUE if @cancellable is cancelled, FALSE if called with %NULL or if item is not cancelled.
11219 * g_cancellable_make_pollfd:
11220 * @cancellable: (allow-none): a #GCancellable or %NULL
11221 * @pollfd: a pointer to a #GPollFD
11223 * Creates a #GPollFD corresponding to @cancellable; this can be passed
11224 * to g_poll() and used to poll for cancellation. This is useful both
11225 * for unix systems without a native poll and for portability to
11228 * When this function returns %TRUE, you should use
11229 * g_cancellable_release_fd() to free up resources allocated for the
11230 * @pollfd. After a %FALSE return, do not call g_cancellable_release_fd().
11232 * If this function returns %FALSE, either no @cancellable was given or
11233 * resource limits prevent this function from allocating the necessary
11234 * structures for polling. (On Linux, you will likely have reached
11235 * the maximum number of file descriptors.) The suggested way to handle
11236 * these cases is to ignore the @cancellable.
11238 * You are not supposed to read from the fd yourself, just check for
11239 * readable status. Reading to unset the readable status is done
11240 * with g_cancellable_reset().
11242 * Returns: %TRUE if @pollfd was successfully initialized, %FALSE on failure to prepare the cancellable.
11248 * g_cancellable_new:
11250 * Creates a new #GCancellable object.
11252 * Applications that want to start one or more operations
11253 * that should be cancellable should create a #GCancellable
11254 * and pass it to the operations.
11256 * One #GCancellable can be used in multiple consecutive
11257 * operations or in multiple concurrent operations.
11259 * Returns: a #GCancellable.
11264 * g_cancellable_pop_current:
11265 * @cancellable: a #GCancellable object
11267 * Pops @cancellable off the cancellable stack (verifying that @cancellable
11268 * is on the top of the stack).
11273 * g_cancellable_push_current:
11274 * @cancellable: a #GCancellable object
11276 * Pushes @cancellable onto the cancellable stack. The current
11277 * cancellable can then be received using g_cancellable_get_current().
11279 * This is useful when implementing cancellable operations in
11280 * code that does not allow you to pass down the cancellable object.
11282 * This is typically called automatically by e.g. #GFile operations,
11283 * so you rarely have to call this yourself.
11288 * g_cancellable_release_fd:
11289 * @cancellable: a #GCancellable
11291 * Releases a resources previously allocated by g_cancellable_get_fd()
11292 * or g_cancellable_make_pollfd().
11294 * For compatibility reasons with older releases, calling this function
11295 * is not strictly required, the resources will be automatically freed
11296 * when the @cancellable is finalized. However, the @cancellable will
11297 * block scarce file descriptors until it is finalized if this function
11298 * is not called. This can cause the application to run out of file
11299 * descriptors when many #GCancellables are used at the same time.
11306 * g_cancellable_reset:
11307 * @cancellable: a #GCancellable object.
11309 * Resets @cancellable to its uncancelled state.
11311 * If cancellable is currently in use by any cancellable operation
11312 * then the behavior of this function is undefined.
11317 * g_cancellable_set_error_if_cancelled:
11318 * @cancellable: (allow-none): a #GCancellable or %NULL
11319 * @error: #GError to append error state to
11321 * If the @cancellable is cancelled, sets the error to notify
11322 * that the operation was cancelled.
11324 * Returns: %TRUE if @cancellable was cancelled, %FALSE if it was not
11329 * g_cancellable_source_new: (skip)
11330 * @cancellable: (allow-none): a #GCancellable, or %NULL
11332 * Creates a source that triggers if @cancellable is cancelled and
11333 * calls its callback of type #GCancellableSourceFunc. This is
11334 * primarily useful for attaching to another (non-cancellable) source
11335 * with g_source_add_child_source() to add cancellability to it.
11337 * For convenience, you can call this with a %NULL #GCancellable,
11338 * in which case the source will never trigger.
11340 * Returns: (transfer full): the new #GSource.
11346 * g_charset_converter_get_num_fallbacks:
11347 * @converter: a #GCharsetConverter
11349 * Gets the number of fallbacks that @converter has applied so far.
11351 * Returns: the number of fallbacks that @converter has applied
11357 * g_charset_converter_get_use_fallback:
11358 * @converter: a #GCharsetConverter
11360 * Gets the #GCharsetConverter:use-fallback property.
11362 * Returns: %TRUE if fallbacks are used by @converter
11368 * g_charset_converter_new:
11369 * @to_charset: destination charset
11370 * @from_charset: source charset
11371 * @error: #GError for error reporting, or %NULL to ignore.
11373 * Creates a new #GCharsetConverter.
11375 * Returns: a new #GCharsetConverter or %NULL on error.
11381 * g_charset_converter_set_use_fallback:
11382 * @converter: a #GCharsetConverter
11383 * @use_fallback: %TRUE to use fallbacks
11385 * Sets the #GCharsetConverter:use-fallback property.
11392 * g_content_type_can_be_executable:
11393 * @type: a content type string
11395 * Checks if a content type can be executable. Note that for instance
11396 * things like text files can be executables (i.e. scripts and batch files).
11398 * Returns: %TRUE if the file type corresponds to a type that can be executable, %FALSE otherwise.
11403 * g_content_type_equals:
11404 * @type1: a content type string
11405 * @type2: a content type string
11407 * Compares two content types for equality.
11409 * Returns: %TRUE if the two strings are identical or equivalent, %FALSE otherwise.
11414 * g_content_type_from_mime_type:
11415 * @mime_type: a mime type string
11417 * Tries to find a content type based on the mime type name.
11419 * Returns: (allow-none): Newly allocated string with content type or %NULL. Free with g_free()
11425 * g_content_type_get_description:
11426 * @type: a content type string
11428 * Gets the human readable description of the content type.
11430 * Returns: a short description of the content type @type. Free the returned string with g_free()
11435 * g_content_type_get_generic_icon_name:
11436 * @type: a content type string
11438 * Gets the generic icon name for a content type.
11440 * See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
11441 * specification for more on the generic icon name.
11443 * Returns: (allow-none): the registered generic icon name for the given @type, or %NULL if unknown. Free with g_free()
11449 * g_content_type_get_icon:
11450 * @type: a content type string
11452 * Gets the icon for a content type.
11454 * Returns: (transfer full): #GIcon corresponding to the content type. Free the returned object with g_object_unref()
11459 * g_content_type_get_mime_type:
11460 * @type: a content type string
11462 * Gets the mime type for the content type, if one is registered.
11464 * Returns: (allow-none): the registered mime type for the given @type, or %NULL if unknown.
11469 * g_content_type_get_symbolic_icon:
11470 * @type: a content type string
11472 * Gets the symbolic icon for a content type.
11474 * Returns: (transfer full): symbolic #GIcon corresponding to the content type. Free the returned object with g_object_unref()
11480 * g_content_type_guess:
11481 * @filename: (allow-none): a string, or %NULL
11482 * @data: (allow-none) (array length=data_size): a stream of data, or %NULL
11483 * @data_size: the size of @data
11484 * @result_uncertain: (allow-none) (out): return location for the certainty of the result, or %NULL
11486 * Guesses the content type based on example data. If the function is
11487 * uncertain, @result_uncertain will be set to %TRUE. Either @filename
11488 * or @data may be %NULL, in which case the guess will be based solely
11489 * on the other argument.
11491 * Returns: a string indicating a guessed content type for the given data. Free with g_free()
11496 * g_content_type_guess_for_tree:
11497 * @root: the root of the tree to guess a type for
11499 * Tries to guess the type of the tree with root @root, by
11500 * looking at the files it contains. The result is an array
11501 * of content types, with the best guess coming first.
11503 * The types returned all have the form x-content/foo, e.g.
11504 * x-content/audio-cdda (for audio CDs) or x-content/image-dcf
11505 * (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
11506 * specification for more on x-content types.
11508 * This function is useful in the implementation of
11509 * g_mount_guess_content_type().
11511 * Returns: (transfer full) (array zero-terminated=1): an %NULL-terminated array of zero or more content types. Free with g_strfreev()
11517 * g_content_type_is_a:
11518 * @type: a content type string
11519 * @supertype: a content type string
11521 * Determines if @type is a subset of @supertype.
11523 * Returns: %TRUE if @type is a kind of @supertype, %FALSE otherwise.
11528 * g_content_type_is_unknown:
11529 * @type: a content type string
11531 * Checks if the content type is the generic "unknown" type.
11532 * On UNIX this is the "application/octet-stream" mimetype,
11533 * while on win32 it is "*".
11535 * Returns: %TRUE if the type is the unknown type.
11540 * g_content_types_get_registered:
11542 * Gets a list of strings containing all the registered content types
11543 * known to the system. The list and its data should be freed using
11545 * g_list_free_full (list, g_free);
11546 * </programlisting>
11548 * Returns: (element-type utf8) (transfer full): #GList of the registered content types
11553 * g_converter_convert:
11554 * @converter: a #GConverter.
11555 * @inbuf: (array length=inbuf_size) (element-type guint8): the buffer containing the data to convert.
11556 * @inbuf_size: the number of bytes in @inbuf
11557 * @outbuf: a buffer to write converted data in.
11558 * @outbuf_size: the number of bytes in @outbuf, must be at least one
11559 * @flags: a #GConverterFlags controlling the conversion details
11560 * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success
11561 * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success
11562 * @error: location to store the error occurring, or %NULL to ignore
11564 * This is the main operation used when converting data. It is to be called
11565 * multiple times in a loop, and each time it will do some work, i.e.
11566 * producing some output (in @outbuf) or consuming some input (from @inbuf) or
11567 * both. If its not possible to do any work an error is returned.
11569 * Note that a single call may not consume all input (or any input at all).
11570 * Also a call may produce output even if given no input, due to state stored
11571 * in the converter producing output.
11573 * If any data was either produced or consumed, and then an error happens, then
11574 * only the successful conversion is reported and the error is returned on the
11577 * A full conversion loop involves calling this method repeatedly, each time
11578 * giving it new input and space output space. When there is no more input
11579 * data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
11580 * The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
11581 * each time until all data is consumed and all output is produced, then
11582 * %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
11583 * may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
11584 * in a decompression converter where the end of data is detectable from the
11585 * data (and there might even be other data after the end of the compressed data).
11587 * When some data has successfully been converted @bytes_read and is set to
11588 * the number of bytes read from @inbuf, and @bytes_written is set to indicate
11589 * how many bytes was written to @outbuf. If there are more data to output
11590 * or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
11591 * %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
11592 * then %G_CONVERTER_FINISHED is returned.
11594 * On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
11595 * Some errors need special handling:
11597 * %G_IO_ERROR_NO_SPACE is returned if there is not enough space
11598 * to write the resulting converted data, the application should
11599 * call the function again with a larger @outbuf to continue.
11601 * %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
11602 * input to fully determine what the conversion should produce,
11603 * and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
11604 * example with an incomplete multibyte sequence when converting text,
11605 * or when a regexp matches up to the end of the input (and may match
11606 * further input). It may also happen when @inbuf_size is zero and
11607 * there is no more data to produce.
11609 * When this happens the application should read more input and then
11610 * call the function again. If further input shows that there is no
11611 * more data call the function again with the same data but with
11612 * the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
11613 * to finish as e.g. in the regexp match case (or, to fail again with
11614 * %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
11615 * input is actually partial).
11617 * After g_converter_convert() has returned %G_CONVERTER_FINISHED the
11618 * converter object is in an invalid state where its not allowed
11619 * to call g_converter_convert() anymore. At this time you can only
11620 * free the object or call g_converter_reset() to reset it to the
11623 * If the flag %G_CONVERTER_FLUSH is set then conversion is modified
11624 * to try to write out all internal state to the output. The application
11625 * has to call the function multiple times with the flag set, and when
11626 * the available input has been consumed and all internal state has
11627 * been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
11628 * really at the end) is returned instead of %G_CONVERTER_CONVERTED.
11629 * This is somewhat similar to what happens at the end of the input stream,
11630 * but done in the middle of the data.
11632 * This has different meanings for different conversions. For instance
11633 * in a compression converter it would mean that we flush all the
11634 * compression state into output such that if you uncompress the
11635 * compressed data you get back all the input data. Doing this may
11636 * make the final file larger due to padding though. Another example
11637 * is a regexp conversion, where if you at the end of the flushed data
11638 * have a match, but there is also a potential longer match. In the
11639 * non-flushed case we would ask for more input, but when flushing we
11640 * treat this as the end of input and do the match.
11642 * Flushing is not always possible (like if a charset converter flushes
11643 * at a partial multibyte sequence). Converters are supposed to try
11644 * to produce as much output as possible and then return an error
11645 * (typically %G_IO_ERROR_PARTIAL_INPUT).
11647 * Returns: a #GConverterResult, %G_CONVERTER_ERROR on error.
11653 * g_converter_input_stream_get_converter:
11654 * @converter_stream: a #GConverterInputStream
11656 * Gets the #GConverter that is used by @converter_stream.
11658 * Returns: (transfer none): the converter of the converter input stream
11664 * g_converter_input_stream_new:
11665 * @base_stream: a #GInputStream
11666 * @converter: a #GConverter
11668 * Creates a new converter input stream for the @base_stream.
11670 * Returns: a new #GInputStream.
11675 * g_converter_output_stream_get_converter:
11676 * @converter_stream: a #GConverterOutputStream
11678 * Gets the #GConverter that is used by @converter_stream.
11680 * Returns: (transfer none): the converter of the converter output stream
11686 * g_converter_output_stream_new:
11687 * @base_stream: a #GOutputStream
11688 * @converter: a #GConverter
11690 * Creates a new converter output stream for the @base_stream.
11692 * Returns: a new #GOutputStream.
11697 * g_converter_reset:
11698 * @converter: a #GConverter.
11700 * Resets all internal state in the converter, making it behave
11701 * as if it was just created. If the converter has any internal
11702 * state that would produce output then that output is lost.
11709 * g_credentials_get_native: (skip)
11710 * @credentials: A #GCredentials.
11711 * @native_type: The type of native credentials to get.
11713 * Gets a pointer to native credentials of type @native_type from
11716 * It is a programming error (which will cause an warning to be
11717 * logged) to use this method if there is no #GCredentials support for
11718 * the OS or if @native_type isn't supported by the OS.
11720 * 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.
11726 * g_credentials_get_unix_user:
11727 * @credentials: A #GCredentials
11728 * @error: Return location for error or %NULL.
11730 * Tries to get the UNIX user identifier from @credentials. This
11731 * method is only available on UNIX platforms.
11733 * This operation can fail if #GCredentials is not supported on the
11734 * OS or if the native credentials type does not contain information
11735 * about the UNIX user.
11737 * Returns: The UNIX user identifier or -1 if @error is set.
11743 * g_credentials_is_same_user:
11744 * @credentials: A #GCredentials.
11745 * @other_credentials: A #GCredentials.
11746 * @error: Return location for error or %NULL.
11748 * Checks if @credentials and @other_credentials is the same user.
11750 * This operation can fail if #GCredentials is not supported on the
11753 * Returns: %TRUE if @credentials and @other_credentials has the same user, %FALSE otherwise or if @error is set.
11759 * g_credentials_new:
11761 * Creates a new #GCredentials object with credentials matching the
11762 * the current process.
11764 * Returns: A #GCredentials. Free with g_object_unref().
11770 * g_credentials_set_native:
11771 * @credentials: A #GCredentials.
11772 * @native_type: The type of native credentials to set.
11773 * @native: A pointer to native credentials.
11775 * Copies the native credentials of type @native_type from @native
11776 * into @credentials.
11778 * It is a programming error (which will cause an warning to be
11779 * logged) to use this method if there is no #GCredentials support for
11780 * the OS or if @native_type isn't supported by the OS.
11787 * g_credentials_set_unix_user:
11788 * @credentials: A #GCredentials.
11789 * @uid: The UNIX user identifier to set.
11790 * @error: Return location for error or %NULL.
11792 * Tries to set the UNIX user identifier on @credentials. This method
11793 * is only available on UNIX platforms.
11795 * This operation can fail if #GCredentials is not supported on the
11796 * OS or if the native credentials type does not contain information
11797 * about the UNIX user.
11799 * Returns: %TRUE if @uid was set, %FALSE if error is set.
11805 * g_credentials_to_string:
11806 * @credentials: A #GCredentials object.
11808 * Creates a human-readable textual representation of @credentials
11809 * that can be used in logging and debug messages. The format of the
11810 * returned string may change in future GLib release.
11812 * Returns: A string that should be freed with g_free().
11818 * g_data_input_stream_get_byte_order:
11819 * @stream: a given #GDataInputStream.
11821 * Gets the byte order for the data input stream.
11823 * Returns: the @stream's current #GDataStreamByteOrder.
11828 * g_data_input_stream_get_newline_type:
11829 * @stream: a given #GDataInputStream.
11831 * Gets the current newline type for the @stream.
11833 * Returns: #GDataStreamNewlineType for the given @stream.
11838 * g_data_input_stream_new:
11839 * @base_stream: a #GInputStream.
11841 * Creates a new data input stream for the @base_stream.
11843 * Returns: a new #GDataInputStream.
11848 * g_data_input_stream_read_byte:
11849 * @stream: a given #GDataInputStream.
11850 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11851 * @error: #GError for error reporting.
11853 * Reads an unsigned 8-bit/1-byte value from @stream.
11855 * Returns: an unsigned 8-bit/1-byte value read from the @stream or %0 if an error occurred.
11860 * g_data_input_stream_read_int16:
11861 * @stream: a given #GDataInputStream.
11862 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11863 * @error: #GError for error reporting.
11865 * Reads a 16-bit/2-byte value from @stream.
11867 * In order to get the correct byte order for this read operation,
11868 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11870 * Returns: a signed 16-bit/2-byte value read from @stream or %0 if an error occurred.
11875 * g_data_input_stream_read_int32:
11876 * @stream: a given #GDataInputStream.
11877 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11878 * @error: #GError for error reporting.
11880 * Reads a signed 32-bit/4-byte value from @stream.
11882 * In order to get the correct byte order for this read operation,
11883 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11885 * If @cancellable is not %NULL, then the operation can be cancelled by
11886 * triggering the cancellable object from another thread. If the operation
11887 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11889 * Returns: a signed 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11894 * g_data_input_stream_read_int64:
11895 * @stream: a given #GDataInputStream.
11896 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11897 * @error: #GError for error reporting.
11899 * Reads a 64-bit/8-byte value from @stream.
11901 * In order to get the correct byte order for this read operation,
11902 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11904 * If @cancellable is not %NULL, then the operation can be cancelled by
11905 * triggering the cancellable object from another thread. If the operation
11906 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11908 * Returns: a signed 64-bit/8-byte value read from @stream or %0 if an error occurred.
11913 * g_data_input_stream_read_line:
11914 * @stream: a given #GDataInputStream.
11915 * @length: (out): a #gsize to get the length of the data read in.
11916 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11917 * @error: #GError for error reporting.
11919 * Reads a line from the data input stream. Note that no encoding
11920 * checks or conversion is performed; the input is not guaranteed to
11921 * be UTF-8, and may in fact have embedded NUL characters.
11923 * If @cancellable is not %NULL, then the operation can be cancelled by
11924 * triggering the cancellable object from another thread. If the operation
11925 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11927 * 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.
11932 * g_data_input_stream_read_line_async:
11933 * @stream: a given #GDataInputStream.
11934 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11935 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11936 * @callback: (scope async): callback to call when the request is satisfied.
11937 * @user_data: (closure): the data to pass to callback function.
11939 * The asynchronous version of g_data_input_stream_read_line(). It is
11940 * an error to have two outstanding calls to this function.
11942 * When the operation is finished, @callback will be called. You
11943 * can then call g_data_input_stream_read_line_finish() to get
11944 * the result of the operation.
11951 * g_data_input_stream_read_line_finish:
11952 * @stream: a given #GDataInputStream.
11953 * @result: the #GAsyncResult that was provided to the callback.
11954 * @length: (out): a #gsize to get the length of the data read in.
11955 * @error: #GError for error reporting.
11957 * Finish an asynchronous call started by
11958 * g_data_input_stream_read_line_async(). Note the warning about
11959 * string encoding in g_data_input_stream_read_line() applies here as
11962 * 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.
11968 * g_data_input_stream_read_line_finish_utf8:
11969 * @stream: a given #GDataInputStream.
11970 * @result: the #GAsyncResult that was provided to the callback.
11971 * @length: (out): a #gsize to get the length of the data read in.
11972 * @error: #GError for error reporting.
11974 * Finish an asynchronous call started by
11975 * g_data_input_stream_read_line_async().
11977 * 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.
11983 * g_data_input_stream_read_line_utf8:
11984 * @stream: a given #GDataInputStream.
11985 * @length: (out): a #gsize to get the length of the data read in.
11986 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11987 * @error: #GError for error reporting.
11989 * Reads a UTF-8 encoded line from the data input stream.
11991 * If @cancellable is not %NULL, then the operation can be cancelled by
11992 * triggering the cancellable object from another thread. If the operation
11993 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11995 * 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.
12001 * g_data_input_stream_read_uint16:
12002 * @stream: a given #GDataInputStream.
12003 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12004 * @error: #GError for error reporting.
12006 * Reads an unsigned 16-bit/2-byte value from @stream.
12008 * In order to get the correct byte order for this read operation,
12009 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12011 * Returns: an unsigned 16-bit/2-byte value read from the @stream or %0 if an error occurred.
12016 * g_data_input_stream_read_uint32:
12017 * @stream: a given #GDataInputStream.
12018 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12019 * @error: #GError for error reporting.
12021 * Reads an unsigned 32-bit/4-byte value from @stream.
12023 * In order to get the correct byte order for this read operation,
12024 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12026 * If @cancellable is not %NULL, then the operation can be cancelled by
12027 * triggering the cancellable object from another thread. If the operation
12028 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12030 * Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred.
12035 * g_data_input_stream_read_uint64:
12036 * @stream: a given #GDataInputStream.
12037 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12038 * @error: #GError for error reporting.
12040 * Reads an unsigned 64-bit/8-byte value from @stream.
12042 * In order to get the correct byte order for this read operation,
12043 * see g_data_input_stream_get_byte_order().
12045 * If @cancellable is not %NULL, then the operation can be cancelled by
12046 * triggering the cancellable object from another thread. If the operation
12047 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12049 * Returns: an unsigned 64-bit/8-byte read from @stream or %0 if an error occurred.
12054 * g_data_input_stream_read_until:
12055 * @stream: a given #GDataInputStream.
12056 * @stop_chars: characters to terminate the read.
12057 * @length: (out): a #gsize to get the length of the data read in.
12058 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12059 * @error: #GError for error reporting.
12061 * Reads a string from the data input stream, up to the first
12062 * occurrence of any of the stop characters.
12064 * Note that, in contrast to g_data_input_stream_read_until_async(),
12065 * this function consumes the stop character that it finds.
12067 * Don't use this function in new code. Its functionality is
12068 * inconsistent with g_data_input_stream_read_until_async(). Both
12069 * functions will be marked as deprecated in a future release. Use
12070 * g_data_input_stream_read_upto() instead, but note that that function
12071 * does not consume the stop character.
12073 * 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.
12078 * g_data_input_stream_read_until_async:
12079 * @stream: a given #GDataInputStream.
12080 * @stop_chars: characters to terminate the read.
12081 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12082 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12083 * @callback: (scope async): callback to call when the request is satisfied.
12084 * @user_data: (closure): the data to pass to callback function.
12086 * The asynchronous version of g_data_input_stream_read_until().
12087 * It is an error to have two outstanding calls to this function.
12089 * Note that, in contrast to g_data_input_stream_read_until(),
12090 * this function does not consume the stop character that it finds. You
12091 * must read it for yourself.
12093 * When the operation is finished, @callback will be called. You
12094 * can then call g_data_input_stream_read_until_finish() to get
12095 * the result of the operation.
12097 * Don't use this function in new code. Its functionality is
12098 * inconsistent with g_data_input_stream_read_until(). Both functions
12099 * will be marked as deprecated in a future release. Use
12100 * g_data_input_stream_read_upto_async() instead.
12107 * g_data_input_stream_read_until_finish:
12108 * @stream: a given #GDataInputStream.
12109 * @result: the #GAsyncResult that was provided to the callback.
12110 * @length: (out): a #gsize to get the length of the data read in.
12111 * @error: #GError for error reporting.
12113 * Finish an asynchronous call started by
12114 * g_data_input_stream_read_until_async().
12117 * 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.
12122 * g_data_input_stream_read_upto:
12123 * @stream: a #GDataInputStream
12124 * @stop_chars: characters to terminate the read
12125 * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12126 * @length: (out): a #gsize to get the length of the data read in
12127 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12128 * @error: #GError for error reporting
12130 * Reads a string from the data input stream, up to the first
12131 * occurrence of any of the stop characters.
12133 * In contrast to g_data_input_stream_read_until(), this function
12134 * does <emphasis>not</emphasis> consume the stop character. You have
12135 * to use g_data_input_stream_read_byte() to get it before calling
12136 * g_data_input_stream_read_upto() again.
12138 * Note that @stop_chars may contain '\0' if @stop_chars_len is
12141 * 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
12147 * g_data_input_stream_read_upto_async:
12148 * @stream: a #GDataInputStream
12149 * @stop_chars: characters to terminate the read
12150 * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12151 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12152 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12153 * @callback: (scope async): callback to call when the request is satisfied
12154 * @user_data: (closure): the data to pass to callback function
12156 * The asynchronous version of g_data_input_stream_read_upto().
12157 * It is an error to have two outstanding calls to this function.
12159 * In contrast to g_data_input_stream_read_until(), this function
12160 * does <emphasis>not</emphasis> consume the stop character. You have
12161 * to use g_data_input_stream_read_byte() to get it before calling
12162 * g_data_input_stream_read_upto() again.
12164 * Note that @stop_chars may contain '\0' if @stop_chars_len is
12167 * When the operation is finished, @callback will be called. You
12168 * can then call g_data_input_stream_read_upto_finish() to get
12169 * the result of the operation.
12176 * g_data_input_stream_read_upto_finish:
12177 * @stream: a #GDataInputStream
12178 * @result: the #GAsyncResult that was provided to the callback
12179 * @length: (out): a #gsize to get the length of the data read in
12180 * @error: #GError for error reporting
12182 * Finish an asynchronous call started by
12183 * g_data_input_stream_read_upto_async().
12185 * Note that this function does <emphasis>not</emphasis> consume the
12186 * stop character. You have to use g_data_input_stream_read_byte() to
12187 * get it before calling g_data_input_stream_read_upto_async() again.
12189 * 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.
12195 * g_data_input_stream_set_byte_order:
12196 * @stream: a given #GDataInputStream.
12197 * @order: a #GDataStreamByteOrder to set.
12199 * This function sets the byte order for the given @stream. All subsequent
12200 * reads from the @stream will be read in the given @order.
12205 * g_data_input_stream_set_newline_type:
12206 * @stream: a #GDataInputStream.
12207 * @type: the type of new line return as #GDataStreamNewlineType.
12209 * Sets the newline type for the @stream.
12211 * Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
12212 * chunk ends in "CR" we must read an additional byte to know if this is "CR" or
12213 * "CR LF", and this might block if there is no more data available.
12218 * g_data_output_stream_get_byte_order:
12219 * @stream: a #GDataOutputStream.
12221 * Gets the byte order for the stream.
12223 * Returns: the #GDataStreamByteOrder for the @stream.
12228 * g_data_output_stream_new:
12229 * @base_stream: a #GOutputStream.
12231 * Creates a new data output stream for @base_stream.
12233 * Returns: #GDataOutputStream.
12238 * g_data_output_stream_put_byte:
12239 * @stream: a #GDataOutputStream.
12240 * @data: a #guchar.
12241 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12242 * @error: a #GError, %NULL to ignore.
12244 * Puts a byte into the output stream.
12246 * Returns: %TRUE if @data was successfully added to the @stream.
12251 * g_data_output_stream_put_int16:
12252 * @stream: a #GDataOutputStream.
12253 * @data: a #gint16.
12254 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12255 * @error: a #GError, %NULL to ignore.
12257 * Puts a signed 16-bit integer into the output stream.
12259 * Returns: %TRUE if @data was successfully added to the @stream.
12264 * g_data_output_stream_put_int32:
12265 * @stream: a #GDataOutputStream.
12266 * @data: a #gint32.
12267 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12268 * @error: a #GError, %NULL to ignore.
12270 * Puts a signed 32-bit integer into the output stream.
12272 * Returns: %TRUE if @data was successfully added to the @stream.
12277 * g_data_output_stream_put_int64:
12278 * @stream: a #GDataOutputStream.
12279 * @data: a #gint64.
12280 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12281 * @error: a #GError, %NULL to ignore.
12283 * Puts a signed 64-bit integer into the stream.
12285 * Returns: %TRUE if @data was successfully added to the @stream.
12290 * g_data_output_stream_put_string:
12291 * @stream: a #GDataOutputStream.
12293 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12294 * @error: a #GError, %NULL to ignore.
12296 * Puts a string into the output stream.
12298 * Returns: %TRUE if @string was successfully added to the @stream.
12303 * g_data_output_stream_put_uint16:
12304 * @stream: a #GDataOutputStream.
12305 * @data: a #guint16.
12306 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12307 * @error: a #GError, %NULL to ignore.
12309 * Puts an unsigned 16-bit integer into the output stream.
12311 * Returns: %TRUE if @data was successfully added to the @stream.
12316 * g_data_output_stream_put_uint32:
12317 * @stream: a #GDataOutputStream.
12318 * @data: a #guint32.
12319 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12320 * @error: a #GError, %NULL to ignore.
12322 * Puts an unsigned 32-bit integer into the stream.
12324 * Returns: %TRUE if @data was successfully added to the @stream.
12329 * g_data_output_stream_put_uint64:
12330 * @stream: a #GDataOutputStream.
12331 * @data: a #guint64.
12332 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12333 * @error: a #GError, %NULL to ignore.
12335 * Puts an unsigned 64-bit integer into the stream.
12337 * Returns: %TRUE if @data was successfully added to the @stream.
12342 * g_data_output_stream_set_byte_order:
12343 * @stream: a #GDataOutputStream.
12344 * @order: a %GDataStreamByteOrder.
12346 * Sets the byte order of the data output stream to @order.
12351 * g_dbus_action_group_get:
12352 * @connection: A #GDBusConnection
12353 * @bus_name: the bus name which exports the action group
12354 * @object_path: the object path at which the action group is exported
12356 * Obtains a #GDBusActionGroup for the action group which is exported at
12357 * the given @bus_name and @object_path.
12359 * The thread default main context is taken at the time of this call.
12360 * All signals on the menu model (and any linked models) are reported
12361 * with respect to this context. All calls on the returned menu model
12362 * (and linked models) must also originate from this same context, with
12363 * the thread default main context unchanged.
12365 * This call is non-blocking. The returned action group may or may not
12366 * already be filled in. The correct thing to do is connect the signals
12367 * for the action group to monitor for changes and then to call
12368 * g_action_group_list_actions() to get the initial list.
12370 * Returns: (transfer full): a #GDBusActionGroup
12376 * g_dbus_address_get_for_bus_sync:
12377 * @bus_type: A #GBusType.
12378 * @cancellable: (allow-none): A #GCancellable or %NULL.
12379 * @error: Return location for error or %NULL.
12381 * Synchronously looks up the D-Bus address for the well-known message
12382 * bus instance specified by @bus_type. This may involve using various
12383 * platform specific mechanisms.
12385 * Returns: A valid D-Bus address string for @bus_type or %NULL if @error is set.
12391 * g_dbus_address_get_stream:
12392 * @address: A valid D-Bus address.
12393 * @cancellable: (allow-none): A #GCancellable or %NULL.
12394 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12395 * @user_data: Data to pass to @callback.
12397 * Asynchronously connects to an endpoint specified by @address and
12398 * sets up the connection so it is in a state to run the client-side
12399 * of the D-Bus authentication conversation.
12401 * When the operation is finished, @callback will be invoked. You can
12402 * then call g_dbus_address_get_stream_finish() to get the result of
12405 * This is an asynchronous failable function. See
12406 * g_dbus_address_get_stream_sync() for the synchronous version.
12413 * g_dbus_address_get_stream_finish:
12414 * @res: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
12415 * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12416 * @error: Return location for error or %NULL.
12418 * Finishes an operation started with g_dbus_address_get_stream().
12420 * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12426 * g_dbus_address_get_stream_sync:
12427 * @address: A valid D-Bus address.
12428 * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12429 * @cancellable: (allow-none): A #GCancellable or %NULL.
12430 * @error: Return location for error or %NULL.
12432 * Synchronously connects to an endpoint specified by @address and
12433 * sets up the connection so it is in a state to run the client-side
12434 * of the D-Bus authentication conversation.
12436 * This is a synchronous failable function. See
12437 * g_dbus_address_get_stream() for the asynchronous version.
12439 * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12445 * g_dbus_annotation_info_lookup:
12446 * @annotations: (array zero-terminated=1) (allow-none): A %NULL-terminated array of annotations or %NULL.
12447 * @name: The name of the annotation to look up.
12449 * Looks up the value of an annotation.
12451 * This cost of this function is O(n) in number of annotations.
12453 * Returns: The value or %NULL if not found. Do not free, it is owned by @annotations.
12459 * g_dbus_annotation_info_ref:
12460 * @info: A #GDBusNodeInfo
12462 * If @info is statically allocated does nothing. Otherwise increases
12463 * the reference count.
12465 * Returns: The same @info.
12471 * g_dbus_annotation_info_unref:
12472 * @info: A #GDBusAnnotationInfo.
12474 * If @info is statically allocated, does nothing. Otherwise decreases
12475 * the reference count of @info. When its reference count drops to 0,
12476 * the memory used is freed.
12483 * g_dbus_arg_info_ref:
12484 * @info: A #GDBusArgInfo
12486 * If @info is statically allocated does nothing. Otherwise increases
12487 * the reference count.
12489 * Returns: The same @info.
12495 * g_dbus_arg_info_unref:
12496 * @info: A #GDBusArgInfo.
12498 * If @info is statically allocated, does nothing. Otherwise decreases
12499 * the reference count of @info. When its reference count drops to 0,
12500 * the memory used is freed.
12507 * g_dbus_auth_observer_allow_mechanism:
12508 * @observer: A #GDBusAuthObserver.
12509 * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
12511 * Emits the #GDBusAuthObserver::allow-mechanism signal on @observer.
12513 * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
12519 * g_dbus_auth_observer_authorize_authenticated_peer:
12520 * @observer: A #GDBusAuthObserver.
12521 * @stream: A #GIOStream for the #GDBusConnection.
12522 * @credentials: (allow-none): Credentials received from the peer or %NULL.
12524 * Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
12526 * Returns: %TRUE if the peer is authorized, %FALSE if not.
12532 * g_dbus_auth_observer_new:
12534 * Creates a new #GDBusAuthObserver object.
12536 * Returns: A #GDBusAuthObserver. Free with g_object_unref().
12542 * g_dbus_connection_add_filter:
12543 * @connection: A #GDBusConnection.
12544 * @filter_function: A filter function.
12545 * @user_data: User data to pass to @filter_function.
12546 * @user_data_free_func: Function to free @user_data with when filter is removed or %NULL.
12548 * Adds a message filter. Filters are handlers that are run on all
12549 * incoming and outgoing messages, prior to standard dispatch. Filters
12550 * are run in the order that they were added. The same handler can be
12551 * added as a filter more than once, in which case it will be run more
12552 * than once. Filters added during a filter callback won't be run on
12553 * the message being processed. Filter functions are allowed to modify
12554 * and even drop messages.
12556 * Note that filters are run in a dedicated message handling thread so
12557 * they can't block and, generally, can't do anything but signal a
12558 * worker thread. Also note that filters are rarely needed - use API
12559 * such as g_dbus_connection_send_message_with_reply(),
12560 * g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
12562 * If a filter consumes an incoming message the message is not
12563 * dispatched anywhere else - not even the standard dispatch machinery
12564 * (that API such as g_dbus_connection_signal_subscribe() and
12565 * g_dbus_connection_send_message_with_reply() relies on) will see the
12566 * message. Similary, if a filter consumes an outgoing message, the
12567 * message will not be sent to the other peer.
12569 * Returns: A filter identifier that can be used with g_dbus_connection_remove_filter().
12575 * g_dbus_connection_call:
12576 * @connection: A #GDBusConnection.
12577 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12578 * @object_path: Path of remote object.
12579 * @interface_name: D-Bus interface to invoke method on.
12580 * @method_name: The name of the method to invoke.
12581 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12582 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12583 * @flags: Flags from the #GDBusCallFlags enumeration.
12584 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12585 * @cancellable: (allow-none): A #GCancellable or %NULL.
12586 * @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.
12587 * @user_data: The data to pass to @callback.
12589 * Asynchronously invokes the @method_name method on the
12590 * @interface_name D-Bus interface on the remote object at
12591 * @object_path owned by @bus_name.
12593 * If @connection is closed then the operation will fail with
12594 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
12595 * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
12596 * not compatible with the D-Bus protocol, the operation fails with
12597 * %G_IO_ERROR_INVALID_ARGUMENT.
12599 * If @reply_type is non-%NULL then the reply will be checked for having this type and an
12600 * error will be raised if it does not match. Said another way, if you give a @reply_type
12601 * then any non-%NULL return value will be of this type.
12603 * If the @parameters #GVariant is floating, it is consumed. This allows
12604 * convenient 'inline' use of g_variant_new(), e.g.:
12606 * g_dbus_connection_call (connection,
12607 * "org.freedesktop.StringThings",
12608 * "/org/freedesktop/StringThings",
12609 * "org.freedesktop.StringThings",
12611 * g_variant_new ("(ss)",
12615 * G_DBUS_CALL_FLAGS_NONE,
12618 * (GAsyncReadyCallback) two_strings_done,
12622 * This is an asynchronous method. When the operation is finished, @callback will be invoked
12623 * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
12624 * of the thread you are calling this method from. You can then call
12625 * g_dbus_connection_call_finish() to get the result of the operation.
12626 * See g_dbus_connection_call_sync() for the synchronous version of this
12629 * If @callback is %NULL then the D-Bus method call message will be sent with
12630 * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
12637 * g_dbus_connection_call_finish:
12638 * @connection: A #GDBusConnection.
12639 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
12640 * @error: Return location for error or %NULL.
12642 * Finishes an operation started with g_dbus_connection_call().
12644 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12650 * g_dbus_connection_call_sync:
12651 * @connection: A #GDBusConnection.
12652 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12653 * @object_path: Path of remote object.
12654 * @interface_name: D-Bus interface to invoke method on.
12655 * @method_name: The name of the method to invoke.
12656 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12657 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12658 * @flags: Flags from the #GDBusCallFlags enumeration.
12659 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12660 * @cancellable: (allow-none): A #GCancellable or %NULL.
12661 * @error: Return location for error or %NULL.
12663 * Synchronously invokes the @method_name method on the
12664 * @interface_name D-Bus interface on the remote object at
12665 * @object_path owned by @bus_name.
12667 * If @connection is closed then the operation will fail with
12668 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
12669 * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
12670 * contains a value not compatible with the D-Bus protocol, the operation
12671 * fails with %G_IO_ERROR_INVALID_ARGUMENT.
12673 * If @reply_type is non-%NULL then the reply will be checked for having
12674 * this type and an error will be raised if it does not match. Said
12675 * another way, if you give a @reply_type then any non-%NULL return
12676 * value will be of this type.
12678 * If the @parameters #GVariant is floating, it is consumed.
12679 * This allows convenient 'inline' use of g_variant_new(), e.g.:
12681 * g_dbus_connection_call_sync (connection,
12682 * "org.freedesktop.StringThings",
12683 * "/org/freedesktop/StringThings",
12684 * "org.freedesktop.StringThings",
12686 * g_variant_new ("(ss)",
12690 * G_DBUS_CALL_FLAGS_NONE,
12696 * The calling thread is blocked until a reply is received. See
12697 * g_dbus_connection_call() for the asynchronous version of
12700 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12706 * g_dbus_connection_call_with_unix_fd_list:
12707 * @connection: A #GDBusConnection.
12708 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12709 * @object_path: Path of remote object.
12710 * @interface_name: D-Bus interface to invoke method on.
12711 * @method_name: The name of the method to invoke.
12712 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12713 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12714 * @flags: Flags from the #GDBusCallFlags enumeration.
12715 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12716 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12717 * @cancellable: (allow-none): A #GCancellable or %NULL.
12718 * @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.
12719 * @user_data: The data to pass to @callback.
12721 * Like g_dbus_connection_call() but also takes a #GUnixFDList object.
12723 * This method is only available on UNIX.
12730 * g_dbus_connection_call_with_unix_fd_list_finish:
12731 * @connection: A #GDBusConnection.
12732 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12733 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
12734 * @error: Return location for error or %NULL.
12736 * Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
12738 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12744 * g_dbus_connection_call_with_unix_fd_list_sync:
12745 * @connection: A #GDBusConnection.
12746 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12747 * @object_path: Path of remote object.
12748 * @interface_name: D-Bus interface to invoke method on.
12749 * @method_name: The name of the method to invoke.
12750 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12751 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12752 * @flags: Flags from the #GDBusCallFlags enumeration.
12753 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12754 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12755 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12756 * @cancellable: (allow-none): A #GCancellable or %NULL.
12757 * @error: Return location for error or %NULL.
12759 * Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
12761 * This method is only available on UNIX.
12763 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12769 * g_dbus_connection_close:
12770 * @connection: A #GDBusConnection.
12771 * @cancellable: (allow-none): A #GCancellable or %NULL.
12772 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12773 * @user_data: The data to pass to @callback.
12775 * Closes @connection. Note that this never causes the process to
12776 * exit (this might only happen if the other end of a shared message
12777 * bus connection disconnects, see #GDBusConnection:exit-on-close).
12779 * Once the connection is closed, operations such as sending a message
12780 * will return with the error %G_IO_ERROR_CLOSED. Closing a connection
12781 * will not automatically flush the connection so queued messages may
12782 * be lost. Use g_dbus_connection_flush() if you need such guarantees.
12784 * If @connection is already closed, this method fails with
12785 * %G_IO_ERROR_CLOSED.
12787 * When @connection has been closed, the #GDBusConnection::closed
12788 * signal is emitted in the <link
12789 * linkend="g-main-context-push-thread-default">thread-default main
12790 * loop</link> of the thread that @connection was constructed in.
12792 * This is an asynchronous method. When the operation is finished,
12793 * @callback will be invoked in the <link
12794 * linkend="g-main-context-push-thread-default">thread-default main
12795 * loop</link> of the thread you are calling this method from. You can
12796 * then call g_dbus_connection_close_finish() to get the result of the
12797 * operation. See g_dbus_connection_close_sync() for the synchronous
12805 * g_dbus_connection_close_finish:
12806 * @connection: A #GDBusConnection.
12807 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
12808 * @error: Return location for error or %NULL.
12810 * Finishes an operation started with g_dbus_connection_close().
12812 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12818 * g_dbus_connection_close_sync:
12819 * @connection: A #GDBusConnection.
12820 * @cancellable: (allow-none): A #GCancellable or %NULL.
12821 * @error: Return location for error or %NULL.
12823 * Synchronously closees @connection. The calling thread is blocked
12824 * until this is done. See g_dbus_connection_close() for the
12825 * asynchronous version of this method and more details about what it
12828 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12834 * g_dbus_connection_emit_signal:
12835 * @connection: A #GDBusConnection.
12836 * @destination_bus_name: (allow-none): The unique bus name for the destination for the signal or %NULL to emit to all listeners.
12837 * @object_path: Path of remote object.
12838 * @interface_name: D-Bus interface to emit a signal on.
12839 * @signal_name: The name of the signal to emit.
12840 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
12841 * @error: Return location for error or %NULL.
12845 * If the parameters GVariant is floating, it is consumed.
12847 * This can only fail if @parameters is not compatible with the D-Bus protocol.
12849 * Returns: %TRUE unless @error is set.
12855 * g_dbus_connection_export_action_group:
12856 * @connection: a #GDBusConnection
12857 * @object_path: a D-Bus object path
12858 * @action_group: a #GActionGroup
12859 * @error: a pointer to a %NULL #GError, or %NULL
12861 * Exports @action_group on @connection at @object_path.
12863 * The implemented D-Bus API should be considered private. It is
12864 * subject to change in the future.
12866 * A given object path can only have one action group exported on it.
12867 * If this constraint is violated, the export will fail and 0 will be
12868 * returned (with @error set accordingly).
12870 * You can unexport the action group using
12871 * g_dbus_connection_unexport_action_group() with the return value of
12874 * The thread default main context is taken at the time of this call.
12875 * All incoming action activations and state change requests are
12876 * reported from this context. Any changes on the action group that
12877 * cause it to emit signals must also come from this same context.
12878 * Since incoming action activations and state change requests are
12879 * rather likely to cause changes on the action group, this effectively
12880 * limits a given action group to being exported from only one main
12883 * Returns: the ID of the export (never zero), or 0 in case of failure
12889 * g_dbus_connection_export_menu_model:
12890 * @connection: a #GDBusConnection
12891 * @object_path: a D-Bus object path
12892 * @menu: a #GMenuModel
12893 * @error: return location for an error, or %NULL
12895 * Exports @menu on @connection at @object_path.
12897 * The implemented D-Bus API should be considered private.
12898 * It is subject to change in the future.
12900 * An object path can only have one action group exported on it. If this
12901 * constraint is violated, the export will fail and 0 will be
12902 * returned (with @error set accordingly).
12904 * You can unexport the menu model using
12905 * g_dbus_connection_unexport_menu_model() with the return value of
12908 * Returns: the ID of the export (never zero), or 0 in case of failure
12914 * g_dbus_connection_flush:
12915 * @connection: A #GDBusConnection.
12916 * @cancellable: (allow-none): A #GCancellable or %NULL.
12917 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12918 * @user_data: The data to pass to @callback.
12920 * Asynchronously flushes @connection, that is, writes all queued
12921 * outgoing message to the transport and then flushes the transport
12922 * (using g_output_stream_flush_async()). This is useful in programs
12923 * that wants to emit a D-Bus signal and then exit
12924 * immediately. Without flushing the connection, there is no guarantee
12925 * that the message has been sent to the networking buffers in the OS
12928 * This is an asynchronous method. When the operation is finished,
12929 * @callback will be invoked in the <link
12930 * linkend="g-main-context-push-thread-default">thread-default main
12931 * loop</link> of the thread you are calling this method from. You can
12932 * then call g_dbus_connection_flush_finish() to get the result of the
12933 * operation. See g_dbus_connection_flush_sync() for the synchronous
12941 * g_dbus_connection_flush_finish:
12942 * @connection: A #GDBusConnection.
12943 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
12944 * @error: Return location for error or %NULL.
12946 * Finishes an operation started with g_dbus_connection_flush().
12948 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12954 * g_dbus_connection_flush_sync:
12955 * @connection: A #GDBusConnection.
12956 * @cancellable: (allow-none): A #GCancellable or %NULL.
12957 * @error: Return location for error or %NULL.
12959 * Synchronously flushes @connection. The calling thread is blocked
12960 * until this is done. See g_dbus_connection_flush() for the
12961 * asynchronous version of this method and more details about what it
12964 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12970 * g_dbus_connection_get_capabilities:
12971 * @connection: A #GDBusConnection.
12973 * Gets the capabilities negotiated with the remote peer
12975 * Returns: Zero or more flags from the #GDBusCapabilityFlags enumeration.
12981 * g_dbus_connection_get_exit_on_close:
12982 * @connection: A #GDBusConnection.
12984 * Gets whether the process is terminated when @connection is
12985 * closed by the remote peer. See
12986 * #GDBusConnection:exit-on-close for more details.
12988 * Returns: Whether the process is terminated when @connection is closed by the remote peer.
12994 * g_dbus_connection_get_guid:
12995 * @connection: A #GDBusConnection.
12997 * The GUID of the peer performing the role of server when
12998 * authenticating. See #GDBusConnection:guid for more details.
13000 * Returns: The GUID. Do not free this string, it is owned by @connection.
13006 * g_dbus_connection_get_last_serial:
13007 * @connection: A #GDBusConnection.
13009 * Retrieves the last serial number assigned to a #GDBusMessage on
13010 * the current thread. This includes messages sent via both low-level
13011 * API such as g_dbus_connection_send_message() as well as
13012 * high-level API such as g_dbus_connection_emit_signal(),
13013 * g_dbus_connection_call() or g_dbus_proxy_call().
13015 * Returns: the last used serial or zero when no message has been sent within the current thread.
13021 * g_dbus_connection_get_peer_credentials:
13022 * @connection: A #GDBusConnection.
13024 * Gets the credentials of the authenticated peer. This will always
13025 * return %NULL unless @connection acted as a server
13026 * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
13027 * when set up and the client passed credentials as part of the
13028 * authentication process.
13030 * In a message bus setup, the message bus is always the server and
13031 * each application is a client. So this method will always return
13032 * %NULL for message bus clients.
13034 * Returns: (transfer none): A #GCredentials or %NULL if not available. Do not free this object, it is owned by @connection.
13040 * g_dbus_connection_get_stream:
13041 * @connection: a #GDBusConnection
13043 * Gets the underlying stream used for IO.
13045 * While the #GDBusConnection is active, it will interact with this
13046 * stream from a worker thread, so it is not safe to interact with
13047 * the stream directly.
13049 * Returns: (transfer none): the stream used for IO
13055 * g_dbus_connection_get_unique_name:
13056 * @connection: A #GDBusConnection.
13058 * Gets the unique name of @connection as assigned by the message
13059 * bus. This can also be used to figure out if @connection is a
13060 * message bus connection.
13062 * Returns: The unique name or %NULL if @connection is not a message bus connection. Do not free this string, it is owned by @connection.
13068 * g_dbus_connection_is_closed:
13069 * @connection: A #GDBusConnection.
13071 * Gets whether @connection is closed.
13073 * Returns: %TRUE if the connection is closed, %FALSE otherwise.
13079 * g_dbus_connection_new:
13080 * @stream: A #GIOStream.
13081 * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13082 * @flags: Flags describing how to make the connection.
13083 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13084 * @cancellable: (allow-none): A #GCancellable or %NULL.
13085 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13086 * @user_data: The data to pass to @callback.
13088 * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
13089 * with the end represented by @stream.
13091 * If @stream is a #GSocketConnection, then the corresponding #GSocket
13092 * will be put into non-blocking mode.
13094 * The D-Bus connection will interact with @stream from a worker thread.
13095 * As a result, the caller should not interact with @stream after this
13096 * method has been called, except by calling g_object_unref() on it.
13098 * If @observer is not %NULL it may be used to control the
13099 * authentication process.
13101 * When the operation is finished, @callback will be invoked. You can
13102 * then call g_dbus_connection_new_finish() to get the result of the
13105 * This is a asynchronous failable constructor. See
13106 * g_dbus_connection_new_sync() for the synchronous
13114 * g_dbus_connection_new_finish:
13115 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13116 * @error: Return location for error or %NULL.
13118 * Finishes an operation started with g_dbus_connection_new().
13120 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13126 * g_dbus_connection_new_for_address:
13127 * @address: A D-Bus address.
13128 * @flags: Flags describing how to make the connection.
13129 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13130 * @cancellable: (allow-none): A #GCancellable or %NULL.
13131 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13132 * @user_data: The data to pass to @callback.
13134 * Asynchronously connects and sets up a D-Bus client connection for
13135 * exchanging D-Bus messages with an endpoint specified by @address
13136 * which must be in the D-Bus address format.
13138 * This constructor can only be used to initiate client-side
13139 * connections - use g_dbus_connection_new() if you need to act as the
13140 * server. In particular, @flags cannot contain the
13141 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13142 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13144 * When the operation is finished, @callback will be invoked. You can
13145 * then call g_dbus_connection_new_finish() to get the result of the
13148 * If @observer is not %NULL it may be used to control the
13149 * authentication process.
13151 * This is a asynchronous failable constructor. See
13152 * g_dbus_connection_new_for_address_sync() for the synchronous
13160 * g_dbus_connection_new_for_address_finish:
13161 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13162 * @error: Return location for error or %NULL.
13164 * Finishes an operation started with g_dbus_connection_new_for_address().
13166 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13172 * g_dbus_connection_new_for_address_sync:
13173 * @address: A D-Bus address.
13174 * @flags: Flags describing how to make the connection.
13175 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13176 * @cancellable: (allow-none): A #GCancellable or %NULL.
13177 * @error: Return location for error or %NULL.
13179 * Synchronously connects and sets up a D-Bus client connection for
13180 * exchanging D-Bus messages with an endpoint specified by @address
13181 * which must be in the D-Bus address format.
13183 * This constructor can only be used to initiate client-side
13184 * connections - use g_dbus_connection_new_sync() if you need to act
13185 * as the server. In particular, @flags cannot contain the
13186 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13187 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13189 * This is a synchronous failable constructor. See
13190 * g_dbus_connection_new_for_address() for the asynchronous version.
13192 * If @observer is not %NULL it may be used to control the
13193 * authentication process.
13195 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13201 * g_dbus_connection_new_sync:
13202 * @stream: A #GIOStream.
13203 * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13204 * @flags: Flags describing how to make the connection.
13205 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13206 * @cancellable: (allow-none): A #GCancellable or %NULL.
13207 * @error: Return location for error or %NULL.
13209 * Synchronously sets up a D-Bus connection for exchanging D-Bus messages
13210 * with the end represented by @stream.
13212 * If @stream is a #GSocketConnection, then the corresponding #GSocket
13213 * will be put into non-blocking mode.
13215 * The D-Bus connection will interact with @stream from a worker thread.
13216 * As a result, the caller should not interact with @stream after this
13217 * method has been called, except by calling g_object_unref() on it.
13219 * If @observer is not %NULL it may be used to control the
13220 * authentication process.
13222 * This is a synchronous failable constructor. See
13223 * g_dbus_connection_new() for the asynchronous version.
13225 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13231 * g_dbus_connection_register_object:
13232 * @connection: A #GDBusConnection.
13233 * @object_path: The object path to register at.
13234 * @interface_info: Introspection data for the interface.
13235 * @vtable: (allow-none): A #GDBusInterfaceVTable to call into or %NULL.
13236 * @user_data: (allow-none): Data to pass to functions in @vtable.
13237 * @user_data_free_func: Function to call when the object path is unregistered.
13238 * @error: Return location for error or %NULL.
13240 * Registers callbacks for exported objects at @object_path with the
13241 * D-Bus interface that is described in @interface_info.
13243 * Calls to functions in @vtable (and @user_data_free_func) will
13244 * happen in the <link linkend="g-main-context-push-thread-default">thread-default main
13245 * loop</link> of the thread you are calling this method from.
13247 * Note that all #GVariant values passed to functions in @vtable will match
13248 * the signature given in @interface_info - if a remote caller passes
13249 * incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
13250 * is returned to the remote caller.
13252 * Additionally, if the remote caller attempts to invoke methods or
13253 * access properties not mentioned in @interface_info the
13254 * <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
13255 * <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
13256 * are returned to the caller.
13258 * It is considered a programming error if the
13259 * #GDBusInterfaceGetPropertyFunc function in @vtable returns a
13260 * #GVariant of incorrect type.
13262 * If an existing callback is already registered at @object_path and
13263 * @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
13265 * GDBus automatically implements the standard D-Bus interfaces
13266 * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
13267 * and org.freedesktop.Peer, so you don't have to implement those for
13268 * the objects you export. You <emphasis>can</emphasis> implement
13269 * org.freedesktop.DBus.Properties yourself, e.g. to handle getting
13270 * and setting of properties asynchronously.
13272 * Note that the reference count on @interface_info will be
13273 * incremented by 1 (unless allocated statically, e.g. if the
13274 * reference count is -1, see g_dbus_interface_info_ref()) for as long
13275 * as the object is exported. Also note that @vtable will be copied.
13277 * See <xref linkend="gdbus-server"/> for an example of how to use this method.
13279 * Returns: 0 if @error is set, otherwise a registration id (never 0) that can be used with g_dbus_connection_unregister_object() .
13285 * g_dbus_connection_register_subtree:
13286 * @connection: A #GDBusConnection.
13287 * @object_path: The object path to register the subtree at.
13288 * @vtable: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
13289 * @flags: Flags used to fine tune the behavior of the subtree.
13290 * @user_data: Data to pass to functions in @vtable.
13291 * @user_data_free_func: Function to call when the subtree is unregistered.
13292 * @error: Return location for error or %NULL.
13294 * Registers a whole subtree of <quote>dynamic</quote> objects.
13296 * The @enumerate and @introspection functions in @vtable are used to
13297 * convey, to remote callers, what nodes exist in the subtree rooted
13300 * When handling remote calls into any node in the subtree, first the
13301 * @enumerate function is used to check if the node exists. If the node exists
13302 * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
13303 * the @introspection function is used to check if the node supports the
13304 * requested method. If so, the @dispatch function is used to determine
13305 * where to dispatch the call. The collected #GDBusInterfaceVTable and
13306 * #gpointer will be used to call into the interface vtable for processing
13309 * All calls into user-provided code will be invoked in the <link
13310 * linkend="g-main-context-push-thread-default">thread-default main
13311 * loop</link> of the thread you are calling this method from.
13313 * If an existing subtree is already registered at @object_path or
13314 * then @error is set to #G_IO_ERROR_EXISTS.
13316 * Note that it is valid to register regular objects (using
13317 * g_dbus_connection_register_object()) in a subtree registered with
13318 * g_dbus_connection_register_subtree() - if so, the subtree handler
13319 * is tried as the last resort. One way to think about a subtree
13320 * handler is to consider it a <quote>fallback handler</quote>
13321 * for object paths not registered via g_dbus_connection_register_object()
13322 * or other bindings.
13324 * Note that @vtable will be copied so you cannot change it after
13327 * See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
13329 * Returns: 0 if @error is set, otherwise a subtree registration id (never 0) that can be used with g_dbus_connection_unregister_subtree() .
13335 * g_dbus_connection_remove_filter:
13336 * @connection: a #GDBusConnection
13337 * @filter_id: an identifier obtained from g_dbus_connection_add_filter()
13339 * Removes a filter.
13346 * g_dbus_connection_send_message:
13347 * @connection: A #GDBusConnection.
13348 * @message: A #GDBusMessage
13349 * @flags: Flags affecting how the message is sent.
13350 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13351 * @error: Return location for error or %NULL.
13353 * Asynchronously sends @message to the peer represented by @connection.
13355 * Unless @flags contain the
13356 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13357 * will be assigned by @connection and set on @message via
13358 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13359 * serial number used will be written to this location prior to
13360 * submitting the message to the underlying transport.
13362 * If @connection is closed then the operation will fail with
13363 * %G_IO_ERROR_CLOSED. If @message is not well-formed,
13364 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13366 * See <xref linkend="gdbus-server"/> and <xref
13367 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13368 * low-level API to send and receive UNIX file descriptors.
13370 * Note that @message must be unlocked, unless @flags contain the
13371 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13373 * Returns: %TRUE if the message was well-formed and queued for transmission, %FALSE if @error is set.
13379 * g_dbus_connection_send_message_with_reply:
13380 * @connection: A #GDBusConnection.
13381 * @message: A #GDBusMessage.
13382 * @flags: Flags affecting how the message is sent.
13383 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13384 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13385 * @cancellable: (allow-none): A #GCancellable or %NULL.
13386 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13387 * @user_data: The data to pass to @callback.
13389 * Asynchronously sends @message to the peer represented by @connection.
13391 * Unless @flags contain the
13392 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13393 * will be assigned by @connection and set on @message via
13394 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13395 * serial number used will be written to this location prior to
13396 * submitting the message to the underlying transport.
13398 * If @connection is closed then the operation will fail with
13399 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13400 * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13401 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13403 * This is an asynchronous method. When the operation is finished, @callback will be invoked
13404 * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13405 * of the thread you are calling this method from. You can then call
13406 * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
13407 * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
13409 * Note that @message must be unlocked, unless @flags contain the
13410 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13412 * See <xref linkend="gdbus-server"/> and <xref
13413 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13414 * low-level API to send and receive UNIX file descriptors.
13421 * g_dbus_connection_send_message_with_reply_finish:
13422 * @connection: a #GDBusConnection
13423 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
13424 * @error: Return location for error or %NULL.
13426 * Finishes an operation started with g_dbus_connection_send_message_with_reply().
13428 * Note that @error is only set if a local in-process error
13429 * occurred. That is to say that the returned #GDBusMessage object may
13430 * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13431 * g_dbus_message_to_gerror() to transcode this to a #GError.
13433 * See <xref linkend="gdbus-server"/> and <xref
13434 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13435 * low-level API to send and receive UNIX file descriptors.
13437 * Returns: (transfer full): A locked #GDBusMessage or %NULL if @error is set.
13443 * g_dbus_connection_send_message_with_reply_sync:
13444 * @connection: A #GDBusConnection.
13445 * @message: A #GDBusMessage.
13446 * @flags: Flags affecting how the message is sent.
13447 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13448 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13449 * @cancellable: (allow-none): A #GCancellable or %NULL.
13450 * @error: Return location for error or %NULL.
13452 * Synchronously sends @message to the peer represented by @connection
13453 * and blocks the calling thread until a reply is received or the
13454 * timeout is reached. See g_dbus_connection_send_message_with_reply()
13455 * for the asynchronous version of this method.
13457 * Unless @flags contain the
13458 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13459 * will be assigned by @connection and set on @message via
13460 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13461 * serial number used will be written to this location prior to
13462 * submitting the message to the underlying transport.
13464 * If @connection is closed then the operation will fail with
13465 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13466 * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13467 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13469 * Note that @error is only set if a local in-process error
13470 * occurred. That is to say that the returned #GDBusMessage object may
13471 * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13472 * g_dbus_message_to_gerror() to transcode this to a #GError.
13474 * See <xref linkend="gdbus-server"/> and <xref
13475 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13476 * low-level API to send and receive UNIX file descriptors.
13478 * Note that @message must be unlocked, unless @flags contain the
13479 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13481 * Returns: (transfer full): A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
13487 * g_dbus_connection_set_exit_on_close:
13488 * @connection: A #GDBusConnection.
13489 * @exit_on_close: Whether the process should be terminated when @connection is closed by the remote peer.
13491 * Sets whether the process should be terminated when @connection is
13492 * closed by the remote peer. See #GDBusConnection:exit-on-close for
13495 * Note that this function should be used with care. Most modern UNIX
13496 * desktops tie the notion of a user session the session bus, and expect
13497 * all of a users applications to quit when their bus connection goes away.
13498 * If you are setting @exit_on_close to %FALSE for the shared session
13499 * bus connection, you should make sure that your application exits
13500 * when the user session ends.
13507 * g_dbus_connection_signal_subscribe:
13508 * @connection: A #GDBusConnection.
13509 * @sender: (allow-none): Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
13510 * @interface_name: (allow-none): D-Bus interface name to match on or %NULL to match on all interfaces.
13511 * @member: (allow-none): D-Bus signal name to match on or %NULL to match on all signals.
13512 * @object_path: (allow-none): Object path to match on or %NULL to match on all object paths.
13513 * @arg0: (allow-none): Contents of first string argument to match on or %NULL to match on all kinds of arguments.
13514 * @flags: Flags describing how to subscribe to the signal (currently unused).
13515 * @callback: Callback to invoke when there is a signal matching the requested data.
13516 * @user_data: User data to pass to @callback.
13517 * @user_data_free_func: (allow-none): Function to free @user_data with when subscription is removed or %NULL.
13519 * Subscribes to signals on @connection and invokes @callback with a
13520 * whenever the signal is received. Note that @callback
13521 * will be invoked in the <link
13522 * linkend="g-main-context-push-thread-default">thread-default main
13523 * loop</link> of the thread you are calling this method from.
13525 * If @connection is not a message bus connection, @sender must be
13528 * If @sender is a well-known name note that @callback is invoked with
13529 * the unique name for the owner of @sender, not the well-known name
13530 * as one would expect. This is because the message bus rewrites the
13531 * name. As such, to avoid certain race conditions, users should be
13532 * tracking the name owner of the well-known name and use that when
13533 * processing the received signal.
13535 * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
13541 * g_dbus_connection_signal_unsubscribe:
13542 * @connection: A #GDBusConnection.
13543 * @subscription_id: A subscription id obtained from g_dbus_connection_signal_subscribe().
13545 * Unsubscribes from signals.
13552 * g_dbus_connection_start_message_processing:
13553 * @connection: A #GDBusConnection.
13555 * If @connection was created with
13556 * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
13557 * starts processing messages. Does nothing on if @connection wasn't
13558 * created with this flag or if the method has already been called.
13565 * g_dbus_connection_unexport_action_group:
13566 * @connection: a #GDBusConnection
13567 * @export_id: the ID from g_dbus_connection_export_action_group()
13569 * Reverses the effect of a previous call to
13570 * g_dbus_connection_export_action_group().
13572 * It is an error to call this function with an ID that wasn't returned
13573 * from g_dbus_connection_export_action_group() or to call it with the
13574 * same ID more than once.
13581 * g_dbus_connection_unexport_menu_model:
13582 * @connection: a #GDBusConnection
13583 * @export_id: the ID from g_dbus_connection_export_menu_model()
13585 * Reverses the effect of a previous call to
13586 * g_dbus_connection_export_menu_model().
13588 * It is an error to call this function with an ID that wasn't returned
13589 * from g_dbus_connection_export_menu_model() or to call it with the
13590 * same ID more than once.
13597 * g_dbus_connection_unregister_object:
13598 * @connection: A #GDBusConnection.
13599 * @registration_id: A registration id obtained from g_dbus_connection_register_object().
13601 * Unregisters an object.
13603 * Returns: %TRUE if the object was unregistered, %FALSE otherwise.
13609 * g_dbus_connection_unregister_subtree:
13610 * @connection: A #GDBusConnection.
13611 * @registration_id: A subtree registration id obtained from g_dbus_connection_register_subtree().
13613 * Unregisters a subtree.
13615 * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise.
13621 * g_dbus_error_encode_gerror:
13622 * @error: A #GError.
13624 * Creates a D-Bus error name to use for @error. If @error matches
13625 * a registered error (cf. g_dbus_error_register_error()), the corresponding
13626 * D-Bus error name will be returned.
13628 * Otherwise the a name of the form
13629 * <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
13630 * will be used. This allows other GDBus applications to map the error
13631 * on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
13633 * This function is typically only used in object mappings to put a
13634 * #GError on the wire. Regular applications should not use it.
13636 * Returns: A D-Bus error name (never %NULL). Free with g_free().
13642 * g_dbus_error_get_remote_error:
13643 * @error: A #GError.
13645 * Gets the D-Bus error name used for @error, if any.
13647 * This function is guaranteed to return a D-Bus error name for all
13648 * #GError<!-- -->s returned from functions handling remote method
13649 * calls (e.g. g_dbus_connection_call_finish()) unless
13650 * g_dbus_error_strip_remote_error() has been used on @error.
13652 * Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
13658 * g_dbus_error_is_remote_error:
13659 * @error: A #GError.
13661 * Checks if @error represents an error received via D-Bus from a remote peer. If so,
13662 * use g_dbus_error_get_remote_error() to get the name of the error.
13664 * Returns: %TRUE if @error represents an error from a remote peer, %FALSE otherwise.
13670 * g_dbus_error_new_for_dbus_error:
13671 * @dbus_error_name: D-Bus error name.
13672 * @dbus_error_message: D-Bus error message.
13674 * Creates a #GError based on the contents of @dbus_error_name and
13675 * @dbus_error_message.
13677 * Errors registered with g_dbus_error_register_error() will be looked
13678 * up using @dbus_error_name and if a match is found, the error domain
13679 * and code is used. Applications can use g_dbus_error_get_remote_error()
13680 * to recover @dbus_error_name.
13682 * If a match against a registered error is not found and the D-Bus
13683 * error name is in a form as returned by g_dbus_error_encode_gerror()
13684 * the error domain and code encoded in the name is used to
13685 * create the #GError. Also, @dbus_error_name is added to the error message
13686 * such that it can be recovered with g_dbus_error_get_remote_error().
13688 * Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
13689 * in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
13690 * added to the error message such that it can be recovered with
13691 * g_dbus_error_get_remote_error().
13693 * In all three cases, @dbus_error_name can always be recovered from the
13694 * returned #GError using the g_dbus_error_get_remote_error() function
13695 * (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
13697 * This function is typically only used in object mappings to prepare
13698 * #GError instances for applications. Regular applications should not use
13701 * Returns: An allocated #GError. Free with g_error_free().
13707 * g_dbus_error_register_error:
13708 * @error_domain: A #GQuark for a error domain.
13709 * @error_code: An error code.
13710 * @dbus_error_name: A D-Bus error name.
13712 * Creates an association to map between @dbus_error_name and
13713 * #GError<!-- -->s specified by @error_domain and @error_code.
13715 * This is typically done in the routine that returns the #GQuark for
13718 * Returns: %TRUE if the association was created, %FALSE if it already exists.
13724 * g_dbus_error_register_error_domain:
13725 * @error_domain_quark_name: The error domain name.
13726 * @quark_volatile: A pointer where to store the #GQuark.
13727 * @entries: A pointer to @num_entries #GDBusErrorEntry struct items.
13728 * @num_entries: Number of items to register.
13730 * Helper function for associating a #GError error domain with D-Bus error names.
13737 * g_dbus_error_set_dbus_error:
13738 * @error: A pointer to a #GError or %NULL.
13739 * @dbus_error_name: D-Bus error name.
13740 * @dbus_error_message: D-Bus error message.
13741 * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13742 * @...: Arguments for @format.
13744 * Does nothing if @error is %NULL. Otherwise sets *@error to
13745 * a new #GError created with g_dbus_error_new_for_dbus_error()
13746 * with @dbus_error_message prepend with @format (unless %NULL).
13753 * g_dbus_error_set_dbus_error_valist:
13754 * @error: A pointer to a #GError or %NULL.
13755 * @dbus_error_name: D-Bus error name.
13756 * @dbus_error_message: D-Bus error message.
13757 * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13758 * @var_args: Arguments for @format.
13760 * Like g_dbus_error_set_dbus_error() but intended for language bindings.
13767 * g_dbus_error_strip_remote_error:
13768 * @error: A #GError.
13770 * Looks for extra information in the error message used to recover
13771 * the D-Bus error name and strips it if found. If stripped, the
13772 * message field in @error will correspond exactly to what was
13773 * received on the wire.
13775 * This is typically used when presenting errors to the end user.
13777 * Returns: %TRUE if information was stripped, %FALSE otherwise.
13783 * g_dbus_error_unregister_error:
13784 * @error_domain: A #GQuark for a error domain.
13785 * @error_code: An error code.
13786 * @dbus_error_name: A D-Bus error name.
13788 * Destroys an association previously set up with g_dbus_error_register_error().
13790 * Returns: %TRUE if the association was destroyed, %FALSE if it wasn't found.
13796 * g_dbus_generate_guid:
13798 * Generate a D-Bus GUID that can be used with
13799 * e.g. g_dbus_connection_new().
13801 * See the D-Bus specification regarding what strings are valid D-Bus
13802 * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
13804 * Returns: A valid D-Bus GUID. Free with g_free().
13810 * g_dbus_gvalue_to_gvariant:
13811 * @gvalue: A #GValue to convert to a #GVariant.
13812 * @type: A #GVariantType.
13814 * Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
13816 * The conversion is using the following rules:
13817 * <table frame='all'>
13818 * <title>#GValue / #GVariant conversion rules</title>
13819 * <tgroup cols='2' align='left' colsep='1' rowsep='1'>
13822 * <entry>If the #GType for @gvalue is...</entry>
13823 * <entry>... then @type must be</entry>
13828 * <entry>#G_TYPE_STRING</entry>
13829 * <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>
13832 * <entry>#G_TYPE_STRV</entry>
13833 * <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>
13836 * <entry>#G_TYPE_BOOLEAN</entry>
13837 * <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
13840 * <entry>#G_TYPE_UCHAR</entry>
13841 * <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
13844 * <entry>#G_TYPE_INT</entry>
13845 * <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
13848 * <entry>#G_TYPE_UINT</entry>
13849 * <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
13852 * <entry>#G_TYPE_INT64</entry>
13853 * <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
13856 * <entry>#G_TYPE_UINT64</entry>
13857 * <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
13860 * <entry>#G_TYPE_DOUBLE</entry>
13861 * <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
13864 * <entry>#G_TYPE_VARIANT</entry>
13865 * <entry>Any #GVariantType</entry>
13870 * This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
13871 * is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
13872 * also fail for any #GType (including e.g. #G_TYPE_OBJECT and
13873 * #G_TYPE_BOXED derived-types) not in the table above.
13875 * Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
13876 * %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
13877 * %NULL) for @type is returned (e.g. 0 for scalar types, the empty
13878 * string for string types, <literal>'/'</literal> for object path
13879 * types, the empty array for any array type and so on).
13881 * See the g_dbus_gvariant_to_gvalue() function for how to convert a
13882 * #GVariant to a #GValue.
13884 * Returns: A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or %NULL in case of failure. Free with g_variant_unref().
13890 * g_dbus_gvariant_to_gvalue:
13891 * @value: A #GVariant.
13892 * @out_gvalue: (out): Return location pointing to a zero-filled (uninitialized) #GValue.
13894 * Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
13896 * The rules specified in the g_dbus_gvalue_to_gvariant() function are
13897 * used - this function is essentially its reverse form.
13899 * The conversion never fails - a valid #GValue is always returned in
13907 * g_dbus_interface_dup_object:
13908 * @interface_: An exported D-Bus interface.
13910 * Gets the #GDBusObject that @interface_ belongs to, if any.
13912 * Returns: (transfer full): A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
13914 * Rename to: g_dbus_interface_get_object
13919 * g_dbus_interface_get_info:
13920 * @interface_: An exported D-Bus interface.
13922 * Gets D-Bus introspection information for the D-Bus interface
13923 * implemented by @interface_.
13925 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
13931 * g_dbus_interface_get_object: (skip)
13932 * @interface_: An exported D-Bus interface.
13934 * Gets the #GDBusObject that @interface_ belongs to, if any.
13936 * <warning>It is not safe to use the returned object if @interface_
13937 * or the returned object is being used from other threads. See
13938 * g_dbus_interface_dup_object() for a thread-safe
13939 * alternative.</warning>
13941 * Returns: (transfer none): A #GDBusObject or %NULL. The returned reference belongs to @interface_ and should not be freed.
13947 * g_dbus_interface_info_cache_build:
13948 * @info: A #GDBusInterfaceInfo.
13950 * Builds a lookup-cache to speed up
13951 * g_dbus_interface_info_lookup_method(),
13952 * g_dbus_interface_info_lookup_signal() and
13953 * g_dbus_interface_info_lookup_property().
13955 * If this has already been called with @info, the existing cache is
13956 * used and its use count is increased.
13958 * Note that @info cannot be modified until
13959 * g_dbus_interface_info_cache_release() is called.
13966 * g_dbus_interface_info_cache_release:
13967 * @info: A GDBusInterfaceInfo
13969 * Decrements the usage count for the cache for @info built by
13970 * g_dbus_interface_info_cache_build() (if any) and frees the
13971 * resources used by the cache if the usage count drops to zero.
13978 * g_dbus_interface_info_generate_xml:
13979 * @info: A #GDBusNodeInfo
13980 * @indent: Indentation level.
13981 * @string_builder: (out): A #GString to to append XML data to.
13983 * Appends an XML representation of @info (and its children) to @string_builder.
13985 * This function is typically used for generating introspection XML
13986 * documents at run-time for handling the
13987 * <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
13995 * g_dbus_interface_info_lookup_method:
13996 * @info: A #GDBusInterfaceInfo.
13997 * @name: A D-Bus method name (typically in CamelCase)
13999 * Looks up information about a method.
14001 * This cost of this function is O(n) in number of methods unless
14002 * g_dbus_interface_info_cache_build() has been used on @info.
14004 * Returns: (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
14010 * g_dbus_interface_info_lookup_property:
14011 * @info: A #GDBusInterfaceInfo.
14012 * @name: A D-Bus property name (typically in CamelCase).
14014 * Looks up information about a property.
14016 * This cost of this function is O(n) in number of properties unless
14017 * g_dbus_interface_info_cache_build() has been used on @info.
14019 * Returns: (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
14025 * g_dbus_interface_info_lookup_signal:
14026 * @info: A #GDBusInterfaceInfo.
14027 * @name: A D-Bus signal name (typically in CamelCase)
14029 * Looks up information about a signal.
14031 * This cost of this function is O(n) in number of signals unless
14032 * g_dbus_interface_info_cache_build() has been used on @info.
14034 * Returns: (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
14040 * g_dbus_interface_info_ref:
14041 * @info: A #GDBusInterfaceInfo
14043 * If @info is statically allocated does nothing. Otherwise increases
14044 * the reference count.
14046 * Returns: The same @info.
14052 * g_dbus_interface_info_unref:
14053 * @info: A #GDBusInterfaceInfo.
14055 * If @info is statically allocated, does nothing. Otherwise decreases
14056 * the reference count of @info. When its reference count drops to 0,
14057 * the memory used is freed.
14064 * g_dbus_interface_set_object:
14065 * @interface_: An exported D-Bus interface.
14066 * @object: (allow-none): A #GDBusObject or %NULL.
14068 * Sets the #GDBusObject for @interface_ to @object.
14070 * Note that @interface_ will hold a weak reference to @object.
14077 * g_dbus_interface_skeleton_export:
14078 * @interface_: The D-Bus interface to export.
14079 * @connection: A #GDBusConnection to export @interface_ on.
14080 * @object_path: The path to export the interface at.
14081 * @error: Return location for error or %NULL.
14083 * Exports @interface_ at @object_path on @connection.
14085 * This can be called multiple times to export the same @interface_
14086 * onto multiple connections however the @object_path provided must be
14087 * the same for all connections.
14089 * Use g_dbus_interface_skeleton_unexport() to unexport the object.
14091 * Returns: %TRUE if the interface was exported on @connection, otherwise %FALSE with @error set.
14097 * g_dbus_interface_skeleton_flush:
14098 * @interface_: A #GDBusInterfaceSkeleton.
14100 * If @interface_ has outstanding changes, request for these changes to be
14101 * emitted immediately.
14103 * For example, an exported D-Bus interface may queue up property
14104 * changes and emit the
14105 * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
14106 * signal later (e.g. in an idle handler). This technique is useful
14107 * for collapsing multiple property changes into one.
14114 * g_dbus_interface_skeleton_get_connection:
14115 * @interface_: A #GDBusInterfaceSkeleton.
14117 * Gets the first connection that @interface_ is exported on, if any.
14119 * Returns: (transfer none): A #GDBusConnection or %NULL if @interface_ is not exported anywhere. Do not free, the object belongs to @interface_.
14125 * g_dbus_interface_skeleton_get_connections:
14126 * @interface_: A #GDBusInterfaceSkeleton.
14128 * Gets a list of the connections that @interface_ is exported on.
14130 * 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().
14136 * g_dbus_interface_skeleton_get_flags:
14137 * @interface_: A #GDBusInterfaceSkeleton.
14139 * Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
14142 * Returns: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
14148 * g_dbus_interface_skeleton_get_info:
14149 * @interface_: A #GDBusInterfaceSkeleton.
14151 * Gets D-Bus introspection information for the D-Bus interface
14152 * implemented by @interface_.
14154 * Returns: (transfer none): A #GDBusInterfaceInfo (never %NULL). Do not free.
14160 * g_dbus_interface_skeleton_get_object_path:
14161 * @interface_: A #GDBusInterfaceSkeleton.
14163 * Gets the object path that @interface_ is exported on, if any.
14165 * Returns: A string owned by @interface_ or %NULL if @interface_ is not exported anywhere. Do not free, the string belongs to @interface_.
14171 * g_dbus_interface_skeleton_get_properties:
14172 * @interface_: A #GDBusInterfaceSkeleton.
14174 * Gets all D-Bus properties for @interface_.
14176 * Returns: (transfer full): A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
14182 * g_dbus_interface_skeleton_get_vtable: (skip)
14183 * @interface_: A #GDBusInterfaceSkeleton.
14185 * Gets the interface vtable for the D-Bus interface implemented by
14186 * @interface_. The returned function pointers should expect @interface_
14187 * itself to be passed as @user_data.
14189 * Returns: A #GDBusInterfaceVTable (never %NULL).
14195 * g_dbus_interface_skeleton_has_connection:
14196 * @interface_: A #GDBusInterfaceSkeleton.
14197 * @connection: A #GDBusConnection.
14199 * Checks if @interface_ is export on @connection.
14201 * Returns: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
14207 * g_dbus_interface_skeleton_set_flags:
14208 * @interface_: A #GDBusInterfaceSkeleton.
14209 * @flags: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
14211 * Sets flags describing what the behavior of @skeleton should be.
14218 * g_dbus_interface_skeleton_unexport:
14219 * @interface_: A #GDBusInterfaceSkeleton.
14221 * Stops exporting @interface_ on all connections it is exported on.
14223 * To unexport @interface_ from only a single connection, use
14224 * g_dbus_interface_skeleton_unexport_from_connection()
14231 * g_dbus_interface_skeleton_unexport_from_connection:
14232 * @interface_: A #GDBusInterfaceSkeleton.
14233 * @connection: A #GDBusConnection.
14235 * Stops exporting @interface_ on @connection.
14237 * To stop exporting on all connections the interface is exported on,
14238 * use g_dbus_interface_skeleton_unexport().
14245 * g_dbus_is_address:
14246 * @string: A string.
14248 * Checks if @string is a D-Bus address.
14250 * This doesn't check if @string is actually supported by #GDBusServer
14251 * or #GDBusConnection - use g_dbus_is_supported_address() to do more
14254 * Returns: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
14261 * @string: The string to check.
14263 * Checks if @string is a D-Bus GUID.
14265 * See the D-Bus specification regarding what strings are valid D-Bus
14266 * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
14268 * Returns: %TRUE if @string is a guid, %FALSE otherwise.
14274 * g_dbus_is_interface_name:
14275 * @string: The string to check.
14277 * Checks if @string is a valid D-Bus interface name.
14279 * Returns: %TRUE if valid, %FALSE otherwise.
14285 * g_dbus_is_member_name:
14286 * @string: The string to check.
14288 * Checks if @string is a valid D-Bus member (e.g. signal or method) name.
14290 * Returns: %TRUE if valid, %FALSE otherwise.
14297 * @string: The string to check.
14299 * Checks if @string is a valid D-Bus bus name (either unique or well-known).
14301 * Returns: %TRUE if valid, %FALSE otherwise.
14307 * g_dbus_is_supported_address:
14308 * @string: A string.
14309 * @error: Return location for error or %NULL.
14311 * Like g_dbus_is_address() but also checks if the library suppors the
14312 * transports in @string and that key/value pairs for each transport
14315 * Returns: %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set.
14321 * g_dbus_is_unique_name:
14322 * @string: The string to check.
14324 * Checks if @string is a valid D-Bus unique bus name.
14326 * Returns: %TRUE if valid, %FALSE otherwise.
14332 * g_dbus_menu_model_get:
14333 * @connection: a #GDBusConnection
14334 * @bus_name: the bus name which exports the menu model
14335 * @object_path: the object path at which the menu model is exported
14337 * Obtains a #GDBusMenuModel for the menu model which is exported
14338 * at the given @bus_name and @object_path.
14340 * The thread default main context is taken at the time of this call.
14341 * All signals on the menu model (and any linked models) are reported
14342 * with respect to this context. All calls on the returned menu model
14343 * (and linked models) must also originate from this same context, with
14344 * the thread default main context unchanged.
14346 * Returns: (transfer full): a #GDBusMenuModel object. Free with g_object_unref().
14352 * g_dbus_message_bytes_needed:
14353 * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14354 * @blob_len: The length of @blob (must be at least 16).
14355 * @error: Return location for error or %NULL.
14357 * Utility function to calculate how many bytes are needed to
14358 * completely deserialize the D-Bus message stored at @blob.
14360 * 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).
14366 * g_dbus_message_copy:
14367 * @message: A #GDBusMessage.
14368 * @error: Return location for error or %NULL.
14370 * Copies @message. The copy is a deep copy and the returned
14371 * #GDBusMessage is completely identical except that it is guaranteed
14372 * to not be locked.
14374 * This operation can fail if e.g. @message contains file descriptors
14375 * and the per-process or system-wide open files limit is reached.
14377 * Returns: (transfer full): A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14383 * g_dbus_message_get_arg0:
14384 * @message: A #GDBusMessage.
14386 * Convenience to get the first item in the body of @message.
14388 * Returns: The string item or %NULL if the first item in the body of @message is not a string.
14394 * g_dbus_message_get_body:
14395 * @message: A #GDBusMessage.
14397 * Gets the body of a message.
14399 * Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
14405 * g_dbus_message_get_byte_order:
14406 * @message: A #GDBusMessage.
14408 * Gets the byte order of @message.
14410 * Returns: The byte order.
14415 * g_dbus_message_get_destination:
14416 * @message: A #GDBusMessage.
14418 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14420 * Returns: The value.
14426 * g_dbus_message_get_error_name:
14427 * @message: A #GDBusMessage.
14429 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14431 * Returns: The value.
14437 * g_dbus_message_get_flags:
14438 * @message: A #GDBusMessage.
14440 * Gets the flags for @message.
14442 * Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14448 * g_dbus_message_get_header:
14449 * @message: A #GDBusMessage.
14450 * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14452 * Gets a header field on @message.
14454 * Returns: A #GVariant with the value if the header was found, %NULL otherwise. Do not free, it is owned by @message.
14460 * g_dbus_message_get_header_fields:
14461 * @message: A #GDBusMessage.
14463 * Gets an array of all header fields on @message that are set.
14465 * 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().
14471 * g_dbus_message_get_interface:
14472 * @message: A #GDBusMessage.
14474 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14476 * Returns: The value.
14482 * g_dbus_message_get_locked:
14483 * @message: A #GDBusMessage.
14485 * Checks whether @message is locked. To monitor changes to this
14486 * value, conncet to the #GObject::notify signal to listen for changes
14487 * on the #GDBusMessage:locked property.
14489 * Returns: %TRUE if @message is locked, %FALSE otherwise.
14495 * g_dbus_message_get_member:
14496 * @message: A #GDBusMessage.
14498 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14500 * Returns: The value.
14506 * g_dbus_message_get_message_type:
14507 * @message: A #GDBusMessage.
14509 * Gets the type of @message.
14511 * Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14517 * g_dbus_message_get_num_unix_fds:
14518 * @message: A #GDBusMessage.
14520 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14522 * Returns: The value.
14528 * g_dbus_message_get_path:
14529 * @message: A #GDBusMessage.
14531 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14533 * Returns: The value.
14539 * g_dbus_message_get_reply_serial:
14540 * @message: A #GDBusMessage.
14542 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14544 * Returns: The value.
14550 * g_dbus_message_get_sender:
14551 * @message: A #GDBusMessage.
14553 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14555 * Returns: The value.
14561 * g_dbus_message_get_serial:
14562 * @message: A #GDBusMessage.
14564 * Gets the serial for @message.
14566 * Returns: A #guint32.
14572 * g_dbus_message_get_signature:
14573 * @message: A #GDBusMessage.
14575 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14577 * Returns: The value.
14583 * g_dbus_message_get_unix_fd_list:
14584 * @message: A #GDBusMessage.
14586 * Gets the UNIX file descriptors associated with @message, if any.
14588 * This method is only available on UNIX.
14590 * Returns: (transfer none): A #GUnixFDList or %NULL if no file descriptors are associated. Do not free, this object is owned by @message.
14596 * g_dbus_message_lock:
14597 * @message: A #GDBusMessage.
14599 * If @message is locked, does nothing. Otherwise locks the message.
14606 * g_dbus_message_new:
14608 * Creates a new empty #GDBusMessage.
14610 * Returns: A #GDBusMessage. Free with g_object_unref().
14616 * g_dbus_message_new_from_blob:
14617 * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14618 * @blob_len: The length of @blob.
14619 * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14620 * @error: Return location for error or %NULL.
14622 * Creates a new #GDBusMessage from the data stored at @blob. The byte
14623 * order that the message was in can be retrieved using
14624 * g_dbus_message_get_byte_order().
14626 * Returns: A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14632 * g_dbus_message_new_method_call:
14633 * @name: (allow-none): A valid D-Bus name or %NULL.
14634 * @path: A valid object path.
14635 * @interface_: (allow-none): A valid D-Bus interface name or %NULL.
14636 * @method: A valid method name.
14638 * Creates a new #GDBusMessage for a method call.
14640 * Returns: A #GDBusMessage. Free with g_object_unref().
14646 * g_dbus_message_new_method_error:
14647 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14648 * @error_name: A valid D-Bus error name.
14649 * @error_message_format: The D-Bus error message in a printf() format.
14650 * @...: Arguments for @error_message_format.
14652 * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14654 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14660 * g_dbus_message_new_method_error_literal:
14661 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14662 * @error_name: A valid D-Bus error name.
14663 * @error_message: The D-Bus error message.
14665 * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14667 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14673 * g_dbus_message_new_method_error_valist:
14674 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14675 * @error_name: A valid D-Bus error name.
14676 * @error_message_format: The D-Bus error message in a printf() format.
14677 * @var_args: Arguments for @error_message_format.
14679 * Like g_dbus_message_new_method_error() but intended for language bindings.
14681 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14687 * g_dbus_message_new_method_reply:
14688 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14690 * Creates a new #GDBusMessage that is a reply to @method_call_message.
14692 * Returns: (transfer full): #GDBusMessage. Free with g_object_unref().
14698 * g_dbus_message_new_signal:
14699 * @path: A valid object path.
14700 * @interface_: A valid D-Bus interface name.
14701 * @signal: A valid signal name.
14703 * Creates a new #GDBusMessage for a signal emission.
14705 * Returns: A #GDBusMessage. Free with g_object_unref().
14711 * g_dbus_message_print:
14712 * @message: A #GDBusMessage.
14713 * @indent: Indentation level.
14715 * Produces a human-readable multi-line description of @message.
14717 * The contents of the description has no ABI guarantees, the contents
14718 * and formatting is subject to change at any time. Typical output
14719 * looks something like this:
14721 * Type: method-call
14722 * Flags: none
14726 * path -> objectpath '/org/gtk/GDBus/TestObject'
14727 * interface -> 'org.gtk.GDBus.TestInterface'
14728 * member -> 'GimmeStdout'
14729 * destination -> ':1.146'
14731 * UNIX File Descriptors:
14733 * </programlisting>
14736 * Type: method-return
14737 * Flags: no-reply-expected
14739 * Serial: 477
14741 * reply-serial -> uint32 4
14742 * destination -> ':1.159'
14743 * sender -> ':1.146'
14744 * num-unix-fds -> uint32 1
14746 * UNIX File Descriptors:
14747 * fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
14748 * </programlisting>
14750 * Returns: A string that should be freed with g_free().
14756 * g_dbus_message_set_body:
14757 * @message: A #GDBusMessage.
14758 * @body: Either %NULL or a #GVariant that is a tuple.
14760 * Sets the body @message. As a side-effect the
14761 * %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
14762 * type string of @body (or cleared if @body is %NULL).
14764 * If @body is floating, @message assumes ownership of @body.
14771 * g_dbus_message_set_byte_order:
14772 * @message: A #GDBusMessage.
14773 * @byte_order: The byte order.
14775 * Sets the byte order of @message.
14780 * g_dbus_message_set_destination:
14781 * @message: A #GDBusMessage.
14782 * @value: The value to set.
14784 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14791 * g_dbus_message_set_error_name:
14792 * @message: A #GDBusMessage.
14793 * @value: The value to set.
14795 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14802 * g_dbus_message_set_flags:
14803 * @message: A #GDBusMessage.
14804 * @flags: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14806 * Sets the flags to set on @message.
14813 * g_dbus_message_set_header:
14814 * @message: A #GDBusMessage.
14815 * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14816 * @value: (allow-none): A #GVariant to set the header field or %NULL to clear the header field.
14818 * Sets a header field on @message.
14820 * If @value is floating, @message assumes ownership of @value.
14827 * g_dbus_message_set_interface:
14828 * @message: A #GDBusMessage.
14829 * @value: The value to set.
14831 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14838 * g_dbus_message_set_member:
14839 * @message: A #GDBusMessage.
14840 * @value: The value to set.
14842 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14849 * g_dbus_message_set_message_type:
14850 * @message: A #GDBusMessage.
14851 * @type: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14853 * Sets @message to be of @type.
14860 * g_dbus_message_set_num_unix_fds:
14861 * @message: A #GDBusMessage.
14862 * @value: The value to set.
14864 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14871 * g_dbus_message_set_path:
14872 * @message: A #GDBusMessage.
14873 * @value: The value to set.
14875 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14882 * g_dbus_message_set_reply_serial:
14883 * @message: A #GDBusMessage.
14884 * @value: The value to set.
14886 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14893 * g_dbus_message_set_sender:
14894 * @message: A #GDBusMessage.
14895 * @value: The value to set.
14897 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14904 * g_dbus_message_set_serial:
14905 * @message: A #GDBusMessage.
14906 * @serial: A #guint32.
14908 * Sets the serial for @message.
14915 * g_dbus_message_set_signature:
14916 * @message: A #GDBusMessage.
14917 * @value: The value to set.
14919 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14926 * g_dbus_message_set_unix_fd_list:
14927 * @message: A #GDBusMessage.
14928 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
14930 * Sets the UNIX file descriptors associated with @message. As a
14931 * side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
14932 * field is set to the number of fds in @fd_list (or cleared if
14933 * @fd_list is %NULL).
14935 * This method is only available on UNIX.
14942 * g_dbus_message_to_blob:
14943 * @message: A #GDBusMessage.
14944 * @out_size: Return location for size of generated blob.
14945 * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14946 * @error: Return location for error.
14948 * Serializes @message to a blob. The byte order returned by
14949 * g_dbus_message_get_byte_order() will be used.
14951 * 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().
14957 * g_dbus_message_to_gerror:
14958 * @message: A #GDBusMessage.
14959 * @error: The #GError to set.
14961 * If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
14962 * nothing and returns %FALSE.
14964 * Otherwise this method encodes the error in @message as a #GError
14965 * using g_dbus_error_set_dbus_error() using the information in the
14966 * %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
14967 * well as the first string item in @message's body.
14969 * Returns: %TRUE if @error was set, %FALSE otherwise.
14975 * g_dbus_method_info_ref:
14976 * @info: A #GDBusMethodInfo
14978 * If @info is statically allocated does nothing. Otherwise increases
14979 * the reference count.
14981 * Returns: The same @info.
14987 * g_dbus_method_info_unref:
14988 * @info: A #GDBusMethodInfo.
14990 * If @info is statically allocated, does nothing. Otherwise decreases
14991 * the reference count of @info. When its reference count drops to 0,
14992 * the memory used is freed.
14999 * g_dbus_method_invocation_get_connection:
15000 * @invocation: A #GDBusMethodInvocation.
15002 * Gets the #GDBusConnection the method was invoked on.
15004 * Returns: (transfer none): A #GDBusConnection. Do not free, it is owned by @invocation.
15010 * g_dbus_method_invocation_get_interface_name:
15011 * @invocation: A #GDBusMethodInvocation.
15013 * Gets the name of the D-Bus interface the method was invoked on.
15015 * Returns: A string. Do not free, it is owned by @invocation.
15021 * g_dbus_method_invocation_get_message:
15022 * @invocation: A #GDBusMethodInvocation.
15024 * Gets the #GDBusMessage for the method invocation. This is useful if
15025 * you need to use low-level protocol features, such as UNIX file
15026 * descriptor passing, that cannot be properly expressed in the
15029 * See <xref linkend="gdbus-server"/> and <xref
15030 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
15031 * low-level API to send and receive UNIX file descriptors.
15033 * Returns: (transfer none): #GDBusMessage. Do not free, it is owned by @invocation.
15039 * g_dbus_method_invocation_get_method_info:
15040 * @invocation: A #GDBusMethodInvocation.
15042 * Gets information about the method call, if any.
15044 * Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
15050 * g_dbus_method_invocation_get_method_name:
15051 * @invocation: A #GDBusMethodInvocation.
15053 * Gets the name of the method that was invoked.
15055 * Returns: A string. Do not free, it is owned by @invocation.
15061 * g_dbus_method_invocation_get_object_path:
15062 * @invocation: A #GDBusMethodInvocation.
15064 * Gets the object path the method was invoked on.
15066 * Returns: A string. Do not free, it is owned by @invocation.
15072 * g_dbus_method_invocation_get_parameters:
15073 * @invocation: A #GDBusMethodInvocation.
15075 * Gets the parameters of the method invocation. If there are no input
15076 * parameters then this will return a GVariant with 0 children rather than NULL.
15078 * Returns: (transfer none): A #GVariant tuple. Do not unref this because it is owned by @invocation.
15084 * g_dbus_method_invocation_get_sender:
15085 * @invocation: A #GDBusMethodInvocation.
15087 * Gets the bus name that invoked the method.
15089 * Returns: A string. Do not free, it is owned by @invocation.
15095 * g_dbus_method_invocation_get_user_data: (skip)
15096 * @invocation: A #GDBusMethodInvocation.
15098 * Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
15100 * Returns: A #gpointer.
15106 * g_dbus_method_invocation_return_dbus_error:
15107 * @invocation: (transfer full): A #GDBusMethodInvocation.
15108 * @error_name: A valid D-Bus error name.
15109 * @error_message: A valid D-Bus error message.
15111 * Finishes handling a D-Bus method call by returning an error.
15113 * This method will free @invocation, you cannot use it afterwards.
15120 * g_dbus_method_invocation_return_error:
15121 * @invocation: (transfer full): A #GDBusMethodInvocation.
15122 * @domain: A #GQuark for the #GError error domain.
15123 * @code: The error code.
15124 * @format: printf()-style format.
15125 * @...: Parameters for @format.
15127 * Finishes handling a D-Bus method call by returning an error.
15129 * See g_dbus_error_encode_gerror() for details about what error name
15130 * will be returned on the wire. In a nutshell, if the given error is
15131 * registered using g_dbus_error_register_error() the name given
15132 * during registration is used. Otherwise, a name of the form
15133 * <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
15134 * used. This provides transparent mapping of #GError between
15135 * applications using GDBus.
15137 * If you are writing an application intended to be portable,
15138 * <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
15139 * or use g_dbus_method_invocation_return_dbus_error().
15141 * This method will free @invocation, you cannot use it afterwards.
15148 * g_dbus_method_invocation_return_error_literal:
15149 * @invocation: (transfer full): A #GDBusMethodInvocation.
15150 * @domain: A #GQuark for the #GError error domain.
15151 * @code: The error code.
15152 * @message: The error message.
15154 * Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
15156 * This method will free @invocation, you cannot use it afterwards.
15163 * g_dbus_method_invocation_return_error_valist:
15164 * @invocation: (transfer full): A #GDBusMethodInvocation.
15165 * @domain: A #GQuark for the #GError error domain.
15166 * @code: The error code.
15167 * @format: printf()-style format.
15168 * @var_args: #va_list of parameters for @format.
15170 * Like g_dbus_method_invocation_return_error() but intended for
15171 * language bindings.
15173 * This method will free @invocation, you cannot use it afterwards.
15180 * g_dbus_method_invocation_return_gerror:
15181 * @invocation: (transfer full): A #GDBusMethodInvocation.
15182 * @error: A #GError.
15184 * Like g_dbus_method_invocation_return_error() but takes a #GError
15185 * instead of the error domain, error code and message.
15187 * This method will free @invocation, you cannot use it afterwards.
15194 * g_dbus_method_invocation_return_value:
15195 * @invocation: (transfer full): A #GDBusMethodInvocation.
15196 * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15198 * Finishes handling a D-Bus method call by returning @parameters.
15199 * If the @parameters GVariant is floating, it is consumed.
15201 * It is an error if @parameters is not of the right format.
15203 * This method will free @invocation, you cannot use it afterwards.
15210 * g_dbus_method_invocation_return_value_with_unix_fd_list:
15211 * @invocation: (transfer full): A #GDBusMethodInvocation.
15212 * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15213 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15215 * Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
15217 * This method is only available on UNIX.
15219 * This method will free @invocation, you cannot use it afterwards.
15226 * g_dbus_method_invocation_take_error: (skip)
15227 * @invocation: (transfer full): A #GDBusMethodInvocation.
15228 * @error: (transfer full): A #GError.
15230 * Like g_dbus_method_invocation_return_gerror() but takes ownership
15231 * of @error so the caller does not need to free it.
15233 * This method will free @invocation, you cannot use it afterwards.
15240 * g_dbus_node_info_generate_xml:
15241 * @info: A #GDBusNodeInfo.
15242 * @indent: Indentation level.
15243 * @string_builder: (out): A #GString to to append XML data to.
15245 * Appends an XML representation of @info (and its children) to @string_builder.
15247 * This function is typically used for generating introspection XML documents at run-time for
15248 * handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
15255 * g_dbus_node_info_lookup_interface:
15256 * @info: A #GDBusNodeInfo.
15257 * @name: A D-Bus interface name.
15259 * Looks up information about an interface.
15261 * This cost of this function is O(n) in number of interfaces.
15263 * Returns: (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
15269 * g_dbus_node_info_new_for_xml:
15270 * @xml_data: Valid D-Bus introspection XML.
15271 * @error: Return location for error.
15273 * Parses @xml_data and returns a #GDBusNodeInfo representing the data.
15275 * The introspection XML must contain exactly one top-level
15276 * <tag class="starttag">node</tag> element.
15278 * Note that this routine is using a
15279 * <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
15280 * parser that only accepts a subset of valid XML documents.
15282 * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free with g_dbus_node_info_unref().
15288 * g_dbus_node_info_ref:
15289 * @info: A #GDBusNodeInfo
15291 * If @info is statically allocated does nothing. Otherwise increases
15292 * the reference count.
15294 * Returns: The same @info.
15300 * g_dbus_node_info_unref:
15301 * @info: A #GDBusNodeInfo.
15303 * If @info is statically allocated, does nothing. Otherwise decreases
15304 * the reference count of @info. When its reference count drops to 0,
15305 * the memory used is freed.
15312 * g_dbus_object_get_interface:
15313 * @object: A #GDBusObject.
15314 * @interface_name: A D-Bus interface name.
15316 * Gets the D-Bus interface with name @interface_name associated with
15319 * Returns: (transfer full): %NULL if not found, otherwise a #GDBusInterface that must be freed with g_object_unref().
15325 * g_dbus_object_get_interfaces:
15326 * @object: A #GDBusObject.
15328 * Gets the D-Bus interfaces associated with @object.
15330 * 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().
15336 * g_dbus_object_get_object_path:
15337 * @object: A #GDBusObject.
15339 * Gets the object path for @object.
15341 * Returns: A string owned by @object. Do not free.
15347 * g_dbus_object_manager_client_get_connection:
15348 * @manager: A #GDBusObjectManagerClient
15350 * Gets the #GDBusConnection used by @manager.
15352 * Returns: (transfer none): A #GDBusConnection object. Do not free, the object belongs to @manager.
15358 * g_dbus_object_manager_client_get_flags:
15359 * @manager: A #GDBusObjectManagerClient
15361 * Gets the flags that @manager was constructed with.
15363 * Returns: Zero of more flags from the #GDBusObjectManagerClientFlags enumeration.
15369 * g_dbus_object_manager_client_get_name:
15370 * @manager: A #GDBusObjectManagerClient
15372 * Gets the name that @manager is for.
15374 * Returns: A unique or well-known name. Do not free, the string belongs to @manager.
15380 * g_dbus_object_manager_client_get_name_owner:
15381 * @manager: A #GDBusObjectManagerClient.
15383 * The unique name that owns the name that @manager is for or %NULL if
15384 * no-one currently owns that name. You can connect to the
15385 * #GObject::notify signal to track changes to the
15386 * #GDBusObjectManagerClient:name-owner property.
15388 * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15394 * g_dbus_object_manager_client_new:
15395 * @connection: A #GDBusConnection.
15396 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15397 * @name: The owner of the control object (unique or well-known name).
15398 * @object_path: The object path of the control object.
15399 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15400 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15401 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15402 * @cancellable: (allow-none): A #GCancellable or %NULL
15403 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15404 * @user_data: The data to pass to @callback.
15406 * Asynchronously creates a new #GDBusObjectManagerClient object.
15408 * This is an asynchronous failable constructor. When the result is
15409 * ready, @callback will be invoked in the
15410 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15411 * of the thread you are calling this method from. You can
15412 * then call g_dbus_object_manager_client_new_finish() to get the result. See
15413 * g_dbus_object_manager_client_new_sync() for the synchronous version.
15420 * g_dbus_object_manager_client_new_finish:
15421 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
15422 * @error: Return location for error or %NULL.
15424 * Finishes an operation started with g_dbus_object_manager_client_new().
15426 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15432 * g_dbus_object_manager_client_new_for_bus:
15433 * @bus_type: A #GBusType.
15434 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15435 * @name: The owner of the control object (unique or well-known name).
15436 * @object_path: The object path of the control object.
15437 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15438 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15439 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15440 * @cancellable: (allow-none): A #GCancellable or %NULL
15441 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15442 * @user_data: The data to pass to @callback.
15444 * Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
15445 * #GDBusConnection.
15447 * This is an asynchronous failable constructor. When the result is
15448 * ready, @callback will be invoked in the
15449 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15450 * of the thread you are calling this method from. You can
15451 * then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
15452 * g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
15459 * g_dbus_object_manager_client_new_for_bus_finish:
15460 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
15461 * @error: Return location for error or %NULL.
15463 * Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
15465 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15471 * g_dbus_object_manager_client_new_for_bus_sync:
15472 * @bus_type: A #GBusType.
15473 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15474 * @name: The owner of the control object (unique or well-known name).
15475 * @object_path: The object path of the control object.
15476 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15477 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15478 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15479 * @cancellable: (allow-none): A #GCancellable or %NULL
15480 * @error: Return location for error or %NULL.
15482 * Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
15483 * of a #GDBusConnection.
15485 * This is a synchronous failable constructor - the calling thread is
15486 * blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
15487 * for the asynchronous version.
15489 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15495 * g_dbus_object_manager_client_new_sync:
15496 * @connection: A #GDBusConnection.
15497 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15498 * @name: The owner of the control object (unique or well-known name).
15499 * @object_path: The object path of the control object.
15500 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15501 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15502 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15503 * @cancellable: (allow-none): A #GCancellable or %NULL
15504 * @error: Return location for error or %NULL.
15506 * Creates a new #GDBusObjectManagerClient object.
15508 * This is a synchronous failable constructor - the calling thread is
15509 * blocked until a reply is received. See g_dbus_object_manager_client_new()
15510 * for the asynchronous version.
15512 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15518 * g_dbus_object_manager_get_interface:
15519 * @manager: A #GDBusObjectManager.
15520 * @object_path: Object path to lookup.
15521 * @interface_name: D-Bus interface name to lookup.
15523 * Gets the interface proxy for @interface_name at @object_path, if
15526 * Returns: (transfer full): A #GDBusInterface instance or %NULL. Free with g_object_unref().
15532 * g_dbus_object_manager_get_object:
15533 * @manager: A #GDBusObjectManager.
15534 * @object_path: Object path to lookup.
15536 * Gets the #GDBusObjectProxy at @object_path, if any.
15538 * Returns: (transfer full): A #GDBusObject or %NULL. Free with g_object_unref().
15544 * g_dbus_object_manager_get_object_path:
15545 * @manager: A #GDBusObjectManager.
15547 * Gets the object path that @manager is for.
15549 * Returns: A string owned by @manager. Do not free.
15555 * g_dbus_object_manager_get_objects:
15556 * @manager: A #GDBusObjectManager.
15558 * Gets all #GDBusObject objects known to @manager.
15560 * 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().
15566 * g_dbus_object_manager_server_export:
15567 * @manager: A #GDBusObjectManagerServer.
15568 * @object: A #GDBusObjectSkeleton.
15570 * Exports @object on @manager.
15572 * If there is already a #GDBusObject exported at the object path,
15573 * then the old object is removed.
15575 * The object path for @object must be in the hierarchy rooted by the
15576 * object path for @manager.
15578 * Note that @manager will take a reference on @object for as long as
15586 * g_dbus_object_manager_server_export_uniquely:
15587 * @manager: A #GDBusObjectManagerServer.
15588 * @object: An object.
15590 * Like g_dbus_object_manager_server_export() but appends a string of
15591 * the form <literal>_N</literal> (with N being a natural number) to
15592 * @object<!-- -->'s object path if an object with the given path
15593 * already exists. As such, the #GDBusObjectProxy:g-object-path property
15594 * of @object may be modified.
15601 * g_dbus_object_manager_server_get_connection:
15602 * @manager: A #GDBusObjectManagerServer
15604 * Gets the #GDBusConnection used by @manager.
15606 * 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().
15612 * g_dbus_object_manager_server_is_exported:
15613 * @manager: A #GDBusObjectManagerServer.
15614 * @object: An object.
15616 * Returns whether @object is currently exported on @manager.
15618 * Returns: %TRUE if @object is exported
15624 * g_dbus_object_manager_server_new:
15625 * @object_path: The object path to export the manager object at.
15627 * Creates a new #GDBusObjectManagerServer object.
15629 * The returned server isn't yet exported on any connection. To do so,
15630 * use g_dbus_object_manager_server_set_connection(). Normally you
15631 * want to export all of your objects before doing so to avoid <ulink
15632 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
15633 * signals being emitted.
15635 * Returns: A #GDBusObjectManagerServer object. Free with g_object_unref().
15641 * g_dbus_object_manager_server_set_connection:
15642 * @manager: A #GDBusObjectManagerServer.
15643 * @connection: (allow-none): A #GDBusConnection or %NULL.
15645 * Exports all objects managed by @manager on @connection. If
15646 * @connection is %NULL, stops exporting objects.
15651 * g_dbus_object_manager_server_unexport:
15652 * @manager: A #GDBusObjectManagerServer.
15653 * @object_path: An object path.
15655 * If @manager has an object at @path, removes the object. Otherwise
15658 * Note that @object_path must be in the hierarchy rooted by the
15659 * object path for @manager.
15661 * Returns: %TRUE if object at @object_path was removed, %FALSE otherwise.
15667 * g_dbus_object_proxy_get_connection:
15668 * @proxy: a #GDBusObjectProxy
15670 * Gets the connection that @proxy is for.
15672 * Returns: (transfer none): A #GDBusConnection. Do not free, the object is owned by @proxy.
15678 * g_dbus_object_proxy_new:
15679 * @connection: a #GDBusConnection
15680 * @object_path: the object path
15682 * Creates a new #GDBusObjectProxy for the given connection and
15685 * Returns: a new #GDBusObjectProxy
15691 * g_dbus_object_skeleton_add_interface:
15692 * @object: A #GDBusObjectSkeleton.
15693 * @interface_: A #GDBusInterfaceSkeleton.
15695 * Adds @interface_ to @object.
15697 * If @object already contains a #GDBusInterfaceSkeleton with the same
15698 * interface name, it is removed before @interface_ is added.
15700 * Note that @object takes its own reference on @interface_ and holds
15701 * it until removed.
15708 * g_dbus_object_skeleton_flush:
15709 * @object: A #GDBusObjectSkeleton.
15711 * This method simply calls g_dbus_interface_skeleton_flush() on all
15712 * interfaces belonging to @object. See that method for when flushing
15720 * g_dbus_object_skeleton_new:
15721 * @object_path: An object path.
15723 * Creates a new #GDBusObjectSkeleton.
15725 * Returns: A #GDBusObjectSkeleton. Free with g_object_unref().
15731 * g_dbus_object_skeleton_remove_interface:
15732 * @object: A #GDBusObjectSkeleton.
15733 * @interface_: A #GDBusInterfaceSkeleton.
15735 * Removes @interface_ from @object.
15742 * g_dbus_object_skeleton_remove_interface_by_name:
15743 * @object: A #GDBusObjectSkeleton.
15744 * @interface_name: A D-Bus interface name.
15746 * Removes the #GDBusInterface with @interface_name from @object.
15748 * If no D-Bus interface of the given interface exists, this function
15756 * g_dbus_object_skeleton_set_object_path:
15757 * @object: A #GDBusObjectSkeleton.
15758 * @object_path: A valid D-Bus object path.
15760 * Sets the object path for @object.
15767 * g_dbus_property_info_ref:
15768 * @info: A #GDBusPropertyInfo
15770 * If @info is statically allocated does nothing. Otherwise increases
15771 * the reference count.
15773 * Returns: The same @info.
15779 * g_dbus_property_info_unref:
15780 * @info: A #GDBusPropertyInfo.
15782 * If @info is statically allocated, does nothing. Otherwise decreases
15783 * the reference count of @info. When its reference count drops to 0,
15784 * the memory used is freed.
15791 * g_dbus_proxy_call:
15792 * @proxy: A #GDBusProxy.
15793 * @method_name: Name of method to invoke.
15794 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15795 * @flags: Flags from the #GDBusCallFlags enumeration.
15796 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15797 * @cancellable: (allow-none): A #GCancellable or %NULL.
15798 * @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.
15799 * @user_data: The data to pass to @callback.
15801 * Asynchronously invokes the @method_name method on @proxy.
15803 * If @method_name contains any dots, then @name is split into interface and
15804 * method name parts. This allows using @proxy for invoking methods on
15805 * other interfaces.
15807 * If the #GDBusConnection associated with @proxy is closed then
15808 * the operation will fail with %G_IO_ERROR_CLOSED. If
15809 * @cancellable is canceled, the operation will fail with
15810 * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15811 * compatible with the D-Bus protocol, the operation fails with
15812 * %G_IO_ERROR_INVALID_ARGUMENT.
15814 * If the @parameters #GVariant is floating, it is consumed. This allows
15815 * convenient 'inline' use of g_variant_new(), e.g.:
15817 * g_dbus_proxy_call (proxy,
15819 * g_variant_new ("(ss)",
15822 * G_DBUS_CALL_FLAGS_NONE,
15825 * (GAsyncReadyCallback) two_strings_done,
15829 * If @proxy has an expected interface (see
15830 * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15831 * then the return value is checked against the return type.
15833 * This is an asynchronous method. When the operation is finished,
15834 * @callback will be invoked in the
15835 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15836 * of the thread you are calling this method from.
15837 * You can then call g_dbus_proxy_call_finish() to get the result of
15838 * the operation. See g_dbus_proxy_call_sync() for the synchronous
15839 * version of this method.
15841 * If @callback is %NULL then the D-Bus method call message will be sent with
15842 * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
15849 * g_dbus_proxy_call_finish:
15850 * @proxy: A #GDBusProxy.
15851 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
15852 * @error: Return location for error or %NULL.
15854 * Finishes an operation started with g_dbus_proxy_call().
15856 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15862 * g_dbus_proxy_call_sync:
15863 * @proxy: A #GDBusProxy.
15864 * @method_name: Name of method to invoke.
15865 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15866 * @flags: Flags from the #GDBusCallFlags enumeration.
15867 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15868 * @cancellable: (allow-none): A #GCancellable or %NULL.
15869 * @error: Return location for error or %NULL.
15871 * Synchronously invokes the @method_name method on @proxy.
15873 * If @method_name contains any dots, then @name is split into interface and
15874 * method name parts. This allows using @proxy for invoking methods on
15875 * other interfaces.
15877 * If the #GDBusConnection associated with @proxy is disconnected then
15878 * the operation will fail with %G_IO_ERROR_CLOSED. If
15879 * @cancellable is canceled, the operation will fail with
15880 * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15881 * compatible with the D-Bus protocol, the operation fails with
15882 * %G_IO_ERROR_INVALID_ARGUMENT.
15884 * If the @parameters #GVariant is floating, it is consumed. This allows
15885 * convenient 'inline' use of g_variant_new(), e.g.:
15887 * g_dbus_proxy_call_sync (proxy,
15889 * g_variant_new ("(ss)",
15892 * G_DBUS_CALL_FLAGS_NONE,
15898 * The calling thread is blocked until a reply is received. See
15899 * g_dbus_proxy_call() for the asynchronous version of this
15902 * If @proxy has an expected interface (see
15903 * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15904 * then the return value is checked against the return type.
15906 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15912 * g_dbus_proxy_call_with_unix_fd_list:
15913 * @proxy: A #GDBusProxy.
15914 * @method_name: Name of method to invoke.
15915 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15916 * @flags: Flags from the #GDBusCallFlags enumeration.
15917 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15918 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15919 * @cancellable: (allow-none): A #GCancellable or %NULL.
15920 * @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.
15921 * @user_data: The data to pass to @callback.
15923 * Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
15925 * This method is only available on UNIX.
15932 * g_dbus_proxy_call_with_unix_fd_list_finish:
15933 * @proxy: A #GDBusProxy.
15934 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15935 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
15936 * @error: Return location for error or %NULL.
15938 * Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
15940 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15946 * g_dbus_proxy_call_with_unix_fd_list_sync:
15947 * @proxy: A #GDBusProxy.
15948 * @method_name: Name of method to invoke.
15949 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15950 * @flags: Flags from the #GDBusCallFlags enumeration.
15951 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15952 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15953 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15954 * @cancellable: (allow-none): A #GCancellable or %NULL.
15955 * @error: Return location for error or %NULL.
15957 * Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
15959 * This method is only available on UNIX.
15961 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15967 * g_dbus_proxy_get_cached_property:
15968 * @proxy: A #GDBusProxy.
15969 * @property_name: Property name.
15971 * Looks up the value for a property from the cache. This call does no
15974 * If @proxy has an expected interface (see
15975 * #GDBusProxy:g-interface-info) and @property_name is referenced by
15976 * it, then @value is checked against the type of the property.
15978 * 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().
15984 * g_dbus_proxy_get_cached_property_names:
15985 * @proxy: A #GDBusProxy.
15987 * Gets the names of all cached properties on @proxy.
15989 * Returns: (transfer full): A %NULL-terminated array of strings or %NULL if @proxy has no cached properties. Free the returned array with g_strfreev().
15995 * g_dbus_proxy_get_connection:
15996 * @proxy: A #GDBusProxy.
15998 * Gets the connection @proxy is for.
16000 * Returns: (transfer none): A #GDBusConnection owned by @proxy. Do not free.
16006 * g_dbus_proxy_get_default_timeout:
16007 * @proxy: A #GDBusProxy.
16009 * Gets the timeout to use if -1 (specifying default timeout) is
16010 * passed as @timeout_msec in the g_dbus_proxy_call() and
16011 * g_dbus_proxy_call_sync() functions.
16013 * See the #GDBusProxy:g-default-timeout property for more details.
16015 * Returns: Timeout to use for @proxy.
16021 * g_dbus_proxy_get_flags:
16022 * @proxy: A #GDBusProxy.
16024 * Gets the flags that @proxy was constructed with.
16026 * Returns: Flags from the #GDBusProxyFlags enumeration.
16032 * g_dbus_proxy_get_interface_info:
16033 * @proxy: A #GDBusProxy
16035 * Returns the #GDBusInterfaceInfo, if any, specifying the interface
16036 * that @proxy conforms to. See the #GDBusProxy:g-interface-info
16037 * property for more details.
16039 * Returns: A #GDBusInterfaceInfo or %NULL. Do not unref the returned object, it is owned by @proxy.
16045 * g_dbus_proxy_get_interface_name:
16046 * @proxy: A #GDBusProxy.
16048 * Gets the D-Bus interface name @proxy is for.
16050 * Returns: A string owned by @proxy. Do not free.
16056 * g_dbus_proxy_get_name:
16057 * @proxy: A #GDBusProxy.
16059 * Gets the name that @proxy was constructed for.
16061 * Returns: A string owned by @proxy. Do not free.
16067 * g_dbus_proxy_get_name_owner:
16068 * @proxy: A #GDBusProxy.
16070 * The unique name that owns the name that @proxy is for or %NULL if
16071 * no-one currently owns that name. You may connect to the
16072 * #GObject::notify signal to track changes to the
16073 * #GDBusProxy:g-name-owner property.
16075 * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
16081 * g_dbus_proxy_get_object_path:
16082 * @proxy: A #GDBusProxy.
16084 * Gets the object path @proxy is for.
16086 * Returns: A string owned by @proxy. Do not free.
16092 * g_dbus_proxy_new:
16093 * @connection: A #GDBusConnection.
16094 * @flags: Flags used when constructing the proxy.
16095 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16096 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16097 * @object_path: An object path.
16098 * @interface_name: A D-Bus interface name.
16099 * @cancellable: (allow-none): A #GCancellable or %NULL.
16100 * @callback: Callback function to invoke when the proxy is ready.
16101 * @user_data: User data to pass to @callback.
16103 * Creates a proxy for accessing @interface_name on the remote object
16104 * at @object_path owned by @name at @connection and asynchronously
16105 * loads D-Bus properties unless the
16106 * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
16107 * the #GDBusProxy::g-properties-changed signal to get notified about
16108 * property changes.
16110 * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16111 * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16112 * to handle signals from the remote object.
16114 * If @name is a well-known name and the
16115 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16116 * owner currently exists, the message bus will be requested to launch
16117 * a name owner for the name.
16119 * This is a failable asynchronous constructor - when the proxy is
16120 * ready, @callback will be invoked and you can use
16121 * g_dbus_proxy_new_finish() to get the result.
16123 * See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
16125 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16132 * g_dbus_proxy_new_finish:
16133 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
16134 * @error: Return location for error or %NULL.
16136 * Finishes creating a #GDBusProxy.
16138 * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16144 * g_dbus_proxy_new_for_bus:
16145 * @bus_type: A #GBusType.
16146 * @flags: Flags used when constructing the proxy.
16147 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16148 * @name: A bus name (well-known or unique).
16149 * @object_path: An object path.
16150 * @interface_name: A D-Bus interface name.
16151 * @cancellable: (allow-none): A #GCancellable or %NULL.
16152 * @callback: Callback function to invoke when the proxy is ready.
16153 * @user_data: User data to pass to @callback.
16155 * Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
16157 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16164 * g_dbus_proxy_new_for_bus_finish:
16165 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
16166 * @error: Return location for error or %NULL.
16168 * Finishes creating a #GDBusProxy.
16170 * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16176 * g_dbus_proxy_new_for_bus_sync:
16177 * @bus_type: A #GBusType.
16178 * @flags: Flags used when constructing the proxy.
16179 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16180 * @name: A bus name (well-known or unique).
16181 * @object_path: An object path.
16182 * @interface_name: A D-Bus interface name.
16183 * @cancellable: (allow-none): A #GCancellable or %NULL.
16184 * @error: Return location for error or %NULL.
16186 * Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
16188 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16190 * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16196 * g_dbus_proxy_new_sync:
16197 * @connection: A #GDBusConnection.
16198 * @flags: Flags used when constructing the proxy.
16199 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16200 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16201 * @object_path: An object path.
16202 * @interface_name: A D-Bus interface name.
16203 * @cancellable: (allow-none): A #GCancellable or %NULL.
16204 * @error: (allow-none): Return location for error or %NULL.
16206 * Creates a proxy for accessing @interface_name on the remote object
16207 * at @object_path owned by @name at @connection and synchronously
16208 * loads D-Bus properties unless the
16209 * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
16211 * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16212 * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16213 * to handle signals from the remote object.
16215 * If @name is a well-known name and the
16216 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16217 * owner currently exists, the message bus will be requested to launch
16218 * a name owner for the name.
16220 * This is a synchronous failable constructor. See g_dbus_proxy_new()
16221 * and g_dbus_proxy_new_finish() for the asynchronous version.
16223 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16225 * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16231 * g_dbus_proxy_set_cached_property:
16232 * @proxy: A #GDBusProxy
16233 * @property_name: Property name.
16234 * @value: (allow-none): Value for the property or %NULL to remove it from the cache.
16236 * If @value is not %NULL, sets the cached value for the property with
16237 * name @property_name to the value in @value.
16239 * If @value is %NULL, then the cached value is removed from the
16242 * If @proxy has an expected interface (see
16243 * #GDBusProxy:g-interface-info) and @property_name is referenced by
16244 * it, then @value is checked against the type of the property.
16246 * If the @value #GVariant is floating, it is consumed. This allows
16247 * convenient 'inline' use of g_variant_new(), e.g.
16249 * g_dbus_proxy_set_cached_property (proxy,
16251 * g_variant_new ("(si)",
16256 * Normally you will not need to use this method since @proxy is
16257 * tracking changes using the
16258 * <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
16259 * D-Bus signal. However, for performance reasons an object may decide
16260 * to not use this signal for some properties and instead use a
16261 * proprietary out-of-band mechanism to transmit changes.
16263 * As a concrete example, consider an object with a property
16264 * <literal>ChatroomParticipants</literal> which is an array of
16265 * strings. Instead of transmitting the same (long) array every time
16266 * the property changes, it is more efficient to only transmit the
16267 * delta using e.g. signals <literal>ChatroomParticipantJoined(String
16268 * name)</literal> and <literal>ChatroomParticipantParted(String
16276 * g_dbus_proxy_set_default_timeout:
16277 * @proxy: A #GDBusProxy.
16278 * @timeout_msec: Timeout in milliseconds.
16280 * Sets the timeout to use if -1 (specifying default timeout) is
16281 * passed as @timeout_msec in the g_dbus_proxy_call() and
16282 * g_dbus_proxy_call_sync() functions.
16284 * See the #GDBusProxy:g-default-timeout property for more details.
16291 * g_dbus_proxy_set_interface_info:
16292 * @proxy: A #GDBusProxy
16293 * @info: (allow-none): Minimum interface this proxy conforms to or %NULL to unset.
16295 * Ensure that interactions with @proxy conform to the given
16296 * interface. See the #GDBusProxy:g-interface-info property for more
16304 * g_dbus_server_get_client_address:
16305 * @server: A #GDBusServer.
16307 * Gets a D-Bus address string that can be used by clients to connect
16310 * Returns: A D-Bus address string. Do not free, the string is owned by @server.
16316 * g_dbus_server_get_flags:
16317 * @server: A #GDBusServer.
16319 * Gets the flags for @server.
16321 * Returns: A set of flags from the #GDBusServerFlags enumeration.
16327 * g_dbus_server_get_guid:
16328 * @server: A #GDBusServer.
16330 * Gets the GUID for @server.
16332 * Returns: A D-Bus GUID. Do not free this string, it is owned by @server.
16338 * g_dbus_server_is_active:
16339 * @server: A #GDBusServer.
16341 * Gets whether @server is active.
16343 * Returns: %TRUE if server is active, %FALSE otherwise.
16349 * g_dbus_server_new_sync:
16350 * @address: A D-Bus address.
16351 * @flags: Flags from the #GDBusServerFlags enumeration.
16352 * @guid: A D-Bus GUID.
16353 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
16354 * @cancellable: (allow-none): A #GCancellable or %NULL.
16355 * @error: Return location for server or %NULL.
16357 * Creates a new D-Bus server that listens on the first address in
16358 * @address that works.
16360 * Once constructed, you can use g_dbus_server_get_client_address() to
16361 * get a D-Bus address string that clients can use to connect.
16363 * Connect to the #GDBusServer::new-connection signal to handle
16364 * incoming connections.
16366 * The returned #GDBusServer isn't active - you have to start it with
16367 * g_dbus_server_start().
16369 * See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
16372 * This is a synchronous failable constructor. See
16373 * g_dbus_server_new() for the asynchronous version.
16375 * Returns: A #GDBusServer or %NULL if @error is set. Free with g_object_unref().
16381 * g_dbus_server_start:
16382 * @server: A #GDBusServer.
16391 * g_dbus_server_stop:
16392 * @server: A #GDBusServer.
16401 * g_dbus_signal_info_ref:
16402 * @info: A #GDBusSignalInfo
16404 * If @info is statically allocated does nothing. Otherwise increases
16405 * the reference count.
16407 * Returns: The same @info.
16413 * g_dbus_signal_info_unref:
16414 * @info: A #GDBusSignalInfo.
16416 * If @info is statically allocated, does nothing. Otherwise decreases
16417 * the reference count of @info. When its reference count drops to 0,
16418 * the memory used is freed.
16425 * g_desktop_app_info_get_categories:
16426 * @info: a #GDesktopAppInfo
16428 * Gets the categories from the desktop file.
16430 * Returns: The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by ';' or validate it.
16435 * g_desktop_app_info_get_filename:
16436 * @info: a #GDesktopAppInfo
16438 * When @info was created from a known filename, return it. In some
16439 * situations such as the #GDesktopAppInfo returned from
16440 * g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
16442 * Returns: The full path to the file for @info, or %NULL if not known.
16448 * g_desktop_app_info_get_generic_name:
16449 * @info: a #GDesktopAppInfo
16451 * Gets the generic name from the destkop file.
16453 * Returns: The value of the GenericName key
16458 * g_desktop_app_info_get_is_hidden:
16459 * @info: a #GDesktopAppInfo.
16461 * A desktop file is hidden if the Hidden key in it is
16464 * Returns: %TRUE if hidden, %FALSE otherwise.
16469 * g_desktop_app_info_get_keywords:
16470 * @info: a #GDesktopAppInfo
16472 * Gets the keywords from the desktop file.
16474 * Returns: (transfer none): The value of the Keywords key
16480 * g_desktop_app_info_get_nodisplay:
16481 * @info: a #GDesktopAppInfo
16483 * Gets the value of the NoDisplay key, which helps determine if the
16484 * application info should be shown in menus. See
16485 * #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
16487 * Returns: The value of the NoDisplay key
16493 * g_desktop_app_info_get_show_in:
16494 * @info: a #GDesktopAppInfo
16495 * @desktop_env: a string specifying a desktop name
16497 * Checks if the application info should be shown in menus that list available
16498 * applications for a specific name of the desktop, based on the
16499 * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
16501 * If @desktop_env is %NULL, then the name of the desktop set with
16502 * g_desktop_app_info_set_desktop_env() is used.
16504 * Note that g_app_info_should_show() for @info will include this check (with
16505 * %NULL for @desktop_env) as well as additional checks.
16507 * Returns: %TRUE if the @info should be shown in @desktop_env according to the <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE otherwise.
16513 * g_desktop_app_info_get_startup_wm_class:
16514 * @app_info: a #GDesktopAppInfo that supports startup notify
16516 * Retrieves the StartupWMClass field from @app_info. This represents the
16517 * WM_CLASS property of the main window of the application, if launched through
16520 * Returns: (transfer none): the startup WM class, or %NULL if none is set in the desktop file.
16526 * g_desktop_app_info_launch_uris_as_manager:
16527 * @appinfo: a #GDesktopAppInfo
16528 * @uris: (element-type utf8): List of URIs
16529 * @launch_context: a #GAppLaunchContext
16530 * @spawn_flags: #GSpawnFlags, used for each process
16531 * @user_setup: (scope call): a #GSpawnChildSetupFunc, used once for each process.
16532 * @user_setup_data: (closure user_setup): User data for @user_setup
16533 * @pid_callback: (scope call): Callback for child processes
16534 * @pid_callback_data: (closure pid_callback): User data for @callback
16535 * @error: return location for a #GError, or %NULL
16537 * This function performs the equivalent of g_app_info_launch_uris(),
16538 * but is intended primarily for operating system components that
16539 * launch applications. Ordinary applications should use
16540 * g_app_info_launch_uris().
16542 * In contrast to g_app_info_launch_uris(), all processes created will
16543 * always be run directly as children as if by the UNIX fork()/exec()
16546 * This guarantee allows additional control over the exact environment
16547 * of the child processes, which is provided via a setup function
16548 * @user_setup, as well as the process identifier of each child process
16549 * via @pid_callback. See g_spawn_async() for more information about the
16550 * semantics of the @user_setup function.
16552 * Returns: %TRUE on successful launch, %FALSE otherwise.
16557 * g_desktop_app_info_lookup_get_default_for_uri_scheme:
16558 * @lookup: a #GDesktopAppInfoLookup
16559 * @uri_scheme: a string containing a URI scheme.
16561 * Gets the default application for launching applications
16562 * using this URI scheme for a particular GDesktopAppInfoLookup
16565 * The GDesktopAppInfoLookup interface and this function is used
16566 * to implement g_app_info_get_default_for_uri_scheme() backends
16567 * in a GIO module. There is no reason for applications to use it
16568 * directly. Applications should use g_app_info_get_default_for_uri_scheme().
16570 * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
16571 * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
16576 * g_desktop_app_info_new:
16577 * @desktop_id: the desktop file id
16579 * Creates a new #GDesktopAppInfo based on a desktop file id.
16581 * A desktop file id is the basename of the desktop file, including the
16582 * .desktop extension. GIO is looking for a desktop file with this name
16583 * in the <filename>applications</filename> subdirectories of the XDG data
16584 * directories (i.e. the directories specified in the
16585 * <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
16586 * variables). GIO also supports the prefix-to-subdirectory mapping that is
16587 * described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
16588 * (i.e. a desktop id of kde-foo.desktop will match
16589 * <filename>/usr/share/applications/kde/foo.desktop</filename>).
16591 * Returns: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
16596 * g_desktop_app_info_new_from_filename:
16597 * @filename: the path of a desktop file, in the GLib filename encoding
16599 * Creates a new #GDesktopAppInfo.
16601 * Returns: a new #GDesktopAppInfo or %NULL on error.
16606 * g_desktop_app_info_new_from_keyfile:
16607 * @key_file: an opened #GKeyFile
16609 * Creates a new #GDesktopAppInfo.
16611 * Returns: a new #GDesktopAppInfo or %NULL on error.
16617 * g_desktop_app_info_set_desktop_env:
16618 * @desktop_env: a string specifying what desktop this is
16620 * Sets the name of the desktop that the application is running in.
16621 * This is used by g_app_info_should_show() and
16622 * g_desktop_app_info_get_show_in() to evaluate the
16623 * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
16624 * desktop entry fields.
16626 * The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
16627 * Menu specification</ulink> recognizes the following:
16629 * <member>GNOME</member>
16630 * <member>KDE</member>
16631 * <member>ROX</member>
16632 * <member>XFCE</member>
16633 * <member>LXDE</member>
16634 * <member>Unity</member>
16635 * <member>Old</member>
16638 * Should be called only once; subsequent calls are ignored.
16643 * g_drive_can_eject:
16644 * @drive: a #GDrive.
16646 * Checks if a drive can be ejected.
16648 * Returns: %TRUE if the @drive can be ejected, %FALSE otherwise.
16653 * g_drive_can_poll_for_media:
16654 * @drive: a #GDrive.
16656 * Checks if a drive can be polled for media changes.
16658 * Returns: %TRUE if the @drive can be polled for media changes, %FALSE otherwise.
16663 * g_drive_can_start:
16664 * @drive: a #GDrive.
16666 * Checks if a drive can be started.
16668 * Returns: %TRUE if the @drive can be started, %FALSE otherwise.
16674 * g_drive_can_start_degraded:
16675 * @drive: a #GDrive.
16677 * Checks if a drive can be started degraded.
16679 * Returns: %TRUE if the @drive can be started degraded, %FALSE otherwise.
16685 * g_drive_can_stop:
16686 * @drive: a #GDrive.
16688 * Checks if a drive can be stopped.
16690 * Returns: %TRUE if the @drive can be stopped, %FALSE otherwise.
16697 * @drive: a #GDrive.
16698 * @flags: flags affecting the unmount if required for eject
16699 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16700 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16701 * @user_data: user data to pass to @callback
16703 * Asynchronously ejects a drive.
16705 * When the operation is finished, @callback will be called.
16706 * You can then call g_drive_eject_finish() to obtain the
16707 * result of the operation.
16709 * Deprecated: 2.22: Use g_drive_eject_with_operation() instead.
16714 * g_drive_eject_finish:
16715 * @drive: a #GDrive.
16716 * @result: a #GAsyncResult.
16717 * @error: a #GError, or %NULL
16719 * Finishes ejecting a drive.
16721 * Returns: %TRUE if the drive has been ejected successfully, %FALSE otherwise.
16722 * Deprecated: 2.22: Use g_drive_eject_with_operation_finish() instead.
16727 * g_drive_eject_with_operation:
16728 * @drive: a #GDrive.
16729 * @flags: flags affecting the unmount if required for eject
16730 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16731 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16732 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16733 * @user_data: user data passed to @callback.
16735 * Ejects a drive. This is an asynchronous operation, and is
16736 * finished by calling g_drive_eject_with_operation_finish() with the @drive
16737 * and #GAsyncResult data returned in the @callback.
16744 * g_drive_eject_with_operation_finish:
16745 * @drive: a #GDrive.
16746 * @result: a #GAsyncResult.
16747 * @error: a #GError location to store the error occurring, or %NULL to ignore.
16749 * Finishes ejecting a drive. If any errors occurred during the operation,
16750 * @error will be set to contain the errors and %FALSE will be returned.
16752 * Returns: %TRUE if the drive was successfully ejected. %FALSE otherwise.
16758 * g_drive_enumerate_identifiers:
16759 * @drive: a #GDrive
16761 * Gets the kinds of identifiers that @drive has.
16762 * Use g_drive_get_identifier() to obtain the identifiers
16765 * Returns: (transfer full) (array zero-terminated=1): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
16770 * g_drive_get_icon:
16771 * @drive: a #GDrive.
16773 * Gets the icon for @drive.
16775 * Returns: (transfer full): #GIcon for the @drive. Free the returned object with g_object_unref().
16780 * g_drive_get_identifier:
16781 * @drive: a #GDrive
16782 * @kind: the kind of identifier to return
16784 * Gets the identifier of the given kind for @drive.
16786 * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GDrive doesn't have this kind of identifier.
16791 * g_drive_get_name:
16792 * @drive: a #GDrive.
16794 * Gets the name of @drive.
16796 * Returns: a string containing @drive's name. The returned string should be freed when no longer needed.
16801 * g_drive_get_sort_key:
16802 * @drive: A #GDrive.
16804 * Gets the sort key for @drive, if any.
16806 * Returns: Sorting key for @drive or %NULL if no such key is available.
16812 * g_drive_get_start_stop_type:
16813 * @drive: a #GDrive.
16815 * Gets a hint about how a drive can be started/stopped.
16817 * Returns: A value from the #GDriveStartStopType enumeration.
16823 * g_drive_get_symbolic_icon:
16824 * @drive: a #GDrive.
16826 * Gets the icon for @drive.
16828 * Returns: (transfer full): symbolic #GIcon for the @drive. Free the returned object with g_object_unref().
16834 * g_drive_get_volumes:
16835 * @drive: a #GDrive.
16837 * Get a list of mountable volumes for @drive.
16839 * The returned list should be freed with g_list_free(), after
16840 * its elements have been unreffed with g_object_unref().
16842 * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive.
16847 * g_drive_has_media:
16848 * @drive: a #GDrive.
16850 * Checks if the @drive has media. Note that the OS may not be polling
16851 * the drive for media changes; see g_drive_is_media_check_automatic()
16852 * for more details.
16854 * Returns: %TRUE if @drive has media, %FALSE otherwise.
16859 * g_drive_has_volumes:
16860 * @drive: a #GDrive.
16862 * Check if @drive has any mountable volumes.
16864 * Returns: %TRUE if the @drive contains volumes, %FALSE otherwise.
16869 * g_drive_is_media_check_automatic:
16870 * @drive: a #GDrive.
16872 * Checks if @drive is capabable of automatically detecting media changes.
16874 * Returns: %TRUE if the @drive is capabable of automatically detecting media changes, %FALSE otherwise.
16879 * g_drive_is_media_removable:
16880 * @drive: a #GDrive.
16882 * Checks if the @drive supports removable media.
16884 * Returns: %TRUE if @drive supports removable media, %FALSE otherwise.
16889 * g_drive_poll_for_media:
16890 * @drive: a #GDrive.
16891 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16892 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16893 * @user_data: user data to pass to @callback
16895 * Asynchronously polls @drive to see if media has been inserted or removed.
16897 * When the operation is finished, @callback will be called.
16898 * You can then call g_drive_poll_for_media_finish() to obtain the
16899 * result of the operation.
16904 * g_drive_poll_for_media_finish:
16905 * @drive: a #GDrive.
16906 * @result: a #GAsyncResult.
16907 * @error: a #GError, or %NULL
16909 * Finishes an operation started with g_drive_poll_for_media() on a drive.
16911 * Returns: %TRUE if the drive has been poll_for_mediaed successfully, %FALSE otherwise.
16917 * @drive: a #GDrive.
16918 * @flags: flags affecting the start operation.
16919 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16920 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16921 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16922 * @user_data: user data to pass to @callback
16924 * Asynchronously starts a drive.
16926 * When the operation is finished, @callback will be called.
16927 * You can then call g_drive_start_finish() to obtain the
16928 * result of the operation.
16935 * g_drive_start_finish:
16936 * @drive: a #GDrive.
16937 * @result: a #GAsyncResult.
16938 * @error: a #GError, or %NULL
16940 * Finishes starting a drive.
16942 * Returns: %TRUE if the drive has been started successfully, %FALSE otherwise.
16949 * @drive: a #GDrive.
16950 * @flags: flags affecting the unmount if required for stopping.
16951 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16952 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16953 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16954 * @user_data: user data to pass to @callback
16956 * Asynchronously stops a drive.
16958 * When the operation is finished, @callback will be called.
16959 * You can then call g_drive_stop_finish() to obtain the
16960 * result of the operation.
16967 * g_drive_stop_finish:
16968 * @drive: a #GDrive.
16969 * @result: a #GAsyncResult.
16970 * @error: a #GError, or %NULL
16972 * Finishes stopping a drive.
16974 * Returns: %TRUE if the drive has been stopped successfully, %FALSE otherwise.
16980 * g_emblem_get_icon:
16981 * @emblem: a #GEmblem from which the icon should be extracted.
16983 * Gives back the icon from @emblem.
16985 * Returns: (transfer none): a #GIcon. The returned object belongs to the emblem and should not be modified or freed.
16991 * g_emblem_get_origin:
16992 * @emblem: a #GEmblem
16994 * Gets the origin of the emblem.
16996 * Returns: (transfer none): the origin of the emblem
17003 * @icon: a GIcon containing the icon.
17005 * Creates a new emblem for @icon.
17007 * Returns: a new #GEmblem.
17013 * g_emblem_new_with_origin:
17014 * @icon: a GIcon containing the icon.
17015 * @origin: a GEmblemOrigin enum defining the emblem's origin
17017 * Creates a new emblem for @icon.
17019 * Returns: a new #GEmblem.
17025 * g_emblemed_icon_add_emblem:
17026 * @emblemed: a #GEmblemedIcon
17027 * @emblem: a #GEmblem
17029 * Adds @emblem to the #GList of #GEmblem <!-- -->s.
17036 * g_emblemed_icon_clear_emblems:
17037 * @emblemed: a #GEmblemedIcon
17039 * Removes all the emblems from @icon.
17046 * g_emblemed_icon_get_emblems:
17047 * @emblemed: a #GEmblemedIcon
17049 * Gets the list of emblems for the @icon.
17051 * Returns: (element-type Gio.Emblem) (transfer none): a #GList of #GEmblem <!-- -->s that is owned by @emblemed
17057 * g_emblemed_icon_get_icon:
17058 * @emblemed: a #GEmblemedIcon
17060 * Gets the main icon for @emblemed.
17062 * Returns: (transfer none): a #GIcon that is owned by @emblemed
17068 * g_emblemed_icon_new:
17070 * @emblem: (allow-none): a #GEmblem, or %NULL
17072 * Creates a new emblemed icon for @icon with the emblem @emblem.
17074 * Returns: (transfer full) (type GEmblemedIcon): a new #GIcon
17080 * g_file_append_to:
17081 * @file: input #GFile
17082 * @flags: a set of #GFileCreateFlags
17083 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17084 * @error: a #GError, or %NULL
17086 * Gets an output stream for appending data to the file.
17087 * If the file doesn't already exist it is created.
17089 * By default files created are generally readable by everyone,
17090 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17091 * will be made readable only to the current user, to the level that
17092 * is supported on the target filesystem.
17094 * If @cancellable is not %NULL, then the operation can be cancelled
17095 * by triggering the cancellable object from another thread. If the
17096 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17099 * Some file systems don't allow all file names, and may return an
17100 * %G_IO_ERROR_INVALID_FILENAME error. If the file is a directory the
17101 * %G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are
17102 * possible too, and depend on what kind of filesystem the file is on.
17104 * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
17109 * g_file_append_to_async:
17110 * @file: input #GFile
17111 * @flags: a set of #GFileCreateFlags
17112 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17113 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17114 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17115 * @user_data: (closure): the data to pass to callback function
17117 * Asynchronously opens @file for appending.
17119 * For more details, see g_file_append_to() which is
17120 * the synchronous version of this call.
17122 * When the operation is finished, @callback will be called.
17123 * You can then call g_file_append_to_finish() to get the result
17124 * of the operation.
17129 * g_file_append_to_finish:
17130 * @file: input #GFile
17131 * @res: #GAsyncResult
17132 * @error: a #GError, or %NULL
17134 * Finishes an asynchronous file append operation started with
17135 * g_file_append_to_async().
17137 * Returns: (transfer full): a valid #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17142 * g_file_attribute_info_list_add:
17143 * @list: a #GFileAttributeInfoList.
17144 * @name: the name of the attribute to add.
17145 * @type: the #GFileAttributeType for the attribute.
17146 * @flags: #GFileAttributeInfoFlags for the attribute.
17148 * Adds a new attribute with @name to the @list, setting
17149 * its @type and @flags.
17154 * g_file_attribute_info_list_dup:
17155 * @list: a #GFileAttributeInfoList to duplicate.
17157 * Makes a duplicate of a file attribute info list.
17159 * Returns: a copy of the given @list.
17164 * g_file_attribute_info_list_lookup:
17165 * @list: a #GFileAttributeInfoList.
17166 * @name: the name of the attribute to lookup.
17168 * Gets the file attribute with the name @name from @list.
17170 * Returns: a #GFileAttributeInfo for the @name, or %NULL if an attribute isn't found.
17175 * g_file_attribute_info_list_new:
17177 * Creates a new file attribute info list.
17179 * Returns: a #GFileAttributeInfoList.
17184 * g_file_attribute_info_list_ref:
17185 * @list: a #GFileAttributeInfoList to reference.
17187 * References a file attribute info list.
17189 * Returns: #GFileAttributeInfoList or %NULL on error.
17194 * g_file_attribute_info_list_unref:
17195 * @list: The #GFileAttributeInfoList to unreference.
17197 * Removes a reference from the given @list. If the reference count
17198 * falls to zero, the @list is deleted.
17203 * g_file_attribute_matcher_enumerate_namespace:
17204 * @matcher: a #GFileAttributeMatcher.
17205 * @ns: a string containing a file attribute namespace.
17207 * Checks if the matcher will match all of the keys in a given namespace.
17208 * This will always return %TRUE if a wildcard character is in use (e.g. if
17209 * matcher was created with "standard::*" and @ns is "standard", or if matcher was created
17210 * using "*" and namespace is anything.)
17212 * TODO: this is awkwardly worded.
17214 * Returns: %TRUE if the matcher matches all of the entries in the given @ns, %FALSE otherwise.
17219 * g_file_attribute_matcher_enumerate_next:
17220 * @matcher: a #GFileAttributeMatcher.
17222 * Gets the next matched attribute from a #GFileAttributeMatcher.
17224 * Returns: a string containing the next attribute or %NULL if no more attribute exist.
17229 * g_file_attribute_matcher_matches:
17230 * @matcher: a #GFileAttributeMatcher.
17231 * @attribute: a file attribute key.
17233 * Checks if an attribute will be matched by an attribute matcher. If
17234 * the matcher was created with the "*" matching string, this function
17235 * will always return %TRUE.
17237 * Returns: %TRUE if @attribute matches @matcher. %FALSE otherwise.
17242 * g_file_attribute_matcher_matches_only:
17243 * @matcher: a #GFileAttributeMatcher.
17244 * @attribute: a file attribute key.
17246 * Checks if a attribute matcher only matches a given attribute. Always
17247 * returns %FALSE if "*" was used when creating the matcher.
17249 * Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
17254 * g_file_attribute_matcher_new:
17255 * @attributes: an attribute string to match.
17257 * Creates a new file attribute matcher, which matches attributes
17258 * against a given string. #GFileAttributeMatcher<!-- -->s are reference
17259 * counted structures, and are created with a reference count of 1. If
17260 * the number of references falls to 0, the #GFileAttributeMatcher is
17261 * automatically destroyed.
17263 * The @attribute string should be formatted with specific keys separated
17264 * from namespaces with a double colon. Several "namespace::key" strings may be
17265 * concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
17266 * The wildcard "*" may be used to match all keys and namespaces, or
17267 * "namespace::*" will match all keys in a given namespace.
17269 * Examples of strings to use:
17271 * <title>File Attribute Matcher strings and results</title>
17272 * <tgroup cols='2' align='left'><thead>
17273 * <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
17275 * <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
17276 * <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
17277 * <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
17278 * all keys in the unix namespace.</entry></row>
17279 * </tbody></tgroup>
17282 * Returns: a #GFileAttributeMatcher.
17287 * g_file_attribute_matcher_ref:
17288 * @matcher: a #GFileAttributeMatcher.
17290 * References a file attribute matcher.
17292 * Returns: a #GFileAttributeMatcher.
17297 * g_file_attribute_matcher_subtract:
17298 * @matcher: Matcher to subtract from
17299 * @subtract: The matcher to subtract
17301 * Subtracts all attributes of @subtract from @matcher and returns
17302 * a matcher that supports those attributes.
17304 * Note that currently it is not possible to remove a single
17305 * attribute when the @matcher matches the whole namespace - or remove
17306 * a namespace or attribute when the matcher matches everything. This
17307 * is a limitation of the current implementation, but may be fixed
17310 * Returns: A file attribute matcher matching all attributes of @matcher that are not matched by @subtract
17315 * g_file_attribute_matcher_to_string:
17316 * @matcher: (allow-none): a #GFileAttributeMatcher.
17318 * Prints what the matcher is matching against. The format will be
17319 * equal to the format passed to g_file_attribute_matcher_new().
17320 * The output however, might not be identical, as the matcher may
17321 * decide to use a different order or omit needless parts.
17323 * Returns: a string describing the attributes the matcher matches against or %NULL if @matcher was %NULL.
17329 * g_file_attribute_matcher_unref:
17330 * @matcher: a #GFileAttributeMatcher.
17332 * Unreferences @matcher. If the reference count falls below 1,
17333 * the @matcher is automatically freed.
17339 * @source: input #GFile
17340 * @destination: destination #GFile
17341 * @flags: set of #GFileCopyFlags
17342 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17343 * @progress_callback: (allow-none) (scope call): function to callback with progress information, or %NULL if progress information is not needed
17344 * @progress_callback_data: (closure): user data to pass to @progress_callback
17345 * @error: #GError to set on error, or %NULL
17347 * Copies the file @source to the location specified by @destination.
17348 * Can not handle recursive copies of directories.
17350 * If the flag #G_FILE_COPY_OVERWRITE is specified an already
17351 * existing @destination file is overwritten.
17353 * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
17354 * will be copied as symlinks, otherwise the target of the
17355 * @source symlink will be copied.
17357 * If @cancellable is not %NULL, then the operation can be cancelled by
17358 * triggering the cancellable object from another thread. If the operation
17359 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17361 * If @progress_callback is not %NULL, then the operation can be monitored
17362 * by setting this to a #GFileProgressCallback function.
17363 * @progress_callback_data will be passed to this function. It is guaranteed
17364 * that this callback will be called after all data has been transferred with
17365 * the total number of bytes copied during the operation.
17367 * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND error
17368 * is returned, independent on the status of the @destination.
17370 * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then
17371 * the error %G_IO_ERROR_EXISTS is returned.
17373 * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
17374 * error is returned. If trying to overwrite a directory with a directory the
17375 * %G_IO_ERROR_WOULD_MERGE error is returned.
17377 * If the source is a directory and the target does not exist, or
17378 * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
17379 * %G_IO_ERROR_WOULD_RECURSE error is returned.
17381 * If you are interested in copying the #GFile object itself (not the on-disk
17382 * file), see g_file_dup().
17384 * Returns: %TRUE on success, %FALSE otherwise.
17389 * g_file_copy_async: (skip)
17390 * @source: input #GFile
17391 * @destination: destination #GFile
17392 * @flags: set of #GFileCopyFlags
17393 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17394 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17395 * @progress_callback: (allow-none): function to callback with progress information, or %NULL if progress information is not needed
17396 * @progress_callback_data: (closure): user data to pass to @progress_callback
17397 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17398 * @user_data: the data to pass to callback function
17400 * Copies the file @source to the location specified by @destination
17401 * asynchronously. For details of the behaviour, see g_file_copy().
17403 * If @progress_callback is not %NULL, then that function that will be called
17404 * just like in g_file_copy(), however the callback will run in the main loop,
17405 * not in the thread that is doing the I/O operation.
17407 * When the operation is finished, @callback will be called. You can then call
17408 * g_file_copy_finish() to get the result of the operation.
17413 * g_file_copy_attributes:
17414 * @source: a #GFile with attributes
17415 * @destination: a #GFile to copy attributes to
17416 * @flags: a set of #GFileCopyFlags
17417 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17418 * @error: a #GError, %NULL to ignore
17420 * Copies the file attributes from @source to @destination.
17422 * Normally only a subset of the file attributes are copied,
17423 * those that are copies in a normal file copy operation
17424 * (which for instance does not include e.g. owner). However
17425 * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
17426 * all the metadata that is possible to copy is copied. This
17427 * is useful when implementing move by copy + delete source.
17429 * Returns: %TRUE if the attributes were copied successfully, %FALSE otherwise.
17434 * g_file_copy_finish:
17435 * @file: input #GFile
17436 * @res: a #GAsyncResult
17437 * @error: a #GError, or %NULL
17439 * Finishes copying the file started with g_file_copy_async().
17441 * Returns: a %TRUE on success, %FALSE on error.
17447 * @file: input #GFile
17448 * @flags: a set of #GFileCreateFlags
17449 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17450 * @error: a #GError, or %NULL
17452 * Creates a new file and returns an output stream for writing to it.
17453 * The file must not already exist.
17455 * By default files created are generally readable by everyone,
17456 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17457 * will be made readable only to the current user, to the level
17458 * that is supported on the target filesystem.
17460 * If @cancellable is not %NULL, then the operation can be cancelled
17461 * by triggering the cancellable object from another thread. If the
17462 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17465 * If a file or directory with this name already exists the
17466 * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
17467 * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
17468 * error, and if the name is to long %G_IO_ERROR_FILENAME_TOO_LONG will
17469 * be returned. Other errors are possible too, and depend on what kind
17470 * of filesystem the file is on.
17472 * Returns: (transfer full): a #GFileOutputStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17477 * g_file_create_async:
17478 * @file: input #GFile
17479 * @flags: a set of #GFileCreateFlags
17480 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17481 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17482 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17483 * @user_data: (closure): the data to pass to callback function
17485 * Asynchronously creates a new file and returns an output stream
17486 * for writing to it. The file must not already exist.
17488 * For more details, see g_file_create() which is
17489 * the synchronous version of this call.
17491 * When the operation is finished, @callback will be called.
17492 * You can then call g_file_create_finish() to get the result
17493 * of the operation.
17498 * g_file_create_finish:
17499 * @file: input #GFile
17500 * @res: a #GAsyncResult
17501 * @error: a #GError, or %NULL
17503 * Finishes an asynchronous file create operation started with
17504 * g_file_create_async().
17506 * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17511 * g_file_create_readwrite:
17513 * @flags: a set of #GFileCreateFlags
17514 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17515 * @error: return location for a #GError, or %NULL
17517 * Creates a new file and returns a stream for reading and
17518 * writing to it. The file must not already exist.
17520 * By default files created are generally readable by everyone,
17521 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17522 * will be made readable only to the current user, to the level
17523 * that is supported on the target filesystem.
17525 * If @cancellable is not %NULL, then the operation can be cancelled
17526 * by triggering the cancellable object from another thread. If the
17527 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17530 * If a file or directory with this name already exists, the
17531 * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
17532 * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
17533 * error, and if the name is too long, %G_IO_ERROR_FILENAME_TOO_LONG
17534 * will be returned. Other errors are possible too, and depend on what
17535 * kind of filesystem the file is on.
17537 * Note that in many non-local file cases read and write streams are
17538 * not supported, so make sure you really need to do read and write
17539 * streaming, rather than just opening for reading or writing.
17541 * Returns: (transfer full): a #GFileIOStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17547 * g_file_create_readwrite_async:
17548 * @file: input #GFile
17549 * @flags: a set of #GFileCreateFlags
17550 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17551 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17552 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17553 * @user_data: (closure): the data to pass to callback function
17555 * Asynchronously creates a new file and returns a stream
17556 * for reading and writing to it. The file must not already exist.
17558 * For more details, see g_file_create_readwrite() which is
17559 * the synchronous version of this call.
17561 * When the operation is finished, @callback will be called.
17562 * You can then call g_file_create_readwrite_finish() to get
17563 * the result of the operation.
17570 * g_file_create_readwrite_finish:
17571 * @file: input #GFile
17572 * @res: a #GAsyncResult
17573 * @error: a #GError, or %NULL
17575 * Finishes an asynchronous file create operation started with
17576 * g_file_create_readwrite_async().
17578 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
17585 * @file: input #GFile
17586 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17587 * @error: a #GError, or %NULL
17589 * Deletes a file. If the @file is a directory, it will only be
17590 * deleted if it is empty. This has the same semantics as g_unlink().
17592 * If @cancellable is not %NULL, then the operation can be cancelled by
17593 * triggering the cancellable object from another thread. If the operation
17594 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17596 * Virtual: delete_file
17597 * Returns: %TRUE if the file was deleted. %FALSE otherwise.
17602 * g_file_delete_async:
17603 * @file: input #GFile
17604 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17605 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17606 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17607 * @user_data: the data to pass to callback function
17609 * Asynchronously delete a file. If the @file is a directory, it will
17610 * only be deleted if it is empty. This has the same semantics as
17613 * Virtual: delete_file_async
17619 * g_file_delete_finish:
17620 * @file: input #GFile
17621 * @res: a #GAsyncResult
17622 * @error: a #GError, or %NULL
17624 * Finishes deleting a file started with g_file_delete_async().
17626 * Virtual: delete_file_finish
17632 * g_file_descriptor_based_get_fd:
17633 * @fd_based: a #GFileDescriptorBased.
17635 * Gets the underlying file descriptor.
17637 * Returns: The file descriptor
17644 * @file: input #GFile
17646 * Duplicates a #GFile handle. This operation does not duplicate
17647 * the actual file or directory represented by the #GFile; see
17648 * g_file_copy() if attempting to copy a file.
17650 * This call does no blocking I/O.
17652 * Returns: (transfer full): a new #GFile that is a duplicate of the given #GFile.
17657 * g_file_eject_mountable:
17658 * @file: input #GFile
17659 * @flags: flags affecting the operation
17660 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17661 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17662 * @user_data: (closure): the data to pass to callback function
17664 * Starts an asynchronous eject on a mountable.
17665 * When this operation has completed, @callback will be called with
17666 * @user_user data, and the operation can be finalized with
17667 * g_file_eject_mountable_finish().
17669 * If @cancellable is not %NULL, then the operation can be cancelled by
17670 * triggering the cancellable object from another thread. If the operation
17671 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17673 * Deprecated: 2.22: Use g_file_eject_mountable_with_operation() instead.
17678 * g_file_eject_mountable_finish:
17679 * @file: input #GFile
17680 * @result: a #GAsyncResult
17681 * @error: a #GError, or %NULL
17683 * Finishes an asynchronous eject operation started by
17684 * g_file_eject_mountable().
17686 * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17687 * Deprecated: 2.22: Use g_file_eject_mountable_with_operation_finish() instead.
17692 * g_file_eject_mountable_with_operation:
17693 * @file: input #GFile
17694 * @flags: flags affecting the operation
17695 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
17696 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17697 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17698 * @user_data: (closure): the data to pass to callback function
17700 * Starts an asynchronous eject on a mountable.
17701 * When this operation has completed, @callback will be called with
17702 * @user_user data, and the operation can be finalized with
17703 * g_file_eject_mountable_with_operation_finish().
17705 * If @cancellable is not %NULL, then the operation can be cancelled by
17706 * triggering the cancellable object from another thread. If the operation
17707 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17714 * g_file_eject_mountable_with_operation_finish:
17715 * @file: input #GFile
17716 * @result: a #GAsyncResult
17717 * @error: a #GError, or %NULL
17719 * Finishes an asynchronous eject operation started by
17720 * g_file_eject_mountable_with_operation().
17722 * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17728 * g_file_enumerate_children:
17729 * @file: input #GFile
17730 * @attributes: an attribute query string
17731 * @flags: a set of #GFileQueryInfoFlags
17732 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17733 * @error: #GError for error reporting
17735 * Gets the requested information about the files in a directory.
17736 * The result is a #GFileEnumerator object that will give out
17737 * #GFileInfo objects for all the files in the directory.
17739 * The @attributes value is a string that specifies the file
17740 * attributes that should be gathered. It is not an error if
17741 * it's not possible to read a particular requested attribute
17742 * from a file - it just won't be set. @attributes should
17743 * be a comma-separated list of attributes or attribute wildcards.
17744 * The wildcard "*" means all attributes, and a wildcard like
17745 * "standard::*" means all attributes in the standard namespace.
17746 * An example attribute query be "standard::*,owner::user".
17747 * The standard attributes are available as defines, like
17748 * #G_FILE_ATTRIBUTE_STANDARD_NAME.
17750 * If @cancellable is not %NULL, then the operation can be cancelled
17751 * by triggering the cancellable object from another thread. If the
17752 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17755 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
17756 * be returned. If the file is not a directory, the %G_FILE_ERROR_NOTDIR
17757 * error will be returned. Other errors are possible too.
17759 * Returns: (transfer full): A #GFileEnumerator if successful, %NULL on error. Free the returned object with g_object_unref().
17764 * g_file_enumerate_children_async:
17765 * @file: input #GFile
17766 * @attributes: an attribute query string
17767 * @flags: a set of #GFileQueryInfoFlags
17768 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17769 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17770 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17771 * @user_data: (closure): the data to pass to callback function
17773 * Asynchronously gets the requested information about the files
17774 * in a directory. The result is a #GFileEnumerator object that will
17775 * give out #GFileInfo objects for all the files in the directory.
17777 * For more details, see g_file_enumerate_children() which is
17778 * the synchronous version of this call.
17780 * When the operation is finished, @callback will be called. You can
17781 * then call g_file_enumerate_children_finish() to get the result of
17787 * g_file_enumerate_children_finish:
17788 * @file: input #GFile
17789 * @res: a #GAsyncResult
17790 * @error: a #GError
17792 * Finishes an async enumerate children operation.
17793 * See g_file_enumerate_children_async().
17795 * Returns: (transfer full): a #GFileEnumerator or %NULL if an error occurred. Free the returned object with g_object_unref().
17800 * g_file_enumerator_close:
17801 * @enumerator: a #GFileEnumerator.
17802 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17803 * @error: location to store the error occurring, or %NULL to ignore
17805 * Releases all resources used by this enumerator, making the
17806 * enumerator return %G_IO_ERROR_CLOSED on all calls.
17808 * This will be automatically called when the last reference
17809 * is dropped, but you might want to call this function to make
17810 * sure resources are released as early as possible.
17812 * Returns: #TRUE on success or #FALSE on error.
17817 * g_file_enumerator_close_async:
17818 * @enumerator: a #GFileEnumerator.
17819 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17820 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17821 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17822 * @user_data: (closure): the data to pass to callback function
17824 * Asynchronously closes the file enumerator.
17826 * If @cancellable is not %NULL, then the operation can be cancelled by
17827 * triggering the cancellable object from another thread. If the operation
17828 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
17829 * g_file_enumerator_close_finish().
17834 * g_file_enumerator_close_finish:
17835 * @enumerator: a #GFileEnumerator.
17836 * @result: a #GAsyncResult.
17837 * @error: a #GError location to store the error occurring, or %NULL to ignore.
17839 * Finishes closing a file enumerator, started from g_file_enumerator_close_async().
17841 * If the file enumerator was already closed when g_file_enumerator_close_async()
17842 * was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
17843 * return %FALSE. If the file enumerator had pending operation when the close
17844 * operation was started, then this function will report %G_IO_ERROR_PENDING, and
17845 * return %FALSE. If @cancellable was not %NULL, then the operation may have been
17846 * cancelled by triggering the cancellable object from another thread. If the operation
17847 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
17850 * Returns: %TRUE if the close operation has finished successfully.
17855 * g_file_enumerator_get_container:
17856 * @enumerator: a #GFileEnumerator
17858 * Get the #GFile container which is being enumerated.
17860 * Returns: (transfer none): the #GFile which is being enumerated.
17866 * g_file_enumerator_has_pending:
17867 * @enumerator: a #GFileEnumerator.
17869 * Checks if the file enumerator has pending operations.
17871 * Returns: %TRUE if the @enumerator has pending operations.
17876 * g_file_enumerator_is_closed:
17877 * @enumerator: a #GFileEnumerator.
17879 * Checks if the file enumerator has been closed.
17881 * Returns: %TRUE if the @enumerator is closed.
17886 * g_file_enumerator_next_file:
17887 * @enumerator: a #GFileEnumerator.
17888 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17889 * @error: location to store the error occurring, or %NULL to ignore
17891 * Returns information for the next file in the enumerated object.
17892 * Will block until the information is available. The #GFileInfo
17893 * returned from this function will contain attributes that match the
17894 * attribute string that was passed when the #GFileEnumerator was created.
17896 * On error, returns %NULL and sets @error to the error. If the
17897 * enumerator is at the end, %NULL will be returned and @error will
17900 * 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.
17905 * g_file_enumerator_next_files_async:
17906 * @enumerator: a #GFileEnumerator.
17907 * @num_files: the number of file info objects to request
17908 * @io_priority: the <link linkend="gioscheduler">io priority</link> of the request.
17909 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17910 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17911 * @user_data: (closure): the data to pass to callback function
17913 * Request information for a number of files from the enumerator asynchronously.
17914 * When all i/o for the operation is finished the @callback will be called with
17915 * the requested information.
17917 * The callback can be called with less than @num_files files in case of error
17918 * or at the end of the enumerator. In case of a partial error the callback will
17919 * be called with any succeeding items and no error, and on the next request the
17920 * error will be reported. If a request is cancelled the callback will be called
17921 * with %G_IO_ERROR_CANCELLED.
17923 * During an async request no other sync and async calls are allowed, and will
17924 * result in %G_IO_ERROR_PENDING errors.
17926 * Any outstanding i/o request with higher priority (lower numerical value) will
17927 * be executed before an outstanding request with lower priority. Default
17928 * priority is %G_PRIORITY_DEFAULT.
17933 * g_file_enumerator_next_files_finish:
17934 * @enumerator: a #GFileEnumerator.
17935 * @result: a #GAsyncResult.
17936 * @error: a #GError location to store the error occurring, or %NULL to ignore.
17938 * Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
17940 * 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.
17945 * g_file_enumerator_set_pending:
17946 * @enumerator: a #GFileEnumerator.
17947 * @pending: a boolean value.
17949 * Sets the file enumerator as having pending operations.
17955 * @file1: the first #GFile
17956 * @file2: the second #GFile
17958 * Checks equality of two given #GFiles.
17960 * Note that two #GFiles that differ can still refer to the same
17961 * file on the filesystem due to various forms of filename
17964 * This call does no blocking I/O.
17966 * Returns: %TRUE if @file1 and @file2 are equal. %FALSE if either is not a #GFile.
17971 * g_file_find_enclosing_mount:
17972 * @file: input #GFile
17973 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17974 * @error: a #GError
17976 * Gets a #GMount for the #GFile.
17978 * If the #GFileIface for @file does not have a mount (e.g.
17979 * possibly a remote share), @error will be set to %G_IO_ERROR_NOT_FOUND
17980 * and %NULL will be returned.
17982 * If @cancellable is not %NULL, then the operation can be cancelled by
17983 * triggering the cancellable object from another thread. If the operation
17984 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17986 * Returns: (transfer full): a #GMount where the @file is located or %NULL on error. Free the returned object with g_object_unref().
17991 * g_file_find_enclosing_mount_async:
17993 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17994 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17995 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17996 * @user_data: (closure): the data to pass to callback function
17998 * Asynchronously gets the mount for the file.
18000 * For more details, see g_file_find_enclosing_mount() which is
18001 * the synchronous version of this call.
18003 * When the operation is finished, @callback will be called.
18004 * You can then call g_file_find_enclosing_mount_finish() to
18005 * get the result of the operation.
18010 * g_file_find_enclosing_mount_finish:
18012 * @res: a #GAsyncResult
18013 * @error: a #GError
18015 * Finishes an asynchronous find mount request.
18016 * See g_file_find_enclosing_mount_async().
18018 * Returns: (transfer full): #GMount for given @file or %NULL on error. Free the returned object with g_object_unref().
18023 * g_file_get_basename:
18024 * @file: input #GFile
18026 * Gets the base name (the last component of the path) for a given #GFile.
18028 * If called for the top level of a system (such as the filesystem root
18029 * or a uri like sftp://host/) it will return a single directory separator
18030 * (and on Windows, possibly a drive letter).
18032 * The base name is a byte string (not UTF-8). It has no defined encoding
18033 * or rules other than it may not contain zero bytes. If you want to use
18034 * filenames in a user interface you should use the display name that you
18035 * can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
18036 * attribute with g_file_query_info().
18038 * This call does no blocking I/O.
18040 * 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.
18045 * g_file_get_child:
18046 * @file: input #GFile
18047 * @name: string containing the child's basename
18049 * Gets a child of @file with basename equal to @name.
18051 * Note that the file with that specific name might not exist, but
18052 * you can still have a #GFile that points to it. You can use this
18053 * for instance to create that file.
18055 * This call does no blocking I/O.
18057 * Returns: (transfer full): a #GFile to a child specified by @name. Free the returned object with g_object_unref().
18062 * g_file_get_child_for_display_name:
18063 * @file: input #GFile
18064 * @display_name: string to a possible child
18065 * @error: return location for an error
18067 * Gets the child of @file for a given @display_name (i.e. a UTF-8
18068 * version of the name). If this function fails, it returns %NULL
18069 * and @error will be set. This is very useful when constructing a
18070 * #GFile for a new file and the user entered the filename in the
18071 * user interface, for instance when you select a directory and
18072 * type a filename in the file selector.
18074 * This call does no blocking I/O.
18076 * 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().
18081 * g_file_get_parent:
18082 * @file: input #GFile
18084 * Gets the parent directory for the @file.
18085 * If the @file represents the root directory of the
18086 * file system, then %NULL will be returned.
18088 * This call does no blocking I/O.
18090 * 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().
18095 * g_file_get_parse_name:
18096 * @file: input #GFile
18098 * Gets the parse name of the @file.
18099 * A parse name is a UTF-8 string that describes the
18100 * file such that one can get the #GFile back using
18101 * g_file_parse_name().
18103 * This is generally used to show the #GFile as a nice
18104 * full-pathname kind of string in a user interface,
18105 * like in a location entry.
18107 * For local files with names that can safely be converted
18108 * to UTF-8 the pathname is used, otherwise the IRI is used
18109 * (a form of URI that allows UTF-8 characters unescaped).
18111 * This call does no blocking I/O.
18113 * Returns: a string containing the #GFile's parse name. The returned string should be freed with g_free() when no longer needed.
18119 * @file: input #GFile
18121 * Gets the local pathname for #GFile, if one exists.
18123 * This call does no blocking I/O.
18125 * 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.
18130 * g_file_get_relative_path:
18131 * @parent: input #GFile
18132 * @descendant: input #GFile
18134 * Gets the path for @descendant relative to @parent.
18136 * This call does no blocking I/O.
18138 * 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.
18144 * @file: input #GFile
18146 * Gets the URI for the @file.
18148 * This call does no blocking I/O.
18150 * Returns: a string containing the #GFile's URI. The returned string should be freed with g_free() when no longer needed.
18155 * g_file_get_uri_scheme:
18156 * @file: input #GFile
18158 * Gets the URI scheme for a #GFile.
18159 * RFC 3986 decodes the scheme as:
18161 * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
18162 * </programlisting>
18163 * Common schemes include "file", "http", "ftp", etc.
18165 * This call does no blocking I/O.
18167 * Returns: a string containing the URI scheme for the given #GFile. The returned string should be freed with g_free() when no longer needed.
18172 * g_file_has_parent:
18173 * @file: input #GFile
18174 * @parent: (allow-none): the parent to check for, or %NULL
18176 * Checks if @file has a parent, and optionally, if it is @parent.
18178 * If @parent is %NULL then this function returns %TRUE if @file has any
18179 * parent at all. If @parent is non-%NULL then %TRUE is only returned
18180 * if @file is a child of @parent.
18182 * Returns: %TRUE if @file is a child of @parent (or any parent in the case that @parent is %NULL).
18188 * g_file_has_prefix:
18189 * @file: input #GFile
18190 * @prefix: input #GFile
18192 * Checks whether @file has the prefix specified by @prefix.
18194 * In other words, if the names of initial elements of @file's
18195 * pathname match @prefix. Only full pathname elements are matched,
18196 * so a path like /foo is not considered a prefix of /foobar, only
18199 * This call does no I/O, as it works purely on names. As such it can
18200 * sometimes return %FALSE even if @file is inside a @prefix (from a
18201 * filesystem point of view), because the prefix of @file is an alias
18204 * Virtual: prefix_matches
18205 * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix, %FALSE otherwise.
18210 * g_file_has_uri_scheme:
18211 * @file: input #GFile
18212 * @uri_scheme: a string containing a URI scheme
18214 * Checks to see if a #GFile has a given URI scheme.
18216 * This call does no blocking I/O.
18218 * Returns: %TRUE if #GFile's backend supports the given URI scheme, %FALSE if URI scheme is %NULL, not supported, or #GFile is invalid.
18224 * @file: (type GFile): #gconstpointer to a #GFile
18226 * Creates a hash value for a #GFile.
18228 * This call does no blocking I/O.
18231 * 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.
18236 * g_file_icon_get_file:
18239 * Gets the #GFile associated with the given @icon.
18241 * Returns: (transfer none): a #GFile, or %NULL.
18249 * Creates a new icon for a file.
18251 * Returns: (transfer full) (type GFileIcon): a #GIcon for the given @file, or %NULL on error.
18256 * g_file_info_clear_status:
18257 * @info: a #GFileInfo.
18259 * Clears the status information from @info.
18264 * g_file_info_copy_into:
18265 * @src_info: source to copy attributes from.
18266 * @dest_info: destination to copy attributes to.
18268 * Copies all of the <link linkend="gio-GFileAttribute">GFileAttribute</link>s
18269 * from @src_info to @dest_info.
18275 * @other: a #GFileInfo.
18277 * Duplicates a file info structure.
18279 * Returns: (transfer full): a duplicate #GFileInfo of @other.
18284 * g_file_info_get_attribute_as_string:
18285 * @info: a #GFileInfo.
18286 * @attribute: a file attribute key.
18288 * Gets the value of a attribute, formated as a string.
18289 * This escapes things as needed to make the string valid
18292 * Returns: a UTF-8 string associated with the given @attribute. When you're done with the string it must be freed with g_free().
18297 * g_file_info_get_attribute_boolean:
18298 * @info: a #GFileInfo.
18299 * @attribute: a file attribute key.
18301 * Gets the value of a boolean attribute. If the attribute does not
18302 * contain a boolean value, %FALSE will be returned.
18304 * Returns: the boolean value contained within the attribute.
18309 * g_file_info_get_attribute_byte_string:
18310 * @info: a #GFileInfo.
18311 * @attribute: a file attribute key.
18313 * Gets the value of a byte string attribute. If the attribute does
18314 * not contain a byte string, %NULL will be returned.
18316 * Returns: the contents of the @attribute value as a byte string, or %NULL otherwise.
18321 * g_file_info_get_attribute_data:
18322 * @info: a #GFileInfo
18323 * @attribute: a file attribute key
18324 * @type: (out) (allow-none): return location for the attribute type, or %NULL
18325 * @value_pp: (out) (allow-none): return location for the attribute value, or %NULL
18326 * @status: (out) (allow-none): return location for the attribute status, or %NULL
18328 * Gets the attribute type, value and status for an attribute key.
18330 * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
18335 * g_file_info_get_attribute_int32:
18336 * @info: a #GFileInfo.
18337 * @attribute: a file attribute key.
18339 * Gets a signed 32-bit integer contained within the attribute. If the
18340 * attribute does not contain a signed 32-bit integer, or is invalid,
18341 * 0 will be returned.
18343 * Returns: a signed 32-bit integer from the attribute.
18348 * g_file_info_get_attribute_int64:
18349 * @info: a #GFileInfo.
18350 * @attribute: a file attribute key.
18352 * Gets a signed 64-bit integer contained within the attribute. If the
18353 * attribute does not contain an signed 64-bit integer, or is invalid,
18354 * 0 will be returned.
18356 * Returns: a signed 64-bit integer from the attribute.
18361 * g_file_info_get_attribute_object:
18362 * @info: a #GFileInfo.
18363 * @attribute: a file attribute key.
18365 * Gets the value of a #GObject attribute. If the attribute does
18366 * not contain a #GObject, %NULL will be returned.
18368 * Returns: (transfer none): a #GObject associated with the given @attribute, or %NULL otherwise.
18373 * g_file_info_get_attribute_status:
18374 * @info: a #GFileInfo
18375 * @attribute: a file attribute key
18377 * Gets the attribute status for an attribute key.
18379 * Returns: a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
18384 * g_file_info_get_attribute_string:
18385 * @info: a #GFileInfo.
18386 * @attribute: a file attribute key.
18388 * Gets the value of a string attribute. If the attribute does
18389 * not contain a string, %NULL will be returned.
18391 * Returns: the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
18396 * g_file_info_get_attribute_stringv:
18397 * @info: a #GFileInfo.
18398 * @attribute: a file attribute key.
18400 * Gets the value of a stringv attribute. If the attribute does
18401 * not contain a stringv, %NULL will be returned.
18403 * Returns: (transfer none): the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
18409 * g_file_info_get_attribute_type:
18410 * @info: a #GFileInfo.
18411 * @attribute: a file attribute key.
18413 * Gets the attribute type for an attribute key.
18415 * Returns: a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
18420 * g_file_info_get_attribute_uint32:
18421 * @info: a #GFileInfo.
18422 * @attribute: a file attribute key.
18424 * Gets an unsigned 32-bit integer contained within the attribute. If the
18425 * attribute does not contain an unsigned 32-bit integer, or is invalid,
18426 * 0 will be returned.
18428 * Returns: an unsigned 32-bit integer from the attribute.
18433 * g_file_info_get_attribute_uint64:
18434 * @info: a #GFileInfo.
18435 * @attribute: a file attribute key.
18437 * Gets a unsigned 64-bit integer contained within the attribute. If the
18438 * attribute does not contain an unsigned 64-bit integer, or is invalid,
18439 * 0 will be returned.
18441 * Returns: a unsigned 64-bit integer from the attribute.
18446 * g_file_info_get_content_type:
18447 * @info: a #GFileInfo.
18449 * Gets the file's content type.
18451 * Returns: a string containing the file's content type.
18456 * g_file_info_get_display_name:
18457 * @info: a #GFileInfo.
18459 * Gets a display name for a file.
18461 * Returns: a string containing the display name.
18466 * g_file_info_get_edit_name:
18467 * @info: a #GFileInfo.
18469 * Gets the edit name for a file.
18471 * Returns: a string containing the edit name.
18476 * g_file_info_get_etag:
18477 * @info: a #GFileInfo.
18479 * Gets the <link linkend="gfile-etag">entity tag</link> for a given
18480 * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
18482 * Returns: a string containing the value of the "etag:value" attribute.
18487 * g_file_info_get_file_type:
18488 * @info: a #GFileInfo.
18490 * Gets a file's type (whether it is a regular file, symlink, etc).
18491 * This is different from the file's content type, see g_file_info_get_content_type().
18493 * Returns: a #GFileType for the given file.
18498 * g_file_info_get_icon:
18499 * @info: a #GFileInfo.
18501 * Gets the icon for a file.
18503 * Returns: (transfer none): #GIcon for the given @info.
18508 * g_file_info_get_is_backup:
18509 * @info: a #GFileInfo.
18511 * Checks if a file is a backup file.
18513 * Returns: %TRUE if file is a backup file, %FALSE otherwise.
18518 * g_file_info_get_is_hidden:
18519 * @info: a #GFileInfo.
18521 * Checks if a file is hidden.
18523 * Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
18528 * g_file_info_get_is_symlink:
18529 * @info: a #GFileInfo.
18531 * Checks if a file is a symlink.
18533 * Returns: %TRUE if the given @info is a symlink.
18538 * g_file_info_get_modification_time:
18539 * @info: a #GFileInfo.
18540 * @result: (out caller-allocates): a #GTimeVal.
18542 * Gets the modification time of the current @info and sets it
18548 * g_file_info_get_name:
18549 * @info: a #GFileInfo.
18551 * Gets the name for a file.
18553 * Returns: a string containing the file name.
18558 * g_file_info_get_size:
18559 * @info: a #GFileInfo.
18561 * Gets the file's size.
18563 * Returns: a #goffset containing the file's size.
18568 * g_file_info_get_sort_order:
18569 * @info: a #GFileInfo.
18571 * Gets the value of the sort_order attribute from the #GFileInfo.
18572 * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18574 * Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
18579 * g_file_info_get_symbolic_icon:
18580 * @info: a #GFileInfo.
18582 * Gets the symbolic icon for a file.
18584 * Returns: (transfer none): #GIcon for the given @info.
18590 * g_file_info_get_symlink_target:
18591 * @info: a #GFileInfo.
18593 * Gets the symlink target for a given #GFileInfo.
18595 * Returns: a string containing the symlink target.
18600 * g_file_info_has_attribute:
18601 * @info: a #GFileInfo.
18602 * @attribute: a file attribute key.
18604 * Checks if a file info structure has an attribute named @attribute.
18606 * Returns: %TRUE if @Ginfo has an attribute named @attribute, %FALSE otherwise.
18611 * g_file_info_has_namespace:
18612 * @info: a #GFileInfo.
18613 * @name_space: a file attribute namespace.
18615 * Checks if a file info structure has an attribute in the
18616 * specified @name_space.
18618 * Returns: %TRUE if @Ginfo has an attribute in @name_space, %FALSE otherwise.
18624 * g_file_info_list_attributes:
18625 * @info: a #GFileInfo.
18626 * @name_space: a file attribute key's namespace.
18628 * Lists the file info structure's attributes.
18630 * 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.
18637 * Creates a new file info structure.
18639 * Returns: a #GFileInfo.
18644 * g_file_info_remove_attribute:
18645 * @info: a #GFileInfo.
18646 * @attribute: a file attribute key.
18648 * Removes all cases of @attribute from @info if it exists.
18653 * g_file_info_set_attribute:
18654 * @info: a #GFileInfo.
18655 * @attribute: a file attribute key.
18656 * @type: a #GFileAttributeType
18657 * @value_p: pointer to the value
18659 * Sets the @attribute to contain the given value, if possible. To unset the
18660 * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
18665 * g_file_info_set_attribute_boolean:
18666 * @info: a #GFileInfo.
18667 * @attribute: a file attribute key.
18668 * @attr_value: a boolean value.
18670 * Sets the @attribute to contain the given @attr_value,
18676 * g_file_info_set_attribute_byte_string:
18677 * @info: a #GFileInfo.
18678 * @attribute: a file attribute key.
18679 * @attr_value: a byte string.
18681 * Sets the @attribute to contain the given @attr_value,
18687 * g_file_info_set_attribute_int32:
18688 * @info: a #GFileInfo.
18689 * @attribute: a file attribute key.
18690 * @attr_value: a signed 32-bit integer
18692 * Sets the @attribute to contain the given @attr_value,
18698 * g_file_info_set_attribute_int64:
18699 * @info: a #GFileInfo.
18700 * @attribute: attribute name to set.
18701 * @attr_value: int64 value to set attribute to.
18703 * Sets the @attribute to contain the given @attr_value,
18709 * g_file_info_set_attribute_mask:
18710 * @info: a #GFileInfo.
18711 * @mask: a #GFileAttributeMatcher.
18713 * Sets @mask on @info to match specific attribute types.
18718 * g_file_info_set_attribute_object:
18719 * @info: a #GFileInfo.
18720 * @attribute: a file attribute key.
18721 * @attr_value: a #GObject.
18723 * Sets the @attribute to contain the given @attr_value,
18729 * g_file_info_set_attribute_status:
18730 * @info: a #GFileInfo
18731 * @attribute: a file attribute key
18732 * @status: a #GFileAttributeStatus
18734 * Sets the attribute status for an attribute key. This is only
18735 * needed by external code that implement g_file_set_attributes_from_info()
18736 * or similar functions.
18738 * The attribute must exist in @info for this to work. Otherwise %FALSE
18739 * is returned and @info is unchanged.
18741 * Returns: %TRUE if the status was changed, %FALSE if the key was not set.
18747 * g_file_info_set_attribute_string:
18748 * @info: a #GFileInfo.
18749 * @attribute: a file attribute key.
18750 * @attr_value: a UTF-8 string.
18752 * Sets the @attribute to contain the given @attr_value,
18758 * g_file_info_set_attribute_stringv:
18759 * @info: a #GFileInfo.
18760 * @attribute: a file attribute key
18761 * @attr_value: (array) (element-type utf8): a %NULL terminated array of UTF-8 strings.
18763 * Sets the @attribute to contain the given @attr_value,
18771 * g_file_info_set_attribute_uint32:
18772 * @info: a #GFileInfo.
18773 * @attribute: a file attribute key.
18774 * @attr_value: an unsigned 32-bit integer.
18776 * Sets the @attribute to contain the given @attr_value,
18782 * g_file_info_set_attribute_uint64:
18783 * @info: a #GFileInfo.
18784 * @attribute: a file attribute key.
18785 * @attr_value: an unsigned 64-bit integer.
18787 * Sets the @attribute to contain the given @attr_value,
18793 * g_file_info_set_content_type:
18794 * @info: a #GFileInfo.
18795 * @content_type: a content type. See <link linkend="gio-GContentType">GContentType</link>.
18797 * Sets the content type attribute for a given #GFileInfo.
18798 * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
18803 * g_file_info_set_display_name:
18804 * @info: a #GFileInfo.
18805 * @display_name: a string containing a display name.
18807 * Sets the display name for the current #GFileInfo.
18808 * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
18813 * g_file_info_set_edit_name:
18814 * @info: a #GFileInfo.
18815 * @edit_name: a string containing an edit name.
18817 * Sets the edit name for the current file.
18818 * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
18823 * g_file_info_set_file_type:
18824 * @info: a #GFileInfo.
18825 * @type: a #GFileType.
18827 * Sets the file type in a #GFileInfo to @type.
18828 * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
18833 * g_file_info_set_icon:
18834 * @info: a #GFileInfo.
18837 * Sets the icon for a given #GFileInfo.
18838 * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
18843 * g_file_info_set_is_hidden:
18844 * @info: a #GFileInfo.
18845 * @is_hidden: a #gboolean.
18847 * Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
18848 * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
18853 * g_file_info_set_is_symlink:
18854 * @info: a #GFileInfo.
18855 * @is_symlink: a #gboolean.
18857 * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
18858 * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
18863 * g_file_info_set_modification_time:
18864 * @info: a #GFileInfo.
18865 * @mtime: a #GTimeVal.
18867 * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
18868 * info to the given time value.
18873 * g_file_info_set_name:
18874 * @info: a #GFileInfo.
18875 * @name: a string containing a name.
18877 * Sets the name attribute for the current #GFileInfo.
18878 * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
18883 * g_file_info_set_size:
18884 * @info: a #GFileInfo.
18885 * @size: a #goffset containing the file's size.
18887 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
18888 * to the given size.
18893 * g_file_info_set_sort_order:
18894 * @info: a #GFileInfo.
18895 * @sort_order: a sort order integer.
18897 * Sets the sort order attribute in the file info structure. See
18898 * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18903 * g_file_info_set_symbolic_icon:
18904 * @info: a #GFileInfo.
18907 * Sets the symbolic icon for a given #GFileInfo.
18908 * See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
18915 * g_file_info_set_symlink_target:
18916 * @info: a #GFileInfo.
18917 * @symlink_target: a static string containing a path to a symlink target.
18919 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
18920 * to the given symlink target.
18925 * g_file_info_unset_attribute_mask:
18926 * @info: #GFileInfo.
18928 * Unsets a mask set by g_file_info_set_attribute_mask(), if one
18934 * g_file_input_stream_query_info:
18935 * @stream: a #GFileInputStream.
18936 * @attributes: a file attribute query string.
18937 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18938 * @error: a #GError location to store the error occurring, or %NULL to ignore.
18940 * Queries a file input stream the given @attributes. This function blocks
18941 * while querying the stream. For the asynchronous (non-blocking) version
18942 * of this function, see g_file_input_stream_query_info_async(). While the
18943 * stream is blocked, the stream will set the pending flag internally, and
18944 * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
18946 * Returns: (transfer full): a #GFileInfo, or %NULL on error.
18951 * g_file_input_stream_query_info_async:
18952 * @stream: a #GFileInputStream.
18953 * @attributes: a file attribute query string.
18954 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18955 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18956 * @callback: (scope async): callback to call when the request is satisfied
18957 * @user_data: (closure): the data to pass to callback function
18959 * Queries the stream information asynchronously.
18960 * When the operation is finished @callback will be called.
18961 * You can then call g_file_input_stream_query_info_finish()
18962 * to get the result of the operation.
18964 * For the synchronous version of this function,
18965 * see g_file_input_stream_query_info().
18967 * If @cancellable is not %NULL, then the operation can be cancelled by
18968 * triggering the cancellable object from another thread. If the operation
18969 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set
18974 * g_file_input_stream_query_info_finish:
18975 * @stream: a #GFileInputStream.
18976 * @result: a #GAsyncResult.
18977 * @error: a #GError location to store the error occurring, or %NULL to ignore.
18979 * Finishes an asynchronous info query operation.
18981 * Returns: (transfer full): #GFileInfo.
18986 * g_file_io_stream_get_etag:
18987 * @stream: a #GFileIOStream.
18989 * Gets the entity tag for the file when it has been written.
18990 * This must be called after the stream has been written
18991 * and closed, as the etag can change while writing.
18993 * Returns: the entity tag for the stream.
18999 * g_file_io_stream_query_info:
19000 * @stream: a #GFileIOStream.
19001 * @attributes: a file attribute query string.
19002 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19003 * @error: a #GError, %NULL to ignore.
19005 * Queries a file io stream for the given @attributes.
19006 * This function blocks while querying the stream. For the asynchronous
19007 * version of this function, see g_file_io_stream_query_info_async().
19008 * While the stream is blocked, the stream will set the pending flag
19009 * internally, and any other operations on the stream will fail with
19010 * %G_IO_ERROR_PENDING.
19012 * Can fail if the stream was already closed (with @error being set to
19013 * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19014 * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19015 * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
19016 * all cases of failure, %NULL will be returned.
19018 * If @cancellable is not %NULL, then the operation can be cancelled by
19019 * triggering the cancellable object from another thread. If the operation
19020 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19023 * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19029 * g_file_io_stream_query_info_async:
19030 * @stream: a #GFileIOStream.
19031 * @attributes: a file attribute query string.
19032 * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19033 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19034 * @callback: (scope async): callback to call when the request is satisfied
19035 * @user_data: (closure): the data to pass to callback function
19037 * Asynchronously queries the @stream for a #GFileInfo. When completed,
19038 * @callback will be called with a #GAsyncResult which can be used to
19039 * finish the operation with g_file_io_stream_query_info_finish().
19041 * For the synchronous version of this function, see
19042 * g_file_io_stream_query_info().
19049 * g_file_io_stream_query_info_finish:
19050 * @stream: a #GFileIOStream.
19051 * @result: a #GAsyncResult.
19052 * @error: a #GError, %NULL to ignore.
19054 * Finalizes the asynchronous query started
19055 * by g_file_io_stream_query_info_async().
19057 * Returns: (transfer full): A #GFileInfo for the finished query.
19063 * g_file_is_native:
19064 * @file: input #GFile
19066 * Checks to see if a file is native to the platform.
19068 * A native file s one expressed in the platform-native filename format,
19069 * e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
19070 * as it might be on a locally mounted remote filesystem.
19072 * On some systems non-native files may be available using the native
19073 * filesystem via a userspace filesystem (FUSE), in these cases this call
19074 * will return %FALSE, but g_file_get_path() will still return a native path.
19076 * This call does no blocking I/O.
19078 * Returns: %TRUE if @file is native
19083 * g_file_load_contents:
19084 * @file: input #GFile
19085 * @cancellable: optional #GCancellable object, %NULL to ignore
19086 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19087 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19088 * @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
19089 * @error: a #GError, or %NULL
19091 * Loads the content of the file into memory. The data is always
19092 * zero-terminated, but this is not included in the resultant @length.
19093 * The returned @content should be freed with g_free() when no longer
19096 * If @cancellable is not %NULL, then the operation can be cancelled by
19097 * triggering the cancellable object from another thread. If the operation
19098 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19100 * Returns: %TRUE if the @file's contents were successfully loaded. %FALSE if there were errors.
19105 * g_file_load_contents_async:
19106 * @file: input #GFile
19107 * @cancellable: optional #GCancellable object, %NULL to ignore
19108 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19109 * @user_data: the data to pass to callback function
19111 * Starts an asynchronous load of the @file's contents.
19113 * For more details, see g_file_load_contents() which is
19114 * the synchronous version of this call.
19116 * When the load operation has completed, @callback will be called
19117 * with @user data. To finish the operation, call
19118 * g_file_load_contents_finish() with the #GAsyncResult returned by
19121 * If @cancellable is not %NULL, then the operation can be cancelled by
19122 * triggering the cancellable object from another thread. If the operation
19123 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19128 * g_file_load_contents_finish:
19129 * @file: input #GFile
19130 * @res: a #GAsyncResult
19131 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19132 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19133 * @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
19134 * @error: a #GError, or %NULL
19136 * Finishes an asynchronous load of the @file's contents.
19137 * The contents are placed in @contents, and @length is set to the
19138 * size of the @contents string. The @content should be freed with
19139 * g_free() when no longer needed. If @etag_out is present, it will be
19140 * set to the new entity tag for the @file.
19142 * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19147 * g_file_load_partial_contents_async: (skip)
19148 * @file: input #GFile
19149 * @cancellable: optional #GCancellable object, %NULL to ignore
19150 * @read_more_callback: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read
19151 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19152 * @user_data: the data to pass to the callback functions
19154 * Reads the partial contents of a file. A #GFileReadMoreCallback should
19155 * be used to stop reading from the file when appropriate, else this
19156 * function will behave exactly as g_file_load_contents_async(). This
19157 * operation can be finished by g_file_load_partial_contents_finish().
19159 * Users of this function should be aware that @user_data is passed to
19160 * both the @read_more_callback and the @callback.
19162 * If @cancellable is not %NULL, then the operation can be cancelled by
19163 * triggering the cancellable object from another thread. If the operation
19164 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19169 * g_file_load_partial_contents_finish:
19170 * @file: input #GFile
19171 * @res: a #GAsyncResult
19172 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19173 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19174 * @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
19175 * @error: a #GError, or %NULL
19177 * Finishes an asynchronous partial load operation that was started
19178 * with g_file_load_partial_contents_async(). The data is always
19179 * zero-terminated, but this is not included in the resultant @length.
19180 * The returned @content should be freed with g_free() when no longer
19183 * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19188 * g_file_make_directory:
19189 * @file: input #GFile
19190 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19191 * @error: a #GError, or %NULL
19193 * Creates a directory. Note that this will only create a child directory
19194 * of the immediate parent directory of the path or URI given by the #GFile.
19195 * To recursively create directories, see g_file_make_directory_with_parents().
19196 * This function will fail if the parent directory does not exist, setting
19197 * @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support
19198 * creating directories, this function will fail, setting @error to
19199 * %G_IO_ERROR_NOT_SUPPORTED.
19201 * For a local #GFile the newly created directory will have the default
19202 * (current) ownership and permissions of the current process.
19204 * If @cancellable is not %NULL, then the operation can be cancelled by
19205 * triggering the cancellable object from another thread. If the operation
19206 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19208 * Returns: %TRUE on successful creation, %FALSE otherwise.
19213 * g_file_make_directory_with_parents:
19214 * @file: input #GFile
19215 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19216 * @error: a #GError, or %NULL
19218 * Creates a directory and any parent directories that may not
19219 * exist similar to 'mkdir -p'. If the file system does not support
19220 * creating directories, this function will fail, setting @error to
19221 * %G_IO_ERROR_NOT_SUPPORTED. If the directory itself already exists,
19222 * this function will fail setting @error to %G_IO_ERROR_EXISTS, unlike
19223 * the similar g_mkdir_with_parents().
19225 * For a local #GFile the newly created directories will have the default
19226 * (current) ownership and permissions of the current process.
19228 * If @cancellable is not %NULL, then the operation can be cancelled by
19229 * triggering the cancellable object from another thread. If the operation
19230 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19232 * Returns: %TRUE if all directories have been successfully created, %FALSE otherwise.
19238 * g_file_make_symbolic_link:
19239 * @file: a #GFile with the name of the symlink to create
19240 * @symlink_value: a string with the path for the target of the new symlink
19241 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19242 * @error: a #GError
19244 * Creates a symbolic link named @file which contains the string
19247 * If @cancellable is not %NULL, then the operation can be cancelled by
19248 * triggering the cancellable object from another thread. If the operation
19249 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19251 * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
19257 * @file: input #GFile
19258 * @flags: a set of #GFileMonitorFlags
19259 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19260 * @error: a #GError, or %NULL
19262 * Obtains a file or directory monitor for the given file,
19263 * depending on the type of the file.
19265 * If @cancellable is not %NULL, then the operation can be cancelled by
19266 * triggering the cancellable object from another thread. If the operation
19267 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19269 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19275 * g_file_monitor_cancel:
19276 * @monitor: a #GFileMonitor.
19278 * Cancels a file monitor.
19280 * Returns: %TRUE if monitor was cancelled.
19285 * g_file_monitor_directory:
19286 * @file: input #GFile
19287 * @flags: a set of #GFileMonitorFlags
19288 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19289 * @error: a #GError, or %NULL
19291 * Obtains a directory monitor for the given file.
19292 * This may fail if directory monitoring is not supported.
19294 * If @cancellable is not %NULL, then the operation can be cancelled by
19295 * triggering the cancellable object from another thread. If the operation
19296 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19298 * Virtual: monitor_dir
19299 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19304 * g_file_monitor_emit_event:
19305 * @monitor: a #GFileMonitor.
19306 * @child: a #GFile.
19307 * @other_file: a #GFile.
19308 * @event_type: a set of #GFileMonitorEvent flags.
19310 * Emits the #GFileMonitor::changed signal if a change
19311 * has taken place. Should be called from file monitor
19312 * implementations only.
19314 * The signal will be emitted from an idle handler (in the <link
19315 * linkend="g-main-context-push-thread-default">thread-default main
19321 * g_file_monitor_file:
19322 * @file: input #GFile
19323 * @flags: a set of #GFileMonitorFlags
19324 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19325 * @error: a #GError, or %NULL
19327 * Obtains a file monitor for the given file. If no file notification
19328 * mechanism exists, then regular polling of the file is used.
19330 * If @cancellable is not %NULL, then the operation can be cancelled by
19331 * triggering the cancellable object from another thread. If the operation
19332 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19334 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19339 * g_file_monitor_is_cancelled:
19340 * @monitor: a #GFileMonitor
19342 * Returns whether the monitor is canceled.
19344 * Returns: %TRUE if monitor is canceled. %FALSE otherwise.
19349 * g_file_monitor_set_rate_limit:
19350 * @monitor: a #GFileMonitor.
19351 * @limit_msecs: a non-negative integer with the limit in milliseconds to poll for changes
19353 * Sets the rate limit to which the @monitor will report
19354 * consecutive change events to the same file.
19359 * g_file_mount_enclosing_volume:
19360 * @location: input #GFile
19361 * @flags: flags affecting the operation
19362 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction
19363 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19364 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19365 * @user_data: the data to pass to callback function
19367 * Starts a @mount_operation, mounting the volume that contains
19368 * the file @location.
19370 * When this operation has completed, @callback will be called with
19371 * @user_user data, and the operation can be finalized with
19372 * g_file_mount_enclosing_volume_finish().
19374 * If @cancellable is not %NULL, then the operation can be cancelled by
19375 * triggering the cancellable object from another thread. If the operation
19376 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19381 * g_file_mount_enclosing_volume_finish:
19382 * @location: input #GFile
19383 * @result: a #GAsyncResult
19384 * @error: a #GError, or %NULL
19386 * Finishes a mount operation started by g_file_mount_enclosing_volume().
19388 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19393 * g_file_mount_mountable:
19394 * @file: input #GFile
19395 * @flags: flags affecting the operation
19396 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
19397 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19398 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19399 * @user_data: (closure): the data to pass to callback function
19401 * Mounts a file of type G_FILE_TYPE_MOUNTABLE.
19402 * Using @mount_operation, you can request callbacks when, for instance,
19403 * passwords are needed during authentication.
19405 * If @cancellable is not %NULL, then the operation can be cancelled by
19406 * triggering the cancellable object from another thread. If the operation
19407 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19409 * When the operation is finished, @callback will be called.
19410 * You can then call g_file_mount_mountable_finish() to get
19411 * the result of the operation.
19416 * g_file_mount_mountable_finish:
19417 * @file: input #GFile
19418 * @result: a #GAsyncResult
19419 * @error: a #GError, or %NULL
19421 * Finishes a mount operation. See g_file_mount_mountable() for details.
19423 * Finish an asynchronous mount operation that was started
19424 * with g_file_mount_mountable().
19426 * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
19432 * @source: #GFile pointing to the source location
19433 * @destination: #GFile pointing to the destination location
19434 * @flags: set of #GFileCopyFlags
19435 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19436 * @progress_callback: (allow-none) (scope call): #GFileProgressCallback function for updates
19437 * @progress_callback_data: (closure): gpointer to user data for the callback function
19438 * @error: #GError for returning error conditions, or %NULL
19440 * Tries to move the file or directory @source to the location specified
19441 * by @destination. If native move operations are supported then this is
19442 * used, otherwise a copy + delete fallback is used. The native
19443 * implementation may support moving directories (for instance on moves
19444 * inside the same filesystem), but the fallback code does not.
19446 * If the flag #G_FILE_COPY_OVERWRITE is specified an already
19447 * existing @destination file is overwritten.
19449 * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
19450 * will be copied as symlinks, otherwise the target of the
19451 * @source symlink will be copied.
19453 * If @cancellable is not %NULL, then the operation can be cancelled by
19454 * triggering the cancellable object from another thread. If the operation
19455 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19457 * If @progress_callback is not %NULL, then the operation can be monitored
19458 * by setting this to a #GFileProgressCallback function.
19459 * @progress_callback_data will be passed to this function. It is
19460 * guaranteed that this callback will be called after all data has been
19461 * transferred with the total number of bytes copied during the operation.
19463 * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND
19464 * error is returned, independent on the status of the @destination.
19466 * If #G_FILE_COPY_OVERWRITE is not specified and the target exists,
19467 * then the error %G_IO_ERROR_EXISTS is returned.
19469 * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
19470 * error is returned. If trying to overwrite a directory with a directory the
19471 * %G_IO_ERROR_WOULD_MERGE error is returned.
19473 * If the source is a directory and the target does not exist, or
19474 * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then
19475 * the %G_IO_ERROR_WOULD_RECURSE error may be returned (if the native
19476 * move operation isn't available).
19478 * Returns: %TRUE on successful move, %FALSE otherwise.
19483 * g_file_new_for_commandline_arg:
19484 * @arg: a command line string
19486 * Creates a #GFile with the given argument from the command line.
19487 * The value of @arg can be either a URI, an absolute path or a
19488 * relative path resolved relative to the current working directory.
19489 * This operation never fails, but the returned object might not
19490 * support any I/O operation if @arg points to a malformed path.
19492 * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19497 * g_file_new_for_path:
19498 * @path: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
19500 * Constructs a #GFile for a given path. This operation never
19501 * fails, but the returned object might not support any I/O
19502 * operation if @path is malformed.
19504 * Returns: (transfer full): a new #GFile for the given @path. Free the returned object with g_object_unref().
19509 * g_file_new_for_uri:
19510 * @uri: a UTF-8 string containing a URI
19512 * Constructs a #GFile for a given URI. This operation never
19513 * fails, but the returned object might not support any I/O
19514 * operation if @uri is malformed or if the uri type is
19517 * Returns: (transfer full): a new #GFile for the given @uri. Free the returned object with g_object_unref().
19523 * @tmpl: (type filename) (allow-none): Template for the file name, as in g_file_open_tmp(), or %NULL for a default template
19524 * @iostream: (out): on return, a #GFileIOStream for the created file
19525 * @error: a #GError, or %NULL
19527 * Opens a file in the preferred directory for temporary files (as
19528 * returned by g_get_tmp_dir()) and returns a #GFile and
19529 * #GFileIOStream pointing to it.
19531 * @tmpl should be a string in the GLib file name encoding
19532 * containing a sequence of six 'X' characters, and containing no
19533 * directory components. If it is %NULL, a default template is used.
19535 * Unlike the other #GFile constructors, this will return %NULL if
19536 * a temporary file could not be created.
19538 * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19544 * g_file_open_readwrite:
19545 * @file: #GFile to open
19546 * @cancellable: (allow-none): a #GCancellable
19547 * @error: a #GError, or %NULL
19549 * Opens an existing file for reading and writing. The result is
19550 * a #GFileIOStream that can be used to read and write the contents
19553 * If @cancellable is not %NULL, then the operation can be cancelled
19554 * by triggering the cancellable object from another thread. If the
19555 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19558 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19559 * be returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
19560 * error will be returned. Other errors are possible too, and depend on
19561 * what kind of filesystem the file is on. Note that in many non-local
19562 * file cases read and write streams are not supported, so make sure you
19563 * really need to do read and write streaming, rather than just opening
19564 * for reading or writing.
19566 * Returns: (transfer full): #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19572 * g_file_open_readwrite_async:
19573 * @file: input #GFile
19574 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19575 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19576 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19577 * @user_data: (closure): the data to pass to callback function
19579 * Asynchronously opens @file for reading and writing.
19581 * For more details, see g_file_open_readwrite() which is
19582 * the synchronous version of this call.
19584 * When the operation is finished, @callback will be called.
19585 * You can then call g_file_open_readwrite_finish() to get
19586 * the result of the operation.
19593 * g_file_open_readwrite_finish:
19594 * @file: input #GFile
19595 * @res: a #GAsyncResult
19596 * @error: a #GError, or %NULL
19598 * Finishes an asynchronous file read operation started with
19599 * g_file_open_readwrite_async().
19601 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19607 * g_file_output_stream_get_etag:
19608 * @stream: a #GFileOutputStream.
19610 * Gets the entity tag for the file when it has been written.
19611 * This must be called after the stream has been written
19612 * and closed, as the etag can change while writing.
19614 * Returns: the entity tag for the stream.
19619 * g_file_output_stream_query_info:
19620 * @stream: a #GFileOutputStream.
19621 * @attributes: a file attribute query string.
19622 * @cancellable: optional #GCancellable object, %NULL to ignore.
19623 * @error: a #GError, %NULL to ignore.
19625 * Queries a file output stream for the given @attributes.
19626 * This function blocks while querying the stream. For the asynchronous
19627 * version of this function, see g_file_output_stream_query_info_async().
19628 * While the stream is blocked, the stream will set the pending flag
19629 * internally, and any other operations on the stream will fail with
19630 * %G_IO_ERROR_PENDING.
19632 * Can fail if the stream was already closed (with @error being set to
19633 * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19634 * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19635 * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
19636 * all cases of failure, %NULL will be returned.
19638 * If @cancellable is not %NULL, then the operation can be cancelled by
19639 * triggering the cancellable object from another thread. If the operation
19640 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19643 * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19648 * g_file_output_stream_query_info_async:
19649 * @stream: a #GFileOutputStream.
19650 * @attributes: a file attribute query string.
19651 * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19652 * @cancellable: optional #GCancellable object, %NULL to ignore.
19653 * @callback: callback to call when the request is satisfied
19654 * @user_data: the data to pass to callback function
19656 * Asynchronously queries the @stream for a #GFileInfo. When completed,
19657 * @callback will be called with a #GAsyncResult which can be used to
19658 * finish the operation with g_file_output_stream_query_info_finish().
19660 * For the synchronous version of this function, see
19661 * g_file_output_stream_query_info().
19666 * g_file_output_stream_query_info_finish:
19667 * @stream: a #GFileOutputStream.
19668 * @result: a #GAsyncResult.
19669 * @error: a #GError, %NULL to ignore.
19671 * Finalizes the asynchronous query started
19672 * by g_file_output_stream_query_info_async().
19674 * Returns: (transfer full): A #GFileInfo for the finished query.
19679 * g_file_parse_name:
19680 * @parse_name: a file name or path to be parsed
19682 * Constructs a #GFile with the given @parse_name (i.e. something
19683 * given by g_file_get_parse_name()). This operation never fails,
19684 * but the returned object might not support any I/O operation if
19685 * the @parse_name cannot be parsed.
19687 * Returns: (transfer full): a new #GFile.
19692 * g_file_poll_mountable:
19693 * @file: input #GFile
19694 * @cancellable: optional #GCancellable object, %NULL to ignore
19695 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19696 * @user_data: the data to pass to callback function
19698 * Polls a file of type #G_FILE_TYPE_MOUNTABLE.
19700 * If @cancellable is not %NULL, then the operation can be cancelled by
19701 * triggering the cancellable object from another thread. If the operation
19702 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19704 * When the operation is finished, @callback will be called.
19705 * You can then call g_file_mount_mountable_finish() to get
19706 * the result of the operation.
19713 * g_file_poll_mountable_finish:
19714 * @file: input #GFile
19715 * @result: a #GAsyncResult
19716 * @error: a #GError, or %NULL
19718 * Finishes a poll operation. See g_file_poll_mountable() for details.
19720 * Finish an asynchronous poll operation that was polled
19721 * with g_file_poll_mountable().
19723 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
19729 * g_file_query_default_handler:
19730 * @file: a #GFile to open
19731 * @cancellable: optional #GCancellable object, %NULL to ignore
19732 * @error: a #GError, or %NULL
19734 * Returns the #GAppInfo that is registered as the default
19735 * application to handle the file specified by @file.
19737 * If @cancellable is not %NULL, then the operation can be cancelled by
19738 * triggering the cancellable object from another thread. If the operation
19739 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19741 * 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()
19746 * g_file_query_exists:
19747 * @file: input #GFile
19748 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19750 * Utility function to check if a particular file exists. This is
19751 * implemented using g_file_query_info() and as such does blocking I/O.
19753 * Note that in many cases it is racy to first check for file existence
19754 * and then execute something based on the outcome of that, because the
19755 * file might have been created or removed in between the operations. The
19756 * general approach to handling that is to not check, but just do the
19757 * operation and handle the errors as they come.
19759 * As an example of race-free checking, take the case of reading a file,
19760 * and if it doesn't exist, creating it. There are two racy versions: read
19761 * it, and on error create it; and: check if it exists, if not create it.
19762 * These can both result in two processes creating the file (with perhaps
19763 * a partially written file as the result). The correct approach is to
19764 * always try to create the file with g_file_create() which will either
19765 * atomically create the file or fail with a %G_IO_ERROR_EXISTS error.
19767 * However, in many cases an existence check is useful in a user interface,
19768 * for instance to make a menu item sensitive/insensitive, so that you don't
19769 * have to fool users that something is possible and then just show an error
19770 * dialog. If you do this, you should make sure to also handle the errors
19771 * that can happen due to races when you execute the operation.
19773 * Returns: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
19778 * g_file_query_file_type:
19779 * @file: input #GFile
19780 * @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info()
19781 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19783 * Utility function to inspect the #GFileType of a file. This is
19784 * implemented using g_file_query_info() and as such does blocking I/O.
19786 * The primary use case of this method is to check if a file is
19787 * a regular file, directory, or symlink.
19789 * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist
19795 * g_file_query_filesystem_info:
19796 * @file: input #GFile
19797 * @attributes: an attribute query string
19798 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19799 * @error: a #GError
19801 * Similar to g_file_query_info(), but obtains information
19802 * about the filesystem the @file is on, rather than the file itself.
19803 * For instance the amount of space available and the type of
19806 * The @attributes value is a string that specifies the attributes
19807 * that should be gathered. It is not an error if it's not possible
19808 * to read a particular requested attribute from a file - it just
19809 * won't be set. @attributes should be a comma-separated list of
19810 * attributes or attribute wildcards. The wildcard "*" means all
19811 * attributes, and a wildcard like "filesystem::*" means all attributes
19812 * in the filesystem namespace. The standard namespace for filesystem
19813 * attributes is "filesystem". Common attributes of interest are
19814 * #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem
19815 * in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available),
19816 * and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
19818 * If @cancellable is not %NULL, then the operation can be cancelled
19819 * by triggering the cancellable object from another thread. If the
19820 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19823 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19824 * be returned. Other errors are possible too, and depend on what
19825 * kind of filesystem the file is on.
19827 * Returns: (transfer full): a #GFileInfo or %NULL if there was an error. Free the returned object with g_object_unref().
19832 * g_file_query_filesystem_info_async:
19833 * @file: input #GFile
19834 * @attributes: an attribute query string
19835 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19836 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19837 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19838 * @user_data: (closure): the data to pass to callback function
19840 * Asynchronously gets the requested information about the filesystem
19841 * that the specified @file is on. The result is a #GFileInfo object
19842 * that contains key-value attributes (such as type or size for the
19845 * For more details, see g_file_query_filesystem_info() which is the
19846 * synchronous version of this call.
19848 * When the operation is finished, @callback will be called. You can
19849 * then call g_file_query_info_finish() to get the result of the
19855 * g_file_query_filesystem_info_finish:
19856 * @file: input #GFile
19857 * @res: a #GAsyncResult
19858 * @error: a #GError
19860 * Finishes an asynchronous filesystem info query.
19861 * See g_file_query_filesystem_info_async().
19863 * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19868 * g_file_query_info:
19869 * @file: input #GFile
19870 * @attributes: an attribute query string
19871 * @flags: a set of #GFileQueryInfoFlags
19872 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19873 * @error: a #GError
19875 * Gets the requested information about specified @file.
19876 * The result is a #GFileInfo object that contains key-value
19877 * attributes (such as the type or size of the file).
19879 * The @attributes value is a string that specifies the file
19880 * attributes that should be gathered. It is not an error if
19881 * it's not possible to read a particular requested attribute
19882 * from a file - it just won't be set. @attributes should be a
19883 * comma-separated list of attributes or attribute wildcards.
19884 * The wildcard "*" means all attributes, and a wildcard like
19885 * "standard::*" means all attributes in the standard namespace.
19886 * An example attribute query be "standard::*,owner::user".
19887 * The standard attributes are available as defines, like
19888 * #G_FILE_ATTRIBUTE_STANDARD_NAME.
19890 * If @cancellable is not %NULL, then the operation can be cancelled
19891 * by triggering the cancellable object from another thread. If the
19892 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19895 * For symlinks, normally the information about the target of the
19896 * symlink is returned, rather than information about the symlink
19897 * itself. However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS
19898 * in @flags the information about the symlink itself will be returned.
19899 * Also, for symlinks that point to non-existing files the information
19900 * about the symlink itself will be returned.
19902 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
19903 * returned. Other errors are possible too, and depend on what kind of
19904 * filesystem the file is on.
19906 * Returns: (transfer full): a #GFileInfo for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19911 * g_file_query_info_async:
19912 * @file: input #GFile
19913 * @attributes: an attribute query string
19914 * @flags: a set of #GFileQueryInfoFlags
19915 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19916 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19917 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19918 * @user_data: (closure): the data to pass to callback function
19920 * Asynchronously gets the requested information about specified @file.
19921 * The result is a #GFileInfo object that contains key-value attributes
19922 * (such as type or size for the file).
19924 * For more details, see g_file_query_info() which is the synchronous
19925 * version of this call.
19927 * When the operation is finished, @callback will be called. You can
19928 * then call g_file_query_info_finish() to get the result of the operation.
19933 * g_file_query_info_finish:
19934 * @file: input #GFile
19935 * @res: a #GAsyncResult
19936 * @error: a #GError
19938 * Finishes an asynchronous file info query.
19939 * See g_file_query_info_async().
19941 * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19946 * g_file_query_settable_attributes:
19947 * @file: input #GFile
19948 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19949 * @error: a #GError, or %NULL
19951 * Obtain the list of settable attributes for the file.
19953 * Returns the type and full attribute name of all the attributes
19954 * that can be set on this file. This doesn't mean setting it will
19955 * always succeed though, you might get an access failure, or some
19956 * specific file may not support a specific attribute.
19958 * If @cancellable is not %NULL, then the operation can be cancelled by
19959 * triggering the cancellable object from another thread. If the operation
19960 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19962 * Returns: a #GFileAttributeInfoList describing the settable attributes. When you are done with it, release it with g_file_attribute_info_list_unref()
19967 * g_file_query_writable_namespaces:
19968 * @file: input #GFile
19969 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19970 * @error: a #GError, or %NULL
19972 * Obtain the list of attribute namespaces where new attributes
19973 * can be created by a user. An example of this is extended
19974 * attributes (in the "xattr" namespace).
19976 * If @cancellable is not %NULL, then the operation can be cancelled by
19977 * triggering the cancellable object from another thread. If the operation
19978 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19980 * Returns: a #GFileAttributeInfoList describing the writable namespaces. When you are done with it, release it with g_file_attribute_info_list_unref()
19986 * @file: #GFile to read
19987 * @cancellable: (allow-none): a #GCancellable
19988 * @error: a #GError, or %NULL
19990 * Opens a file for reading. The result is a #GFileInputStream that
19991 * can be used to read the contents of the file.
19993 * If @cancellable is not %NULL, then the operation can be cancelled by
19994 * triggering the cancellable object from another thread. If the operation
19995 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19997 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
19998 * returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
19999 * error will be returned. Other errors are possible too, and depend
20000 * on what kind of filesystem the file is on.
20003 * Returns: (transfer full): #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20008 * g_file_read_async:
20009 * @file: input #GFile
20010 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20011 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20012 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20013 * @user_data: (closure): the data to pass to callback function
20015 * Asynchronously opens @file for reading.
20017 * For more details, see g_file_read() which is
20018 * the synchronous version of this call.
20020 * When the operation is finished, @callback will be called.
20021 * You can then call g_file_read_finish() to get the result
20022 * of the operation.
20027 * g_file_read_finish:
20028 * @file: input #GFile
20029 * @res: a #GAsyncResult
20030 * @error: a #GError, or %NULL
20032 * Finishes an asynchronous file read operation started with
20033 * g_file_read_async().
20035 * Returns: (transfer full): a #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20041 * @file: input #GFile
20042 * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20043 * @make_backup: %TRUE if a backup should be created
20044 * @flags: a set of #GFileCreateFlags
20045 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20046 * @error: a #GError, or %NULL
20048 * Returns an output stream for overwriting the file, possibly
20049 * creating a backup copy of the file first. If the file doesn't exist,
20050 * it will be created.
20052 * This will try to replace the file in the safest way possible so
20053 * that any errors during the writing will not affect an already
20054 * existing copy of the file. For instance, for local files it
20055 * may write to a temporary file and then atomically rename over
20056 * the destination when the stream is closed.
20058 * By default files created are generally readable by everyone,
20059 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
20060 * will be made readable only to the current user, to the level that
20061 * is supported on the target filesystem.
20063 * If @cancellable is not %NULL, then the operation can be cancelled
20064 * by triggering the cancellable object from another thread. If the
20065 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20068 * If you pass in a non-%NULL @etag value, then this value is
20069 * compared to the current entity tag of the file, and if they differ
20070 * an %G_IO_ERROR_WRONG_ETAG error is returned. This generally means
20071 * that the file has been changed since you last read it. You can get
20072 * the new etag from g_file_output_stream_get_etag() after you've
20073 * finished writing and closed the #GFileOutputStream. When you load
20074 * a new file you can use g_file_input_stream_query_info() to get
20075 * the etag of the file.
20077 * If @make_backup is %TRUE, this function will attempt to make a
20078 * backup of the current file before overwriting it. If this fails
20079 * a %G_IO_ERROR_CANT_CREATE_BACKUP error will be returned. If you
20080 * want to replace anyway, try again with @make_backup set to %FALSE.
20082 * If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will
20083 * be returned, and if the file is some other form of non-regular file
20084 * then a %G_IO_ERROR_NOT_REGULAR_FILE error will be returned. Some
20085 * file systems don't allow all file names, and may return an
20086 * %G_IO_ERROR_INVALID_FILENAME error, and if the name is to long
20087 * %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are
20088 * possible too, and depend on what kind of filesystem the file is on.
20090 * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
20095 * g_file_replace_async:
20096 * @file: input #GFile
20097 * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20098 * @make_backup: %TRUE if a backup should be created
20099 * @flags: a set of #GFileCreateFlags
20100 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20101 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20102 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20103 * @user_data: (closure): the data to pass to callback function
20105 * Asynchronously overwrites the file, replacing the contents,
20106 * possibly creating a backup copy of the file first.
20108 * For more details, see g_file_replace() which is
20109 * the synchronous version of this call.
20111 * When the operation is finished, @callback will be called.
20112 * You can then call g_file_replace_finish() to get the result
20113 * of the operation.
20118 * g_file_replace_contents:
20119 * @file: input #GFile
20120 * @contents: (element-type guint8) (array length=length): a string containing the new contents for @file
20121 * @length: the length of @contents in bytes
20122 * @etag: (allow-none): the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
20123 * @make_backup: %TRUE if a backup should be created
20124 * @flags: a set of #GFileCreateFlags
20125 * @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
20126 * @cancellable: optional #GCancellable object, %NULL to ignore
20127 * @error: a #GError, or %NULL
20129 * Replaces the contents of @file with @contents of @length bytes.
20131 * If @etag is specified (not %NULL), any existing file must have that etag,
20132 * or the error %G_IO_ERROR_WRONG_ETAG will be returned.
20134 * If @make_backup is %TRUE, this function will attempt to make a backup
20137 * If @cancellable is not %NULL, then the operation can be cancelled by
20138 * triggering the cancellable object from another thread. If the operation
20139 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20141 * The returned @new_etag can be used to verify that the file hasn't
20142 * changed the next time it is saved over.
20144 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
20149 * g_file_replace_contents_async:
20150 * @file: input #GFile
20151 * @contents: (element-type guint8) (array length=length): string of contents to replace the file with
20152 * @length: the length of @contents in bytes
20153 * @etag: (allow-none): a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
20154 * @make_backup: %TRUE if a backup should be created
20155 * @flags: a set of #GFileCreateFlags
20156 * @cancellable: optional #GCancellable object, %NULL to ignore
20157 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
20158 * @user_data: the data to pass to callback function
20160 * Starts an asynchronous replacement of @file with the given
20161 * @contents of @length bytes. @etag will replace the document's
20162 * current entity tag.
20164 * When this operation has completed, @callback will be called with
20165 * @user_user data, and the operation can be finalized with
20166 * g_file_replace_contents_finish().
20168 * If @cancellable is not %NULL, then the operation can be cancelled by
20169 * triggering the cancellable object from another thread. If the operation
20170 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20172 * If @make_backup is %TRUE, this function will attempt to
20173 * make a backup of @file.
20178 * g_file_replace_contents_finish:
20179 * @file: input #GFile
20180 * @res: a #GAsyncResult
20181 * @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
20182 * @error: a #GError, or %NULL
20184 * Finishes an asynchronous replace of the given @file. See
20185 * g_file_replace_contents_async(). Sets @new_etag to the new entity
20186 * tag for the document, if present.
20188 * Returns: %TRUE on success, %FALSE on failure.
20193 * g_file_replace_finish:
20194 * @file: input #GFile
20195 * @res: a #GAsyncResult
20196 * @error: a #GError, or %NULL
20198 * Finishes an asynchronous file replace operation started with
20199 * g_file_replace_async().
20201 * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
20206 * g_file_replace_readwrite:
20208 * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20209 * @make_backup: %TRUE if a backup should be created
20210 * @flags: a set of #GFileCreateFlags
20211 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20212 * @error: return location for a #GError, or %NULL
20214 * Returns an output stream for overwriting the file in readwrite mode,
20215 * possibly creating a backup copy of the file first. If the file doesn't
20216 * exist, it will be created.
20218 * For details about the behaviour, see g_file_replace() which does the
20219 * same thing but returns an output stream only.
20221 * Note that in many non-local file cases read and write streams are not
20222 * supported, so make sure you really need to do read and write streaming,
20223 * rather than just opening for reading or writing.
20225 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20231 * g_file_replace_readwrite_async:
20232 * @file: input #GFile
20233 * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20234 * @make_backup: %TRUE if a backup should be created
20235 * @flags: a set of #GFileCreateFlags
20236 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20237 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20238 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20239 * @user_data: (closure): the data to pass to callback function
20241 * Asynchronously overwrites the file in read-write mode,
20242 * replacing the contents, possibly creating a backup copy
20243 * of the file first.
20245 * For more details, see g_file_replace_readwrite() which is
20246 * the synchronous version of this call.
20248 * When the operation is finished, @callback will be called.
20249 * You can then call g_file_replace_readwrite_finish() to get
20250 * the result of the operation.
20257 * g_file_replace_readwrite_finish:
20258 * @file: input #GFile
20259 * @res: a #GAsyncResult
20260 * @error: a #GError, or %NULL
20262 * Finishes an asynchronous file replace operation started with
20263 * g_file_replace_readwrite_async().
20265 * Returns: (transfer full): a #GFileIOStream, or %NULL on error. Free the returned object with g_object_unref().
20271 * g_file_resolve_relative_path:
20272 * @file: input #GFile
20273 * @relative_path: a given relative path string
20275 * Resolves a relative path for @file to an absolute path.
20277 * This call does no blocking I/O.
20279 * 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().
20284 * g_file_set_attribute:
20285 * @file: input #GFile
20286 * @attribute: a string containing the attribute's name
20287 * @type: The type of the attribute
20288 * @value_p: (allow-none): a pointer to the value (or the pointer itself if the type is a pointer type)
20289 * @flags: a set of #GFileQueryInfoFlags
20290 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20291 * @error: a #GError, or %NULL
20293 * Sets an attribute in the file with attribute name @attribute to @value.
20295 * Some attributes can be unset by setting @attribute to
20296 * %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
20298 * If @cancellable is not %NULL, then the operation can be cancelled by
20299 * triggering the cancellable object from another thread. If the operation
20300 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20302 * Returns: %TRUE if the attribute was set, %FALSE otherwise.
20307 * g_file_set_attribute_byte_string:
20308 * @file: input #GFile
20309 * @attribute: a string containing the attribute's name
20310 * @value: a string containing the attribute's new value
20311 * @flags: a #GFileQueryInfoFlags
20312 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20313 * @error: a #GError, or %NULL
20315 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
20316 * If @attribute is of a different type, this operation will fail,
20317 * returning %FALSE.
20319 * If @cancellable is not %NULL, then the operation can be cancelled by
20320 * triggering the cancellable object from another thread. If the operation
20321 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20323 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20328 * g_file_set_attribute_int32:
20329 * @file: input #GFile
20330 * @attribute: a string containing the attribute's name
20331 * @value: a #gint32 containing the attribute's new value
20332 * @flags: a #GFileQueryInfoFlags
20333 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20334 * @error: a #GError, or %NULL
20336 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
20337 * If @attribute is of a different type, this operation will fail.
20339 * If @cancellable is not %NULL, then the operation can be cancelled by
20340 * triggering the cancellable object from another thread. If the operation
20341 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20343 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20348 * g_file_set_attribute_int64:
20349 * @file: input #GFile
20350 * @attribute: a string containing the attribute's name
20351 * @value: a #guint64 containing the attribute's new value
20352 * @flags: a #GFileQueryInfoFlags
20353 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20354 * @error: a #GError, or %NULL
20356 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
20357 * If @attribute is of a different type, this operation will fail.
20359 * If @cancellable is not %NULL, then the operation can be cancelled by
20360 * triggering the cancellable object from another thread. If the operation
20361 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20363 * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20368 * g_file_set_attribute_string:
20369 * @file: input #GFile
20370 * @attribute: a string containing the attribute's name
20371 * @value: a string containing the attribute's value
20372 * @flags: #GFileQueryInfoFlags
20373 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20374 * @error: a #GError, or %NULL
20376 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
20377 * If @attribute is of a different type, this operation will fail.
20379 * If @cancellable is not %NULL, then the operation can be cancelled by
20380 * triggering the cancellable object from another thread. If the operation
20381 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20383 * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20388 * g_file_set_attribute_uint32:
20389 * @file: input #GFile
20390 * @attribute: a string containing the attribute's name
20391 * @value: a #guint32 containing the attribute's new value
20392 * @flags: a #GFileQueryInfoFlags
20393 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20394 * @error: a #GError, or %NULL
20396 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
20397 * If @attribute is of a different type, this operation will fail.
20399 * If @cancellable is not %NULL, then the operation can be cancelled by
20400 * triggering the cancellable object from another thread. If the operation
20401 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20403 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20408 * g_file_set_attribute_uint64:
20409 * @file: input #GFile
20410 * @attribute: a string containing the attribute's name
20411 * @value: a #guint64 containing the attribute's new value
20412 * @flags: a #GFileQueryInfoFlags
20413 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20414 * @error: a #GError, or %NULL
20416 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
20417 * If @attribute is of a different type, this operation will fail.
20419 * If @cancellable is not %NULL, then the operation can be cancelled by
20420 * triggering the cancellable object from another thread. If the operation
20421 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20423 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20428 * g_file_set_attributes_async:
20429 * @file: input #GFile
20430 * @info: a #GFileInfo
20431 * @flags: a #GFileQueryInfoFlags
20432 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20433 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20434 * @callback: (scope async): a #GAsyncReadyCallback
20435 * @user_data: (closure): a #gpointer
20437 * Asynchronously sets the attributes of @file with @info.
20439 * For more details, see g_file_set_attributes_from_info(),
20440 * which is the synchronous version of this call.
20442 * When the operation is finished, @callback will be called.
20443 * You can then call g_file_set_attributes_finish() to get
20444 * the result of the operation.
20449 * g_file_set_attributes_finish:
20450 * @file: input #GFile
20451 * @result: a #GAsyncResult
20452 * @info: (out) (transfer full): a #GFileInfo
20453 * @error: a #GError, or %NULL
20455 * Finishes setting an attribute started in g_file_set_attributes_async().
20457 * Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
20462 * g_file_set_attributes_from_info:
20463 * @file: input #GFile
20464 * @info: a #GFileInfo
20465 * @flags: #GFileQueryInfoFlags
20466 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20467 * @error: a #GError, or %NULL
20469 * Tries to set all attributes in the #GFileInfo on the target
20470 * values, not stopping on the first error.
20472 * If there is any error during this operation then @error will
20473 * be set to the first error. Error on particular fields are flagged
20474 * by setting the "status" field in the attribute value to
20475 * %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can
20476 * also detect further errors.
20478 * If @cancellable is not %NULL, then the operation can be cancelled by
20479 * triggering the cancellable object from another thread. If the operation
20480 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20482 * Returns: %TRUE if there was any error, %FALSE otherwise.
20487 * g_file_set_display_name:
20488 * @file: input #GFile
20489 * @display_name: a string
20490 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20491 * @error: a #GError, or %NULL
20493 * Renames @file to the specified display name.
20495 * The display name is converted from UTF-8 to the correct encoding
20496 * for the target filesystem if possible and the @file is renamed to this.
20498 * If you want to implement a rename operation in the user interface the
20499 * edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
20500 * initial value in the rename widget, and then the result after editing
20501 * should be passed to g_file_set_display_name().
20503 * On success the resulting converted filename is returned.
20505 * If @cancellable is not %NULL, then the operation can be cancelled by
20506 * triggering the cancellable object from another thread. If the operation
20507 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20509 * 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().
20514 * g_file_set_display_name_async:
20515 * @file: input #GFile
20516 * @display_name: a string
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 to call when the request is satisfied
20520 * @user_data: (closure): the data to pass to callback function
20522 * Asynchronously sets the display name for a given #GFile.
20524 * For more details, see g_file_set_display_name() which is
20525 * the synchronous version of this call.
20527 * When the operation is finished, @callback will be called.
20528 * You can then call g_file_set_display_name_finish() to get
20529 * the result of the operation.
20534 * g_file_set_display_name_finish:
20535 * @file: input #GFile
20536 * @res: a #GAsyncResult
20537 * @error: a #GError, or %NULL
20539 * Finishes setting a display name started with
20540 * g_file_set_display_name_async().
20542 * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
20547 * g_file_start_mountable:
20548 * @file: input #GFile
20549 * @flags: flags affecting the operation
20550 * @start_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20551 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20552 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20553 * @user_data: the data to pass to callback function
20555 * Starts a file of type #G_FILE_TYPE_MOUNTABLE.
20556 * Using @start_operation, you can request callbacks when, for instance,
20557 * passwords are needed during authentication.
20559 * If @cancellable is not %NULL, then the operation can be cancelled by
20560 * triggering the cancellable object from another thread. If the operation
20561 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20563 * When the operation is finished, @callback will be called.
20564 * You can then call g_file_mount_mountable_finish() to get
20565 * the result of the operation.
20572 * g_file_start_mountable_finish:
20573 * @file: input #GFile
20574 * @result: a #GAsyncResult
20575 * @error: a #GError, or %NULL
20577 * Finishes a start operation. See g_file_start_mountable() for details.
20579 * Finish an asynchronous start operation that was started
20580 * with g_file_start_mountable().
20582 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20588 * g_file_stop_mountable:
20589 * @file: input #GFile
20590 * @flags: flags affecting the operation
20591 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
20592 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20593 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20594 * @user_data: the data to pass to callback function
20596 * Stops a file of type #G_FILE_TYPE_MOUNTABLE.
20598 * If @cancellable is not %NULL, then the operation can be cancelled by
20599 * triggering the cancellable object from another thread. If the operation
20600 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20602 * When the operation is finished, @callback will be called.
20603 * You can then call g_file_stop_mountable_finish() to get
20604 * the result of the operation.
20611 * g_file_stop_mountable_finish:
20612 * @file: input #GFile
20613 * @result: a #GAsyncResult
20614 * @error: a #GError, or %NULL
20616 * Finishes an stop operation, see g_file_stop_mountable() for details.
20618 * Finish an asynchronous stop operation that was started
20619 * with g_file_stop_mountable().
20621 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20627 * g_file_supports_thread_contexts:
20630 * Checks if @file supports <link
20631 * linkend="g-main-context-push-thread-default-context">thread-default
20632 * contexts</link>. If this returns %FALSE, you cannot perform
20633 * asynchronous operations on @file in a thread that has a
20634 * thread-default context.
20636 * Returns: Whether or not @file supports thread-default contexts.
20643 * @file: #GFile to send to trash
20644 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20645 * @error: a #GError, or %NULL
20647 * Sends @file to the "Trashcan", if possible. This is similar to
20648 * deleting it, but the user can recover it before emptying the trashcan.
20649 * Not all file systems support trashing, so this call can return the
20650 * %G_IO_ERROR_NOT_SUPPORTED error.
20652 * If @cancellable is not %NULL, then the operation can be cancelled by
20653 * triggering the cancellable object from another thread. If the operation
20654 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20656 * Returns: %TRUE on successful trash, %FALSE otherwise.
20661 * g_file_unmount_mountable:
20662 * @file: input #GFile
20663 * @flags: flags affecting the operation
20664 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20665 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20666 * @user_data: (closure): the data to pass to callback function
20668 * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
20670 * If @cancellable is not %NULL, then the operation can be cancelled by
20671 * triggering the cancellable object from another thread. If the operation
20672 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20674 * When the operation is finished, @callback will be called.
20675 * You can then call g_file_unmount_mountable_finish() to get
20676 * the result of the operation.
20678 * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation() instead.
20683 * g_file_unmount_mountable_finish:
20684 * @file: input #GFile
20685 * @result: a #GAsyncResult
20686 * @error: a #GError, or %NULL
20688 * Finishes an unmount operation, see g_file_unmount_mountable() for details.
20690 * Finish an asynchronous unmount operation that was started
20691 * with g_file_unmount_mountable().
20693 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20694 * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation_finish() instead.
20699 * g_file_unmount_mountable_with_operation:
20700 * @file: input #GFile
20701 * @flags: flags affecting the operation
20702 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20703 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20704 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20705 * @user_data: (closure): the data to pass to callback function
20707 * Unmounts a file of type #G_FILE_TYPE_MOUNTABLE.
20709 * If @cancellable is not %NULL, then the operation can be cancelled by
20710 * triggering the cancellable object from another thread. If the operation
20711 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20713 * When the operation is finished, @callback will be called.
20714 * You can then call g_file_unmount_mountable_finish() to get
20715 * the result of the operation.
20722 * g_file_unmount_mountable_with_operation_finish:
20723 * @file: input #GFile
20724 * @result: a #GAsyncResult
20725 * @error: a #GError, or %NULL
20727 * Finishes an unmount operation,
20728 * see g_file_unmount_mountable_with_operation() for details.
20730 * Finish an asynchronous unmount operation that was started
20731 * with g_file_unmount_mountable_with_operation().
20733 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20739 * g_filename_completer_get_completion_suffix:
20740 * @completer: the filename completer.
20741 * @initial_text: text to be completed.
20743 * Obtains a completion for @initial_text from @completer.
20745 * 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.
20750 * g_filename_completer_get_completions:
20751 * @completer: the filename completer.
20752 * @initial_text: text to be completed.
20754 * Gets an array of completion strings for a given initial text.
20756 * 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.
20761 * g_filename_completer_new:
20763 * Creates a new filename completer.
20765 * Returns: a #GFilenameCompleter.
20770 * g_filename_completer_set_dirs_only:
20771 * @completer: the filename completer.
20772 * @dirs_only: a #gboolean.
20774 * If @dirs_only is %TRUE, @completer will only
20775 * complete directory names, and not file names.
20780 * g_filter_input_stream_get_base_stream:
20781 * @stream: a #GFilterInputStream.
20783 * Gets the base stream for the filter stream.
20785 * Returns: (transfer none): a #GInputStream.
20790 * g_filter_input_stream_get_close_base_stream:
20791 * @stream: a #GFilterInputStream.
20793 * Returns whether the base stream will be closed when @stream is
20796 * Returns: %TRUE if the base stream will be closed.
20801 * g_filter_input_stream_set_close_base_stream:
20802 * @stream: a #GFilterInputStream.
20803 * @close_base: %TRUE to close the base stream.
20805 * Sets whether the base stream will be closed when @stream is closed.
20810 * g_filter_output_stream_get_base_stream:
20811 * @stream: a #GFilterOutputStream.
20813 * Gets the base stream for the filter stream.
20815 * Returns: (transfer none): a #GOutputStream.
20820 * g_filter_output_stream_get_close_base_stream:
20821 * @stream: a #GFilterOutputStream.
20823 * Returns whether the base stream will be closed when @stream is
20826 * Returns: %TRUE if the base stream will be closed.
20831 * g_filter_output_stream_set_close_base_stream:
20832 * @stream: a #GFilterOutputStream.
20833 * @close_base: %TRUE to close the base stream.
20835 * Sets whether the base stream will be closed when @stream is closed.
20841 * @icon1: (allow-none): pointer to the first #GIcon.
20842 * @icon2: (allow-none): pointer to the second #GIcon.
20844 * Checks if two icons are equal.
20846 * Returns: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
20852 * @icon: #gconstpointer to an icon object.
20854 * Gets a hash for an icon.
20857 * Returns: a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure.
20862 * g_icon_new_for_string:
20863 * @str: A string obtained via g_icon_to_string().
20864 * @error: Return location for error.
20866 * Generate a #GIcon instance from @str. This function can fail if
20867 * @str is not valid - see g_icon_to_string() for discussion.
20869 * If your application or library provides one or more #GIcon
20870 * implementations you need to ensure that each #GType is registered
20871 * with the type system prior to calling g_icon_new_for_string().
20873 * Returns: (transfer full): An object implementing the #GIcon interface or %NULL if @error is set.
20879 * g_icon_to_string:
20882 * Generates a textual representation of @icon that can be used for
20883 * serialization such as when passing @icon to a different process or
20884 * saving it to persistent storage. Use g_icon_new_for_string() to
20885 * get @icon back from the returned string.
20887 * The encoding of the returned string is proprietary to #GIcon except
20888 * in the following two cases
20892 * If @icon is a #GFileIcon, the returned string is a native path
20893 * (such as <literal>/path/to/my icon.png</literal>) without escaping
20894 * if the #GFile for @icon is a native file. If the file is not
20895 * native, the returned string is the result of g_file_get_uri()
20896 * (such as <literal>sftp://path/to/my%20icon.png</literal>).
20897 * </para></listitem>
20899 * If @icon is a #GThemedIcon with exactly one name, the encoding is
20900 * simply the name (such as <literal>network-server</literal>).
20901 * </para></listitem>
20904 * Virtual: to_tokens
20905 * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't be serialized. Use g_free() to free.
20911 * g_inet_address_equal:
20912 * @address: A #GInetAddress.
20913 * @other_address: Another #GInetAddress.
20915 * Checks if two #GInetAddress instances are equal, e.g. the same address.
20917 * Returns: %TRUE if @address and @other_address are equal, %FALSE otherwise.
20923 * g_inet_address_get_family:
20924 * @address: a #GInetAddress
20926 * Gets @address's family
20928 * Returns: @address's family
20934 * g_inet_address_get_is_any:
20935 * @address: a #GInetAddress
20937 * Tests whether @address is the "any" address for its family.
20939 * Returns: %TRUE if @address is the "any" address for its family.
20945 * g_inet_address_get_is_link_local:
20946 * @address: a #GInetAddress
20948 * Tests whether @address is a link-local address (that is, if it
20949 * identifies a host on a local network that is not connected to the
20952 * Returns: %TRUE if @address is a link-local address.
20958 * g_inet_address_get_is_loopback:
20959 * @address: a #GInetAddress
20961 * Tests whether @address is the loopback address for its family.
20963 * Returns: %TRUE if @address is the loopback address for its family.
20969 * g_inet_address_get_is_mc_global:
20970 * @address: a #GInetAddress
20972 * Tests whether @address is a global multicast address.
20974 * Returns: %TRUE if @address is a global multicast address.
20980 * g_inet_address_get_is_mc_link_local:
20981 * @address: a #GInetAddress
20983 * Tests whether @address is a link-local multicast address.
20985 * Returns: %TRUE if @address is a link-local multicast address.
20991 * g_inet_address_get_is_mc_node_local:
20992 * @address: a #GInetAddress
20994 * Tests whether @address is a node-local multicast address.
20996 * Returns: %TRUE if @address is a node-local multicast address.
21002 * g_inet_address_get_is_mc_org_local:
21003 * @address: a #GInetAddress
21005 * Tests whether @address is an organization-local multicast address.
21007 * Returns: %TRUE if @address is an organization-local multicast address.
21013 * g_inet_address_get_is_mc_site_local:
21014 * @address: a #GInetAddress
21016 * Tests whether @address is a site-local multicast address.
21018 * Returns: %TRUE if @address is a site-local multicast address.
21024 * g_inet_address_get_is_multicast:
21025 * @address: a #GInetAddress
21027 * Tests whether @address is a multicast address.
21029 * Returns: %TRUE if @address is a multicast address.
21035 * g_inet_address_get_is_site_local:
21036 * @address: a #GInetAddress
21038 * Tests whether @address is a site-local address such as 10.0.0.1
21039 * (that is, the address identifies a host on a local network that can
21040 * not be reached directly from the Internet, but which may have
21041 * outgoing Internet connectivity via a NAT or firewall).
21043 * Returns: %TRUE if @address is a site-local address.
21049 * g_inet_address_get_native_size:
21050 * @address: a #GInetAddress
21052 * Gets the size of the native raw binary address for @address. This
21053 * is the size of the data that you get from g_inet_address_to_bytes().
21055 * Returns: the number of bytes used for the native version of @address.
21061 * g_inet_address_mask_equal:
21062 * @mask: a #GInetAddressMask
21063 * @mask2: another #GInetAddressMask
21065 * Tests if @mask and @mask2 are the same mask.
21067 * Returns: whether @mask and @mask2 are the same mask
21073 * g_inet_address_mask_get_address:
21074 * @mask: a #GInetAddressMask
21076 * Gets @mask's base address
21078 * Returns: (transfer none): @mask's base address
21084 * g_inet_address_mask_get_family:
21085 * @mask: a #GInetAddressMask
21087 * Gets the #GSocketFamily of @mask's address
21089 * Returns: the #GSocketFamily of @mask's address
21095 * g_inet_address_mask_get_length:
21096 * @mask: a #GInetAddressMask
21098 * Gets @mask's length
21100 * Returns: @mask's length
21106 * g_inet_address_mask_matches:
21107 * @mask: a #GInetAddressMask
21108 * @address: a #GInetAddress
21110 * Tests if @address falls within the range described by @mask.
21112 * Returns: whether @address falls within the range described by @mask.
21118 * g_inet_address_mask_new:
21119 * @addr: a #GInetAddress
21120 * @length: number of bits of @addr to use
21121 * @error: return location for #GError, or %NULL
21123 * Creates a new #GInetAddressMask representing all addresses whose
21124 * first @length bits match @addr.
21126 * Returns: a new #GInetAddressMask, or %NULL on error
21132 * g_inet_address_mask_new_from_string:
21133 * @mask_string: an IP address or address/length string
21134 * @error: return location for #GError, or %NULL
21136 * Parses @mask_string as an IP address and (optional) length, and
21137 * creates a new #GInetAddressMask. The length, if present, is
21138 * delimited by a "/". If it is not present, then the length is
21139 * assumed to be the full length of the address.
21141 * Returns: a new #GInetAddressMask corresponding to @string, or %NULL on error.
21147 * g_inet_address_mask_to_string:
21148 * @mask: a #GInetAddressMask
21150 * Converts @mask back to its corresponding string form.
21152 * Returns: a string corresponding to @mask.
21158 * g_inet_address_new_any:
21159 * @family: the address family
21161 * Creates a #GInetAddress for the "any" address (unassigned/"don't
21162 * care") for @family.
21164 * Returns: a new #GInetAddress corresponding to the "any" address for @family.
21170 * g_inet_address_new_from_bytes:
21171 * @bytes: (array) (element-type guint8): raw address data
21172 * @family: the address family of @bytes
21174 * Creates a new #GInetAddress from the given @family and @bytes.
21175 * @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
21176 * %G_SOCKET_FAMILY_IPV6.
21178 * Returns: a new #GInetAddress corresponding to @family and @bytes.
21184 * g_inet_address_new_from_string:
21185 * @string: a string representation of an IP address
21187 * Parses @string as an IP address and creates a new #GInetAddress.
21189 * Returns: a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed.
21195 * g_inet_address_new_loopback:
21196 * @family: the address family
21198 * Creates a #GInetAddress for the loopback address for @family.
21200 * Returns: a new #GInetAddress corresponding to the loopback address for @family.
21206 * g_inet_address_to_bytes: (skip)
21207 * @address: a #GInetAddress
21209 * Gets the raw binary address data from @address.
21211 * 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().
21217 * g_inet_address_to_string:
21218 * @address: a #GInetAddress
21220 * Converts @address to string form.
21222 * Returns: a representation of @address as a string, which should be freed after use.
21228 * g_inet_socket_address_get_address:
21229 * @address: a #GInetSocketAddress
21231 * Gets @address's #GInetAddress.
21233 * Returns: (transfer none): the #GInetAddress for @address, which must be g_object_ref()'d if it will be stored
21239 * g_inet_socket_address_get_flowinfo:
21240 * @address: a %G_SOCKET_FAMILY_IPV6 #GInetSocketAddress
21242 * Gets the <literal>sin6_flowinfo</literal> field from @address,
21243 * which must be an IPv6 address.
21245 * Returns: the flowinfo field
21251 * g_inet_socket_address_get_port:
21252 * @address: a #GInetSocketAddress
21254 * Gets @address's port.
21256 * Returns: the port for @address
21262 * g_inet_socket_address_get_scope_id:
21263 * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress
21265 * Gets the <literal>sin6_scope_id</literal> field from @address,
21266 * which must be an IPv6 address.
21268 * Returns: the scope id field
21274 * g_inet_socket_address_new:
21275 * @address: a #GInetAddress
21276 * @port: a port number
21278 * Creates a new #GInetSocketAddress for @address and @port.
21280 * Returns: a new #GInetSocketAddress
21287 * @initable: a #GInitable.
21288 * @cancellable: optional #GCancellable object, %NULL to ignore.
21289 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21291 * Initializes the object implementing the interface.
21293 * The object must be initialized before any real use after initial
21294 * construction, either with this function or g_async_initable_init_async().
21296 * Implementations may also support cancellation. If @cancellable is not %NULL,
21297 * then initialization can be cancelled by triggering the cancellable object
21298 * from another thread. If the operation was cancelled, the error
21299 * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
21300 * the object doesn't support cancellable initialization the error
21301 * %G_IO_ERROR_NOT_SUPPORTED will be returned.
21303 * If the object is not initialized, or initialization returns with an
21304 * error, then all operations on the object except g_object_ref() and
21305 * g_object_unref() are considered to be invalid, and have undefined
21306 * behaviour. See the <xref linkend="ginitable"/> section introduction
21307 * for more details.
21309 * Implementations of this method must be idempotent, i.e. multiple calls
21310 * to this function with the same argument should return the same results.
21311 * Only the first call initializes the object, further calls return the result
21312 * of the first call. This is so that it's safe to implement the singleton
21313 * pattern in the GObject constructor function.
21315 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
21322 * @object_type: a #GType supporting #GInitable.
21323 * @cancellable: optional #GCancellable object, %NULL to ignore.
21324 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21325 * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
21326 * @...: the value if the first property, followed by and other property value pairs, and ended by %NULL.
21328 * Helper function for constructing #GInitable object. This is
21329 * similar to g_object_new() but also initializes the object
21330 * and returns %NULL, setting an error on failure.
21332 * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21338 * g_initable_new_valist:
21339 * @object_type: a #GType supporting #GInitable.
21340 * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
21341 * @var_args: The var args list generated from @first_property_name.
21342 * @cancellable: optional #GCancellable object, %NULL to ignore.
21343 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21345 * Helper function for constructing #GInitable object. This is
21346 * similar to g_object_new_valist() but also initializes the object
21347 * and returns %NULL, setting an error on failure.
21349 * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21356 * @object_type: a #GType supporting #GInitable.
21357 * @n_parameters: the number of parameters in @parameters
21358 * @parameters: (array length=n_parameters): the parameters to use to construct the object
21359 * @cancellable: optional #GCancellable object, %NULL to ignore.
21360 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21362 * Helper function for constructing #GInitable object. This is
21363 * similar to g_object_newv() but also initializes the object
21364 * and returns %NULL, setting an error on failure.
21366 * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21372 * g_input_stream_clear_pending:
21373 * @stream: input stream
21375 * Clears the pending flag on @stream.
21380 * g_input_stream_close:
21381 * @stream: A #GInputStream.
21382 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21383 * @error: location to store the error occurring, or %NULL to ignore
21385 * Closes the stream, releasing resources related to it.
21387 * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
21388 * Closing a stream multiple times will not return an error.
21390 * Streams will be automatically closed when the last reference
21391 * is dropped, but you might want to call this function to make sure
21392 * resources are released as early as possible.
21394 * Some streams might keep the backing store of the stream (e.g. a file descriptor)
21395 * open after the stream is closed. See the documentation for the individual
21396 * stream for details.
21398 * On failure the first error that happened will be reported, but the close
21399 * operation will finish as much as possible. A stream that failed to
21400 * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
21401 * is important to check and report the error to the user.
21403 * If @cancellable is not %NULL, then the operation can be cancelled by
21404 * triggering the cancellable object from another thread. If the operation
21405 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21406 * Cancelling a close will still leave the stream closed, but some streams
21407 * can use a faster close that doesn't block to e.g. check errors.
21409 * Returns: %TRUE on success, %FALSE on failure
21414 * g_input_stream_close_async:
21415 * @stream: A #GInputStream.
21416 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21417 * @cancellable: (allow-none): optional cancellable object
21418 * @callback: (scope async): callback to call when the request is satisfied
21419 * @user_data: (closure): the data to pass to callback function
21421 * Requests an asynchronous closes of the stream, releasing resources related to it.
21422 * When the operation is finished @callback will be called.
21423 * You can then call g_input_stream_close_finish() to get the result of the
21426 * For behaviour details see g_input_stream_close().
21428 * The asyncronous methods have a default fallback that uses threads to implement
21429 * asynchronicity, so they are optional for inheriting classes. However, if you
21430 * override one you must override all.
21435 * g_input_stream_close_finish:
21436 * @stream: a #GInputStream.
21437 * @result: a #GAsyncResult.
21438 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21440 * Finishes closing a stream asynchronously, started from g_input_stream_close_async().
21442 * Returns: %TRUE if the stream was closed successfully.
21447 * g_input_stream_has_pending:
21448 * @stream: input stream.
21450 * Checks if an input stream has pending actions.
21452 * Returns: %TRUE if @stream has pending actions.
21457 * g_input_stream_is_closed:
21458 * @stream: input stream.
21460 * Checks if an input stream is closed.
21462 * Returns: %TRUE if the stream is closed.
21467 * g_input_stream_read:
21468 * @stream: a #GInputStream.
21469 * @buffer: a buffer to read data into (which should be at least count bytes long).
21470 * @count: the number of bytes that will be read from the stream
21471 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21472 * @error: location to store the error occurring, or %NULL to ignore
21474 * Tries to read @count bytes from the stream into the buffer starting at
21475 * @buffer. Will block during this read.
21477 * If count is zero returns zero and does nothing. A value of @count
21478 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21480 * On success, the number of bytes read into the buffer is returned.
21481 * It is not an error if this is not the same as the requested size, as it
21482 * can happen e.g. near the end of a file. Zero is returned on end of file
21483 * (or if @count is zero), but never otherwise.
21485 * If @cancellable is not %NULL, then the operation can be cancelled by
21486 * triggering the cancellable object from another thread. If the operation
21487 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21488 * operation was partially finished when the operation was cancelled the
21489 * partial result will be returned, without an error.
21491 * On error -1 is returned and @error is set accordingly.
21493 * Returns: Number of bytes read, or -1 on error, or 0 on end of file.
21498 * g_input_stream_read_all:
21499 * @stream: a #GInputStream.
21500 * @buffer: a buffer to read data into (which should be at least count bytes long).
21501 * @count: the number of bytes that will be read from the stream
21502 * @bytes_read: (out): location to store the number of bytes that was read from the stream
21503 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21504 * @error: location to store the error occurring, or %NULL to ignore
21506 * Tries to read @count bytes from the stream into the buffer starting at
21507 * @buffer. Will block during this read.
21509 * This function is similar to g_input_stream_read(), except it tries to
21510 * read as many bytes as requested, only stopping on an error or end of stream.
21512 * On a successful read of @count bytes, or if we reached the end of the
21513 * stream, %TRUE is returned, and @bytes_read is set to the number of bytes
21514 * read into @buffer.
21516 * If there is an error during the operation %FALSE is returned and @error
21517 * is set to indicate the error status, @bytes_read is updated to contain
21518 * the number of bytes read into @buffer before the error occurred.
21520 * Returns: %TRUE on success, %FALSE if there was an error
21525 * g_input_stream_read_async:
21526 * @stream: A #GInputStream.
21527 * @buffer: a buffer to read data into (which should be at least count bytes long).
21528 * @count: the number of bytes that will be read from the stream
21529 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21530 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21531 * @callback: (scope async): callback to call when the request is satisfied
21532 * @user_data: (closure): the data to pass to callback function
21534 * Request an asynchronous read of @count bytes from the stream into the buffer
21535 * starting at @buffer. When the operation is finished @callback will be called.
21536 * You can then call g_input_stream_read_finish() to get the result of the
21539 * During an async request no other sync and async calls are allowed on @stream, and will
21540 * result in %G_IO_ERROR_PENDING errors.
21542 * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21544 * On success, the number of bytes read into the buffer will be passed to the
21545 * callback. It is not an error if this is not the same as the requested size, as it
21546 * can happen e.g. near the end of a file, but generally we try to read
21547 * as many bytes as requested. Zero is returned on end of file
21548 * (or if @count is zero), but never otherwise.
21550 * Any outstanding i/o request with higher priority (lower numerical value) will
21551 * be executed before an outstanding request with lower priority. Default
21552 * priority is %G_PRIORITY_DEFAULT.
21554 * The asyncronous methods have a default fallback that uses threads to implement
21555 * asynchronicity, so they are optional for inheriting classes. However, if you
21556 * override one you must override all.
21561 * g_input_stream_read_bytes:
21562 * @stream: a #GInputStream.
21563 * @count: maximum number of bytes that will be read from the stream. Common values include 4096 and 8192.
21564 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21565 * @error: location to store the error occurring, or %NULL to ignore
21567 * Like g_input_stream_read(), this tries to read @count bytes from
21568 * the stream in a blocking fashion. However, rather than reading into
21569 * a user-supplied buffer, this will create a new #GBytes containing
21570 * the data that was read. This may be easier to use from language
21573 * If count is zero, returns a zero-length #GBytes and does nothing. A
21574 * value of @count larger than %G_MAXSSIZE will cause a
21575 * %G_IO_ERROR_INVALID_ARGUMENT error.
21577 * On success, a new #GBytes is returned. It is not an error if the
21578 * size of this object is not the same as the requested size, as it
21579 * can happen e.g. near the end of a file. A zero-length #GBytes is
21580 * returned on end of file (or if @count is zero), but never
21583 * If @cancellable is not %NULL, then the operation can be cancelled by
21584 * triggering the cancellable object from another thread. If the operation
21585 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21586 * operation was partially finished when the operation was cancelled the
21587 * partial result will be returned, without an error.
21589 * On error %NULL is returned and @error is set accordingly.
21591 * Returns: a new #GBytes, or %NULL on error
21596 * g_input_stream_read_bytes_async:
21597 * @stream: A #GInputStream.
21598 * @count: the number of bytes that will be read from the stream
21599 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21600 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21601 * @callback: (scope async): callback to call when the request is satisfied
21602 * @user_data: (closure): the data to pass to callback function
21604 * Request an asynchronous read of @count bytes from the stream into a
21605 * new #GBytes. When the operation is finished @callback will be
21606 * called. You can then call g_input_stream_read_bytes_finish() to get the
21607 * result of the operation.
21609 * During an async request no other sync and async calls are allowed
21610 * on @stream, and will result in %G_IO_ERROR_PENDING errors.
21612 * A value of @count larger than %G_MAXSSIZE will cause a
21613 * %G_IO_ERROR_INVALID_ARGUMENT error.
21615 * On success, the new #GBytes will be passed to the callback. It is
21616 * not an error if this is smaller than the requested size, as it can
21617 * happen e.g. near the end of a file, but generally we try to read as
21618 * many bytes as requested. Zero is returned on end of file (or if
21619 * @count is zero), but never otherwise.
21621 * Any outstanding I/O request with higher priority (lower numerical
21622 * value) will be executed before an outstanding request with lower
21623 * priority. Default priority is %G_PRIORITY_DEFAULT.
21628 * g_input_stream_read_bytes_finish:
21629 * @stream: a #GInputStream.
21630 * @result: a #GAsyncResult.
21631 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21633 * Finishes an asynchronous stream read-into-#GBytes operation.
21635 * Returns: the newly-allocated #GBytes, or %NULL on error
21640 * g_input_stream_read_finish:
21641 * @stream: a #GInputStream.
21642 * @result: a #GAsyncResult.
21643 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21645 * Finishes an asynchronous stream read operation.
21647 * Returns: number of bytes read in, or -1 on error, or 0 on end of file.
21652 * g_input_stream_set_pending:
21653 * @stream: input stream
21654 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21656 * Sets @stream to have actions pending. If the pending flag is
21657 * already set or @stream is closed, it will return %FALSE and set
21660 * Returns: %TRUE if pending was previously unset and is now set.
21665 * g_input_stream_skip:
21666 * @stream: a #GInputStream.
21667 * @count: the number of bytes that will be skipped from the stream
21668 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21669 * @error: location to store the error occurring, or %NULL to ignore
21671 * Tries to skip @count bytes from the stream. Will block during the operation.
21673 * This is identical to g_input_stream_read(), from a behaviour standpoint,
21674 * but the bytes that are skipped are not returned to the user. Some
21675 * streams have an implementation that is more efficient than reading the data.
21677 * This function is optional for inherited classes, as the default implementation
21678 * emulates it using read.
21680 * If @cancellable is not %NULL, then the operation can be cancelled by
21681 * triggering the cancellable object from another thread. If the operation
21682 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21683 * operation was partially finished when the operation was cancelled the
21684 * partial result will be returned, without an error.
21686 * Returns: Number of bytes skipped, or -1 on error
21691 * g_input_stream_skip_async:
21692 * @stream: A #GInputStream.
21693 * @count: the number of bytes that will be skipped from the stream
21694 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21695 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21696 * @callback: (scope async): callback to call when the request is satisfied
21697 * @user_data: (closure): the data to pass to callback function
21699 * Request an asynchronous skip of @count bytes from the stream.
21700 * When the operation is finished @callback will be called.
21701 * You can then call g_input_stream_skip_finish() to get the result
21702 * of the operation.
21704 * During an async request no other sync and async calls are allowed,
21705 * and will result in %G_IO_ERROR_PENDING errors.
21707 * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21709 * On success, the number of bytes skipped will be passed to the callback.
21710 * It is not an error if this is not the same as the requested size, as it
21711 * can happen e.g. near the end of a file, but generally we try to skip
21712 * as many bytes as requested. Zero is returned on end of file
21713 * (or if @count is zero), but never otherwise.
21715 * Any outstanding i/o request with higher priority (lower numerical value)
21716 * will be executed before an outstanding request with lower priority.
21717 * Default priority is %G_PRIORITY_DEFAULT.
21719 * The asynchronous methods have a default fallback that uses threads to
21720 * implement asynchronicity, so they are optional for inheriting classes.
21721 * However, if you override one, you must override all.
21726 * g_input_stream_skip_finish:
21727 * @stream: a #GInputStream.
21728 * @result: a #GAsyncResult.
21729 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21731 * Finishes a stream skip operation.
21733 * Returns: the size of the bytes skipped, or %-1 on error.
21738 * g_io_error_from_errno:
21739 * @err_no: Error number as defined in errno.h.
21741 * Converts errno.h error codes into GIO error codes.
21743 * Returns: #GIOErrorEnum value for the given errno.h error number.
21748 * g_io_error_from_win32_error:
21749 * @error_code: Windows error number.
21751 * Converts some common error codes into GIO error codes. The
21752 * fallback value G_IO_ERROR_FAILED is returned for error codes not
21755 * Returns: #GIOErrorEnum value for the given error number.
21761 * g_io_error_quark:
21763 * Gets the GIO Error Quark.
21765 * Returns: a #GQuark.
21770 * g_io_extension_get_name:
21771 * @extension: a #GIOExtension
21773 * Gets the name under which @extension was registered.
21775 * Note that the same type may be registered as extension
21776 * for multiple extension points, under different names.
21778 * Returns: the name of @extension.
21783 * g_io_extension_get_priority:
21784 * @extension: a #GIOExtension
21786 * Gets the priority with which @extension was registered.
21788 * Returns: the priority of @extension
21793 * g_io_extension_get_type:
21794 * @extension: a #GIOExtension
21796 * Gets the type associated with @extension.
21798 * Returns: the type of @extension
21803 * g_io_extension_point_get_extension_by_name:
21804 * @extension_point: a #GIOExtensionPoint
21805 * @name: the name of the extension to get
21807 * Finds a #GIOExtension for an extension point by name.
21809 * Returns: (transfer none): the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name
21814 * g_io_extension_point_get_extensions:
21815 * @extension_point: a #GIOExtensionPoint
21817 * Gets a list of all extensions that implement this extension point.
21818 * The list is sorted by priority, beginning with the highest priority.
21820 * Returns: (element-type GIOExtension) (transfer none): a #GList of #GIOExtension<!-- -->s. The list is owned by GIO and should not be modified.
21825 * g_io_extension_point_get_required_type:
21826 * @extension_point: a #GIOExtensionPoint
21828 * Gets the required type for @extension_point.
21830 * Returns: the #GType that all implementations must have, or #G_TYPE_INVALID if the extension point has no required type
21835 * g_io_extension_point_implement:
21836 * @extension_point_name: the name of the extension point
21837 * @type: the #GType to register as extension
21838 * @extension_name: the name for the extension
21839 * @priority: the priority for the extension
21841 * Registers @type as extension for the extension point with name
21842 * @extension_point_name.
21844 * If @type has already been registered as an extension for this
21845 * extension point, the existing #GIOExtension object is returned.
21847 * Returns: (transfer none): a #GIOExtension object for #GType
21852 * g_io_extension_point_lookup:
21853 * @name: the name of the extension point
21855 * Looks up an existing extension point.
21857 * Returns: (transfer none): the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name.
21862 * g_io_extension_point_register:
21863 * @name: The name of the extension point
21865 * Registers an extension point.
21867 * Returns: (transfer none): the new #GIOExtensionPoint. This object is owned by GIO and should not be freed.
21872 * g_io_extension_point_set_required_type:
21873 * @extension_point: a #GIOExtensionPoint
21874 * @type: the #GType to require
21876 * Sets the required type for @extension_point to @type.
21877 * All implementations must henceforth have this type.
21882 * g_io_extension_ref_class:
21883 * @extension: a #GIOExtension
21885 * Gets a reference to the class for the type that is
21886 * associated with @extension.
21888 * Returns: (transfer full): the #GTypeClass for the type of @extension
21894 * @filename: filename of the shared library module.
21896 * Creates a new GIOModule that will load the specific
21897 * shared library when in use.
21899 * Returns: a #GIOModule from given @filename, or %NULL on error.
21904 * g_io_module_scope_block:
21905 * @scope: a module loading scope
21906 * @basename: the basename to block
21908 * Block modules with the given @basename from being loaded when
21909 * this scope is used with g_io_modules_scan_all_in_directory_with_scope()
21910 * or g_io_modules_load_all_in_directory_with_scope().
21917 * g_io_module_scope_free:
21918 * @scope: a module loading scope
21920 * Free a module scope.
21927 * g_io_module_scope_new:
21928 * @flags: flags for the new scope
21930 * Create a new scope for loading of IO modules. A scope can be used for
21931 * blocking duplicate modules, or blocking a module you don't want to load.
21933 * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
21934 * which have the same base name as a module that has already been seen
21937 * Returns: (transfer full): the new module scope
21943 * g_io_modules_load_all_in_directory:
21944 * @dirname: pathname for a directory containing modules to load.
21946 * Loads all the modules in the specified directory.
21948 * If don't require all modules to be initialized (and thus registering
21949 * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21950 * which allows delayed/lazy loading of modules.
21952 * 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().
21957 * g_io_modules_load_all_in_directory_with_scope:
21958 * @dirname: pathname for a directory containing modules to load.
21959 * @scope: a scope to use when scanning the modules.
21961 * Loads all the modules in the specified directory.
21963 * If don't require all modules to be initialized (and thus registering
21964 * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21965 * which allows delayed/lazy loading of modules.
21967 * 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().
21973 * g_io_modules_scan_all_in_directory:
21974 * @dirname: pathname for a directory containing modules to scan.
21976 * Scans all the modules in the specified directory, ensuring that
21977 * any extension point implemented by a module is registered.
21979 * This may not actually load and initialize all the types in each
21980 * module, some modules may be lazily loaded and initialized when
21981 * an extension point it implementes is used with e.g.
21982 * g_io_extension_point_get_extensions() or
21983 * g_io_extension_point_get_extension_by_name().
21985 * If you need to guarantee that all types are loaded in all the modules,
21986 * use g_io_modules_load_all_in_directory().
21993 * g_io_modules_scan_all_in_directory_with_scope:
21994 * @dirname: pathname for a directory containing modules to scan.
21995 * @scope: a scope to use when scanning the modules
21997 * Scans all the modules in the specified directory, ensuring that
21998 * any extension point implemented by a module is registered.
22000 * This may not actually load and initialize all the types in each
22001 * module, some modules may be lazily loaded and initialized when
22002 * an extension point it implementes is used with e.g.
22003 * g_io_extension_point_get_extensions() or
22004 * g_io_extension_point_get_extension_by_name().
22006 * If you need to guarantee that all types are loaded in all the modules,
22007 * use g_io_modules_load_all_in_directory().
22014 * g_io_scheduler_cancel_all_jobs:
22016 * Cancels all cancellable I/O jobs.
22018 * A job is cancellable if a #GCancellable was passed into
22019 * g_io_scheduler_push_job().
22024 * g_io_scheduler_job_send_to_mainloop:
22025 * @job: a #GIOSchedulerJob
22026 * @func: a #GSourceFunc callback that will be called in the original thread
22027 * @user_data: data to pass to @func
22028 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22030 * Used from an I/O job to send a callback to be run in the thread
22031 * that the job was started from, waiting for the result (and thus
22032 * blocking the I/O job).
22034 * Returns: The return value of @func
22039 * g_io_scheduler_job_send_to_mainloop_async:
22040 * @job: a #GIOSchedulerJob
22041 * @func: a #GSourceFunc callback that will be called in the original thread
22042 * @user_data: data to pass to @func
22043 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22045 * Used from an I/O job to send a callback to be run asynchronously in
22046 * the thread that the job was started from. The callback will be run
22047 * when the main loop is available, but at that time the I/O job might
22048 * have finished. The return value from the callback is ignored.
22050 * Note that if you are passing the @user_data from g_io_scheduler_push_job()
22051 * on to this function you have to ensure that it is not freed before
22052 * @func is called, either by passing %NULL as @notify to
22053 * g_io_scheduler_push_job() or by using refcounting for @user_data.
22058 * g_io_scheduler_push_job:
22059 * @job_func: a #GIOSchedulerJobFunc.
22060 * @user_data: data to pass to @job_func
22061 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22062 * @io_priority: the <link linkend="gioscheduler">I/O priority</link> of the request.
22063 * @cancellable: optional #GCancellable object, %NULL to ignore.
22065 * Schedules the I/O job to run in another thread.
22067 * @notify will be called on @user_data after @job_func has returned,
22068 * regardless whether the job was cancelled or has run to completion.
22070 * If @cancellable is not %NULL, it can be used to cancel the I/O job
22071 * by calling g_cancellable_cancel() or by calling
22072 * g_io_scheduler_cancel_all_jobs().
22077 * g_io_stream_clear_pending:
22078 * @stream: a #GIOStream
22080 * Clears the pending flag on @stream.
22087 * g_io_stream_close:
22088 * @stream: a #GIOStream
22089 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
22090 * @error: location to store the error occurring, or %NULL to ignore
22092 * Closes the stream, releasing resources related to it. This will also
22093 * closes the individual input and output streams, if they are not already
22096 * Once the stream is closed, all other operations will return
22097 * %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
22100 * Closing a stream will automatically flush any outstanding buffers
22103 * Streams will be automatically closed when the last reference
22104 * is dropped, but you might want to call this function to make sure
22105 * resources are released as early as possible.
22107 * Some streams might keep the backing store of the stream (e.g. a file
22108 * descriptor) open after the stream is closed. See the documentation for
22109 * the individual stream for details.
22111 * On failure the first error that happened will be reported, but the
22112 * close operation will finish as much as possible. A stream that failed
22113 * to close will still return %G_IO_ERROR_CLOSED for all operations.
22114 * Still, it is important to check and report the error to the user,
22115 * otherwise there might be a loss of data as all data might not be written.
22117 * If @cancellable is not NULL, then the operation can be cancelled by
22118 * triggering the cancellable object from another thread. If the operation
22119 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
22120 * Cancelling a close will still leave the stream closed, but some streams
22121 * can use a faster close that doesn't block to e.g. check errors.
22123 * The default implementation of this method just calls close on the
22124 * individual input/output streams.
22126 * Returns: %TRUE on success, %FALSE on failure
22132 * g_io_stream_close_async:
22133 * @stream: a #GIOStream
22134 * @io_priority: the io priority of the request
22135 * @cancellable: (allow-none): optional cancellable object
22136 * @callback: (scope async): callback to call when the request is satisfied
22137 * @user_data: (closure): the data to pass to callback function
22139 * Requests an asynchronous close of the stream, releasing resources
22140 * related to it. When the operation is finished @callback will be
22141 * called. You can then call g_io_stream_close_finish() to get
22142 * the result of the operation.
22144 * For behaviour details see g_io_stream_close().
22146 * The asynchronous methods have a default fallback that uses threads
22147 * to implement asynchronicity, so they are optional for inheriting
22148 * classes. However, if you override one you must override all.
22155 * g_io_stream_close_finish:
22156 * @stream: a #GIOStream
22157 * @result: a #GAsyncResult
22158 * @error: a #GError location to store the error occurring, or %NULL to ignore
22162 * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
22168 * g_io_stream_get_input_stream:
22169 * @stream: a #GIOStream
22171 * Gets the input stream for this object. This is used
22174 * Returns: (transfer none): a #GInputStream, owned by the #GIOStream. Do not free.
22180 * g_io_stream_get_output_stream:
22181 * @stream: a #GIOStream
22183 * Gets the output stream for this object. This is used for
22186 * Returns: (transfer none): a #GOutputStream, owned by the #GIOStream. Do not free.
22192 * g_io_stream_has_pending:
22193 * @stream: a #GIOStream
22195 * Checks if a stream has pending actions.
22197 * Returns: %TRUE if @stream has pending actions.
22203 * g_io_stream_is_closed:
22204 * @stream: a #GIOStream
22206 * Checks if a stream is closed.
22208 * Returns: %TRUE if the stream is closed.
22214 * g_io_stream_set_pending:
22215 * @stream: a #GIOStream
22216 * @error: a #GError location to store the error occurring, or %NULL to ignore
22218 * Sets @stream to have actions pending. If the pending flag is
22219 * already set or @stream is closed, it will return %FALSE and set
22222 * Returns: %TRUE if pending was previously unset and is now set.
22228 * g_io_stream_splice_async:
22229 * @stream1: a #GIOStream.
22230 * @stream2: a #GIOStream.
22231 * @flags: a set of #GIOStreamSpliceFlags.
22232 * @io_priority: the io priority of the request.
22233 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22234 * @callback: (scope async): a #GAsyncReadyCallback.
22235 * @user_data: (closure): user data passed to @callback.
22237 * Asyncronously splice the output stream of @stream1 to the input stream of
22238 * @stream2, and splice the output stream of @stream2 to the input stream of
22241 * When the operation is finished @callback will be called.
22242 * You can then call g_io_stream_splice_finish() to get the
22243 * result of the operation.
22250 * g_io_stream_splice_finish:
22251 * @result: a #GAsyncResult.
22252 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22254 * Finishes an asynchronous io stream splice operation.
22256 * Returns: %TRUE on success, %FALSE otherwise.
22262 * g_keyfile_settings_backend_new:
22263 * @filename: the filename of the keyfile
22264 * @root_path: the path under which all settings keys appear
22265 * @root_group: (allow-none): the group name corresponding to @root_path, or %NULL
22267 * Creates a keyfile-backed #GSettingsBackend.
22269 * The filename of the keyfile to use is given by @filename.
22271 * All settings read to or written from the backend must fall under the
22272 * path given in @root_path (which must start and end with a slash and
22273 * not contain two consecutive slashes). @root_path may be "/".
22275 * If @root_group is non-%NULL then it specifies the name of the keyfile
22276 * group used for keys that are written directly below @root_path. For
22277 * example, if @root_path is "/apps/example/" and @root_group is
22278 * "toplevel", then settings the key "/apps/example/enabled" to a value
22279 * of %TRUE will cause the following to appear in the keyfile:
22286 * If @root_group is %NULL then it is not permitted to store keys
22287 * directly below the @root_path.
22289 * For keys not stored directly below @root_path (ie: in a sub-path),
22290 * the name of the subpath (with the final slash stripped) is used as
22291 * the name of the keyfile group. To continue the example, if
22292 * "/apps/example/profiles/default/font-size" were set to
22293 * 12 then the following would appear in the keyfile:
22296 * [profiles/default]
22300 * The backend will refuse writes (and return writability as being
22301 * %FALSE) for keys outside of @root_path and, in the event that
22302 * @root_group is %NULL, also for keys directly under @root_path.
22303 * Writes will also be refused if the backend detects that it has the
22304 * inability to rewrite the keyfile (ie: the containing directory is not
22307 * There is no checking done for your key namespace clashing with the
22308 * syntax of the key file format. For example, if you have '[' or ']'
22309 * characters in your path names or '=' in your key names you may be in
22312 * Returns: (transfer full): a keyfile-backed #GSettingsBackend
22317 * g_loadable_icon_load:
22318 * @icon: a #GLoadableIcon.
22319 * @size: an integer.
22320 * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
22321 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22322 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22324 * Loads a loadable icon. For the asynchronous version of this function,
22325 * see g_loadable_icon_load_async().
22327 * Returns: (transfer full): a #GInputStream to read the icon from.
22332 * g_loadable_icon_load_async:
22333 * @icon: a #GLoadableIcon.
22334 * @size: an integer.
22335 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22336 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
22337 * @user_data: (closure): the data to pass to callback function
22339 * Loads an icon asynchronously. To finish this function, see
22340 * g_loadable_icon_load_finish(). For the synchronous, blocking
22341 * version of this function, see g_loadable_icon_load().
22346 * g_loadable_icon_load_finish:
22347 * @icon: a #GLoadableIcon.
22348 * @res: a #GAsyncResult.
22349 * @type: a location to store the type of the loaded icon, %NULL to ignore.
22350 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22352 * Finishes an asynchronous icon load started in g_loadable_icon_load_async().
22354 * Returns: (transfer full): a #GInputStream to read the icon from.
22361 * Returns a new #GVfs handle for a local vfs.
22363 * Returns: a new #GVfs handle.
22368 * g_memory_input_stream_add_bytes:
22369 * @stream: a #GMemoryInputStream
22370 * @bytes: input data
22372 * Appends @bytes to data that can be read from the input stream.
22379 * g_memory_input_stream_add_data:
22380 * @stream: a #GMemoryInputStream
22381 * @data: (array length=len) (element-type guint8) (transfer full): input data
22382 * @len: length of the data, may be -1 if @data is a nul-terminated string
22383 * @destroy: (allow-none): function that is called to free @data, or %NULL
22385 * Appends @data to data that can be read from the input stream
22390 * g_memory_input_stream_new:
22392 * Creates a new empty #GMemoryInputStream.
22394 * Returns: a new #GInputStream
22399 * g_memory_input_stream_new_from_bytes:
22400 * @bytes: a #GBytes
22402 * Creates a new #GMemoryInputStream with data from the given @bytes.
22404 * Returns: new #GInputStream read from @bytes
22410 * g_memory_input_stream_new_from_data:
22411 * @data: (array length=len) (element-type guint8) (transfer full): input data
22412 * @len: length of the data, may be -1 if @data is a nul-terminated string
22413 * @destroy: (allow-none): function that is called to free @data, or %NULL
22415 * Creates a new #GMemoryInputStream with data in memory of a given size.
22417 * Returns: new #GInputStream read from @data of @len bytes.
22422 * g_memory_output_stream_get_data:
22423 * @ostream: a #GMemoryOutputStream
22425 * Gets any loaded data from the @ostream.
22427 * Note that the returned pointer may become invalid on the next
22428 * write or truncate operation on the stream.
22430 * Returns: (transfer none): pointer to the stream's data
22435 * g_memory_output_stream_get_data_size:
22436 * @ostream: a #GMemoryOutputStream
22438 * Returns the number of bytes from the start up
22439 * to including the last byte written in the stream
22440 * that has not been truncated away.
22442 * Returns: the number of bytes written to the stream
22448 * g_memory_output_stream_get_size:
22449 * @ostream: a #GMemoryOutputStream
22451 * Gets the size of the currently allocated data area (available from
22452 * g_memory_output_stream_get_data()). If the stream isn't
22453 * growable (no realloc was passed to g_memory_output_stream_new()) then
22454 * this is the maximum size of the stream and further writes
22455 * will return %G_IO_ERROR_NO_SPACE.
22457 * Note that for growable streams the returned size may become invalid on
22458 * the next write or truncate operation on the stream.
22460 * If you want the number of bytes currently written to the stream, use
22461 * g_memory_output_stream_get_data_size().
22463 * Returns: the number of bytes allocated for the data buffer
22468 * g_memory_output_stream_new: (skip)
22469 * @data: (allow-none): pointer to a chunk of memory to use, or %NULL
22470 * @size: the size of @data
22471 * @realloc_function: (allow-none): a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
22472 * @destroy_function: (allow-none): a function to be called on @data when the stream is finalized, or %NULL
22474 * Creates a new #GMemoryOutputStream.
22476 * If @data is non-%NULL, the stream will use that for its internal storage.
22477 * If @realloc_fn is non-%NULL, it will be used for resizing the internal
22478 * storage when necessary. To construct a fixed-size output stream,
22479 * pass %NULL as @realloc_fn.
22482 * /* a stream that can grow */
22483 * stream = g_memory_output_stream_new (NULL, 0, realloc, free);
22485 * /* another stream that can grow */
22486 * stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
22488 * /* a fixed-size stream */
22489 * data = malloc (200);
22490 * stream3 = g_memory_output_stream_new (data, 200, NULL, free);
22493 * Returns: A newly created #GMemoryOutputStream object.
22498 * g_memory_output_stream_steal_as_bytes:
22499 * @ostream: a #GMemoryOutputStream
22501 * Returns data from the @ostream as a #GBytes. @ostream must be
22502 * closed before calling this function.
22504 * Returns: (transfer full): the stream's data
22510 * g_memory_output_stream_steal_data:
22511 * @ostream: a #GMemoryOutputStream
22513 * Gets any loaded data from the @ostream. Ownership of the data
22514 * is transferred to the caller; when no longer needed it must be
22515 * freed using the free function set in @ostream's
22516 * #GMemoryOutputStream:destroy-function property.
22518 * @ostream must be closed before calling this function.
22520 * Returns: (transfer full): the stream's data
22526 * g_memory_settings_backend_new:
22528 * Creates a memory-backed #GSettingsBackend.
22530 * This backend allows changes to settings, but does not write them
22531 * to any backing storage, so the next time you run your application,
22532 * the memory backend will start out with the default values again.
22534 * Returns: (transfer full): a newly created #GSettingsBackend
22542 * @label: (allow-none): the section label, or %NULL
22543 * @detailed_action: (allow-none): the detailed action string, or %NULL
22545 * Convenience function for appending a normal menu item to the end of
22546 * @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
22547 * flexible alternative.
22554 * g_menu_append_item:
22556 * @item: a #GMenuItem to append
22558 * Appends @item to the end of @menu.
22560 * See g_menu_insert_item() for more information.
22567 * g_menu_append_section:
22569 * @label: (allow-none): the section label, or %NULL
22570 * @section: a #GMenuModel with the items of the section
22572 * Convenience function for appending a section menu item to the end of
22573 * @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for a
22574 * more flexible alternative.
22581 * g_menu_append_submenu:
22583 * @label: (allow-none): the section label, or %NULL
22584 * @submenu: a #GMenuModel with the items of the submenu
22586 * Convenience function for appending a submenu menu item to the end of
22587 * @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for a
22588 * more flexible alternative.
22595 * g_menu_attribute_iter_get_name:
22596 * @iter: a #GMenuAttributeIter
22598 * Gets the name of the attribute at the current iterator position, as
22601 * The iterator is not advanced.
22603 * Returns: the name of the attribute
22609 * g_menu_attribute_iter_get_next:
22610 * @iter: a #GMenuAttributeIter
22611 * @out_name: (out) (allow-none) (transfer none): the type of the attribute
22612 * @value: (out) (allow-none) (transfer full): the attribute value
22614 * This function combines g_menu_attribute_iter_next() with
22615 * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
22617 * First the iterator is advanced to the next (possibly first) attribute.
22618 * If that fails, then %FALSE is returned and there are no other
22621 * If successful, @name and @value are set to the name and value of the
22622 * attribute that has just been advanced to. At this point,
22623 * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will
22624 * return the same values again.
22626 * The value returned in @name remains valid for as long as the iterator
22627 * remains at the current position. The value returned in @value must
22628 * be unreffed using g_variant_unref() when it is no longer in use.
22630 * Returns: %TRUE on success, or %FALSE if there is no additional attribute
22636 * g_menu_attribute_iter_get_value:
22637 * @iter: a #GMenuAttributeIter
22639 * Gets the value of the attribute at the current iterator position.
22641 * The iterator is not advanced.
22643 * Returns: (transfer full): the value of the current attribute
22649 * g_menu_attribute_iter_next:
22650 * @iter: a #GMenuAttributeIter
22652 * Attempts to advance the iterator to the next (possibly first)
22655 * %TRUE is returned on success, or %FALSE if there are no more
22658 * You must call this function when you first acquire the iterator
22659 * to advance it to the first attribute (and determine if the first
22660 * attribute exists at all).
22662 * Returns: %TRUE on success, or %FALSE when there are no more attributes
22671 * Marks @menu as frozen.
22673 * After the menu is frozen, it is an error to attempt to make any
22674 * changes to it. In effect this means that the #GMenu API must no
22677 * This function causes g_menu_model_is_mutable() to begin returning
22678 * %FALSE, which has some positive performance implications.
22687 * @position: the position at which to insert the item
22688 * @label: (allow-none): the section label, or %NULL
22689 * @detailed_action: (allow-none): the detailed action string, or %NULL
22691 * Convenience function for inserting a normal menu item into @menu.
22692 * Combine g_menu_item_new() and g_menu_insert_item() for a more flexible
22700 * g_menu_insert_item:
22702 * @position: the position at which to insert the item
22703 * @item: the #GMenuItem to insert
22705 * Inserts @item into @menu.
22707 * The "insertion" is actually done by copying all of the attribute and
22708 * link values of @item and using them to form a new item within @menu.
22709 * As such, @item itself is not really inserted, but rather, a menu item
22710 * that is exactly the same as the one presently described by @item.
22712 * This means that @item is essentially useless after the insertion
22713 * occurs. Any changes you make to it are ignored unless it is inserted
22714 * again (at which point its updated values will be copied).
22716 * You should probably just free @item once you're done.
22718 * There are many convenience functions to take care of common cases.
22719 * See g_menu_insert(), g_menu_insert_section() and
22720 * g_menu_insert_submenu() as well as "prepend" and "append" variants of
22721 * each of these functions.
22728 * g_menu_insert_section:
22730 * @position: the position at which to insert the item
22731 * @label: (allow-none): the section label, or %NULL
22732 * @section: a #GMenuModel with the items of the section
22734 * Convenience function for inserting a section menu item into @menu.
22735 * Combine g_menu_item_new_section() and g_menu_insert_item() for a more
22736 * flexible alternative.
22743 * g_menu_insert_submenu:
22745 * @position: the position at which to insert the item
22746 * @label: (allow-none): the section label, or %NULL
22747 * @submenu: a #GMenuModel with the items of the submenu
22749 * Convenience function for inserting a submenu menu item into @menu.
22750 * Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more
22751 * flexible alternative.
22758 * g_menu_item_get_attribute:
22759 * @menu_item: a #GMenuItem
22760 * @attribute: the attribute name to query
22761 * @format_string: a #GVariant format string
22762 * @...: positional parameters, as per @format_string
22764 * Queries the named @attribute on @menu_item.
22766 * If the attribute exists and matches the #GVariantType corresponding
22767 * to @format_string then @format_string is used to deconstruct the
22768 * value into the positional parameters and %TRUE is returned.
22770 * If the attribute does not exist, or it does exist but has the wrong
22771 * type, then the positional parameters are ignored and %FALSE is
22774 * Returns: %TRUE if the named attribute was found with the expected type
22780 * g_menu_item_get_attribute_value:
22781 * @menu_item: a #GMenuItem
22782 * @attribute: the attribute name to query
22783 * @expected_type: (allow-none): the expected type of the attribute
22785 * Queries the named @attribute on @menu_item.
22787 * If @expected_type is specified and the attribute does not have this
22788 * type, %NULL is returned. %NULL is also returned if the attribute
22789 * simply does not exist.
22791 * Returns: (transfer full): the attribute value, or %NULL
22797 * g_menu_item_get_link:
22798 * @menu_item: a #GMenuItem
22799 * @link: the link name to query
22801 * Queries the named @link on @menu_item.
22803 * Returns: (transfer full): the link, or %NULL
22810 * @label: (allow-none): the section label, or %NULL
22811 * @detailed_action: (allow-none): the detailed action string, or %NULL
22813 * Creates a new #GMenuItem.
22815 * If @label is non-%NULL it is used to set the "label" attribute of the
22818 * If @detailed_action is non-%NULL it is used to set the "action" and
22819 * possibly the "target" attribute of the new item. See
22820 * g_menu_item_set_detailed_action() for more information.
22822 * Returns: a new #GMenuItem
22828 * g_menu_item_new_from_model:
22829 * @model: a #GMenuModel
22830 * @item_index: the index of an item in @model
22832 * Creates a #GMenuItem as an exact copy of an existing menu item in a
22835 * @item_index must be valid (ie: be sure to call
22836 * g_menu_model_get_n_items() first).
22838 * Returns: a new #GMenuItem.
22844 * g_menu_item_new_section:
22845 * @label: (allow-none): the section label, or %NULL
22846 * @section: a #GMenuModel with the items of the section
22848 * Creates a new #GMenuItem representing a section.
22850 * This is a convenience API around g_menu_item_new() and
22851 * g_menu_item_set_section().
22853 * The effect of having one menu appear as a section of another is
22854 * exactly as it sounds: the items from @section become a direct part of
22855 * the menu that @menu_item is added to.
22857 * Visual separation is typically displayed between two non-empty
22858 * sections. If @label is non-%NULL then it will be encorporated into
22859 * this visual indication. This allows for labeled subsections of a
22862 * As a simple example, consider a typical "Edit" menu from a simple
22863 * program. It probably contains an "Undo" and "Redo" item, followed by
22864 * a separator, followed by "Cut", "Copy" and "Paste".
22866 * This would be accomplished by creating three #GMenu instances. The
22867 * first would be populated with the "Undo" and "Redo" items, and the
22868 * second with the "Cut", "Copy" and "Paste" items. The first and
22869 * second menus would then be added as submenus of the third. In XML
22870 * format, this would look something like the following:
22872 * <informalexample><programlisting><![CDATA[
22873 * <menu id='edit-menu'>
22875 * <item label='Undo'/>
22876 * <item label='Redo'/>
22879 * <item label='Cut'/>
22880 * <item label='Copy'/>
22881 * <item label='Paste'/>
22884 * ]]></programlisting></informalexample>
22886 * The following example is exactly equivalent. It is more illustrative
22887 * of the exact relationship between the menus and items (keeping in
22888 * mind that the 'link' element defines a new menu that is linked to the
22889 * containing one). The style of the second example is more verbose and
22890 * difficult to read (and therefore not recommended except for the
22891 * purpose of understanding what is really going on).
22893 * <informalexample><programlisting><![CDATA[
22894 * <menu id='edit-menu'>
22896 * <link name='section'>
22897 * <item label='Undo'/>
22898 * <item label='Redo'/>
22902 * <link name='section'>
22903 * <item label='Cut'/>
22904 * <item label='Copy'/>
22905 * <item label='Paste'/>
22909 * ]]></programlisting></informalexample>
22911 * Returns: a new #GMenuItem
22917 * g_menu_item_new_submenu:
22918 * @label: (allow-none): the section label, or %NULL
22919 * @submenu: a #GMenuModel with the items of the submenu
22921 * Creates a new #GMenuItem representing a submenu.
22923 * This is a convenience API around g_menu_item_new() and
22924 * g_menu_item_set_submenu().
22926 * Returns: a new #GMenuItem
22932 * g_menu_item_set_action_and_target:
22933 * @menu_item: a #GMenuItem
22934 * @action: (allow-none): the name of the action for this item
22935 * @format_string: (allow-none): a GVariant format string
22936 * @...: positional parameters, as per @format_string
22938 * Sets or unsets the "action" and "target" attributes of @menu_item.
22940 * If @action is %NULL then both the "action" and "target" attributes
22941 * are unset (and @format_string is ignored along with the positional
22944 * If @action is non-%NULL then the "action" attribute is set.
22945 * @format_string is then inspected. If it is non-%NULL then the proper
22946 * position parameters are collected to create a #GVariant instance to
22947 * use as the target value. If it is %NULL then the positional
22948 * parameters are ignored and the "target" attribute is unset.
22950 * See also g_menu_item_set_action_and_target_value() for an equivalent
22951 * call that directly accepts a #GVariant. See
22952 * g_menu_item_set_detailed_action() for a more convenient version that
22953 * works with string-typed targets.
22955 * See also g_menu_item_set_action_and_target_value() for a
22956 * description of the semantics of the action and target attributes.
22963 * g_menu_item_set_action_and_target_value:
22964 * @menu_item: a #GMenuItem
22965 * @action: (allow-none): the name of the action for this item
22966 * @target_value: (allow-none): a #GVariant to use as the action target
22968 * Sets or unsets the "action" and "target" attributes of @menu_item.
22970 * If @action is %NULL then both the "action" and "target" attributes
22971 * are unset (and @target_value is ignored).
22973 * If @action is non-%NULL then the "action" attribute is set. The
22974 * "target" attribute is then set to the value of @target_value if it is
22975 * non-%NULL or unset otherwise.
22977 * Normal menu items (ie: not submenu, section or other custom item
22978 * types) are expected to have the "action" attribute set to identify
22979 * the action that they are associated with. The state type of the
22980 * action help to determine the disposition of the menu item. See
22981 * #GAction and #GActionGroup for an overview of actions.
22983 * In general, clicking on the menu item will result in activation of
22984 * the named action with the "target" attribute given as the parameter
22985 * to the action invocation. If the "target" attribute is not set then
22986 * the action is invoked with no parameter.
22988 * If the action has no state then the menu item is usually drawn as a
22989 * plain menu item (ie: with no additional decoration).
22991 * If the action has a boolean state then the menu item is usually drawn
22992 * as a toggle menu item (ie: with a checkmark or equivalent
22993 * indication). The item should be marked as 'toggled' or 'checked'
22994 * when the boolean state is %TRUE.
22996 * If the action has a string state then the menu item is usually drawn
22997 * as a radio menu item (ie: with a radio bullet or equivalent
22998 * indication). The item should be marked as 'selected' when the string
22999 * state is equal to the value of the @target property.
23001 * See g_menu_item_set_action_and_target() or
23002 * g_menu_item_set_detailed_action() for two equivalent calls that are
23003 * probably more convenient for most uses.
23010 * g_menu_item_set_attribute:
23011 * @menu_item: a #GMenuItem
23012 * @attribute: the attribute to set
23013 * @format_string: (allow-none): a #GVariant format string, or %NULL
23014 * @...: positional parameters, as per @format_string
23016 * Sets or unsets an attribute on @menu_item.
23018 * The attribute to set or unset is specified by @attribute. This
23019 * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23020 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23022 * Attribute names are restricted to lowercase characters, numbers
23023 * and '-'. Furthermore, the names must begin with a lowercase character,
23024 * must not end with a '-', and must not contain consecutive dashes.
23026 * If @format_string is non-%NULL then the proper position parameters
23027 * are collected to create a #GVariant instance to use as the attribute
23028 * value. If it is %NULL then the positional parameterrs are ignored
23029 * and the named attribute is unset.
23031 * See also g_menu_item_set_attribute_value() for an equivalent call
23032 * that directly accepts a #GVariant.
23039 * g_menu_item_set_attribute_value:
23040 * @menu_item: a #GMenuItem
23041 * @attribute: the attribute to set
23042 * @value: (allow-none): a #GVariant to use as the value, or %NULL
23044 * Sets or unsets an attribute on @menu_item.
23046 * The attribute to set or unset is specified by @attribute. This
23047 * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23048 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23050 * Attribute names are restricted to lowercase characters, numbers
23051 * and '-'. Furthermore, the names must begin with a lowercase character,
23052 * must not end with a '-', and must not contain consecutive dashes.
23054 * must consist only of lowercase
23055 * ASCII characters, digits and '-'.
23057 * If @value is non-%NULL then it is used as the new value for the
23058 * attribute. If @value is %NULL then the attribute is unset. If
23059 * the @value #GVariant is floating, it is consumed.
23061 * See also g_menu_item_set_attribute() for a more convenient way to do
23069 * g_menu_item_set_detailed_action:
23070 * @menu_item: a #GMenuItem
23071 * @detailed_action: the "detailed" action string
23073 * Sets the "action" and possibly the "target" attribute of @menu_item.
23075 * If @detailed_action contains a double colon ("::") then it is used as
23076 * a separator between an action name and a target string. In this
23077 * case, this call is equivalent to calling
23078 * g_menu_item_set_action_and_target() with the part before the "::" and
23079 * with a string-type #GVariant containing the part following the "::".
23081 * If @detailed_action doesn't contain "::" then the action is set to
23082 * the given string (verbatim) and the target value is unset.
23084 * See g_menu_item_set_action_and_target() or
23085 * g_menu_item_set_action_and_target_value() for more flexible (but
23086 * slightly less convenient) alternatives.
23088 * See also g_menu_item_set_action_and_target_value() for a description of
23089 * the semantics of the action and target attributes.
23096 * g_menu_item_set_label:
23097 * @menu_item: a #GMenuItem
23098 * @label: (allow-none): the label to set, or %NULL to unset
23100 * Sets or unsets the "label" attribute of @menu_item.
23102 * If @label is non-%NULL it is used as the label for the menu item. If
23103 * it is %NULL then the label attribute is unset.
23110 * g_menu_item_set_link:
23111 * @menu_item: a #GMenuItem
23112 * @link: type of link to establish or unset
23113 * @model: (allow-none): the #GMenuModel to link to (or %NULL to unset)
23115 * Creates a link from @menu_item to @model if non-%NULL, or unsets it.
23117 * Links are used to establish a relationship between a particular menu
23118 * item and another menu. For example, %G_MENU_LINK_SUBMENU is used to
23119 * associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
23120 * is used to create a section. Other types of link can be used, but there
23121 * is no guarantee that clients will be able to make sense of them.
23122 * Link types are restricted to lowercase characters, numbers
23123 * and '-'. Furthermore, the names must begin with a lowercase character,
23124 * must not end with a '-', and must not contain consecutive dashes.
23131 * g_menu_item_set_section:
23132 * @menu_item: a #GMenuItem
23133 * @section: (allow-none): a #GMenuModel, or %NULL
23135 * Sets or unsets the "section" link of @menu_item to @section.
23137 * The effect of having one menu appear as a section of another is
23138 * exactly as it sounds: the items from @section become a direct part of
23139 * the menu that @menu_item is added to. See g_menu_item_new_section()
23140 * for more information about what it means for a menu item to be a
23148 * g_menu_item_set_submenu:
23149 * @menu_item: a #GMenuItem
23150 * @submenu: (allow-none): a #GMenuModel, or %NULL
23152 * Sets or unsets the "submenu" link of @menu_item to @submenu.
23154 * If @submenu is non-%NULL, it is linked to. If it is %NULL then the
23157 * The effect of having one menu appear as a submenu of another is
23158 * exactly as it sounds.
23165 * g_menu_link_iter_get_name:
23166 * @iter: a #GMenuLinkIter
23168 * Gets the name of the link at the current iterator position.
23170 * The iterator is not advanced.
23172 * Returns: the type of the link
23178 * g_menu_link_iter_get_next:
23179 * @iter: a #GMenuLinkIter
23180 * @out_link: (out) (allow-none) (transfer none): the name of the link
23181 * @value: (out) (allow-none) (transfer full): the linked #GMenuModel
23183 * This function combines g_menu_link_iter_next() with
23184 * g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
23186 * First the iterator is advanced to the next (possibly first) link.
23187 * If that fails, then %FALSE is returned and there are no other effects.
23189 * If successful, @out_link and @value are set to the name and #GMenuModel
23190 * of the link that has just been advanced to. At this point,
23191 * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
23192 * same values again.
23194 * The value returned in @out_link remains valid for as long as the iterator
23195 * remains at the current position. The value returned in @value must
23196 * be unreffed using g_object_unref() when it is no longer in use.
23198 * Returns: %TRUE on success, or %FALSE if there is no additional link
23204 * g_menu_link_iter_get_value:
23205 * @iter: a #GMenuLinkIter
23207 * Gets the linked #GMenuModel at the current iterator position.
23209 * The iterator is not advanced.
23211 * Returns: (transfer full): the #GMenuModel that is linked to
23217 * g_menu_link_iter_next:
23218 * @iter: a #GMenuLinkIter
23220 * Attempts to advance the iterator to the next (possibly first)
23223 * %TRUE is returned on success, or %FALSE if there are no more links.
23225 * You must call this function when you first acquire the iterator to
23226 * advance it to the first link (and determine if the first link exists
23229 * Returns: %TRUE on success, or %FALSE when there are no more links
23235 * g_menu_model_get_item_attribute:
23236 * @model: a #GMenuModel
23237 * @item_index: the index of the item
23238 * @attribute: the attribute to query
23239 * @format_string: a #GVariant format string
23240 * @...: positional parameters, as per @format_string
23242 * Queries item at position @item_index in @model for the attribute
23243 * specified by @attribute.
23245 * If the attribute exists and matches the #GVariantType corresponding
23246 * to @format_string then @format_string is used to deconstruct the
23247 * value into the positional parameters and %TRUE is returned.
23249 * If the attribute does not exist, or it does exist but has the wrong
23250 * type, then the positional parameters are ignored and %FALSE is
23253 * This function is a mix of g_menu_model_get_item_attribute_value() and
23254 * g_variant_get(), followed by a g_variant_unref(). As such,
23255 * @format_string must make a complete copy of the data (since the
23256 * #GVariant may go away after the call to g_variant_unref()). In
23257 * particular, no '&' characters are allowed in @format_string.
23259 * Returns: %TRUE if the named attribute was found with the expected type
23265 * g_menu_model_get_item_attribute_value:
23266 * @model: a #GMenuModel
23267 * @item_index: the index of the item
23268 * @attribute: the attribute to query
23269 * @expected_type: (allow-none): the expected type of the attribute, or %NULL
23271 * Queries the item at position @item_index in @model for the attribute
23272 * specified by @attribute.
23274 * If @expected_type is non-%NULL then it specifies the expected type of
23275 * the attribute. If it is %NULL then any type will be accepted.
23277 * If the attribute exists and matches @expected_type (or if the
23278 * expected type is unspecified) then the value is returned.
23280 * If the attribute does not exist, or does not match the expected type
23281 * then %NULL is returned.
23283 * Returns: (transfer full): the value of the attribute
23289 * g_menu_model_get_item_link:
23290 * @model: a #GMenuModel
23291 * @item_index: the index of the item
23292 * @link: the link to query
23294 * Queries the item at position @item_index in @model for the link
23295 * specified by @link.
23297 * If the link exists, the linked #GMenuModel is returned. If the link
23298 * does not exist, %NULL is returned.
23300 * Returns: (transfer full): the linked #GMenuModel, or %NULL
23306 * g_menu_model_get_n_items:
23307 * @model: a #GMenuModel
23309 * Query the number of items in @model.
23311 * Returns: the number of items
23317 * g_menu_model_is_mutable:
23318 * @model: a #GMenuModel
23320 * Queries if @model is mutable.
23322 * An immutable #GMenuModel will never emit the #GMenuModel::items-changed
23323 * signal. Consumers of the model may make optimisations accordingly.
23325 * Returns: %TRUE if the model is mutable (ie: "items-changed" may be emitted).
23331 * g_menu_model_items_changed:
23332 * @model: a #GMenuModel
23333 * @position: the position of the change
23334 * @removed: the number of items removed
23335 * @added: the number of items added
23337 * Requests emission of the #GMenuModel::items-changed signal on @model.
23339 * This function should never be called except by #GMenuModel
23340 * subclasses. Any other calls to this function will very likely lead
23341 * to a violation of the interface of the model.
23343 * The implementation should update its internal representation of the
23344 * menu before emitting the signal. The implementation should further
23345 * expect to receive queries about the new state of the menu (and
23346 * particularly added menu items) while signal handlers are running.
23348 * The implementation must dispatch this call directly from a mainloop
23349 * entry and not in response to calls -- particularly those from the
23350 * #GMenuModel API. Said another way: the menu must not change while
23351 * user code is running without returning to the mainloop.
23358 * g_menu_model_iterate_item_attributes:
23359 * @model: a #GMenuModel
23360 * @item_index: the index of the item
23362 * Creates a #GMenuAttributeIter to iterate over the attributes of
23363 * the item at position @item_index in @model.
23365 * You must free the iterator with g_object_unref() when you are done.
23367 * Returns: (transfer full): a new #GMenuAttributeIter
23373 * g_menu_model_iterate_item_links:
23374 * @model: a #GMenuModel
23375 * @item_index: the index of the item
23377 * Creates a #GMenuLinkIter to iterate over the links of the item at
23378 * position @item_index in @model.
23380 * You must free the iterator with g_object_unref() when you are done.
23382 * Returns: (transfer full): a new #GMenuLinkIter
23390 * Creates a new #GMenu.
23392 * The new menu has no items.
23394 * Returns: a new #GMenu
23402 * @label: (allow-none): the section label, or %NULL
23403 * @detailed_action: (allow-none): the detailed action string, or %NULL
23405 * Convenience function for prepending a normal menu item to the start
23406 * of @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
23407 * flexible alternative.
23414 * g_menu_prepend_item:
23416 * @item: a #GMenuItem to prepend
23418 * Prepends @item to the start of @menu.
23420 * See g_menu_insert_item() for more information.
23427 * g_menu_prepend_section:
23429 * @label: (allow-none): the section label, or %NULL
23430 * @section: a #GMenuModel with the items of the section
23432 * Convenience function for prepending a section menu item to the start
23433 * of @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for
23434 * a more flexible alternative.
23441 * g_menu_prepend_submenu:
23443 * @label: (allow-none): the section label, or %NULL
23444 * @submenu: a #GMenuModel with the items of the submenu
23446 * Convenience function for prepending a submenu menu item to the start
23447 * of @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for
23448 * a more flexible alternative.
23457 * @position: the position of the item to remove
23459 * Removes an item from the menu.
23461 * @position gives the index of the item to remove.
23463 * It is an error if position is not in range the range from 0 to one
23464 * less than the number of items in the menu.
23466 * It is not possible to remove items by identity since items are added
23467 * to the menu simply by copying their links and attributes (ie:
23468 * identity of the item itself is not preserved).
23475 * g_mount_can_eject:
23476 * @mount: a #GMount.
23478 * Checks if @mount can be eject.
23480 * Returns: %TRUE if the @mount can be ejected.
23485 * g_mount_can_unmount:
23486 * @mount: a #GMount.
23488 * Checks if @mount can be mounted.
23490 * Returns: %TRUE if the @mount can be unmounted.
23496 * @mount: a #GMount.
23497 * @flags: flags affecting the unmount if required for eject
23498 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23499 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23500 * @user_data: user data passed to @callback.
23502 * Ejects a mount. This is an asynchronous operation, and is
23503 * finished by calling g_mount_eject_finish() with the @mount
23504 * and #GAsyncResult data returned in the @callback.
23506 * Deprecated: 2.22: Use g_mount_eject_with_operation() instead.
23511 * g_mount_eject_finish:
23512 * @mount: a #GMount.
23513 * @result: a #GAsyncResult.
23514 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23516 * Finishes ejecting a mount. If any errors occurred during the operation,
23517 * @error will be set to contain the errors and %FALSE will be returned.
23519 * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23520 * Deprecated: 2.22: Use g_mount_eject_with_operation_finish() instead.
23525 * g_mount_eject_with_operation:
23526 * @mount: a #GMount.
23527 * @flags: flags affecting the unmount if required for eject
23528 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23529 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23530 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23531 * @user_data: user data passed to @callback.
23533 * Ejects a mount. This is an asynchronous operation, and is
23534 * finished by calling g_mount_eject_with_operation_finish() with the @mount
23535 * and #GAsyncResult data returned in the @callback.
23542 * g_mount_eject_with_operation_finish:
23543 * @mount: a #GMount.
23544 * @result: a #GAsyncResult.
23545 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23547 * Finishes ejecting a mount. If any errors occurred during the operation,
23548 * @error will be set to contain the errors and %FALSE will be returned.
23550 * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23556 * g_mount_get_default_location:
23557 * @mount: a #GMount.
23559 * Gets the default location of @mount. The default location of the given
23560 * @mount is a path that reflects the main entry point for the user (e.g.
23561 * the home directory, or the root of the volume).
23563 * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23568 * g_mount_get_drive:
23569 * @mount: a #GMount.
23571 * Gets the drive for the @mount.
23573 * This is a convenience method for getting the #GVolume and then
23574 * using that object to get the #GDrive.
23576 * 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.
23581 * g_mount_get_icon:
23582 * @mount: a #GMount.
23584 * Gets the icon for @mount.
23586 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23591 * g_mount_get_name:
23592 * @mount: a #GMount.
23594 * Gets the name of @mount.
23596 * Returns: the name for the given @mount. The returned string should be freed with g_free() when no longer needed.
23601 * g_mount_get_root:
23602 * @mount: a #GMount.
23604 * Gets the root directory on @mount.
23606 * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23611 * g_mount_get_sort_key:
23612 * @mount: A #GMount.
23614 * Gets the sort key for @mount, if any.
23616 * Returns: Sorting key for @mount or %NULL if no such key is available.
23622 * g_mount_get_symbolic_icon:
23623 * @mount: a #GMount.
23625 * Gets the symbolic icon for @mount.
23627 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23633 * g_mount_get_uuid:
23634 * @mount: a #GMount.
23636 * Gets the UUID for the @mount. The reference is typically based on
23637 * the file system UUID for the mount in question and should be
23638 * considered an opaque string. Returns %NULL if there is no UUID
23641 * 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.
23646 * g_mount_get_volume:
23647 * @mount: a #GMount.
23649 * Gets the volume for the @mount.
23651 * 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.
23656 * g_mount_guess_content_type:
23657 * @mount: a #GMount
23658 * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23659 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23660 * @callback: a #GAsyncReadyCallback
23661 * @user_data: user data passed to @callback
23663 * Tries to guess the type of content stored on @mount. Returns one or
23664 * more textual identifiers of well-known content types (typically
23665 * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23666 * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23667 * specification for more on x-content types.
23669 * This is an asynchronous operation (see
23670 * g_mount_guess_content_type_sync() for the synchronous version), and
23671 * is finished by calling g_mount_guess_content_type_finish() with the
23672 * @mount and #GAsyncResult data returned in the @callback.
23679 * g_mount_guess_content_type_finish:
23680 * @mount: a #GMount
23681 * @result: a #GAsyncResult
23682 * @error: a #GError location to store the error occurring, or %NULL to ignore
23684 * Finishes guessing content types of @mount. If any errors occurred
23685 * during the operation, @error will be set to contain the errors and
23686 * %FALSE will be returned. In particular, you may get an
23687 * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
23690 * 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.
23696 * g_mount_guess_content_type_sync:
23697 * @mount: a #GMount
23698 * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23699 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23700 * @error: a #GError location to store the error occurring, or %NULL to ignore
23702 * Tries to guess the type of content stored on @mount. Returns one or
23703 * more textual identifiers of well-known content types (typically
23704 * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23705 * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23706 * specification for more on x-content types.
23708 * This is an synchronous operation and as such may block doing IO;
23709 * see g_mount_guess_content_type() for the asynchronous version.
23711 * 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.
23717 * g_mount_is_shadowed:
23718 * @mount: A #GMount.
23720 * Determines if @mount is shadowed. Applications or libraries should
23721 * avoid displaying @mount in the user interface if it is shadowed.
23723 * A mount is said to be shadowed if there exists one or more user
23724 * visible objects (currently #GMount objects) with a root that is
23725 * inside the root of @mount.
23727 * One application of shadow mounts is when exposing a single file
23728 * system that is used to address several logical volumes. In this
23729 * situation, a #GVolumeMonitor implementation would create two
23730 * #GVolume objects (for example, one for the camera functionality of
23731 * the device and one for a SD card reader on the device) with
23732 * activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
23733 * and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
23734 * underlying mount (with root
23735 * <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
23736 * #GVolumeMonitor implementation would create two #GMount objects
23737 * (each with their root matching the corresponding volume activation
23738 * root) that would shadow the original mount.
23740 * The proxy monitor in GVfs 2.26 and later, automatically creates and
23741 * manage shadow mounts (and shadows the underlying mount) if the
23742 * activation root on a #GVolume is set.
23744 * Returns: %TRUE if @mount is shadowed.
23750 * g_mount_operation_get_anonymous:
23751 * @op: a #GMountOperation.
23753 * Check to see whether the mount operation is being used
23754 * for an anonymous user.
23756 * Returns: %TRUE if mount operation is anonymous.
23761 * g_mount_operation_get_choice:
23762 * @op: a #GMountOperation.
23764 * Gets a choice from the mount operation.
23766 * Returns: an integer containing an index of the user's choice from the choice's list, or %0.
23771 * g_mount_operation_get_domain:
23772 * @op: a #GMountOperation.
23774 * Gets the domain of the mount operation.
23776 * Returns: a string set to the domain.
23781 * g_mount_operation_get_password:
23782 * @op: a #GMountOperation.
23784 * Gets a password from the mount operation.
23786 * Returns: a string containing the password within @op.
23791 * g_mount_operation_get_password_save:
23792 * @op: a #GMountOperation.
23794 * Gets the state of saving passwords for the mount operation.
23796 * Returns: a #GPasswordSave flag.
23801 * g_mount_operation_get_username:
23802 * @op: a #GMountOperation.
23804 * Get the user name from the mount operation.
23806 * Returns: a string containing the user name.
23811 * g_mount_operation_new:
23813 * Creates a new mount operation.
23815 * Returns: a #GMountOperation.
23820 * g_mount_operation_reply:
23821 * @op: a #GMountOperation
23822 * @result: a #GMountOperationResult
23824 * Emits the #GMountOperation::reply signal.
23829 * g_mount_operation_set_anonymous:
23830 * @op: a #GMountOperation.
23831 * @anonymous: boolean value.
23833 * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
23838 * g_mount_operation_set_choice:
23839 * @op: a #GMountOperation.
23840 * @choice: an integer.
23842 * Sets a default choice for the mount operation.
23847 * g_mount_operation_set_domain:
23848 * @op: a #GMountOperation.
23849 * @domain: the domain to set.
23851 * Sets the mount operation's domain.
23856 * g_mount_operation_set_password:
23857 * @op: a #GMountOperation.
23858 * @password: password to set.
23860 * Sets the mount operation's password to @password.
23865 * g_mount_operation_set_password_save:
23866 * @op: a #GMountOperation.
23867 * @save: a set of #GPasswordSave flags.
23869 * Sets the state of saving passwords for the mount operation.
23874 * g_mount_operation_set_username:
23875 * @op: a #GMountOperation.
23876 * @username: input username.
23878 * Sets the user name within @op to @username.
23884 * @mount: a #GMount.
23885 * @flags: flags affecting the operation
23886 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23887 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23888 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23889 * @user_data: user data passed to @callback.
23891 * Remounts a mount. This is an asynchronous operation, and is
23892 * finished by calling g_mount_remount_finish() with the @mount
23893 * and #GAsyncResults data returned in the @callback.
23895 * Remounting is useful when some setting affecting the operation
23896 * of the volume has been changed, as these may need a remount to
23897 * take affect. While this is semantically equivalent with unmounting
23898 * and then remounting not all backends might need to actually be
23904 * g_mount_remount_finish:
23905 * @mount: a #GMount.
23906 * @result: a #GAsyncResult.
23907 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23909 * Finishes remounting a mount. If any errors occurred during the operation,
23910 * @error will be set to contain the errors and %FALSE will be returned.
23912 * Returns: %TRUE if the mount was successfully remounted. %FALSE otherwise.
23918 * @mount: A #GMount.
23920 * Increments the shadow count on @mount. Usually used by
23921 * #GVolumeMonitor implementations when creating a shadow mount for
23922 * @mount, see g_mount_is_shadowed() for more information. The caller
23923 * will need to emit the #GMount::changed signal on @mount manually.
23931 * @mount: a #GMount.
23932 * @flags: flags affecting the operation
23933 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23934 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23935 * @user_data: user data passed to @callback.
23937 * Unmounts a mount. This is an asynchronous operation, and is
23938 * finished by calling g_mount_unmount_finish() with the @mount
23939 * and #GAsyncResult data returned in the @callback.
23941 * Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
23946 * g_mount_unmount_finish:
23947 * @mount: a #GMount.
23948 * @result: a #GAsyncResult.
23949 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23951 * Finishes unmounting a mount. If any errors occurred during the operation,
23952 * @error will be set to contain the errors and %FALSE will be returned.
23954 * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23955 * Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
23960 * g_mount_unmount_with_operation:
23961 * @mount: a #GMount.
23962 * @flags: flags affecting the operation
23963 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23964 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23965 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23966 * @user_data: user data passed to @callback.
23968 * Unmounts a mount. This is an asynchronous operation, and is
23969 * finished by calling g_mount_unmount_with_operation_finish() with the @mount
23970 * and #GAsyncResult data returned in the @callback.
23977 * g_mount_unmount_with_operation_finish:
23978 * @mount: a #GMount.
23979 * @result: a #GAsyncResult.
23980 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23982 * Finishes unmounting a mount. If any errors occurred during the operation,
23983 * @error will be set to contain the errors and %FALSE will be returned.
23985 * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23991 * g_mount_unshadow:
23992 * @mount: A #GMount.
23994 * Decrements the shadow count on @mount. Usually used by
23995 * #GVolumeMonitor implementations when destroying a shadow mount for
23996 * @mount, see g_mount_is_shadowed() for more information. The caller
23997 * will need to emit the #GMount::changed signal on @mount manually.
24004 * g_network_address_get_hostname:
24005 * @addr: a #GNetworkAddress
24007 * Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
24008 * depending on what @addr was created with.
24010 * Returns: @addr's hostname
24016 * g_network_address_get_port:
24017 * @addr: a #GNetworkAddress
24019 * Gets @addr's port number
24021 * Returns: @addr's port (which may be 0)
24027 * g_network_address_get_scheme:
24028 * @addr: a #GNetworkAddress
24030 * Gets @addr's scheme
24032 * Returns: @addr's scheme (%NULL if not built from URI)
24038 * g_network_address_new:
24039 * @hostname: the hostname
24042 * Creates a new #GSocketConnectable for connecting to the given
24043 * @hostname and @port.
24045 * Returns: (transfer full) (type GNetworkAddress): the new #GNetworkAddress
24051 * g_network_address_parse:
24052 * @host_and_port: the hostname and optionally a port
24053 * @default_port: the default port if not in @host_and_port
24054 * @error: a pointer to a #GError, or %NULL
24056 * Creates a new #GSocketConnectable for connecting to the given
24057 * @hostname and @port. May fail and return %NULL in case
24058 * parsing @host_and_port fails.
24060 * @host_and_port may be in any of a number of recognised formats; an IPv6
24061 * address, an IPv4 address, or a domain name (in which case a DNS
24062 * lookup is performed). Quoting with [] is supported for all address
24063 * types. A port override may be specified in the usual way with a
24066 * If no port is specified in @host_and_port then @default_port will be
24067 * used as the port number to connect to.
24069 * In general, @host_and_port is expected to be provided by the user
24070 * (allowing them to give the hostname, and a port overide if necessary)
24071 * and @default_port is expected to be provided by the application.
24073 * (The port component of @host_and_port can also be specified as a
24074 * service name rather than as a numeric port, but this functionality
24075 * is deprecated, because it depends on the contents of /etc/services,
24076 * which is generally quite sparse on platforms other than Linux.)
24078 * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24084 * g_network_address_parse_uri:
24085 * @uri: the hostname and optionally a port
24086 * @default_port: The default port if none is found in the URI
24087 * @error: a pointer to a #GError, or %NULL
24089 * Creates a new #GSocketConnectable for connecting to the given
24090 * @uri. May fail and return %NULL in case parsing @uri fails.
24092 * Using this rather than g_network_address_new() or
24093 * g_network_address_parse() allows #GSocketClient to determine
24094 * when to use application-specific proxy protocols.
24096 * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24102 * g_network_monitor_base_add_network:
24103 * @monitor: the #GNetworkMonitorBase
24104 * @network: a #GInetAddressMask
24106 * Adds @network to @monitor's list of available networks.
24113 * g_network_monitor_base_remove_network:
24114 * @monitor: the #GNetworkMonitorBase
24115 * @network: a #GInetAddressMask
24117 * Removes @network from @monitor's list of available networks.
24124 * g_network_monitor_base_set_networks:
24125 * @monitor: the #GNetworkMonitorBase
24126 * @networks: (array length=length): an array of #GInetAddressMask
24127 * @length: length of @networks
24129 * Drops @monitor's current list of available networks and replaces
24130 * it with @networks.
24135 * g_network_monitor_can_reach:
24136 * @monitor: a #GNetworkMonitor
24137 * @connectable: a #GSocketConnectable
24138 * @cancellable: (allow-none): a #GCancellable, or %NULL
24139 * @error: return location for a #GError, or %NULL
24141 * Attempts to determine whether or not the host pointed to by
24142 * @connectable can be reached, without actually trying to connect to
24145 * This may return %TRUE even when #GNetworkMonitor:network-available
24146 * is %FALSE, if, for example, @monitor can determine that
24147 * @connectable refers to a host on a local network.
24149 * If @monitor believes that an attempt to connect to @connectable
24150 * will succeed, it will return %TRUE. Otherwise, it will return
24151 * %FALSE and set @error to an appropriate error (such as
24152 * %G_IO_ERROR_HOST_UNREACHABLE).
24154 * Note that although this does not attempt to connect to
24155 * @connectable, it may still block for a brief period of time (eg,
24156 * trying to do multicast DNS on the local network), so if you do not
24157 * want to block, you should use g_network_monitor_can_reach_async().
24159 * Returns: %TRUE if @connectable is reachable, %FALSE if not.
24165 * g_network_monitor_can_reach_async:
24166 * @monitor: a #GNetworkMonitor
24167 * @connectable: a #GSocketConnectable
24168 * @cancellable: (allow-none): a #GCancellable, or %NULL
24169 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24170 * @user_data: (closure): the data to pass to callback function
24172 * Asynchronously attempts to determine whether or not the host
24173 * pointed to by @connectable can be reached, without actually
24174 * trying to connect to it.
24176 * For more details, see g_network_monitor_can_reach().
24178 * When the operation is finished, @callback will be called.
24179 * You can then call g_network_monitor_can_reach_finish()
24180 * to get the result of the operation.
24185 * g_network_monitor_can_reach_finish:
24186 * @monitor: a #GNetworkMonitor
24187 * @result: a #GAsyncResult
24188 * @error: return location for errors, or %NULL
24190 * Finishes an async network connectivity test.
24191 * See g_network_monitor_can_reach_async().
24193 * Returns: %TRUE if network is reachable, %FALSE if not.
24198 * g_network_monitor_get_default:
24200 * Gets the default #GNetworkMonitor for the system.
24202 * Returns: (transfer none): a #GNetworkMonitor
24208 * g_network_monitor_get_network_available:
24209 * @monitor: the #GNetworkMonitor
24211 * Checks if the network is available. "Available" here means that the
24212 * system has a default route available for at least one of IPv4 or
24213 * IPv6. It does not necessarily imply that the public Internet is
24214 * reachable. See #GNetworkMonitor:network-available for more details.
24216 * Returns: whether the network is available
24222 * g_network_service_get_domain:
24223 * @srv: a #GNetworkService
24225 * Gets the domain that @srv serves. This might be either UTF-8 or
24226 * ASCII-encoded, depending on what @srv was created with.
24228 * Returns: @srv's domain name
24234 * g_network_service_get_protocol:
24235 * @srv: a #GNetworkService
24237 * Gets @srv's protocol name (eg, "tcp").
24239 * Returns: @srv's protocol name
24245 * g_network_service_get_scheme:
24246 * @srv: a #GNetworkService
24248 * Get's the URI scheme used to resolve proxies. By default, the service name
24249 * is used as scheme.
24251 * Returns: @srv's scheme name
24257 * g_network_service_get_service:
24258 * @srv: a #GNetworkService
24260 * Gets @srv's service name (eg, "ldap").
24262 * Returns: @srv's service name
24268 * g_network_service_new:
24269 * @service: the service type to look up (eg, "ldap")
24270 * @protocol: the networking protocol to use for @service (eg, "tcp")
24271 * @domain: the DNS domain to look up the service in
24273 * Creates a new #GNetworkService representing the given @service,
24274 * @protocol, and @domain. This will initially be unresolved; use the
24275 * #GSocketConnectable interface to resolve it.
24277 * Returns: (transfer full) (type GNetworkService): a new #GNetworkService
24283 * g_network_service_set_scheme:
24284 * @srv: a #GNetworkService
24285 * @scheme: a URI scheme
24287 * Set's the URI scheme used to resolve proxies. By default, the service name
24288 * is used as scheme.
24295 * g_null_settings_backend_new:
24297 * Creates a readonly #GSettingsBackend.
24299 * This backend does not allow changes to settings, so all settings
24300 * will always have their default values.
24302 * Returns: (transfer full): a newly created #GSettingsBackend
24308 * g_output_stream_clear_pending:
24309 * @stream: output stream
24311 * Clears the pending flag on @stream.
24316 * g_output_stream_close:
24317 * @stream: A #GOutputStream.
24318 * @cancellable: (allow-none): optional cancellable object
24319 * @error: location to store the error occurring, or %NULL to ignore
24321 * Closes the stream, releasing resources related to it.
24323 * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
24324 * Closing a stream multiple times will not return an error.
24326 * Closing a stream will automatically flush any outstanding buffers in the
24329 * Streams will be automatically closed when the last reference
24330 * is dropped, but you might want to call this function to make sure
24331 * resources are released as early as possible.
24333 * Some streams might keep the backing store of the stream (e.g. a file descriptor)
24334 * open after the stream is closed. See the documentation for the individual
24335 * stream for details.
24337 * On failure the first error that happened will be reported, but the close
24338 * operation will finish as much as possible. A stream that failed to
24339 * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
24340 * is important to check and report the error to the user, otherwise
24341 * there might be a loss of data as all data might not be written.
24343 * If @cancellable is not %NULL, then the operation can be cancelled by
24344 * triggering the cancellable object from another thread. If the operation
24345 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24346 * Cancelling a close will still leave the stream closed, but there some streams
24347 * can use a faster close that doesn't block to e.g. check errors. On
24348 * cancellation (as with any error) there is no guarantee that all written
24349 * data will reach the target.
24351 * Returns: %TRUE on success, %FALSE on failure
24356 * g_output_stream_close_async:
24357 * @stream: A #GOutputStream.
24358 * @io_priority: the io priority of the request.
24359 * @cancellable: (allow-none): optional cancellable object
24360 * @callback: (scope async): callback to call when the request is satisfied
24361 * @user_data: (closure): the data to pass to callback function
24363 * Requests an asynchronous close of the stream, releasing resources
24364 * related to it. When the operation is finished @callback will be
24365 * called. You can then call g_output_stream_close_finish() to get
24366 * the result of the operation.
24368 * For behaviour details see g_output_stream_close().
24370 * The asyncronous methods have a default fallback that uses threads
24371 * to implement asynchronicity, so they are optional for inheriting
24372 * classes. However, if you override one you must override all.
24377 * g_output_stream_close_finish:
24378 * @stream: a #GOutputStream.
24379 * @result: a #GAsyncResult.
24380 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24382 * Closes an output stream.
24384 * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
24389 * g_output_stream_flush:
24390 * @stream: a #GOutputStream.
24391 * @cancellable: (allow-none): optional cancellable object
24392 * @error: location to store the error occurring, or %NULL to ignore
24394 * Forces a write of all user-space buffered data for the given
24395 * @stream. Will block during the operation. Closing the stream will
24396 * implicitly cause a flush.
24398 * This function is optional for inherited classes.
24400 * If @cancellable is not %NULL, then the operation can be cancelled by
24401 * triggering the cancellable object from another thread. If the operation
24402 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24404 * Returns: %TRUE on success, %FALSE on error
24409 * g_output_stream_flush_async:
24410 * @stream: a #GOutputStream.
24411 * @io_priority: the io priority of the request.
24412 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24413 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24414 * @user_data: (closure): the data to pass to callback function
24416 * Forces an asynchronous write of all user-space buffered data for
24417 * the given @stream.
24418 * For behaviour details see g_output_stream_flush().
24420 * When the operation is finished @callback will be
24421 * called. You can then call g_output_stream_flush_finish() to get the
24422 * result of the operation.
24427 * g_output_stream_flush_finish:
24428 * @stream: a #GOutputStream.
24429 * @result: a GAsyncResult.
24430 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24432 * Finishes flushing an output stream.
24434 * Returns: %TRUE if flush operation succeeded, %FALSE otherwise.
24439 * g_output_stream_has_pending:
24440 * @stream: a #GOutputStream.
24442 * Checks if an ouput stream has pending actions.
24444 * Returns: %TRUE if @stream has pending actions.
24449 * g_output_stream_is_closed:
24450 * @stream: a #GOutputStream.
24452 * Checks if an output stream has already been closed.
24454 * Returns: %TRUE if @stream is closed. %FALSE otherwise.
24459 * g_output_stream_is_closing:
24460 * @stream: a #GOutputStream.
24462 * Checks if an output stream is being closed. This can be
24463 * used inside e.g. a flush implementation to see if the
24464 * flush (or other i/o operation) is called from within
24465 * the closing operation.
24467 * Returns: %TRUE if @stream is being closed. %FALSE otherwise.
24473 * g_output_stream_set_pending:
24474 * @stream: a #GOutputStream.
24475 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24477 * Sets @stream to have actions pending. If the pending flag is
24478 * already set or @stream is closed, it will return %FALSE and set
24481 * Returns: %TRUE if pending was previously unset and is now set.
24486 * g_output_stream_splice:
24487 * @stream: a #GOutputStream.
24488 * @source: a #GInputStream.
24489 * @flags: a set of #GOutputStreamSpliceFlags.
24490 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24491 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24493 * Splices an input stream into an output stream.
24495 * 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.
24500 * g_output_stream_splice_async:
24501 * @stream: a #GOutputStream.
24502 * @source: a #GInputStream.
24503 * @flags: a set of #GOutputStreamSpliceFlags.
24504 * @io_priority: the io priority of the request.
24505 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24506 * @callback: (scope async): a #GAsyncReadyCallback.
24507 * @user_data: (closure): user data passed to @callback.
24509 * Splices a stream asynchronously.
24510 * When the operation is finished @callback will be called.
24511 * You can then call g_output_stream_splice_finish() to get the
24512 * result of the operation.
24514 * For the synchronous, blocking version of this function, see
24515 * g_output_stream_splice().
24520 * g_output_stream_splice_finish:
24521 * @stream: a #GOutputStream.
24522 * @result: a #GAsyncResult.
24523 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24525 * Finishes an asynchronous stream splice operation.
24527 * 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.
24532 * g_output_stream_write:
24533 * @stream: a #GOutputStream.
24534 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24535 * @count: the number of bytes to write
24536 * @cancellable: (allow-none): optional cancellable object
24537 * @error: location to store the error occurring, or %NULL to ignore
24539 * Tries to write @count bytes from @buffer into the stream. Will block
24540 * during the operation.
24542 * If count is 0, returns 0 and does nothing. A value of @count
24543 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24545 * On success, the number of bytes written to the stream is returned.
24546 * It is not an error if this is not the same as the requested size, as it
24547 * can happen e.g. on a partial I/O error, or if there is not enough
24548 * storage in the stream. All writes block until at least one byte
24549 * is written or an error occurs; 0 is never returned (unless
24552 * If @cancellable is not %NULL, then the operation can be cancelled by
24553 * triggering the cancellable object from another thread. If the operation
24554 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24555 * operation was partially finished when the operation was cancelled the
24556 * partial result will be returned, without an error.
24558 * On error -1 is returned and @error is set accordingly.
24560 * Virtual: write_fn
24561 * Returns: Number of bytes written, or -1 on error
24566 * g_output_stream_write_all:
24567 * @stream: a #GOutputStream.
24568 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24569 * @count: the number of bytes to write
24570 * @bytes_written: (out): location to store the number of bytes that was written to the stream
24571 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24572 * @error: location to store the error occurring, or %NULL to ignore
24574 * Tries to write @count bytes from @buffer into the stream. Will block
24575 * during the operation.
24577 * This function is similar to g_output_stream_write(), except it tries to
24578 * write as many bytes as requested, only stopping on an error.
24580 * On a successful write of @count bytes, %TRUE is returned, and @bytes_written
24581 * is set to @count.
24583 * If there is an error during the operation %FALSE is returned and @error
24584 * is set to indicate the error status, @bytes_written is updated to contain
24585 * the number of bytes written into the stream before the error occurred.
24587 * Returns: %TRUE on success, %FALSE if there was an error
24592 * g_output_stream_write_async:
24593 * @stream: A #GOutputStream.
24594 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24595 * @count: the number of bytes to write
24596 * @io_priority: the io priority of the request.
24597 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24598 * @callback: (scope async): callback to call when the request is satisfied
24599 * @user_data: (closure): the data to pass to callback function
24601 * Request an asynchronous write of @count bytes from @buffer into
24602 * the stream. When the operation is finished @callback will be called.
24603 * You can then call g_output_stream_write_finish() to get the result of the
24606 * During an async request no other sync and async calls are allowed,
24607 * and will result in %G_IO_ERROR_PENDING errors.
24609 * A value of @count larger than %G_MAXSSIZE will cause a
24610 * %G_IO_ERROR_INVALID_ARGUMENT error.
24612 * On success, the number of bytes written will be passed to the
24613 * @callback. It is not an error if this is not the same as the
24614 * requested size, as it can happen e.g. on a partial I/O error,
24615 * but generally we try to write as many bytes as requested.
24617 * You are guaranteed that this method will never fail with
24618 * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24619 * method will just wait until this changes.
24621 * Any outstanding I/O request with higher priority (lower numerical
24622 * value) will be executed before an outstanding request with lower
24623 * priority. Default priority is %G_PRIORITY_DEFAULT.
24625 * The asyncronous methods have a default fallback that uses threads
24626 * to implement asynchronicity, so they are optional for inheriting
24627 * classes. However, if you override one you must override all.
24629 * For the synchronous, blocking version of this function, see
24630 * g_output_stream_write().
24635 * g_output_stream_write_bytes:
24636 * @stream: a #GOutputStream.
24637 * @bytes: the #GBytes to write
24638 * @cancellable: (allow-none): optional cancellable object
24639 * @error: location to store the error occurring, or %NULL to ignore
24641 * Tries to write the data from @bytes into the stream. Will block
24642 * during the operation.
24644 * If @bytes is 0-length, returns 0 and does nothing. A #GBytes larger
24645 * than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24647 * On success, the number of bytes written to the stream is returned.
24648 * It is not an error if this is not the same as the requested size, as it
24649 * can happen e.g. on a partial I/O error, or if there is not enough
24650 * storage in the stream. All writes block until at least one byte
24651 * is written or an error occurs; 0 is never returned (unless
24652 * the size of @bytes is 0).
24654 * If @cancellable is not %NULL, then the operation can be cancelled by
24655 * triggering the cancellable object from another thread. If the operation
24656 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24657 * operation was partially finished when the operation was cancelled the
24658 * partial result will be returned, without an error.
24660 * On error -1 is returned and @error is set accordingly.
24662 * Returns: Number of bytes written, or -1 on error
24667 * g_output_stream_write_bytes_async:
24668 * @stream: A #GOutputStream.
24669 * @bytes: The bytes to write
24670 * @io_priority: the io priority of the request.
24671 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24672 * @callback: (scope async): callback to call when the request is satisfied
24673 * @user_data: (closure): the data to pass to callback function
24675 * Request an asynchronous write of the data in @bytes to the stream.
24676 * When the operation is finished @callback will be called. You can
24677 * then call g_output_stream_write_bytes_finish() to get the result of
24680 * During an async request no other sync and async calls are allowed,
24681 * and will result in %G_IO_ERROR_PENDING errors.
24683 * A #GBytes larger than %G_MAXSSIZE will cause a
24684 * %G_IO_ERROR_INVALID_ARGUMENT error.
24686 * On success, the number of bytes written will be passed to the
24687 * @callback. It is not an error if this is not the same as the
24688 * requested size, as it can happen e.g. on a partial I/O error,
24689 * but generally we try to write as many bytes as requested.
24691 * You are guaranteed that this method will never fail with
24692 * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24693 * method will just wait until this changes.
24695 * Any outstanding I/O request with higher priority (lower numerical
24696 * value) will be executed before an outstanding request with lower
24697 * priority. Default priority is %G_PRIORITY_DEFAULT.
24699 * For the synchronous, blocking version of this function, see
24700 * g_output_stream_write_bytes().
24705 * g_output_stream_write_bytes_finish:
24706 * @stream: a #GOutputStream.
24707 * @result: a #GAsyncResult.
24708 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24710 * Finishes a stream write-from-#GBytes operation.
24712 * Returns: a #gssize containing the number of bytes written to the stream.
24717 * g_output_stream_write_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 a stream write operation.
24724 * Returns: a #gssize containing the number of bytes written to the stream.
24729 * g_permission_acquire:
24730 * @permission: a #GPermission instance
24731 * @cancellable: (allow-none): a #GCancellable, or %NULL
24732 * @error: a pointer to a %NULL #GError, or %NULL
24734 * Attempts to acquire the permission represented by @permission.
24736 * The precise method by which this happens depends on the permission
24737 * and the underlying authentication mechanism. A simple example is
24738 * that a dialog may appear asking the user to enter their password.
24740 * You should check with g_permission_get_can_acquire() before calling
24743 * If the permission is acquired then %TRUE is returned. Otherwise,
24744 * %FALSE is returned and @error is set appropriately.
24746 * This call is blocking, likely for a very long time (in the case that
24747 * user interaction is required). See g_permission_acquire_async() for
24748 * the non-blocking version.
24750 * Returns: %TRUE if the permission was successfully acquired
24756 * g_permission_acquire_async:
24757 * @permission: a #GPermission instance
24758 * @cancellable: (allow-none): a #GCancellable, or %NULL
24759 * @callback: the #GAsyncReadyCallback to call when done
24760 * @user_data: the user data to pass to @callback
24762 * Attempts to acquire the permission represented by @permission.
24764 * This is the first half of the asynchronous version of
24765 * g_permission_acquire().
24772 * g_permission_acquire_finish:
24773 * @permission: a #GPermission instance
24774 * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24775 * @error: a pointer to a %NULL #GError, or %NULL
24777 * Collects the result of attempting to acquire the permission
24778 * represented by @permission.
24780 * This is the second half of the asynchronous version of
24781 * g_permission_acquire().
24783 * Returns: %TRUE if the permission was successfully acquired
24789 * g_permission_get_allowed:
24790 * @permission: a #GPermission instance
24792 * Gets the value of the 'allowed' property. This property is %TRUE if
24793 * the caller currently has permission to perform the action that
24794 * @permission represents the permission to perform.
24796 * Returns: the value of the 'allowed' property
24802 * g_permission_get_can_acquire:
24803 * @permission: a #GPermission instance
24805 * Gets the value of the 'can-acquire' property. This property is %TRUE
24806 * if it is generally possible to acquire the permission by calling
24807 * g_permission_acquire().
24809 * Returns: the value of the 'can-acquire' property
24815 * g_permission_get_can_release:
24816 * @permission: a #GPermission instance
24818 * Gets the value of the 'can-release' property. This property is %TRUE
24819 * if it is generally possible to release the permission by calling
24820 * g_permission_release().
24822 * Returns: the value of the 'can-release' property
24828 * g_permission_impl_update:
24829 * @permission: a #GPermission instance
24830 * @allowed: the new value for the 'allowed' property
24831 * @can_acquire: the new value for the 'can-acquire' property
24832 * @can_release: the new value for the 'can-release' property
24834 * This function is called by the #GPermission implementation to update
24835 * the properties of the permission. You should never call this
24836 * function except from a #GPermission implementation.
24838 * GObject notify signals are generated, as appropriate.
24845 * g_permission_release:
24846 * @permission: a #GPermission instance
24847 * @cancellable: (allow-none): a #GCancellable, or %NULL
24848 * @error: a pointer to a %NULL #GError, or %NULL
24850 * Attempts to release the permission represented by @permission.
24852 * The precise method by which this happens depends on the permission
24853 * and the underlying authentication mechanism. In most cases the
24854 * permission will be dropped immediately without further action.
24856 * You should check with g_permission_get_can_release() before calling
24859 * If the permission is released then %TRUE is returned. Otherwise,
24860 * %FALSE is returned and @error is set appropriately.
24862 * This call is blocking, likely for a very long time (in the case that
24863 * user interaction is required). See g_permission_release_async() for
24864 * the non-blocking version.
24866 * Returns: %TRUE if the permission was successfully released
24872 * g_permission_release_async:
24873 * @permission: a #GPermission instance
24874 * @cancellable: (allow-none): a #GCancellable, or %NULL
24875 * @callback: the #GAsyncReadyCallback to call when done
24876 * @user_data: the user data to pass to @callback
24878 * Attempts to release the permission represented by @permission.
24880 * This is the first half of the asynchronous version of
24881 * g_permission_release().
24888 * g_permission_release_finish:
24889 * @permission: a #GPermission instance
24890 * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24891 * @error: a pointer to a %NULL #GError, or %NULL
24893 * Collects the result of attempting to release the permission
24894 * represented by @permission.
24896 * This is the second half of the asynchronous version of
24897 * g_permission_release().
24899 * Returns: %TRUE if the permission was successfully released
24905 * g_poll_file_monitor_new:
24908 * Polls @file for changes.
24910 * Returns: a new #GFileMonitor for the given #GFile.
24915 * g_pollable_input_stream_can_poll:
24916 * @stream: a #GPollableInputStream.
24918 * Checks if @stream is actually pollable. Some classes may implement
24919 * #GPollableInputStream but have only certain instances of that class
24920 * be pollable. If this method returns %FALSE, then the behavior of
24921 * other #GPollableInputStream methods is undefined.
24923 * For any given stream, the value returned by this method is constant;
24924 * a stream cannot switch from pollable to non-pollable or vice versa.
24926 * Returns: %TRUE if @stream is pollable, %FALSE if not.
24932 * g_pollable_input_stream_create_source:
24933 * @stream: a #GPollableInputStream.
24934 * @cancellable: (allow-none): a #GCancellable, or %NULL
24936 * Creates a #GSource that triggers when @stream can be read, or
24937 * @cancellable is triggered or an error occurs. The callback on the
24938 * source is of the #GPollableSourceFunc type.
24940 * As with g_pollable_input_stream_is_readable(), it is possible that
24941 * the stream may not actually be readable even after the source
24942 * triggers, so you should use g_pollable_input_stream_read_nonblocking()
24943 * rather than g_input_stream_read() from the callback.
24945 * Returns: (transfer full): a new #GSource
24951 * g_pollable_input_stream_is_readable:
24952 * @stream: a #GPollableInputStream.
24954 * Checks if @stream can be read.
24956 * Note that some stream types may not be able to implement this 100%
24957 * reliably, and it is possible that a call to g_input_stream_read()
24958 * after this returns %TRUE would still block. To guarantee
24959 * non-blocking behavior, you should always use
24960 * g_pollable_input_stream_read_nonblocking(), which will return a
24961 * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
24963 * 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.
24969 * g_pollable_input_stream_read_nonblocking:
24970 * @stream: a #GPollableInputStream
24971 * @buffer: a buffer to read data into (which should be at least @count bytes long).
24972 * @count: the number of bytes you want to read
24973 * @cancellable: (allow-none): a #GCancellable, or %NULL
24974 * @error: #GError for error reporting, or %NULL to ignore.
24976 * Attempts to read up to @count bytes from @stream into @buffer, as
24977 * with g_input_stream_read(). If @stream is not currently readable,
24978 * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
24979 * use g_pollable_input_stream_create_source() to create a #GSource
24980 * that will be triggered when @stream is readable.
24982 * Note that since this method never blocks, you cannot actually
24983 * use @cancellable to cancel it. However, it will return an error
24984 * if @cancellable has already been cancelled when you call, which
24985 * may happen if you call this method after a source triggers due
24986 * to having been cancelled.
24988 * Virtual: read_nonblocking
24989 * Returns: the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
24994 * g_pollable_output_stream_can_poll:
24995 * @stream: a #GPollableOutputStream.
24997 * Checks if @stream is actually pollable. Some classes may implement
24998 * #GPollableOutputStream but have only certain instances of that
24999 * class be pollable. If this method returns %FALSE, then the behavior
25000 * of other #GPollableOutputStream methods is undefined.
25002 * For any given stream, the value returned by this method is constant;
25003 * a stream cannot switch from pollable to non-pollable or vice versa.
25005 * Returns: %TRUE if @stream is pollable, %FALSE if not.
25011 * g_pollable_output_stream_create_source:
25012 * @stream: a #GPollableOutputStream.
25013 * @cancellable: (allow-none): a #GCancellable, or %NULL
25015 * Creates a #GSource that triggers when @stream can be written, or
25016 * @cancellable is triggered or an error occurs. The callback on the
25017 * source is of the #GPollableSourceFunc type.
25019 * As with g_pollable_output_stream_is_writable(), it is possible that
25020 * the stream may not actually be writable even after the source
25021 * triggers, so you should use g_pollable_output_stream_write_nonblocking()
25022 * rather than g_output_stream_write() from the callback.
25024 * Returns: (transfer full): a new #GSource
25030 * g_pollable_output_stream_is_writable:
25031 * @stream: a #GPollableOutputStream.
25033 * Checks if @stream can be written.
25035 * Note that some stream types may not be able to implement this 100%
25036 * reliably, and it is possible that a call to g_output_stream_write()
25037 * after this returns %TRUE would still block. To guarantee
25038 * non-blocking behavior, you should always use
25039 * g_pollable_output_stream_write_nonblocking(), which will return a
25040 * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
25042 * 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.
25048 * g_pollable_output_stream_write_nonblocking:
25049 * @stream: a #GPollableOutputStream
25050 * @buffer: (array length=count) (element-type guint8): a buffer to write data from
25051 * @count: the number of bytes you want to write
25052 * @cancellable: (allow-none): a #GCancellable, or %NULL
25053 * @error: #GError for error reporting, or %NULL to ignore.
25055 * Attempts to write up to @count bytes from @buffer to @stream, as
25056 * with g_output_stream_write(). If @stream is not currently writable,
25057 * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
25058 * use g_pollable_output_stream_create_source() to create a #GSource
25059 * that will be triggered when @stream is writable.
25061 * Note that since this method never blocks, you cannot actually
25062 * use @cancellable to cancel it. However, it will return an error
25063 * if @cancellable has already been cancelled when you call, which
25064 * may happen if you call this method after a source triggers due
25065 * to having been cancelled.
25067 * Virtual: write_nonblocking
25068 * Returns: the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
25073 * g_pollable_source_new:
25074 * @pollable_stream: the stream associated with the new source
25076 * Utility method for #GPollableInputStream and #GPollableOutputStream
25077 * implementations. Creates a new #GSource that expects a callback of
25078 * type #GPollableSourceFunc. The new source does not actually do
25079 * anything on its own; use g_source_add_child_source() to add other
25080 * sources to it to cause it to trigger.
25082 * Returns: (transfer full): the new #GSource.
25088 * g_pollable_source_new_full:
25089 * @pollable_stream: (type GObject): the stream associated with the new source
25090 * @child_source: (allow-none): optional child source to attach
25091 * @cancellable: (allow-none): optional #GCancellable to attach
25093 * Utility method for #GPollableInputStream and #GPollableOutputStream
25094 * implementations. Creates a new #GSource, as with
25095 * g_pollable_source_new(), but also attaching @child_source (with a
25096 * dummy callback), and @cancellable, if they are non-%NULL.
25098 * Returns: (transfer full): the new #GSource.
25104 * g_pollable_stream_read:
25105 * @stream: a #GInputStream
25106 * @buffer: a buffer to read data into
25107 * @count: the number of bytes to read
25108 * @blocking: whether to do blocking I/O
25109 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25110 * @error: location to store the error occurring, or %NULL to ignore
25112 * Tries to read from @stream, as with g_input_stream_read() (if
25113 * @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
25114 * (if @blocking is %FALSE). This can be used to more easily share
25115 * code between blocking and non-blocking implementations of a method.
25117 * If @blocking is %FALSE, then @stream must be a
25118 * #GPollableInputStream for which g_pollable_input_stream_can_poll()
25119 * returns %TRUE, or else the behavior is undefined. If @blocking is
25120 * %TRUE, then @stream does not need to be a #GPollableInputStream.
25122 * Returns: the number of bytes read, or -1 on error.
25128 * g_pollable_stream_write:
25129 * @stream: a #GOutputStream.
25130 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25131 * @count: the number of bytes to write
25132 * @blocking: whether to do blocking I/O
25133 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25134 * @error: location to store the error occurring, or %NULL to ignore
25136 * Tries to write to @stream, as with g_output_stream_write() (if
25137 * @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
25138 * (if @blocking is %FALSE). This can be used to more easily share
25139 * code between blocking and non-blocking implementations of a method.
25141 * If @blocking is %FALSE, then @stream must be a
25142 * #GPollableOutputStream for which
25143 * g_pollable_output_stream_can_poll() returns %TRUE or else the
25144 * behavior is undefined. If @blocking is %TRUE, then @stream does not
25145 * need to be a #GPollableOutputStream.
25147 * Returns: the number of bytes written, or -1 on error.
25153 * g_pollable_stream_write_all:
25154 * @stream: a #GOutputStream.
25155 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25156 * @count: the number of bytes to write
25157 * @blocking: whether to do blocking I/O
25158 * @bytes_written: (out): location to store the number of bytes that was written to the stream
25159 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25160 * @error: location to store the error occurring, or %NULL to ignore
25162 * Tries to write @count bytes to @stream, as with
25163 * g_output_stream_write_all(), but using g_pollable_stream_write()
25164 * rather than g_output_stream_write().
25166 * On a successful write of @count bytes, %TRUE is returned, and
25167 * @bytes_written is set to @count.
25169 * If there is an error during the operation (including
25170 * %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is
25171 * returned and @error is set to indicate the error status,
25172 * @bytes_written is updated to contain the number of bytes written
25173 * into the stream before the error occurred.
25175 * As with g_pollable_stream_write(), if @blocking is %FALSE, then
25176 * @stream must be a #GPollableOutputStream for which
25177 * g_pollable_output_stream_can_poll() returns %TRUE or else the
25178 * behavior is undefined. If @blocking is %TRUE, then @stream does not
25179 * need to be a #GPollableOutputStream.
25181 * Returns: %TRUE on success, %FALSE if there was an error
25187 * g_proxy_address_get_destination_hostname:
25188 * @proxy: a #GProxyAddress
25190 * Gets @proxy's destination hostname; that is, the name of the host
25191 * that will be connected to via the proxy, not the name of the proxy
25194 * Returns: the @proxy's destination hostname
25200 * g_proxy_address_get_destination_port:
25201 * @proxy: a #GProxyAddress
25203 * Gets @proxy's destination port; that is, the port on the
25204 * destination host that will be connected to via the proxy, not the
25205 * port number of the proxy itself.
25207 * Returns: the @proxy's destination port
25213 * g_proxy_address_get_destination_protocol:
25214 * @proxy: a #GProxyAddress
25216 * Gets the protocol that is being spoken to the destination
25217 * server; eg, "http" or "ftp".
25219 * Returns: the @proxy's destination protocol
25225 * g_proxy_address_get_password:
25226 * @proxy: a #GProxyAddress
25228 * Gets @proxy's password.
25230 * Returns: the @proxy's password
25236 * g_proxy_address_get_protocol:
25237 * @proxy: a #GProxyAddress
25239 * Gets @proxy's protocol. eg, "socks" or "http"
25241 * Returns: the @proxy's protocol
25247 * g_proxy_address_get_uri:
25248 * @proxy: a #GProxyAddress
25250 * Gets the proxy URI that @proxy was constructed from.
25252 * Returns: the @proxy's URI, or %NULL if unknown
25258 * g_proxy_address_get_username:
25259 * @proxy: a #GProxyAddress
25261 * Gets @proxy's username.
25263 * Returns: the @proxy's username
25269 * g_proxy_address_new:
25270 * @inetaddr: The proxy server #GInetAddress.
25271 * @port: The proxy server port.
25272 * @protocol: The proxy protocol to support, in lower case (e.g. socks, http).
25273 * @dest_hostname: The destination hostname the proxy should tunnel to.
25274 * @dest_port: The destination port to tunnel to.
25275 * @username: (allow-none): The username to authenticate to the proxy server (or %NULL).
25276 * @password: (allow-none): The password to authenticate to the proxy server (or %NULL).
25278 * Creates a new #GProxyAddress for @inetaddr with @protocol that should
25279 * tunnel through @dest_hostname and @dest_port.
25281 * (Note that this method doesn't set the #GProxyAddress:uri or
25282 * #GProxyAddress:destination-protocol fields; use g_object_new()
25283 * directly if you want to set those.)
25285 * Returns: a new #GProxyAddress
25292 * @proxy: a #GProxy
25293 * @connection: a #GIOStream
25294 * @proxy_address: a #GProxyAddress
25295 * @cancellable: (allow-none): a #GCancellable
25296 * @error: return #GError
25298 * Given @connection to communicate with a proxy (eg, a
25299 * #GSocketConnection that is connected to the proxy server), this
25300 * does the necessary handshake to connect to @proxy_address, and if
25301 * required, wraps the #GIOStream to handle proxy payload.
25303 * Returns: (transfer full): a #GIOStream that will replace @connection. This might be the same as @connection, in which case a reference will be added.
25309 * g_proxy_connect_async:
25310 * @proxy: a #GProxy
25311 * @connection: a #GIOStream
25312 * @proxy_address: a #GProxyAddress
25313 * @cancellable: (allow-none): a #GCancellable
25314 * @callback: (scope async): a #GAsyncReadyCallback
25315 * @user_data: (closure): callback data
25317 * Asynchronous version of g_proxy_connect().
25324 * g_proxy_connect_finish:
25325 * @proxy: a #GProxy
25326 * @result: a #GAsyncResult
25327 * @error: return #GError
25329 * See g_proxy_connect().
25331 * Returns: (transfer full): a #GIOStream.
25337 * g_proxy_get_default_for_protocol:
25338 * @protocol: the proxy protocol name (e.g. http, socks, etc)
25340 * Lookup "gio-proxy" extension point for a proxy implementation that supports
25341 * specified protocol.
25343 * Returns: (transfer full): return a #GProxy or NULL if protocol is not supported.
25349 * g_proxy_resolver_get_default:
25351 * Gets the default #GProxyResolver for the system.
25353 * Returns: (transfer none): the default #GProxyResolver.
25359 * g_proxy_resolver_is_supported:
25360 * @resolver: a #GProxyResolver
25362 * Checks if @resolver can be used on this system. (This is used
25363 * internally; g_proxy_resolver_get_default() will only return a proxy
25364 * resolver that returns %TRUE for this method.)
25366 * Returns: %TRUE if @resolver is supported.
25372 * g_proxy_resolver_lookup:
25373 * @resolver: a #GProxyResolver
25374 * @uri: a URI representing the destination to connect to
25375 * @cancellable: (allow-none): a #GCancellable, or %NULL
25376 * @error: return location for a #GError, or %NULL
25378 * Looks into the system proxy configuration to determine what proxy,
25379 * if any, to use to connect to @uri. The returned proxy URIs are of the
25380 * form <literal><protocol>://[user[:password]@]host:port</literal>
25381 * or <literal>direct://</literal>, where <protocol> could be
25382 * http, rtsp, socks or other proxying protocol.
25384 * If you don't know what network protocol is being used on the
25385 * socket, you should use <literal>none</literal> as the URI protocol.
25386 * In this case, the resolver might still return a generic proxy type
25387 * (such as SOCKS), but would not return protocol-specific proxy types
25390 * <literal>direct://</literal> is used when no proxy is needed.
25391 * Direct connection should not be attempted unless it is part of the
25392 * returned array of proxies.
25394 * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25400 * g_proxy_resolver_lookup_async:
25401 * @resolver: a #GProxyResolver
25402 * @uri: a URI representing the destination to connect to
25403 * @cancellable: (allow-none): a #GCancellable, or %NULL
25404 * @callback: (scope async): callback to call after resolution completes
25405 * @user_data: (closure): data for @callback
25407 * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
25415 * g_proxy_resolver_lookup_finish:
25416 * @resolver: a #GProxyResolver
25417 * @result: the result passed to your #GAsyncReadyCallback
25418 * @error: return location for a #GError, or %NULL
25420 * Call this function to obtain the array of proxy URIs when
25421 * g_proxy_resolver_lookup_async() is complete. See
25422 * g_proxy_resolver_lookup() for more details.
25424 * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25430 * g_proxy_supports_hostname:
25431 * @proxy: a #GProxy
25433 * Some proxy protocols expect to be passed a hostname, which they
25434 * will resolve to an IP address themselves. Others, like SOCKS4, do
25435 * not allow this. This function will return %FALSE if @proxy is
25436 * implementing such a protocol. When %FALSE is returned, the caller
25437 * should resolve the destination hostname first, and then pass a
25438 * #GProxyAddress containing the stringified IP address to
25439 * g_proxy_connect() or g_proxy_connect_async().
25441 * Returns: %TRUE if hostname resolution is supported.
25447 * g_remote_action_group_activate_action_full:
25448 * @remote: a #GDBusActionGroup
25449 * @action_name: the name of the action to activate
25450 * @parameter: (allow-none): the optional parameter to the activation
25451 * @platform_data: the platform data to send
25453 * Activates the remote action.
25455 * This is the same as g_action_group_activate_action() except that it
25456 * allows for provision of "platform data" to be sent along with the
25457 * activation request. This typically contains details such as the user
25458 * interaction timestamp or startup notification information.
25460 * @platform_data must be non-%NULL and must have the type
25461 * %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
25468 * g_remote_action_group_change_action_state_full:
25469 * @remote: a #GRemoteActionGroup
25470 * @action_name: the name of the action to change the state of
25471 * @value: the new requested value for the state
25472 * @platform_data: the platform data to send
25474 * Changes the state of a remote action.
25476 * This is the same as g_action_group_change_action_state() except that
25477 * it allows for provision of "platform data" to be sent along with the
25478 * state change request. This typically contains details such as the
25479 * user interaction timestamp or startup notification information.
25481 * @platform_data must be non-%NULL and must have the type
25482 * %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
25489 * g_resolver_error_quark:
25491 * Gets the #GResolver Error Quark.
25493 * Returns: a #GQuark.
25499 * g_resolver_free_addresses: (skip)
25500 * @addresses: a #GList of #GInetAddress
25502 * Frees @addresses (which should be the return value from
25503 * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
25504 * (This is a convenience method; you can also simply free the results
25512 * g_resolver_free_targets: (skip)
25513 * @targets: a #GList of #GSrvTarget
25515 * Frees @targets (which should be the return value from
25516 * g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
25517 * (This is a convenience method; you can also simply free the
25518 * results by hand.)
25525 * g_resolver_get_default:
25527 * Gets the default #GResolver. You should unref it when you are done
25528 * with it. #GResolver may use its reference count as a hint about how
25529 * many threads it should allocate for concurrent DNS resolutions.
25531 * Returns: (transfer full): the default #GResolver.
25537 * g_resolver_lookup_by_address:
25538 * @resolver: a #GResolver
25539 * @address: the address to reverse-resolve
25540 * @cancellable: (allow-none): a #GCancellable, or %NULL
25541 * @error: return location for a #GError, or %NULL
25543 * Synchronously reverse-resolves @address to determine its
25544 * associated hostname.
25546 * If the DNS resolution fails, @error (if non-%NULL) will be set to
25547 * a value from #GResolverError.
25549 * If @cancellable is non-%NULL, it can be used to cancel the
25550 * operation, in which case @error (if non-%NULL) will be set to
25551 * %G_IO_ERROR_CANCELLED.
25553 * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25559 * g_resolver_lookup_by_address_async:
25560 * @resolver: a #GResolver
25561 * @address: the address to reverse-resolve
25562 * @cancellable: (allow-none): a #GCancellable, or %NULL
25563 * @callback: (scope async): callback to call after resolution completes
25564 * @user_data: (closure): data for @callback
25566 * Begins asynchronously reverse-resolving @address to determine its
25567 * associated hostname, and eventually calls @callback, which must
25568 * call g_resolver_lookup_by_address_finish() to get the final result.
25575 * g_resolver_lookup_by_address_finish:
25576 * @resolver: a #GResolver
25577 * @result: the result passed to your #GAsyncReadyCallback
25578 * @error: return location for a #GError, or %NULL
25580 * Retrieves the result of a previous call to
25581 * g_resolver_lookup_by_address_async().
25583 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25584 * a value from #GResolverError. If the operation was cancelled,
25585 * @error will be set to %G_IO_ERROR_CANCELLED.
25587 * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25593 * g_resolver_lookup_by_name:
25594 * @resolver: a #GResolver
25595 * @hostname: the hostname to look up
25596 * @cancellable: (allow-none): a #GCancellable, or %NULL
25597 * @error: return location for a #GError, or %NULL
25599 * Synchronously resolves @hostname to determine its associated IP
25600 * address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
25601 * the textual form of an IP address (in which case this just becomes
25602 * a wrapper around g_inet_address_new_from_string()).
25604 * On success, g_resolver_lookup_by_name() will return a #GList of
25605 * #GInetAddress, sorted in order of preference and guaranteed to not
25606 * contain duplicates. That is, if using the result to connect to
25607 * @hostname, you should attempt to connect to the first address
25608 * first, then the second if the first fails, etc. If you are using
25609 * the result to listen on a socket, it is appropriate to add each
25610 * result using e.g. g_socket_listener_add_address().
25612 * If the DNS resolution fails, @error (if non-%NULL) will be set to a
25613 * value from #GResolverError.
25615 * If @cancellable is non-%NULL, it can be used to cancel the
25616 * operation, in which case @error (if non-%NULL) will be set to
25617 * %G_IO_ERROR_CANCELLED.
25619 * If you are planning to connect to a socket on the resolved IP
25620 * address, it may be easier to create a #GNetworkAddress and use its
25621 * #GSocketConnectable interface.
25623 * 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.)
25629 * g_resolver_lookup_by_name_async:
25630 * @resolver: a #GResolver
25631 * @hostname: the hostname to look up the address of
25632 * @cancellable: (allow-none): a #GCancellable, or %NULL
25633 * @callback: (scope async): callback to call after resolution completes
25634 * @user_data: (closure): data for @callback
25636 * Begins asynchronously resolving @hostname to determine its
25637 * associated IP address(es), and eventually calls @callback, which
25638 * must call g_resolver_lookup_by_name_finish() to get the result.
25639 * See g_resolver_lookup_by_name() for more details.
25646 * g_resolver_lookup_by_name_finish:
25647 * @resolver: a #GResolver
25648 * @result: the result passed to your #GAsyncReadyCallback
25649 * @error: return location for a #GError, or %NULL
25651 * Retrieves the result of a call to
25652 * g_resolver_lookup_by_name_async().
25654 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25655 * a value from #GResolverError. If the operation was cancelled,
25656 * @error will be set to %G_IO_ERROR_CANCELLED.
25658 * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name() for more details.
25664 * g_resolver_lookup_records:
25665 * @resolver: a #GResolver
25666 * @rrname: the DNS name to lookup the record for
25667 * @record_type: the type of DNS record to lookup
25668 * @cancellable: (allow-none): a #GCancellable, or %NULL
25669 * @error: return location for a #GError, or %NULL
25671 * Synchronously performs a DNS record lookup for the given @rrname and returns
25672 * a list of records as #GVariant tuples. See #GResolverRecordType for
25673 * information on what the records contain for each @record_type.
25675 * If the DNS resolution fails, @error (if non-%NULL) will be set to
25676 * a value from #GResolverError.
25678 * If @cancellable is non-%NULL, it can be used to cancel the
25679 * operation, in which case @error (if non-%NULL) will be set to
25680 * %G_IO_ERROR_CANCELLED.
25682 * 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.)
25688 * g_resolver_lookup_records_async:
25689 * @resolver: a #GResolver
25690 * @rrname: the DNS name to lookup the record for
25691 * @record_type: the type of DNS record to lookup
25692 * @cancellable: (allow-none): a #GCancellable, or %NULL
25693 * @callback: (scope async): callback to call after resolution completes
25694 * @user_data: (closure): data for @callback
25696 * Begins asynchronously performing a DNS lookup for the given
25697 * @rrname, and eventually calls @callback, which must call
25698 * g_resolver_lookup_records_finish() to get the final result. See
25699 * g_resolver_lookup_records() for more details.
25706 * g_resolver_lookup_records_finish:
25707 * @resolver: a #GResolver
25708 * @result: the result passed to your #GAsyncReadyCallback
25709 * @error: return location for a #GError, or %NULL
25711 * Retrieves the result of a previous call to
25712 * g_resolver_lookup_records_async(). Returns a list of records as #GVariant
25713 * tuples. See #GResolverRecordType for information on what the records contain.
25715 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25716 * a value from #GResolverError. If the operation was cancelled,
25717 * @error will be set to %G_IO_ERROR_CANCELLED.
25719 * 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.)
25725 * g_resolver_lookup_service:
25726 * @resolver: a #GResolver
25727 * @service: the service type to look up (eg, "ldap")
25728 * @protocol: the networking protocol to use for @service (eg, "tcp")
25729 * @domain: the DNS domain to look up the service in
25730 * @cancellable: (allow-none): a #GCancellable, or %NULL
25731 * @error: return location for a #GError, or %NULL
25733 * Synchronously performs a DNS SRV lookup for the given @service and
25734 * @protocol in the given @domain and returns an array of #GSrvTarget.
25735 * @domain may be an ASCII-only or UTF-8 hostname. Note also that the
25736 * @service and @protocol arguments <emphasis>do not</emphasis>
25737 * include the leading underscore that appears in the actual DNS
25740 * On success, g_resolver_lookup_service() will return a #GList of
25741 * #GSrvTarget, sorted in order of preference. (That is, you should
25742 * attempt to connect to the first target first, then the second if
25743 * the first fails, etc.)
25745 * If the DNS resolution fails, @error (if non-%NULL) will be set to
25746 * a value from #GResolverError.
25748 * If @cancellable is non-%NULL, it can be used to cancel the
25749 * operation, in which case @error (if non-%NULL) will be set to
25750 * %G_IO_ERROR_CANCELLED.
25752 * If you are planning to connect to the service, it is usually easier
25753 * to create a #GNetworkService and use its #GSocketConnectable
25756 * 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.)
25762 * g_resolver_lookup_service_async:
25763 * @resolver: a #GResolver
25764 * @service: the service type to look up (eg, "ldap")
25765 * @protocol: the networking protocol to use for @service (eg, "tcp")
25766 * @domain: the DNS domain to look up the service in
25767 * @cancellable: (allow-none): a #GCancellable, or %NULL
25768 * @callback: (scope async): callback to call after resolution completes
25769 * @user_data: (closure): data for @callback
25771 * Begins asynchronously performing a DNS SRV lookup for the given
25772 * @service and @protocol in the given @domain, and eventually calls
25773 * @callback, which must call g_resolver_lookup_service_finish() to
25774 * get the final result. See g_resolver_lookup_service() for more
25782 * g_resolver_lookup_service_finish:
25783 * @resolver: a #GResolver
25784 * @result: the result passed to your #GAsyncReadyCallback
25785 * @error: return location for a #GError, or %NULL
25787 * Retrieves the result of a previous call to
25788 * g_resolver_lookup_service_async().
25790 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25791 * a value from #GResolverError. If the operation was cancelled,
25792 * @error will be set to %G_IO_ERROR_CANCELLED.
25794 * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. See g_resolver_lookup_service() for more details.
25800 * g_resolver_set_default:
25801 * @resolver: the new default #GResolver
25803 * Sets @resolver to be the application's default resolver (reffing
25804 * @resolver, and unreffing the previous default resolver, if any).
25805 * Future calls to g_resolver_get_default() will return this resolver.
25807 * This can be used if an application wants to perform any sort of DNS
25808 * caching or "pinning"; it can implement its own #GResolver that
25809 * calls the original default resolver for DNS operations, and
25810 * implements its own cache policies on top of that, and then set
25811 * itself as the default resolver for all later code to use.
25818 * g_resource_enumerate_children:
25819 * @resource: A #GResource
25820 * @path: A pathname inside the resource
25821 * @lookup_flags: A #GResourceLookupFlags
25822 * @error: return location for a #GError, or %NULL
25824 * Returns all the names of children at the specified @path in the resource.
25825 * The return result is a %NULL terminated list of strings which should
25826 * be released with g_strfreev().
25828 * @lookup_flags controls the behaviour of the lookup.
25830 * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25836 * g_resource_error_quark:
25838 * Gets the #GResource Error Quark.
25840 * Returns: a #GQuark
25846 * g_resource_get_info:
25847 * @resource: A #GResource
25848 * @path: A pathname inside the resource
25849 * @lookup_flags: A #GResourceLookupFlags
25850 * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25851 * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25852 * @error: return location for a #GError, or %NULL
25854 * Looks for a file at the specified @path in the resource and
25855 * if found returns information about it.
25857 * @lookup_flags controls the behaviour of the lookup.
25859 * Returns: %TRUE if the file was found. %FALSE if there were errors
25866 * @filename: (type filename): the path of a filename to load, in the GLib filename encoding
25867 * @error: return location for a #GError, or %NULL
25869 * Loads a binary resource bundle and creates a #GResource representation of it, allowing
25870 * you to query it for data.
25872 * If you want to use this resource in the global resource namespace you need
25873 * to register it with g_resources_register().
25875 * Returns: (transfer full): a new #GResource, or %NULL on error
25881 * g_resource_lookup_data:
25882 * @resource: A #GResource
25883 * @path: A pathname inside the resource
25884 * @lookup_flags: A #GResourceLookupFlags
25885 * @error: return location for a #GError, or %NULL
25887 * Looks for a file at the specified @path in the resource and
25888 * returns a #GBytes that lets you directly access the data in
25891 * The data is always followed by a zero byte, so you
25892 * can safely use the data as a C string. However, that byte
25893 * is not included in the size of the GBytes.
25895 * For uncompressed resource files this is a pointer directly into
25896 * the resource bundle, which is typically in some readonly data section
25897 * in the program binary. For compressed files we allocate memory on
25898 * the heap and automatically uncompress the data.
25900 * @lookup_flags controls the behaviour of the lookup.
25902 * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
25908 * g_resource_new_from_data:
25910 * @error: return location for a #GError, or %NULL
25912 * Creates a GResource from a reference to the binary resource bundle.
25913 * This will keep a reference to @data while the resource lives, so
25914 * the data should not be modified or freed.
25916 * If you want to use this resource in the global resource namespace you need
25917 * to register it with g_resources_register().
25919 * Returns: (transfer full): a new #GResource, or %NULL on error
25925 * g_resource_open_stream:
25926 * @resource: A #GResource
25927 * @path: A pathname inside the resource
25928 * @lookup_flags: A #GResourceLookupFlags
25929 * @error: return location for a #GError, or %NULL
25931 * Looks for a file at the specified @path in the resource and
25932 * returns a #GInputStream that lets you read the data.
25934 * @lookup_flags controls the behaviour of the lookup.
25936 * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
25943 * @resource: A #GResource
25945 * Atomically increments the reference count of @array by one. This
25946 * function is MT-safe and may be called from any thread.
25948 * Returns: The passed in #GResource
25954 * g_resource_unref:
25955 * @resource: A #GResource
25957 * Atomically decrements the reference count of @resource by one. If the
25958 * reference count drops to 0, all memory allocated by the array is
25959 * released. This function is MT-safe and may be called from any
25967 * g_resources_enumerate_children:
25968 * @path: A pathname inside the resource
25969 * @lookup_flags: A #GResourceLookupFlags
25970 * @error: return location for a #GError, or %NULL
25972 * Returns all the names of children at the specified @path in the set of
25973 * globally registered resources.
25974 * The return result is a %NULL terminated list of strings which should
25975 * be released with g_strfreev().
25977 * @lookup_flags controls the behaviour of the lookup.
25979 * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25985 * g_resources_get_info:
25986 * @path: A pathname inside the resource
25987 * @lookup_flags: A #GResourceLookupFlags
25988 * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25989 * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25990 * @error: return location for a #GError, or %NULL
25992 * Looks for a file at the specified @path in the set of
25993 * globally registered resources and if found returns information about it.
25995 * @lookup_flags controls the behaviour of the lookup.
25997 * Returns: %TRUE if the file was found. %FALSE if there were errors
26003 * g_resources_lookup_data:
26004 * @path: A pathname inside the resource
26005 * @lookup_flags: A #GResourceLookupFlags
26006 * @error: return location for a #GError, or %NULL
26008 * Looks for a file at the specified @path in the set of
26009 * globally registered resources and returns a #GBytes that
26010 * lets you directly access the data in memory.
26012 * The data is always followed by a zero byte, so you
26013 * can safely use the data as a C string. However, that byte
26014 * is not included in the size of the GBytes.
26016 * For uncompressed resource files this is a pointer directly into
26017 * the resource bundle, which is typically in some readonly data section
26018 * in the program binary. For compressed files we allocate memory on
26019 * the heap and automatically uncompress the data.
26021 * @lookup_flags controls the behaviour of the lookup.
26023 * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
26029 * g_resources_open_stream:
26030 * @path: A pathname inside the resource
26031 * @lookup_flags: A #GResourceLookupFlags
26032 * @error: return location for a #GError, or %NULL
26034 * Looks for a file at the specified @path in the set of
26035 * globally registered resources and returns a #GInputStream
26036 * that lets you read the data.
26038 * @lookup_flags controls the behaviour of the lookup.
26040 * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
26046 * g_resources_register:
26047 * @resource: A #GResource
26049 * Registers the resource with the process-global set of resources.
26050 * Once a resource is registered the files in it can be accessed
26051 * with the global resource lookup functions like g_resources_lookup_data().
26058 * g_resources_unregister:
26059 * @resource: A #GResource
26061 * Unregisters the resource from the process-global set of resources.
26068 * g_seekable_can_seek:
26069 * @seekable: a #GSeekable.
26071 * Tests if the stream supports the #GSeekableIface.
26073 * Returns: %TRUE if @seekable can be seeked. %FALSE otherwise.
26078 * g_seekable_can_truncate:
26079 * @seekable: a #GSeekable.
26081 * Tests if the stream can be truncated.
26083 * Returns: %TRUE if the stream can be truncated, %FALSE otherwise.
26089 * @seekable: a #GSeekable.
26090 * @offset: a #goffset.
26091 * @type: a #GSeekType.
26092 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26093 * @error: a #GError location to store the error occurring, or %NULL to ignore.
26095 * Seeks in the stream by the given @offset, modified by @type.
26097 * If @cancellable is not %NULL, then the operation can be cancelled by
26098 * triggering the cancellable object from another thread. If the operation
26099 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
26101 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26107 * @seekable: a #GSeekable.
26109 * Tells the current position within the stream.
26111 * Returns: the offset from the beginning of the buffer.
26116 * g_seekable_truncate:
26117 * @seekable: a #GSeekable.
26118 * @offset: a #goffset.
26119 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26120 * @error: a #GError location to store the error occurring, or %NULL to ignore.
26122 * Truncates a stream with a given #offset.
26124 * If @cancellable is not %NULL, then the operation can be cancelled by
26125 * triggering the cancellable object from another thread. If the operation
26126 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
26127 * operation was partially finished when the operation was cancelled the
26128 * partial result will be returned, without an error.
26130 * Virtual: truncate_fn
26131 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26136 * g_settings_apply:
26137 * @settings: a #GSettings instance
26139 * Applies any changes that have been made to the settings. This
26140 * function does nothing unless @settings is in 'delay-apply' mode;
26141 * see g_settings_delay(). In the normal case settings are always
26142 * applied immediately.
26147 * g_settings_backend_changed:
26148 * @backend: a #GSettingsBackend implementation
26149 * @key: the name of the key
26150 * @origin_tag: the origin tag
26152 * Signals that a single key has possibly changed. Backend
26153 * implementations should call this if a key has possibly changed its
26156 * @key must be a valid key (ie starting with a slash, not containing
26157 * '//', and not ending with a slash).
26159 * The implementation must call this function during any call to
26160 * g_settings_backend_write(), before the call returns (except in the
26161 * case that no keys are actually changed and it cares to detect this
26162 * fact). It may not rely on the existence of a mainloop for
26163 * dispatching the signal later.
26165 * The implementation may call this function at any other time it likes
26166 * in response to other events (such as changes occurring outside of the
26167 * program). These calls may originate from a mainloop or may originate
26168 * in response to any other action (including from calls to
26169 * g_settings_backend_write()).
26171 * In the case that this call is in response to a call to
26172 * g_settings_backend_write() then @origin_tag must be set to the same
26173 * value that was passed to that call.
26180 * g_settings_backend_changed_tree:
26181 * @backend: a #GSettingsBackend implementation
26182 * @tree: a #GTree containing the changes
26183 * @origin_tag: the origin tag
26185 * This call is a convenience wrapper. It gets the list of changes from
26186 * @tree, computes the longest common prefix and calls
26187 * g_settings_backend_changed().
26194 * g_settings_backend_flatten_tree:
26195 * @tree: a #GTree containing the changes
26196 * @path: (out): the location to save the path
26197 * @keys: (out) (transfer container) (array zero-terminated=1): the location to save the relative keys
26198 * @values: (out) (allow-none) (transfer container) (array zero-terminated=1): the location to save the values, or %NULL
26200 * Calculate the longest common prefix of all keys in a tree and write
26201 * out an array of the key names relative to that prefix and,
26202 * optionally, the value to store at each of those keys.
26204 * You must free the value returned in @path, @keys and @values using
26205 * g_free(). You should not attempt to free or unref the contents of
26206 * @keys or @values.
26213 * g_settings_backend_get_default:
26215 * Returns the default #GSettingsBackend. It is possible to override
26216 * the default by setting the <envar>GSETTINGS_BACKEND</envar>
26217 * environment variable to the name of a settings backend.
26219 * The user gets a reference to the backend.
26221 * Returns: (transfer full): the default #GSettingsBackend
26227 * g_settings_backend_keys_changed:
26228 * @backend: a #GSettingsBackend implementation
26229 * @path: the path containing the changes
26230 * @items: (array zero-terminated=1): the %NULL-terminated list of changed keys
26231 * @origin_tag: the origin tag
26233 * Signals that a list of keys have possibly changed. Backend
26234 * implementations should call this if keys have possibly changed their
26237 * @path must be a valid path (ie starting and ending with a slash and
26238 * not containing '//'). Each string in @items must form a valid key
26239 * name when @path is prefixed to it (ie: each item must not start or
26240 * end with '/' and must not contain '//').
26242 * The meaning of this signal is that any of the key names resulting
26243 * from the contatenation of @path with each item in @items may have
26246 * The same rules for when notifications must occur apply as per
26247 * g_settings_backend_changed(). These two calls can be used
26248 * interchangeably if exactly one item has changed (although in that
26249 * case g_settings_backend_changed() is definitely preferred).
26251 * For efficiency reasons, the implementation should strive for @path to
26252 * be as long as possible (ie: the longest common prefix of all of the
26253 * keys that were changed) but this is not strictly required.
26260 * g_settings_backend_path_changed:
26261 * @backend: a #GSettingsBackend implementation
26262 * @path: the path containing the changes
26263 * @origin_tag: the origin tag
26265 * Signals that all keys below a given path may have possibly changed.
26266 * Backend implementations should call this if an entire path of keys
26267 * have possibly changed their values.
26269 * @path must be a valid path (ie starting and ending with a slash and
26270 * not containing '//').
26272 * The meaning of this signal is that any of the key which has a name
26273 * starting with @path may have changed.
26275 * The same rules for when notifications must occur apply as per
26276 * g_settings_backend_changed(). This call might be an appropriate
26277 * reasponse to a 'reset' call but implementations are also free to
26278 * explicitly list the keys that were affected by that call if they can
26281 * For efficiency reasons, the implementation should strive for @path to
26282 * be as long as possible (ie: the longest common prefix of all of the
26283 * keys that were changed) but this is not strictly required. As an
26284 * example, if this function is called with the path of "/" then every
26285 * single key in the application will be notified of a possible change.
26292 * g_settings_backend_path_writable_changed:
26293 * @backend: a #GSettingsBackend implementation
26294 * @path: the name of the path
26296 * Signals that the writability of all keys below a given path may have
26299 * Since GSettings performs no locking operations for itself, this call
26300 * will always be made in response to external events.
26307 * g_settings_backend_writable_changed:
26308 * @backend: a #GSettingsBackend implementation
26309 * @key: the name of the key
26311 * Signals that the writability of a single key has possibly changed.
26313 * Since GSettings performs no locking operations for itself, this call
26314 * will always be made in response to external events.
26322 * @settings: a #GSettings object
26323 * @key: the key to bind
26324 * @object: (type GObject.Object): a #GObject
26325 * @property: the name of the property to bind
26326 * @flags: flags for the binding
26328 * Create a binding between the @key in the @settings object
26329 * and the property @property of @object.
26331 * The binding uses the default GIO mapping functions to map
26332 * between the settings and property values. These functions
26333 * handle booleans, numeric types and string types in a
26334 * straightforward way. Use g_settings_bind_with_mapping() if
26335 * you need a custom mapping, or map between types that are not
26336 * supported by the default mapping functions.
26338 * Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
26339 * function also establishes a binding between the writability of
26340 * @key and the "sensitive" property of @object (if @object has
26341 * a boolean property by that name). See g_settings_bind_writable()
26342 * for more details about writable bindings.
26344 * Note that the lifecycle of the binding is tied to the object,
26345 * and that you can have only one binding per object property.
26346 * If you bind the same property twice on the same object, the second
26347 * binding overrides the first one.
26354 * g_settings_bind_with_mapping: (skip)
26355 * @settings: a #GSettings object
26356 * @key: the key to bind
26357 * @object: (type GObject.Object): a #GObject
26358 * @property: the name of the property to bind
26359 * @flags: flags for the binding
26360 * @get_mapping: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
26361 * @set_mapping: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
26362 * @user_data: data that gets passed to @get_mapping and @set_mapping
26363 * @destroy: #GDestroyNotify function for @user_data
26365 * Create a binding between the @key in the @settings object
26366 * and the property @property of @object.
26368 * The binding uses the provided mapping functions to map between
26369 * settings and property values.
26371 * Note that the lifecycle of the binding is tied to the object,
26372 * and that you can have only one binding per object property.
26373 * If you bind the same property twice on the same object, the second
26374 * binding overrides the first one.
26381 * g_settings_bind_writable:
26382 * @settings: a #GSettings object
26383 * @key: the key to bind
26384 * @object: (type GObject.Object): a #GObject
26385 * @property: the name of a boolean property to bind
26386 * @inverted: whether to 'invert' the value
26388 * Create a binding between the writability of @key in the
26389 * @settings object and the property @property of @object.
26390 * The property must be boolean; "sensitive" or "visible"
26391 * properties of widgets are the most likely candidates.
26393 * Writable bindings are always uni-directional; changes of the
26394 * writability of the setting will be propagated to the object
26395 * property, not the other way.
26397 * When the @inverted argument is %TRUE, the binding inverts the
26398 * value as it passes from the setting to the object, i.e. @property
26399 * will be set to %TRUE if the key is <emphasis>not</emphasis>
26402 * Note that the lifecycle of the binding is tied to the object,
26403 * and that you can have only one binding per object property.
26404 * If you bind the same property twice on the same object, the second
26405 * binding overrides the first one.
26412 * g_settings_create_action:
26413 * @settings: a #GSettings
26414 * @key: the name of a key in @settings
26416 * Creates a #GAction corresponding to a given #GSettings key.
26418 * The action has the same name as the key.
26420 * The value of the key becomes the state of the action and the action
26421 * is enabled when the key is writable. Changing the state of the
26422 * action results in the key being written to. Changes to the value or
26423 * writability of the key cause appropriate change notifications to be
26424 * emitted for the action.
26426 * For boolean-valued keys, action activations take no parameter and
26427 * result in the toggling of the value. For all other types,
26428 * activations take the new value for the key (which must have the
26431 * Returns: (transfer full): a new #GAction
26437 * g_settings_delay:
26438 * @settings: a #GSettings object
26440 * Changes the #GSettings object into 'delay-apply' mode. In this
26441 * mode, changes to @settings are not immediately propagated to the
26442 * backend, but kept locally until g_settings_apply() is called.
26450 * @settings: a #GSettings object
26451 * @key: the key to get the value for
26452 * @format: a #GVariant format string
26453 * @...: arguments as per @format
26455 * Gets the value that is stored at @key in @settings.
26457 * A convenience function that combines g_settings_get_value() with
26460 * It is a programmer error to give a @key that isn't contained in the
26461 * schema for @settings or for the #GVariantType of @format to mismatch
26462 * the type given in the schema.
26469 * g_settings_get_boolean:
26470 * @settings: a #GSettings object
26471 * @key: the key to get the value for
26473 * Gets the value that is stored at @key in @settings.
26475 * A convenience variant of g_settings_get() for booleans.
26477 * It is a programmer error to give a @key that isn't specified as
26478 * having a boolean type in the schema for @settings.
26480 * Returns: a boolean
26486 * g_settings_get_child:
26487 * @settings: a #GSettings object
26488 * @name: the name of the 'child' schema
26490 * Creates a 'child' settings object which has a base path of
26491 * <replaceable>base-path</replaceable>/@name, where
26492 * <replaceable>base-path</replaceable> is the base path of @settings.
26494 * The schema for the child settings object must have been declared
26495 * in the schema of @settings using a <tag class="starttag">child</tag> element.
26497 * Returns: (transfer full): a 'child' settings object
26503 * g_settings_get_double:
26504 * @settings: a #GSettings object
26505 * @key: the key to get the value for
26507 * Gets the value that is stored at @key in @settings.
26509 * A convenience variant of g_settings_get() for doubles.
26511 * It is a programmer error to give a @key that isn't specified as
26512 * having a 'double' type in the schema for @settings.
26514 * Returns: a double
26520 * g_settings_get_enum:
26521 * @settings: a #GSettings object
26522 * @key: the key to get the value for
26524 * Gets the value that is stored in @settings for @key and converts it
26525 * to the enum value that it represents.
26527 * In order to use this function the type of the value must be a string
26528 * and it must be marked in the schema file as an enumerated type.
26530 * It is a programmer error to give a @key that isn't contained in the
26531 * schema for @settings or is not marked as an enumerated type.
26533 * If the value stored in the configuration database is not a valid
26534 * value for the enumerated type then this function will return the
26537 * Returns: the enum value
26543 * g_settings_get_flags:
26544 * @settings: a #GSettings object
26545 * @key: the key to get the value for
26547 * Gets the value that is stored in @settings for @key and converts it
26548 * to the flags value that it represents.
26550 * In order to use this function the type of the value must be an array
26551 * of strings and it must be marked in the schema file as an flags type.
26553 * It is a programmer error to give a @key that isn't contained in the
26554 * schema for @settings or is not marked as a flags type.
26556 * If the value stored in the configuration database is not a valid
26557 * value for the flags type then this function will return the default
26560 * Returns: the flags value
26566 * g_settings_get_has_unapplied:
26567 * @settings: a #GSettings object
26569 * Returns whether the #GSettings object has any unapplied
26570 * changes. This can only be the case if it is in 'delayed-apply' mode.
26572 * Returns: %TRUE if @settings has unapplied changes
26578 * g_settings_get_int:
26579 * @settings: a #GSettings object
26580 * @key: the key to get the value for
26582 * Gets the value that is stored at @key in @settings.
26584 * A convenience variant of g_settings_get() for 32-bit integers.
26586 * It is a programmer error to give a @key that isn't specified as
26587 * having a int32 type in the schema for @settings.
26589 * Returns: an integer
26595 * g_settings_get_mapped:
26596 * @settings: a #GSettings object
26597 * @key: the key to get the value for
26598 * @mapping: (scope call): the function to map the value in the settings database to the value used by the application
26599 * @user_data: user data for @mapping
26601 * Gets the value that is stored at @key in @settings, subject to
26602 * application-level validation/mapping.
26604 * You should use this function when the application needs to perform
26605 * some processing on the value of the key (for example, parsing). The
26606 * @mapping function performs that processing. If the function
26607 * indicates that the processing was unsuccessful (due to a parse error,
26608 * for example) then the mapping is tried again with another value.
26610 * This allows a robust 'fall back to defaults' behaviour to be
26611 * implemented somewhat automatically.
26613 * The first value that is tried is the user's setting for the key. If
26614 * the mapping function fails to map this value, other values may be
26615 * tried in an unspecified order (system or site defaults, translated
26616 * schema default values, untranslated schema default values, etc).
26618 * If the mapping function fails for all possible values, one additional
26619 * attempt is made: the mapping function is called with a %NULL value.
26620 * If the mapping function still indicates failure at this point then
26621 * the application will be aborted.
26623 * The result parameter for the @mapping function is pointed to a
26624 * #gpointer which is initially set to %NULL. The same pointer is given
26625 * to each invocation of @mapping. The final value of that #gpointer is
26626 * what is returned by this function. %NULL is valid; it is returned
26627 * just as any other value would be.
26629 * Returns: (transfer full): the result, which may be %NULL
26634 * g_settings_get_range:
26635 * @settings: a #GSettings
26636 * @key: the key to query the range of
26638 * Queries the range of a key.
26640 * This function will return a #GVariant that fully describes the range
26641 * of values that are valid for @key.
26643 * The type of #GVariant returned is <literal>(sv)</literal>. The
26644 * string describes the type of range restriction in effect. The type
26645 * and meaning of the value contained in the variant depends on the
26648 * If the string is <literal>'type'</literal> then the variant contains
26649 * an empty array. The element type of that empty array is the expected
26650 * type of value and all values of that type are valid.
26652 * If the string is <literal>'enum'</literal> then the variant contains
26653 * an array enumerating the possible values. Each item in the array is
26654 * a possible valid value and no other values are valid.
26656 * If the string is <literal>'flags'</literal> then the variant contains
26657 * an array. Each item in the array is a value that may appear zero or
26658 * one times in an array to be used as the value for this key. For
26659 * example, if the variant contained the array <literal>['x',
26660 * 'y']</literal> then the valid values for the key would be
26661 * <literal>[]</literal>, <literal>['x']</literal>,
26662 * <literal>['y']</literal>, <literal>['x', 'y']</literal> and
26663 * <literal>['y', 'x']</literal>.
26665 * Finally, if the string is <literal>'range'</literal> then the variant
26666 * contains a pair of like-typed values -- the minimum and maximum
26667 * permissible values for this key.
26669 * This information should not be used by normal programs. It is
26670 * considered to be a hint for introspection purposes. Normal programs
26671 * should already know what is permitted by their own schema. The
26672 * format may change in any way in the future -- but particularly, new
26673 * forms may be added to the possibilities described above.
26675 * It is a programmer error to give a @key that isn't contained in the
26676 * schema for @settings.
26678 * You should free the returned value with g_variant_unref() when it is
26679 * no longer needed.
26681 * Returns: a #GVariant describing the range
26687 * g_settings_get_string:
26688 * @settings: a #GSettings object
26689 * @key: the key to get the value for
26691 * Gets the value that is stored at @key in @settings.
26693 * A convenience variant of g_settings_get() for strings.
26695 * It is a programmer error to give a @key that isn't specified as
26696 * having a string type in the schema for @settings.
26698 * Returns: a newly-allocated string
26704 * g_settings_get_strv:
26705 * @settings: a #GSettings object
26706 * @key: the key to get the value for
26708 * A convenience variant of g_settings_get() for string arrays.
26710 * It is a programmer error to give a @key that isn't specified as
26711 * having an array of strings type in the schema for @settings.
26713 * Returns: (array zero-terminated=1) (transfer full): a newly-allocated, %NULL-terminated array of strings, the value that is stored at @key in @settings.
26719 * g_settings_get_uint:
26720 * @settings: a #GSettings object
26721 * @key: the key to get the value for
26723 * Gets the value that is stored at @key in @settings.
26725 * A convenience variant of g_settings_get() for 32-bit unsigned
26728 * It is a programmer error to give a @key that isn't specified as
26729 * having a uint32 type in the schema for @settings.
26731 * Returns: an unsigned integer
26737 * g_settings_get_value:
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.
26743 * It is a programmer error to give a @key that isn't contained in the
26744 * schema for @settings.
26746 * Returns: a new #GVariant
26752 * g_settings_is_writable:
26753 * @settings: a #GSettings object
26754 * @name: the name of a key
26756 * Finds out if a key can be written or not
26758 * Returns: %TRUE if the key @name is writable
26764 * g_settings_list_children:
26765 * @settings: a #GSettings object
26767 * Gets the list of children on @settings.
26769 * The list is exactly the list of strings for which it is not an error
26770 * to call g_settings_get_child().
26772 * For GSettings objects that are lists, this value can change at any
26773 * time and you should connect to the "children-changed" signal to watch
26774 * for those changes. Note that there is a race condition here: you may
26775 * request a child after listing it only for it to have been destroyed
26776 * in the meantime. For this reason, g_settings_get_child() may return
26777 * %NULL even for a child that was listed by this function.
26779 * For GSettings objects that are not lists, you should probably not be
26780 * calling this function from "normal" code (since you should already
26781 * know what children are in your schema). This function may still be
26782 * useful there for introspection reasons, however.
26784 * You should free the return value with g_strfreev() when you are done
26787 * Returns: (transfer full) (element-type utf8): a list of the children on @settings
26792 * g_settings_list_keys:
26793 * @settings: a #GSettings object
26795 * Introspects the list of keys on @settings.
26797 * You should probably not be calling this function from "normal" code
26798 * (since you should already know what keys are in your schema). This
26799 * function is intended for introspection reasons.
26801 * You should free the return value with g_strfreev() when you are done
26804 * Returns: (transfer full) (element-type utf8): a list of the keys on @settings
26809 * g_settings_list_relocatable_schemas:
26811 * Gets a list of the relocatable #GSettings schemas installed on the
26812 * system. These are schemas that do not provide their own path. It is
26813 * usual to instantiate these schemas directly, but if you want to you
26814 * can use g_settings_new_with_path() to specify the path.
26816 * The output of this function, taken together with the output of
26817 * g_settings_list_schemas() represents the complete list of all
26818 * installed schemas.
26820 * Returns: (element-type utf8) (transfer none): a list of relocatable #GSettings schemas that are available. The list must not be modified or freed.
26826 * g_settings_list_schemas:
26828 * Gets a list of the #GSettings schemas installed on the system. The
26829 * returned list is exactly the list of schemas for which you may call
26830 * g_settings_new() without adverse effects.
26832 * This function does not list the schemas that do not provide their own
26833 * paths (ie: schemas for which you must use
26834 * g_settings_new_with_path()). See
26835 * g_settings_list_relocatable_schemas() for that.
26837 * Returns: (element-type utf8) (transfer none): a list of #GSettings schemas that are available. The list must not be modified or freed.
26844 * @schema_id: the id of the schema
26846 * Creates a new #GSettings object with the schema specified by
26849 * Signals on the newly created #GSettings object will be dispatched
26850 * via the thread-default #GMainContext in effect at the time of the
26851 * call to g_settings_new(). The new #GSettings will hold a reference
26852 * on the context. See g_main_context_push_thread_default().
26854 * Returns: a new #GSettings object
26860 * g_settings_new_full:
26861 * @schema: a #GSettingsSchema
26862 * @backend: (allow-none): a #GSettingsBackend
26863 * @path: (allow-none): the path to use
26865 * Creates a new #GSettings object with a given schema, backend and
26868 * It should be extremely rare that you ever want to use this function.
26869 * It is made available for advanced use-cases (such as plugin systems
26870 * that want to provide access to schemas loaded from custom locations,
26873 * At the most basic level, a #GSettings object is a pure composition of
26874 * 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
26875 * backend, and a #GMainContext to which signals are dispatched.
26877 * This constructor therefore gives you full control over constructing
26878 * #GSettings instances. The first 4 parameters are given directly as
26879 * @schema, @backend and @path, and the main context is taken from the
26880 * thread-default (as per g_settings_new()).
26882 * If @backend is %NULL then the default backend is used.
26884 * If @path is %NULL then the path from the schema is used. It is an
26885 * error f @path is %NULL and the schema has no path of its own or if
26886 * @path is non-%NULL and not equal to the path that the schema does
26889 * Returns: a new #GSettings object
26895 * g_settings_new_with_backend:
26896 * @schema_id: the id of the schema
26897 * @backend: the #GSettingsBackend to use
26899 * Creates a new #GSettings object with the schema specified by
26900 * @schema_id and a given #GSettingsBackend.
26902 * Creating a #GSettings object with a different backend allows accessing
26903 * settings from a database other than the usual one. For example, it may make
26904 * sense to pass a backend corresponding to the "defaults" settings database on
26905 * the system to get a settings object that modifies the system default
26906 * settings instead of the settings for this user.
26908 * Returns: a new #GSettings object
26914 * g_settings_new_with_backend_and_path:
26915 * @schema_id: the id of the schema
26916 * @backend: the #GSettingsBackend to use
26917 * @path: the path to use
26919 * Creates a new #GSettings object with the schema specified by
26920 * @schema_id and a given #GSettingsBackend and path.
26922 * This is a mix of g_settings_new_with_backend() and
26923 * g_settings_new_with_path().
26925 * Returns: a new #GSettings object
26931 * g_settings_new_with_path:
26932 * @schema_id: the id of the schema
26933 * @path: the path to use
26935 * Creates a new #GSettings object with the relocatable schema specified
26936 * by @schema_id and a given path.
26938 * You only need to do this if you want to directly create a settings
26939 * object with a schema that doesn't have a specified path of its own.
26940 * That's quite rare.
26942 * It is a programmer error to call this function for a schema that
26943 * has an explicitly specified path.
26945 * Returns: a new #GSettings object
26951 * g_settings_range_check:
26952 * @settings: a #GSettings
26953 * @key: the key to check
26954 * @value: the value to check
26956 * Checks if the given @value is of the correct type and within the
26957 * permitted range for @key.
26959 * This API is not intended to be used by normal programs -- they should
26960 * already know what is permitted by their own schemas. This API is
26961 * meant to be used by programs such as editors or commandline tools.
26963 * It is a programmer error to give a @key that isn't contained in the
26964 * schema for @settings.
26966 * Returns: %TRUE if @value is valid for @key
26972 * g_settings_reset:
26973 * @settings: a #GSettings object
26974 * @key: the name of a key
26976 * Resets @key to its default value.
26978 * This call resets the key, as much as possible, to its default value.
26979 * That might the value specified in the schema or the one set by the
26985 * g_settings_revert:
26986 * @settings: a #GSettings instance
26988 * Reverts all non-applied changes to the settings. This function
26989 * does nothing unless @settings is in 'delay-apply' mode; see
26990 * g_settings_delay(). In the normal case settings are always applied
26993 * Change notifications will be emitted for affected keys.
26998 * g_settings_schema_get_id:
26999 * @schema: a #GSettingsSchema
27001 * Get the ID of @schema.
27003 * Returns: (transfer none): the ID
27008 * g_settings_schema_get_path:
27009 * @schema: a #GSettingsSchema
27011 * Gets the path associated with @schema, or %NULL.
27013 * Schemas may be single-instance or relocatable. Single-instance
27014 * schemas correspond to exactly one set of keys in the backend
27015 * database: those located at the path returned by this function.
27017 * Relocatable schemas can be referenced by other schemas and can
27018 * threfore describe multiple sets of keys at different locations. For
27019 * relocatable schemas, this function will return %NULL.
27021 * Returns: (transfer none): the path of the schema, or %NULL
27027 * g_settings_schema_ref:
27028 * @schema: a #GSettingsSchema
27030 * Increase the reference count of @schema, returning a new reference.
27032 * Returns: a new reference to @schema
27038 * g_settings_schema_source_get_default:
27040 * Gets the default system schema source.
27042 * This function is not required for normal uses of #GSettings but it
27043 * may be useful to authors of plugin management systems or to those who
27044 * want to introspect the content of schemas.
27046 * If no schemas are installed, %NULL will be returned.
27048 * The returned source may actually consist of multiple schema sources
27049 * from different directories, depending on which directories were given
27050 * in <envar>XDG_DATA_DIRS</envar> and
27051 * <envar>GSETTINGS_SCHEMA_DIR</envar>. For this reason, all lookups
27052 * performed against the default source should probably be done
27055 * Returns: (transfer none): the default schema source
27061 * g_settings_schema_source_lookup:
27062 * @source: a #GSettingsSchemaSource
27063 * @schema_id: a schema ID
27064 * @recursive: %TRUE if the lookup should be recursive
27066 * Looks up a schema with the identifier @schema_id in @source.
27068 * This function is not required for normal uses of #GSettings but it
27069 * may be useful to authors of plugin management systems or to those who
27070 * want to introspect the content of schemas.
27072 * If the schema isn't found directly in @source and @recursive is %TRUE
27073 * then the parent sources will also be checked.
27075 * If the schema isn't found, %NULL is returned.
27077 * Returns: (transfer full): a new #GSettingsSchema
27083 * g_settings_schema_source_new_from_directory:
27084 * @directory: the filename of a directory
27085 * @parent: (allow-none): a #GSettingsSchemaSource, or %NULL
27086 * @trusted: %TRUE, if the directory is trusted
27087 * @error: a pointer to a #GError pointer set to %NULL, or %NULL
27089 * Attempts to create a new schema source corresponding to the contents
27090 * of the given directory.
27092 * This function is not required for normal uses of #GSettings but it
27093 * may be useful to authors of plugin management systems.
27095 * The directory should contain a file called
27096 * <filename>gschemas.compiled</filename> as produced by
27097 * <command>glib-compile-schemas</command>.
27099 * If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
27100 * trusted not to be corrupted. This assumption has a performance
27101 * advantage, but can result in crashes or inconsistent behaviour in the
27102 * case of a corrupted file. Generally, you should set @trusted to
27103 * %TRUE for files installed by the system and to %FALSE for files in
27104 * the home directory.
27106 * If @parent is non-%NULL then there are two effects.
27108 * First, if g_settings_schema_source_lookup() is called with the
27109 * @recursive flag set to %TRUE and the schema can not be found in the
27110 * source, the lookup will recurse to the parent.
27112 * Second, any references to other schemas specified within this
27113 * source (ie: <literal>child</literal> or <literal>extends</literal>)
27114 * references may be resolved from the @parent.
27116 * For this second reason, except in very unusual situations, the
27117 * @parent should probably be given as the default schema source, as
27118 * returned by g_settings_schema_source_get_default().
27125 * g_settings_schema_source_ref:
27126 * @source: a #GSettingsSchemaSource
27128 * Increase the reference count of @source, returning a new reference.
27130 * Returns: a new reference to @source
27136 * g_settings_schema_source_unref:
27137 * @source: a #GSettingsSchemaSource
27139 * Decrease the reference count of @source, possibly freeing it.
27146 * g_settings_schema_unref:
27147 * @schema: a #GSettingsSchema
27149 * Decrease the reference count of @schema, possibly freeing it.
27157 * @settings: a #GSettings object
27158 * @key: the name of the key to set
27159 * @format: a #GVariant format string
27160 * @...: arguments as per @format
27162 * Sets @key in @settings to @value.
27164 * A convenience function that combines g_settings_set_value() with
27167 * It is a programmer error to give a @key that isn't contained in the
27168 * schema for @settings or for the #GVariantType of @format to mismatch
27169 * the type given in the schema.
27171 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27177 * g_settings_set_boolean:
27178 * @settings: a #GSettings object
27179 * @key: the name of the key to set
27180 * @value: the value to set it to
27182 * Sets @key in @settings to @value.
27184 * A convenience variant of g_settings_set() for booleans.
27186 * It is a programmer error to give a @key that isn't specified as
27187 * having a boolean type in the schema for @settings.
27189 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27195 * g_settings_set_double:
27196 * @settings: a #GSettings object
27197 * @key: the name of the key to set
27198 * @value: the value to set it to
27200 * Sets @key in @settings to @value.
27202 * A convenience variant of g_settings_set() for doubles.
27204 * It is a programmer error to give a @key that isn't specified as
27205 * having a 'double' type in the schema for @settings.
27207 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27213 * g_settings_set_enum:
27214 * @settings: a #GSettings object
27215 * @key: a key, within @settings
27216 * @value: an enumerated value
27218 * Looks up the enumerated type nick for @value and writes it to @key,
27219 * within @settings.
27221 * It is a programmer error to give a @key that isn't contained in the
27222 * schema for @settings or is not marked as an enumerated type, or for
27223 * @value not to be a valid value for the named type.
27225 * After performing the write, accessing @key directly with
27226 * g_settings_get_string() will return the 'nick' associated with
27229 * Returns: %TRUE, if the set succeeds
27234 * g_settings_set_flags:
27235 * @settings: a #GSettings object
27236 * @key: a key, within @settings
27237 * @value: a flags value
27239 * Looks up the flags type nicks for the bits specified by @value, puts
27240 * them in an array of strings and writes the array to @key, within
27243 * It is a programmer error to give a @key that isn't contained in the
27244 * schema for @settings or is not marked as a flags type, or for @value
27245 * to contain any bits that are not value for the named type.
27247 * After performing the write, accessing @key directly with
27248 * g_settings_get_strv() will return an array of 'nicks'; one for each
27251 * Returns: %TRUE, if the set succeeds
27256 * g_settings_set_int:
27257 * @settings: a #GSettings object
27258 * @key: the name of the key to set
27259 * @value: the value to set it to
27261 * Sets @key in @settings to @value.
27263 * A convenience variant of g_settings_set() for 32-bit integers.
27265 * It is a programmer error to give a @key that isn't specified as
27266 * having a int32 type in the schema for @settings.
27268 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27274 * g_settings_set_string:
27275 * @settings: a #GSettings object
27276 * @key: the name of the key to set
27277 * @value: the value to set it to
27279 * Sets @key in @settings to @value.
27281 * A convenience variant of g_settings_set() for strings.
27283 * It is a programmer error to give a @key that isn't specified as
27284 * having a string type in the schema for @settings.
27286 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27292 * g_settings_set_strv:
27293 * @settings: a #GSettings object
27294 * @key: the name of the key to set
27295 * @value: (allow-none) (array zero-terminated=1): the value to set it to, or %NULL
27297 * Sets @key in @settings to @value.
27299 * A convenience variant of g_settings_set() for string arrays. If
27300 * @value is %NULL, then @key is set to be the empty array.
27302 * It is a programmer error to give a @key that isn't specified as
27303 * having an array of strings type in the schema for @settings.
27305 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27311 * g_settings_set_uint:
27312 * @settings: a #GSettings object
27313 * @key: the name of the key to set
27314 * @value: the value to set it to
27316 * Sets @key in @settings to @value.
27318 * A convenience variant of g_settings_set() for 32-bit unsigned
27321 * It is a programmer error to give a @key that isn't specified as
27322 * having a uint32 type in the schema for @settings.
27324 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27330 * g_settings_set_value:
27331 * @settings: a #GSettings object
27332 * @key: the name of the key to set
27333 * @value: a #GVariant of the correct type
27335 * Sets @key in @settings to @value.
27337 * It is a programmer error to give a @key that isn't contained in the
27338 * schema for @settings or for @value to have the incorrect type, per
27341 * If @value is floating then this function consumes the reference.
27343 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27351 * Ensures that all pending operations for the given are complete for
27352 * the default backend.
27354 * Writes made to a #GSettings are handled asynchronously. For this
27355 * reason, it is very unlikely that the changes have it to disk by the
27356 * time g_settings_set() returns.
27358 * This call will block until all of the writes have made it to the
27359 * backend. Since the mainloop is not running, no change notifications
27360 * will be dispatched during this call (but some may be queued by the
27361 * time the call is done).
27366 * g_settings_unbind:
27367 * @object: the object
27368 * @property: the property whose binding is removed
27370 * Removes an existing binding for @property on @object.
27372 * Note that bindings are automatically removed when the
27373 * object is finalized, so it is rarely necessary to call this
27381 * g_simple_action_group_add_entries:
27382 * @simple: a #GSimpleActionGroup
27383 * @entries: (array length=n_entries): a pointer to the first item in an array of #GActionEntry structs
27384 * @n_entries: the length of @entries, or -1
27385 * @user_data: the user data for signal connections
27387 * A convenience function for creating multiple #GSimpleAction instances
27388 * and adding them to the action group.
27395 * g_simple_action_group_insert:
27396 * @simple: a #GSimpleActionGroup
27397 * @action: a #GAction
27399 * Adds an action to the action group.
27401 * If the action group already contains an action with the same name as
27402 * @action then the old action is dropped from the group.
27404 * The action group takes its own reference on @action.
27411 * g_simple_action_group_lookup:
27412 * @simple: a #GSimpleActionGroup
27413 * @action_name: the name of an action
27415 * Looks up the action with the name @action_name in the group.
27417 * If no such action exists, returns %NULL.
27419 * Returns: (transfer none): a #GAction, or %NULL
27425 * g_simple_action_group_new:
27427 * Creates a new, empty, #GSimpleActionGroup.
27429 * Returns: a new #GSimpleActionGroup
27435 * g_simple_action_group_remove:
27436 * @simple: a #GSimpleActionGroup
27437 * @action_name: the name of the action
27439 * Removes the named action from the action group.
27441 * If no action of this name is in the group then nothing happens.
27448 * g_simple_action_new:
27449 * @name: the name of the action
27450 * @parameter_type: (allow-none): the type of parameter to the activate function
27452 * Creates a new action.
27454 * The created action is stateless. See g_simple_action_new_stateful().
27456 * Returns: a new #GSimpleAction
27462 * g_simple_action_new_stateful:
27463 * @name: the name of the action
27464 * @parameter_type: (allow-none): the type of the parameter to the activate function
27465 * @state: the initial state of the action
27467 * Creates a new stateful action.
27469 * @state is the initial state of the action. All future state values
27470 * must have the same #GVariantType as the initial state.
27472 * If the @state GVariant is floating, it is consumed.
27474 * Returns: a new #GSimpleAction
27480 * g_simple_action_set_enabled:
27481 * @simple: a #GSimpleAction
27482 * @enabled: whether the action is enabled
27484 * Sets the action as enabled or not.
27486 * An action must be enabled in order to be activated or in order to
27487 * have its state changed from outside callers.
27489 * This should only be called by the implementor of the action. Users
27490 * of the action should not attempt to modify its enabled flag.
27497 * g_simple_action_set_state:
27498 * @simple: a #GSimpleAction
27499 * @value: the new #GVariant for the state
27501 * Sets the state of the action.
27503 * This directly updates the 'state' property to the given value.
27505 * This should only be called by the implementor of the action. Users
27506 * of the action should not attempt to directly modify the 'state'
27507 * property. Instead, they should call g_action_change_state() to
27508 * request the change.
27515 * g_simple_async_report_error_in_idle: (skip)
27516 * @object: (allow-none): a #GObject, or %NULL.
27517 * @callback: a #GAsyncReadyCallback.
27518 * @user_data: user data passed to @callback.
27519 * @domain: a #GQuark containing the error domain (usually #G_IO_ERROR).
27520 * @code: a specific error code.
27521 * @format: a formatted error reporting string.
27522 * @...: a list of variables to fill in @format.
27524 * Reports an error in an asynchronous function in an idle function by
27525 * directly setting the contents of the #GAsyncResult with the given error
27531 * g_simple_async_report_gerror_in_idle:
27532 * @object: (allow-none): a #GObject, or %NULL
27533 * @callback: (scope async): a #GAsyncReadyCallback.
27534 * @user_data: (closure): user data passed to @callback.
27535 * @error: the #GError to report
27537 * Reports an error in an idle function. Similar to
27538 * g_simple_async_report_error_in_idle(), but takes a #GError rather
27539 * than building a new one.
27544 * g_simple_async_report_take_gerror_in_idle: (skip)
27545 * @object: (allow-none): a #GObject, or %NULL
27546 * @callback: a #GAsyncReadyCallback.
27547 * @user_data: user data passed to @callback.
27548 * @error: the #GError to report
27550 * Reports an error in an idle function. Similar to
27551 * g_simple_async_report_gerror_in_idle(), but takes over the caller's
27552 * ownership of @error, so the caller does not have to free it any more.
27559 * g_simple_async_result_complete:
27560 * @simple: a #GSimpleAsyncResult.
27562 * Completes an asynchronous I/O job immediately. Must be called in
27563 * the thread where the asynchronous result was to be delivered, as it
27564 * invokes the callback directly. If you are in a different thread use
27565 * g_simple_async_result_complete_in_idle().
27567 * Calling this function takes a reference to @simple for as long as
27568 * is needed to complete the call.
27573 * g_simple_async_result_complete_in_idle:
27574 * @simple: a #GSimpleAsyncResult.
27576 * Completes an asynchronous function in an idle handler in the <link
27577 * linkend="g-main-context-push-thread-default">thread-default main
27578 * loop</link> of the thread that @simple was initially created in
27579 * (and re-pushes that context around the invocation of the callback).
27581 * Calling this function takes a reference to @simple for as long as
27582 * is needed to complete the call.
27587 * g_simple_async_result_get_op_res_gboolean:
27588 * @simple: a #GSimpleAsyncResult.
27590 * Gets the operation result boolean from within the asynchronous result.
27592 * Returns: %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE.
27597 * g_simple_async_result_get_op_res_gpointer: (skip)
27598 * @simple: a #GSimpleAsyncResult.
27600 * Gets a pointer result as returned by the asynchronous function.
27602 * Returns: a pointer from the result.
27607 * g_simple_async_result_get_op_res_gssize:
27608 * @simple: a #GSimpleAsyncResult.
27610 * Gets a gssize from the asynchronous result.
27612 * Returns: a gssize returned from the asynchronous function.
27617 * g_simple_async_result_get_source_tag: (skip)
27618 * @simple: a #GSimpleAsyncResult.
27620 * Gets the source tag for the #GSimpleAsyncResult.
27622 * Returns: a #gpointer to the source object for the #GSimpleAsyncResult.
27627 * g_simple_async_result_is_valid:
27628 * @result: the #GAsyncResult passed to the _finish function.
27629 * @source: the #GObject passed to the _finish function.
27630 * @source_tag: the asynchronous function.
27632 * Ensures that the data passed to the _finish function of an async
27633 * operation is consistent. Three checks are performed.
27635 * First, @result is checked to ensure that it is really a
27636 * #GSimpleAsyncResult. Second, @source is checked to ensure that it
27637 * matches the source object of @result. Third, @source_tag is
27638 * checked to ensure that it is either %NULL (as it is when the result was
27639 * created by g_simple_async_report_error_in_idle() or
27640 * g_simple_async_report_gerror_in_idle()) or equal to the
27641 * @source_tag argument given to g_simple_async_result_new() (which, by
27642 * convention, is a pointer to the _async function corresponding to the
27643 * _finish function from which this function is called).
27645 * Returns: #TRUE if all checks passed or #FALSE if any failed.
27651 * g_simple_async_result_new:
27652 * @source_object: (allow-none): a #GObject, or %NULL.
27653 * @callback: (scope async): a #GAsyncReadyCallback.
27654 * @user_data: (closure): user data passed to @callback.
27655 * @source_tag: the asynchronous function.
27657 * Creates a #GSimpleAsyncResult.
27659 * The common convention is to create the #GSimpleAsyncResult in the
27660 * function that starts the asynchronous operation and use that same
27661 * function as the @source_tag.
27663 * If your operation supports cancellation with #GCancellable (which it
27664 * probably should) then you should provide the user's cancellable to
27665 * g_simple_async_result_set_check_cancellable() immediately after
27666 * this function returns.
27668 * Returns: a #GSimpleAsyncResult.
27673 * g_simple_async_result_new_error:
27674 * @source_object: (allow-none): a #GObject, or %NULL.
27675 * @callback: (scope async): a #GAsyncReadyCallback.
27676 * @user_data: (closure): user data passed to @callback.
27677 * @domain: a #GQuark.
27678 * @code: an error code.
27679 * @format: a string with format characters.
27680 * @...: a list of values to insert into @format.
27682 * Creates a new #GSimpleAsyncResult with a set error.
27684 * Returns: a #GSimpleAsyncResult.
27689 * g_simple_async_result_new_from_error:
27690 * @source_object: (allow-none): a #GObject, or %NULL.
27691 * @callback: (scope async): a #GAsyncReadyCallback.
27692 * @user_data: (closure): user data passed to @callback.
27693 * @error: a #GError
27695 * Creates a #GSimpleAsyncResult from an error condition.
27697 * Returns: a #GSimpleAsyncResult.
27702 * g_simple_async_result_new_take_error: (skip)
27703 * @source_object: (allow-none): a #GObject, or %NULL
27704 * @callback: (scope async): a #GAsyncReadyCallback
27705 * @user_data: (closure): user data passed to @callback
27706 * @error: a #GError
27708 * Creates a #GSimpleAsyncResult from an error condition, and takes over the
27709 * caller's ownership of @error, so the caller does not need to free it anymore.
27711 * Returns: a #GSimpleAsyncResult
27717 * g_simple_async_result_propagate_error:
27718 * @simple: a #GSimpleAsyncResult.
27719 * @dest: (out): a location to propagate the error to.
27721 * Propagates an error from within the simple asynchronous result to
27722 * a given destination.
27724 * If the #GCancellable given to a prior call to
27725 * g_simple_async_result_set_check_cancellable() is cancelled then this
27726 * function will return %TRUE with @dest set appropriately.
27728 * Returns: %TRUE if the error was propagated to @dest. %FALSE otherwise.
27733 * g_simple_async_result_run_in_thread: (skip)
27734 * @simple: a #GSimpleAsyncResult.
27735 * @func: a #GSimpleAsyncThreadFunc.
27736 * @io_priority: the io priority of the request.
27737 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27739 * Runs the asynchronous job in a separate thread and then calls
27740 * g_simple_async_result_complete_in_idle() on @simple to return
27741 * the result to the appropriate main loop.
27743 * Calling this function takes a reference to @simple for as long as
27744 * is needed to run the job and report its completion.
27749 * g_simple_async_result_set_check_cancellable:
27750 * @simple: a #GSimpleAsyncResult
27751 * @check_cancellable: (allow-none): a #GCancellable to check, or %NULL to unset
27753 * Sets a #GCancellable to check before dispatching results.
27755 * This function has one very specific purpose: the provided cancellable
27756 * is checked at the time of g_simple_async_result_propagate_error() If
27757 * it is cancelled, these functions will return an "Operation was
27758 * cancelled" error (%G_IO_ERROR_CANCELLED).
27760 * Implementors of cancellable asynchronous functions should use this in
27761 * order to provide a guarantee to their callers that cancelling an
27762 * async operation will reliably result in an error being returned for
27763 * that operation (even if a positive result for the operation has
27764 * already been sent as an idle to the main context to be dispatched).
27766 * The checking described above is done regardless of any call to the
27767 * unrelated g_simple_async_result_set_handle_cancellation() function.
27774 * g_simple_async_result_set_error: (skip)
27775 * @simple: a #GSimpleAsyncResult.
27776 * @domain: a #GQuark (usually #G_IO_ERROR).
27777 * @code: an error code.
27778 * @format: a formatted error reporting string.
27779 * @...: a list of variables to fill in @format.
27781 * Sets an error within the asynchronous result without a #GError.
27786 * g_simple_async_result_set_error_va: (skip)
27787 * @simple: a #GSimpleAsyncResult.
27788 * @domain: a #GQuark (usually #G_IO_ERROR).
27789 * @code: an error code.
27790 * @format: a formatted error reporting string.
27791 * @args: va_list of arguments.
27793 * Sets an error within the asynchronous result without a #GError.
27794 * Unless writing a binding, see g_simple_async_result_set_error().
27799 * g_simple_async_result_set_from_error:
27800 * @simple: a #GSimpleAsyncResult.
27803 * Sets the result from a #GError.
27808 * g_simple_async_result_set_handle_cancellation:
27809 * @simple: a #GSimpleAsyncResult.
27810 * @handle_cancellation: a #gboolean.
27812 * Sets whether to handle cancellation within the asynchronous operation.
27814 * This function has nothing to do with
27815 * g_simple_async_result_set_check_cancellable(). It only refers to the
27816 * #GCancellable passed to g_simple_async_result_run_in_thread().
27821 * g_simple_async_result_set_op_res_gboolean:
27822 * @simple: a #GSimpleAsyncResult.
27823 * @op_res: a #gboolean.
27825 * Sets the operation result to a boolean within the asynchronous result.
27830 * g_simple_async_result_set_op_res_gpointer: (skip)
27831 * @simple: a #GSimpleAsyncResult.
27832 * @op_res: a pointer result from an asynchronous function.
27833 * @destroy_op_res: a #GDestroyNotify function.
27835 * Sets the operation result within the asynchronous result to a pointer.
27840 * g_simple_async_result_set_op_res_gssize:
27841 * @simple: a #GSimpleAsyncResult.
27842 * @op_res: a #gssize.
27844 * Sets the operation result within the asynchronous result to
27845 * the given @op_res.
27850 * g_simple_async_result_take_error: (skip)
27851 * @simple: a #GSimpleAsyncResult
27852 * @error: a #GError
27854 * Sets the result from @error, and takes over the caller's ownership
27855 * of @error, so the caller does not need to free it any more.
27862 * g_simple_permission_new:
27863 * @allowed: %TRUE if the action is allowed
27865 * Creates a new #GPermission instance that represents an action that is
27866 * either always or never allowed.
27868 * Returns: the #GSimplePermission, as a #GPermission
27875 * @socket: a #GSocket.
27876 * @cancellable: (allow-none): a %GCancellable or %NULL
27877 * @error: #GError for error reporting, or %NULL to ignore.
27879 * Accept incoming connections on a connection-based socket. This removes
27880 * the first outstanding connection request from the listening socket and
27881 * creates a #GSocket object for it.
27883 * The @socket must be bound to a local address with g_socket_bind() and
27884 * must be listening for incoming connections (g_socket_listen()).
27886 * If there are no outstanding connections then the operation will block
27887 * or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
27888 * To be notified of an incoming connection, wait for the %G_IO_IN condition.
27890 * Returns: (transfer full): a new #GSocket, or %NULL on error. Free the returned object with g_object_unref().
27896 * g_socket_address_enumerator_next:
27897 * @enumerator: a #GSocketAddressEnumerator
27898 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27899 * @error: a #GError.
27901 * Retrieves the next #GSocketAddress from @enumerator. Note that this
27902 * may block for some amount of time. (Eg, a #GNetworkAddress may need
27903 * to do a DNS lookup before it can return an address.) Use
27904 * g_socket_address_enumerator_next_async() if you need to avoid
27907 * If @enumerator is expected to yield addresses, but for some reason
27908 * is unable to (eg, because of a DNS error), then the first call to
27909 * g_socket_address_enumerator_next() will return an appropriate error
27910 * in *@error. However, if the first call to
27911 * g_socket_address_enumerator_next() succeeds, then any further
27912 * internal errors (other than @cancellable being triggered) will be
27915 * 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.
27920 * g_socket_address_enumerator_next_async:
27921 * @enumerator: a #GSocketAddressEnumerator
27922 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27923 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
27924 * @user_data: (closure): the data to pass to callback function
27926 * Asynchronously retrieves the next #GSocketAddress from @enumerator
27927 * and then calls @callback, which must call
27928 * g_socket_address_enumerator_next_finish() to get the result.
27933 * g_socket_address_enumerator_next_finish:
27934 * @enumerator: a #GSocketAddressEnumerator
27935 * @result: a #GAsyncResult
27936 * @error: a #GError
27938 * Retrieves the result of a completed call to
27939 * g_socket_address_enumerator_next_async(). See
27940 * g_socket_address_enumerator_next() for more information about
27943 * 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.
27948 * g_socket_address_get_family:
27949 * @address: a #GSocketAddress
27951 * Gets the socket family type of @address.
27953 * Returns: the socket family type of @address.
27959 * g_socket_address_get_native_size:
27960 * @address: a #GSocketAddress
27962 * Gets the size of @address's native <type>struct sockaddr</type>.
27963 * You can use this to allocate memory to pass to
27964 * g_socket_address_to_native().
27966 * Returns: the size of the native <type>struct sockaddr</type> that @address represents
27972 * g_socket_address_new_from_native:
27973 * @native: a pointer to a <type>struct sockaddr</type>
27974 * @len: the size of the memory location pointed to by @native
27976 * Creates a #GSocketAddress subclass corresponding to the native
27977 * <type>struct sockaddr</type> @native.
27979 * Returns: a new #GSocketAddress if @native could successfully be converted, otherwise %NULL.
27985 * g_socket_address_to_native:
27986 * @address: a #GSocketAddress
27987 * @dest: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
27988 * @destlen: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
27989 * @error: #GError for error reporting, or %NULL to ignore.
27991 * Converts a #GSocketAddress to a native <type>struct
27992 * sockaddr</type>, which can be passed to low-level functions like
27993 * connect() or bind().
27995 * If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
27996 * returned. If the address type is not known on the system
27997 * then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
27999 * Returns: %TRUE if @dest was filled in, %FALSE on error
28006 * @socket: a #GSocket.
28007 * @address: a #GSocketAddress specifying the local address.
28008 * @allow_reuse: whether to allow reusing this address
28009 * @error: #GError for error reporting, or %NULL to ignore.
28011 * When a socket is created it is attached to an address family, but it
28012 * doesn't have an address in this family. g_socket_bind() assigns the
28013 * address (sometimes called name) of the socket.
28015 * It is generally required to bind to a local address before you can
28016 * receive connections. (See g_socket_listen() and g_socket_accept() ).
28017 * In certain situations, you may also want to bind a socket that will be
28018 * used to initiate connections, though this is not normally required.
28020 * @allow_reuse should be %TRUE for server sockets (sockets that you will
28021 * eventually call g_socket_accept() on), and %FALSE for client sockets.
28022 * (Specifically, if it is %TRUE, then g_socket_bind() will set the
28023 * %SO_REUSEADDR flag on the socket, allowing it to bind @address even if
28024 * that address was previously used by another socket that has not yet been
28025 * fully cleaned-up by the kernel. Failing to set this flag on a server
28026 * socket may cause the bind call to return %G_IO_ERROR_ADDRESS_IN_USE if
28027 * the server program is stopped and then immediately restarted.)
28029 * Returns: %TRUE on success, %FALSE on error.
28035 * g_socket_check_connect_result:
28036 * @socket: a #GSocket
28037 * @error: #GError for error reporting, or %NULL to ignore.
28039 * Checks and resets the pending connect error for the socket.
28040 * This is used to check for errors when g_socket_connect() is
28041 * used in non-blocking mode.
28043 * Returns: %TRUE if no error, %FALSE otherwise, setting @error to the error
28049 * g_socket_client_add_application_proxy:
28050 * @client: a #GSocketClient
28051 * @protocol: The proxy protocol
28053 * Enable proxy protocols to be handled by the application. When the
28054 * indicated proxy protocol is returned by the #GProxyResolver,
28055 * #GSocketClient will consider this protocol as supported but will
28056 * not try to find a #GProxy instance to handle handshaking. The
28057 * application must check for this case by calling
28058 * g_socket_connection_get_remote_address() on the returned
28059 * #GSocketConnection, and seeing if it's a #GProxyAddress of the
28060 * appropriate type, to determine whether or not it needs to handle
28061 * the proxy handshaking itself.
28063 * This should be used for proxy protocols that are dialects of
28064 * another protocol such as HTTP proxy. It also allows cohabitation of
28065 * proxy protocols that are reused between protocols. A good example
28066 * is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
28067 * be use as generic socket proxy through the HTTP CONNECT method.
28069 * When the proxy is detected as being an application proxy, TLS handshake
28070 * will be skipped. This is required to let the application do the proxy
28071 * specific handshake.
28076 * g_socket_client_connect:
28077 * @client: a #GSocketClient.
28078 * @connectable: a #GSocketConnectable specifying the remote address.
28079 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28080 * @error: #GError for error reporting, or %NULL to ignore.
28082 * Tries to resolve the @connectable and make a network connection to it.
28084 * Upon a successful connection, a new #GSocketConnection is constructed
28085 * and returned. The caller owns this new object and must drop their
28086 * reference to it when finished with it.
28088 * The type of the #GSocketConnection object returned depends on the type of
28089 * the underlying socket that is used. For instance, for a TCP/IP connection
28090 * it will be a #GTcpConnection.
28092 * The socket created will be the same family as the address that the
28093 * @connectable resolves to, unless family is set with g_socket_client_set_family()
28094 * or indirectly via g_socket_client_set_local_address(). The socket type
28095 * defaults to %G_SOCKET_TYPE_STREAM but can be set with
28096 * g_socket_client_set_socket_type().
28098 * If a local address is specified with g_socket_client_set_local_address() the
28099 * socket will be bound to this address before connecting.
28101 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28107 * g_socket_client_connect_async:
28108 * @client: a #GSocketClient
28109 * @connectable: a #GSocketConnectable specifying the remote address.
28110 * @cancellable: (allow-none): a #GCancellable, or %NULL
28111 * @callback: (scope async): a #GAsyncReadyCallback
28112 * @user_data: (closure): user data for the callback
28114 * This is the asynchronous version of g_socket_client_connect().
28116 * When the operation is finished @callback will be
28117 * called. You can then call g_socket_client_connect_finish() to get
28118 * the result of the operation.
28125 * g_socket_client_connect_finish:
28126 * @client: a #GSocketClient.
28127 * @result: a #GAsyncResult.
28128 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28130 * Finishes an async connect operation. See g_socket_client_connect_async()
28132 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28138 * g_socket_client_connect_to_host:
28139 * @client: a #GSocketClient
28140 * @host_and_port: the name and optionally port of the host to connect to
28141 * @default_port: the default port to connect to
28142 * @cancellable: (allow-none): a #GCancellable, or %NULL
28143 * @error: a pointer to a #GError, or %NULL
28145 * This is a helper function for g_socket_client_connect().
28147 * Attempts to create a TCP connection to the named host.
28149 * @host_and_port may be in any of a number of recognized formats; an IPv6
28150 * address, an IPv4 address, or a domain name (in which case a DNS
28151 * lookup is performed). Quoting with [] is supported for all address
28152 * types. A port override may be specified in the usual way with a
28153 * colon. Ports may be given as decimal numbers or symbolic names (in
28154 * which case an /etc/services lookup is performed).
28156 * If no port override is given in @host_and_port then @default_port will be
28157 * used as the port number to connect to.
28159 * In general, @host_and_port is expected to be provided by the user (allowing
28160 * them to give the hostname, and a port override if necessary) and
28161 * @default_port is expected to be provided by the application.
28163 * In the case that an IP address is given, a single connection
28164 * attempt is made. In the case that a name is given, multiple
28165 * connection attempts may be made, in turn and according to the
28166 * number of address records in DNS, until a connection succeeds.
28168 * Upon a successful connection, a new #GSocketConnection is constructed
28169 * and returned. The caller owns this new object and must drop their
28170 * reference to it when finished with it.
28172 * In the event of any failure (DNS error, service not found, no hosts
28173 * connectable) %NULL is returned and @error (if non-%NULL) is set
28176 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28182 * g_socket_client_connect_to_host_async:
28183 * @client: a #GSocketClient
28184 * @host_and_port: the name and optionally the port of the host to connect to
28185 * @default_port: the default port to connect to
28186 * @cancellable: (allow-none): a #GCancellable, or %NULL
28187 * @callback: (scope async): a #GAsyncReadyCallback
28188 * @user_data: (closure): user data for the callback
28190 * This is the asynchronous version of g_socket_client_connect_to_host().
28192 * When the operation is finished @callback will be
28193 * called. You can then call g_socket_client_connect_to_host_finish() to get
28194 * the result of the operation.
28201 * g_socket_client_connect_to_host_finish:
28202 * @client: a #GSocketClient.
28203 * @result: a #GAsyncResult.
28204 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28206 * Finishes an async connect operation. See g_socket_client_connect_to_host_async()
28208 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28214 * g_socket_client_connect_to_service:
28215 * @client: a #GSocketConnection
28216 * @domain: a domain name
28217 * @service: the name of the service to connect to
28218 * @cancellable: (allow-none): a #GCancellable, or %NULL
28219 * @error: a pointer to a #GError, or %NULL
28221 * Attempts to create a TCP connection to a service.
28223 * This call looks up the SRV record for @service at @domain for the
28224 * "tcp" protocol. It then attempts to connect, in turn, to each of
28225 * the hosts providing the service until either a connection succeeds
28226 * or there are no hosts remaining.
28228 * Upon a successful connection, a new #GSocketConnection is constructed
28229 * and returned. The caller owns this new object and must drop their
28230 * reference to it when finished with it.
28232 * In the event of any failure (DNS error, service not found, no hosts
28233 * connectable) %NULL is returned and @error (if non-%NULL) is set
28236 * Returns: (transfer full): a #GSocketConnection if successful, or %NULL on error
28241 * g_socket_client_connect_to_service_async:
28242 * @client: a #GSocketClient
28243 * @domain: a domain name
28244 * @service: the name of the service to connect to
28245 * @cancellable: (allow-none): a #GCancellable, or %NULL
28246 * @callback: (scope async): a #GAsyncReadyCallback
28247 * @user_data: (closure): user data for the callback
28249 * This is the asynchronous version of
28250 * g_socket_client_connect_to_service().
28257 * g_socket_client_connect_to_service_finish:
28258 * @client: a #GSocketClient.
28259 * @result: a #GAsyncResult.
28260 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28262 * Finishes an async connect operation. See g_socket_client_connect_to_service_async()
28264 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28270 * g_socket_client_connect_to_uri:
28271 * @client: a #GSocketClient
28272 * @uri: A network URI
28273 * @default_port: the default port to connect to
28274 * @cancellable: (allow-none): a #GCancellable, or %NULL
28275 * @error: a pointer to a #GError, or %NULL
28277 * This is a helper function for g_socket_client_connect().
28279 * Attempts to create a TCP connection with a network URI.
28281 * @uri may be any valid URI containing an "authority" (hostname/port)
28282 * component. If a port is not specified in the URI, @default_port
28283 * will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
28284 * (#GSocketClient does not know to automatically assume TLS for
28285 * certain URI schemes.)
28287 * Using this rather than g_socket_client_connect() or
28288 * g_socket_client_connect_to_host() allows #GSocketClient to
28289 * determine when to use application-specific proxy protocols.
28291 * Upon a successful connection, a new #GSocketConnection is constructed
28292 * and returned. The caller owns this new object and must drop their
28293 * reference to it when finished with it.
28295 * In the event of any failure (DNS error, service not found, no hosts
28296 * connectable) %NULL is returned and @error (if non-%NULL) is set
28299 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28305 * g_socket_client_connect_to_uri_async:
28306 * @client: a #GSocketClient
28307 * @uri: a network uri
28308 * @default_port: the default port to connect to
28309 * @cancellable: (allow-none): a #GCancellable, or %NULL
28310 * @callback: (scope async): a #GAsyncReadyCallback
28311 * @user_data: (closure): user data for the callback
28313 * This is the asynchronous version of g_socket_client_connect_to_uri().
28315 * When the operation is finished @callback will be
28316 * called. You can then call g_socket_client_connect_to_uri_finish() to get
28317 * the result of the operation.
28324 * g_socket_client_connect_to_uri_finish:
28325 * @client: a #GSocketClient.
28326 * @result: a #GAsyncResult.
28327 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28329 * Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
28331 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28337 * g_socket_client_get_enable_proxy:
28338 * @client: a #GSocketClient.
28340 * Gets the proxy enable state; see g_socket_client_set_enable_proxy()
28342 * Returns: whether proxying is enabled
28348 * g_socket_client_get_family:
28349 * @client: a #GSocketClient.
28351 * Gets the socket family of the socket client.
28353 * See g_socket_client_set_family() for details.
28355 * Returns: a #GSocketFamily
28361 * g_socket_client_get_local_address:
28362 * @client: a #GSocketClient.
28364 * Gets the local address of the socket client.
28366 * See g_socket_client_set_local_address() for details.
28368 * Returns: (transfer none): a #GSocketAddress or %NULL. Do not free.
28374 * g_socket_client_get_protocol:
28375 * @client: a #GSocketClient
28377 * Gets the protocol name type of the socket client.
28379 * See g_socket_client_set_protocol() for details.
28381 * Returns: a #GSocketProtocol
28387 * g_socket_client_get_socket_type:
28388 * @client: a #GSocketClient.
28390 * Gets the socket type of the socket client.
28392 * See g_socket_client_set_socket_type() for details.
28394 * Returns: a #GSocketFamily
28400 * g_socket_client_get_timeout:
28401 * @client: a #GSocketClient
28403 * Gets the I/O timeout time for sockets created by @client.
28405 * See g_socket_client_set_timeout() for details.
28407 * Returns: the timeout in seconds
28413 * g_socket_client_get_tls:
28414 * @client: a #GSocketClient.
28416 * Gets whether @client creates TLS connections. See
28417 * g_socket_client_set_tls() for details.
28419 * Returns: whether @client uses TLS
28425 * g_socket_client_get_tls_validation_flags:
28426 * @client: a #GSocketClient.
28428 * Gets the TLS validation flags used creating TLS connections via
28431 * Returns: the TLS validation flags
28437 * g_socket_client_new:
28439 * Creates a new #GSocketClient with the default options.
28441 * Returns: a #GSocketClient. Free the returned object with g_object_unref().
28447 * g_socket_client_set_enable_proxy:
28448 * @client: a #GSocketClient.
28449 * @enable: whether to enable proxies
28451 * Sets whether or not @client attempts to make connections via a
28452 * proxy server. When enabled (the default), #GSocketClient will use a
28453 * #GProxyResolver to determine if a proxy protocol such as SOCKS is
28454 * needed, and automatically do the necessary proxy negotiation.
28461 * g_socket_client_set_family:
28462 * @client: a #GSocketClient.
28463 * @family: a #GSocketFamily
28465 * Sets the socket family of the socket client.
28466 * If this is set to something other than %G_SOCKET_FAMILY_INVALID
28467 * then the sockets created by this object will be of the specified
28470 * This might be useful for instance if you want to force the local
28471 * connection to be an ipv4 socket, even though the address might
28472 * be an ipv6 mapped to ipv4 address.
28479 * g_socket_client_set_local_address:
28480 * @client: a #GSocketClient.
28481 * @address: (allow-none): a #GSocketAddress, or %NULL
28483 * Sets the local address of the socket client.
28484 * The sockets created by this object will bound to the
28485 * specified address (if not %NULL) before connecting.
28487 * This is useful if you want to ensure that the local
28488 * side of the connection is on a specific port, or on
28489 * a specific interface.
28496 * g_socket_client_set_protocol:
28497 * @client: a #GSocketClient.
28498 * @protocol: a #GSocketProtocol
28500 * Sets the protocol of the socket client.
28501 * The sockets created by this object will use of the specified
28504 * If @protocol is %0 that means to use the default
28505 * protocol for the socket family and type.
28512 * g_socket_client_set_socket_type:
28513 * @client: a #GSocketClient.
28514 * @type: a #GSocketType
28516 * Sets the socket type of the socket client.
28517 * The sockets created by this object will be of the specified
28520 * It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
28521 * as GSocketClient is used for connection oriented services.
28528 * g_socket_client_set_timeout:
28529 * @client: a #GSocketClient.
28530 * @timeout: the timeout
28532 * Sets the I/O timeout for sockets created by @client. @timeout is a
28533 * time in seconds, or 0 for no timeout (the default).
28535 * The timeout value affects the initial connection attempt as well,
28536 * so setting this may cause calls to g_socket_client_connect(), etc,
28537 * to fail with %G_IO_ERROR_TIMED_OUT.
28544 * g_socket_client_set_tls:
28545 * @client: a #GSocketClient.
28546 * @tls: whether to use TLS
28548 * Sets whether @client creates TLS (aka SSL) connections. If @tls is
28549 * %TRUE, @client will wrap its connections in a #GTlsClientConnection
28550 * and perform a TLS handshake when connecting.
28552 * Note that since #GSocketClient must return a #GSocketConnection,
28553 * but #GTlsClientConnection is not a #GSocketConnection, this
28554 * actually wraps the resulting #GTlsClientConnection in a
28555 * #GTcpWrapperConnection when returning it. You can use
28556 * g_tcp_wrapper_connection_get_base_io_stream() on the return value
28557 * to extract the #GTlsClientConnection.
28559 * If you need to modify the behavior of the TLS handshake (eg, by
28560 * setting a client-side certificate to use, or connecting to the
28561 * #GTlsConnection::accept-certificate signal), you can connect to
28562 * @client's #GSocketClient::event signal and wait for it to be
28563 * emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
28564 * a chance to see the #GTlsClientConnection before the handshake
28572 * g_socket_client_set_tls_validation_flags:
28573 * @client: a #GSocketClient.
28574 * @flags: the validation flags
28576 * Sets the TLS validation flags used when creating TLS connections
28577 * via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
28585 * @socket: a #GSocket
28586 * @error: #GError for error reporting, or %NULL to ignore.
28588 * Closes the socket, shutting down any active connection.
28590 * Closing a socket does not wait for all outstanding I/O operations
28591 * to finish, so the caller should not rely on them to be guaranteed
28592 * to complete even if the close returns with no error.
28594 * Once the socket is closed, all other operations will return
28595 * %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
28598 * Sockets will be automatically closed when the last reference
28599 * is dropped, but you might want to call this function to make sure
28600 * resources are released as early as possible.
28602 * Beware that due to the way that TCP works, it is possible for
28603 * recently-sent data to be lost if either you close a socket while the
28604 * %G_IO_IN condition is set, or else if the remote connection tries to
28605 * send something to you after you close the socket but before it has
28606 * finished reading all of the data you sent. There is no easy generic
28607 * way to avoid this problem; the easiest fix is to design the network
28608 * protocol such that the client will never send data "out of turn".
28609 * Another solution is for the server to half-close the connection by
28610 * calling g_socket_shutdown() with only the @shutdown_write flag set,
28611 * and then wait for the client to notice this and close its side of the
28612 * connection, after which the server can safely call g_socket_close().
28613 * (This is what #GTcpConnection does if you call
28614 * g_tcp_connection_set_graceful_disconnect(). But of course, this
28615 * only works if the client will close its connection after the server
28618 * Returns: %TRUE on success, %FALSE on error
28624 * g_socket_condition_check:
28625 * @socket: a #GSocket
28626 * @condition: a #GIOCondition mask to check
28628 * Checks on the readiness of @socket to perform operations.
28629 * The operations specified in @condition are checked for and masked
28630 * against the currently-satisfied conditions on @socket. The result
28633 * Note that on Windows, it is possible for an operation to return
28634 * %G_IO_ERROR_WOULD_BLOCK even immediately after
28635 * g_socket_condition_check() has claimed that the socket is ready for
28636 * writing. Rather than calling g_socket_condition_check() and then
28637 * writing to the socket if it succeeds, it is generally better to
28638 * simply try writing to the socket right away, and try again later if
28639 * the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
28641 * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
28642 * these conditions will always be set in the output if they are true.
28644 * This call never blocks.
28646 * Returns: the @GIOCondition mask of the current state
28652 * g_socket_condition_timed_wait:
28653 * @socket: a #GSocket
28654 * @condition: a #GIOCondition mask to wait for
28655 * @timeout: the maximum time (in microseconds) to wait, or -1
28656 * @cancellable: (allow-none): a #GCancellable, or %NULL
28657 * @error: a #GError pointer, or %NULL
28659 * Waits for up to @timeout microseconds for @condition to become true
28660 * on @socket. If the condition is met, %TRUE is returned.
28662 * If @cancellable is cancelled before the condition is met, or if
28663 * @timeout (or the socket's #GSocket:timeout) is reached before the
28664 * condition is met, then %FALSE is returned and @error, if non-%NULL,
28665 * is set to the appropriate value (%G_IO_ERROR_CANCELLED or
28666 * %G_IO_ERROR_TIMED_OUT).
28668 * If you don't want a timeout, use g_socket_condition_wait().
28669 * (Alternatively, you can pass -1 for @timeout.)
28671 * Note that although @timeout is in microseconds for consistency with
28672 * other GLib APIs, this function actually only has millisecond
28673 * resolution, and the behavior is undefined if @timeout is not an
28674 * exact number of milliseconds.
28676 * Returns: %TRUE if the condition was met, %FALSE otherwise
28682 * g_socket_condition_wait:
28683 * @socket: a #GSocket
28684 * @condition: a #GIOCondition mask to wait for
28685 * @cancellable: (allow-none): a #GCancellable, or %NULL
28686 * @error: a #GError pointer, or %NULL
28688 * Waits for @condition to become true on @socket. When the condition
28689 * is met, %TRUE is returned.
28691 * If @cancellable is cancelled before the condition is met, or if the
28692 * socket has a timeout set and it is reached before the condition is
28693 * met, then %FALSE is returned and @error, if non-%NULL, is set to
28694 * the appropriate value (%G_IO_ERROR_CANCELLED or
28695 * %G_IO_ERROR_TIMED_OUT).
28697 * See also g_socket_condition_timed_wait().
28699 * Returns: %TRUE if the condition was met, %FALSE otherwise
28705 * g_socket_connect:
28706 * @socket: a #GSocket.
28707 * @address: a #GSocketAddress specifying the remote address.
28708 * @cancellable: (allow-none): a %GCancellable or %NULL
28709 * @error: #GError for error reporting, or %NULL to ignore.
28711 * Connect the socket to the specified remote address.
28713 * For connection oriented socket this generally means we attempt to make
28714 * a connection to the @address. For a connection-less socket it sets
28715 * the default address for g_socket_send() and discards all incoming datagrams
28716 * from other sources.
28718 * Generally connection oriented sockets can only connect once, but
28719 * connection-less sockets can connect multiple times to change the
28722 * If the connect call needs to do network I/O it will block, unless
28723 * non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
28724 * and the user can be notified of the connection finishing by waiting
28725 * for the G_IO_OUT condition. The result of the connection must then be
28726 * checked with g_socket_check_connect_result().
28728 * Returns: %TRUE if connected, %FALSE on error.
28734 * g_socket_connectable_enumerate:
28735 * @connectable: a #GSocketConnectable
28737 * Creates a #GSocketAddressEnumerator for @connectable.
28739 * Returns: (transfer full): a new #GSocketAddressEnumerator.
28745 * g_socket_connectable_proxy_enumerate:
28746 * @connectable: a #GSocketConnectable
28748 * Creates a #GSocketAddressEnumerator for @connectable that will
28749 * return #GProxyAddress<!-- -->es for addresses that you must connect
28752 * If @connectable does not implement
28753 * g_socket_connectable_proxy_enumerate(), this will fall back to
28754 * calling g_socket_connectable_enumerate().
28756 * Returns: (transfer full): a new #GSocketAddressEnumerator.
28762 * g_socket_connection_connect:
28763 * @connection: a #GSocketConnection
28764 * @address: a #GSocketAddress specifying the remote address.
28765 * @cancellable: (allow-none): a %GCancellable or %NULL
28766 * @error: #GError for error reporting, or %NULL to ignore.
28768 * Connect @connection to the specified remote address.
28770 * Returns: %TRUE if the connection succeeded, %FALSE on error
28776 * g_socket_connection_connect_async:
28777 * @connection: a #GSocketConnection
28778 * @address: a #GSocketAddress specifying the remote address.
28779 * @cancellable: (allow-none): a %GCancellable or %NULL
28780 * @callback: (scope async): a #GAsyncReadyCallback
28781 * @user_data: (closure): user data for the callback
28783 * Asynchronously connect @connection to the specified remote address.
28785 * This clears the #GSocket:blocking flag on @connection's underlying
28786 * socket if it is currently set.
28788 * Use g_socket_connection_connect_finish() to retrieve the result.
28795 * g_socket_connection_connect_finish:
28796 * @connection: a #GSocketConnection
28797 * @result: the #GAsyncResult
28798 * @error: #GError for error reporting, or %NULL to ignore.
28800 * Gets the result of a g_socket_connection_connect_async() call.
28802 * Returns: %TRUE if the connection succeeded, %FALSE on error
28808 * g_socket_connection_factory_create_connection:
28809 * @socket: a #GSocket
28811 * Creates a #GSocketConnection subclass of the right type for
28814 * Returns: (transfer full): a #GSocketConnection
28820 * g_socket_connection_factory_lookup_type:
28821 * @family: a #GSocketFamily
28822 * @type: a #GSocketType
28823 * @protocol_id: a protocol id
28825 * Looks up the #GType to be used when creating socket connections on
28826 * sockets with the specified @family, @type and @protocol_id.
28828 * If no type is registered, the #GSocketConnection base type is returned.
28830 * Returns: a #GType
28836 * g_socket_connection_factory_register_type:
28837 * @g_type: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
28838 * @family: a #GSocketFamily
28839 * @type: a #GSocketType
28840 * @protocol: a protocol id
28842 * Looks up the #GType to be used when creating socket connections on
28843 * sockets with the specified @family, @type and @protocol.
28845 * If no type is registered, the #GSocketConnection base type is returned.
28852 * g_socket_connection_get_local_address:
28853 * @connection: a #GSocketConnection
28854 * @error: #GError for error reporting, or %NULL to ignore.
28856 * Try to get the local address of a socket connection.
28858 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28864 * g_socket_connection_get_remote_address:
28865 * @connection: a #GSocketConnection
28866 * @error: #GError for error reporting, or %NULL to ignore.
28868 * Try to get the remote address of a socket connection.
28870 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28876 * g_socket_connection_get_socket:
28877 * @connection: a #GSocketConnection
28879 * Gets the underlying #GSocket object of the connection.
28880 * This can be useful if you want to do something unusual on it
28881 * not supported by the #GSocketConnection APIs.
28883 * Returns: (transfer none): a #GSocketAddress or %NULL on error.
28889 * g_socket_connection_is_connected:
28890 * @connection: a #GSocketConnection
28892 * Checks if @connection is connected. This is equivalent to calling
28893 * g_socket_is_connected() on @connection's underlying #GSocket.
28895 * Returns: whether @connection is connected
28901 * g_socket_control_message_deserialize:
28902 * @level: a socket level
28903 * @type: a socket control message type for the given @level
28904 * @size: the size of the data in bytes
28905 * @data: (array length=size) (element-type guint8): pointer to the message data
28907 * Tries to deserialize a socket control message of a given
28908 * @level and @type. This will ask all known (to GType) subclasses
28909 * of #GSocketControlMessage if they can understand this kind
28910 * of message and if so deserialize it into a #GSocketControlMessage.
28912 * If there is no implementation for this kind of control message, %NULL
28913 * will be returned.
28915 * Returns: (transfer full): the deserialized message or %NULL
28921 * g_socket_control_message_get_level:
28922 * @message: a #GSocketControlMessage
28924 * Returns the "level" (i.e. the originating protocol) of the control message.
28925 * This is often SOL_SOCKET.
28927 * Returns: an integer describing the level
28933 * g_socket_control_message_get_msg_type:
28934 * @message: a #GSocketControlMessage
28936 * Returns the protocol specific type of the control message.
28937 * For instance, for UNIX fd passing this would be SCM_RIGHTS.
28939 * Returns: an integer describing the type of control message
28945 * g_socket_control_message_get_size:
28946 * @message: a #GSocketControlMessage
28948 * Returns the space required for the control message, not including
28949 * headers or alignment.
28951 * Returns: The number of bytes required.
28957 * g_socket_control_message_serialize:
28958 * @message: a #GSocketControlMessage
28959 * @data: A buffer to write data to
28961 * Converts the data in the message to bytes placed in the
28964 * @data is guaranteed to have enough space to fit the size
28965 * returned by g_socket_control_message_get_size() on this
28973 * g_socket_create_source: (skip)
28974 * @socket: a #GSocket
28975 * @condition: a #GIOCondition mask to monitor
28976 * @cancellable: (allow-none): a %GCancellable or %NULL
28978 * Creates a %GSource that can be attached to a %GMainContext to monitor
28979 * for the availibility of the specified @condition on the socket.
28981 * The callback on the source is of the #GSocketSourceFunc type.
28983 * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
28984 * these conditions will always be reported output if they are true.
28986 * @cancellable if not %NULL can be used to cancel the source, which will
28987 * cause the source to trigger, reporting the current condition (which
28988 * is likely 0 unless cancellation happened at the same time as a
28989 * condition change). You can check for this in the callback using
28990 * g_cancellable_is_cancelled().
28992 * If @socket has a timeout set, and it is reached before @condition
28993 * occurs, the source will then trigger anyway, reporting %G_IO_IN or
28994 * %G_IO_OUT depending on @condition. However, @socket will have been
28995 * marked as having had a timeout, and so the next #GSocket I/O method
28996 * you call will then fail with a %G_IO_ERROR_TIMED_OUT.
28998 * Returns: (transfer full): a newly allocated %GSource, free with g_source_unref().
29004 * g_socket_get_available_bytes:
29005 * @socket: a #GSocket
29007 * Get the amount of data pending in the OS input buffer.
29009 * Returns: the number of bytes that can be read from the socket without blocking or -1 on error.
29015 * g_socket_get_blocking:
29016 * @socket: a #GSocket.
29018 * Gets the blocking mode of the socket. For details on blocking I/O,
29019 * see g_socket_set_blocking().
29021 * Returns: %TRUE if blocking I/O is used, %FALSE otherwise.
29027 * g_socket_get_broadcast:
29028 * @socket: a #GSocket.
29030 * Gets the broadcast setting on @socket; if %TRUE,
29031 * it is possible to send packets to broadcast
29032 * addresses or receive from broadcast addresses.
29034 * Returns: the broadcast setting on @socket
29040 * g_socket_get_credentials:
29041 * @socket: a #GSocket.
29042 * @error: #GError for error reporting, or %NULL to ignore.
29044 * Returns the credentials of the foreign process connected to this
29045 * socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
29048 * If this operation isn't supported on the OS, the method fails with
29049 * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
29050 * by reading the %SO_PEERCRED option on the underlying socket.
29052 * Other ways to obtain credentials from a foreign peer includes the
29053 * #GUnixCredentialsMessage type and
29054 * g_unix_connection_send_credentials() /
29055 * g_unix_connection_receive_credentials() functions.
29057 * Returns: (transfer full): %NULL if @error is set, otherwise a #GCredentials object that must be freed with g_object_unref().
29063 * g_socket_get_family:
29064 * @socket: a #GSocket.
29066 * Gets the socket family of the socket.
29068 * Returns: a #GSocketFamily
29075 * @socket: a #GSocket.
29077 * Returns the underlying OS socket object. On unix this
29078 * is a socket file descriptor, and on Windows this is
29079 * a Winsock2 SOCKET handle. This may be useful for
29080 * doing platform specific or otherwise unusual operations
29083 * Returns: the file descriptor of the socket.
29089 * g_socket_get_keepalive:
29090 * @socket: a #GSocket.
29092 * Gets the keepalive mode of the socket. For details on this,
29093 * see g_socket_set_keepalive().
29095 * Returns: %TRUE if keepalive is active, %FALSE otherwise.
29101 * g_socket_get_listen_backlog:
29102 * @socket: a #GSocket.
29104 * Gets the listen backlog setting of the socket. For details on this,
29105 * see g_socket_set_listen_backlog().
29107 * Returns: the maximum number of pending connections.
29113 * g_socket_get_local_address:
29114 * @socket: a #GSocket.
29115 * @error: #GError for error reporting, or %NULL to ignore.
29117 * Try to get the local address of a bound socket. This is only
29118 * useful if the socket has been bound to a local address,
29119 * either explicitly or implicitly when connecting.
29121 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29127 * g_socket_get_multicast_loopback:
29128 * @socket: a #GSocket.
29130 * Gets the multicast loopback setting on @socket; if %TRUE (the
29131 * default), outgoing multicast packets will be looped back to
29132 * multicast listeners on the same host.
29134 * Returns: the multicast loopback setting on @socket
29140 * g_socket_get_multicast_ttl:
29141 * @socket: a #GSocket.
29143 * Gets the multicast time-to-live setting on @socket; see
29144 * g_socket_set_multicast_ttl() for more details.
29146 * Returns: the multicast time-to-live setting on @socket
29152 * g_socket_get_protocol:
29153 * @socket: a #GSocket.
29155 * Gets the socket protocol id the socket was created with.
29156 * In case the protocol is unknown, -1 is returned.
29158 * Returns: a protocol id, or -1 if unknown
29164 * g_socket_get_remote_address:
29165 * @socket: a #GSocket.
29166 * @error: #GError for error reporting, or %NULL to ignore.
29168 * Try to get the remove address of a connected socket. This is only
29169 * useful for connection oriented sockets that have been connected.
29171 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29177 * g_socket_get_socket_type:
29178 * @socket: a #GSocket.
29180 * Gets the socket type of the socket.
29182 * Returns: a #GSocketType
29188 * g_socket_get_timeout:
29189 * @socket: a #GSocket.
29191 * Gets the timeout setting of the socket. For details on this, see
29192 * g_socket_set_timeout().
29194 * Returns: the timeout in seconds
29200 * g_socket_get_ttl:
29201 * @socket: a #GSocket.
29203 * Gets the unicast time-to-live setting on @socket; see
29204 * g_socket_set_ttl() for more details.
29206 * Returns: the time-to-live setting on @socket
29212 * g_socket_is_closed:
29213 * @socket: a #GSocket
29215 * Checks whether a socket is closed.
29217 * Returns: %TRUE if socket is closed, %FALSE otherwise
29223 * g_socket_is_connected:
29224 * @socket: a #GSocket.
29226 * Check whether the socket is connected. This is only useful for
29227 * connection-oriented sockets.
29229 * Returns: %TRUE if socket is connected, %FALSE otherwise.
29235 * g_socket_join_multicast_group:
29236 * @socket: a #GSocket.
29237 * @group: a #GInetAddress specifying the group address to join.
29238 * @iface: (allow-none): Name of the interface to use, or %NULL
29239 * @source_specific: %TRUE if source-specific multicast should be used
29240 * @error: #GError for error reporting, or %NULL to ignore.
29242 * Registers @socket to receive multicast messages sent to @group.
29243 * @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
29244 * been bound to an appropriate interface and port with
29247 * If @iface is %NULL, the system will automatically pick an interface
29248 * to bind to based on @group.
29250 * If @source_specific is %TRUE, source-specific multicast as defined
29251 * in RFC 4604 is used. Note that on older platforms this may fail
29252 * with a %G_IO_ERROR_NOT_SUPPORTED error.
29254 * Returns: %TRUE on success, %FALSE on error.
29260 * g_socket_leave_multicast_group:
29261 * @socket: a #GSocket.
29262 * @group: a #GInetAddress specifying the group address to leave.
29263 * @iface: (allow-none): Interface used
29264 * @source_specific: %TRUE if source-specific multicast was used
29265 * @error: #GError for error reporting, or %NULL to ignore.
29267 * Removes @socket from the multicast group defined by @group, @iface,
29268 * and @source_specific (which must all have the same values they had
29269 * when you joined the group).
29271 * @socket remains bound to its address and port, and can still receive
29272 * unicast messages after calling this.
29274 * Returns: %TRUE on success, %FALSE on error.
29281 * @socket: a #GSocket.
29282 * @error: #GError for error reporting, or %NULL to ignore.
29284 * Marks the socket as a server socket, i.e. a socket that is used
29285 * to accept incoming requests using g_socket_accept().
29287 * Before calling this the socket must be bound to a local address using
29290 * To set the maximum amount of outstanding clients, use
29291 * g_socket_set_listen_backlog().
29293 * Returns: %TRUE on success, %FALSE on error.
29299 * g_socket_listener_accept:
29300 * @listener: a #GSocketListener
29301 * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL
29302 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29303 * @error: #GError for error reporting, or %NULL to ignore.
29305 * Blocks waiting for a client to connect to any of the sockets added
29306 * to the listener. Returns a #GSocketConnection for the socket that was
29309 * If @source_object is not %NULL it will be filled out with the source
29310 * object specified when the corresponding socket or address was added
29313 * If @cancellable is not %NULL, then the operation can be cancelled by
29314 * triggering the cancellable object from another thread. If the operation
29315 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29317 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29323 * g_socket_listener_accept_async:
29324 * @listener: a #GSocketListener
29325 * @cancellable: (allow-none): a #GCancellable, or %NULL
29326 * @callback: (scope async): a #GAsyncReadyCallback
29327 * @user_data: (closure): user data for the callback
29329 * This is the asynchronous version of g_socket_listener_accept().
29331 * When the operation is finished @callback will be
29332 * called. You can then call g_socket_listener_accept_socket()
29333 * to get the result of the operation.
29340 * g_socket_listener_accept_finish:
29341 * @listener: a #GSocketListener
29342 * @result: a #GAsyncResult.
29343 * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29344 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29346 * Finishes an async accept operation. See g_socket_listener_accept_async()
29348 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29354 * g_socket_listener_accept_socket:
29355 * @listener: a #GSocketListener
29356 * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL.
29357 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29358 * @error: #GError for error reporting, or %NULL to ignore.
29360 * Blocks waiting for a client to connect to any of the sockets added
29361 * to the listener. Returns the #GSocket that was accepted.
29363 * If you want to accept the high-level #GSocketConnection, not a #GSocket,
29364 * which is often the case, then you should use g_socket_listener_accept()
29367 * If @source_object is not %NULL it will be filled out with the source
29368 * object specified when the corresponding socket or address was added
29371 * If @cancellable is not %NULL, then the operation can be cancelled by
29372 * triggering the cancellable object from another thread. If the operation
29373 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29375 * Returns: (transfer full): a #GSocket on success, %NULL on error.
29381 * g_socket_listener_accept_socket_async:
29382 * @listener: a #GSocketListener
29383 * @cancellable: (allow-none): a #GCancellable, or %NULL
29384 * @callback: (scope async): a #GAsyncReadyCallback
29385 * @user_data: (closure): user data for the callback
29387 * This is the asynchronous version of g_socket_listener_accept_socket().
29389 * When the operation is finished @callback will be
29390 * called. You can then call g_socket_listener_accept_socket_finish()
29391 * to get the result of the operation.
29398 * g_socket_listener_accept_socket_finish:
29399 * @listener: a #GSocketListener
29400 * @result: a #GAsyncResult.
29401 * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29402 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29404 * Finishes an async accept operation. See g_socket_listener_accept_socket_async()
29406 * Returns: (transfer full): a #GSocket on success, %NULL on error.
29412 * g_socket_listener_add_address:
29413 * @listener: a #GSocketListener
29414 * @address: a #GSocketAddress
29415 * @type: a #GSocketType
29416 * @protocol: a #GSocketProtocol
29417 * @source_object: (allow-none): Optional #GObject identifying this source
29418 * @effective_address: (out) (allow-none): location to store the address that was bound to, or %NULL.
29419 * @error: #GError for error reporting, or %NULL to ignore.
29421 * Creates a socket of type @type and protocol @protocol, binds
29422 * it to @address and adds it to the set of sockets we're accepting
29425 * Note that adding an IPv6 address, depending on the platform,
29426 * may or may not result in a listener that also accepts IPv4
29427 * connections. For more deterministic behavior, see
29428 * g_socket_listener_add_inet_port().
29430 * @source_object will be passed out in the various calls
29431 * to accept to identify this particular source, which is
29432 * useful if you're listening on multiple addresses and do
29433 * different things depending on what address is connected to.
29435 * If successful and @effective_address is non-%NULL then it will
29436 * be set to the address that the binding actually occurred at. This
29437 * is helpful for determining the port number that was used for when
29438 * requesting a binding to port 0 (ie: "any port"). This address, if
29439 * requested, belongs to the caller and must be freed.
29441 * Returns: %TRUE on success, %FALSE on error.
29447 * g_socket_listener_add_any_inet_port:
29448 * @listener: a #GSocketListener
29449 * @source_object: (allow-none): Optional #GObject identifying this source
29450 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29452 * Listens for TCP connections on any available port number for both
29453 * IPv6 and IPv4 (if each is available).
29455 * This is useful if you need to have a socket for incoming connections
29456 * but don't care about the specific port number.
29458 * @source_object will be passed out in the various calls
29459 * to accept to identify this particular source, which is
29460 * useful if you're listening on multiple addresses and do
29461 * different things depending on what address is connected to.
29463 * Returns: the port number, or 0 in case of failure.
29469 * g_socket_listener_add_inet_port:
29470 * @listener: a #GSocketListener
29471 * @port: an IP port number (non-zero)
29472 * @source_object: (allow-none): Optional #GObject identifying this source
29473 * @error: #GError for error reporting, or %NULL to ignore.
29475 * Helper function for g_socket_listener_add_address() that
29476 * creates a TCP/IP socket listening on IPv4 and IPv6 (if
29477 * supported) on the specified port on all interfaces.
29479 * @source_object will be passed out in the various calls
29480 * to accept to identify this particular source, which is
29481 * useful if you're listening on multiple addresses and do
29482 * different things depending on what address is connected to.
29484 * Returns: %TRUE on success, %FALSE on error.
29490 * g_socket_listener_add_socket:
29491 * @listener: a #GSocketListener
29492 * @socket: a listening #GSocket
29493 * @source_object: (allow-none): Optional #GObject identifying this source
29494 * @error: #GError for error reporting, or %NULL to ignore.
29496 * Adds @socket to the set of sockets that we try to accept
29497 * new clients from. The socket must be bound to a local
29498 * address and listened to.
29500 * @source_object will be passed out in the various calls
29501 * to accept to identify this particular source, which is
29502 * useful if you're listening on multiple addresses and do
29503 * different things depending on what address is connected to.
29505 * Returns: %TRUE on success, %FALSE on error.
29511 * g_socket_listener_close:
29512 * @listener: a #GSocketListener
29514 * Closes all the sockets in the listener.
29521 * g_socket_listener_new:
29523 * Creates a new #GSocketListener with no sockets to listen for.
29524 * New listeners can be added with e.g. g_socket_listener_add_address()
29525 * or g_socket_listener_add_inet_port().
29527 * Returns: a new #GSocketListener.
29533 * g_socket_listener_set_backlog:
29534 * @listener: a #GSocketListener
29535 * @listen_backlog: an integer
29537 * Sets the listen backlog on the sockets in the listener.
29539 * See g_socket_set_listen_backlog() for details
29547 * @family: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
29548 * @type: the socket type to use.
29549 * @protocol: the id of the protocol to use, or 0 for default.
29550 * @error: #GError for error reporting, or %NULL to ignore.
29552 * Creates a new #GSocket with the defined family, type and protocol.
29553 * If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
29554 * for the family and type is used.
29556 * The @protocol is a family and type specific int that specifies what
29557 * kind of protocol to use. #GSocketProtocol lists several common ones.
29558 * Many families only support one protocol, and use 0 for this, others
29559 * support several and using 0 means to use the default protocol for
29560 * the family and type.
29562 * The protocol id is passed directly to the operating
29563 * system, so you can use protocols not listed in #GSocketProtocol if you
29564 * know the protocol number used for it.
29566 * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29572 * g_socket_new_from_fd:
29573 * @fd: a native socket file descriptor.
29574 * @error: #GError for error reporting, or %NULL to ignore.
29576 * Creates a new #GSocket from a native file descriptor
29577 * or winsock SOCKET handle.
29579 * This reads all the settings from the file descriptor so that
29580 * all properties should work. Note that the file descriptor
29581 * will be set to non-blocking mode, independent on the blocking
29582 * mode of the #GSocket.
29584 * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29590 * g_socket_receive:
29591 * @socket: a #GSocket
29592 * @buffer: a buffer to read data into (which should be at least @size bytes long).
29593 * @size: the number of bytes you want to read from the socket
29594 * @cancellable: (allow-none): a %GCancellable or %NULL
29595 * @error: #GError for error reporting, or %NULL to ignore.
29597 * Receive data (up to @size bytes) from a socket. This is mainly used by
29598 * connection-oriented sockets; it is identical to g_socket_receive_from()
29599 * with @address set to %NULL.
29601 * For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
29602 * g_socket_receive() will always read either 0 or 1 complete messages from
29603 * the socket. If the received message is too large to fit in @buffer, then
29604 * the data beyond @size bytes will be discarded, without any explicit
29605 * indication that this has occurred.
29607 * For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
29608 * number of bytes, up to @size. If more than @size bytes have been
29609 * received, the additional data will be returned in future calls to
29610 * g_socket_receive().
29612 * If the socket is in blocking mode the call will block until there
29613 * is some data to receive, the connection is closed, or there is an
29614 * error. If there is no data available and the socket is in
29615 * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29616 * returned. To be notified when data is available, wait for the
29617 * %G_IO_IN condition.
29619 * On error -1 is returned and @error is set accordingly.
29621 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29627 * g_socket_receive_from:
29628 * @socket: a #GSocket
29629 * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29630 * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29631 * @size: the number of bytes you want to read from the socket
29632 * @cancellable: (allow-none): a %GCancellable or %NULL
29633 * @error: #GError for error reporting, or %NULL to ignore.
29635 * Receive data (up to @size bytes) from a socket.
29637 * If @address is non-%NULL then @address will be set equal to the
29638 * source address of the received packet.
29639 * @address is owned by the caller.
29641 * See g_socket_receive() for additional information.
29643 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29649 * g_socket_receive_message:
29650 * @socket: a #GSocket
29651 * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29652 * @vectors: (array length=num_vectors): an array of #GInputVector structs
29653 * @num_vectors: the number of elements in @vectors, or -1
29654 * @messages: (array length=num_messages) (allow-none): a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
29655 * @num_messages: a pointer which will be filled with the number of elements in @messages, or %NULL
29656 * @flags: a pointer to an int containing #GSocketMsgFlags flags
29657 * @cancellable: (allow-none): a %GCancellable or %NULL
29658 * @error: a #GError pointer, or %NULL
29660 * Receive data from a socket. This is the most complicated and
29661 * fully-featured version of this call. For easier use, see
29662 * g_socket_receive() and g_socket_receive_from().
29664 * If @address is non-%NULL then @address will be set equal to the
29665 * source address of the received packet.
29666 * @address is owned by the caller.
29668 * @vector must point to an array of #GInputVector structs and
29669 * @num_vectors must be the length of this array. These structs
29670 * describe the buffers that received data will be scattered into.
29671 * If @num_vectors is -1, then @vectors is assumed to be terminated
29672 * by a #GInputVector with a %NULL buffer pointer.
29674 * As a special case, if @num_vectors is 0 (in which case, @vectors
29675 * may of course be %NULL), then a single byte is received and
29676 * discarded. This is to facilitate the common practice of sending a
29677 * single '\0' byte for the purposes of transferring ancillary data.
29679 * @messages, if non-%NULL, will be set to point to a newly-allocated
29680 * array of #GSocketControlMessage instances or %NULL if no such
29681 * messages was received. These correspond to the control messages
29682 * received from the kernel, one #GSocketControlMessage per message
29683 * from the kernel. This array is %NULL-terminated and must be freed
29684 * by the caller using g_free() after calling g_object_unref() on each
29685 * element. If @messages is %NULL, any control messages received will
29688 * @num_messages, if non-%NULL, will be set to the number of control
29689 * messages received.
29691 * If both @messages and @num_messages are non-%NULL, then
29692 * @num_messages gives the number of #GSocketControlMessage instances
29693 * in @messages (ie: not including the %NULL terminator).
29695 * @flags is an in/out parameter. The commonly available arguments
29696 * for this are available in the #GSocketMsgFlags enum, but the
29697 * values there are the same as the system values, and the flags
29698 * are passed in as-is, so you can pass in system-specific flags too
29699 * (and g_socket_receive_message() may pass system-specific flags out).
29701 * As with g_socket_receive(), data may be discarded if @socket is
29702 * %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
29703 * provide enough buffer space to read a complete message. You can pass
29704 * %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
29705 * removing it from the receive queue, but there is no portable way to find
29706 * out the length of the message other than by reading it into a
29707 * sufficiently-large buffer.
29709 * If the socket is in blocking mode the call will block until there
29710 * is some data to receive, the connection is closed, or there is an
29711 * error. If there is no data available and the socket is in
29712 * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29713 * returned. To be notified when data is available, wait for the
29714 * %G_IO_IN condition.
29716 * On error -1 is returned and @error is set accordingly.
29718 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29724 * g_socket_receive_with_blocking:
29725 * @socket: a #GSocket
29726 * @buffer: a buffer to read data into (which should be at least @size bytes long).
29727 * @size: the number of bytes you want to read from the socket
29728 * @blocking: whether to do blocking or non-blocking I/O
29729 * @cancellable: (allow-none): a %GCancellable or %NULL
29730 * @error: #GError for error reporting, or %NULL to ignore.
29732 * This behaves exactly the same as g_socket_receive(), except that
29733 * the choice of blocking or non-blocking behavior is determined by
29734 * the @blocking argument rather than by @socket's properties.
29736 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29743 * @socket: a #GSocket
29744 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29745 * @size: the number of bytes to send
29746 * @cancellable: (allow-none): a %GCancellable or %NULL
29747 * @error: #GError for error reporting, or %NULL to ignore.
29749 * Tries to send @size bytes from @buffer on the socket. This is
29750 * mainly used by connection-oriented sockets; it is identical to
29751 * g_socket_send_to() with @address set to %NULL.
29753 * If the socket is in blocking mode the call will block until there is
29754 * space for the data in the socket queue. If there is no space available
29755 * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29756 * will be returned. To be notified when space is available, wait for the
29757 * %G_IO_OUT condition. Note though that you may still receive
29758 * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29759 * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29760 * very common due to the way the underlying APIs work.)
29762 * On error -1 is returned and @error is set accordingly.
29764 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29770 * g_socket_send_message:
29771 * @socket: a #GSocket
29772 * @address: (allow-none): a #GSocketAddress, or %NULL
29773 * @vectors: (array length=num_vectors): an array of #GOutputVector structs
29774 * @num_vectors: the number of elements in @vectors, or -1
29775 * @messages: (array length=num_messages) (allow-none): a pointer to an array of #GSocketControlMessages, or %NULL.
29776 * @num_messages: number of elements in @messages, or -1.
29777 * @flags: an int containing #GSocketMsgFlags flags
29778 * @cancellable: (allow-none): a %GCancellable or %NULL
29779 * @error: #GError for error reporting, or %NULL to ignore.
29781 * Send data to @address on @socket. This is the most complicated and
29782 * fully-featured version of this call. For easier use, see
29783 * g_socket_send() and g_socket_send_to().
29785 * If @address is %NULL then the message is sent to the default receiver
29786 * (set by g_socket_connect()).
29788 * @vectors must point to an array of #GOutputVector structs and
29789 * @num_vectors must be the length of this array. (If @num_vectors is -1,
29790 * then @vectors is assumed to be terminated by a #GOutputVector with a
29791 * %NULL buffer pointer.) The #GOutputVector structs describe the buffers
29792 * that the sent data will be gathered from. Using multiple
29793 * #GOutputVector<!-- -->s is more memory-efficient than manually copying
29794 * data from multiple sources into a single buffer, and more
29795 * network-efficient than making multiple calls to g_socket_send().
29797 * @messages, if non-%NULL, is taken to point to an array of @num_messages
29798 * #GSocketControlMessage instances. These correspond to the control
29799 * messages to be sent on the socket.
29800 * If @num_messages is -1 then @messages is treated as a %NULL-terminated
29803 * @flags modify how the message is sent. The commonly available arguments
29804 * for this are available in the #GSocketMsgFlags enum, but the
29805 * values there are the same as the system values, and the flags
29806 * are passed in as-is, so you can pass in system-specific flags too.
29808 * If the socket is in blocking mode the call will block until there is
29809 * space for the data in the socket queue. If there is no space available
29810 * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29811 * will be returned. To be notified when space is available, wait for the
29812 * %G_IO_OUT condition. Note though that you may still receive
29813 * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29814 * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29815 * very common due to the way the underlying APIs work.)
29817 * On error -1 is returned and @error is set accordingly.
29819 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29825 * g_socket_send_to:
29826 * @socket: a #GSocket
29827 * @address: (allow-none): a #GSocketAddress, or %NULL
29828 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29829 * @size: the number of bytes to send
29830 * @cancellable: (allow-none): a %GCancellable or %NULL
29831 * @error: #GError for error reporting, or %NULL to ignore.
29833 * Tries to send @size bytes from @buffer to @address. If @address is
29834 * %NULL then the message is sent to the default receiver (set by
29835 * g_socket_connect()).
29837 * See g_socket_send() for additional information.
29839 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29845 * g_socket_send_with_blocking:
29846 * @socket: a #GSocket
29847 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29848 * @size: the number of bytes to send
29849 * @blocking: whether to do blocking or non-blocking I/O
29850 * @cancellable: (allow-none): a %GCancellable or %NULL
29851 * @error: #GError for error reporting, or %NULL to ignore.
29853 * This behaves exactly the same as g_socket_send(), except that
29854 * the choice of blocking or non-blocking behavior is determined by
29855 * the @blocking argument rather than by @socket's properties.
29857 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29863 * g_socket_service_is_active:
29864 * @service: a #GSocketService
29866 * Check whether the service is active or not. An active
29867 * service will accept new clients that connect, while
29868 * a non-active service will let connecting clients queue
29869 * up until the service is started.
29871 * Returns: %TRUE if the service is active, %FALSE otherwise
29877 * g_socket_service_new:
29879 * Creates a new #GSocketService with no sockets to listen for.
29880 * New listeners can be added with e.g. g_socket_listener_add_address()
29881 * or g_socket_listener_add_inet_port().
29883 * Returns: a new #GSocketService.
29889 * g_socket_service_start:
29890 * @service: a #GSocketService
29892 * Starts the service, i.e. start accepting connections
29893 * from the added sockets when the mainloop runs.
29895 * This call is thread-safe, so it may be called from a thread
29896 * handling an incoming client request.
29903 * g_socket_service_stop:
29904 * @service: a #GSocketService
29906 * Stops the service, i.e. stops accepting connections
29907 * from the added sockets when the mainloop runs.
29909 * This call is thread-safe, so it may be called from a thread
29910 * handling an incoming client request.
29917 * g_socket_set_blocking:
29918 * @socket: a #GSocket.
29919 * @blocking: Whether to use blocking I/O or not.
29921 * Sets the blocking mode of the socket. In blocking mode
29922 * all operations block until they succeed or there is an error. In
29923 * non-blocking mode all functions return results immediately or
29924 * with a %G_IO_ERROR_WOULD_BLOCK error.
29926 * All sockets are created in blocking mode. However, note that the
29927 * platform level socket is always non-blocking, and blocking mode
29928 * is a GSocket level feature.
29935 * g_socket_set_broadcast:
29936 * @socket: a #GSocket.
29937 * @broadcast: whether @socket should allow sending to and receiving from broadcast addresses
29939 * Sets whether @socket should allow sending to and receiving from
29940 * broadcast addresses. This is %FALSE by default.
29947 * g_socket_set_keepalive:
29948 * @socket: a #GSocket.
29949 * @keepalive: Value for the keepalive flag
29951 * Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
29952 * this flag is set on a socket, the system will attempt to verify that the
29953 * remote socket endpoint is still present if a sufficiently long period of
29954 * time passes with no data being exchanged. If the system is unable to
29955 * verify the presence of the remote endpoint, it will automatically close
29958 * This option is only functional on certain kinds of sockets. (Notably,
29959 * %G_SOCKET_PROTOCOL_TCP sockets.)
29961 * The exact time between pings is system- and protocol-dependent, but will
29962 * normally be at least two hours. Most commonly, you would set this flag
29963 * on a server socket if you want to allow clients to remain idle for long
29964 * periods of time, but also want to ensure that connections are eventually
29965 * garbage-collected if clients crash or become unreachable.
29972 * g_socket_set_listen_backlog:
29973 * @socket: a #GSocket.
29974 * @backlog: the maximum number of pending connections.
29976 * Sets the maximum number of outstanding connections allowed
29977 * when listening on this socket. If more clients than this are
29978 * connecting to the socket and the application is not handling them
29979 * on time then the new connections will be refused.
29981 * Note that this must be called before g_socket_listen() and has no
29982 * effect if called after that.
29989 * g_socket_set_multicast_loopback:
29990 * @socket: a #GSocket.
29991 * @loopback: whether @socket should receive messages sent to its multicast groups from the local host
29993 * Sets whether outgoing multicast packets will be received by sockets
29994 * listening on that multicast address on the same host. This is %TRUE
30002 * g_socket_set_multicast_ttl:
30003 * @socket: a #GSocket.
30004 * @ttl: the time-to-live value for all multicast datagrams on @socket
30006 * Sets the time-to-live for outgoing multicast datagrams on @socket.
30007 * By default, this is 1, meaning that multicast packets will not leave
30008 * the local network.
30015 * g_socket_set_timeout:
30016 * @socket: a #GSocket.
30017 * @timeout: the timeout for @socket, in seconds, or 0 for none
30019 * Sets the time in seconds after which I/O operations on @socket will
30020 * time out if they have not yet completed.
30022 * On a blocking socket, this means that any blocking #GSocket
30023 * operation will time out after @timeout seconds of inactivity,
30024 * returning %G_IO_ERROR_TIMED_OUT.
30026 * On a non-blocking socket, calls to g_socket_condition_wait() will
30027 * also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
30028 * created with g_socket_create_source() will trigger after
30029 * @timeout seconds of inactivity, with the requested condition
30030 * set, at which point calling g_socket_receive(), g_socket_send(),
30031 * g_socket_check_connect_result(), etc, will fail with
30032 * %G_IO_ERROR_TIMED_OUT.
30034 * If @timeout is 0 (the default), operations will never time out
30037 * Note that if an I/O operation is interrupted by a signal, this may
30038 * cause the timeout to be reset.
30045 * g_socket_set_ttl:
30046 * @socket: a #GSocket.
30047 * @ttl: the time-to-live value for all unicast packets on @socket
30049 * Sets the time-to-live for outgoing unicast packets on @socket.
30050 * By default the platform-specific default value is used.
30057 * g_socket_shutdown:
30058 * @socket: a #GSocket
30059 * @shutdown_read: whether to shut down the read side
30060 * @shutdown_write: whether to shut down the write side
30061 * @error: #GError for error reporting, or %NULL to ignore.
30063 * Shut down part of a full-duplex connection.
30065 * If @shutdown_read is %TRUE then the receiving side of the connection
30066 * is shut down, and further reading is disallowed.
30068 * If @shutdown_write is %TRUE then the sending side of the connection
30069 * is shut down, and further writing is disallowed.
30071 * It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
30073 * One example where this is used is graceful disconnect for TCP connections
30074 * where you close the sending side, then wait for the other side to close
30075 * the connection, thus ensuring that the other side saw all sent data.
30077 * Returns: %TRUE on success, %FALSE on error
30083 * g_socket_speaks_ipv4:
30084 * @socket: a #GSocket
30086 * Checks if a socket is capable of speaking IPv4.
30088 * IPv4 sockets are capable of speaking IPv4. On some operating systems
30089 * and under some combinations of circumstances IPv6 sockets are also
30090 * capable of speaking IPv4. See RFC 3493 section 3.7 for more
30093 * No other types of sockets are currently considered as being capable
30094 * of speaking IPv4.
30096 * Returns: %TRUE if this socket can be used with IPv4.
30102 * g_srv_target_copy:
30103 * @target: a #GSrvTarget
30107 * Returns: a copy of @target
30113 * g_srv_target_free:
30114 * @target: a #GSrvTarget
30123 * g_srv_target_get_hostname:
30124 * @target: a #GSrvTarget
30126 * Gets @target's hostname (in ASCII form; if you are going to present
30127 * this to the user, you should use g_hostname_is_ascii_encoded() to
30128 * check if it contains encoded Unicode segments, and use
30129 * g_hostname_to_unicode() to convert it if it does.)
30131 * Returns: @target's hostname
30137 * g_srv_target_get_port:
30138 * @target: a #GSrvTarget
30140 * Gets @target's port
30142 * Returns: @target's port
30148 * g_srv_target_get_priority:
30149 * @target: a #GSrvTarget
30151 * Gets @target's priority. You should not need to look at this;
30152 * #GResolver already sorts the targets according to the algorithm in
30155 * Returns: @target's priority
30161 * g_srv_target_get_weight:
30162 * @target: a #GSrvTarget
30164 * Gets @target's weight. You should not need to look at this;
30165 * #GResolver already sorts the targets according to the algorithm in
30168 * Returns: @target's weight
30174 * g_srv_target_list_sort: (skip)
30175 * @targets: a #GList of #GSrvTarget
30177 * Sorts @targets in place according to the algorithm in RFC 2782.
30179 * Returns: (transfer full): the head of the sorted list.
30185 * g_srv_target_new:
30186 * @hostname: the host that the service is running on
30187 * @port: the port that the service is running on
30188 * @priority: the target's priority
30189 * @weight: the target's weight
30191 * Creates a new #GSrvTarget with the given parameters.
30193 * You should not need to use this; normally #GSrvTarget<!-- -->s are
30194 * created by #GResolver.
30196 * Returns: a new #GSrvTarget.
30202 * g_static_resource_fini:
30203 * @static_resource: pointer to a static #GStaticResource
30205 * Finalized a GResource initialized by g_static_resource_init().
30207 * This is normally used by code generated by
30208 * <link linkend="glib-compile-resources">glib-compile-resources</link>
30209 * and is not typically used by other code.
30216 * g_static_resource_get_resource:
30217 * @static_resource: pointer to a static #GStaticResource
30219 * Gets the GResource that was registered by a call to g_static_resource_init().
30221 * This is normally used by code generated by
30222 * <link linkend="glib-compile-resources">glib-compile-resources</link>
30223 * and is not typically used by other code.
30225 * Returns: (transfer none): a #GResource
30231 * g_static_resource_init:
30232 * @static_resource: pointer to a static #GStaticResource
30234 * Initializes a GResource from static data using a
30237 * This is normally used by code generated by
30238 * <link linkend="glib-compile-resources">glib-compile-resources</link>
30239 * and is not typically used by other code.
30246 * g_tcp_connection_get_graceful_disconnect:
30247 * @connection: a #GTcpConnection
30249 * Checks if graceful disconnects are used. See
30250 * g_tcp_connection_set_graceful_disconnect().
30252 * Returns: %TRUE if graceful disconnect is used on close, %FALSE otherwise
30258 * g_tcp_connection_set_graceful_disconnect:
30259 * @connection: a #GTcpConnection
30260 * @graceful_disconnect: Whether to do graceful disconnects or not
30262 * This enabled graceful disconnects on close. A graceful disconnect
30263 * means that we signal the receiving end that the connection is terminated
30264 * and wait for it to close the connection before closing the connection.
30266 * A graceful disconnect means that we can be sure that we successfully sent
30267 * all the outstanding data to the other end, or get an error reported.
30268 * However, it also means we have to wait for all the data to reach the
30269 * other side and for it to acknowledge this by closing the socket, which may
30270 * take a while. For this reason it is disabled by default.
30277 * g_tcp_wrapper_connection_get_base_io_stream:
30278 * @conn: a #GTcpWrapperConnection
30280 * Get's @conn's base #GIOStream
30282 * Returns: (transfer none): @conn's base #GIOStream
30287 * g_tcp_wrapper_connection_new:
30288 * @base_io_stream: the #GIOStream to wrap
30289 * @socket: the #GSocket associated with @base_io_stream
30291 * Wraps @base_io_stream and @socket together as a #GSocketConnection.
30293 * Returns: the new #GSocketConnection.
30299 * g_test_dbus_add_service_dir:
30300 * @self: a #GTestDBus
30301 * @path: path to a directory containing .service files
30303 * Add a path where dbus-daemon will lookup for .services files. This can't be
30304 * called after g_test_dbus_up().
30309 * g_test_dbus_down:
30310 * @self: a #GTestDBus
30312 * Stop the session bus started by g_test_dbus_up().
30314 * This will wait for the singleton returned by g_bus_get() or g_bus_get_sync()
30315 * is destroyed. This is done to ensure that the next unit test won't get a
30316 * leaked singleton from this test.
30321 * g_test_dbus_get_bus_address:
30322 * @self: a #GTestDBus
30324 * Get the address on which dbus-daemon is running. if g_test_dbus_up() has not
30325 * been called yet, %NULL is returned. This can be used with
30326 * g_dbus_connection_new_for_address()
30328 * Returns: the address of the bus, or %NULL.
30333 * g_test_dbus_get_flags:
30334 * @self: a #GTestDBus
30338 * Returns: the value of #GTestDBus:flags property
30344 * @flags: a #GTestDBusFlags
30346 * Create a new #GTestDBus object.
30348 * Returns: (transfer full): a new #GTestDBus.
30353 * g_test_dbus_stop:
30354 * @self: a #GTestDBus
30356 * Stop the session bus started by g_test_dbus_up().
30358 * Unlike g_test_dbus_down(), this won't verify the #GDBusConnection
30359 * singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit
30360 * tests wanting to verify behaviour after the session bus has been stopped
30361 * can use this function but should still call g_test_dbus_down() when done.
30366 * g_test_dbus_unset:
30368 * Unset DISPLAY and DBUS_SESSION_BUS_ADDRESS env variables to ensure the test
30369 * won't use user's session bus.
30371 * This is useful for unit tests that want to verify behaviour when no session
30372 * bus is running. It is not necessary to call this if unit test already calls
30373 * g_test_dbus_up() before acquiring the session bus.
30379 * @self: a #GTestDBus
30381 * Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this
30382 * call, it is safe for unit tests to start sending messages on the session bug.
30384 * If this function is called from setup callback of g_test_add(),
30385 * g_test_dbus_down() must be called in its teardown callback.
30387 * If this function is called from unit test's main(), then g_test_dbus_down()
30388 * must be called after g_test_run().
30393 * g_themed_icon_append_name:
30394 * @icon: a #GThemedIcon
30395 * @iconname: name of icon to append to list of icons from within @icon.
30397 * Append a name to the list of icons from within @icon.
30400 * Note that doing so invalidates the hash computed by prior calls
30401 * to g_icon_hash().
30407 * g_themed_icon_get_names:
30408 * @icon: a #GThemedIcon.
30410 * Gets the names of icons from within @icon.
30412 * Returns: (transfer none): a list of icon names.
30417 * g_themed_icon_new:
30418 * @iconname: a string containing an icon name.
30420 * Creates a new themed icon for @iconname.
30422 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30427 * g_themed_icon_new_from_names:
30428 * @iconnames: (array length=len): an array of strings containing icon names.
30429 * @len: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
30431 * Creates a new themed icon for @iconnames.
30433 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon
30438 * g_themed_icon_new_with_default_fallbacks:
30439 * @iconname: a string containing an icon name
30441 * Creates a new themed icon for @iconname, and all the names
30442 * that can be created by shortening @iconname at '-' characters.
30444 * In the following example, @icon1 and @icon2 are equivalent:
30446 * const char *names[] = {
30447 * "gnome-dev-cdrom-audio",
30448 * "gnome-dev-cdrom",
30453 * icon1 = g_themed_icon_new_from_names (names, 4);
30454 * icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
30457 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30462 * g_themed_icon_prepend_name:
30463 * @icon: a #GThemedIcon
30464 * @iconname: name of icon to prepend to list of icons from within @icon.
30466 * Prepend a name to the list of icons from within @icon.
30469 * Note that doing so invalidates the hash computed by prior calls
30470 * to g_icon_hash().
30478 * g_threaded_socket_service_new:
30479 * @max_threads: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
30481 * Creates a new #GThreadedSocketService with no listeners. Listeners
30482 * must be added with one of the #GSocketListener "add" methods.
30484 * Returns: a new #GSocketService.
30490 * g_tls_backend_get_certificate_type:
30491 * @backend: the #GTlsBackend
30493 * Gets the #GType of @backend's #GTlsCertificate implementation.
30495 * Returns: the #GType of @backend's #GTlsCertificate implementation.
30501 * g_tls_backend_get_client_connection_type:
30502 * @backend: the #GTlsBackend
30504 * Gets the #GType of @backend's #GTlsClientConnection implementation.
30506 * Returns: the #GType of @backend's #GTlsClientConnection implementation.
30512 * g_tls_backend_get_default:
30514 * Gets the default #GTlsBackend for the system.
30516 * Returns: (transfer none): a #GTlsBackend
30522 * g_tls_backend_get_default_database:
30523 * @backend: the #GTlsBackend
30525 * Gets the default #GTlsDatabase used to verify TLS connections.
30527 * Returns: (transfer full): the default database, which should be unreffed when done.
30533 * g_tls_backend_get_file_database_type:
30534 * @backend: the #GTlsBackend
30536 * Gets the #GType of @backend's #GTlsFileDatabase implementation.
30538 * Returns: the #GType of backend's #GTlsFileDatabase implementation.
30544 * g_tls_backend_get_server_connection_type:
30545 * @backend: the #GTlsBackend
30547 * Gets the #GType of @backend's #GTlsServerConnection implementation.
30549 * Returns: the #GType of @backend's #GTlsServerConnection implementation.
30555 * g_tls_backend_supports_tls:
30556 * @backend: the #GTlsBackend
30558 * Checks if TLS is supported; if this returns %FALSE for the default
30559 * #GTlsBackend, it means no "real" TLS backend is available.
30561 * Returns: whether or not TLS is supported
30567 * g_tls_certificate_get_issuer:
30568 * @cert: a #GTlsCertificate
30570 * Gets the #GTlsCertificate representing @cert's issuer, if known
30572 * Returns: (transfer none): The certificate of @cert's issuer, or %NULL if @cert is self-signed or signed with an unknown certificate.
30578 * g_tls_certificate_is_same:
30579 * @cert_one: first certificate to compare
30580 * @cert_two: second certificate to compare
30582 * Check if two #GTlsCertificate objects represent the same certificate.
30583 * The raw DER byte data of the two certificates are checked for equality.
30584 * This has the effect that two certificates may compare equal even if
30585 * their #GTlsCertificate:issuer, #GTlsCertificate:private-key, or
30586 * #GTlsCertificate:private-key-pem properties differ.
30588 * Returns: whether the same or not
30594 * g_tls_certificate_list_new_from_file:
30595 * @file: file containing PEM-encoded certificates to import
30596 * @error: #GError for error reporting, or %NULL to ignore.
30598 * Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
30599 * data in @file. If @file cannot be read or parsed, the function will
30600 * return %NULL and set @error. If @file does not contain any
30601 * PEM-encoded certificates, this will return an empty list and not
30604 * 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.
30610 * g_tls_certificate_new_from_file:
30611 * @file: file containing a PEM-encoded certificate to import
30612 * @error: #GError for error reporting, or %NULL to ignore.
30614 * Creates a #GTlsCertificate from the PEM-encoded data in @file. If
30615 * @file cannot be read or parsed, the function will return %NULL and
30616 * set @error. Otherwise, this behaves like
30617 * g_tls_certificate_new_from_pem().
30619 * Returns: the new certificate, or %NULL on error
30625 * g_tls_certificate_new_from_files:
30626 * @cert_file: file containing a PEM-encoded certificate to import
30627 * @key_file: file containing a PEM-encoded private key to import
30628 * @error: #GError for error reporting, or %NULL to ignore.
30630 * Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
30631 * and @key_file. If either file cannot be read or parsed, the
30632 * function will return %NULL and set @error. Otherwise, this behaves
30633 * like g_tls_certificate_new_from_pem().
30635 * Returns: the new certificate, or %NULL on error
30641 * g_tls_certificate_new_from_pem:
30642 * @data: PEM-encoded certificate data
30643 * @length: the length of @data, or -1 if it's 0-terminated.
30644 * @error: #GError for error reporting, or %NULL to ignore.
30646 * Creates a new #GTlsCertificate from the PEM-encoded data in @data.
30647 * If @data includes both a certificate and a private key, then the
30648 * returned certificate will include the private key data as well. (See
30649 * the #GTlsCertificate:private-key-pem property for information about
30650 * supported formats.)
30652 * If @data includes multiple certificates, only the first one will be
30655 * Returns: the new certificate, or %NULL if @data is invalid
30661 * g_tls_certificate_verify:
30662 * @cert: a #GTlsCertificate
30663 * @identity: (allow-none): the expected peer identity
30664 * @trusted_ca: (allow-none): the certificate of a trusted authority
30666 * This verifies @cert and returns a set of #GTlsCertificateFlags
30667 * indicating any problems found with it. This can be used to verify a
30668 * certificate outside the context of making a connection, or to
30669 * check a certificate against a CA that is not part of the system
30672 * If @identity is not %NULL, @cert's name(s) will be compared against
30673 * it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
30674 * value if it does not match. If @identity is %NULL, that bit will
30675 * never be set in the return value.
30677 * If @trusted_ca is not %NULL, then @cert (or one of the certificates
30678 * in its chain) must be signed by it, or else
30679 * %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
30680 * @trusted_ca is %NULL, that bit will never be set in the return
30683 * (All other #GTlsCertificateFlags values will always be set or unset
30686 * Returns: the appropriate #GTlsCertificateFlags
30692 * g_tls_client_connection_get_accepted_cas:
30693 * @conn: the #GTlsClientConnection
30695 * Gets the list of distinguished names of the Certificate Authorities
30696 * that the server will accept certificates from. This will be set
30697 * during the TLS handshake if the server requests a certificate.
30698 * Otherwise, it will be %NULL.
30700 * Each item in the list is a #GByteArray which contains the complete
30701 * subject DN of the certificate authority.
30703 * 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().
30709 * g_tls_client_connection_get_server_identity:
30710 * @conn: the #GTlsClientConnection
30712 * Gets @conn's expected server identity
30714 * Returns: (transfer none): a #GSocketConnectable describing the expected server identity, or %NULL if the expected identity is not known.
30720 * g_tls_client_connection_get_use_ssl3:
30721 * @conn: the #GTlsClientConnection
30723 * Gets whether @conn will use SSL 3.0 rather than the
30724 * highest-supported version of TLS; see
30725 * g_tls_client_connection_set_use_ssl3().
30727 * Returns: whether @conn will use SSL 3.0
30733 * g_tls_client_connection_get_validation_flags:
30734 * @conn: the #GTlsClientConnection
30736 * Gets @conn's validation flags
30738 * Returns: the validation flags
30744 * g_tls_client_connection_new:
30745 * @base_io_stream: the #GIOStream to wrap
30746 * @server_identity: (allow-none): the expected identity of the server
30747 * @error: #GError for error reporting, or %NULL to ignore.
30749 * Creates a new #GTlsClientConnection wrapping @base_io_stream (which
30750 * must have pollable input and output streams) which is assumed to
30751 * communicate with the server identified by @server_identity.
30753 * Returns: (transfer full) (type GTlsClientConnection): the new #GTlsClientConnection, or %NULL on error
30759 * g_tls_client_connection_set_server_identity:
30760 * @conn: the #GTlsClientConnection
30761 * @identity: a #GSocketConnectable describing the expected server identity
30763 * Sets @conn's expected server identity, which is used both to tell
30764 * servers on virtual hosts which certificate to present, and also
30765 * to let @conn know what name to look for in the certificate when
30766 * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
30773 * g_tls_client_connection_set_use_ssl3:
30774 * @conn: the #GTlsClientConnection
30775 * @use_ssl3: whether to use SSL 3.0
30777 * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
30778 * trying to properly negotiate the right version of TLS or SSL to use.
30779 * This can be used when talking to servers that do not implement the
30780 * fallbacks correctly and which will therefore fail to handshake with
30781 * a "modern" TLS handshake attempt.
30788 * g_tls_client_connection_set_validation_flags:
30789 * @conn: the #GTlsClientConnection
30790 * @flags: the #GTlsCertificateFlags to use
30792 * Sets @conn's validation flags, to override the default set of
30793 * checks performed when validating a server certificate. By default,
30794 * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
30801 * g_tls_connection_emit_accept_certificate:
30802 * @conn: a #GTlsConnection
30803 * @peer_cert: the peer's #GTlsCertificate
30804 * @errors: the problems with @peer_cert
30806 * Used by #GTlsConnection implementations to emit the
30807 * #GTlsConnection::accept-certificate signal.
30809 * Returns: %TRUE if one of the signal handlers has returned %TRUE to accept @peer_cert
30815 * g_tls_connection_get_certificate:
30816 * @conn: a #GTlsConnection
30818 * Gets @conn's certificate, as set by
30819 * g_tls_connection_set_certificate().
30821 * Returns: (transfer none): @conn's certificate, or %NULL
30827 * g_tls_connection_get_database:
30828 * @conn: a #GTlsConnection
30830 * Gets the certificate database that @conn uses to verify
30831 * peer certificates. See g_tls_connection_set_database().
30833 * Returns: (transfer none): the certificate database that @conn uses or %NULL
30839 * g_tls_connection_get_interaction:
30840 * @conn: a connection
30842 * Get the object that will be used to interact with the user. It will be used
30843 * for things like prompting the user for passwords. If %NULL is returned, then
30844 * no user interaction will occur for this connection.
30846 * Returns: (transfer none): The interaction object.
30852 * g_tls_connection_get_peer_certificate:
30853 * @conn: a #GTlsConnection
30855 * Gets @conn's peer's certificate after the handshake has completed.
30856 * (It is not set during the emission of
30857 * #GTlsConnection::accept-certificate.)
30859 * Returns: (transfer none): @conn's peer's certificate, or %NULL
30865 * g_tls_connection_get_peer_certificate_errors:
30866 * @conn: a #GTlsConnection
30868 * Gets the errors associated with validating @conn's peer's
30869 * certificate, after the handshake has completed. (It is not set
30870 * during the emission of #GTlsConnection::accept-certificate.)
30872 * Returns: @conn's peer's certificate errors
30878 * g_tls_connection_get_rehandshake_mode:
30879 * @conn: a #GTlsConnection
30881 * Gets @conn rehandshaking mode. See
30882 * g_tls_connection_set_rehandshake_mode() for details.
30884 * Returns: @conn's rehandshaking mode
30890 * g_tls_connection_get_require_close_notify:
30891 * @conn: a #GTlsConnection
30893 * Tests whether or not @conn expects a proper TLS close notification
30894 * when the connection is closed. See
30895 * g_tls_connection_set_require_close_notify() for details.
30897 * Returns: %TRUE if @conn requires a proper TLS close notification.
30903 * g_tls_connection_get_use_system_certdb:
30904 * @conn: a #GTlsConnection
30906 * Gets whether @conn uses the system certificate database to verify
30907 * peer certificates. See g_tls_connection_set_use_system_certdb().
30909 * Returns: whether @conn uses the system certificate database
30910 * Deprecated: 2.30: Use g_tls_connection_get_database() instead
30915 * g_tls_connection_handshake:
30916 * @conn: a #GTlsConnection
30917 * @cancellable: (allow-none): a #GCancellable, or %NULL
30918 * @error: a #GError, or %NULL
30920 * Attempts a TLS handshake on @conn.
30922 * On the client side, it is never necessary to call this method;
30923 * although the connection needs to perform a handshake after
30924 * connecting (or after sending a "STARTTLS"-type command) and may
30925 * need to rehandshake later if the server requests it,
30926 * #GTlsConnection will handle this for you automatically when you try
30927 * to send or receive data on the connection. However, you can call
30928 * g_tls_connection_handshake() manually if you want to know for sure
30929 * whether the initial handshake succeeded or failed (as opposed to
30930 * just immediately trying to write to @conn's output stream, in which
30931 * case if it fails, it may not be possible to tell if it failed
30932 * before or after completing the handshake).
30934 * Likewise, on the server side, although a handshake is necessary at
30935 * the beginning of the communication, you do not need to call this
30936 * function explicitly unless you want clearer error reporting.
30937 * However, you may call g_tls_connection_handshake() later on to
30938 * renegotiate parameters (encryption methods, etc) with the client.
30940 * #GTlsConnection::accept_certificate may be emitted during the
30943 * Returns: success or failure
30949 * g_tls_connection_handshake_async:
30950 * @conn: a #GTlsConnection
30951 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
30952 * @cancellable: (allow-none): a #GCancellable, or %NULL
30953 * @callback: callback to call when the handshake is complete
30954 * @user_data: the data to pass to the callback function
30956 * Asynchronously performs a TLS handshake on @conn. See
30957 * g_tls_connection_handshake() for more information.
30964 * g_tls_connection_handshake_finish:
30965 * @conn: a #GTlsConnection
30966 * @result: a #GAsyncResult.
30967 * @error: a #GError pointer, or %NULL
30969 * Finish an asynchronous TLS handshake operation. See
30970 * g_tls_connection_handshake() for more information.
30972 * Returns: %TRUE on success, %FALSE on failure, in which case @error will be set.
30978 * g_tls_connection_set_certificate:
30979 * @conn: a #GTlsConnection
30980 * @certificate: the certificate to use for @conn
30982 * This sets the certificate that @conn will present to its peer
30983 * during the TLS handshake. For a #GTlsServerConnection, it is
30984 * mandatory to set this, and that will normally be done at construct
30987 * For a #GTlsClientConnection, this is optional. If a handshake fails
30988 * with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
30989 * requires a certificate, and if you try connecting again, you should
30990 * call this method first. You can call
30991 * g_tls_client_connection_get_accepted_cas() on the failed connection
30992 * to get a list of Certificate Authorities that the server will
30993 * accept certificates from.
30995 * (It is also possible that a server will allow the connection with
30996 * or without a certificate; in that case, if you don't provide a
30997 * certificate, you can tell that the server requested one by the fact
30998 * that g_tls_client_connection_get_accepted_cas() will return
31006 * g_tls_connection_set_database:
31007 * @conn: a #GTlsConnection
31008 * @database: a #GTlsDatabase
31010 * Sets the certificate database that is used to verify peer certificates.
31011 * This is set to the default database by default. See
31012 * g_tls_backend_get_default_database(). If set to %NULL, then
31013 * peer certificate validation will always set the
31014 * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
31015 * #GTlsConnection::accept-certificate will always be emitted on
31016 * client-side connections, unless that bit is not set in
31017 * #GTlsClientConnection:validation-flags).
31024 * g_tls_connection_set_interaction:
31025 * @conn: a connection
31026 * @interaction: (allow-none): an interaction object, or %NULL
31028 * Set the object that will be used to interact with the user. It will be used
31029 * for things like prompting the user for passwords.
31031 * The @interaction argument will normally be a derived subclass of
31032 * #GTlsInteraction. %NULL can also be provided if no user interaction
31033 * should occur for this connection.
31040 * g_tls_connection_set_rehandshake_mode:
31041 * @conn: a #GTlsConnection
31042 * @mode: the rehandshaking mode
31044 * Sets how @conn behaves with respect to rehandshaking requests.
31046 * %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
31047 * rehandshake after the initial handshake is complete. (For a client,
31048 * this means it will refuse rehandshake requests from the server, and
31049 * for a server, this means it will close the connection with an error
31050 * if the client attempts to rehandshake.)
31052 * %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
31053 * rehandshake only if the other end of the connection supports the
31054 * TLS <literal>renegotiation_info</literal> extension. This is the
31055 * default behavior, but means that rehandshaking will not work
31056 * against older implementations that do not support that extension.
31058 * %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
31059 * rehandshaking even without the
31060 * <literal>renegotiation_info</literal> extension. On the server side
31061 * in particular, this is not recommended, since it leaves the server
31062 * open to certain attacks. However, this mode is necessary if you
31063 * need to allow renegotiation with older client software.
31070 * g_tls_connection_set_require_close_notify:
31071 * @conn: a #GTlsConnection
31072 * @require_close_notify: whether or not to require close notification
31074 * Sets whether or not @conn expects a proper TLS close notification
31075 * before the connection is closed. If this is %TRUE (the default),
31076 * then @conn will expect to receive a TLS close notification from its
31077 * peer before the connection is closed, and will return a
31078 * %G_TLS_ERROR_EOF error if the connection is closed without proper
31079 * notification (since this may indicate a network error, or
31080 * man-in-the-middle attack).
31082 * In some protocols, the application will know whether or not the
31083 * connection was closed cleanly based on application-level data
31084 * (because the application-level data includes a length field, or is
31085 * somehow self-delimiting); in this case, the close notify is
31086 * redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
31087 * in TLS 1.0 it is technically an error, but often done anyway.) You
31088 * can use g_tls_connection_set_require_close_notify() to tell @conn
31089 * to allow an "unannounced" connection close, in which case the close
31090 * will show up as a 0-length read, as in a non-TLS
31091 * #GSocketConnection, and it is up to the application to check that
31092 * the data has been fully received.
31094 * Note that this only affects the behavior when the peer closes the
31095 * connection; when the application calls g_io_stream_close() itself
31096 * on @conn, this will send a close notification regardless of the
31097 * setting of this property. If you explicitly want to do an unclean
31098 * close, you can close @conn's #GTlsConnection:base-io-stream rather
31099 * than closing @conn itself.
31106 * g_tls_connection_set_use_system_certdb:
31107 * @conn: a #GTlsConnection
31108 * @use_system_certdb: whether to use the system certificate database
31110 * Sets whether @conn uses the system certificate database to verify
31111 * peer certificates. This is %TRUE by default. If set to %FALSE, then
31112 * peer certificate validation will always set the
31113 * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
31114 * #GTlsConnection::accept-certificate will always be emitted on
31115 * client-side connections, unless that bit is not set in
31116 * #GTlsClientConnection:validation-flags).
31118 * Deprecated: 2.30: Use g_tls_connection_set_database() instead
31123 * g_tls_database_create_certificate_handle:
31124 * @self: a #GTlsDatabase
31125 * @certificate: certificate for which to create a handle.
31127 * Create a handle string for the certificate. The database will only be able
31128 * to create a handle for certificates that originate from the database. In
31129 * cases where the database cannot create a handle for a certificate, %NULL
31130 * will be returned.
31132 * This handle should be stable across various instances of the application,
31133 * and between applications. If a certificate is modified in the database,
31134 * then it is not guaranteed that this handle will continue to point to it.
31136 * Returns: (allow-none): a newly allocated string containing the handle.
31142 * g_tls_database_lookup_certificate_for_handle:
31143 * @self: a #GTlsDatabase
31144 * @handle: a certificate handle
31145 * @interaction: (allow-none): used to interact with the user if necessary
31146 * @flags: Flags which affect the lookup.
31147 * @cancellable: (allow-none): a #GCancellable, or %NULL
31148 * @error: (allow-none): a #GError, or %NULL
31150 * Lookup a certificate by its handle.
31152 * The handle should have been created by calling
31153 * g_tls_database_create_certificate_handle() on a #GTlsDatabase object of
31154 * the same TLS backend. The handle is designed to remain valid across
31155 * instantiations of the database.
31157 * If the handle is no longer valid, or does not point to a certificate in
31158 * this database, then %NULL will be returned.
31160 * This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
31161 * the lookup operation asynchronously.
31163 * Returns: (transfer full) (allow-none): a newly allocated #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31169 * g_tls_database_lookup_certificate_for_handle_async:
31170 * @self: a #GTlsDatabase
31171 * @handle: a certificate handle
31172 * @interaction: (allow-none): used to interact with the user if necessary
31173 * @flags: Flags which affect the lookup.
31174 * @cancellable: (allow-none): a #GCancellable, or %NULL
31175 * @callback: callback to call when the operation completes
31176 * @user_data: the data to pass to the callback function
31178 * Asynchronously lookup a certificate by its handle in the database. See
31179 * g_tls_database_lookup_certificate_for_handle() for more information.
31186 * g_tls_database_lookup_certificate_for_handle_finish:
31187 * @self: a #GTlsDatabase
31188 * @result: a #GAsyncResult.
31189 * @error: a #GError pointer, or %NULL
31191 * Finish an asynchronous lookup of a certificate by its handle. See
31192 * g_tls_database_lookup_certificate_handle() for more information.
31194 * If the handle is no longer valid, or does not point to a certificate in
31195 * this database, then %NULL will be returned.
31197 * Returns: (transfer full): a newly allocated #GTlsCertificate object. Use g_object_unref() to release the certificate.
31203 * g_tls_database_lookup_certificate_issuer:
31204 * @self: a #GTlsDatabase
31205 * @certificate: a #GTlsCertificate
31206 * @interaction: (allow-none): used to interact with the user if necessary
31207 * @flags: flags which affect the lookup operation
31208 * @cancellable: (allow-none): a #GCancellable, or %NULL
31209 * @error: (allow-none): a #GError, or %NULL
31211 * Lookup the issuer of @certificate in the database.
31213 * The %issuer property
31214 * of @certificate is not modified, and the two certificates are not hooked
31217 * This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
31218 * the lookup operation asynchronously.
31220 * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31226 * g_tls_database_lookup_certificate_issuer_async:
31227 * @self: a #GTlsDatabase
31228 * @certificate: a #GTlsCertificate
31229 * @interaction: (allow-none): used to interact with the user if necessary
31230 * @flags: flags which affect the lookup operation
31231 * @cancellable: (allow-none): a #GCancellable, or %NULL
31232 * @callback: callback to call when the operation completes
31233 * @user_data: the data to pass to the callback function
31235 * Asynchronously lookup the issuer of @certificate in the database. See
31236 * g_tls_database_lookup_certificate_issuer() for more information.
31243 * g_tls_database_lookup_certificate_issuer_finish:
31244 * @self: a #GTlsDatabase
31245 * @result: a #GAsyncResult.
31246 * @error: a #GError pointer, or %NULL
31248 * Finish an asynchronous lookup issuer operation. See
31249 * g_tls_database_lookup_certificate_issuer() for more information.
31251 * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31257 * g_tls_database_lookup_certificates_issued_by:
31258 * @self: a #GTlsDatabase
31259 * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
31260 * @interaction: (allow-none): used to interact with the user if necessary
31261 * @flags: Flags which affect the lookup operation.
31262 * @cancellable: (allow-none): a #GCancellable, or %NULL
31263 * @error: (allow-none): a #GError, or %NULL
31265 * Lookup certificates issued by this issuer in the database.
31267 * This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
31268 * the lookup operation asynchronously.
31270 * 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.
31276 * g_tls_database_lookup_certificates_issued_by_async:
31277 * @self: a #GTlsDatabase
31278 * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
31279 * @interaction: (allow-none): used to interact with the user if necessary
31280 * @flags: Flags which affect the lookup operation.
31281 * @cancellable: (allow-none): a #GCancellable, or %NULL
31282 * @callback: callback to call when the operation completes
31283 * @user_data: the data to pass to the callback function
31285 * Asynchronously lookup certificates issued by this issuer in the database. See
31286 * g_tls_database_lookup_certificates_issued_by() for more information.
31288 * The database may choose to hold a reference to the issuer byte array for the duration
31289 * of of this asynchronous operation. The byte array should not be modified during
31297 * g_tls_database_lookup_certificates_issued_by_finish:
31298 * @self: a #GTlsDatabase
31299 * @result: a #GAsyncResult.
31300 * @error: a #GError pointer, or %NULL
31302 * Finish an asynchronous lookup of certificates. See
31303 * g_tls_database_lookup_certificates_issued_by() for more information.
31305 * Returns: (transfer full): a newly allocated list of #GTlsCertificate objects. Use g_object_unref() on each certificate, and g_list_free() on the release the list.
31311 * g_tls_database_verify_chain:
31312 * @self: a #GTlsDatabase
31313 * @chain: a #GTlsCertificate chain
31314 * @purpose: the purpose that this certificate chain will be used for.
31315 * @identity: (allow-none): the expected peer identity
31316 * @interaction: (allow-none): used to interact with the user if necessary
31317 * @flags: additional verify flags
31318 * @cancellable: (allow-none): a #GCancellable, or %NULL
31319 * @error: (allow-none): a #GError, or %NULL
31321 * Verify's a certificate chain after looking up and adding any missing
31322 * certificates to the chain.
31324 * @chain is a chain of #GTlsCertificate objects each pointing to the next
31325 * certificate in the chain by its %issuer property. The chain may initially
31326 * consist of one or more certificates. After the verification process is
31327 * complete, @chain may be modified by adding missing certificates, or removing
31328 * extra certificates. If a certificate anchor was found, then it is added to
31331 * @purpose describes the purpose (or usage) for which the certificate
31332 * is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
31333 * which means that the certificate is being used to authenticate a server
31334 * (and we are acting as the client).
31336 * The @identity is used to check for pinned certificates (trust exceptions)
31337 * in the database. These will override the normal verification process on a
31338 * host by host basis.
31340 * Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
31343 * This function can block, use g_tls_database_verify_chain_async() to perform
31344 * the verification operation asynchronously.
31346 * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31352 * g_tls_database_verify_chain_async:
31353 * @self: a #GTlsDatabase
31354 * @chain: a #GTlsCertificate chain
31355 * @purpose: the purpose that this certificate chain will be used for.
31356 * @identity: (allow-none): the expected peer identity
31357 * @interaction: (allow-none): used to interact with the user if necessary
31358 * @flags: additional verify flags
31359 * @cancellable: (allow-none): a #GCancellable, or %NULL
31360 * @callback: callback to call when the operation completes
31361 * @user_data: the data to pass to the callback function
31363 * Asynchronously verify's a certificate chain after looking up and adding
31364 * any missing certificates to the chain. See g_tls_database_verify_chain()
31365 * for more information.
31372 * g_tls_database_verify_chain_finish:
31373 * @self: a #GTlsDatabase
31374 * @result: a #GAsyncResult.
31375 * @error: a #GError pointer, or %NULL
31377 * Finish an asynchronous verify chain operation. See
31378 * g_tls_database_verify_chain() for more information. *
31380 * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31386 * g_tls_error_quark:
31388 * Gets the TLS error quark.
31390 * Returns: a #GQuark.
31396 * g_tls_file_database_new:
31397 * @anchors: filename of anchor certificate authorities.
31398 * @error: #GError for error reporting, or %NULL to ignore.
31400 * Creates a new #GTlsFileDatabase which uses anchor certificate authorities
31401 * in @anchors to verify certificate chains.
31403 * The certificates in @anchors must be PEM encoded.
31405 * Returns: (transfer full) (type GTlsFileDatabase): the new #GTlsFileDatabase, or %NULL on error
31411 * g_tls_interaction_ask_password:
31412 * @interaction: a #GTlsInteraction object
31413 * @password: a #GTlsPassword object
31414 * @cancellable: an optional #GCancellable cancellation object
31415 * @error: an optional location to place an error on failure
31417 * Run synchronous interaction to ask the user for a password. In general,
31418 * g_tls_interaction_invoke_ask_password() should be used instead of this
31421 * Derived subclasses usually implement a password prompt, although they may
31422 * also choose to provide a password from elsewhere. The @password value will
31423 * be filled in and then @callback will be called. Alternatively the user may
31424 * abort this password request, which will usually abort the TLS connection.
31426 * If the interaction is cancelled by the cancellation object, or by the
31427 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31428 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31429 * not support immediate cancellation.
31431 * Returns: The status of the ask password interaction.
31437 * g_tls_interaction_ask_password_async:
31438 * @interaction: a #GTlsInteraction object
31439 * @password: a #GTlsPassword object
31440 * @cancellable: an optional #GCancellable cancellation object
31441 * @callback: (allow-none): will be called when the interaction completes
31442 * @user_data: (allow-none): data to pass to the @callback
31444 * Run asynchronous interaction to ask the user for a password. In general,
31445 * g_tls_interaction_invoke_ask_password() should be used instead of this
31448 * Derived subclasses usually implement a password prompt, although they may
31449 * also choose to provide a password from elsewhere. The @password value will
31450 * be filled in and then @callback will be called. Alternatively the user may
31451 * abort this password request, which will usually abort the TLS connection.
31453 * If the interaction is cancelled by the cancellation object, or by the
31454 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31455 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31456 * not support immediate cancellation.
31458 * Certain implementations may not support immediate cancellation.
31465 * g_tls_interaction_ask_password_finish:
31466 * @interaction: a #GTlsInteraction object
31467 * @result: the result passed to the callback
31468 * @error: an optional location to place an error on failure
31470 * Complete an ask password user interaction request. This should be once
31471 * the g_tls_interaction_ask_password_async() completion callback is called.
31473 * If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
31474 * to g_tls_interaction_ask_password() will have its password filled in.
31476 * If the interaction is cancelled by the cancellation object, or by the
31477 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31478 * contains a %G_IO_ERROR_CANCELLED error code.
31480 * Returns: The status of the ask password interaction.
31486 * g_tls_interaction_invoke_ask_password:
31487 * @interaction: a #GTlsInteraction object
31488 * @password: a #GTlsPassword object
31489 * @cancellable: an optional #GCancellable cancellation object
31490 * @error: an optional location to place an error on failure
31492 * Invoke the interaction to ask the user for a password. It invokes this
31493 * interaction in the main loop, specifically the #GMainContext returned by
31494 * g_main_context_get_thread_default() when the interaction is created. This
31495 * is called by called by #GTlsConnection or #GTlsDatabase to ask the user
31498 * Derived subclasses usually implement a password prompt, although they may
31499 * also choose to provide a password from elsewhere. The @password value will
31500 * be filled in and then @callback will be called. Alternatively the user may
31501 * abort this password request, which will usually abort the TLS connection.
31503 * The implementation can either be a synchronous (eg: modal dialog) or an
31504 * asynchronous one (eg: modeless dialog). This function will take care of
31505 * calling which ever one correctly.
31507 * If the interaction is cancelled by the cancellation object, or by the
31508 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31509 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31510 * not support immediate cancellation.
31512 * Returns: The status of the ask password interaction.
31518 * g_tls_password_get_description:
31519 * @password: a #GTlsPassword object
31521 * Get a description string about what the password will be used for.
31523 * Returns: The description of the password.
31529 * g_tls_password_get_flags:
31530 * @password: a #GTlsPassword object
31532 * Get flags about the password.
31534 * Returns: The flags about the password.
31540 * g_tls_password_get_value:
31541 * @password: a #GTlsPassword object
31542 * @length: (allow-none): location to place the length of the password.
31544 * Get the password value. If @length is not %NULL then it will be
31545 * filled in with the length of the password value. (Note that the
31546 * password value is not nul-terminated, so you can only pass %NULL
31547 * for @length in contexts where you know the password will have a
31548 * certain fixed length.)
31550 * Returns: The password value (owned by the password object).
31556 * g_tls_password_get_warning:
31557 * @password: a #GTlsPassword object
31559 * Get a user readable translated warning. Usually this warning is a
31560 * representation of the password flags returned from
31561 * g_tls_password_get_flags().
31563 * Returns: The warning.
31569 * g_tls_password_new:
31570 * @flags: the password flags
31571 * @description: description of what the password is for
31573 * Create a new #GTlsPassword object.
31575 * Returns: (transfer full): The newly allocated password object
31580 * g_tls_password_set_description:
31581 * @password: a #GTlsPassword object
31582 * @description: The description of the password
31584 * Set a description string about what the password will be used for.
31591 * g_tls_password_set_flags:
31592 * @password: a #GTlsPassword object
31593 * @flags: The flags about the password
31595 * Set flags about the password.
31602 * g_tls_password_set_value:
31603 * @password: a #GTlsPassword object
31604 * @value: the new password value
31605 * @length: the length of the password, or -1
31607 * Set the value for this password. The @value will be copied by the password
31610 * Specify the @length, for a non-nul-terminated password. Pass -1 as
31611 * @length if using a nul-terminated password, and @length will be
31612 * calculated automatically. (Note that the terminating nul is not
31613 * considered part of the password in this case.)
31620 * g_tls_password_set_value_full:
31621 * @password: a #GTlsPassword object
31622 * @value: the value for the password
31623 * @length: the length of the password, or -1
31624 * @destroy: (allow-none): a function to use to free the password.
31626 * Provide the value for this password.
31628 * The @value will be owned by the password object, and later freed using
31629 * the @destroy function callback.
31631 * Specify the @length, for a non-nul-terminated password. Pass -1 as
31632 * @length if using a nul-terminated password, and @length will be
31633 * calculated automatically. (Note that the terminating nul is not
31634 * considered part of the password in this case.)
31636 * Virtual: set_value
31642 * g_tls_password_set_warning:
31643 * @password: a #GTlsPassword object
31644 * @warning: The user readable warning
31646 * Set a user readable translated warning. Usually this warning is a
31647 * representation of the password flags returned from
31648 * g_tls_password_get_flags().
31655 * g_tls_server_connection_new:
31656 * @base_io_stream: the #GIOStream to wrap
31657 * @certificate: (allow-none): the default server certificate, or %NULL
31658 * @error: #GError for error reporting, or %NULL to ignore.
31660 * Creates a new #GTlsServerConnection wrapping @base_io_stream (which
31661 * must have pollable input and output streams).
31663 * Returns: (transfer full) (type GTlsServerConnection): the new #GTlsServerConnection, or %NULL on error
31669 * g_unix_connection_receive_credentials:
31670 * @connection: A #GUnixConnection.
31671 * @cancellable: (allow-none): A #GCancellable or %NULL.
31672 * @error: Return location for error or %NULL.
31674 * Receives credentials from the sending end of the connection. The
31675 * sending end has to call g_unix_connection_send_credentials() (or
31676 * similar) for this to work.
31678 * As well as reading the credentials this also reads (and discards) a
31679 * single byte from the stream, as this is required for credentials
31680 * passing to work on some implementations.
31682 * Other ways to exchange credentials with a foreign peer includes the
31683 * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31685 * Returns: (transfer full): Received credentials on success (free with g_object_unref()), %NULL if @error is set.
31691 * g_unix_connection_receive_credentials_async:
31692 * @connection: A #GUnixConnection.
31693 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31694 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31695 * @user_data: (closure): the data to pass to callback function
31697 * Asynchronously receive credentials.
31699 * For more details, see g_unix_connection_receive_credentials() which is
31700 * the synchronous version of this call.
31702 * When the operation is finished, @callback will be called. You can then call
31703 * g_unix_connection_receive_credentials_finish() to get the result of the operation.
31710 * g_unix_connection_receive_credentials_finish:
31711 * @connection: A #GUnixConnection.
31712 * @result: a #GAsyncResult.
31713 * @error: a #GError, or %NULL
31715 * Finishes an asynchronous receive credentials operation started with
31716 * g_unix_connection_receive_credentials_async().
31718 * Returns: (transfer full): a #GCredentials, or %NULL on error. Free the returned object with g_object_unref().
31724 * g_unix_connection_receive_fd:
31725 * @connection: a #GUnixConnection
31726 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
31727 * @error: (allow-none): #GError for error reporting, or %NULL to ignore
31729 * Receives a file descriptor from the sending end of the connection.
31730 * The sending end has to call g_unix_connection_send_fd() for this
31733 * As well as reading the fd this also reads a single byte from the
31734 * stream, as this is required for fd passing to work on some
31737 * Returns: a file descriptor on success, -1 on error.
31743 * g_unix_connection_send_credentials:
31744 * @connection: A #GUnixConnection.
31745 * @cancellable: (allow-none): A #GCancellable or %NULL.
31746 * @error: Return location for error or %NULL.
31748 * Passes the credentials of the current user the receiving side
31749 * of the connection. The receiving end has to call
31750 * g_unix_connection_receive_credentials() (or similar) to accept the
31753 * As well as sending the credentials this also writes a single NUL
31754 * byte to the stream, as this is required for credentials passing to
31755 * work on some implementations.
31757 * Other ways to exchange credentials with a foreign peer includes the
31758 * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31760 * Returns: %TRUE on success, %FALSE if @error is set.
31766 * g_unix_connection_send_credentials_async:
31767 * @connection: A #GUnixConnection.
31768 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31769 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31770 * @user_data: (closure): the data to pass to callback function
31772 * Asynchronously send credentials.
31774 * For more details, see g_unix_connection_send_credentials() which is
31775 * the synchronous version of this call.
31777 * When the operation is finished, @callback will be called. You can then call
31778 * g_unix_connection_send_credentials_finish() to get the result of the operation.
31785 * g_unix_connection_send_credentials_finish:
31786 * @connection: A #GUnixConnection.
31787 * @result: a #GAsyncResult.
31788 * @error: a #GError, or %NULL
31790 * Finishes an asynchronous send credentials operation started with
31791 * g_unix_connection_send_credentials_async().
31793 * Returns: %TRUE if the operation was successful, otherwise %FALSE.
31799 * g_unix_connection_send_fd:
31800 * @connection: a #GUnixConnection
31801 * @fd: a file descriptor
31802 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31803 * @error: (allow-none): #GError for error reporting, or %NULL to ignore.
31805 * Passes a file descriptor to the receiving side of the
31806 * connection. The receiving end has to call g_unix_connection_receive_fd()
31807 * to accept the file descriptor.
31809 * As well as sending the fd this also writes a single byte to the
31810 * stream, as this is required for fd passing to work on some
31813 * Returns: a %TRUE on success, %NULL on error.
31819 * g_unix_credentials_message_get_credentials:
31820 * @message: A #GUnixCredentialsMessage.
31822 * Gets the credentials stored in @message.
31824 * Returns: (transfer none): A #GCredentials instance. Do not free, it is owned by @message.
31830 * g_unix_credentials_message_is_supported:
31832 * Checks if passing #GCredentials on a #GSocket is supported on this platform.
31834 * Returns: %TRUE if supported, %FALSE otherwise
31840 * g_unix_credentials_message_new:
31842 * Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
31844 * Returns: a new #GUnixCredentialsMessage
31850 * g_unix_credentials_message_new_with_credentials:
31851 * @credentials: A #GCredentials object.
31853 * Creates a new #GUnixCredentialsMessage holding @credentials.
31855 * Returns: a new #GUnixCredentialsMessage
31861 * g_unix_fd_list_append:
31862 * @list: a #GUnixFDList
31863 * @fd: a valid open file descriptor
31864 * @error: a #GError pointer
31866 * Adds a file descriptor to @list.
31868 * The file descriptor is duplicated using dup(). You keep your copy
31869 * of the descriptor and the copy contained in @list will be closed
31870 * when @list is finalized.
31872 * A possible cause of failure is exceeding the per-process or
31873 * system-wide file descriptor limit.
31875 * The index of the file descriptor in the list is returned. If you use
31876 * this index with g_unix_fd_list_get() then you will receive back a
31877 * duplicated copy of the same file descriptor.
31879 * Returns: the index of the appended fd in case of success, else -1 (and @error is set)
31885 * g_unix_fd_list_get:
31886 * @list: a #GUnixFDList
31887 * @index_: the index into the list
31888 * @error: a #GError pointer
31890 * Gets a file descriptor out of @list.
31892 * @index_ specifies the index of the file descriptor to get. It is a
31893 * programmer error for @index_ to be out of range; see
31894 * g_unix_fd_list_get_length().
31896 * The file descriptor is duplicated using dup() and set as
31897 * close-on-exec before being returned. You must call close() on it
31898 * when you are done.
31900 * A possible cause of failure is exceeding the per-process or
31901 * system-wide file descriptor limit.
31903 * Returns: the file descriptor, or -1 in case of error
31909 * g_unix_fd_list_get_length:
31910 * @list: a #GUnixFDList
31912 * Gets the length of @list (ie: the number of file descriptors
31913 * contained within).
31915 * Returns: the length of @list
31921 * g_unix_fd_list_new:
31923 * Creates a new #GUnixFDList containing no file descriptors.
31925 * Returns: a new #GUnixFDList
31931 * g_unix_fd_list_new_from_array:
31932 * @fds: (array length=n_fds): the initial list of file descriptors
31933 * @n_fds: the length of #fds, or -1
31935 * Creates a new #GUnixFDList containing the file descriptors given in
31936 * @fds. The file descriptors become the property of the new list and
31937 * may no longer be used by the caller. The array itself is owned by
31940 * Each file descriptor in the array should be set to close-on-exec.
31942 * If @n_fds is -1 then @fds must be terminated with -1.
31944 * Returns: a new #GUnixFDList
31950 * g_unix_fd_list_peek_fds:
31951 * @list: a #GUnixFDList
31952 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
31954 * Returns the array of file descriptors that is contained in this
31957 * After this call, the descriptors remain the property of @list. The
31958 * caller must not close them and must not free the array. The array is
31959 * valid only until @list is changed in any way.
31961 * If @length is non-%NULL then it is set to the number of file
31962 * descriptors in the returned array. The returned array is also
31963 * terminated with -1.
31965 * This function never returns %NULL. In case there are no file
31966 * descriptors contained in @list, an empty array is returned.
31968 * Returns: (array length=length) (transfer none): an array of file descriptors
31974 * g_unix_fd_list_steal_fds:
31975 * @list: a #GUnixFDList
31976 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
31978 * Returns the array of file descriptors that is contained in this
31981 * After this call, the descriptors are no longer contained in
31982 * @list. Further calls will return an empty list (unless more
31983 * descriptors have been added).
31985 * The return result of this function must be freed with g_free().
31986 * The caller is also responsible for closing all of the file
31987 * descriptors. The file descriptors in the array are set to
31990 * If @length is non-%NULL then it is set to the number of file
31991 * descriptors in the returned array. The returned array is also
31992 * terminated with -1.
31994 * This function never returns %NULL. In case there are no file
31995 * descriptors contained in @list, an empty array is returned.
31997 * Returns: (array length=length) (transfer full): an array of file descriptors
32003 * g_unix_fd_message_append_fd:
32004 * @message: a #GUnixFDMessage
32005 * @fd: a valid open file descriptor
32006 * @error: a #GError pointer
32008 * Adds a file descriptor to @message.
32010 * The file descriptor is duplicated using dup(). You keep your copy
32011 * of the descriptor and the copy contained in @message will be closed
32012 * when @message is finalized.
32014 * A possible cause of failure is exceeding the per-process or
32015 * system-wide file descriptor limit.
32017 * Returns: %TRUE in case of success, else %FALSE (and @error is set)
32023 * g_unix_fd_message_get_fd_list:
32024 * @message: a #GUnixFDMessage
32026 * Gets the #GUnixFDList contained in @message. This function does not
32027 * return a reference to the caller, but the returned list is valid for
32028 * the lifetime of @message.
32030 * Returns: (transfer none): the #GUnixFDList from @message
32036 * g_unix_fd_message_new:
32038 * Creates a new #GUnixFDMessage containing an empty file descriptor
32041 * Returns: a new #GUnixFDMessage
32047 * g_unix_fd_message_new_with_fd_list:
32048 * @fd_list: a #GUnixFDList
32050 * Creates a new #GUnixFDMessage containing @list.
32052 * Returns: a new #GUnixFDMessage
32058 * g_unix_fd_message_steal_fds:
32059 * @message: a #GUnixFDMessage
32060 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32062 * Returns the array of file descriptors that is contained in this
32065 * After this call, the descriptors are no longer contained in
32066 * @message. Further calls will return an empty list (unless more
32067 * descriptors have been added).
32069 * The return result of this function must be freed with g_free().
32070 * The caller is also responsible for closing all of the file
32073 * If @length is non-%NULL then it is set to the number of file
32074 * descriptors in the returned array. The returned array is also
32075 * terminated with -1.
32077 * This function never returns %NULL. In case there are no file
32078 * descriptors contained in @message, an empty array is returned.
32080 * Returns: (array length=length) (transfer full): an array of file descriptors
32086 * g_unix_input_stream_get_close_fd:
32087 * @stream: a #GUnixInputStream
32089 * Returns whether the file descriptor of @stream will be
32090 * closed when the stream is closed.
32092 * Returns: %TRUE if the file descriptor is closed when done
32098 * g_unix_input_stream_get_fd:
32099 * @stream: a #GUnixInputStream
32101 * Return the UNIX file descriptor that the stream reads from.
32103 * Returns: The file descriptor of @stream
32109 * g_unix_input_stream_new:
32110 * @fd: a UNIX file descriptor
32111 * @close_fd: %TRUE to close the file descriptor when done
32113 * Creates a new #GUnixInputStream for the given @fd.
32115 * If @close_fd is %TRUE, the file descriptor will be closed
32116 * when the stream is closed.
32118 * Returns: a new #GUnixInputStream
32123 * g_unix_input_stream_set_close_fd:
32124 * @stream: a #GUnixInputStream
32125 * @close_fd: %TRUE to close the file descriptor when done
32127 * Sets whether the file descriptor of @stream shall be closed
32128 * when the stream is closed.
32135 * g_unix_is_mount_path_system_internal:
32136 * @mount_path: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
32138 * Determines if @mount_path is considered an implementation of the
32139 * OS. This is primarily used for hiding mountable and mounted volumes
32140 * that only are used in the OS and has little to no relevance to the
32143 * Returns: %TRUE if @mount_path is considered an implementation detail of the OS.
32148 * g_unix_mount_at: (skip)
32149 * @mount_path: path for a possible unix mount.
32150 * @time_read: (out) (allow-none): guint64 to contain a timestamp.
32152 * Gets a #GUnixMountEntry for a given mount path. If @time_read
32153 * is set, it will be filled with a unix timestamp for checking
32154 * if the mounts have changed since with g_unix_mounts_changed_since().
32156 * Returns: (transfer full): a #GUnixMountEntry.
32161 * g_unix_mount_compare:
32162 * @mount1: first #GUnixMountEntry to compare.
32163 * @mount2: second #GUnixMountEntry to compare.
32165 * Compares two unix mounts.
32167 * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
32172 * g_unix_mount_free:
32173 * @mount_entry: a #GUnixMountEntry.
32175 * Frees a unix mount.
32180 * g_unix_mount_get_device_path:
32181 * @mount_entry: a #GUnixMount.
32183 * Gets the device path for a unix mount.
32185 * Returns: a string containing the device path.
32190 * g_unix_mount_get_fs_type:
32191 * @mount_entry: a #GUnixMount.
32193 * Gets the filesystem type for the unix mount.
32195 * Returns: a string containing the file system type.
32200 * g_unix_mount_get_mount_path:
32201 * @mount_entry: input #GUnixMountEntry to get the mount path for.
32203 * Gets the mount path for a unix mount.
32205 * Returns: the mount path for @mount_entry.
32210 * g_unix_mount_guess_can_eject:
32211 * @mount_entry: a #GUnixMountEntry
32213 * Guesses whether a Unix mount can be ejected.
32215 * Returns: %TRUE if @mount_entry is deemed to be ejectable.
32220 * g_unix_mount_guess_icon:
32221 * @mount_entry: a #GUnixMountEntry
32223 * Guesses the icon of a Unix mount.
32225 * Returns: (transfer full): a #GIcon
32230 * g_unix_mount_guess_name:
32231 * @mount_entry: a #GUnixMountEntry
32233 * Guesses the name of a Unix mount.
32234 * The result is a translated string.
32236 * Returns: A newly allocated string that must be freed with g_free()
32241 * g_unix_mount_guess_should_display:
32242 * @mount_entry: a #GUnixMountEntry
32244 * Guesses whether a Unix mount should be displayed in the UI.
32246 * Returns: %TRUE if @mount_entry is deemed to be displayable.
32251 * g_unix_mount_guess_symbolic_icon:
32252 * @mount_entry: a #GUnixMountEntry
32254 * Guesses the symbolic icon of a Unix mount.
32256 * Returns: (transfer full): a #GIcon
32262 * g_unix_mount_is_readonly:
32263 * @mount_entry: a #GUnixMount.
32265 * Checks if a unix mount is mounted read only.
32267 * Returns: %TRUE if @mount_entry is read only.
32272 * g_unix_mount_is_system_internal:
32273 * @mount_entry: a #GUnixMount.
32275 * Checks if a unix mount is a system path.
32277 * Returns: %TRUE if the unix mount is for a system path.
32282 * g_unix_mount_monitor_new:
32284 * Gets a new #GUnixMountMonitor. The default rate limit for which the
32285 * monitor will report consecutive changes for the mount and mount
32286 * point entry files is the default for a #GFileMonitor. Use
32287 * g_unix_mount_monitor_set_rate_limit() to change this.
32289 * Returns: a #GUnixMountMonitor.
32294 * g_unix_mount_monitor_set_rate_limit:
32295 * @mount_monitor: a #GUnixMountMonitor
32296 * @limit_msec: a integer with the limit in milliseconds to poll for changes.
32298 * Sets the rate limit to which the @mount_monitor will report
32299 * consecutive change events to the mount and mount point entry files.
32306 * g_unix_mount_point_compare:
32307 * @mount1: a #GUnixMount.
32308 * @mount2: a #GUnixMount.
32310 * Compares two unix mount points.
32312 * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
32317 * g_unix_mount_point_free:
32318 * @mount_point: unix mount point to free.
32320 * Frees a unix mount point.
32325 * g_unix_mount_point_get_device_path:
32326 * @mount_point: a #GUnixMountPoint.
32328 * Gets the device path for a unix mount point.
32330 * Returns: a string containing the device path.
32335 * g_unix_mount_point_get_fs_type:
32336 * @mount_point: a #GUnixMountPoint.
32338 * Gets the file system type for the mount point.
32340 * Returns: a string containing the file system type.
32345 * g_unix_mount_point_get_mount_path:
32346 * @mount_point: a #GUnixMountPoint.
32348 * Gets the mount path for a unix mount point.
32350 * Returns: a string containing the mount path.
32355 * g_unix_mount_point_get_options:
32356 * @mount_point: a #GUnixMountPoint.
32358 * Gets the options for the mount point.
32360 * Returns: a string containing the options.
32366 * g_unix_mount_point_guess_can_eject:
32367 * @mount_point: a #GUnixMountPoint
32369 * Guesses whether a Unix mount point can be ejected.
32371 * Returns: %TRUE if @mount_point is deemed to be ejectable.
32376 * g_unix_mount_point_guess_icon:
32377 * @mount_point: a #GUnixMountPoint
32379 * Guesses the icon of a Unix mount point.
32381 * Returns: (transfer full): a #GIcon
32386 * g_unix_mount_point_guess_name:
32387 * @mount_point: a #GUnixMountPoint
32389 * Guesses the name of a Unix mount point.
32390 * The result is a translated string.
32392 * Returns: A newly allocated string that must be freed with g_free()
32397 * g_unix_mount_point_guess_symbolic_icon:
32399 * Guesses the symbolic icon of a Unix mount point.
32401 * Returns: (transfer full): a #GIcon
32407 * g_unix_mount_point_is_loopback:
32408 * @mount_point: a #GUnixMountPoint.
32410 * Checks if a unix mount point is a loopback device.
32412 * Returns: %TRUE if the mount point is a loopback. %FALSE otherwise.
32417 * g_unix_mount_point_is_readonly:
32418 * @mount_point: a #GUnixMountPoint.
32420 * Checks if a unix mount point is read only.
32422 * Returns: %TRUE if a mount point is read only.
32427 * g_unix_mount_point_is_user_mountable:
32428 * @mount_point: a #GUnixMountPoint.
32430 * Checks if a unix mount point is mountable by the user.
32432 * Returns: %TRUE if the mount point is user mountable.
32437 * g_unix_mount_points_changed_since:
32438 * @time: guint64 to contain a timestamp.
32440 * Checks if the unix mount points have changed since a given unix time.
32442 * Returns: %TRUE if the mount points have changed since @time.
32447 * g_unix_mount_points_get: (skip)
32448 * @time_read: (out) (allow-none): guint64 to contain a timestamp.
32450 * Gets a #GList of #GUnixMountPoint containing the unix mount points.
32451 * If @time_read is set, it will be filled with the mount timestamp,
32452 * allowing for checking if the mounts have changed with
32453 * g_unix_mount_points_changed_since().
32455 * Returns: (element-type GUnixMountPoint) (transfer full): a #GList of the UNIX mountpoints.
32460 * g_unix_mounts_changed_since:
32461 * @time: guint64 to contain a timestamp.
32463 * Checks if the unix mounts have changed since a given unix time.
32465 * Returns: %TRUE if the mounts have changed since @time.
32470 * g_unix_mounts_get: (skip)
32471 * @time_read: (out) (allow-none): guint64 to contain a timestamp, or %NULL
32473 * Gets a #GList of #GUnixMountEntry containing the unix mounts.
32474 * If @time_read is set, it will be filled with the mount
32475 * timestamp, allowing for checking if the mounts have changed
32476 * with g_unix_mounts_changed_since().
32478 * Returns: (element-type GUnixMountEntry) (transfer full): a #GList of the UNIX mounts.
32483 * g_unix_output_stream_get_close_fd:
32484 * @stream: a #GUnixOutputStream
32486 * Returns whether the file descriptor of @stream will be
32487 * closed when the stream is closed.
32489 * Returns: %TRUE if the file descriptor is closed when done
32495 * g_unix_output_stream_get_fd:
32496 * @stream: a #GUnixOutputStream
32498 * Return the UNIX file descriptor that the stream writes to.
32500 * Returns: The file descriptor of @stream
32506 * g_unix_output_stream_new:
32507 * @fd: a UNIX file descriptor
32508 * @close_fd: %TRUE to close the file descriptor when done
32510 * Creates a new #GUnixOutputStream for the given @fd.
32512 * If @close_fd, is %TRUE, the file descriptor will be closed when
32513 * the output stream is destroyed.
32515 * Returns: a new #GOutputStream
32520 * g_unix_output_stream_set_close_fd:
32521 * @stream: a #GUnixOutputStream
32522 * @close_fd: %TRUE to close the file descriptor when done
32524 * Sets whether the file descriptor of @stream shall be closed
32525 * when the stream is closed.
32532 * g_unix_socket_address_abstract_names_supported:
32534 * Checks if abstract UNIX domain socket names are supported.
32536 * Returns: %TRUE if supported, %FALSE otherwise
32542 * g_unix_socket_address_get_address_type:
32543 * @address: a #GInetSocketAddress
32545 * Gets @address's type.
32547 * Returns: a #GUnixSocketAddressType
32553 * g_unix_socket_address_get_is_abstract:
32554 * @address: a #GInetSocketAddress
32556 * Tests if @address is abstract.
32558 * Returns: %TRUE if the address is abstract, %FALSE otherwise
32560 * Deprecated: Use g_unix_socket_address_get_address_type()
32565 * g_unix_socket_address_get_path:
32566 * @address: a #GInetSocketAddress
32568 * Gets @address's path, or for abstract sockets the "name".
32570 * Guaranteed to be zero-terminated, but an abstract socket
32571 * may contain embedded zeros, and thus you should use
32572 * g_unix_socket_address_get_path_len() to get the true length
32575 * Returns: the path for @address
32581 * g_unix_socket_address_get_path_len:
32582 * @address: a #GInetSocketAddress
32584 * Gets the length of @address's path.
32586 * For details, see g_unix_socket_address_get_path().
32588 * Returns: the length of the path
32594 * g_unix_socket_address_new:
32595 * @path: the socket path
32597 * Creates a new #GUnixSocketAddress for @path.
32599 * To create abstract socket addresses, on systems that support that,
32600 * use g_unix_socket_address_new_abstract().
32602 * Returns: a new #GUnixSocketAddress
32608 * g_unix_socket_address_new_abstract:
32609 * @path: (array length=path_len) (element-type gchar): the abstract name
32610 * @path_len: the length of @path, or -1
32612 * Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
32613 * #GUnixSocketAddress for @path.
32615 * Returns: a new #GUnixSocketAddress
32616 * Deprecated: Use g_unix_socket_address_new_with_type().
32621 * g_unix_socket_address_new_with_type:
32622 * @path: (array length=path_len) (element-type gchar): the name
32623 * @path_len: the length of @path, or -1
32624 * @type: a #GUnixSocketAddressType
32626 * Creates a new #GUnixSocketAddress of type @type with name @path.
32628 * If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
32629 * calling g_unix_socket_address_new().
32631 * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
32632 * bytes of @path will be copied to the socket's path, and only those
32633 * bytes will be considered part of the name. (If @path_len is -1,
32634 * then @path is assumed to be NUL-terminated.) For example, if @path
32635 * was "test", then calling g_socket_address_get_native_size() on the
32636 * returned socket would return 7 (2 bytes of overhead, 1 byte for the
32637 * abstract-socket indicator byte, and 4 bytes for the name "test").
32639 * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
32640 * @path_len bytes of @path will be copied to the socket's path, the
32641 * rest of the path will be padded with 0 bytes, and the entire
32642 * zero-padded buffer will be considered the name. (As above, if
32643 * @path_len is -1, then @path is assumed to be NUL-terminated.) In
32644 * this case, g_socket_address_get_native_size() will always return
32645 * the full size of a <literal>struct sockaddr_un</literal>, although
32646 * g_unix_socket_address_get_path_len() will still return just the
32649 * %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
32650 * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
32651 * when connecting to a server created by another process, you must
32652 * use the appropriate type corresponding to how that process created
32653 * its listening socket.
32655 * Returns: a new #GUnixSocketAddress
32661 * g_vfs_get_default:
32663 * Gets the default #GVfs for the system.
32665 * Returns: (transfer none): a #GVfs.
32670 * g_vfs_get_file_for_path:
32672 * @path: a string containing a VFS path.
32674 * Gets a #GFile for @path.
32676 * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32681 * g_vfs_get_file_for_uri:
32683 * @uri: a string containing a URI
32685 * Gets a #GFile for @uri.
32687 * This operation never fails, but the returned object
32688 * might not support any I/O operation if the URI
32689 * is malformed or if the URI scheme is not supported.
32691 * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32698 * Gets the local #GVfs for the system.
32700 * Returns: (transfer none): a #GVfs.
32705 * g_vfs_get_supported_uri_schemes:
32708 * Gets a list of URI schemes supported by @vfs.
32710 * Returns: (transfer none): a %NULL-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
32718 * Checks if the VFS is active.
32720 * Returns: %TRUE if construction of the @vfs was successful and it is now active.
32725 * g_vfs_parse_name:
32727 * @parse_name: a string to be parsed by the VFS module.
32729 * This operation never fails, but the returned object might
32730 * not support any I/O operations if the @parse_name cannot
32731 * be parsed by the #GVfs module.
32733 * Returns: (transfer full): a #GFile for the given @parse_name. Free the returned object with g_object_unref().
32738 * g_volume_can_eject:
32739 * @volume: a #GVolume.
32741 * Checks if a volume can be ejected.
32743 * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise.
32748 * g_volume_can_mount:
32749 * @volume: a #GVolume.
32751 * Checks if a volume can be mounted.
32753 * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise.
32759 * @volume: a #GVolume.
32760 * @flags: flags affecting the unmount if required for eject
32761 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32762 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32763 * @user_data: user data that gets passed to @callback
32765 * Ejects a volume. This is an asynchronous operation, and is
32766 * finished by calling g_volume_eject_finish() with the @volume
32767 * and #GAsyncResult returned in the @callback.
32769 * Deprecated: 2.22: Use g_volume_eject_with_operation() instead.
32774 * g_volume_eject_finish:
32775 * @volume: pointer to a #GVolume.
32776 * @result: a #GAsyncResult.
32777 * @error: a #GError location to store an error, or %NULL to ignore
32779 * Finishes ejecting a volume. If any errors occurred during the operation,
32780 * @error will be set to contain the errors and %FALSE will be returned.
32782 * Returns: %TRUE, %FALSE if operation failed.
32783 * Deprecated: 2.22: Use g_volume_eject_with_operation_finish() instead.
32788 * g_volume_eject_with_operation:
32789 * @volume: a #GVolume.
32790 * @flags: flags affecting the unmount if required for eject
32791 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
32792 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32793 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32794 * @user_data: user data passed to @callback.
32796 * Ejects a volume. This is an asynchronous operation, and is
32797 * finished by calling g_volume_eject_with_operation_finish() with the @volume
32798 * and #GAsyncResult data returned in the @callback.
32805 * g_volume_eject_with_operation_finish:
32806 * @volume: a #GVolume.
32807 * @result: a #GAsyncResult.
32808 * @error: a #GError location to store the error occurring, or %NULL to ignore.
32810 * Finishes ejecting a volume. If any errors occurred during the operation,
32811 * @error will be set to contain the errors and %FALSE will be returned.
32813 * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise.
32819 * g_volume_enumerate_identifiers:
32820 * @volume: a #GVolume
32822 * Gets the kinds of <link linkend="volume-identifier">identifiers</link>
32823 * that @volume has. Use g_volume_get_identifier() to obtain
32824 * the identifiers themselves.
32826 * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
32831 * g_volume_get_activation_root:
32832 * @volume: a #GVolume
32834 * Gets the activation root for a #GVolume if it is known ahead of
32835 * mount time. Returns %NULL otherwise. If not %NULL and if @volume
32836 * is mounted, then the result of g_mount_get_root() on the
32837 * #GMount object obtained from g_volume_get_mount() will always
32838 * either be equal or a prefix of what this function returns. In
32839 * other words, in code
32843 * GFile *mount_root
32844 * GFile *volume_activation_root;
32846 * mount = g_volume_get_mount (volume); /* mounted, so never NULL */
32847 * mount_root = g_mount_get_root (mount);
32848 * volume_activation_root = g_volume_get_activation_root(volume); /* assume not NULL */
32849 * </programlisting>
32851 * then the expression
32854 * (g_file_has_prefix (volume_activation_root, mount_root) ||
32855 * g_file_equal (volume_activation_root, mount_root))
32856 * </programlisting>
32858 * will always be %TRUE.
32860 * Activation roots are typically used in #GVolumeMonitor
32861 * implementations to find the underlying mount to shadow, see
32862 * g_mount_is_shadowed() for more details.
32864 * Returns: (transfer full): the activation root of @volume or %NULL. Use g_object_unref() to free.
32870 * g_volume_get_drive:
32871 * @volume: a #GVolume.
32873 * Gets the drive for the @volume.
32875 * 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.
32880 * g_volume_get_icon:
32881 * @volume: a #GVolume.
32883 * Gets the icon for @volume.
32885 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
32890 * g_volume_get_identifier:
32891 * @volume: a #GVolume
32892 * @kind: the kind of identifier to return
32894 * Gets the identifier of the given kind for @volume.
32895 * See the <link linkend="volume-identifier">introduction</link>
32896 * for more information about volume identifiers.
32898 * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GVolume doesn't have this kind of identifier
32903 * g_volume_get_mount:
32904 * @volume: a #GVolume.
32906 * Gets the mount for the @volume.
32908 * 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.
32913 * g_volume_get_name:
32914 * @volume: a #GVolume.
32916 * Gets the name of @volume.
32918 * Returns: the name for the given @volume. The returned string should be freed with g_free() when no longer needed.
32923 * g_volume_get_sort_key:
32924 * @volume: A #GVolume.
32926 * Gets the sort key for @volume, if any.
32928 * Returns: Sorting key for @volume or %NULL if no such key is available.
32934 * g_volume_get_symbolic_icon:
32935 * @volume: a #GVolume.
32937 * Gets the symbolic icon for @volume.
32939 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
32945 * g_volume_get_uuid:
32946 * @volume: a #GVolume.
32948 * Gets the UUID for the @volume. The reference is typically based on
32949 * the file system UUID for the volume in question and should be
32950 * considered an opaque string. Returns %NULL if there is no UUID
32953 * 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.
32958 * g_volume_monitor_adopt_orphan_mount:
32959 * @mount: a #GMount object to find a parent for
32961 * This function should be called by any #GVolumeMonitor
32962 * implementation when a new #GMount object is created that is not
32963 * associated with a #GVolume object. It must be called just before
32964 * emitting the @mount_added signal.
32966 * If the return value is not %NULL, the caller must associate the
32967 * returned #GVolume object with the #GMount. This involves returning
32968 * it in its g_mount_get_volume() implementation. The caller must
32969 * also listen for the "removed" signal on the returned object
32970 * and give up its reference when handling that signal
32972 * Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
32973 * the implementor must take a reference to @mount and return it in
32974 * its g_volume_get_mount() implemented. Also, the implementor must
32975 * listen for the "unmounted" signal on @mount and give up its
32976 * reference upon handling that signal.
32978 * There are two main use cases for this function.
32980 * One is when implementing a user space file system driver that reads
32981 * blocks of a block device that is already represented by the native
32982 * volume monitor (for example a CD Audio file system driver). Such
32983 * a driver will generate its own #GMount object that needs to be
32984 * associated with the #GVolume object that represents the volume.
32986 * The other is for implementing a #GVolumeMonitor whose sole purpose
32987 * is to return #GVolume objects representing entries in the users
32988 * "favorite servers" list or similar.
32990 * Returns: (transfer full): the #GVolume object that is the parent for @mount or %NULL if no wants to adopt the #GMount.
32991 * 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.
32996 * g_volume_monitor_get:
32998 * Gets the volume monitor used by gio.
33000 * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call g_object_unref() when done with it.
33005 * g_volume_monitor_get_connected_drives:
33006 * @volume_monitor: a #GVolumeMonitor.
33008 * Gets a list of drives connected to the system.
33010 * The returned list should be freed with g_list_free(), after
33011 * its elements have been unreffed with g_object_unref().
33013 * Returns: (element-type GDrive) (transfer full): a #GList of connected #GDrive objects.
33018 * g_volume_monitor_get_mount_for_uuid:
33019 * @volume_monitor: a #GVolumeMonitor.
33020 * @uuid: the UUID to look for
33022 * Finds a #GMount object by its UUID (see g_mount_get_uuid())
33024 * Returns: (transfer full): a #GMount or %NULL if no such mount is available. Free the returned object with g_object_unref().
33029 * g_volume_monitor_get_mounts:
33030 * @volume_monitor: a #GVolumeMonitor.
33032 * Gets a list of the mounts on the system.
33034 * The returned list should be freed with g_list_free(), after
33035 * its elements have been unreffed with g_object_unref().
33037 * Returns: (element-type GMount) (transfer full): a #GList of #GMount objects.
33042 * g_volume_monitor_get_volume_for_uuid:
33043 * @volume_monitor: a #GVolumeMonitor.
33044 * @uuid: the UUID to look for
33046 * Finds a #GVolume object by its UUID (see g_volume_get_uuid())
33048 * Returns: (transfer full): a #GVolume or %NULL if no such volume is available. Free the returned object with g_object_unref().
33053 * g_volume_monitor_get_volumes:
33054 * @volume_monitor: a #GVolumeMonitor.
33056 * Gets a list of the volumes on the system.
33058 * The returned list should be freed with g_list_free(), after
33059 * its elements have been unreffed with g_object_unref().
33061 * Returns: (element-type GVolume) (transfer full): a #GList of #GVolume objects.
33067 * @volume: a #GVolume.
33068 * @flags: flags affecting the operation
33069 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
33070 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33071 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33072 * @user_data: user data that gets passed to @callback
33074 * Mounts a volume. This is an asynchronous operation, and is
33075 * finished by calling g_volume_mount_finish() with the @volume
33076 * and #GAsyncResult returned in the @callback.
33078 * Virtual: mount_fn
33083 * g_volume_mount_finish:
33084 * @volume: a #GVolume
33085 * @result: a #GAsyncResult
33086 * @error: a #GError location to store an error, or %NULL to ignore
33088 * Finishes mounting a volume. If any errors occurred during the operation,
33089 * @error will be set to contain the errors and %FALSE will be returned.
33091 * If the mount operation succeeded, g_volume_get_mount() on @volume
33092 * is guaranteed to return the mount right after calling this
33093 * function; there's no need to listen for the 'mount-added' signal on
33096 * Returns: %TRUE, %FALSE if operation failed.
33101 * g_volume_should_automount:
33102 * @volume: a #GVolume
33104 * Returns whether the volume should be automatically mounted.
33106 * Returns: %TRUE if the volume should be automatically mounted.
33111 * g_win32_input_stream_get_close_handle:
33112 * @stream: a #GWin32InputStream
33114 * Returns whether the handle of @stream will be
33115 * closed when the stream is closed.
33117 * Returns: %TRUE if the handle is closed when done
33123 * g_win32_input_stream_get_handle:
33124 * @stream: a #GWin32InputStream
33126 * Return the Windows file handle that the stream reads from.
33128 * Returns: The file handle of @stream
33134 * g_win32_input_stream_new:
33135 * @handle: a Win32 file handle
33136 * @close_handle: %TRUE to close the handle when done
33138 * Creates a new #GWin32InputStream for the given @handle.
33140 * If @close_handle is %TRUE, the handle will be closed
33141 * when the stream is closed.
33143 * Note that "handle" here means a Win32 HANDLE, not a "file descriptor"
33144 * as used in the Windows C libraries.
33146 * Returns: a new #GWin32InputStream
33151 * g_win32_input_stream_set_close_handle:
33152 * @stream: a #GWin32InputStream
33153 * @close_handle: %TRUE to close the handle when done
33155 * Sets whether the handle of @stream shall be closed
33156 * when the stream is closed.
33163 * g_win32_output_stream_get_close_handle:
33164 * @stream: a #GWin32OutputStream
33166 * Returns whether the handle of @stream will be closed when the
33167 * stream is closed.
33169 * Returns: %TRUE if the handle is closed when done
33175 * g_win32_output_stream_get_handle:
33176 * @stream: a #GWin32OutputStream
33178 * Return the Windows handle that the stream writes to.
33180 * Returns: The handle descriptor of @stream
33186 * g_win32_output_stream_new:
33187 * @handle: a Win32 file handle
33188 * @close_handle: %TRUE to close the handle when done
33190 * Creates a new #GWin32OutputStream for the given @handle.
33192 * If @close_handle, is %TRUE, the handle will be closed when the
33193 * output stream is destroyed.
33195 * Returns: a new #GOutputStream
33201 * g_win32_output_stream_set_close_handle:
33202 * @stream: a #GWin32OutputStream
33203 * @close_handle: %TRUE to close the handle when done
33205 * Sets whether the handle of @stream shall be closed when the stream
33213 * g_zlib_compressor_get_file_info:
33214 * @compressor: a #GZlibCompressor
33216 * Returns the #GZlibCompressor:file-info property.
33218 * Returns: (transfer none): a #GFileInfo, or %NULL
33224 * g_zlib_compressor_new:
33225 * @format: The format to use for the compressed data
33226 * @level: compression level (0-9), -1 for default
33228 * Creates a new #GZlibCompressor.
33230 * Returns: a new #GZlibCompressor
33236 * g_zlib_compressor_set_file_info:
33237 * @compressor: a #GZlibCompressor
33238 * @file_info: (allow-none): a #GFileInfo
33240 * Sets @file_info in @compressor. If non-%NULL, and @compressor's
33241 * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
33242 * it will be used to set the file name and modification time in
33243 * the GZIP header of the compressed data.
33245 * Note: it is an error to call this function while a compression is in
33246 * progress; it may only be called immediately after creation of @compressor,
33247 * or after resetting it with g_converter_reset().
33254 * g_zlib_decompressor_get_file_info:
33255 * @decompressor: a #GZlibDecompressor
33257 * Retrieves the #GFileInfo constructed from the GZIP header data
33258 * of compressed data processed by @compressor, or %NULL if @decompressor's
33259 * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
33260 * or the header data was not fully processed yet, or it not present in the
33261 * data stream at all.
33263 * Returns: (transfer none): a #GFileInfo, or %NULL
33269 * g_zlib_decompressor_new:
33270 * @format: The format to use for the compressed data
33272 * Creates a new #GZlibDecompressor.
33274 * Returns: a new #GZlibDecompressor
33280 * get_all_desktop_entries_for_mime_type:
33281 * @mime_type: a mime type.
33282 * @except: NULL or a strv list
33284 * Returns all the desktop ids for @mime_type. The desktop files
33285 * are listed in an order so that default applications are listed before
33286 * non-default ones, and handlers for inherited mimetypes are listed
33287 * after the base ones.
33289 * Optionally doesn't list the desktop ids given in the @except
33291 * Returns: a #GList containing the desktop ids which claim to handle @mime_type.
33296 * mime_info_cache_reload:
33297 * @dir: directory path which needs reloading.
33299 * Reload the mime information for the @dir.
33304 /************************************************************/
33305 /* THIS FILE IS GENERATED DO NOT EDIT */
33306 /************************************************************/